Search completed in 1.87 seconds.
3175 results for "rev":
Your results are loading. Please wait...
PointerEvent.PointerEvent() - Web APIs
the pointerevent() constructor creates a new synthetic and untrusted pointerevent object instance.
... syntax event = new pointerevent(type, pointereventinit); arguments type is a domstring representing the name of the event (see pointerevent event types).
... pointereventinitoptional is a pointereventinit dictionary, having the following fields: pointerid — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.pointerid.
...And 11 more matches
SensorErrorEvent.SensorErrorEvent() - Web APIs
the sensorerrorevent constructor creates a new sensorerrorevent object which provides information about errors thrown by any of the interfaces based on sensor.
... syntax sensorerrorevent = new sensorerrorevent(type, {error: domexception}); parameters type will always be 'sensorerrorevent'.
... specifications specification status comment generic sensor apithe definition of 'sensorerrorevent' in that specification.
Localization technical reviews
this guide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for requesting one and following its progress.
... the technical review process we use for new localizations can be confusing for any trying to start a new localization.
... we use this review process to perform quality assurance (qa) testing on your l10n efforts.
...And 29 more matches
Localization sign-off reviews
this article presents an overview of why we do sign-off reviews of localizations, the details on the criteria used for the sign-off reviews, and the process for requesting a review and for following its progress.
... the sign-off review process has been notoriously shrouded in mystery.
... we use this review process to perform quality assurance (qa) testing on your l10n efforts.
...And 26 more matches
nsITaskbarPreviewController
widget/public/nsitaskbarpreviewcontroller.idlscriptable this interface is used on microsoft windows to provide the behavior of taskbar previews.
... its methods and properties are used by the nsitaskbarpreview interface.
...depending on whether the controller is connected to an nsitaskbartabpreview or nsitaskbarwindowpreview, only certain methods and attributes need to be implemented.
...And 17 more matches
revert - CSS: Cascading Style Sheets
WebCSSrevert
the revert css keyword reverts the cascaded value of the property from its current value to the value the property would have had if no changes had been made by the current style origin to the current element.
... if used by a site's own styles (the author origin), revert rolls back the property's cascaded value to the user's custom style, if one exists; otherwise, it rolls the style back to the user agent's default style.
... if used in a user's custom stylesheet, or if the style was applied by the user (the user origin), revert rolls back the cascaded value to the user agent's default style.
...And 16 more matches
nsITaskbarWindowPreview
widget/public/nsitaskbarwindowpreview.idlscriptable this interface is used on microsoft windows to represent the preview for a window in the taskbar.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsitaskbarpreview last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) you can't directly instantiate this interface; instead, call nsiwintaskbar.gettaskbarwindowpreview() to get the taskbar preview for a specific window.
... window preview behavior by default, windows implements much of the behavior for applications in a standard way.
...And 15 more matches
PointerEvent - Web APIs
the pointerevent interface represents the state of a dom event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc.
... constructors pointerevent() creates a synthetic—and untrusted—pointerevent.
... pointerevent.pointerid read only a unique identifier for the pointer causing the event.
...And 15 more matches
nsITaskbarTabPreview
widget/public/nsitaskbartabpreview.idlscriptable this interface is used on microsoft windows to control tab preview specific behavior.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsitaskbarpreview last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) tab preview support is disabled by default in gecko 1.9.2 creating an nsitaskbartabpreview for a window will automatically hide that window's nsitaskbarwindowpreview; this is done by windows and cannot be prevented.
... when there are no more tab previews left for a window, the window preview is automatically made visible again.
...And 11 more matches
Mailnews and Mail code review requirements
this document describes the process for reviewing patches to the mozilla/mailnews and mozilla/mail directories.
... mailnews and mail review rules patches affecting thunderbird user experience or interfaces note: it is recommended that when working on bugs that affect user experience or interfaces, that ui-review is obtained at an early stage in the patch development process.
... getting early ui-reviews this reduces the chance that work is rejected due to needing further user experience changes, and hence is aimed at saving time for the developer and reviewers.
...And 11 more matches
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
the html abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation.
...the title attribute has a specific semantic meaning when used with the <abbr> element; it must contain a full human-readable description or expansion of the abbreviation.
... usage notes typical use cases it's certainly not required that all abbreviations be marked up using <abbr>.
...And 10 more matches
JS_PreventExtensions
syntax // added in spidermonkey 45 bool js_preventextensions(jscontext *cx, js::handleobject obj, js::objectopresult &result); // obsolete since jsapi 39 bool js_preventextensions(jscontext *cx, js::handleobject obj, bool *succeeded); name type description cx jscontext * the context.
... in javascript this may be accomplished using the object.preventextensions method.
... the similar jsapi method is js_preventextensions.
...And 9 more matches
nsITaskbarPreview
widget/public/nsitaskbarpreview.idlscriptable this interface is used on microsoft windows as a common interface for both window and tab taskbar previews.
...instead, you use nsitaskbartabpreview or nsitaskbarwindowpreview as appropriate.
... method overview void invalidate(); attributes attribute type description active boolean indicates whether or not the preview is marked as active (currently selected) in the taskbar.
...And 9 more matches
Object.preventExtensions() - JavaScript
the object.preventextensions() method prevents new properties from ever being added to an object (i.e.
... prevents future extensions to the object).
... syntax object.preventextensions(obj) parameters obj the object which should be made non-extensible.
...And 8 more matches
ErrorEvent - Web APIs
the errorevent interface represents events providing information related to errors in scripts or in files.
...height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/errorevent" target="_top"><rect x="116" y="1" width="100" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="166" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">errorevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits propert...
... errorevent.message read only is a domstring containing a human-readable error message describing the problem.
...And 7 more matches
Event.preventDefault() - Web APIs
the event interface's preventdefault() method tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
... as noted below, calling preventdefault() for a non-cancelable event, such as one dispatched via eventtarget.dispatchevent(), without specifying cancelable: true has no effect.
... syntax event.preventdefault(); examples blocking default click handling toggling a checkbox is the default action of clicking on a checkbox.
...And 7 more matches
Reflect.preventExtensions() - JavaScript
the static reflect.preventextensions() method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object).
... it is similar to object.preventextensions(), but with some differences.
... syntax reflect.preventextensions(target) parameters target the target object on which to prevent extensions.
...And 7 more matches
Array.prototype.reverse() - JavaScript
the reverse() method reverses an array in place.
... syntax a.reverse() return value the reversed array.
... description the reverse method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array.
...And 6 more matches
Proxy.revocable() - JavaScript
the proxy.revocable() method is used to create a revocable proxy object.
... syntax proxy.revocable(target, handler); parameters target a target object to wrap with proxy.
... return value a newly created revocable proxy object is returned.
...And 6 more matches
RTCIdentityErrorEvent - Web APIs
the rtcidentityerrorevent interface represents an error associated with the identity provider (idp).
... firefox implements this interface under the following name: rtcpeerconnectionidentityerrorevent.
... properties a rtcidentityerrorevent being an event, this event also implements these properties.
...And 5 more matches
handler.preventExtensions() - JavaScript
the handler.preventextensions() method is a trap for object.preventextensions().
... syntax const p = new proxy(target, { preventextensions: function(target) { } }); parameters the following parameter is passed to the preventextensions() method.
... return value the preventextensions() method must return a boolean value.
...And 5 more matches
Node.previousSibling - Web APIs
the node.previoussibling read-only property returns the node immediately preceding the specified one in its parent's childnodes list, or null if the specified node is the first in that list.
... syntax previousnode = node.previoussibling; example <img id="b0"> <img id="b1"> <img id="b2"> console.log(document.getelementbyid("b1").previoussibling); // <img id="b0"> console.log(document.getelementbyid("b2").previoussibling.id); // "b1" notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup.
... therefore a node obtained, for example, using node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get.
...And 4 more matches
::-ms-reveal - Archive of obsolete content
the ::-ms-reveal css pseudo-element is a microsoft extension that is used to display a password reveal button for use with a password field created by <input type="password">.
... the user presses the button to reveal the actual field value rather than asterisks.
... the password reveal button is usually displayed at the edge of the password field.
...And 3 more matches
Reviewer Checklist
this article provides a list of best practices for your patch content that reviewers will check for or require.
... following these best practices will lead to a smoother, more rapid process of review and acceptance.
...commonly this results in "part 0" of a bug, which is "tidy things up to make the fix easier to write and review".
...And 3 more matches
nsITaskbarPreviewButton
widget/public/nsitaskbarpreviewbutton.idlscriptable this interface is used on microsoft windows to get access to a window preview's toolbar button properties.
... these buttons are displayed below the window preview.
...instead, you use the nsitaskbarwindowpreview.getbutton() to get the objects representing the buttons.
...And 3 more matches
SpeechSynthesisErrorEvent - Web APIs
the speechsynthesiserrorevent interface of the web speech api contains information about any errors that occur while processing speechsynthesisutterance objects in the speech service.
... properties speechsynthesiserrorevent extends the speechsynthesisevent interface, which inherits properties from its parent interface, event.
... speechsynthesiserrorevent.error read only returns an error code indicating what has gone wrong with a speech synthesis attempt.
...And 3 more matches
Event.defaultPrevented - Web APIs
the defaultprevented read-only property of the event interface returns a boolean indicating whether or not the call to event.preventdefault() canceled the event.
... note: you should use this instead of the non-standard, deprecated getpreventdefault() method (see bug 691151).
... syntax var defaultwasprevented = event.defaultprevented; value a boolean, where true indicates that the default user agent action was prevented, and false indicates that it was not.
...And 2 more matches
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.previouselementsibling read-only property returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list.
... syntax prevnode = elementnodereference.previouselementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <li>this is a list item</li> <li>this is another list item</li> <div id="div-03">here is div-03</div> <script> let el = document.getelementbyid('div-03').previouselementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example outputs the following into the page when it loads: siblings of div-03 1.
...div polyfills polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can be used to add support to ie8: // source: https://github.com/alhadis/snippets/blob/master/js/polyfills/ie8-child-elements.js if(!("previouselementsibling" in document.documentelement)){ object.defineproperty(element.prototype, "previouselementsibling", { get: function(){ var e = this.previoussibling; while(e && 1 !== e.nodetype) e = e.previoussibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/previouselementsibling/previouselementsibling.md (function (arr) { arr.foreach(function (item) { if (...
...And 2 more matches
RTCErrorEvent - Web APIs
the webrtc api's rtcerrorevent interface represents an error sent to a webrtc object.
... constructor rtcerrorevent() creates and returns a new rtcerrorevent object.
... properties in addition to the standard properties available on the event interface, rtcerrorevent also includes the following: error read only an rtcerror object specifying the error which occurred; this object includes the type of error that occurred, information about where the error occurred (such as which line number in the sdp or what sctp cause code was at issue).
...And 2 more matches
RTCPeerConnectionIceErrorEvent - Web APIs
the rtcpeerconnectioniceerrorevent interface—based upon the event interface—provides details pertaining to an ice error announced by sending an icecandidateerror event to the rtcpeerconnection object.
... constructor rtcpeerconnectioniceerrorevent() creates and returns a new rtcpeerconnectioniceerrorevent object, with its type and other properties initialized as specified in the parameters.
... properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has not yet been exposed as part of a local ice candidate.
...And 2 more matches
SpeechRecognitionErrorEvent - Web APIs
the speechrecognitionerrorevent interface of the web speech api represents error messages from the recognition service.
... properties speechrecognitionerrorevent also inherits properties from its parent interface, event.
... speechrecognitionerrorevent.error read only returns the type of error raised.
...And 2 more matches
Animation.reverse() - Web APIs
WebAPIAnimationreverse
the animation.reverse() method of the animation interface reverses the playback direction, meaning the animation ends at its beginning.
...if called on a paused animation, the animation will continue in reverse.
... syntax animation.reverse(); parameters none.
...it is done by setting alicechange's animation.playbackrate to -1 like so: var shrinkalice = function() { // play alice's animation in reverse alicechange.playbackrate = -1; alicechange.play(); // play the bottle's animation drinking.play() } but it could also have been done by calling reverse() on alicechange like so: var shrinkalice = function() { // play alice's animation in reverse alicechange.reverse(); // play the bottle's animation drinking.play() } specifications specification status comment web animationsthe definition of 'reverse()' ...
compareVersion - Web APIs
compareversion compares the version of a file or package with the version of an existing file or package.
... method of installtrigger object syntax int compareversion ( string registryname, installversion version); int compareversion ( string registryname, string version); int compareversion ( string registryname, int major, int minor, int release, int build); parameters the compareversion method has the following parameters: registryname the pathname in the client version registry for the component whose version is to be compared.
... the following constants can be used to check the value returned by compareversion: int major_diff = 4; int minor_diff = 3; int rel_diff = 2; int bld_diff = 1; int equal = 0; in communicator 4.5, the following constants are defined and available for checking the value returned by compareversion: <code>installtrigger.major_diff installtrigger.minor_diff installtrigger.rel_diff installtrigger.bld_diff installtrigger.equal </code> description the compareversion method...
...if registryname represents a file, compareversion checks for the existence of the file.
NodeIterator.previousNode() - Web APIs
the nodeiterator.previousnode() method returns the previous node in the set represented by the nodeiterator and moves the position of the iterator backwards within the set.
... syntax node = nodeiterator.previousnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node previousnode = nodeiterator.previousnode(); // same result, since we backtracked to the previous node specifications specification status ...
... comment domthe definition of 'nodeiterator.previousnode' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.previousnode' in that specification.
Permissions.revoke() - Web APIs
the permissions.revoke() method of the permissions interface reverts a currently set permission back to its default state, which is usually prompt.
... var revokepromise = navigator.permissions.revoke(descriptor); parameters descriptor an object based on the permissiondescriptor dictionary that sets options for the operation consisting of a comma-separated list of name-value pairs.
... example this function can be used by an app to request that its own geolocation api permission be revoked.
... function revokepermission() { navigator.permissions.revoke({name:'geolocation'}).then(function(result) { report(result.state); }); } ...
PointerEvent.pointerId - Web APIs
the pointerid read-only property of the pointerevent interface is an identifier assigned to a given pointer event.
... syntax var id = pointerevent.pointerid; return value id the pointer event's unique identifier number.
... example the following code snippet compares a previously saved pointerid with the one of the pointerdown event that was just fired.
... let id; // let's assume that this is a previously saved pointerid target.addeventlistener('pointerdown', function(event) { // compare previous event's id that was cached // to current event's id and handle accordingly if (id === event.pointerid) process_event(event); }, false); specifications specification status comment pointer events – level 2the definition of 'pointerid' in that specification.
SensorErrorEvent - Web APIs
the sensorerrorevent interface of the sensor apis provides information about errors thrown by a sensor or related interface.
... constructor sensorerrorevent.sensorerrorevent() creates a new sensorerrorevent object.
... properties sensorerrorevent.error read only returns the domexception object passed in the event's contructor.
... specifications specification status comment generic sensor apithe definition of 'sensorerrorevent' in that specification.
TypedArray.prototype.reverse() - JavaScript
the reverse() method reverses a typed array in place.
...this method has the same algorithm as array.prototype.reverse().
... syntax typedarray.reverse(); return value the reversed array.
... examples using reverse var uint8 = new uint8array([1, 2, 3]); uint8.reverse(); console.log(uint8); // uint8array [3, 2, 1] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.reverse' in that specification.
CredentialsContainer.preventSilentAccess() - Web APIs
the preventsilentaccess() method of the credentialscontainer interface sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty promise.
... syntax var promise = credentialscontainer.preventsilentaccess() parameters none.
... specifications specification status comment credential management level 1the definition of 'preventsilentaccess()' in that specification.
MediaRecorderErrorEvent() - Web APIs
the mediarecordererrorevent() constructor creates a new mediarecordererrorevent object that represents an error that occurred during the recording of media by the mediastream recording api.
... syntax var errorevent = new mediarecordererrorevent(errorinfo) parameters errorinfo an object describing the error object to be created.
... specifications specification status comment mediastream recordingthe definition of 'mediarecordererrorevent()' in that specification.
MediaRecorderErrorEvent.error - Web APIs
the read-only error property in the mediarecordererrorevent interface is a domexception object providing details about the exception that was thrown by a mediarecorder instance.
... syntax error = mediarecordererrorevent.error; value a domexception describing the error represented by the event.
...ecorder; handle that */ } recorder.ondataavailable = function(event) { bufferlist.push(event.data); }; recorder.onerror = function(event) { let error = event.error; }; recorder.start(100); /* 100ms time slices per buffer */ return recorder; } specifications specification status comment mediastream recordingthe definition of 'mediarecordererrorevent.error' in that specification.
MediaRecorderErrorEvent - Web APIs
the mediarecordererrorevent interface represents errors returned by the mediastream recording api.
... constructor mediastreamrecorderevent() creates and returns a new mediarecordererrorevent event object with the given parameters.
... specifications specification status comment mediastream recordingthe definition of 'mediarecordererrorevent' in that specification.
PointerEvent.getCoalescedEvents() - Web APIs
the getcoalescedevents() method of the pointerevent interface returns a sequence of all pointerevent instances that were coalesced into the dispatched pointermove event.
... syntax var pointerevents[] = pointerevent.getcoalescedevents() parameters none.
... returns a sequence of pointerevent instances.
PointerEvent.height - Web APIs
the height read-only property of the pointerevent interface represents the height of the pointer's contact geometry, along the y-axis (in css pixels).
... syntax var contactheight = pointerevent.height; return value contactheight the height of the event's contact area (in css pixels).
... example an example of this property is included in the pointerevent.width example.
PointerEvent.pointerType - Web APIs
the pointertype read-only property of the pointerevent interface indicates the device type (mouse, pen, or touch) that caused a given pointer event.
... syntax var ptype = pointerevent.pointertype; return value ptype the event's pointer type.
...this means that a pointerevent whose pointertype is mouse will be a double.
PointerEvent.width - Web APIs
the width read-only property of the pointerevent interface represents the width of the pointer's contact geometry along the x-axis, measured in css pixels.
... syntax var contactwidth = pointerevent.width; return value contactwidth the width of the event's contact area (in css pixels).
... example this example illustrates using the pointerevent interface's width and height properties to calculate the contact area.
RTCErrorEvent.error - Web APIs
the read-only rtcerrorevent property error contains an rtcerror object describing the details of the error which the event is announcing.
... syntax let errorinfo = rtcerrorevent.error; value an rtcerror object whose properties provide details about the error which has occurred in the context of a webrtc operation.
...you can also use the rtcdatachannel object's onerror event handler property, like this: datachannel.onerror = (event) => { let error = event.error; /* and so forth */ }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcerrorevent.error' in that specification.
RTCPeerConnectionIceErrorEvent.address - Web APIs
the rtcpeerconnectioniceerrorevent property address is a string which indicates the local ip address being used to communicate with the stun or turn server during negotiations.
... syntax let address = rtcpeerconnectioniceerrorevent.address; value a domstring which specifies the local ip address of the network connection to the ice server with which negotiations were occurring when the error occurred.
...c.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.url}`; showmessage(errortext, iceserverinfo, networkinfo); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerrorevent.address' in that specification.
TreeWalker.previousNode() - Web APIs
the treewalker.previousnode() method moves the current node to the previous visible node in the document order, and returns the found node.
... syntax node = treewalker.previousnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.previousnode(); // returns null as there is no parent specifications specification status comment domthe definition of 'treewalker.previousnode' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.previousnode' in that specification.
TreeWalker.previousSibling() - Web APIs
the treewalker.previoussibling() method moves the current node to its previous sibling, if any, and returns the found sibling.
... syntax node = treewalker.previoussibling(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.previoussibling(); // returns null as there is no previous sibiling specifications specification status comment domthe definition of 'treewalker.previoussibling' in that specification.
... living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe definition of 'treewalker.previoussibling' in that specification.
URL.revokeObjectURL() - Web APIs
the url.revokeobjecturl() static method releases an existing object url which was previously created by calling url.createobjecturl().
... syntax url.revokeobjecturl(objecturl) parameters objecturl a domstring representing a object url that was previously created by calling createobjecturl().
... specification specification status comment file apithe definition of 'revokeobjecturl()' in that specification.
ontextrevert - Archive of obsolete content
« xul reference home ontextrevert obsolete since gecko 1.9.1 type: script code note: applies to: thunderbird, seamonkey this event handler is called when the user presses escape to revert the textbox to its original uncompleted value.
... as of gecko 1.9.1, this attribute is superseded by the ontextreverted attribute.
getPreviousItem - Archive of obsolete content
« xul reference home getpreviousitem( startitem, delta ) return type: element this method returns the item a given distance (delta) before the specified startitem, or null if no such item exists.
... this example will return the item five rows before someitem: getpreviousitem ( someitem, 5 ); ...
PL_CompareValues
syntax #include <plhash.h> printn pl_comparevalues(const void *v1, const void *v2); description pl_comparevalues compares the two void * values v1 and v2 numerically, i.e., it returns the value of the expression v1 == v2.
... pl_comparevalues can be used as the comparator function for integer or pointer-valued key or entry value.
PR_PREV_LINK
syntax #include <prclist.h> prclist *pr_prev_link (prclist *elemp); parameter elemp a pointer to the element.
... description pr_prev_link returns a pointer to the element preceding the specified element.
PreviousSibling
« nsiaccessible page summary returns previous node in accessible tree.
... attribute nsiaccessible previoussibling; exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.
PointerEvent.isPrimary - Web APIs
the isprimary read-only property of the pointerevent interface indicates whether or not the pointer device that created the event is the primary pointer.
... syntax var isprimary = pointerevent.isprimary; return value isprimary returns true if the pointer for this event is the primary pointer and returns false otherwise.
PointerEvent.pressure - Web APIs
the pressure read-only property of the pointerevent interface indicates the normalized pressure of the pointer input.
... syntax var pressure = pointerevent.pressure; return value pressure the normalized pressure of the pointer input in the range of 0 to 1, inclusive, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.
PointerEvent.tangentialPressure - Web APIs
the tangentialpressure read-only property of the pointerevent interface represents the normalized tangential pressure of the pointer input (also known as barrel pressure or cylinder stress).
... syntax var tanpressure = pointerevent.tangentialpressure; return value a float representing the normalized tangential pressure of the pointer input in the range -1 to 1, inclusive, where 0 is the neutral position of the control.
PointerEvent.tiltX - Web APIs
the tiltx read-only property of the pointerevent interface is the angle (in degrees) between the y-z plane of the pointer and the screen.
... syntax var tiltx = pointerevent.tiltx; return value tiltx the angle in degrees between the y-z plane of the pointer (stylus) and the screen.
PointerEvent.tiltY - Web APIs
the tilty read-only property of the pointerevent interface is the angle (in degrees) between the x-z plane of the pointer and the screen.
... syntax var tilty = pointerevent.tilty; return value tilty the angle in degrees between the x-z plane of the pointer (stylus) and the screen.
PointerEvent.twist - Web APIs
the twist read-only property of the pointerevent interface represents the clockwise rotation of the pointer (e.g., pen stylus) around its major axis, in degrees.
... syntax var twist = pointerevent.twist; return value a long value representing the amount of twist, in degrees, applied to the transducer (pointer).
RTCIdentityErrorEvent.idp - Web APIs
the read-only property rtcidentityerrorevent.idp returns the domstring describing the domain name of the identity provider (idp) generating the error response event.
... firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent.
RTCIdentityErrorEvent.loginUrl - Web APIs
the read-only property rtcidentityerrorevent.loginurl is a domstring giving the url where the user can complete the authentication.
... firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent.
RTCIdentityErrorEvent.protocol - Web APIs
the read-only property rtcidentityerrorevent.protocol is a domstring describing the idp protocol in use.
... firefox implements the interface of this property under the following name: rtcpeerconnectionidentityerrorevent.
SensorErrorEvent.error - Web APIs
the error read-only property of the sensorerrorevent interface returns the domexception object passed in the event's contructor.
... syntax var domexception = sensorerrorevent.error; value a domexception.
SpeechSynthesisErrorEvent.error - Web APIs
the error property of the speechsynthesiserrorevent interface returns an error code indicating what has gone wrong with a speech synthesis attempt.
... inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onerror = function(event) { console.error('an error has occurred wi...
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
tamarin-central rev 703:2cee46be9ce0 was declared stable on 12/02/08.
findpreviousaccesskey - Archive of obsolete content
« xul reference home findpreviousaccesskey type: string the access key for the "find previous" toolbar button in the findbar.
ontextreverted - Archive of obsolete content
« xul reference home ontextreverted new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the user presses escape to revert the textbox to its original uncompleted value.
onTextReverted - Archive of obsolete content
« xul reference home ontextreverted() return type: event result calls the ontextreverted event handler.
Styling Abbreviations and Acronyms - Archive of obsolete content
many authors are beginning to use the html elements abbr (abbreviation) and acronym in their web pages.
nsIDataSignatureVerifier
security/manager/ssl/public/nsidatasignatureverifier.idlscriptable an interface for verifying that a given string of data was signed by the private key matching the given public key.
SpeechRecognitionErrorEvent.error - Web APIs
the error read-only property of the speechrecognitionerrorevent interface returns the type of error raised.
SpeechRecognitionErrorEvent.message - Web APIs
the message read-only property of the speechrecognitionerrorevent interface returns a message describing the error in more detail.
Index - Web APIs
WebAPIIndex
78 animation.reverse() api, animation, interface, method, reference, web animations, reverse, waapi, web animations api the animation.reverse() method of the animation interface reverses the playback direction, meaning the animation ends at its beginning.
...if called on a paused animation, the animation will continue in reverse.
... 134 audiocontext.resume() api, audio, audiocontext, method, reference, web audio api, resume the resume() method of the audiocontext interface resumes the progression of time in an audio context that has previously been suspended.
...And 158 more matches
Index - Archive of obsolete content
these are the sort of things that super-review should be catching for code that goes into the tree; avoiding these to start with saves super-reviewers a lot of effort.
...this practice is dangerous and will not, in fact, pass an amo review.
... 269 adding menus and submenus add-ons, codingscripting, macs, xul, apple the hello world example in the previous sections shows the two most common ways to add menus.
...And 45 more matches
Index
many (if not most) of the operations performed by nss involve the use of x.509 certificates (often abbreviated as “cert”, unfortunately making it easy to confuse with the term “computer emergency response team“).
...the intention is to make it easier to review code for security.
... the less code that has access to raw secret keys, the less code that must be reviewed.
...And 30 more matches
JavaScript Daemons Management - Archive of obsolete content
1.0 rev.
...*/ daemon.prototype; daemon.context.constructor = object; /* these properties can be manually reconfigured after the creation of the daemon */ daemon.prototype.owner = daemon.context; daemon.prototype.task = null; daemon.prototype.rate = 100; daemon.prototype.length = infinity; daemon.prototype.reversals = 0; daemon.prototype.onstart = null; daemon.prototype.onstop = null; /* these properties should be read-only after the creation of the daemon */ daemon.prototype.session = -1; daemon.prototype.index = 0; daemon.prototype.paused = true; daemon.prototype.backw = true; /* system required daemon global object methods */ daemon.forcecall = function (odmn) { odmn.inde...
...-1 : 1; var bbreak = odmn.task.call(odmn.owner, odmn.index, odmn.length, odmn.backw) === false, bend = odmn.isatend(), binvert = odmn.reversals > 0; if (bend && !binvert || bbreak) { odmn.pause(); return false; } if (bend && binvert) { odmn.backw = !odmn.backw; odmn.reversals--; } return true; }; /* system not required daemon global object methods */ /** * daemon global object optional methods (shortcuts).
...And 26 more matches
sslfnc.html
it uses the ssl version number 3.1, appearing to be a "minor" revision of ssl 3.0.
...two-way simultaneous communication is also known as "full duplex", abbreviated fdx.
... ssl_cipherprefsetdefault enables or disables ssl2 or ssl3 cipher suites (subject to which cipher suites are permitted or disallowed by previous calls to one or more of the ssl export policy functions).
...And 24 more matches
Index
MozillaTechXPCOMIndex
14 introduction to xpcom for the dom developing mozilla warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
... 34 components.utils.evalinsandbox add-ons, developing mozilla, extensions, javascript, xpcom:language bindings, xpconnect the evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.
... 43 components.utils.makeobjectpropsnormal add-ons, developing mozilla, extensions, javascript, needstechnicalreview, xpcom:language bindings, xpconnect ensures that the specified object's methods are all in the object's scope, and aren't cross-component wrappers.
...And 22 more matches
Key Values - Web APIs
scrolls up or displays the previous page of content.
...redoes or repeats a previous action.
...resumes a previously paused application, if applicable.
...And 19 more matches
Anatomy of a video game - Game development
building a better main loop in javascript there are two obvious issues with our previous main loop: main() pollutes the window object (where all global variables are stored) and the example code did not leave us with a way to stop the loop unless the whole tab is closed or refreshed.
...the browser could accidentally * think this whole example continues from the previous line.
... the leading semicolon * marks the beginning of our new line if the previous one was not empty or terminated.
...And 18 more matches
Border-image generator - CSS: Cascading Style Sheets
</div> </div> <div class="separator"></div> <div class="property"> <div class="name">draggable</div> <div class="ui-checkbox" data-topic='drag-subject'></div> </div> <div class="property right"> <div class="name">section height</div> <div class="ui-input-slider" data-topic="preview-area-height" data-min="400" data-max="1000"> </div> </div> </div> <div id="preview_section" class="group section"> <div id="subject"> <div class="guideline" data-axis="y" data-topic="slice-top"></div> <div class="guideline" data-axis="x" data-topic="slice-right"></div> <...
...div class="guideline" data-axis="y" data-topic="slice-bottom"></div> <div class="guideline" data-axis="x" data-topic="slice-left"></div> </div> <div id="preview"> </div> </div> <!-- controls --> <div id="controls" class="group section"> <!-- border-image-slice --> <div id="border-slice-control" class="category"> <div class="title"> border-image-slice </div> <div class="property"> <div class="name">fill</div> <div class="ui-checkbox" data-topic='slice-fill'></div> </div> </div> <!-- border-image-width --> <div id="border-width-control" class="category"> <div class="t...
... </div> </div> <div class="property"> <div class="ui-input-slider" data-topic="font-size" data-info="em size" data-unit="px" data-value="12" data-sensivity="3"> </div> </div> <div class="property"> <div class="ui-input-slider" data-topic="preview-width" data-info="width" data-unit=" px" data-min="10" data-max="10000" data-sensivity="3"></div> </div> <div class="property"> <div class="ui-input-slider" data-topic="preview-height" data-info="height" data-unit=" px" data-min="10" data-max="10000" data-sensivity="3"> </di...
...And 18 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
« previousnext » this document was authored by taiga (gomita) gomibuchi and was originally published in japanese for the firefox developers conference summer 2007.
...the folder can be wherever you want, but for the purposes of this guide, we’ll assume it’s at c:\extensions\helloworld .
...during development, it’s important to minimize the number of steps between revising a source file and running an operations check against those changes.
...And 17 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
found 528 pages: # page tags and summary 1 mdn web docs glossary: definitions of web-related terms beginner, definitions, dictionary, glossary, index, landing, terminology web technologies contain long lists of jargon and abbreviations that are used in documentation and coding.
... this glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web.
... 7 arpa glossary, infrastructure .arpa (address and routing parameter area) is a top-level domain used for internet infrastructure purposes, especially reverse dns lookup (i.e., find the domain name for a given ip address).
...And 16 more matches
Client-side storage - Learn web development
previous overview: client-side web apis modern web browsers support a number of ways for web sites to store data on the user's computer — with the user's permission — then retrieve it when necessary.
... persisting previous site activity (e.g.
... storing the contents of a shopping cart from a previous session, remembering if a user was previously logged in).
...And 15 more matches
nsIDOMEvent
everything marked as gecko 16.0 was previously available in that interface.
... nseventptr getinternalnsevent(); violates the xpcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidel...
... cancelable boolean used to indicate whether or not an event can have its default action prevented.
...And 15 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
lpha"] > input { float: right; } .ui-color-picker .input[data-topic="hexa"] { width: auto; float: right; margin: 6px 8px 0 0; } .ui-color-picker .input[data-topic="hexa"] > .name { display: none; } .ui-color-picker .input[data-topic="hexa"] > input { width: 90px; height: 24px; padding: 2px 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /* preview color */ .ui-color-picker .preview { width: 95px; height: 53px; margin: 5px; margin-top: 10px; border: 1px solid #ddd; background-image: url("images/alpha.png"); float: left; position: relative; } .ui-color-picker .preview:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-index: 1; } .ui-color-picker .preview-color { w...
...component('v', 'value', this.inputchangevalue.bind(this)); this.newinputcomponent('l', 'lightness', this.inputchangelightness.bind(this)); this.createalphaarea(); this.newinputcomponent('r', 'red', this.inputchangered.bind(this)); this.newinputcomponent('g', 'green', this.inputchangegreen.bind(this)); this.newinputcomponent('b', 'blue', this.inputchangeblue.bind(this)); this.createpreviewbox(); this.createchangemodebutton(); this.newinputcomponent('alpha', 'alpha', this.inputchangealpha.bind(this)); this.newinputcomponent('hexa', 'hexa', this.inputchangehexa.bind(this)); this.setcolor(this.color); pickers[topic] = this; } /*************************************************************************/ // function for generating the color-picker /*****************...
... function createalphaarea() { var mask = document.createelement('div'); var picker = document.createelement('div'); mask.classname = 'alpha'; picker.classname = 'slider-picker'; this.alpha_mask = mask; this.alpha_picker = picker; setmousetracking(mask, this.updatealphaslider.bind(this)); mask.appendchild(picker); this.node.appendchild(mask); }; colorpicker.prototype.createpreviewbox = function createpreviewbox(e) { var preview_box = document.createelement('div'); var preview_color = document.createelement('div'); preview_box.classname = 'preview'; preview_color.classname = 'preview-color'; this.preview_color = preview_color; preview_box.appendchild(preview_color); this.node.appendchild(preview_box); }; colorpicker.prototype.newinputcomponent = funct...
...And 15 more matches
Mozilla Development Strategies
but those might be difficult bugs (hard to reproduce crashers, big rewrites for performance, etc.) which can take several days or weeks to complete, plus the time for reviews.
...in theory, fixes for these bugs will be quick to review.
... smaller patches get reviewed faster if you find that you spend a lot of time waiting for reviews, keep in mind that patch size is not linear to time to review.
...And 14 more matches
Handling common accessibility problems - Learn web development
previous overview: cross browser testing next next we turn our attention to accessibility, providing information on common problems, how to do simple testing, and how to make use of auditing/automation tools for finding accessibility issues.
...we've already hinted at some accessibility problems related to javascript, mainly in the area of semantic html — you should always use appropriate semantic html to implement functionality wherever it is available, for example use links and buttons as appropriate.
...if you are inventing them yourself, you need to make sure that they are keyboard accessible; if you are using some kind of third-party framework, carefully review the options available to see how accessible they are before diving in.
...And 13 more matches
Release phase
technical and sign-off reviews you've done some localization work and your ready for it to be released.
...do you know whether to ask for technical review of your work or a sign-off review?
... do you know what what exactly is reviewed in each process?
...And 13 more matches
Using files from web applications - Web APIs
they just stop propagation of the event and prevent the default action from occurring: function dragenter(e) { e.stoppropagation(); e.preventdefault(); } function dragover(e) { e.stoppropagation(); e.preventdefault(); } the real magic happens in the drop() function: function drop(e) { e.stoppropagation(); e.preventdefault(); const dt = e.datatransfer; const files = dt.files; handlefiles(files); } here, we retrieve the...
... example: showing thumbnails of user-selected images let's say you're developing the next great photo-sharing website and want to use html to display thumbnail previews of images before the user actually uploads them.
... you can establish your input element or drop zone as discussed previously and have them call a function such as the handlefiles() function below.
...And 13 more matches
How to Write and Land Nanojit Patches - Archive of obsolete content
but don't push that update, as that should only be done by a member of that public repo.] once it passes testing, file the patch to bugzilla (file a bug under the "nanojit" component in the "core" product) and get a review.
... generally, patches by mozilla people should be reviewed by adobe people and vice versa.
... once it passes review, land it on nanojit-central, mark the bug's whiteboard as fixed-in-nanojit, and note the revision in a comment.
...And 12 more matches
Introducing a complete toolchain - Learn web development
previous overview: understanding client-side tools next in the final couple of articles in the series we will solidify your tooling knowledge by walking you through the process of building up a sample case study toolchain.
... as mentioned previously, github is a source code repository service that adds community features such as issue tracking, following project releases and much more.
...you will probably want to review this part of the toolchain semi-regularly and consider if there's any upgrades or changes you should introduce, but this shouldn't be required too often.
...And 12 more matches
nsIWinTaskbar
by default, there is a single taskbar preview per top level window (excluding pop-ups).
... this preview is represented by an nsitaskbarwindowpreview object.
... an application can register its own "tab" previews.
...And 12 more matches
Using IndexedDB - Web APIs
creating or updating the version of the database when you create a new database or increase the version number of an existing database (by specifying a higher version number than you did previously, when opening a database), the onupgradeneeded event will be triggered and an idbversionchangeevent object will be passed to any onversionchange event handler set up on request.result (i.e., db in the example).
...ded for this version of the database: // this event is only implemented in recent browsers request.onupgradeneeded = function(event) { // save the idbdatabase interface var db = event.target.result; // create an objectstore for this database var objectstore = db.createobjectstore("name", { keypath: "mykey" }); }; in this case, the database will already have the object stores from the previous version of the database, so you do not have to create these object stores again.
... you only need to create any new object stores, or delete object stores from the previous version that are no longer needed.
...And 12 more matches
HTTP caching - HTTP
WebHTTPCaching
the performance of web sites and applications can be significantly improved by reusing previously fetched resources.
...on the other side, it has to be configured properly as not all resources stay identical forever: it is important to cache a resource only until it changes, not longer.
...this page will mostly talk about browser and proxy caches, but there are also gateway caches, cdn, reverse proxy caches and load balancers that are deployed on web servers for better reliability, performance and scaling of web sites and web applications.
...And 12 more matches
HTTP Index - HTTP
WebHTTPIndex
cross-origin resource policy complements cross-origin read blocking (corb), which is a mechanism to prevent some cross-origin reads by default.
... 43 http caching caching, guide, http the performance of web sites and applications can be significantly improved by reusing previously fetched resources.
...such requests can be useful to validate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when resuming a download, or when preventing to lose updates when uploading or modifying a document on the server.
...And 12 more matches
JXON - Archive of obsolete content
t_until>dec 25, 1995</discount_until> <price>42.50</price> <size description="medium"> <color_swatch image="black_cardigan.jpg">black</color_swatch> </size> </catalog_item> </product> <script type="text/javascript"><![cdata[function matchwo(a,b) { if (a < b && a < 0) { return 1; } else { return 0; } }]]></script> </catalog> first, create a dom tree like the previous example as described in the how to create a dom tree article.
...the object.freeze() method prevents new properties from being added to it, prevents existing properties from being removed and prevents existing properties, or their enumerability, configurability, or writability, from being changed.
...the object.freeze() method prevents new properties from being added to it, prevents existing properties from being removed and prevents existing properties, or their enumerability, configurability, or writability, from being changed.
...And 11 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
3 a xul bestiary add-ons, extensions, needstechnicalreview, xul this xulnote presents some of the key concepts and terms in the xul development environment.
... 121 findpreviousaccesskey no summary!
... 250 ontextrevert xul attributes, xul reference no summary!
...And 11 more matches
Accessibility in React - Learn web development
previous overview: client-side javascript frameworks next in our final tutorial article, we'll focus on (pun intended) accessibility, including focus management in react, which can improve usability and reduce confusion for both keyboard-only and screenreader users.
...let's see this in action; put the following useeffect() call just above the return statement in the body of todo(), and pass into it a function that logs the words "side effect" to your console: useeffect(() => { console.log("side effect"); }); to illustrate the difference between the main render process and code run inside useeffect(), add another log – put this one below the previous addition: console.log("main render"); now, open the app in your browser.
...in order to do that, we need to be able to read the previous value of the isediting constant.
...And 11 more matches
Contributing to the Mozilla code base
ront-end) javascript and/or html/css firefox developers documentation devtools javascript and/or html/css contribute to devtools add-ons javascript and/or html/css contribute to add-ons firefox focus for android java contribute to firefox focus for android firefox for fire tv java contribute to firefox for fire tv firefox preview (mobile browser, codename: "fenix") kotlin contribute to firefox preview firefox for ios swift contribute to firefox for ios firefox focus for ios swift contribute to firefox focus for ios mozilla hubs javascript and/or html/css, vr contribute to mozilla hubs servo rust contribute to servo there are even many ways to cont...
...let the bug submitter, reviewer, and component owner know that you'd like to work on the bug.
...here are some further resources to help: ask for help in a comment on the bug, or in #introduction:mozilla.org or #developers:mozilla.org check out https://developer.mozilla.org/docs/developer_guide and its parent document, https://developer.mozilla.org/docs/mozilla our reviewer checklist is very useful, if you have a patch near completion, and seek a favorable review utilize our build tool mach, its linting, static analysis, and other code checking features step 3: get your code reviewed once you fix the bug, you can advance to having your code reviewed.
...And 11 more matches
Index
59 js::ordinarytoprimitive jsapi reference, reference, référence(2), spidermonkey js::ordinarytoprimitive converts a javascript object to a specified type value, by the algorithm specified in es6 draft rev 28 (2014 oct 14) 7.1.1, second algorithm.
...js_destroyruntime garbage collects and frees the memory previously allocated by js_newruntime.
... 264 js_executescript jsapi reference, spidermonkey js_executescript executes a previously-compiled script, script.
...And 11 more matches
Secure Development Guidelines
the following content will likely see significant revision, though can be used as a reference for security best practices to follow when developing code for mozilla.
...is exploitable (in some browsers) with a simple request such as: http://www.victim.com?something=<script>alert('oops')</script> xss: prevention escape all dynamic input that will be sent back to the user html encoding &amp; → & &lt; → < &gt; → > &quot; → " &apos; → ' url encoding % encoding java/vbscript escaping depends on the context; in a single-quoted string, escaping ' would suffice sql injection occurs when un-trusted input is mixed with a sql string sql is a ...
... could itself become an sql instruction and be used to: query data from the database (passwords) insert value into the database (a user account) change application logic based on results returned by the database sql injection: example snprintf(str, sizeof(str), "select * from account where name ='%s'", name); sqlite3_exec(db, str, null, null, null); sql injection: prevention use parameterized queries insert a marker for every piece of dynamic content so data does not get mixed with sql instructions example: sqlite3_stmt *stmt; char *str = "select * from account where name='?'"; sqlite3_prepare_v2(db, str, strlen(str), &stmt, null); sqlite3_bind_text(stmt, 1, name, strlen(name), sqlite_transient); sqlite3_step(stmt); sqlite3_finalize(p_stmt); ...
...And 11 more matches
Touch events - Web APIs
function handlestart(evt) { evt.preventdefault(); console.log("touchstart."); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { console.log("touchstart:" + i + "..."); ongoingtouches.push(copytouch(touches[i])); var color = colorfortouch(touches[i]); ctx.beginpath(); ctx.arc(touches[i].pagex, touches[i...
...].pagey, 4, 0, 2 * math.pi, false); // a circle at the start ctx.fillstyle = color; ctx.fill(); console.log("touchstart:" + i + "."); } } this calls event.preventdefault() to keep the browser from continuing to process the touch event (this also prevents a mouse event from also being delivered).
...its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch.
...And 11 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
nonrepudiation prevents the sender of information from claiming at a later date that the information was never sent.
...certificates help prevent the use of fake public keys for impersonation.
... for example, this might be a typical dn for an employee of example corp: uid=doe,e=doe@example.net,cn=john doe,o=example corp.,c=us the abbreviations before each equal sign in this example have these meanings: uid: user id e: email address cn: the user's common name o: organization c: country dns may include a variety of other name-value pairs.
...And 10 more matches
Overview of Mozilla embedding APIs
being reviewed interface definition: nsiweakreference.idl nsisimpleemunerator this interface provides a simple enumeration abstraction.
...being reviewed interface definition: nsisimpleenumerator.idl nsiservicemanager this interface allows access to global services within mozilla.
...being reviewed interface definition: nsimemory.idl nsidomwindow this interface is used to represent the window containing a specific document.
...And 10 more matches
nsIDOMWindowUtils
ko 9 void sendcompositionevent(in astring atype, in astring adata, in astring alocale); obsolete since gecko 38.0 void sendcontentcommandevent(in astring atype, [optional] in nsitransferable atransferable); void getclassname(in object aobj); boolean sendkeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); obsolete since gecko 15.0 boolean sendkeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in unsigned long aadditionalflags); deprecated since gecko 38.0 void sendmouseevent(in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignorerootscrollframe); ...
...ong aoffset, in unsigned long alength, in long ax, in long ay); obsolete since gecko 31.0 nsiquerycontenteventresult sendquerycontentevent(in unsigned long atype, in unsigned long aoffset, in unsigned long alength, in long ax, in long ay, [optional] in unsigned long aadditionalflags); boolean sendselectionsetevent(in unsigned long aoffset, in unsigned long alength, in boolean areverse); obsolete since gecko 31.0 boolean sendselectionsetevent(in unsigned long aoffset, in unsigned long alength, [optional] in unsigned long aadditionalflags); void sendsimplegestureevent(in astring atype, in float ax, in float ay, in unsigned long adirection, in double adelta, in long amodifiers); void sendtextevent(in astring acompositionstring, in long afirstclau...
... this is used on mobile, for example, to prevent attempts to render content until enough of the page has been loaded to avoid content bouncing around excessively as more content is loaded.
...And 10 more matches
Drag Operations - Web APIs
for example, setting the effectallowed property to copymove allows a copy or move operation but prevents the user from performing a link operation.
... if you want to allow a drop, you must prevent the default handling by cancelling both the dragenter and dragover events.
... you can do this either by returning false from attribute-defined event listeners, or by calling the event's preventdefault() method.
...And 10 more matches
Color picker tool - CSS: Cascading Style Sheets
lpha"] > input { float: right; } .ui-color-picker .input[data-topic="hexa"] { width: auto; float: right; margin: 6px 8px 0 0; } .ui-color-picker .input[data-topic="hexa"] > .name { display: none; } .ui-color-picker .input[data-topic="hexa"] > input { width: 90px; height: 24px; padding: 2px 0; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /* preview color */ .ui-color-picker .preview { width: 95px; height: 53px; margin: 5px; margin-top: 10px; border: 1px solid #ddd; background-image: url("https://mdn.mozillademos.org/files/5705/alpha.png"); float: left; position: relative; } .ui-color-picker .preview:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-index: 1; } .ui...
...-color-picker .preview-color { width: 100%; height: 100%; background-color: rgba(255, 0, 0, 0.5); position: absolute; z-index: 1; } .ui-color-picker .switch_mode { width: 10px; height: 20px; position: relative; border-radius: 5px 0 0 5px; border: 1px solid #ddd; background-color: #eee; left: -12px; top: -1px; z-index: 1; transition: all 0.5s; } .ui-color-picker .switch_mode:hover { background-color: #ccc; cursor: pointer; } /* * ui component */ .ui-input-slider { height: 20px; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-user-select: none; user-select: none; } .ui-input-slider * { float: left; height: 100%; line-height: 100%; } /* input slider */ .ui-input-slider > input { margin: 0; padding: 0; width: 50px; text-align: center; -moz-box-si...
...ck { display: table; } /** * container */ #container { width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; display: table; } /** * picker zone */ #picker { padding: 10px; width: 980px; } .ui-color-picker { padding: 3px 5px; float: left; border-color: #fff; } .ui-color-picker .switch_mode { display: none; } .ui-color-picker .preview-color:hover { cursor: move; } /** * picker container */ #picker-samples { width: 375px; height: 114px; max-height: 218px; margin: 0 10px 0 30px; overflow: hidden; position: relative; float: left; transition: all 0.2s; } #picker-samples .sample { width: 40px; height: 40px; margin: 5px; border: 1px solid #ddd; position: absolute; float: left; transition: all 0.2s; } #picke...
...And 10 more matches
Event reference
afterprint event html5 the associated document has started printing or the print preview has been closed.
... beforeprint event html5 the associated document is about to be printed or previewed for printing.
... error speechsynthesiserrorevent web speech api an error occurs that prevents the utterance from being successfully spoken.
...And 10 more matches
Cache-Control - HTTP
cache-control: must-revalidate cache-control: no-cache cache-control: no-store cache-control: no-transform cache-control: public cache-control: private cache-control: proxy-revalidate cache-control: max-age=<seconds> cache-control: s-maxage=<seconds> extension cache-control directives extension cache-control directives are not part of the core http caching standards document.
... cache-control: immutable cache-control: stale-while-revalidate=<seconds> cache-control: stale-if-error=<seconds> directives cacheability a response is normally cached by the browser if: it has a status code of 301, 302, 307, 308, or 410 and cache-control does not have no-store, or if proxy, does not have private and authorization is unset either has a status code of 301, 302, 307, 308, or 410 or has public, max-age or s-maxage in cache-control or has expires set public the response may be stored by any cache, even if the response is normally non-cacheable.
...this directive is not effective in preventing caches from storing your response.
...And 10 more matches
HTTP headers - HTTP
WebHTTPHeaders
if viewport-width occurs in a message more than once, the last value overrides all previous occurrences.
...if width occurs in a message more than once, the last value overrides all previous occurrences conditionals last-modified the last modification date of the resource, used to compare several versions of the same resource.
...this is used to update caches (for safe requests), or to prevent to upload a new resource when one already exists.
...And 10 more matches
Developing New Mozilla Features - Archive of obsolete content
become familiar with our code review processes.
...reviewing the tree only at the milestone releases is risky if you're doing significant development.
... try hard to design your feature so that it can be implemented and reviewed in manageable size patches if you can implement and submit core elements first and build on them in subsequent patches, so much the better.
...And 9 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 purpose of billing and payment of revenues.
...let's start with the global variables: let contentbox; let nextarticleid = 1; let visibleads = new set(); let previouslyvisibleads = null; let adobserver; let refreshintervalid = 0; these are used as follows: contentbox a reference to the <main> element's htmlelement object in the dom.
... previouslyvisibleads used to temporarily store the list of visible ads while the document is not visible (for example, if the user has tabbed to another page).
...And 9 more matches
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
the string is prefixed with c:\fakepath\, to prevent malicious software from guessing the user's file structure.
... note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input.
... let's look at a more complete example: <form method="post" enctype="multipart/form-data"> <div> <label for="profile_pic">choose file to upload</label> <input type="file" id="profile_pic" name="profile_pic" accept=".jpg, .jpeg, .png"> </div> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces a similar-looking output to the previous example: note: you can find this example on github too — see the source code, and also see it running live.
...And 9 more matches
Client-side form validation - Learn web development
previous overview: forms next before submitting data to the server, it is important to ensure all required form controls are filled out, in the correct format.
...even if your form is validating correctly and preventing malformed input on the client-side, a malicious user can still alter the network request.
... note: there are several errors that will prevent the form from being submitted, including a badinput, patternmismatch, rangeoverflow or rangeunderflow, stepmismatch, toolong or tooshort, typemismatch, valuemissing, or a customerror.
...And 8 more matches
Graceful asynchronous programming with Promises - Learn web development
previous overview: asynchronous next promises are a comparatively new feature of the javascript language that allow you to defer further actions until after a previous action has completed, or respond to its failure.
...there are certain steps that you have to take for your order to be successful, which doesn't really make sense to try to execute out of order, or in order but before each previous step has quite finished: you choose what toppings you want.
...{ return collectorder(order); }) .then(function(pizza) { eatpizza(pizza); }) .catch(failurecallback); this is much better — it is easier to see what is going on, we only need a single .catch() block to handle all the errors, it doesn't block the main thread (so we can keep playing video games while we wait for the pizza to be ready to collect), and each operation is guaranteed to wait for previous operations to complete before running.
...And 8 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
previous overview: asynchronous next this tutorial looks at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g.
... for example, you could refactor the previous function so that it will say hi to whatever person's name is passed to it: function sayhi(who) { alert(`hello ${who}!`); } now, you can pass the name of the person into the settimeout() call as a third parameter: let mygreeting = settimeout(sayhi, 2000, 'mr.
... clearing intervals setinterval() keeps running a task forever, unless you do something about it.
...And 8 more matches
Fetching data from the server - Learn web development
previous overview: client-side web apis next another very common task in modern websites and applications is retrieving individual data items from the server to update sections of a webpage without having to load an entire new page.
... xmlhttprequest xmlhttprequest (which is frequently abbreviated to xhr) is a fairly old technology now — it was invented by microsoft in the late '90s, and has been standardized across browsers for quite a long time.
...first of all, put the following beneath your previous code block — this is the empty shell of the function.
...And 8 more matches
A first splash into JavaScript - Learn web development
previous overview: first steps next now you've learned something about the theory of javascript, and what you can do with it, we are going to give you a crash course in the basic features of javascript via a completely practical tutorial.
...in subsequent articles, you'll revisit all these features in a lot more detail!
... with that in mind, let's look at the example we'll be building up in this article, and review the general process of dissecting it into tangible tasks.
...And 8 more matches
NSS Tools crlutil
using the certificate revocation list management tool newsgroup: mozilla.dev.tech.crypto the certificate revocation list (crl) management tool is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl.
... the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation.
... this document discusses certificate revocation list management.
...And 8 more matches
Web Replay
step back when paused, the reverse step button in the debugger developer tool will step to the previous line executed and allow inspecting program state there.
... the tab will pause at this point and allow state to be inspected, forward/reverse stepping, and so forth.
... the rewind infrastructure allows a replaying process to restore a previous state, while still maintaining communication with the chrome process.
...And 8 more matches
EventTarget.addEventListener() - Web APIs
passive a boolean that, if true, indicates that the function specified by listener will never call preventdefault().
... if a passive listener does call preventdefault(), the user agent will do nothing other than generate a console warning.
... example of options usage html <div class="outer"> outer, once & none-once <div class="middle" target="_blank"> middle, capture & none-capture <a class="inner1" href="https://www.mozilla.org" target="_blank"> inner1, passive & preventdefault(which is not allowed) </a> <a class="inner2" href="https://developer.mozilla.org/" target="_blank"> inner2, none-passive & preventdefault(not open new page) </a> </div> </div> css .outer, .middle, .inner1, .inner2 { display: block; width: 520px; padding: 15px; margin: 15px; text-decoration: none; } .outer { border: 1px solid red; color: red; } .m...
...And 8 more matches
WebGL model view projection - Web APIs
homogeneous coordinates the main line of the previous clip space vertex shader contained this code: gl_position = vec4(position, 1.0); the position variable was defined in the draw() method and passed in as an attribute to the shader.
... function cartesiantohomogeneous(point) let x = point[0]; let y = point[1]; let z = point[2]; return [x, y, z, 1]; } function homogeneoustocartesian(point) { let x = point[0]; let y = point[1]; let z = point[2]; let w = point[3]; return [x/w, y/w, z/w]; } as previously mentioned and shown in the functions above, the w component divides the x, y, and z components.
... to start playing with this idea the previous example can be modified to allow for the use of the w component.
...And 8 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
a typical implementation of autocomplete simply recalls previous values entered in the same input field, but more complex forms of autocomplete can exist.
...by default, browsers prevent users from entering more characters than allowed by the maxlength attribute.
...if the min attribute is valid and a non-empty value is less than the minimum allowed by the min attribute, constraint validation will prevent form submission.
...And 8 more matches
Link types - HTML: Hypertext Markup Language
although recognized, the rev attribute on <a>, <area> or<link> elements with a link type of made is incorrect and should be replaced by the rel attribute with this link type.
... <a>, <area> <link>, <form> canonical from wikipedia, the free encyclopedia: canonical_link_element a canonical link element is an html element that helps webmasters prevent duplicate content issues by specifying the "canonical" or "preferred" version of a web page as part of search engine optimization.
... note: other link types related to linking resources in the same sequence are last, prev, next.
...And 8 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
however, using this method prevents some javascript engine and minifier optimizations being applied.
... a.reverse() reverses the array.
... it is important to note that wherever the rest parameter operator is placed in a function declaration it will store all arguments after its declaration, but not before.
...And 8 more matches
JSON.parse() - JavaScript
an optional reviver function can be provided to perform a transformation on the resulting object before it is returned.
... syntax json.parse(text[, reviver]) parameters text the string to parse as json.
... reviver optional if a function, this prescribes how the value originally produced by parsing is transformed, before being returned.
...And 8 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
range of uses restricted to author unrestricted book print, publish, revise read music record, perform, revise listen movie distribute, screen, revise watch software copy, distribute, modify execute licenses are a use permit in order to use (in the authorial sense) a copyrighted work, the user must either receive a use permit from the copyright holder, or must be assigned partial rights by the author.
...and essential freedoms, such as reverse-engineering, are also restricted.
...the “no discrimination may be made based on field of endeavor” rule means that you cannot prevent it from being used in warfare.
...And 7 more matches
Building accessible custom components in XUL - Archive of obsolete content
/column> <column flex="1"> <description value="expense"/> <label value="conference fee" flex="1"/> <label value="lodging" flex="1"/> <label value="dinner" flex="1"/> <label value="lodging" flex="1"/> <label value="breakfast" flex="1"/> <label value="lunch" flex="1"/> <label value="dinner" flex="1"/> </column> <-- several columns omitted for brevity --> </columns> </grid> </code> now we can use css to add some minimal styling to make it actually look like a spreadsheet.
...lodging" flex="1"/> <label x2:role="wairole:gridcell" value="dinner" flex="1"/> <label x2:role="wairole:gridcell" value="lodging" flex="1"/> <label x2:role="wairole:gridcell" value="breakfast" flex="1"/> <label x2:role="wairole:gridcell" value="lunch" flex="1"/> <label x2:role="wairole:gridcell" value="dinner" flex="1"/> </column> <-- several columns omitted for brevity --> </columns> </grid> </code> the resulting spreadsheet looks exactly the same visually, but the difference to an assistive technology is enormous.
... each label, which was previously exposed as a text label, is now exposed as a cell.
...And 7 more matches
More Event Handlers - Archive of obsolete content
« previousnext » in this section, the event object is examined and additional events are described.
...prevent default action if no event handlers have been registered for an event, then after completing the capturing and bubbling phases, the element will handle the event in a default way.
...if the default action is prevented, the popup will not be displayed.
...And 7 more matches
XBL Example - Archive of obsolete content
« previousnext » this section will describe an example xbl element.
...along the bottom, we'll need a button to go the previous page, a label to display the current page number, and a button to go to the next page.
... example 1 : source <binding id="slideshow"> <content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selectedindex" selectedindex="0" flex="1"> <children/> </xul:deck> <xul:hbox> <xul:button xbl:inherits="label=previoustext"/> <xul:label flex="1"/> <xul:button xbl:inherits="label=nexttext"/> </xul:hbox> </xul:vbox> </content> </binding> this binding creates the slideshow structure that we want.
...And 7 more matches
source-editor.jsm
method overview initialization and destruction void destroy(); void init(element aelement, object aconfig, function acallback); search operations number find(string astring, [optional] object options); number findnext(boolean awrap); number findprevious(boolean awrap); event management void addeventlistener(string aeventtype, function acallback); void removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(...
... lastfind object an object describing the result of the last find operation performed using the find(), findnext(), or findprevious() method.
... lastfound number the index of the previous location at which str was found, for multiple find operations (such as find() followed by findnext()).
...And 7 more matches
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
synopsis crlutil [options] arguments description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl.
... the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation.
... this document discusses certificate revocation list management.
...And 7 more matches
Event - Web APIs
WebAPIEvent
animationevent audioprocessingevent beforeinputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent devicelightevent devicemotionevent deviceorientationevent deviceproximityevent domtransactionevent dragevent editingbeforeinputevent errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent inputevent keyboardevent mediastreamevent messageevent mouseevent mutationevent offlineaudiocompletionevent overconstrainederror pagetransitionevent paymentrequestupdateevent pointerevent popstateevent progressevent relatedevent rtcdatachannelevent rtcidentityerrorevent rtcidentityevent rtcpeerconne...
...ctioniceevent sensorevent storageevent svgevent svgzoomevent timeevent touchevent trackevent transitionevent uievent userproximityevent webglcontextevent wheelevent constructor event() creates an event object, returning it to the caller.
...setting its value to true before returning from an event handler prevents propagation of the event.
...And 7 more matches
Using the Permissions API - Web APIs
this object will eventually include methods for querying, requesting, and revoking permissions, although currently it only contains permissions.query(); see below.
...the geolocation.getcurrentposition() function is then run, which prompts the user for permission; it runs the revealposition() function if permission is granted (which shows the map), or the positiondenied() function if permission is denied (which makes the "enable geolocation" button appear).
... "denied" the "enable geolocation" button is revealed (this code needs to be here too, in case the permission state is already set to denied for this origin when the page is first loaded).
...And 7 more matches
Using Pointer Events - Web APIs
create a canvas the touch-action property is set to none to prevent the browser from applying its default touch behavior to the application.
...its responsibility in this example is to update the cached touch information and to draw a line from the previous position to the current position of each touch.
...ientx + ", " + evt.clienty + ");"); ctx.lineto(evt.clientx, evt.clienty); ctx.linewidth = 4; ctx.strokestyle = color; ctx.stroke(); ongoingtouches.splice(idx, 1, copytouch(evt)); // swap in the new touch record log("."); } else { log("can't figure out which touch to continue: idx = " + idx); } } this function looks in our cached touch information array for the previous information about each touch to determine the starting point for each touch's new line segment to be drawn.
...And 7 more matches
Window.open() - Web APIs
WebAPIWindowopen
firefox (50.0.1) functions as described: from the same domain+port reopen with same name will access the previously created window.
...firefox (51.) gets the handle but cannot run any element.focus() while chrome can run focus() from opener to child but not between siblings nor, reverse, from child to opener.
... tip: note that in some browsers, users can override the windowfeatures settings and enable (or prevent the disabling of) features position and size features windowfeatures parameter can specify the position and size of the new window.
...And 7 more matches
Border-radius generator - CSS: Cascading Style Sheets
border-radius html content <div id="container"> <div class="group section"> <div id="preview" class="col span_12"> <div id="subject"> <div id="top-left" class="radius-container" data-x="left" data-y="top"> </div> <div id="top-right" class="radius-container" data-x="right" data-y="top"> </div> <div id="bottom-right" class="radius-container" data-x="right" data-y="bottom"> </div> <div id="bottom-left" class="radius-container" data-x="left" data-y="bottom"> </div> <div id="radiu...
...order-box; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } #container { width: 100%; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /******************************************************************************/ /******************************************************************************/ /* * preview area */ #preview { height: 500px; border: 1px solid #ccc; border-radius: 3px; text-align: center; overflow: hidden; position: relative; } #preview .content { width: 100%; height: 100%; display: block; } #preview input { color: #333; border: 1px solid #ccc; border-radius: 3px; } #subject { width: 400px; height: 150px; margin: 0 auto; border: 3px solid #c60; background: #ff...
...{ top: 0; right: 0; } #top-right .radius { border-top-right-radius: 100%; top: 0; right: 0; } /* bottom right */ #bottom-right { bottom: 0; right: 0; } #bottom-right .radius { border-bottom-right-radius: 100%; bottom: 0; right: 0; } /* bottom left */ #bottom-left { bottom: 0; left: 0; } #bottom-left .radius { border-bottom-left-radius: 100%; bottom: 0; } /* input sliders */ #preview .ui-input-slider { margin: 10px; position: absolute; z-index: 10; } #radius-ui-sliders { width: 100%; height: 100%; min-height: 75px; min-width: 150px; padding: 20px 50px; top: -20px; left: -50px; position: relative; } #tlr { top: -30px; left: -50px; display: none; } #tlw { top: -30px; left: 30px; } #tlh { top: 20px; left: -50px; } #trr { top: -30px; right: -50px; dis...
...And 7 more matches
Box-shadow generator - CSS: Cascading Style Sheets
iner"> <div class="group section"> <div id="layer_manager"> <div class="group section"> <div class="button" data-type="add"> </div> <div class="button" data-type="move-up"> </div> <div class="button" data-type="move-down"> </div> </div> <div id="stack_container"></div> </div> <div id="preview_zone"> <div id="layer_menu" class="col span_12"> <div class="button" id="element" data-type="subject" data-title="element"> element </div> <div class="button" id="before" data-type="subject" data-title=":before"> :before <span class="delete" data-type="disable"></span> </div> <di...
...s="button" id="after" data-type="subject" data-title=":after"> :after <span class="delete" data-type="disable"></span> </div> <div class="ui-checkbox" data-topic='before' data-label=":before"></div> <div class="ui-checkbox" data-topic='after' data-label=":after"></div> </div> <div id="preview"> <div id="obj-element"> <div class="content"> </div> <div id="obj-before"> </div> <div id="obj-after"> </div> </div> </div> </div> </div> <div id="controls" class="group section"> <div class="wrap-left"> <div class="colorpicker category"> ...
...iv> <div class="info"> <div class="input" data-topic="r" data-title='r:' data-action="rgb"></div> <div class="input" data-topic="g" data-title='g:' data-action="rgb"></div> <div class="input" data-topic="b" data-title='b:' data-action="rgb"></div> </div> <div class="preview block"> <div id="output_color"> </div> </div> <div class="block info"> <div class="input" data-topic="a" data-title='alpha:' data-action="alpha"></div> <div class="input" data-topic="hexa" data-title='' data-action="hexa"></div> </div> </div> ...
...And 7 more matches
Ordering Flex Items - CSS: Cascading Style Sheets
reverse the display of the items the flex-direction property can take one of four values: row column row-reverse column-reverse the first two values ​​keep the items in the same order that they appear in the document source order and display them sequentially from the start line.
... the second two values ​​reverse the items by switching the start and end lines.
...the row-related examples above demonstrate how row and row-reverse work in a left-to-right language such as english.
...And 7 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
that prefcalls.js is now archive in omni.jar file located at the root of the mozilla apps installation, example of tb5: # jar -tvf /usr/lib/thunderbird/omni.jar | grep prefcalls.js 7499 sat nov 05 09:21:34 cet 2011 defaults/autoconfig/prefcalls.js traditionally (previous apps versions) is was in mozilla_home/default/autoconfig/prefcalls.js.
...// pref("general.config.obscure_value", 0); // for mcd .cfg files pref('general.config.filename', 'thunderbird.cfg'); // for mcd .cfg files it used to be in previous releases (up until 7.0) in /usr/lib/thunderbird-x.0/default/pref/autoconf.js the first pref just tells us that we won't encode the file (no more rotary 13 or 7 cf below), the second pref is the name of the file to be read: /usr/lib/thunderbird/thunderbird.cfg.
...to process ldap results before we make the call function processldapvalues(queryresults) { if( queryresults ) { // build the userinfo object for later use for( var attr in ldapattrs ) { userinfo[ ldapattrs[attr] ] = getldapvalue( queryresults, ldapattrs[attr] ); } } else { throw( "no ldap results" ); } } // call upon ldap for the values in ldapattrs array, // uses the previous processldapvalues() getldapattributes( ldaphost, ldapbase, ldapfilter, ldapattrs.join(",") ); // create account // see also http://blog.deanandadie.net/2010/06/easy-thunderbird-account-management-using-mcd/ // identity defaultpref("mail.identity.id1.fullname", userinfo.cn ); defaultpref("mail.identity.id1.smtpserver", "smtp1" ); defaultpref("mail.identity.id1.useremail", userinfo.mail ); //...
...And 6 more matches
Getting Started - Archive of obsolete content
remember if at any point you wish to revert back to the original code again, just extract this jar over top of what you've modified.
...skin info when switching skins in mozilla, it displays a preview image and some information about the theme.
...place it in \myskin and call it preview.png (if it's a jpg or gif call it preview.jpg or preview.gif).
...And 6 more matches
XUL Events - Archive of obsolete content
any previously attached listeners are disconnected.
...the default action of the event can be prevented to prevent the popup to appear.popupshownthe popupshown event is executed when a <menupopup>, <panel> or <tooltip> has become visible.radiostatechangethe radiostatechange event is executed when the state of a <radio> element has changed.valuechangethe valuechange event is executed when the value of an element, <progress> for example, has changed.
...the focus can be changed by clicking on another element, by pressing tab to switch to the next element in the tab order sequence, or by pressing 'back tab' to switch focus to the previous element in the tab order.
...And 6 more matches
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 purpose at all times.
... you can jump to the next/previous heading in many screen readers.
... expand abbreviations — instead of writing jan, write january.
...And 6 more matches
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 purpose at all times.
... you can jump to the next/previous heading in many screen readers.
... expand abbreviations — instead of writing jan, write january.
...And 6 more matches
HTML text fundamentals - Learn web development
previous overview: introduction to html next one of html's main jobs is to give text structure and meaning (also known as semantics) so that a browser can display it correctly.
...statistician and my name is trish.</p>\n<p>my legs are made of cardboard and i am married to a fish.</p>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caret...
... semantics are relied on everywhere around us—we rely on previous experience to tell us what the function of an everyday object is; when we see something, we know what its function will be.
...And 6 more matches
From object to iframe — other embedding technologies - Learn web development
previous overview: multimedia and embedding next by now you should really be getting the hang of embedding things into your web pages, including images, video and audio.
... prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html) and the previous articles in this module.
...k!4v1518171785211" width="600" height="450" frameborder="0" style="border:0" allowfullscreen>\n</iframe>'; let solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back;...
...And 6 more matches
Introducing asynchronous JavaScript - Learn web development
previous overview: asynchronous next in this article we briefly recap the problems associated with synchronous javascript, and take a first look at some of the different asynchronous techniques you'll encounter, showing how they can help us solve such problems.
...this section recaps some of the information we saw in the previous article.
... a lot of the functionality we have looked at in previous learning area modules is synchronous — you run some code, and the result is returned as soon as the browser can do so.
...And 6 more matches
Introduction to events - Learn web development
previous overview: building blocks next events are actions or occurrences that happen in the system you are programming, which the system tells you about so you can respond to them in some way if desired.
...in this section, we review the various mechanisms and discuss which ones you should use.
...first, there is a counterpart function, removeeventlistener(), which removes a previously added listener.
...And 6 more matches
Third-party APIs - Learn web development
previous overview: client-side web apis next the apis we've covered so far are built into the browser, but not all apis are.
...the easiest action would be to just revoke their api privileges.
...'; replace the existing api key with the actual api key you got in the previous section.
...And 6 more matches
Website security - Learn web development
previous overview: first steps website security requires vigilance in all aspects of website design and usage.
... the purpose of website security is to prevent these (or any) sorts of attacks.
... select * from users where name = 'a';drop table users; select * from userinfo where 't' = 't'; the modified statement creates a valid sql statement that deletes the users table and selects all data from the userinfo table (which reveals the information of every user).
...And 6 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
previous overview: client-side javascript frameworks next we now have sample data in place, and a loop that takes each bit of data and renders it inside a todoitem in our app.
...go back to app.vue and add the following import statement just below the previous one, inside your <script> element: import todoform from './components/todoform'; you also need to register the new component in your app component — update the components property of the component object so that it looks like this: components: { todoitem, todoform } finally for this section, render your todoform component inside your app by adding the <to-do-form /> el...
...to prevent the browser from posting to the server, we need to stop the event’s default action from bubbling up through the page (event.preventdefault(), in vanilla javascript).
...And 6 more matches
HTTP Cache
this can only be engaged for resumable responses that (bug 960902) don't need revalidation.
... the consumer then indicates the cache entry needs to be revalidated by returning entry_needs_revalidation from oncacheentrycheck.
... lifetime of an existing entry that doesn't pass server revalidation such a cache entry is first examined in the nsicacheentryopencallback.oncacheentrycheck callback, where the consumer finds out it must be revalidated with the server before use.
...And 6 more matches
Localizing with Koala
revision: leave empty.
...3099 changesets with 158636 changes to 50664 files (+9 heads) updating working directory 40357 files updated, 0 files merged, 0 files removed, 0 files unresolved configure the locale locale id: x-testing (put your locale's code) version: 3.6 location: choose the folder where you want to keep the localized files or leave empty for now check "mercurial" if you wish to use mercurial to keep the revision history of your files (very recommended) existing localizations: url: if you're editing an existing localization or you already have a repository set up (either on hg.mozilla.org or bitbucket), type the url of the remote repository, e.g.
...revision: leave empty.
...And 6 more matches
NSS tools : crlutil
please contribute to the initial review in mozilla nss bug 836477[1] description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl.
... the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see certutil tool) and continues with certificates expiration or revocation.
... this document discusses certificate revocation list management.
...And 6 more matches
nsISessionStore
ean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session.
... return value the string value that was previously assigned to akey using nsisessionstore.settabvalue(), or an empty string if no value is set for that key.
... if the previously saved value was originally a complex data (ie a javascript object) it can then be deserialized using json.parse cf.
...And 6 more matches
Debugger.Object - Firefox Developer Tools
isproxy if the referent is a (scripted) proxy, either revoked or not, return true.
... proxytarget if the referent is a non-revoked (scripted) proxy, return a debugger.object instance referring to the ecmascript [[proxytarget]] of the referent.
... if the referent is a revoked (scripted) proxy, return null.
...And 6 more matches
Debugger.Object - Firefox Developer Tools
setproperty(name,value) storevalue as the value of the referent's property namedname, creating the property if it does not exist.name must be a string;value must be a debuggee value.
... seal() prevent properties from being added to or deleted from the referent.
...(this function behaves like the standard object.seal function, except that the object to be sealed is implicit and in a different compartment from the caller.) freeze() prevent properties from being added to or deleted from the referent, and mark each property as non-writable.
...And 6 more matches
Recording a media element - Web APIs
<div class="left"> <div id="startbutton" class="button"> start </div> <h2>preview</h2> <video id="preview" width="160" height="120" autoplay muted></video> </div> we present our main interface in two columns.
... on the left is a start button and a <video> element which displays the video preview; this is the video the user's camera sees.
... let preview = document.getelementbyid("preview"); let recording = document.getelementbyid("recording"); let startbutton = document.getelementbyid("startbutton"); let stopbutton = document.getelementbyid("stopbutton"); let downloadbutton = document.getelementbyid("downloadbutton"); let logelement = document.getelementbyid("log"); let recordingtimems = 5000; most of these are references to elements we ne...
...And 6 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
this was due to a small number of issues with the api and some potential race conditions that needed to be prevented.
... perfect negotiation works by assigning each of the two peers a role to play in the negotiation process that's entirely separate from the webrtc connection state: a polite peer, which uses ice rollback to prevent collisions with incoming offers.
...on(); signaler.send({ description: pc.localdescription }); } catch(err) { console.error(err); } finally { makingoffer = false; } }; we set makingoffer immediately before calling setlocaldescription() in order to lock against interfering with sending this offer, and we don't clear it back to false until the offer has been sent to the signaling server (or an error has occurred, preventing the offer from being made).
...And 6 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
the main axis the main axis is defined by flex-direction, which has four possible values: row row-reverse column column-reverse should you choose row or row-reverse, your main axis will run along the row in the inline direction.
... choose column or column-reverse and your main axis will run from the top of the page to the bottom — in the block direction.
... the cross axis the cross axis runs perpendicular to the main axis, therefore if your flex-direction (main axis) is set to row or row-reverse the cross axis runs down the columns.
...And 6 more matches
flex-direction - CSS: Cascading Style Sheets
the flex-direction css property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed).
... note that the values row and row-reverse are affected by the directionality of the flex container.
... if its dir attribute is ltr, row represents the horizontal axis oriented from the left to the right, and row-reverse from the right to the left; if the dir attribute is rtl, row represents the axis oriented from the right to the left, and row-reverse from the left to the right.
...And 6 more matches
Index - HTTP
WebHTTPHeadersIndex
30 csp: block-all-mixed-content csp, directive, http, mixed content, reference, security the http content-security-policy (csp) block-all-mixed-content directive prevents loading any assets using http when the page is loaded using https.
...it applies restrictions to a page's actions including preventing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy.
... 54 cookie cookies, http, reference, header, request the cookie http request header contains stored http cookies previously sent by the server with the set-cookie header.
...And 6 more matches
Special Condition Tests - Archive of obsolete content
« previousnext » there are several additional types of conditional tests that may be performed.
...for inner iterations, it will be the element with the uri attribute from the previous iteration.
... here is a previous example, rewritten to use the parent matching syntax: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <rule parent="vbox"> <action> <groupbox uri="?"> <caption label="?name"/> </groupbox> </action> </rule> <rule> <action> <label uri="?" value="?name"/> </action> </rule> </template> </vbox> previously, an assign element was used to assign the tagname of the result to a variable, which was then compared in a rule condition.
...And 5 more matches
Table Reflow Internals - Archive of obsolete content
overview review of reflow table frames table reflow intro to paginated reflow table paginated reflow review of reflow reflow process starts when an html document starts loading (the frame tree contains only viewport, scroll(s), canvas, html, body).
... review of reflow reflow starts with pres shell which reflows the reflow root (usually the viewport frame), which reflows it children, etc.
...absolutely positioned elements) reflows reflowee and passes a reflow state (in) and a reflow metrics (in/out) review of reflow the reflow state: is a node in a tree structurally equivalent to the frame tree of reflow participants contains: reflow type, avail size, various computed values, resolved style structs possible request for preferred size and more.
...And 5 more matches
Building up a basic demo with Babylon.js - Game development
let's create a scene by adding the following lines just below our previous code: var scene = new babylon.scene(engine); scene.clearcolor = new babylon.color3(0.8, 0.8, 0.8); thus, the scene is created and the second line sets the background color to light gray.
...add the following line below your camera definition: var light = new babylon.pointlight("light", new babylon.vector3(10, 10, 0), scene); the parameters are very similar to the previously defined camera: the name of the light, a position in 3d space and the scene to which the light is added.
...let's start by defining the geometry for a box shape — add the following new code below your previous additions: var box = babylon.mesh.createbox("box", 2, scene); a mesh is a way the engine creates geometric shapes, so material can be easily applied to them later on.
...And 5 more matches
Building up a basic demo with Three.js - Game development
let's create it, by adding the following line below our previous lines: var scene = new three.scene(); later, we will be using the .add() method, to add objects to this scene.
...the following lines put the camera in place in the 3d coordinate system, and point it in the direction of our scene, so we can finally see something: var camera = new three.perspectivecamera(70, width/height); camera.position.z = 50; scene.add(camera); add the above lines to your code, below those previously added.
... again, add this new code below your previous additions.
...And 5 more matches
CSS and JavaScript accessibility best practices - Learn web development
previous overview: accessibility next css and javascript, when used properly, also have the potential to allow for accessible web experiences ...
... abbreviations an element that allows an abbreviation, acronym, or initialization to be associated with its expansion: <p>web content is marked up using <abbr title="hypertext markup language">html</abbr>.</p> again, you might want to style it in some simple way: abbr { color: #a60000; } the recognised styling convention for abbreviations is a dotted underline, and it is unwise to significantly de...
...for more on abbreviations, see abbreviations.
...And 5 more matches
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 purposes of our example, we'll stop with that; however, if you're a careful reader, you'll notice that some behaviors are missing.
... as seen previously, we already use a native select control as a fallback for accessibility reasons; we can simply synchronize its value with that of our custom control: // this function updates the displayed value and synchronizes it with the native control.
... // it takes two parameters: // select : the dom node with the class `select` containing the value to update // index : the index of the value to be selected function updatevalue(select, index) { // we need to get the native control for the given custom control // in our example, that native control is a sibling of the custom control var nativewidget = select.previouselementsibling; // we also need to get the value placeholder of our custom control var value = select.queryselector('.value'); // and we need the whole list of options var optionlist = select.queryselectorall('.option'); // we set the selected index to the index of our choice nativewidget.selectedindex = index; // we update the value placeholder accordingly value.innerhtml = optionlist[index].innerhtml...
...And 5 more matches
UI pseudo-classes - Learn web development
previous overview: forms next in the previous articles, we covered the styling of various form controls, in a general manner.
... using generated content with pseudo-classes in previous articles, we've seen the usage of generated content, but we thought now would be a good time to talk about it in a bit more detail.
... as in the previous example, we've got extra <span>s to generate content on, which we'll use to provide indicators of valid/invalid data: <div> <label for="fname">first name *: </label> <input id="fname" name="fname" type="text" required> <span></span> </div> to provide these indicators, we use the following css: input + span { position: relative; } input + span::before { position: absolute; righ...
...And 5 more matches
Advanced text formatting - Learn web development
previous overview: introduction to html next there are many other elements in html for formatting text, which we didn't get to in the html text fundamentals article.
... <dd>the drink that gets the world running in the morning.</dd>\n <dd>a light brown color.</dd>\n</dl>'; const solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back;...
...p://www.affirmationsforpositivethinking.com"><cite>affirmations for positive thinking</cite></a>.)</p>'; const solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back;...
...And 5 more matches
Getting started with HTML - Learn web development
anatomy of an html element let's further explore our paragraph element from the previous section: the anatomy of our element is: the opening tag: this consists of the name of the element (in this example, p for paragraph), wrapped in opening and closing angle brackets.
...solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<em>this is my text.</em>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caret...
...one reason html5 dropped these terms was to prevent this rather common confusion.
...And 5 more matches
Video and Audio APIs - Learn web development
previous overview: client-side web apis next html5 comes with elements for embedding rich media in documents — <video> and <audio> — which in turn come with their own apis for controlling playback, seeking, etc.
...here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> this creates a video player inside the browser like so: you can review what all the html features do in the article linked above; for our purposes here, the most interesting attribute is controls, which enables the default set of playback controls.
...add the following addeventlistener() lines below the previous one you added: stop.addeventlistener('click', stopmedia); media.addeventlistener('ended', stopmedia); the click event is obvious — we want to stop the video by running our stopmedia() function when the stop button is clicked.
...And 5 more matches
Arrays - Learn web development
previous overview: first steps next in the final article of this module, we'll look at arrays — a neat way of storing a list of data items under a single variable name.
... as in previous articles, let's learn about the real basics of arrays by entering some examples into browser developer console.
...for example, to access one of the items inside the array that is the third item inside the random array (see previous section), we could do something like this: random[2][2]; try making some more modifications to your array examples before moving on.
...And 5 more matches
React interactivity: Events and state - Learn web development
previous overview: client-side javascript frameworks next with our component plan worked out, it's now time to start updating our app from a completely static ui to one that actually allows us to interact and change things.
...this function should prevent the default behavior of the submit event.
...it should end up looking something like this: function handlesubmit(e) { e.preventdefault(); alert('hello, world!'); } to use this function, add an onsubmit attribute to the <form> element, and set its value to the handlesubmit function: <form onsubmit={handlesubmit}> now if you head back to your browser and click on the "add" button, your browser will show you an alert dialog with the words "hello, world!" — or whatever you chose to write there.
...And 5 more matches
Componentizing our Svelte app - Learn web development
previous overview: client-side javascript frameworks next in the last article we started developing our todo list app.
... we will just declare the onclick prop assigning a dummy handler to prevent errors, like this: export let onclick = (clicked) => {} and we'll declare the following reactive statement — $: onclick(filter) — to call the onclick handler whenever the filter variable is updated.
... easier two-way data binding with the bind directive in the previous example we realized that our filterbutton component wasn't working because our application state was flowing down from parent to child through the filter prop — but it wasn't going back up.
...And 5 more matches
NSS_3.12_release_notes.html
on (see cert.h) cert_encodesubjectkeyid (see certdb/cert.h) cert_encodeusernotice (see cert.h) cert_findcrlentryreasonexten (see cert.h) cert_findcrlnumberexten (see cert.h) cert_findnameconstraintsexten (see cert.h) cert_getclassicocspdisabledpolicy (see cert.h) cert_getclassicocspenabledhardfailurepolicy (see cert.h) cert_getclassicocspenabledsoftfailurepolicy (see cert.h) cert_getpkixverifynistrevocationpolicy (see cert.h) cert_getusepkixforvalidation (see cert.h) cert_getvaliddnspatternsfromcert (see cert.h) cert_newtempcertificate (see cert.h) cert_setocsptimeout (see certhigh/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pu...
... (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camellia support (see blapit.h): nss_camellia nss_camellia_cbc camellia_block_size new macros for rsa (see blapit.h): rsa_max_modulus_bits rsa_max_exponent_bits new macros in certt.h: x.509 v3 ku_encipher_only cert_max_serial_number_bytes cert_max_dn_bytes pkix cert_rev_m_do_not_test_using_this_method cert_rev_m_test_using_this_method cert_rev_m_allow_network_fetching cert_rev_m_forbid_network_fetching cert_rev_m_allow_implicit_default_source cert_rev_m_ignore_implicit_default_source cert_rev_m_skip_test_on_missing_source cert_rev_m_require_info_on_missing_source cert_rev_m_ignore_missing_fresh_info cert_rev_m_fail_on_missing_fresh_info cert_rev_m_stop_testing_o...
...n_fresh_info cert_rev_m_continue_testing_on_fresh_info cert_rev_mi_test_each_method_separately cert_rev_mi_test_all_local_information_first cert_rev_mi_no_overall_info_requirement cert_rev_mi_require_some_fresh_info_available cert_policy_flag_no_mapping cert_policy_flag_explicit cert_policy_flag_no_any cert_enable_ldap_fetch cert_enable_http_fetch new macro in utilrename.h: smime_aes_cbc_128 the nssckbi pkcs #11 module's version changed to 1.70.
...And 5 more matches
Finishing the Component
« previousnext » at this point you have created most of the infrastructure of the component.
...this can prevent many errors like this.
...at the time this book was written, this interface was under review.
...And 5 more matches
Starting WebLock
« previousnext » in this chapter, we begin to design and implement the web locking functionality itself.
...you can then use the service manager to add the component to the category: nsresult rv; nscomptr<nsiservicemanager> servman = do_queryinterface((nsisupports*)acompmgr, &rv); if (ns_failed(rv)) return rv; do_queryinterface the previous code uses the special nscomptr function do_queryinterface that lets you queryinterface without having to worry about reference counting, error handling, and other overhead.
... in short, to register the weblock component as an xpcom-startup observer, do the following: char* previous = nsnull; rv = catman->addcategoryentry("xpcom-startup", "weblock", weblock_contractid, pr_true, // persist category pr_true, // replace existing &previous); if (previous) nsmemory::free(previous); // free the memory the replaced value might...
...And 5 more matches
nsIMsgFolder
e, in boolean newvalue); void notifypropertyflagchanged(in nsimsgdbhdr item, in nsiatom property, in unsigned long oldvalue, in unsigned long newvalue); void notifyunicharpropertychanged(in nsiatom property, in astring oldvalue, in astring newvalue); void notifyitemadded(in nsisupports item); void notifyitemremoved(in nsisupports item); void notifyfolderevent(in nsiatom event); void listdescendents(in nsisupportsarray descendents); void shutdown(in boolean shutdownchildren); void setinvfeditsearchscope(in boolean asearchthisfolder, in boolean asetonsubfolders); void copydatatooutputstreamforappend(in nsiinputstream aistream, in long alength, in nsioutputstream outputstream); void copydatadone(); ...
... void setjunkscoreformessages(in nsisupportsarray amessages, in acstring ajunkscore); void applyretentionsettings(); boolean fetchmsgpreviewtext([array, size_is (anumkeys)] in nsmsgkey akeystofetch, in unsigned long anumkeys, in boolean alocalonly, in nsiurllistener aurllistener); void addkeywordstomessages(in nsisupportsarray amessages, in acstring akeywords); void removekeywordsfrommessages(in nsisupportsarray amessages, in acstring akeywords); autf8string getmsgtextfromstream(in nsimsgdbhdr amsghdr, in nsiinputstream astream, in long abytestoread, in long amaxoutputlen, in boolean acompressquotes); attributes attribute type description supportsoffline boolean readonly offlinestoreoutputstream nsi...
... abbreviatedname astring readonly: old nsifolder properties and methods.
...And 5 more matches
CustomEvent - Web APIs
setting its value to true before returning from an event handler prevents propagation of the event.
... event.defaultprevented read only indicates whether or not the call to event.preventdefault() canceled the event.
...ideally, you should try to use event.preventdefault() and event.defaultprevented instead, but you can use returnvalue if you choose to do so.
...And 5 more matches
Pointer events - Web APIs
in fact, the pointerevent interface inherits all of the mouseevent properties, thus facilitating the migration of content from mouse events to pointer events.
... interfaces the primary interface is the pointerevent interface which has a constructor plus several event types and associated global event handlers.
... pointerevent interface the pointerevent interface extends the mouseevent interface and has the following properties.
...And 5 more matches
Accessibility documentation index - Accessibility
found 105 pages: # page tags and summary 1 accessibility accessibility, landing accessibility (often abbreviated to a11y—as in "a" then 11 characters then "y") in web development means enabling as many people as possible to use web sites, even when those people's abilities are limited in some way.
...an editorial comment related to a part of a document under review).
... 40 x-ms-aria-flowfrom aria, microsoft, non-standard the x-ms-aria-flowfrom property specifies the id of the previous element in an alternative reading order, allowing assistive technology to override the general default of reading in document source order.
...And 5 more matches
animation-direction - CSS: Cascading Style Sheets
syntax /* single animation */ animation-direction: normal; animation-direction: reverse; animation-direction: alternate; animation-direction: alternate-reverse; /* multiple animations */ animation-direction: normal, reverse; animation-direction: alternate, reverse, normal; /* global values */ animation-direction: inherit; animation-direction: initial; animation-direction: unset; values normal the animation plays forwards each cycle.
... reverse the animation plays backwards each cycle.
...animation steps are performed backwards, and timing functions are also reversed.
...And 5 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
if you encounter problems with the favicon not loading, verify that the content-security-policy header's img-src directive is not preventing access to it.
...without sending the origin http header), preventing its non-tainted usage.
... rev the value of this attribute shows the relationship of the current document to the linked document, as defined by the href attribute.
...And 5 more matches
d - SVG: Scalable Vector Graphics
WebSVGAttributed
the start control point is a reflection of the end control point of the previous curve command.
... if the previous command wasn't a cubic bézier curve, the start control point is the same as the curve starting point (current point).
...the start control point is a reflection of the end control point of the previous curve command.
...And 5 more matches
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
« previousnext » the <path> element is the most powerful element in the svg library of basic shapes.
... l x y (or) l dx dy there are two abbreviated forms for drawing horizontal and vertical lines.
... s x2 y2, x y (or) s dx2 dy2, dx dy s produces the same type of curve as earlier—but if it follows another s command or a c command, the first control point is assumed to be a reflection of the one used previously.
...And 5 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
« previousnext » adding a new toolbar adding new toolbars to firefox is easy, but adding them the wrong way is very easy as well.
...the way icons are handled in firefox changed considerably after firefox 4, so supporting older versions is not mentioned here (you can check this document's change history for older revisions, though).
... windows: /* the second and third selectors at the bottom are necessary to prevent conflicts with installed themes.
...And 4 more matches
Editor Embedding Guide - Archive of obsolete content
cmd_abbr toggles abbreviation on selection.
... cmd_selectlineprevious scrolls relative to the current selection end point.
... cmd_selectcharprevious scrolls relative to the current selection end point.
...And 4 more matches
Box Objects - Archive of obsolete content
« previousnext » this section describes the box object, which holds display and layout related information about a xul box as well as some details about xul layout.
...the box object provides several properties, firstchild, lastchild, nextsibling, previoussibling, and parentbox.
...there is no corresponding childnodes property for box navigation; instead you must navigate by sibling using the nextsibling or previoussibling properties.
...And 4 more matches
Archived Mozilla and build documentation - Archive of obsolete content
exception logging in javascript technical review completed.
... helper apps (and a bit of save as) hidden prefs this page has been flagged by editors or users as needing technical review.
... until it is fully reviewed, it may contain inaccurate or incorrect information.
...And 4 more matches
Create Your Own Firefox Background Theme - Archive of obsolete content
firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window.
... the upper right-hand side of the image should have the most important information—as a user increases the width of the browser window, the browser reveals more of the left-hand side of the image.
... firefox may reveal more of the upper portion of the image if the find bar is open or if an extension adds more height to the bottom of the window.
...And 4 more matches
Advanced form styling - Learn web development
previous overview: forms next in this article, we will see what can be done with css to style the types of form control that are more difficult to style — the "bad" and "ugly" categories.
... as we saw in the previous article, text fields and buttons are perfectly easy to style; now we will dig into styling the bits that are more problematic.
... to recap what we said in the previous article, we have: the bad: some elements are more difficult to style, requiring more complex css or some more specific tricks: checkboxes and radio buttons <input type="search"> the ugly: some elements can't be styled thoroughly using css.
...And 4 more matches
How to structure a web form - Learn web development
previous overview: forms next with the basics out of the way, we'll now look in more detail at the elements used to provide structure and meaning to the different parts of a form.
... we already met this in the previous article.
... the <label> element as we saw in the previous article, the <label> element is the formal way to define a label for an html form widget.
...And 4 more matches
Creating hyperlinks - Learn web development
previous overview: introduction to html next hyperlinks are really important — they are what makes the web a web.
... note: a link title is only revealed on mouse hover, which means that people relying on keyboard controls or touchscreens to navigate web pages will have difficulty accessing title information.
... relative url: points to a location that is relative to the file you are linking from, more like what we looked at in the previous section.
...And 4 more matches
Debugging HTML - Learn web development
previous overview: introduction to html next writing html is fine, but what if something goes wrong, and you can't work out where the error in the code is?
...let's look at an example: <a href="https://www.mozilla.org/>link to mozilla homepage</a> </ul> let's review the problems: the paragraph and list item elements have no closing tags.
...it is not easy to tell how this has been interpreted because of the previous problem.
...And 4 more matches
HTML table advanced features and accessibility - Learn web development
previous overview: tables next in the second article in this module, we look at some more advanced features of html tables — such as captions/summaries and grouping your rows into table head, body and footer sections — as well as looking at the accessibility of tables for visually impaired users.
...we'd recommend using the <caption> element instead, however, as summary is deprecated by the html5 spec, and can't be read by sighted users (it doesn't appear on the page.) active learning: adding a caption let's try this out, revisiting an example we first met in the previous article.
... the <tfoot> element needs to wrap the part of the table that is the footer — this might be a final row with items in the previous rows summed, for example.
...And 4 more matches
Index - Learn web development
53 graceful asynchronous programming with promises beginner, codingscripting, guide, javascript, learn, promises, async, asynchronous, catch, finally, then promises are a comparatively new feature of the javascript language that allow you to defer further actions until after a previous action has completed, or respond to its failure.
... 65 adding features to our bouncing balls demo assessment, beginner, codingscripting, javascript, learn, oojs, object-oriented, objects, l10n:priority in this assessment, you are expected to use the bouncing balls demo from the previous article as a starting point, and add some new and interesting features to it.
... 90 build your own function article, beginner, codingscripting, functions, guide, javascript, learn, tutorial, build, invoke, l10n:priority, parameters with most of the essential theory dealt with in the previous article, this article provides practical experience.
...And 4 more matches
Looping code - Learn web development
previous overview: building blocks next programming languages are very useful for rapidly completing repetitive tasks, from multiple basic calculations to just about any other situation where you've got a lot of similar items of work to complete.
...if not, the loop will go on forever, and either the browser will force it to stop, or it will crash.
...we already met this in the previous article when we looked at switch statements — when a case is met in a switch statement that matches the input expression, the break statement immediately exits the switch statement and moves onto the code after it.
...And 4 more matches
The business case for web performance - Learn web development
previous overview: performance we've discussed the importance of web performance.
... making performance a business priority we've discussed how prioritizing performance can improve user experience and therefore revenue.
... we know that not prioritizing web performance can result in a loss of business revenue.
...And 4 more matches
Introduction to automated testing - Learn web development
previous overview: cross browser testing next manually running tests on several browsers and devices, several times per day, can get tedious, and time-consuming.
... we agree — testing all the things we've looked at in previous articles manually can be a real pain.
... to begin with, create a test npm project using the procedure detailed at the bottom of the previous section.
...And 4 more matches
Setting up your own test automation environment - Learn web development
previous overview: cross browser testing in this article, we will teach you how to install your own automation environment and run your own tests using selenium/webdriver and a testing library such as selenium-webdriver for node.
... we will also look at how to integrate your local testing environment with commercial tools like the ones discussed in the previous article.
...to install selenium-webdriver, run the following command, making sure you are inside your project folder: npm install selenium-webdriver note: it is still a good idea to follow these steps even if you previously installed selenium-webdriver and downloaded the browser drivers.
...And 4 more matches
Deploying our app - Learn web development
previous overview: understanding client-side tools in the final article in our series, we take the example toolchain we built up in the previous article and add to it so that we can deploy our sample app.
... running tests: these can range from "is this code formatted properly?" to "does this thing do what i expect?", and ensuring failing tests prevent deployment.
... actually deploying the updated code to a live url: or potentially a staging url so it can be reviewed first.
...And 4 more matches
Package management basics - Learn web development
previous overview: understanding client-side tools next in this article we'll look at package managers in some detail to understand how we can use them in our own projects — to install project tool dependencies, keep them up-to-date, and more.
... a project dependency can be an entire javascript library or framework — such as react or vue — or a very small utility like our human-readable date library, or it can be a command line tool such as prettier or eslint, which we talked about in previous articles.
...as we touched on in the previous article, dependencies can be installed globally or locally to your project.
...And 4 more matches
Embedding Tips
how do i print preview a page?
...call the nsiwebbrowserprint::printpreview() method supplying a print settings object (e.g.
... that returned from nsiwebbrowserprint::getglobalprintsettings()) that you wish to preview the page with.
...And 4 more matches
IME handling guide
introduction ime is an abbreviation of input method editor.
... editor/libeditor mozilla::editoreventlistener listens for trusted dom compositionstart, text and compositionend events and notifies mozilla::editorbase and mozilla::texteditor of the events.
...this must be called after the previous imecontentobserver notified widget of notify_ime_of_blur.
...And 4 more matches
Application Translation with Mercurial
enabling mercurial queues (revertable patches) some time will pass between the moment in which you start the localization, finish it, test it, improve it, upload it for review and get review (maybe not approved on first try).
...mercurial queues allow to revert changes and also pull changes and reapply your local changes.
...this detects often more than 90 percent of the possible reasons for the reviewer to not accept the patch.
...And 4 more matches
SVN for Localizers
brief intro to svn svn (abbreviation for subversion) is a free and open source repository tool we use to manage the localized mozilla web pages.
... note: we use the terms stage and prod (abbreviations of the terms staging and production) to refer to testing and publicly visible websites, respectively.
...go back to the root of your working directory and execute this command: svn revert * this is a really helpful command because it reverts all of your changes to your working directory's last updated state.
...And 4 more matches
Getting Started With NSS
a new set of samples is currently under development and review, see create new nss samples.
...when you're satisfied with it, you'll need code review.
... code review http://phabricator.services.mozilla.com/ is our code review tool, which uses your bugzilla account.
...And 4 more matches
NSS API Guidelines
the layer indicates the main layer, seen in the previous diagram, in which the library operates.
...nss_shutdown() closes these databases, to prevent further access by an application.
...the preferred format is: "@(#) $rcsfile: nss-guidelines.html, v $ $revision: 48936 $ $date: 2009-08-11 07:45:57 -0700 (tue, 11 aug 2009) $ $name$" you can put the string in a comment or in a static char array.
...And 4 more matches
NSS tools : certutil
if you create a new key pair for such a card, the previous pair is overwritten.
...be sure to prevent unauthorized access to this file.
...this extension identifies the url of a certificate's associated certificate revocation list (crl).
...And 4 more matches
certutil
if you create a new key pair for such a card, the previous pair is overwritten.
...be sure to prevent unauthorized access to this file.
...this extension identifies the url of a certificate's associated certificate revocation list (crl).
...And 4 more matches
SpiderMonkey 1.8.5
on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... spidermonkey 1.8.5 is not binary-compatible with previous releases, nor is it source-code compatible.
... previous versions of spidermonkey supported two types of native functions: jsnative and jsfastnative.
...And 4 more matches
Handling Mozilla Security Bugs
however, a security bug can revert back to being a normal bug by having the "security-sensitive" flag removed, in which case the access control restrictions will no longer be in effect.
... super-reviewers and drivers.
... expanding the mozilla security bug group as previously described, the mozilla security module owner can select one or more peers to share the core work of coordinating investigation and resolution of mozilla security vulnerabilities, and will work with them to create some agreed-upon ground rules for how this work can be most effectively shared among themselves.
...And 4 more matches
Mozilla internal string guide
for example: void nsfoo::reversecharacters(nsastring& str) { ...
... str.assign(reversedstr); // modifies the string } this should not compile, because you're assigning to a const class: void nsfoo::reversecharacters(const nsastring& str) { ...
... str.assign(reversedstr); } as function parameters for methods which are exposed across modules, use nsastring references to pass strings.
...And 4 more matches
nsIDocShell
for a new document load, this will be the channel of the previous document until after onlocationchange fires.
... layouthistorystate nsilayouthistorystate loadedtransindex long keeps track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load.
... previoustransindex long keeps track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load.
...And 4 more matches
Drawing and Event Handling - Plugins
« previousnext » this chapter tells how to determine whether a plug-in instance is windowed or windowless, how to draw and redraw plug-ins, and how to handle plug-in events.
...this value prevents the instance from drawing further until it is pasted back on the page and npp_setwindow is called again with a new value.
... however, for the plug-in to draw at any other time, for example, to highlight on a mouse-down event or draw animation at idle time, it must save the current setting of the port, set up its drawing environment as appropriate, draw, and then restore the port to the previous settings.
...And 4 more matches
Applying styles and colors - Web APIs
« previousnext » in the chapter about drawing shapes, we used only the default line and fill styles.
...this is what happens with the 1.0 width line in the previous example code.
... note also that only start and final endpoints of a path are affected: if a path is closed with closepath(), there's no start and final endpoint; instead, all endpoints in the path are connected to their attached previous and next segment using the current setting of the linejoin style, whose default value is miter, with the effect of automatically extending the outer borders of the connected segments to their intersection point, so that the rendered stroke will exactly cover full pixels centered at each endpoint if those connected segments are horizontal and/or vertical).
...And 4 more matches
Document.cookie - Web APIs
WebAPIDocumentcookie
;samesite samesite prevents the browser from sending this cookie along with cross-site requests.
...this is sufficient for user tracking, but it will prevent many csrf attacks.
... the strict value will prevent the cookie from being sent by the browser to the target site in all cross-site browsing contexts, even when following a regular link.
...And 4 more matches
Event.cancelable - Web APIs
WebAPIEventcancelable
the cancelable read-only property of the event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.
... event listeners that handle multiple kinds of events may want to check cancelable before invoking their preventdefault() methods.
...canceling the click, scroll, or beforeunload events would prevent the user from clicking on something, scrolling the page, or navigating away from the page, respectively.
...And 4 more matches
Signaling and video calling - Web APIs
the "local_video" <video> element presents a preview of the user's camera; specifiying the muted attribute, as we don't need to hear local audio in this preview panel.
...this code generally handles text chat messages as it did previously.
... we attach the incoming stream to the local preview <video> element by setting the element's srcobject property.
...And 4 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
t = "", asheets = [], amap = []; this.rate = nrate || 100; this.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.length === 0) { return; } for (var nitem = 0; nitem < aitems.length; nitem++) { asheets.push(new sheet(aitems[nitem])); /* uncomment the following line if you have previously hidden your elements via css: */ // aitems[nitem].style.visibility = "visible"; } bstart = false; } nintervid = setinterval(typewrite, this.rate); btyping = true; }; this.pause = function () { clearinterval(nintervid); btyping = false; }; this.terminate = function () { ocurrent.nodevalue += spart; spart = ""; for (nidx; nidx < ...
... callback arguments as previously discussed, internet explorer versions 9 and below do not support the passing of arguments to the callback function in either settimeout() or setinterval().
... minidaemon.js /*\ |*| |*| :: minidaemon :: |*| |*| revision #2 - september 26, 2014 |*| |*| /docs/web/api/window.setinterval |*| https://developer.mozilla.org/user:fusionchess |*| https://github.com/madmurphy/minidaemon.js |*| |*| this framework is released under the gnu lesser general public license, version 3 or later.
...And 4 more matches
Cognitive accessibility - Accessibility
for these users, the ability to read and understand may depend on the availability of specific definitions or the expanded forms of acronyms or abbreviations.
... define abbreviations abbreviations can be confusing for people who: have difficulty decoding words.
... provide an expanded form of the abbreviation the first time it is used, followed by the abbreviation placed within an <abbr> element.
...And 4 more matches
Understandable - Accessibility
3.1.4 abbreviations (aaa) where abbreviations are used, you should provide an expansion of them, or a definition as required.
... the <abbr> element is often thought of as the preferred way to provide an expansion for an abbreviation — it takes a title attribute that contains the expansion, and this appears when the acronym is moused over.
... see abbreviations.
...And 4 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent form submission.
... 56 <abbr>: the abbreviation element acronym, definitions, element, html, html text-level semantics, html:flow content, html:palpable content, html:phrasing content, reference, web, abbr, abbreviation, semantics the html abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation.
... 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 compose an acronym or abbreviation for a word.
...And 4 more matches
Functions - JavaScript
« previousnext » functions are one of the fundamental building blocks in javascript.
... the reverse, however, is not true.
...however, this is prevented by the second line in this example: function multiply(a, b) { b = typeof b !== 'undefined' ?
...And 4 more matches
Working with objects - JavaScript
« previousnext » javascript is designed on a simple object-based paradigm.
...r, this can be achieved with the following function: function listallproperties(o) { var objecttoinspect; var result = []; for(objecttoinspect = o; objecttoinspect !== null; objecttoinspect = object.getprototypeof(objecttoinspect)) { result = result.concat( object.getownpropertynames(objecttoinspect) ); } return result; } this can be useful to reveal "hidden" properties (properties in the prototype chain which are not accessible through the object, because another property has the same name earlier in the prototype chain).
...then if you want to find out the name of the owner of car2, you can access the following property: car2.owner.name note that you can always add a property to a previously defined object.
...And 4 more matches
Same-origin policy - Web security
sites can use the x-frame-options header to prevent cross-origin framing.
... how to block cross-origin access to prevent cross-origin writes, check an unguessable token in the request — known as a cross-site request forgery (csrf) token.
... you must prevent cross-origin reads of pages that require this token.
...And 4 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
using the current firefox esr, stable version, or nightly is generally a better idea if given the option, but some users take forever to upgrade.
...however, because it was implemented first for only file:// and resource:// but not chrome://, everyone who learned of this new feature learned that you had to load jsm from resource:// uris and just stuck with that forever.
... step 2a: load your jsm from chrome:// now with that preface out of the way, this part is easy: drop support for firefox 3.x if you haven't already, move your jsm files to wherever you've got your chrome mapping to for your xul overlay and/or windows, import your files from that new chrome mapped path instead of the old resource one, and remove your "resource" line from your chrome.manifest file.
...And 3 more matches
Intercepting Page Loads - Archive of obsolete content
« previousnext » there are several ways to detect and intercept loading of web pages and their content, be it only to realize when it happens, modify their contents, or to block them and do something else instead.
...in the previous example, one of the first things we do is check if the url is of interest to us, otherwise we let it go.
... xpcom solutions there are a couple more solutions you may be interested in trying if the previous ones are insufficient.
...And 3 more matches
Useful Mozilla Community Sites - Archive of obsolete content
« previous the mozilla community is very rich and active.
...amo has a review process that prevents malicious, insecure or low quality extensions to make it to the public site.
... your extension begins in a sandbox with limited access, and once you nominate it an editor will review it and see if it is appropriate for the public amo site, where everyone can see it and install it.
...And 3 more matches
Tabbed browser - Archive of obsolete content
window.open(url); } } } reusing by other criteria sometimes you want to reuse a previously-opened tab regardless of which url/uri it displays.
...you can get it with win.gbrowser, where win is the browser's window from the previous step.
... if (!notificationcallbacks) return null; var domwin = notificationcallbacks.getinterface(components.interfaces.nsidomwindow); return gbrowser.getbrowserfordocument(domwin.top.document); } catch (e) { dump(e + "\n"); return null; } } getting the browser that fires the http-on-modify-request notification (example code updated for loadcontext) here an example of the previous section is shown.
...And 3 more matches
jspage - Archive of obsolete content
ion(a,b){if(!a.type){a.type=function(c){return($type(c)===b); };}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,initialize:a[h],protect:true}); }var d={"boolean":boolean,"native":native,object:object};for(var c in d){native.typize(d[c],c);}var f={array:["concat","indexof","join","lastindexof","pop","push","reverse","shift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","indexof","lastindexof","match","replace","search","slice","split","substr","substring","tolowercase","touppercase","valueof"]}; for(var e in f){for(var b=f[e].length;b--;){native.genericize(a[e],f[e][b],true);}}})();var hash=new native({name:"hash",initialize:function(a){if($type(a)=="hash...
...ttempt:browser.engine.gecko})()){l=false; }}}}return $extend(this,{event:a,type:j,page:i,client:c,rightclick:e,wheel:h,relatedtarget:l,target:g,code:b,key:m,shift:a.shiftkey,control:a.ctrlkey,alt:a.altkey,meta:a.metakey}); }});event.keys=new hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});event.implement({stop:function(){return this.stoppropagation().preventdefault(); },stoppropagation:function(){if(this.event.stoppropagation){this.event.stoppropagation();}else{this.event.cancelbubble=true;}return this;},preventdefault:function(){if(this.event.preventdefault){this.event.preventdefault(); }else{this.event.returnvalue=false;}return this;}});function class(b){if(b instanceof function){b={initialize:b};}var a=function(){object.reset(this);if(a._protot...
...text:function(m,l){return this.grab(this.getdocument().newtextnode(m),l); },grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this;},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this;},replaces:function(l){l=document.id(l,true); l.parentnode.replacechild(this,l);return this;},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l);},getprevious:function(l,m){return j(this,"previoussibling",null,l,false,m); },getallprevious:function(l,m){return j(this,"previoussibling",null,l,true,m);},getnext:function(l,m){return j(this,"nextsibling",null,l,false,m);},getallnext:function(l,m){return j(this,"nextsibling",null,l,true,m); },getfirst:function(l,m){return j(this,"nextsibling","firstchild",l,false,m);},getlast:function(l,m){return j(this,...
...And 3 more matches
New Security Model for Web Services - Archive of obsolete content
when an attempt is made to access a resource at a previously-unknown uri, the sandbox reads a file at that domain with declarations to determine whether access is permitted to the script.
... client-controlled solutions several client-controlled solutions have been designed to prevent sandboxed applications loaded behind a firewall from compromising other resources protected behind the firewall.
... same source restriction by restricting sandboxed scripts to access only resources in the domain from which they were loaded, any script loaded from one domain into another is prevented from accessing resources in the domain into which it has been loaded.
...And 3 more matches
New Skin Notes - Archive of obsolete content
this is currently just a preview, but we would appreciate help with testing.
...--callek is it possible to remove the blank space on category pages, like category:dom?by the way, it looks like this skin has the same problem as previous - the edit box, category list on category pages, and others are always below the end of the sidebar.
...--mmondor 12:52, 26 aug 2005 (pdt) will revisit sidebar width later.
...And 3 more matches
Space Manager Detailed Design - Archive of obsolete content
// list of frames occupying the space }; bandrect(nscoord aleft, nscoord atop, nscoord aright, nscoord abottom, nsiframe*); bandrect(nscoord aleft, nscoord atop, nscoord aright, nscoord abottom, nsvoidarray*); ~bandrect(); // list operations bandrect* next() const {return (bandrect*)pr_next_link(this);} bandrect* prev() const {return (bandrect*)pr_prev_link(this);} void insertbefore(bandrect* abandrect) {pr_insert_before(abandrect, this);} void insertafter(bandrect* abandrect) {pr_insert_after(abandrect, this);} void remove() {pr_remove_link(this);} // split the band rect into two vertically, with this band rect becoming // the top part, and a new band rect being allocated a...
... frameinfo* getframeinfofor(nsiframe* aframe); frameinfo* createframeinfo(nsiframe* aframe, const nsrect& arect); void destroyframeinfo(frameinfo*); void clearframeinfo(); void clearbandrects(); bandrect* getnextband(const bandrect* abandrect) const; void divideband(bandrect* aband, nscoord abottom); prbool canjoinbands(bandrect* aband, bandrect* aprevband); prbool joinbands(bandrect* aband, bandrect* aprevband); void addrecttoband(bandrect* aband, bandrect* abandrect); void insertbandrect(bandrect* abandrect); nsresult getbandavailablespace(const bandrect* aband, nscoord ay, const nssize& amaxsize, nsban...
...space manager instances come and go pretty frequently, and this recycler prevents excessive heap allocations and the performance penalties associated with it.
...And 3 more matches
PopupEvents - Archive of obsolete content
<panel id="time-panel" onpopupshowing="this.lastchild.value = (new date()).tolocaleformat('%t')"> <label value="time:"/> <label id="time"/> </panel> <toolbarbutton label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener.
...the preventdefault method will stop this from happening and the popup will not be opened.
... <menu label="edit"> <menupopup onpopupshowing="if (gdisallowed) event.preventdefault();"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> in this example, a global variable gdisallowed is checked and the preventdefault method is called.
...And 3 more matches
Multiple Rules - Archive of obsolete content
« previousnext » all of the examples shown so far have used only a single rule.
...the second rule does not contain a where element, so it matches results unconditionally, or any result that wasn't matched by a previous rule.
...adding to the previous example, here we check for people with a space in their name, and a total number of letters less than 15.
...And 3 more matches
Game monetization - Game development
advertisements instead of actively selling the games you can also try to get yourself a passive income — showing adverts and relying on previous activities related to promoting your game may benefit, but your game has to be addictive, which isn't as easy as it sounds.
... subscriptions there's also an option to get a passive, monthly revenue via a subscription deal.
... ad revenue you can implement advertisements in your game on your own and try to find the traffic to earn a bit, but you can also do a revenue share deal with a publisher.
...And 3 more matches
Building up a basic demo with the PlayCanvas engine - Game development
let's start with the camera — add these lines to your code, below the previous ones.
...let's start by defining the geometry for a cube shape — add the following new code below your previous additions: var box = new pc.entity(); box.addcomponent("model", { type: "box" }); app.root.addchild(box); box.rotate(10, 15, 0); it will create an entity with the box model component and add it to the root of the application, our scene.
...again, add the new code below your previous additions.
...And 3 more matches
Bounce off the walls - Game development
« previousnext » this is the 3rd step out of 10 of the gamedev canvas tutorial.
...we need to check, on every frame, whether the ball is touching the top edge of the canvas — if yes, we'll reverse the ball movement so it will start to move in the opposite direction and stay within the visible boundaries.
... remembering that the coordinate system starts from the top left, we can come up with something like this: if(y + dy < 0) { dy = -dy; } if the y value of the ball position is lower than zero, change the direction of the movement on the y axis by setting it equal to itself, reversed.
...And 3 more matches
Move the ball - Game development
« previousnext » this is the 2nd step out of 10 of the gamedev canvas tutorial.
... you already know how to draw a ball from working through the previous article, so now let's make it move.
...the draw() function will be executed within setinterval every 10 miliseconds: function draw() { // drawing code } setinterval(draw, 10); thanks to the infinite nature of setinterval the draw() function will be called every 10 milliseconds forever, or until we stop it.
...And 3 more matches
WAI-ARIA basics - Learn web development
previous overview: accessibility next following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult.
... prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, an understanding of the previous articles in the course.
... enter wai-aria wai-aria (web accessibility initiative - accessible rich internet applications) is a specification written by the w3c, defining a set of additional html attributes that can be applied to elements to provide additional semantics and improve accessibility wherever it is lacking.
...And 3 more matches
Flexbox - Learn web development
previous overview: css layout next flexbox is a one-dimensional layout method for laying out items in rows or columns.
... note: you can also lay out flex items in a reverse direction using the row-reverse and column-reverse values.
...first of all, try changing your flex-direction property value to row-reverse — now you'll see that you still have your multiple row layout, but it starts from the opposite corner of the browser window and flows in reverse.
...And 3 more matches
Legacy layout methods - Learn web development
previous overview: css layout next grid systems are a very common feature used in css layouts, and before css grid layout they tended to be implemented using floats or other layout features.
...add the following rule below your previous one: .row { clear: both; } applying this clearing means that we don’t need to completely fill each row with elements making the full twelve columns.
... updating our grid to get started in this section, make a new copy of your previous example page, or make a local copy of our simple-grid-finished.html code to use as a starting point.
...And 3 more matches
How CSS is structured - Learn web development
previous overview: first steps next now that you are beginning to understanding the purpose and use of css, let's examine the structure of css.
...which selector prevails?
... p { color: red; } p { color: blue; } however, in the case of our earlier example with the conflict between the class selector and the element selector, the class prevails, rendering red paragraph text.
...And 3 more matches
Making asynchronous programming easier with async and await - Learn web development
previous overview: asynchronous next more recent additions to the javascript language are async functions and the await keyword, part of the so-called ecmascript 2017 javascript edition (see ecmascript next support in mozilla).
... rewriting promise code with async/await let's look back at a simple fetch example that we saw in the previous article: fetch('coffee.jpg') .then(response => { if (!response.ok) { throw new error(`http error!
... inside the myfetch() function definition you can see that the code closely resembles the previous promise version, but there are some differences.
...And 3 more matches
Making decisions in your code — conditionals - Learn web development
note: review the material at the previous link if you want to refresh your memories on these.
...cheese available for making cheese on toast.'); } else { console.log('no cheese on toast for you today.'); } and, returning to our previous example about the child doing a chore for their parent, you could write it like this: let shoppingdone = false; if (shoppingdone) { // don't need to explicitly specify '=== true' let childsallowance = 10; } else { let childsallowance = 5; } nesting if ...
... to give you an and example, the previous example snippet can be rewritten to this: if (choice === 'sunny' && temperature < 86) { para.textcontent = 'it is ' + temperature + ' degrees outside — nice and sunny.
...And 3 more matches
Drawing graphics - Learn web development
previous overview: client-side web apis next the browser contains some very powerful graphics programming tools, from the scalable vector graphics (svg) language, to apis for drawing on html <canvas> elements, (see the canvas api and webgl).
... add the following to the previous example, again below the previous javascript lines: ctx.strokestyle = 'rgb(255, 255, 255)'; ctx.strokerect(25, 25, 175, 200); the default width of strokes is 1 pixel; you can adjust the linewidth property value to change this (it takes a number representing the number of pixels wide the stroke is).
... add the following line in between the previous two lines: ctx.linewidth = 5; now you should see that your white outline has become much thicker!
...And 3 more matches
Object-oriented JavaScript for beginners - Learn web development
previous overview: objects next with the basics out of the way, we'll now focus on object-oriented javascript (oojs) — this article presents a basic view of object-oriented programming (oop) theory, then explores how javascript emulates object classes via constructor functions, and how to create object instances.
... replace your previous function with the following: function person(name) { this.name = name; this.greeting = function() { alert('hi!
... add the following lines below your previous code addition: let person1 = new person('bob'); let person2 = new person('sarah'); save your code and reload it in the browser, and try entering the following lines into your js console: person1.name person1.greeting() person2.name person2.greeting() cool!
...And 3 more matches
Introduction to the server side - Learn web development
as in the previous diagram, browsers send http requests to the server, then the server processes the requests and returns appropriate http responses.
... companies like amazon use server-side programming to construct search results for products, make targeted product suggestions based on client preferences and previous buying habits, simplify purchases, etc.
... a deeper analysis of user habits can be used to anticipate their interests and further customize responses and notifications, for example providing a list of previously visited or popular locations you may want to look at on a map.
...And 3 more matches
Framework main features - Learn web development
previous overview: client-side javascript frameworks next each major javascript framework has a different approach to updating the dom, handling browser events, and providing an enjoyable developer experience.
... when used with react, the jsx from the previous snippet would be compiled into this: var subject = "world"; var header = react.createelement("header", null, react.createelement("h1", null, "hello, ", subject, "!") ); when ultimately rendered by the browser, the above snippet will produce html that looks like this: <header> <h1>hello, world!</h1> </header> handlebars the handlebars templating language is not specific to ember appli...
... writing components as mentioned in the previous chapter, most frameworks have some kind of component model.
...And 3 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
previous overview: client-side javascript frameworks next in the last article we added more features to our to-do list and started to organize our app into components.
... put the following contents inside it: <script> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() let name = '' const addtodo = () => { dispatch('addtodo', name) name = '' } const oncancel = () => name = '' </script> <form on:submit|preventdefault={addtodo} on:keydown={e => e.key === 'escape' && oncancel()}> <h2 class="label-wrapper"> <label for="todo-0" class="label__lg">what needs to be done?</label> </h2> <input bind:value={name} type="text" id="todo-0" autocomplete="off" class="input input__lg" /> <button type="submit" disabled={!name} class="btn btn__primary btn__lg">add</button> </form> here we are binding th...
...nst dispatch = createeventdispatcher() let name = '' let nameel // reference to the name input dom node const addtodo = () => { dispatch('addtodo', name) name = '' nameel.focus() // give focus to the name input } const oncancel = () => { name = '' nameel.focus() // give focus to the name input } </script> <form on:submit|preventdefault={addtodo} on:keydown={e => e.key === 'escape' && oncancel()}> <h2 class="label-wrapper"> <label for="todo-0" class="label__lg">what needs to be done?</label> </h2> <input bind:value={name} bind:this={nameel} type="text" id="todo-0" autocomplete="off" class="input input__lg" /> <button type="submit" disabled={!name} class="btn btn__primary btn__lg">add</button> </form> try t...
...And 3 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
previous overview: client-side javascript frameworks next now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app.
...update the newtodo form's opening tag like so: <form on:submit|preventdefault={addtodo}> the on:eventname directive supports adding modifiers to the dom event with the | character.
... in this case, the preventdefault modifier tells svelte to generate the code to call event.preventdefault() before running the handler.
...And 3 more matches
Introduction to cross browser testing - Learn web development
troubleshooting javascript from previous topics to refresh your memory if needed).
...if you are working on a large project, you should be testing it regularly, to make sure that new features work for your target audience, and that new additions to the code don't break old features that were previously working.
...the client might already have data about this from previous research they've done, e.g.
...And 3 more matches
Handling common JavaScript problems - Learn web development
previous overview: cross browser testing next now we'll look at common cross-browser javascript problems and how to fix them.
... fixing general javascript problems as we said in the previous article on html/css, you should make sure your code is working generally, before going on to concentrate on the cross-browser issues.
...we'll break this down into: using modern core javascript features using modern web api features using bad browser sniffing code performance problems using modern javascript/api features in the previous article we described some of the ways in which html and css errors and unrecognized features can be handled due to the nature of the languages.
...And 3 more matches
Command line crash course - Learn web development
previous overview: understanding client-side tools next in your development process you'll undoubtedly be required to run some command in the terminal (or on the "command line" — these are effectively the same thing).
... try typing this into your system's terminal: cd desktop if you want to move back up to the previous directory, you can use two dots: cd ..
...they are pretty simple, so we won’t explain them all in quite as much detail as the previous couple.
...And 3 more matches
Gecko info for Windows accessibility vendors
in general we abbreviate by removing redundant words.
... note that the label and description relations may be used to prevent redundant information from being presented by the screen reader, since the label and description can occur both on their own, and in the name or description fields of an iaccessible.
... these relations can affect the calculation for the next next or previous item of a certain type.
...And 3 more matches
Creating a Language Pack
it is only useful if you want to preview the contents of the mergedir.
... done unpacking let's check which revision the binary was built from.
... $ make ident fx_revision 237dccbcb967 buildid 20091126033851 you can now go back to your source hg clone.
...And 3 more matches
Storage access policy: Block cookies from trackers
second, firefox uses an additional "entity list", which prevents domains from being classified as trackers when they are loaded on a top-level site owned by the same organization.
...this prevents those resources from retrieving tracking identifiers stored in cookies or site storage and using them to identify users across visits to multiple first parties.
... the restrictions applied by the policy will not prevent third-party scripts classified as tracking resources from accessing storage in the main context of the page.
...And 3 more matches
Patches and pushes
from the dropdown menu next to the review flag.
... this will display a text box to assign the review to someone.
... review, commit, & land address any review comments made by the reviewers and update the patch until it receives an r+ rating.
...And 3 more matches
An overview of NSS Internals
many (if not most) of the operations performed by nss involve the use of x.509 certificates (often abbreviated as “cert”, unfortunately making it easy to confuse with the term “computer emergency response team“).
...the intention is to make it easier to review code for security.
... the less code that has access to raw secret keys, the less code that must be reviewed.
...And 3 more matches
Python binding for NSS
project history red hat utilizes both nss and python in many of it's projects, however it was not previously possible to call nss directly from python.
... other documentation the doc directory contains other files you may wish to review.
... you may want to review the getting mozilla source code using mercurial documentation for more information with working with mercurial.
...And 3 more matches
sslerr.html
ssl_error_revoked_cert_alert -12270 "ssl peer rejected your certificate as revoked." the remote system has received a certificate from the local system, and has determined that the certificate has been revoked.
... sec_error_revoked_certificate -8180 peer's certificate has been revoked.
... sec_error_revoked_key -8131 the key for this site's certificate has been revoked.
...And 3 more matches
Scripting Java
so the previous example could be even shorter: js> java [javapackage java] we can access java classes simply by stepping down the package hierarchy: js> java.io.file [javaclass java.io.file] if your scripts access a lot of different java classes, it can get awkward to use the full package name of the class every time.
... the javaadapter constructor in the previous section we created java adapters using the new operator with java interfaces.
...most of the time the previous syntaxes using the new operator will be sufficient.
...And 3 more matches
Redis Tips
event logging lists, zsets, pubsub queues lists (rpush, blpop, blpoprpush, etc.) priority queues zsets membership sets, bitstrings state hashes heartbeats zsets hit counters zsets message broadcast pubsub search reverse indexes (never use keys in production) documentation redis has fantastic documentation.
... you can specify a timeout, or have them block forever (timeout = 0).
... some things to notice: the subscriber blocks forever - not just for the first message.
...And 3 more matches
Using the Places history service
history services interface overview the mozilla history service has undergone many revisions.
... differences from previous implementations the previous nsglobalhistory service stored one entry for each page in history.
...currently, this is used to store whether there was a scrollbar, which allows more efficient layout if the page is revisited.
...And 3 more matches
Creating the Component Code
« previousnext » this chapter goes over the basic code required to handle the relationship between your component and xpcom.
... what we'll be working on the component we'll be working on in this book controls a special mode in your browser that prevents users from leaving the current domain or a set of safe domains.
... overview of the weblock module source as we mentioned in the previous section, components have layers.
...And 3 more matches
Introduction to XPCOM for the DOM
warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
...the good thing is that your code will (in the best condition) last forever.
... note: the previous paragraph is extremely important.
...And 3 more matches
Migrating from Firebug - Firefox Developer Tools
response preview there is a preview tab when a network request logged to the console is expanded in firebug.
... the web console displays a preview within the response tab.
... it is currently missing the preview for html, xml and svg, though, which is tracked in bug 1247392 and bug 1262796, but when you click on the url of the request you switch to the network monitor, which has a preview tab.
...And 3 more matches
Drawing shapes with canvas - Web APIs
« previousnext » now that we have set up our canvas environment, we can get into the details of how to draw on the canvas.
...our html skeleton from the previous page had a canvas element 150 pixels wide and 150 pixels high.
... below is the draw() function from the previous page, but now it is making use of these three functions.
...And 3 more matches
Transformations - Web APIs
« previousnext » earlier in this tutorial we've learned about the canvas grid and the coordinate space.
...e ctx.fillstyle = '#09f'; // make changes to the settings ctx.fillrect(15, 15, 120, 120); // draw a rectangle with new settings ctx.save(); // save the current state ctx.fillstyle = '#fff'; // make changes to the settings ctx.globalalpha = 0.5; ctx.fillrect(30, 30, 90, 90); // draw a rectangle with new settings ctx.restore(); // restore previous state ctx.fillrect(45, 45, 60, 60); // draw a rectangle with restored settings ctx.restore(); // restore original state ctx.fillrect(60, 60, 30, 30); // draw a rectangle with restored settings } <canvas id="canvas" width="150" height="150"></canvas> draw(); the first step is to draw a large rectangle with the default settings.
... so far this is pretty similar to what we've done in previous sections.
...And 3 more matches
Element: auxclick event - Web APIs
bubbles yes cancelable yes interface mouseevent event handler property onauxclick preventing default actions for the vast majority of browsers that map middle click to opening a link in a new tab, including firefox, it is possible to cancel this behavior by calling preventdefault() from within an auxclick event handler.
... when listening for auxclick events originating on elements that do not support input or navigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button.
...this can be done by preventing the default behaviour of the mousedown or pointerdown event.
...And 3 more matches
Using the Gamepad API - Web APIs
technologies like <canvas>, webgl, <audio>, and <video>, along with javascript implementations, have matured to the point where they can now support many tasks previously requiring native code.
...this helps prevent gamepads being used for fingerprinting the user.
... disconnecting a gamepad when a gamepad is disconnected, and if a page has previously received data for that gamepad (e.g.
...And 3 more matches
GlobalEventHandlers.onpointerdown - Web APIs
if the pointerdown event isn't canceled through a call to preventdefault(), most user agents will fire a mousedown event, so that sites not using pointer events will work.
...it receives as input the pointerevent describing the pointerdown event.
...andledown; function handledown(evt) { var action; switch(evt.pointertype) { case "mouse": action = "clicking"; break; case "pen": action = "tapping"; break; case "touch": action = "touching"; break; default: action = "interacting with"; break; } targetbox.innerhtml = "<strong>thanks for " + action + " me!</strong>"; evt.preventdefault(); } this simply uses onpointerdown to establish the function handledown() as the event handler for pointer down events.
...And 3 more matches
Using Service Workers - Web APIs
the previous attempt — appcache — seemed to be a good idea because it allowed you to specify assets to cache really easily.
...the primary use of onactivate is for cleanup of resources used in previous versions of a service worker script.
... updating your service worker if your service worker has previously been installed, but then a new version of the worker is available on refresh or page load, the new version is installed in the background, but not yet activated.
...And 3 more matches
TouchEvent - Web APIs
touchevent.changedtouches read only a touchlist of all the touch objects representing individual points of contact whose states changed between the previous touch event and this one.
... using with addeventlistener() and preventdefault() it's important to note that in many cases, both touch and mouse events get sent (in order to let non-touch-specific code still interact with the user).
... if you use touch events, you should call preventdefault() to keep the mouse event from being sent as well.
...And 3 more matches
A basic 2D WebGL animation example - Web APIs
let uscalingfactor; let uglobalcolor; let urotationvector; let avertexposition; // animation timing let previoustime = 0.0; let degreespersecond = 90.0; initializing the program is handled through a load event handler called startup(): window.addeventlistener("load", startup, false); function startup() { glcanvas = document.getelementbyid("glcanvas"); gl = glcanvas.getcontext("webgl"); const shaderset = [ { type: gl.vertex_shader, id: "vertex-shader" }, { type: g...
...gl.array_buffer, vertexbuffer); avertexposition = gl.getattriblocation(shaderprogram, "avertexposition"); gl.enablevertexattribarray(avertexposition); gl.vertexattribpointer(avertexposition, vertexnumcomponents, gl.float, false, 0, 0); gl.drawarrays(gl.triangles, 0, vertexcount); window.requestanimationframe(function(currenttime) { let deltaangle = ((currenttime - previoustime) / 1000.0) * degreespersecond; currentangle = (currentangle + deltaangle) % 360; previoustime = currenttime; animatescene(); }); } the first thing that needs to be done in order to draw a frame of the animation is to clear the background to the desired color.
... useprogram() is called to activate the glsl shading program we established previously.
...And 3 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
in this article, we'll make use of information introduced in the previous articles in our webxr tutorial series to construct an example which animates a rotating cube around which the user can move freely using a vr headset, keyboard, and/or mouse.
...) { let refspacetype; xrsession = session; xrbutton.innertext = "exit webxr"; xrsession.addeventlistener("end", sessionended); let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); if (allowmouserotation) { canvas.addeventlistener("pointermove", handlepointermove); canvas.addeventlistener("contextmenu", (event) => { event.preventdefault(); }); } if (allowkeyboardmotion) { document.addeventlistener("keydown", handlekeydown); } shaderprogram = initshaderprogram(gl, vssource, fssource); programinfo = { program: shaderprogram, attriblocations: { vertexposition: gl.getattriblocation(shaderprogram, 'avertexposition'), vertexnormal: gl.getattriblocation(shaderprogram, 'avertexnormal'), ...
...since the "mouselook" feature functions only while the right mouse button is held down, and clicking using the right mouse button triggers the context menu, we add a handler for the contextmenu event to the canvas to prevent the context menu fom appearing when the user initially begins their drag of the mouse.
...And 3 more matches
Using the Web Animations API - Web APIs
safari supports web animations in its technology preview version and there is also a handy polyfill that tests for feature support and adds it where necessary.
...ion and not its iterations (by default, animations iterate once), we could pass in the milliseconds alone: document.getelementbyid("alice").animate( [ { transform: 'rotate(0) translate3d(-50%, -50%, 0)', color: '#000' }, { color: '#431236', offset: 0.3}, { transform: 'rotate(360deg) translate3d(-50%, -50%, 0)', color: '#000' } ], 3000); controlling playback with play(), pause(), reverse(), and updateplaybackrate() while we can write css animations with the web animations api, where the api really comes in handy is manipulating the animation’s playback.
...to prevent the cake from eating itself up before the user has had the chance to click on it, we call animation.pause() on it immediately after it is defined, like so: nommingcake.pause(); we can now use the animation.play() method to run it whenever we’re ready: nommingcake.play(); specifically, we want to link it to alice’s animation, so she gets bigger as the cupcake gets eaten.
...And 3 more matches
Web APIs
WebAPI
micscompressornode e ext_blend_minmax ext_color_buffer_float ext_color_buffer_half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic eckeygenparams eckeyimportparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinlinestyle elementtraversal errorevent event eventlistener eventsource eventtarget extendableevent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync fileerror fileexception filelist filereader filereadersync filerequest filesystem filesystemdirectoryentry filesystemdirectoryreader filesystementry filesystementrysync filesystemfileentry filesystemflags filesystemsyn...
...aconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess mediakeysystemconfiguration mediakeys medialist mediametadata mediapositionstate mediaquerylist mediaquerylistevent mediaquerylistlistener mediarecorder mediarecordererrorevent mediasession mediasessionactiondetails mediasettingsrange mediasource mediastream mediastreamaudiodestinationnode mediastreamaudiosourcenode mediastreamaudiosourceoptions mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints mer...
...rformanceeventtiming performanceframetiming performancelongtasktiming performancemark performancemeasure performancenavigation performancenavigationtiming performanceobserver performanceobserverentrylist performancepainttiming performanceresourcetiming performanceservertiming performancetiming periodicwave permissionstatus permissions photocapabilities plugin pluginarray point pointerevent popstateevent positionoptions processinginstruction progressevent promiserejectionevent publickeycredential publickeycredentialcreationoptions publickeycredentialrequestoptions pushevent pushmanager pushmessagedata pushregistrationmanager pushsubscription r rtcansweroptions rtccertificate rtcconfiguration rtcdtmfsender rtcdtmftonechangeevent rtcdatachannel rtcdatachannelevent rt...
...And 3 more matches
ARIA Test Cases - Accessibility
documenting and filing bugs review the information on how to file a bug on an aria implementation.
...when possible provide a link to the bug in the database so that its status can be reviewed.
... expected at behavior: when any control is focused inside the groupbox, where focus was previously outside of the groupbox, the description for the entire groupbox should be read by a screen reader.
...And 3 more matches
Variable fonts guide - CSS: Cascading Style Sheets
variable fonts: what they are, and how they differ to better understand what's different about variable fonts, it is worth reviewing what non-variable ones are like and how they compare.
...the advantage in choosing the variable font is that you have access to the entire range of weights, widths, and styles available, rather than being constrained to only the few that you previously would have loaded separately.
...therefore wherever possible, the appropriate property should be used, with the lower-level syntax of font-variation-settings only being used to set values or axes not available otherwise.
...And 3 more matches
Using media queries - CSS: Cascading Style Sheets
print intended for paged material and documents viewed on a screen in print preview mode.
... only the only operator is used to apply a style only if an entire query matches, and is useful for preventing older browsers from applying selected styles.
... in the previous example, we've already seen the and operator used to group a media type with a media feature.
...And 3 more matches
<color> - CSS: Cascading Style Sheets
hite #ffffff maroon #800000 red #ff0000 purple #800080 fuchsia #ff00ff green #008000 lime #00ff00 olive #808000 yellow #ffff00 navy #000080 blue #0000ff teal #008080 aqua #00ffff css level 2 (revision 1) orange #ffa500 css color module level 3 aliceblue #f0f8ff antiquewhite #faebd7 aquamarine #7fffd4 azure #f0ffff beige #f5f5dc bisque #ffe4c4 blanchedalmond #ffebcd blueviolet #8a2be2 brown #a52a2a burlywood #deb887 ...
... compatibility note: to prevent unexpected behavior, such as in a <gradient>, the current css spec states that transparent should be calculated in the alpha-premultiplied color space.
... historical note: transparent wasn't a true color in css level 2 (revision 1).
...And 3 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari gif graphics interchange format image/gif .gif chrome, edge, firefox, i...
....png chrome, edge, firefox, internet explorer, opera, safari svg scalable vector graphics image/svg+xml .svg chrome, edge, firefox, internet explorer, opera, safari tiff tagged image file format image/tiff .tif, .tiff none built-in; add-ons required webp web picture format image/webp .webp chrome, edge, firefox, opera the abbreviation for each format links to a longer description of the format, its capabilities, and detailed browser compatibility information; including which versions introduced support and specific special features that may have been introduced later.
... the image is corrupted in some way that prevents it from being loaded.
...And 3 more matches
Indexed collections - JavaScript
« previousnext » this chapter introduces collections of data which are ordered by an index value.
...the array object has methods for manipulating arrays in various ways, such as joining, reversing, and sorting them.
... reverse() transposes the elements of an array, in place: the first array element becomes the last and the last becomes the first.
...And 3 more matches
Meta programming - JavaScript
« previousnext » starting with ecmascript 2015, javascript gains support for the proxy and reflect objects allowing you to intercept and define custom behavior for fundamental language operations (e.g.
... handler.preventextensions() object.preventextensions() reflect.preventextensions() object.preventextensions(proxy) only returns true if object.isextensible(proxy) is false.
... revocable proxy the proxy.revocable() method is used to create a revocable proxy object.
...And 3 more matches
Object.isFrozen() - JavaScript
var vacuouslyfrozen = object.preventextensions({}); object.isfrozen(vacuouslyfrozen); // === true // a new object with one property is also extensible, // ergo not frozen.
... var oneprop = { p: 42 }; object.isfrozen(oneprop); // === false // preventing extensions to the object still doesn't // make it frozen, because the property is still // configurable (and writable).
... object.preventextensions(oneprop); object.isfrozen(oneprop); // === false // ...but then deleting that property makes the object // vacuously frozen.
...And 3 more matches
TypedArray.prototype.reduceRight() - JavaScript
syntax typedarray.reduceright(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below).
... description the reduceright method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring.
... the call to the reduceright callback would look something like this: typedarray.reduceright(function(previousvalue, currentvalue, index, typedarray) { // ...
...And 3 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
autoplay of media elements now that we've covered what autoplay is and what can prevent autoplay from being allowed, we'll look at how your web site or app can automatically play media upon page load, how to detect when autoplay fails to occur, and tips for coping when autoplay is denied by the browser.
...this will prevent any future play events from being delivered to the handler.
...checking for undefined prevents this code from failing with an error on older versions of web browsers.
...And 3 more matches
panel - Archive of obsolete content
this makes your code easier to maintain, secure, debug and review.
... the main add-on code is exactly the same as the main add-on code in the previous example, except that we don't attach a content script: var data = require("sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" script // into it.
... focus boolean set to false to prevent taking the focus away when the panel is shown.
...And 2 more matches
Creating annotations - Archive of obsolete content
r(function() { if (!active || $(this).hasclass('annotated')) { return; } resetmatchedelement(); ancestor = $(this).closest("[id]"); matchedelement = $(this).first(); originalbgcolor = $(matchedelement).css('background-color'); $(matchedelement).css('background-color', 'yellow'); $(matchedelement).bind('click.annotator', function(event) { event.stoppropagation(); event.preventdefault(); self.port.emit('show', [ document.location.tostring(), $(ancestor).attr("id"), $(matchedelement).text() ] ); }); }); conversely, the add-on resets the matched element on mouseout: $('*').mouseout(function() { resetmatchedelement(); }); save this code in a new file called selector.js in your add-on's data directory.
...activate the annotator by clicking the widget and load a page: the screenshot below uses http://blog.mozilla.com/addons/2011/02/04/ overview-amo-review-process/.
... you should see the highlight appearing when you move the mouse over certain elements: click on the highlight and you should see something like this in the console output: info: show info: http://blog.mozilla.com/addons/2011/02/04/overview-amo-review-process/, post-2249,when you submit a new add-on, you will have to choose between 2 review tracks: full review and preliminary review.
...And 2 more matches
Chrome Authority - Archive of obsolete content
chrome-authority-using modules must receive extra security review, and most bugs in these modules are security-critical.
... when the manifest implementation is complete the runtime loader will actually prevent modules from require()ing modules that are not listed in the manifest.
... likewise, it will prevent modules from getting chrome authority unless the manifest indicates that they have asked for it.
...And 2 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
« previousnext » this document was authored by hiroshi shimoda of clear code inc.
...with the previously discussed persist attribute, you can easily store a window's size and location.
... a click reveals the drop-down list; when an item is selected, the values of that item’s label and value attributes are copied to the label and value attributes of the menulist element itself.
...And 2 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
in order to host your add-on with mozilla it is crucial to minimize or completely eliminate eval use in order to receive a positive review and have your add-on made public.
... if it cannot be easily proven that an eval() call is benign and necessary because there are no viable alternatives, a mozilla add-ons gallery reviewer will generally reject the submission!
... the code is hard to read and by that hard to maintain and review.
...And 2 more matches
Local Storage - Archive of obsolete content
« previousnext » note: you may rather be looking for dom storage (localstorage, etc.), unless you really are doing xul development.
...an nsifile doesn't necessarily represent an existing file, as in the previous examples.
...some extension developers prefer to leave the data there, so that if the user chooses to install the extension again, all the previous data will be recovered.
...And 2 more matches
Setting Up a Development Environment - Archive of obsolete content
« previousnext » getting the right tools there are 3 tools that we think are essential for effective add-on development (or any kind of development, really): a source code editor, a source control system, and a build system.
...this structure should be familiar, as it is almost identical to the unpacked xpi from the previous section.
...the last & prevents automator from waiting for your firefox session to finish.
...And 2 more matches
Creating a dynamic status bar extension - Archive of obsolete content
« previousnext » this article builds upon the article creating a status bar extension, which creates a static status bar panel in the firefox status bar, by dynamically updating its content with information fetched from the web every few minutes.
...concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample code or to the previous sample for further details.
...update the chrome manifest the chrome manifest needs only a minor update from the previous sample; simply replace the id of the first sample, "status-bar-sample-1", with the name of the new sample, "stockwatcher".
...And 2 more matches
List of Mozilla-Based Applications - Archive of obsolete content
kompozer wysiwyg html editor unofficial bug-fix release of nvu kylo video browser uses gecko biofortis labmatrix web-accessible software application used for information management and integration of patient clinical, specimen, genetic and molecular assay data based on xul liaison groupware client for novell’s email and collaboration server previously called mozngw linbox kiosk browser (fr) web browser dedicated browser for french prefecture and town hall litl internet computer for home uses spidermonkey and gecko lizilayers gis application 3liz also creates some gis firefox add-ons logitech harmony remote software software for remote control device uses gre or xulrunner ...
... qsos xul editor tool for the qsos method qsos stands for qualification and selection of opensource software qtrax music client based on songbird quickstaf gui client for software testing automation framework uses xulrunner qutecom phone software previously named openwengo redcar text editor seems to use xulrunner red hat directory server server product uses nss red hat certificate system server product uses nss regex renamer tool to rename files sameplace im client scenari platform application suite for designing publishing chains script it ...
... part of instant-on operating system sqlite-manager database manager standalone version of add-on stealthsurfer secure internet tools on usb key uses firefox and thunderbird streambase complex event processing platform seems to use xulrunner stylizer css editor css editor css editor with built-in firebug-like diagnostics and gecko 1.8 preview sun java enterprise system server products uses nss sundial browser with advanced domain name technology based on firefox surfeasy private and secure web browsing sweet16 apple ii computer emulator uses spidermonkey as a scriptable debugger for software running in the emulator mozilla sunbird/mozilla lightning calendar ...
...And 2 more matches
Localizing an extension - Archive of obsolete content
« previousnext » this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension.
...if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension download the sample you can download this article's sample code so you can look at it side-by-side with the article, or to use it as a basis for your own extension.
...update the chrome manifest to let firefox know about the locale files, we need to make a revision to our chrome.manifest file, adding one line for each localization: locale stockwatcher2 en-us chrome/locale/ this instructs firefox that the en-us localization is located in the chrome/locale/en-us directory.
...And 2 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
el (dom): dom level 1, dom level 2 and parts of dom level 3 mathematical markup language: mathml version 2.0 extensible markup language (xml): xml 1.0, namespaces in xml, associating style sheets with xml documents 1.0, fragment identifier for xml xsl transformations: xslt 1.0 xml path language: xpath 1.0 resource description framework: rdf simple object access protocol: soap 1.1 ecma-262, revision 3 (javascript 1.5): ecma-262 general cross-browser coding tips even though web standards do exist, different browsers behave differently (in fact, the same browser may behave differently depending on the platform).
... previoussibling returns the node immediately preceding the current one.
... such timing-related issues are also hardware-related -- slower systems can reveal bugs that faster systems hide.
...And 2 more matches
Tamarin Build System Documentation - Archive of obsolete content
the next phase is started when all slaves have completed the previous phase successfully.
... create a user repository, instructions are https://developer.mozilla.org/en/publishing_mercurial_clones go to the request a sandbox build page http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm enter the repository url, revision number, email address, and description.
...; cd scripts edit environment.sh, change the basedir and buildsdir settings (around line 51) basedir=~/hg/tamarin-redux (path to my test repository) (next line) buildsdir=~/hg/builds (a directory to store downloaded builds) always set current working directory to the scripts directory when running a script run a script (e.g.) ../all/run-acceptance-release.sh <optional hg revision number like 1902> how do i navigate the build status page?
...And 2 more matches
Simple Example - Archive of obsolete content
« previousnext » let's look a more useful example, this time for a template that will show a list of photos.
...unlike previous examples where we iterated over a property to navigate the graph, here we want to iterate over the children of an rdf container.
... <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> the seed is set in a similar manner as the previous examples, effectively creating a single result with the ?start variable set to the reference resource 'http://www.xulplanet.com/rdf/myphotos'.
...And 2 more matches
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add event handlers to xbl-defined elements.
...the last example in the previous section demonstrated this.
... example, a custom checkbox might have a checked property which needs to be changed when the user clicks the checkbox: <handlers> <handler event="mouseup" action="this.checked=!this.checked"/> </handlers> when the user clicks and releases the mouse button over the check box, the mouseup event is sent to it, and the handler defined here is called, causing the state of the checked property to be reversed.
...And 2 more matches
More Button Features - Archive of obsolete content
« previousnext » in this section, we will look at some additional features of buttons.
...by setting this attribute to the value reverse, the image will be placed on the right side of the text.
...the same values are used, where normal means place the image above the text, and reverse means place the image below the text.
...And 2 more matches
Tree Box Objects - Archive of obsolete content
« previousnext » this section will describe the tree box object used to handle how a tree is displayed.
... redrawing the tree we already saw the rowcountchanged() function of the tree box object in the previous section.
...if you move the mouse around in the previous example, you might notice the label change between 'text' and 'cell'.
...And 2 more matches
Mozilla release FAQ - Archive of obsolete content
it is more suitable for being embedded in other applications than the previous rendering engine.
... gemini was a previous rendering engine project, renamed nglayout aurora is the navigation center in mozilla and navigator5 seamonkey refers to versions of mozilla based on xpfe and nglayout normandy refers to the mail/news branch of mozilla what are all these acronyms people are using in the newsgroup?
.../usr/include/stdlib.h:196: previous declaration of `seed48' see section 3.7 nothing looks much like an error, except something returned error status your compiler has a switch (probably) that prints everything it's doing (i.e.
...And 2 more matches
Using workers in extensions - Archive of obsolete content
« previous this article shows you how to use worker threads in extensions to perform tasks in the background without blocking the user interface.
... if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension localizing an extension updating an extension to support multiple mozilla applications download the sample you may download the complete example: download the example.
... how this differs from previous versions this version of the stock ticker extension moves the xmlhttprequest call that fetches updated stock information into a worker thread, which then passes that information back to the main body of the extension's code to update the display in the status bar.
...And 2 more matches
Reference - Archive of obsolete content
how should they be revised?
...if anyone disagrees, you can always revert.
...while also holding in account the previous example where it was avalable in both instances when prototyping object it should be : function->object->instance or (function=object)->instance and ofcourse function == object return false ;) and the following statements also tells me that function == object although math is only an instance of object...
...And 2 more matches
Desktop gamepad controls - Game development
previous overview: control mechanisms next now we'll look at adding something extra — support for gamepad controls, via the gamepad api.
... the buttons variable contains the layout of a given controller (for example which buttons are where, because an xbox 360 layout may be different to a generic one), the cache containing the information about the buttons from the previous frame and the status containing the information from the current frame.
... if(c.buttons[b].pressed) { pressed.push(gamepadapi.buttons.layout[b]); } } } var axes = []; if(c.axes) { for(var a=0,x=c.axes.length; a<x; a++) { axes.push(c.axes[a].tofixed(2)); } } gamepadapi.axes.status = axes; gamepadapi.buttons.status = pressed; return pressed; }, the function above clears the buttons cache, and copies their status from the previous frame to the cache.
...And 2 more matches
Mobile accessibility - Learn web development
previous overview: accessibility next with web access on mobile devices being so popular and renowned platforms such as ios and android having full-fledged accessibility tools, it is important to consider the accessibility of your web content on these platforms.
... prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, and an understanding of the previous articles in the course.
... global and local menus talkback allows you to access global and local context menus, wherever you have navigated to on the device.
...And 2 more matches
Practical positioning examples - Learn web development
next, add the following just below your previous css: .info-box { width: 450px; height: 400px; margin: 0 auto; } this sets a specific width and height on the content, and centers it on the screen using the old margin: 0 auto trick.
... previously in the course we advised against setting a fixed height on content containers if at all possible; it is ok in this circumstance because we have fixed content in our tabs.
... styling our tabs now we want to style tabs to look like tabs — basically, these are a horizontal navigation menu, but instead of loading different web pages when they are clicked on like we've seen previously in the course, they cause different panels to be displayed on the same page.
...And 2 more matches
Responsive design - Learn web development
previous overview: css layout next in the early days of web design, pages were built to target a particular screen size.
...media queries enable the type of layout switch that cameron adams had previously explored using javascript, using only css.
... user-scalable: prevents zooming if set to no.
...And 2 more matches
Fundamental text and font styling - Learn web development
note: if the above paragraph leaves you feeling confused, then no matter — go back and review our box model article, to brush up on the box model theory, before carrying on.
... a font-family example let's add to our previous example, giving the paragraphs a sans-serif font: p { color: red; font-family: helvetica, arial, sans-serif; } this gives us the following result: <h1>tommy the cat</h1> <p>well i remember it as though it were a meal ago...</p> <p>said tommy the cat as he reeled back to clear whatever foreign matter may have nestled its way into his mighty throat.
...but it was a rare occasion such as this that he did.</p> font size in our previous module's css values and units article, we reviewed length and size units.
...And 2 more matches
JavaScript basics - Learn web development
previous overview: getting started with the web next javascript is a programming language that adds interactivity to your website.
...you have already seen some uses of functions previously.
... supercharging our example website with this review of javascript basics completed (above), let's add some new features to our example site.
...And 2 more matches
What’s in the head? Metadata in HTML - Learn web development
previous overview: introduction to html next the head of an html document is the part that is not displayed in the web browser when the page is loaded.
... let's revisit the simple html document we covered in the previous article: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content ...
... active learning: experiment with character encoding to try this out, revisit the simple html template you obtained in the previous section on <title> (the title-example.html page), try changing the meta charset value to iso-8859-1, and add the japanese to your page.
...And 2 more matches
Function return values - Learn web development
previous overview: building blocks next there's one last essential concept about functions for us to discuss — return values.
... let's return to a familiar example (from a previous article in this series): let mytext = 'the weather is cold'; let newstring = mytext.replace('cold', 'warm'); console.log(newstring); // should print "the weather is warm" // the replace() string function takes a string, // replaces one substring with another, and returns // a new string with the replacement made the replace() function is invoked on the mytext string, and is passed two param...
...it is very useful to know and understand what values are returned by functions, so we try to include this information wherever possible.
...And 2 more matches
Handling text — strings in JavaScript - Learn web development
previous overview: first steps next next, we'll turn our attention to strings — this is what pieces of text are called in programming.
... creating a string to start with, enter the following lines: let string = 'the revolution will not be televised.'; string; just like we did with numbers, we are declaring a variable, initializing it with a string value, and then returning the value.
... the following will work if you previously defined the variable string — try it now: let badstring = string; badstring; badstring is now set to have the same value as string.
...And 2 more matches
Useful string methods - Learn web development
previous overview: first steps next now that we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
...\'li\');' + '\n listitem.textcontent = result;' + '\n list.appendchild(listitem);' + '\n }' + '\n}'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back;...
...lement(\'li\');' + '\n listitem.textcontent = result;' + '\n list.appendchild(listitem);' + '\n' + '\n}'; let solutionentry = jssolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back;...
...And 2 more matches
Object building practice - Learn web development
previous overview: objects next in previous articles we looked at all the essential javascript object theory and syntax details, giving you a solid base to start from.
...the finished example will look a little something like this: this example will make use of the canvas api for drawing the balls to the screen, and the requestanimationframe api for animating the whole display — you don't need to have any previous knowledge of these apis, and we hope that by the time you've finished this article you'll be interested in exploring them more.
...if it has, we reverse the polarity of the relevant velocity to make the ball travel in the opposite direction.
...And 2 more matches
Object prototypes - Learn web development
previous overview: objects next prototypes are the mechanism by which javascript objects inherit features from one another.
... you can check out existing prototype properties for yourself — go back to our previous example and try entering the following into the javascript console: person.prototype the output won't show you very much because we haven't defined anything on our custom constructor's prototype!
... revisiting create() earlier on we showed how the object.create() method can be used to create a new object instance.
...And 2 more matches
TypeScript support in Svelte - Learn web development
previous overview: client-side javascript frameworks next in the last article we learned about svelte stores and even implemented our own custom store to persist the app's information to web storage.
...on class="btn toggle-btn" class:btn__primary={filter === filter.completed} aria-pressed={filter === filter.completed} on:click={()=> filter = filter.completed} > <span class="visually-hidden">show</span> <span>completed</span> <span class="visually-hidden">tasks</span> </button> </div> here we are just importing the filter enum, and using it instead of the string values we used previously.
... to fix it, replace tabindex="-1" with tabindex={-1}, like this: <h2 id="list-heading" bind:this={headingel} tabindex={-1}>{completedtodos} out of {totaltodos} items completed</h2> this way typescript can prevent us from incorrectly assigning it to a string variable.
...And 2 more matches
Deployment and next steps - Learn web development
previous overview: client-side javascript frameworks in the previous article we learning about svelte's typescript support, and how to use it to make your application more robust.
... you can also check the progress of the current and previous jobs from the ci / cd > jobs menu option of your gitlab project.
... if you prefer to read books, there's svelte and sapper in action by mark volkman, expected to be published in september 2020, but which you can already preview online for free.
...And 2 more matches
Working with Svelte stores - Learn web development
previous overview: client-side javascript frameworks next in the last article we completed the development of our app, finished organizing it into components, and discussed some advanced techniques for dealing with reactivity, working with dom nodes, and exposing component functionality.
...so our previous code block can be replaced with this: <script> import mystore from './stores.js' </script> {$mystore} and $mystore will be fully reactive.
...we'll also take care of clearing the timeout when the alert component is unmounted to prevent memory leaks.
...And 2 more matches
Implementing feature detection - Learn web development
previous overview: cross browser testing next feature detection involves working out whether a browser supports a certain block of code, and running different code depending on whether it does (or doesn't), so that the browser can always provide a working experience rather than crashing/erroring in some browsers.
... for example, we could rewrite our previous example to use @supports — see supports-feature-detect.html and supports-styling.css.
... @supports also has or and not logic available — the other block applies the float layout if the flexbox properties are not available: @supports not (flex-flow: row) and (flex: 1) { /* rules in here */ } this may look a lot more convenient than the previous example — we can do all of our feature detection in css, no javascript required, and we can handle all the logic in a single css file, cutting down on http requests.
...And 2 more matches
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
when you press the keyboard's return button, the 'submit' event is fired, which we handle like this: urlform.addeventlistener('submit',function(e) { e.preventdefault(); browser.src = urlbar.value; urlbar.blur(); }); we first call preventdefault() to stop the form just submitting and reloading the page — which is really not what we want.
...then, we disable the "previous" and "next" search item buttons so that they don't run anything unless there are search items to cycle between.
... var searchactive = false; prev.disabled = true; next.disabled = true; next, we add an event listener to the searchform so that when it is submitted, the htmliframeelement.findall() method is used to do a search for the string entered into the search input element (searchbar) within the text of the current page (the second parameter can be changed to 'case-insensitive' if you want a case-insensitive search.) we then enable the previous and next buttons, set searchactive to true, and blur() the search bar to make the keyboard disappear and stop taking up our screen once the search is submitted.
...And 2 more matches
Profiling with the Firefox Profiler
as you zoom in on ranges, breadcrumbs are created allowing you to easily navigate back to previously-selected ranges or the entire profile (denoted as "full range").
... tip: while zooming out to a previously-selected range deletes the narrower range, the browser back button can be used to restore the narrower range.
...so, for example, when a thread is blocked, like 'geckomain [tab]', on a thread like 'geckomain [default]', we can see what's occurring on the latter thread that is preventing it from responding to the former.
...And 2 more matches
NSS 3.12.4 release notes
currently nss 3.12.4 is in the "review pending" state in the fips 140-2 pre-validation list at http://csrc.nist.gov/groups/stm/cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h).
... 470500: firefox 3.1b2 crash report [[@ nssutil3.dll@0x34c0 ] bug 482742: enable building util independently of the rest of nss bug 483653: unable to build certutil.exe for fennec/wince bug 485145: miscellaneous crashes in signtool on windows bug 485155: nss_enable_pkix_verify=1 causes sec_error_unknown_issuer errors bug 485527: rename the _x86_ macro in lib/freebl bug 485658: vfychain -p reports revoked cert bug 485745: modify fipstest.c to support cavs 7.1 drbg testing bug 486304: cert7.db/cert8.db corruption when importing a large certificate (>64k) bug 486405: allocator mismatches in pk12util.c bug 486537: disable execstack in freebl x86_64 builds on linux bug 486698: facilitate the building of major components independently and in a chain manner by downstream distributions bug 486999: ca...
...lling ssl_setsockpeerid a second time leaks the previous value bug 487007: make lib/jar conform to nss coding style bug 487162: ckfw/capi build failure on windows bug 487239: nssutil.rc doesn't compile on wince bug 487254: sftkmod.c uses posix file io functions on wince bug 487255: sdb.c uses posix file io functions on wince bug 487487: cert_nametoascii reports !invalid ava!
...And 2 more matches
NSS Developer Tutorial
whether such a change is safe needs to be reviewed on a case-by-case basis.
... nss review/feature approval process nss doesn’t have 'super reviewers'.
... one review is usually enough for the review to pass.
...And 2 more matches
NSS PKCS11 Functions
the module should have previously been loaded by secmod_loadusermodule.
...optimizespace - allocate smaller hash tables and lock tables.when this flag is not specified, softoken will allocatelarge tables to prevent lock contention.
...to retrieve its current value, use ssl_revealpinarg.
...And 2 more matches
NSS_3.12.3_release_notes.html
in anticipation of that, the nss team has provided ways to easily cause nss to revert to its previous behavior through the use of environment variables.
... bug 394077: libpkix need to return revocation status of a cert bug 412468: modify certutil bug 417092: modify pkix_certselector api to return an error if cert was rejected.
... bug 472319: vfychain validates chain even if revoked certificate.
...And 2 more matches
Hacking Tips
(gdb) x /5i $pc - 1 0x7ffff7fb1659: int3 => 0x7ffff7fb165a: mov 0x28(%rsp),%rax 0x7ffff7fb165f: mov %eax,%ecx 0x7ffff7fb1661: mov 0x30(%rsp),%rdx 0x7ffff7fb1666: mov %edx,%ebx (gdb) # replace the int3 by a nop (gdb) set *(unsigned char *) ($pc - 1) = 0x90 (gdb) x /1i $pc - 1 0x7ffff7fb1659: nop (gdb) # set a breakpoint at the previous location (gdb) b *0x7ffff7fb1659 breakpoint 2 at 0x7ffff7fb1659 printing ion generated assembly code (from gdb) if you want to look at the assembly code generated by ionmonkey, you can follow this procedure: place a breakpoint at codegenerator.cpp on the codegenerator::link method.
... (gdb) bt #0 0x00000000007eaad4 in js::inlinelist<js::jit::mbasicblock>::begin() const (this=0x33dbbc0) at …/js/src/jit/inlinelist.h:280 #1 0x00000000007cb845 in js::jit::mirgraph::begin() (this=0x33dbbc0) at …/js/src/jit/mirgraph.h:787 #2 0x0000000000837d25 in js::jit::buildphireversemapping(js::jit::mirgraph&) (graph=...) at …/js/src/jit/ionanalysis.cpp:2436 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 … (gdb) frame 3 #3 0x000000000083317f in js::jit::optimizemir(js::jit::mirgenerator*) (mir=0x33dbdf0) at …/js/src/jit/ion.cpp:1570 (gdb) iongraph mir function 0 (asm.js compilation): success; 1...
...ument(nsrect const&, unsigned int, unsigned int, gfxcontext*)' set print object on set $x = <your x value> set $y = <your y value> print &((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).data[$y * ((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).stride + $x * ((cairo_image_surface_t*)athebescontext->mdt.mrawptr->msurface).depth / 8] watch *(char*)<address of previous command> (note: if you set a watch on the previous expression gdb will watch the expression and run out of watchpoint) rr with emacs within emacs, do m-x gud-gdb and replace the command line with rr replay.
...And 2 more matches
SpiderMonkey 1.8.7
on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... spidermonkey 1.8.7 is not binary-compatible with previous releases, nor is it source-code compatible.
...previous spidermonkey versions usually represented integer values smaller than 2^31 as jsvals encoding jsint; e.g.
...And 2 more matches
SpiderMonkey 38
it continues to improve performance over previous spidermonkey releases, with xxx blah blah blah.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... xxx list removed features here spidermonkey 38 is not binary-compatible with previous releases, nor is it source-code compatible.
...And 2 more matches
Shell global objects
this hook is used to look up a previously loaded module object.
... printprofilerevents() register a callback with the profiler that prints javascript profiler events to stderr.
... setpromiserejectiontrackercallback() sets the callback to be invoked whenever a promise rejection is unhandled or a previously-unhandled rejection becomes handled.
...And 2 more matches
nsIAnnotationService
methods setpageannotation() this method sets an annotation for given uri, overwriting any previous annotation with the same url/name.
... setitemannotation() this method sets an annotation for given item, overwriting any previous annotation with the same url/name.
... setpageannotationstring() this method sets an annotation for given uri by taking a string as input value, overwriting any previous annotation with the same url/name.
...And 2 more matches
nsIAutoCompleteInput
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring getsearchat(in unsigned long index); void onsearchbegin(); void onsearchcomplete(); boolean ontextentered(); boolean ontextreverted(); void selecttextrange(in long startindex, in long endindex); attributes attribute type description completedefaultindex boolean if a search result has its defaultindex set, this will optionally try to complete the text in the textbox to the entire text of the result at the default index as the user types.
...return value return true to prevent handling the selection.
... ontextreverted() called when the user cancels the autocomplete session.
...And 2 more matches
nsITextInputProcessor
key_default_prevented 0x00000001 one of akeyflags.
... when this is specified, defaultprevented attribute of dispatching keyboard events true.
...therefore, this can prevent non-printable key events to cause dispatching as printable keyboard events and you can detect the registered key name change from the thrown exception.
...And 2 more matches
Thunderbird Binaries
described below are three types of generally available thunderbird packages - releases, early preview releases, and nightly builds (including trunk development builds) - and their downloaded locations.
... thunderbird current release can be downloaded from https://www.mozilla.org/thunderbird/ past thunderbird releases can be downloaded from https://releases.mozilla.org/pub/thunderbird/releases/ early preview releases whilst writing new versions of thunderbird, developers release preview versions, known as betas.
... note: while beta builds have had some testing, they should be considered preview only and should not be used in a production environment.
...And 2 more matches
WebIDL bindings
this is a signal that you need to get a review from a dom peer.
... resist the urge to just add your interfaces to the moz.build list without the review; it will just annoy the dom peers and they'll make you get the review anyway.
...if areportexceptions is set to erethrowexceptions, js exceptions will be stashed in the errorresult and will be reported when the stack unwinds to wherever the errorresult was set up.
...And 2 more matches
Mozilla
bugzilla bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects.
...or, alternatively, the conditions can be reversed (a != test rather than an == test).
... signing mozilla apps for mac os x mac os x's gatekeeper functionality prevents users from launching applications that haven't been code-signed, in order to help keep their computers secure.
...And 2 more matches
Debugger.Frame - Firefox Developer Tools
similarly, walking the stack back to a previously accessed frame yields the same frame object as before.
... visible frames when inspecting the call stack, debugger does not reveal all the frames that are actually present on the stack: while it does reveal all frames running debuggee code, it omits frames running the debugger’s own code, and omits most frames running non-debuggee code.
... we call those stack frames a debugger does reveal visible frames.
...And 2 more matches
All keyboard shortcuts - Firefox Developer Tools
command windows macos linux delete the selected node delete delete delete undo delete of a node ctrl + z cmd + z ctrl + z redo delete of a node ctrl + shift + z / ctrl + y cmd + shift + z / cmd + y ctrl + shift + z / ctrl + y move to next node (expanded nodes only) down arrow down arrow down arrow move to previous node up arrow up arrow up arrow move to first node in the tree.
...+ f ctrl + f edit as html f2 f2 f2 stop editing html f2 / ctrl +enter f2 / cmd + return f2 / ctrl + enter copy the selected node's outer html ctrl + c cmd + c ctrl + c scroll the selected node into view s s s find the next match in the markup, when searching is active enter return enter find the previous match in the markup, when searching is active shift + enter shift + return shift + enter breadcrumbs bar these shortcuts work when the breadcrumbs bar is focused.
... command windows macos linux move to the previous element in the breadcrumbs bar left arrow left arrow left arrow move to the next element in the breadcrumbs bar right arrow right arrow right arrow focus the html pane shift + tab shift + tab shift + tab focus the css pane tab tab tab css pane these shortcuts work when you're in the inspector's css pane.
...And 2 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
*/ function is_ignorable( nod ) { return ( nod.nodetype == 8) || // a comment node ( (nod.nodetype == 3) && is_all_ws(nod) ); // a text node, all ws } /** * version of |previoussibling| that skips nodes that are entirely * whitespace or comments.
... (normally |previoussibling| is a property * of all dom nodes that gives the sibling node, the node that is * a child of the same parent, that occurs immediately before the * reference node.) * * @param sib the reference node.
... * @return either: * 1) the closest previous sibling to |sib| that is not * ignorable according to |is_ignorable|, or * 2) null if no such node exists.
...And 2 more matches
Event.returnValue - Web APIs
WebAPIEventreturnValue
the event property returnvalue indicates whether the default action for this event has been prevented or not.
...setting this property to false prevents the default action.
...you should use preventdefault(), and defaultprevented instead of this historical property.
...And 2 more matches
HTMLElement.focus() - Web APIs
this object may contain the following property: preventscroll optional a boolean value indicating whether or not the browser should scroll the document to bring the newly-focused element into view.
... a value of false for preventscroll (the default) means that the browser will scroll the element into view after focusing it.
... if preventscroll is set to true, no scrolling will occur.
...And 2 more matches
Intersection Observer API - Web APIs
reporting of visibility of advertisements in order to calculate ad revenues.
... const numsteps = 20.0; let boxelement; let prevratio = 0.0; let increasingcolor = "rgba(40, 40, 190, ratio)"; let decreasingcolor = "rgba(190, 40, 40, ratio)"; // set things up window.addeventlistener("load", (event) => { boxelement = document.queryselector("#box"); createobserver(); }, false); the constants and variables we set up here are: numsteps a constant which indicates how many thresholds we want to have between a visibility...
... prevratio this variable will be used to record what the visibility ratio was the last time a threshold was crossed; this will let us figure out whether the target element is becoming more or less visible.
...And 2 more matches
KeyboardEvent.getModifierState() - Web APIs
if (event.getmodifierstate("control") + event.getmodifierstate("alt") + event.getmodifierstate("meta") > 1) { return; } // handle shortcut key with standard modifier if (event.getmodifierstate("accel")) { switch (event.key.tolowercase()) { case "c": if (event.getmodifierstate("shift")) { // handle accel + shift + c event.preventdefault(); // consume the key event } break; case "k": if (!event.getmodifierstate("shift")) { // handle accel + k event.preventdefault(); // consume the key event } break; } return; } // do somethig different for arrow keys if scrolllock is locked.
... if ((event.getmodifierstate("scrolllock") || event.getmodifierstate("scroll") /* hack for ie */) && !event.getmodifierstate("control") && !event.getmodifierstate("alt") && !event.getmodifierstate("meta")) { switch (event.key) { case "arrowdown": case "down": // hack for ie and old gecko event.preventdefault(); // consume the key event break; case "arrowleft": case "left": // hack for ie and old gecko // do something different if scrolllock is locked.
... event.preventdefault(); // consume the key event break; case "arrowright": case "right": // hack for ie and old gecko // do something different if scrolllock is locked.
...And 2 more matches
PerformanceTiming - Web APIs
performancetiming.navigationstart read only when the prompt for unload terminates on the previous document in the same browsing context.
... if there is no previous document, this value will be the same as performancetiming.fetchstart.
... performancetiming.unloadeventstart read only when the unload event has been thrown, indicating the time at which the previous document in the window began to unload.
...And 2 more matches
Pinch zoom gestures - Web APIs
// global vars to cache event state var evcache = new array(); var prevdiff = -1; register event handlers event handlers are registered for the following pointer events: pointerdown, pointermove and pointerup.
...t in the cache and update its record with this event for (var i = 0; i < evcache.length; i++) { if (ev.pointerid == evcache[i].pointerid) { evcache[i] = ev; break; } } // if two pointers are down, check for pinch gestures if (evcache.length == 2) { // calculate the distance between the two pointers var curdiff = math.abs(evcache[0].clientx - evcache[1].clientx); if (prevdiff > 0) { if (curdiff > prevdiff) { // the distance between the two pointers has increased log("pinch moving out -> zoom in", ev); ev.target.style.background = "pink"; } if (curdiff < prevdiff) { // the distance between the two pointers has decreased log("pinch moving in -> zoom out",ev); ev.target.style.background = "lightblue"; } ...
... } // cache the distance for the next move event prevdiff = curdiff; } } pointer up the pointerup event is fired when a pointer is raised from the contact surface.
...And 2 more matches
RTCPeerConnection - Web APIs
such an event is sent when an identity assertion is generated, via getidentityassertion() or during the creation of an offer or an answer.onidpassertionerror the rtcpeerconnection.onidpassertionerror event handler is a property containing the code to execute whent the idpassertionerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection.
... such an event is sent when the associated identity provider (idp) encounters an error while generating an identity assertion.onidpvalidationerror the rtcpeerconnection.onidpvalidationerror event handler is a property containing the code to execute whent the idpvalidationerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection.
... icecandidateerror an error of type rtcpeerconnectioniceerrorevent which is sent to the connection if an error occurred during ice candidate gathering.
...And 2 more matches
SVGTransformList - Web APIs
if the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...And 2 more matches
Screen Wake Lock API - Web APIs
the screen wake lock api provides a way to prevent devices from dimming or locking the screen when an application needs to keep running.
... the screen wake lock api prevents the screen from turning off, dimming or locking.
... screen wake lock api interfaces wakelock the wakelock interface prevents device screens from dimming or locking when an application needs to keep running.
...And 2 more matches
Matrix math for the web - Web APIs
when matrices of a certain class are multiplied together they preserve the history of the transformations and are reversible.
... this means that if a translation, rotation, and scale matrix are all combined together, when the order of the matrices is reversed and re-applied then the original points are returned.
... another mind-bender is that matrix multiplication in webgl and css needs to happen in the reverse order that the operations intuitively happen.
...And 2 more matches
Using shaders to apply color in WebGL - Web APIs
« previousnext » having created a square plane in the previous demonstration, the next obvious step is to add a splash of color to it.
... we can do this by revising the shaders.
...previously, our vertex shader didn't apply any specific colors to the vertices.
...And 2 more matches
Using textures in WebGL - Web APIs
« previousnext » now that our sample program has a rotating 3d cube, let's map a texture onto it instead of having its faces be solid colors.
...gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); // prevents s-coordinate wrapping (repeating).
... gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); // prevents t-coordinate wrapping (repeating).
...And 2 more matches
WebRTC API - Web APIs
error an rtcerrorevent indicating that an error occurred on the data channel.
... error an rtcerrorevent indicating that an error occurred on the rtcdtlstransport.
... icecandidateerror an rtcpeerconnectioniceerrorevent indicating that an error has occurred while gathering ice candidates.
...And 2 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
once you've determined the matrix representing the combination of movements you wish the camera to make, you need to reverse it, because you're not moving the camera.
...using the glmatrix library we've used previously, this can be performed using the rotatey() method on the mat4 class, which represents a standard 4x4 matrix.
...previously, we performed our translations like this: mat4.translate(viewmatrix, viewmatrix, [-trackdistance, 0, 0]); mat4.translate(viewmatrix, viewmatrix, [0, -pedestaldistance, 0]); mat4.translate(viewmatrix, viewmatrix, [0, 0, dollyydistance]); the solution here is obvious.
...And 2 more matches
Geometry and reference spaces in WebXR - Web APIs
const radians_per_degree = math.pi / 180.0; let degreestoradians = (deg) => deg * radians_per_degree; let radianstodegrees = (rad) => rad / radians_per_degree; times and durations note that for security reasons, domhighrestimestamp usually introduces a small amount of imprecision to the clock in order to prevent it from being used in fingerprinting and timing-based attacks.
... time is primarily used to determine the amount of time that's elapsed since the scene's previous animation frame was drawn.
...in virtual reality (vr), it's all about creating a sense of space in which the user's movements are precisely matched by the imagery presented on the virtual display, to prevent disjoints and disconnects that could cause discomfort or worse.
...And 2 more matches
Rendering and the WebXR frame animation callback - Web APIs
tearing occurs when the the display hardware starts the next refresh cycle while the previous frame is still being drawn to the screen.
... as a result, you wind up with the visual effect of the top part of the screen showing the new frame, while the bottom part of the frame shows some combination of the previous frame and possibly even the frame before that one.
... we then get the xrviewerpose object that describes the viewer's pose—their position and orientation—using the frame's getviewerpose() method, passing in the viewer's reference space from the viewerrefspace previously obtained while setting up the webxr session.
...And 2 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
this commonly happens when your user interface provides a way to preview the scene inline within the context of a web page, with a button or other control to switch to immersive mode.
... let previousviewerpose = null; function mydrawframe(currentframetime, frame) { let session = frame.session; let viewerpose = frame.getviewerpose(viewerrefspace); animationframerequestid = session.requestanimationframe(mydrawframe); if (viewerpose) { if (!previousviewerpose) { previousviewerpose = viewerpose; } let offsetmatrix = mat4.create(); mat4.sub(offsetmatrix, previ...
...ousviewerpose.transform.matrix, viewerpose.transform.matrix); previousviewerpose = viewerpose; } } continuity and recovery after tracking loss sometimes, while the user is actively using their xr hardware with your app, the flow of data containing updates as to the user's position and orientation might be lost for a period of time.
...And 2 more matches
Window - Web APIs
WebAPIWindow
window.customelements read only returns a reference to the customelementregistry object, which can be used to register new custom elements and get information about previously registered custom elements.
... window.cancelanimationframe() enables you to cancel a callback previously scheduled with window.requestanimationframe.
... window.cancelidlecallback() enables you to cancel a callback previously scheduled with window.requestidlecallback.
...And 2 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
you can try this out in the example below, which has a flex container with flex-direction: column yet otherwise is exactly the same as the previous example.
... alignment and flex-direction the start line will also change if you change the flex-direction property — for example using row-reverse instead of row.
... in this next example i have items laid out with flex-direction: row-reverse and justify-content: flex-end.
...And 2 more matches
all - CSS: Cascading Style Sheets
WebCSSall
syntax /* global values */ all: initial; all: inherit; all: unset; /* css cascading and inheritance level 4 */ all: revert; the all property is specified as one of the css global keyword values.
... revert specifies behavior that depends on the stylesheet origin to which the declaration belongs: user-agent origin equivalent to unset.
...for purposes of revert, the author origin includes the override and animation origins.
...And 2 more matches
box-direction - CSS: Cascading Style Sheets
the -moz-box-direction will only be used for xul while the previous standard box-direction has been replaced by flex-direction.
... the box-direction css property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge).
... /* keyword values */ box-direction: normal; box-direction: reverse; /* global values */ box-direction: inherit; box-direction: initial; box-direction: unset; syntax the box-direction property is specified as one of the keyword values listed below.
...And 2 more matches
writing-mode - CSS: Cascading Style Sheets
the next horizontal line is positioned below the previous line.
... vertical-rl for ltr scripts, content flows vertically from top to bottom, and the next vertical line is positioned to the left of the previous line.
... for rtl scripts, content flows vertically from bottom to top, and the next vertical line is positioned to the right of the previous line.
...And 2 more matches
Video player styling basics - Developer guides
in the previous cross browser video player article we described how to build a cross-browser html5 video player using the media and fullscreen apis.
... html markup there are a few changes that were made to the html markup shown in the previous article.
... <span id="progress-bar"></span> </progress> </div> <button id="mute" type="button" data-state="mute">mute/unmute</button> <button id="volinc" type="button" data-state="volup">vol+</button> <button id="voldec" type="button" data-state="voldown">vol-</button> <button id="fs" type="button" data-state="go-fullscreen">fullscreen</button> </div> related css alteration the previous article simply set the display property of the video controls to block in order to display them.
...And 2 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
while we won't use every single property mentioned previously, we'll look at a couple of examples.
... css we'll look at the css to create the above results a piece at a time, so we can review the interesting parts one by one.
...it's configured to float the box to the right so that it appears next to the previous box.
...And 2 more matches
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
accessibility concerns with viewport scaling disabling zooming capabilities by setting user-scalable to a value of no prevents people experiencing low vision conditions from being able to read and understand page content.
... google, yahoo, bing nosnippet prevents displaying any description of the page in search engine results.
...do not expect to prevent e-mail harvesters with them.
...And 2 more matches
HTTP conditional requests - HTTP
such requests can be useful to validate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when resuming a download, or when preventing to lose updates when uploading or modifying a document on the server.
... integrity of a partial download partial downloading of files is a functionality of http that allows to resume previous operations, saving bandwidth and time, by keeping the already obtained information: a server supporting partial downloads broadcasts this by sending the accept-ranges header.
... to prevent this, conditional requests are used.
...And 2 more matches
Using HTTP cookies - HTTP
WebHTTPCookies
a simple cookie is set like this: set-cookie: <cookie-name>=<cookie-value> this shows the server sending headers to tell the client to store a pair of cookies: http/2.0 200 ok content-type: text/html set-cookie: yummy_cookie=choco set-cookie: tasty_cookie=strawberry [page content] then, with every subsequent request to the server, the browser sends back all previously stored cookies to the server using the cookie header.
...this technique helps prevent session fixation attacks, where a third party can reuse a user's session.
...however, do not assume that secure prevents all access to sensitive information in cookies; for example, it can be read by someone with access to the client's hard disk.
...And 2 more matches
Network Error Logging - HTTP
http 400 (bad request) response { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } dns name not resolved note that the phase is set to dn...
... { "age": 20, "type": "network-error", "url": "https://example.com/previous-page", "body": { "elapsed_time": 18, "method": "post", "phase": "dns", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "", "status_code": 0, "type": "dns.name_not_resolved", "url": "https://example-host.com/" } } the type of the network error may be one of the following pre-defined values from the specification, but browsers can add and send their own error types: dns.unreachable the user's dns server is unreachable dns.name_not_resolved the user's dns server responded but was unable to resolve an ip address for the requested uri.
... dns.failed request to the dns server failed due to reasons not covered by previous errors (e.g.
...And 2 more matches
Proxy servers and tunneling - HTTP
there are two types of proxies: forward proxies (or tunnel, or gateway) and reverse proxies (used to control and protect access to a server for load-balancing, authentication, decryption or caching).
... reverse proxies as the name implies, a reverse proxy does the opposite of what a forward proxy does: a forward proxy acts in behalf of clients (or requesting hosts), a reverse proxy acts in behalf of servers.
... forward proxies can hide the identities of clients whereas reverse proxies can hide the identities of servers.
...And 2 more matches
HTTP response status codes - HTTP
WebHTTPStatus
305 use proxy defined in a previous version of the http specification to indicate that a requested response must be accessed by a proxy.
...it was used in a previous version of the http/1.1 specification.
... 408 request timeout this response is sent on an idle connection by some servers, even without any previous request by the client.
...And 2 more matches
Details of the object model - JavaScript
« previousnext » javascript is an object-based language based on prototypes, rather than being class-based.
...some subtleties of this process are discussed in property inheritance revisited.
...this chapter uses this idiom for brevity; however, it can be puzzling at first glance.
...And 2 more matches
TypeError: can't define property "x": "obj" is not extensible - JavaScript
the javascript exception "can't define property "x": "obj" is not extensible" occurs when object.preventextensions() marked an object as no longer extensible, so that it will never have properties beyond the ones it had at the time it was marked as non-extensible.
...however, in this case object.preventextensions() marked an object as no longer extensible, so that it will never have properties beyond the ones it had at the time it was marked as non-extensible.
... 'use strict'; var obj = {}; object.preventextensions(obj); obj.x = 'foo'; // typeerror: can't define property "x": "obj" is not extensible in both, strict mode and sloppy mode, a call to object.defineproperty() throws when adding a new property to a non-extensible object.
...And 2 more matches
TypedArray.prototype.reduce() - JavaScript
syntax typedarray.reduce(callback[, initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or initialvalue, if supplied (see below).
... description the reduce method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring.
... the first time the callback is called, previousvalue and currentvalue can be one of two values.
...And 2 more matches
Lexical grammar - JavaScript
unicode format-control characters code point name abbreviation description u+200c zero width non-joiner <zwnj> placed between characters to prevent being connected into ligatures in certain languages (wikipedia).
... white space characters code point name abbreviation description escape sequence u+0009 character tabulation <ht> horizontal tabulation \t u+000b line tabulation <vt> vertical tabulation \v u+000c form feed <ff> page breaking control character (wikipedia).
... line terminator characters code point name abbreviation description escape sequence u+000a line feed <lf> new line character in unix systems.
...And 2 more matches
Authoring MathML - MathML
for example, the xhtml version of the previous example looks like this: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.1 plus mathml 2.0//en" "http://www.w3.org/math/dtd/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>xhtml+mathml example</title> </head> <body> <h1>xhtml+mathml example</h1> <p> square root of two: <math xmlns="http://www.w3.org/19...
...even if your browser supports mathml, your webmail may prevent you to send or receive mails with mathml inside.
...one of the advantage of jqmath over the previous scripts is that it will automatically add some simple css rules to do the mathematical layout and make the formulas readable on browsers with limited mathml support.
...And 2 more matches
Navigation and resource timings - Web Performance
the order is: performance timings details navigationstart when the prompt for unload terminates on the previous document in the same browsing context.
... if there is no previous document, this value will be the same as performancetiming.fetchstart.
... unloadeventstart when the unload> event has been thrown, indicating the time at which the previous document in the window began to unload.
...And 2 more matches
orient - SVG: Scalable Vector Graphics
WebSVGAttributeorient
only one element is using this attribute: <marker> html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <marker id="dataarrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="-65deg"> <path d="m 0 0 l 10 5 l 0 10 z" fill="red" /> </marker> </defs> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <...
...polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dataarrow)" marker-mid="url(#dataarrow)" marker-end="url(#dataarrow)" /> </svg> usage notes value auto | auto-start-reverse | <angle> | <number> default value 0 animatable yes (non-additive) auto this value indicates that the marker is oriented such that its positive x-axis is pointing in a direction relative to the path at the position the marker is placed.
... auto-start-reverse if placed by marker-start, the marker is oriented 180° different from the orientation that would be used if auto where specified.
...And 2 more matches
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
one can override default browser behaviors with the evt.preventdefault( ) method, add eventlisteners to objects with the syntax element.addeventlistener(event, function, usecapture), and set element properties with syntax svgelement.style.setproperty("fill-opacity", "0.0", "").
... preventing default behavior in event code when writing drag and drop code, sometimes you'll find that text on the page gets accidently selected while dragging.
... or if you want to use the backspace key in your code, you want to override the browser's default behavior when the backspace key is pressed, which is to go back to the previous page.
...And 2 more matches
Interacting with page scripts - Archive of obsolete content
expose objects to page scripts until firefox 30, you could use unsafewindow to perform the reverse procedure, and make objects defined in content scripts available to page scripts: // content-script.js unsafewindow.contentscriptobject = {"greeting" : "hello from add-on"}; // page-script.js var button = document.getelementbyid("show-content-script-var"); button.addeventlistener("click", function() { // access object defined by content script console.log(window.contentscriptobject.
...now the page script can call the function as foo.greetme(): <html> <head> </head> <body> <input id="test" type="button" value="click me"/> <script> var test = document.getelementbyid("test"); test.addeventlistener("click", function() { alert(window.foo.greetme("page script")); }, false); </script> </body> </html> reverting to the old behavior you can switch firefox back to the old behavior in which content scripts could expose objects and functions to page scripts using unsafewindow.
... listen for messages from the content script: <!doctype html> <html> <head></head> <body> <script> window.addeventlistener('message', function(event) { window.alert(event.data); // message from content script }, false); </script> </body> </html> page script to content script sending messages from the page script to the content script is just the same, but in reverse.
... sendcustomevent() { var greeting = {"greeting" : "hello world"}; var cloned = cloneinto(greeting, document.defaultview); var event = new customevent("addon-message", { bubbles: true, detail: cloned }); document.documentelement.dispatchevent(event); } page script to content script sending messages using custom dom events from the page script to the content script is just the same, but in reverse.
Content Scripts - Archive of obsolete content
this makes your code easier to maintain, secure, debug and review.
...this makes your code easier to maintain, secure, debug and review.
... the same applies in reverse: page scripts can't see javascript objects added by content scripts.
...'], contentscriptfile: self.data.url("content-script.js"), onattach: startlistening }); function startlistening(worker) { worker.port.on('click', function(html) { worker.port.emit('warning', 'do not click this again'); }); } // content-script.js window.addeventlistener('click', function(event) { self.port.emit('click', event.target.tostring()); event.stoppropagation(); event.preventdefault(); }, false); self.port.on('warning', function(message) { window.alert(message); }); in the add-on above there are two messages: click is sent from the page-mod to the add-on, when the user clicks an element in the page warning sends a silly string back to the page-mod from tab.attach() the tab.attach() method returns the worker you can use to communicate with the content sc...
Examples and demos from articles - Archive of obsolete content
[article] image preview before upload [html] the filereader.prototype.readasdataurl() method is useful, for example, to get a preview of an image before uploading it.
...for a full compatibility code, see also our crossbrowser possible solution for image preview.
....[article] pure-css web gallery based on the :hover pseudoclass [zip] you can use the :hover pseudo-class in order to build an image gallery with full-size images shown only when mouse goes over previews.
... .[article] pure-css web gallery based on the :checked pseudoclass [zip] you can also use the :checked pseudo-class applied to hidden radioboxes in order to build, for example, an image gallery with full-size images shown only when mouse clicks on previews.
Extension Etiquette - Archive of obsolete content
prefix names in shared namespaces when shared namespaces can't be avoided, the simplest solution to prevent conflicts is to use a distinct prefix for all of your names.
... some namespaces have specific conflict prevention conventions, which should be followed as appropriate.
... call .noconflict(true) where applicable many common libraries which create global variables provide a method called noconflict, or similar, which revert any global variables they've declared, and return the object itself.
... when available, these methods should always be used to prevent conflicts with third-party code.
Handling Preferences - Archive of obsolete content
« previousnext » preferences in firefox mozilla applications are highly customizable.
...right-clicking on the list reveals several options that allow you to modify preference values and add new ones.
...if you are going to use xpcom, you should always set a default value to your preferences, or use a try / catch block to prevent unhandled errors.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Mozilla Documentation Roadmap - Archive of obsolete content
« previousnext » mozilla documentation firefox extension development is still an immature discipline, with a developer base consisting mostly of hobbyists and just a few organized development groups.
...this blog is maintained by the add-ons team at mozilla, and it's a great way to stay up to date with amo development and add-on review policies.
...problems using irc include: finding help when you have a big timezone difference with the united states, and no records of previously asked questions and their answers.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Adding preferences to an extension - Archive of obsolete content
« previousnext » this article takes the creating a dynamic status bar extension sample to the next level, adding a popup menu that lets you quickly switch between multiple stocks to watch.
... as before, concepts covered in the previous articles in this series won't be rehashed here, so if you haven't already seen them: creating a status bar extension creating a dynamic status bar extension also, for reference, you may want to take a look at preferences system and the preferences api.
... refreshinformation() this method is slightly revised from previous versions, in that it needs to fetch the preference for the stock to watch and use that to construct the url to monitor, as well as to construct the string to be displayed in the status bar panel.
... « previousnext » override chrome://myaddon/content/options.xul chrome://myaddon/content/oldoptions.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} appversion<=6.* examples github - gist :: _ff-addon-template-bootstrapprefsskeleton - this gist here is a fully working example of a fully funcitonal preferences skeleton, it uses the observer example from above.
MMgc - Archive of obsolete content
normally, a pointer to the object is considered a hard reference -- any such reference will prevent the object from being destroyed.
...classic reference counting previous versions of the flash player, up to flash player 7, used reference counting to track object lifetimes.
...he following reasons: coordinating the marking thread and the main thread will require locking and may suffer due to lock overhead/contention supporting mac classic's cooperative threads makes this approach harder flash's frame based architecture gives us a very natural place to do this work we have better control over how much time is spent marking without threads when smp systems become more prevalent it may be worth investigating this approach because true parallelism may afford better performance.
...if we use up the 16mb reserved chunk, we reserve another one, contiguously with the previous if possible.
Mozilla Application Framework in Detail - Archive of obsolete content
the gecko rendering engine gecko is the revolutionary rendering engine that offers advanced features for internet browsing anywhere across applications, computing platforms and devices.
... speed: gecko has been designed for speed and is several times faster than previous versions of internet browsing software.
...it has gone through extensive field testing and revision to maximize web site compatibility.
...ting system facilities with support for threads, thread synchronization, normal file and network i/o, interval timing and calendar time, basic memory management (malloc and free) and shared library linking; psm, a set of libraries that perform cryptographic operations including setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), other common pki functions, and s/mime support; an sql support that provides the ability to set up data sources, query a database, and retrieve results as javascript objects or rdf data sources; and an api for directory services via the lightweight directory access protocol (ldap).
Tamarin build documentation - Archive of obsolete content
$ make cppflags=-davmplus_verbose additional instructions for non-android cross-platform tamarin-redux build on osx 10.6 (snow leopard) (to build tamarin-central on mac please see previous cross-platform instructions here: https://developer.mozilla.org/index.php?title=en/tamarin/tamarin_build_documentation&revision=21 the bug when building on snow leopard (bug 537817) has been fixed in the tamarin-redux repo.
...note the "\obj9" directory under \platform\win32 for the win32 builds and "\x64" directory under \platform\win32 for 64-bit builds; this looks a little odd but preserves previous behavior as much as possible to avoid initial disruption from the shell rename fix.
... $ cd tamarin-central $ echo 'print("hello, world")' > hello.as $ java -jar ./utils/asc.jar -import ./core/builtin.abc hello.as hello.abc, 86 bytes written use the avmplus standalone executable (avmshell) built previously to run the application: $ avmshell hello.abc hello, world use the -help options of asc.jar and avmshell for more details.
... revision: specify the revision number that will be built.
Elements - Archive of obsolete content
for clarity's sake, here's what the embedded xml in the previous example looks like: <?xml version="1.0"?> <bindings id="xbltestbindings" xmlns="http://www.mozilla.org/xbl"> <binding id="xbltest"><content>pass</content></binding> </bindings> only css declarations provide an easy way to attach bindings to any set of elements.
...plied modifiers cdata #implied keycode cdata #implied key cdata #implied charcode cdata #implied clickcount (1|2|3) #implied command id #implied preventdefault false|true #implied > the handler element describes a single event handler.
... preventdefault - if set to true, the default action of the event is not performed.
... see also preventdefault method of the event object.
confirm - Archive of obsolete content
previous gecko versions only support the first, one-parameter method and will throw an error on occuring the extended form.
...utton_pos_1: the second logical button button_pos_2: the third logical button button title constants button_title_ok: an 'ok' button button_title_cancel: a 'cancel' button button_title_yes: a 'yes' button button_title_no: a 'no' button button_title_save: a 'save' button button_title_dont_save: a 'don't save' button button_title_revert: a 'revert' button button_title_is_string: custom title specified by the corresponding abuttonxtitle parameter other constants button_pos_0_default: specifies button 0 as the default button.
... firefox on linux mozilla application suite on win32 it is therefore recommended to only use two buttons wherever possible, and to keep in mind that button 1 has the same return value as "window closed" (see below).
...also: user closed the dialog window 1 'ok' or button 0 2 the third button previous versions of the xpinstall api stated the return value of confirm() to be a boolean.
findbar - Archive of obsolete content
attributes browserid, findnextaccesskey, findpreviousaccesskey, highlightaccesskey, matchcaseaccesskey properties browser, findmode methods close, onfindagaincommand, open, startfind, togglehighlight example <browser type="content-primary" flex="1" id="content" src="about:blank"/> <findbar id="findtoolbar" browserid="content"/> attributes browserid type: string the id of the browser element to which the fi...
... findpreviousaccesskey type: string the access key for the "find previous" toolbar button in the findbar.
... onfindagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands.
... you should specify true as the input parameter to perform a "find previous" operation, or false to perform a "find next." startfind( mode ) return type: no return value call this method to handle your application's "find" command.
Additional Navigation - Archive of obsolete content
« previousnext » retrieving literals the triples used so far have all had variables in both the subject and object.
... source navigation triples may also be used to navigate up the graph as well as downwards, following the graph arrows in the reverse direction.
... data after the second triple will look like this: (?start = http://www.daml.org/2001/09/countries/iso#it, ?countrytitle = italy, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg) (?start = http://www.daml.org/2001/09/countries/iso#it, ?countrytitle = italy, ?photo = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) the third triple just grabs the title from the photo as previous examples did, adding a value for the ?title variable for each photo.
... « previousnext » ...
Containment Properties - Archive of obsolete content
« previousnext » so far, we've seen how the simple query syntax can generate results from the children of an rdf container.
...the only difference between this and the previous example is a a couple of additional lines added to the rdf/xml: <rdf:seq rdf:about="http://www.xulplanet.com/rdf/a"> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/e"/> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/f"/> </rdf:seq> the effect is that there are five results instead of three.
...for example, the following is equivalent to the previous example, except that the full query syntax is used.
... « previousnext » ...
Multiple Queries - Archive of obsolete content
« previousnext » so far, every template has contained only a single query, even for recursive content.
...here is the previous example rewritten using the simple syntax: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template> <rule dc:title="canal"> <button uri="rdf:*" image="rdf:*" label="view" orient="vertical"/> </rule> <rule> <image uri="rdf:*" src="rdf:*"/> </rule>...
... </template> </hbox> the result to the user in this example is the same as the previous example.
... « previousnext » ...
Using Recursive Templates - Archive of obsolete content
« previousnext » you may recall that templates generate content recursively.
...the same query is executed again but using the groups generated from the previous execution of the query.
...the content of the action body is again generated for each result, but instead of being inserted inside the outermost groupbox, this new content is inserted inside the content generated from the previous iteration.
... « previousnext » ...
textbox (Toolkit autocomplete) - Archive of obsolete content
accesskey, autocompletepopup, autocompletesearch, autocompletesearchparam, completedefaultindex, completeselectedindex,crop, disableautocomplete, disabled, disablekeynavigation, enablehistory, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, nomatch, onchange, oninput, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showcommentcolumn, showimagecolumn, size, tabindex, tabscrolling, timeout, type, value properties accessibletype, completedefaultindex, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupope...
...n, searchcount, searchparam, selectionend, selectionstart, showcommentcolumn, showimagecolumn,size, tabindex, tabscrolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="history"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... ontextreverted new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the user presses escape to revert the textbox to its original uncompleted value.
... ontextreverted() return type: event result calls the ontextreverted event handler.
Textbox (XPFE autocomplete) - Archive of obsolete content
tedefaultindex, crop, disableautocomplete, disableautocomplete, disabled, disablehistory, enablehistory, focused, forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, onerrorcommand, oninput, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontextreverted, open, readonly, searchsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tabindex, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearch...
... ontextrevert obsolete since gecko 1.9.1 type: script code note: applies to: thunderbird, seamonkey this event handler is called when the user presses escape to revert the textbox to its original uncompleted value.
... as of gecko 1.9.1, this attribute is superseded by the ontextreverted attribute.
... ontextreverted new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the user presses escape to revert the textbox to its original uncompleted value.
Adding Buttons - Archive of obsolete content
« previousnext » in this section, we will look at how to add some simple buttons to a window.
...you can add align="start" to the window tag to prevent the stretching.
... the findfile.xul example let's add this code to the file findfile.xul that we created in the previous section.
... see also more button features « previousnext » ...
Cross Package Overlays - Archive of obsolete content
« previousnext » this section describes how to apply overlays to files that don't import them.
...in the examples in the previous section, the overlays were imported by the window.
...add these lines just after the previous lines.
... « previousnext » ...
Element Positioning - Archive of obsolete content
« previousnext » here we'll look at controlling the position and size of an element.
...for example, the position of a button in a horizontal box is to the right of the previous button, if any.
...compare this behavior to that of the previous example.
... « previousnext » ...
Manipulating Lists - Archive of obsolete content
« previousnext » the xul listbox provides a number of specialized methods.
...the new item is inserted at this index, so, in the example, the new item will be added at position 3 while the item previously at that position will now be at position 4.
...there is also a corresponding getitematindex() function to do the reverse.
... « previousnext » ...
The Box Model - Archive of obsolete content
« previousnext » in this section, we'll look at how xul handles layout.
...in the case of a horizontal box, each additional element will be placed to the right of the previous one.
...similarly, each element added to a vertical box will be placed underneath the previous one.
... « previousnext » ...
Trees and Templates - Archive of obsolete content
« previousnext » the following describes how to use a template with a tree.
...the following example uses the history datasource: <tree datasources="rdf:history" ref="nc:historybydate" flags="dont-build-content"> as described in the previous section, the tree may use a tree builder for template generation instead of the normal content builder.
...sorting columns if you try the previous example, you might note that the list of files is not sorted.
... « previousnext » ...
tooltip - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
...returning false from this event handler prevents the popup from appearing.
... openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location.
... triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup).
XUL Explorer - Archive of obsolete content
it’s a simple editor that can preview xul inline or in a separate popup window.
... roadmap features: the preview pane can be toggled with the editor.
... previewing in a popup window is still available.
... option to automatically update the preview as the editor changes.
2006-11-17 - Archive of obsolete content
how to get review for work-in-progress patch?
... answer: cc whoever you need review from, but don't post a formal review.
... steps for posting a formal review is provided also.
... code review requested for smtp swticher no comment is made.
2006-10-20 - Archive of obsolete content
paul reed previous post: boris zbarsky answered j.
... paul reed's question that was posted in his previous reply.
...paul reed previous post: in his post, boris zbarsky acknoleges the points that j.
... paul reed made in his previous post.
Introduction to SSL - Archive of obsolete content
some organizations may want to disable the weaker ciphers to prevent ssl connections with weaker encryption.
...this configuration option provides one way of ensuring that the client's certificate has not been revoked.
...this optional step provides one way for a system administrator to revoke a user's certificate even if it passes the tests in all the other steps.
... the red hat certificate system can automatically remove a revoked certificate from the user's entry in the ldap directory.
Updating an extension to support multiple Mozilla applications - Archive of obsolete content
« previousnext » this article shows how to take an existing extension and update it so that it can be used in additional mozilla applications.
... we'll build upon the stock watcher extension created in earlier articles in this series, updating it so it can also be used in thunderbird and sunbird (previous versions worked only in firefox).
... if you haven't already created an extension, or would like to refresh your memory, take a look at the previous articles in this series: creating a status bar extension creating a dynamic status bar extension adding preferences to an extension localizing an extension download the sample you can download this article's sample code so you can look at it side-by-side with the article, or to use it as a basis for your own extension.
... download the sample updating the install manifest the first step is to revise the extension's install manifest to indicate that it can be installed in thunderbird and sunbird.
Browser Detection and Cross Browser Support - Archive of obsolete content
this article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection.
... if (document.body && typeof(document.body.offsetheight) == 'number') { height = document.body.offsetheight; } else if (typeof(window.innerheight) == 'number') { height = window.innerheight; } else { height = 0; } note how the previous example does not make assumptions about which browser is being used.
...ser vendor version netscape 6.0 netscape6 6.0 netscape 6.01 netscape6 6.01 netscape 6.1 netscape6 6.1 netscape 6.2 netscape6 6.2 netscape 6.2.1 netscape6 6.2.1 netscape 6.2.2 netscape6 6.2.2 netscape 6.2.3 netscape6 6.2.3 compuserve 7.0 cs 2000 7.0 7.0 netscape 7 preview release 1 netscape 7.0b1 netscape 7.0 netscape 7.0 netscape 7.01 netscape 7.01 examples if you are like me, you learn best from examples.
...supporting only standards based browsers can reduce development and maintanance costs as well as increase the dynamic and compelling content which will attract visitors and increase your revenue.
Array comprehensions - Archive of obsolete content
array comprehension was previously proposed to be standardized in ecmascript 2016, it provide a useful shortcut for constructing a new array based on the contents of another.
... even strings may be used as input; to achieve the filter and map actions (under array-like objects) above: var str = 'abcdef'; var consonantsonlystr = [for (c of str) if (!(/[aeiouaeiou]/).test(c)) c].join(''); // 'bcdf' var interpolatedzeros = [for (c of str) c + '0' ].join(''); // 'a0b0c0d0e0f0' again, the input form is not preserved, so we have to use join() to revert back to a string.
...bers) for (j of letters) if (i > 1) if(j > 'a') i + j] // ["2b", "2c", "3b", "3c"] [for (i of numbers) if (i > 1) [for (j of letters) if(j > 'a') i + j]] // [["2b", "2c"], ["3b", "3c"]], not the same as below: [for (i of numbers) [for (j of letters) if (i > 1) if(j > 'a') i + j]] // [[], ["2b", "2c"], ["3b", "3c"]] specifications was initially in the ecmascript 2015 draft, but got removed in revision 27 (august 2014).
... please see older revisions of es2015 for specification semantics.
Implementation Status - Archive of obsolete content
processing model (events) section title status notes bugs 4 processing model (events) partial the xforms-recalculate, xforms-revalidate, and xforms-refresh events are not as separated as they should be.
...ms-model-construct-done supported 4.2.3 xforms-ready supported 4.2.4 xforms-model-destruct supported 4.3.1 xforms-rebuild supported 4.3.2 xforms-recalculate supported 4.3.3 xforms-revalidate supported 4.3.4 xforms-refresh supported 4.3.5 xforms-reset supported 4.3.6 xforms-next xforms-previous supported 4.3.7 xforms-focus supported 4.3.8 xforms-help xforms-hint...
...ind element unsupported 4.8 dom interface for access to instance data supported 4.8.1 getinstancedocument() supported 4.8.2 rebuild() supported 4.8.3 recalculate() supported 4.8.4 revalidate() supported 4.8.5 refresh() supported 4.9 feature string for the hasfeature method call supported 5.
... 332231; 349805; 10.11 revalidate partial is dispatching events instead of calling directly 332231; 10.12 refresh partial is dispatching events instead of calling directly 332231; 10.13 reset supported 10.14 load partial no xforms-link-error generated if @src invalid 333782; ...
Common causes of memory leaks in extensions - Extensions
while bug 695480 should prevent most of these compartment leaks, add-ons still need to be aware of the practices that caused these leaks, as the fix causes many add-ons which would have otherwise caused a leak to instead throw errors when attempting to access nodes from documents which no longer exist.
...for example, the following code snippets — part of a bootstrap.js — will leak: function leakref() {} function modifydocument(document) { var a = document.createelement("a"); document.body.appendchild(a); // the new dom node holding a reference to leakref will prevent // that function object from being garbage collected and hence // will leak the whole bootstrap compartment.
... a.someproperty = leakref; } function modifydocument2(document) { // the "body" dom node holding a reference to leakref will prevent // that function object from being garbage collected and hence // will leak the whole bootstrap compartment.
...when your add-on gets updated and re-enabled, the previous module version that is still loaded will be used, which might break your add-on entirely.
Implementing controls using the Gamepad API - Game development
update() is executed on every frame inside the game loop, to update the actual status of the gamepad object regularly: update: function() { // clear the buttons cache gamepadapi.buttonscache = []; // move the buttons status from the previous frame to the cache for(var k=0; k<gamepadapi.buttonsstatus.length; k++) { gamepadapi.buttonscache[k] = gamepadapi.buttonsstatus[k]; } // clear the buttons status gamepadapi.buttonsstatus = []; // get the gamepad object var c = gamepadapi.controller || {}; // loop through buttons and push the pressed ones to the array var pressed = []; if(c.buttons) { for(var b=0,t=c...
...oop 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 purposes 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.
... if(gamepadapi.buttonsstatus[i] == button) { // set the boolean variable to true newpress = true; // if we want to check the single press if(!hold) { // loop through the cached states from the previous frame for(var j=0,p=gamepadapi.buttonscache.length; j<p; j++) { // if the button was already pressed, ignore new press if(gamepadapi.buttonscache[j] == button) { newpress = false; } } } } } return newpress; }, there are two types of action to consider for a button: a single press and a hold.
...to check if the press is a new one, so the player is not holding the key, we loop through the cached states of the buttons from the previous frame of the game loop.
Paddle and keyboard controls - Game development
« previousnext » this is the 4th step out of 10 of the gamedev canvas tutorial.
...add the following just below your drawball() function: function drawpaddle() { ctx.beginpath(); ctx.rect(paddlex, canvas.height-paddleheight, paddlewidth, paddleheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } allowing the user to control the paddle we can draw the paddle wherever we want, but it should respond to the user's actions.
...the only trouble now is that you can just continue hitting the ball with the paddle forever.
... « previousnext » ...
Build the brick field - Game development
« previousnext » this is the 9th step out of 16 of the gamedev phaser tutorial.
... defining new variables first, let's define the needed variables — add the following below your previous variable definitions: var bricks; var newbrick; var brickinfo; the bricks variable will be used to create a group, newbrick will be a new object added to the group on every iteration of the loop, and brickinfo will store all the data we need.
... now, let's start creating the bricks themselves — add an empty group first to contain the bricks, by adding the following line at the bottom of the initbricks() function: bricks = game.add.group(); we can loop through the rows and columns to create new brick on each iteration — add the following nested loop below the previous line of code: for(c=0; c<brickinfo.count.col; c++) { for(r=0; r<brickinfo.count.row; r++) { // create new brick and add it to the group } } this way we will create the exact number of bricks we need and have them all contained in a group.
... « previousnext » ...
Player paddle and controls - Game development
« previousnext » this is the 7th step out of 16 of the gamedev phaser tutorial.
...add the following line below the previous new one: paddle.anchor.set(0.5,1); the paddle is now positioned right where we want it to be.
...update the previous line as follows: paddle.x = game.input.x || game.world.width*0.5; if you haven't already done so, reload your index.html and try it out!
... « previousnext » ...
Plug-in Development Overview - Gecko Plugin API Reference
« previousnext » writing plug-ins once you decide what you want your plug-in to do, creating it is a simple process.
...for example, this description list corresponds to the types in the previous example: string 1: "quicktime video", string 4: "aiff audio", and string 5: "jpeg image format." str#' 126: string 1 can contain a descriptive message about the plug-in.
... streams produced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse.
... building plug-ins once you have added the special code and additional files to make your plug-in scriptable as described in the previous section, the build process is quite straightforward.
Accessible multimedia - Learn web development
previous overview: accessibility next another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives so they can be understood by assistive technologies and their users.
...he following to the top of your javascript file: const playpausebtn = document.queryselector('.playpause'); const stopbtn = document.queryselector('.stop'); const rwdbtn = document.queryselector('.rwd'); const fwdbtn = document.queryselector('.fwd'); const timelabel = document.queryselector('.time'); next, we need to grab a reference to the video/audio player itself — add this line below the previous lines: const player = document.queryselector('video'); this holds a reference to a htmlmediaelement object, which has several useful properties and methods available on it that can be used to wire up functionality to our buttons.
... in terms of actually creating the transcript, your options are: commercial services — you could pay a professional to do the transcription, see for example companies like scribie, casting words, or rev.
... previous overview: accessibility next in this module what is accessibility?
Styling tables - Learn web development
previous overview: building blocks next styling an html table isn't the most glamorous job in the world, but sometimes we all have to do it.
...some rows removed for brevity <tr> <th scope="row">the stranglers</th> <td>1974</td> <td>17</td> <td>no more heroes</td> </tr> </tbody> <tfoot> <tr> <th scope="row" colspan="2">total albums</th> <td colspan="2">77</td> </tr> </tfoot> </table> the table is nicely marked up, easily styleable, and accessible, thanks to features such as scope, <caption>, <thead>, <tbo...
... first, add the following <link> element into your html head, just above your existing <link> element: <link href='https://fonts.googleapis.com/css?family=rock+salt' rel='stylesheet' type='text/css'> now add the following css into your style.css file, below the previous addition: /* typography */ html { font-family: 'helvetica neue', helvetica, arial, sans-serif; } thead th, tfoot th { font-family: 'rock salt', cursive; } th { letter-spacing: 2px; } td { letter-spacing: 1px; } tbody td { text-align: center; } tfoot th { text-align: right; } there is nothing really specific to tables here; we are generally tweaking the font styling to make...
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Floats - Learn web development
previous overview: css layout next originally for floating images inside blocks of text, the float property became one of the most commonly used tools for creating multiple column layouts on webpages.
... floating the content to the right has exactly the same effect, but in reverse — the floated element will stick to the right, and the content will wrap around it to the left.
... in your html from the previous example, add a class of cleared to the second paragraph below the floated item.
... previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Positioning - Learn web development
previous overview: css layout next positioning allows you to take elements out of the normal document layout flow, and make them behave differently; for example sitting on top of one another, or always remaining in the same place inside the browser viewport.
...you may recall from previous points in the course where we discussed web pages using horizontal (x-axis) and vertical (y-axis) coordinates to work out positioning for things like background images and drop shadow offsets.
...each subsequent header will then replace the previous one as it scrolls up to that position.
... previous overview: css layout next ...
Styling links - Learn web development
previous overview: styling text next when styling links, it is important to understand how to make use of pseudo-classes to style link states effectively, and how to style links for use in common varied interface features such as navigation menus and tabs.
... so that's it — try revisiting the active learning section above and trying this new technique out!
... the fourth rule — which styles the <a> element — is the most complicated here; let's go through it step by step: as in previous examples, we start by turning off the default text-decoration and outline — we don't want those spoiling our look.
... previous overview: styling text next in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
The HTML5 input types - Learn web development
previous overview: forms next in the previous article we looked at the <input> element, covering the original values of the type attribute available since the early days of html.
...the last minute of the previous millenium can be expressed in the following different ways, for example: 1999/12/31, 23:59 or 12/31/99t11:59pm.
...additionally, the first week 1 of each year contains the first thursday of that year—which may not include the first day of the year, or may include the last few days of the previous year.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for fo...
Sending form data - Learn web development
previous overview: forms once the form data has been validated on the client-side, it is okay to submit the form.
... and, since we covered validation in the previous article, we're ready to submit!
... for example: <form method="post" action="https://www.foo.com" enctype="multipart/form-data"> <div> <label for="file">choose a file</label> <input type="file" id="file" name="myfile"> </div> <div> <button>send the file</button> </div> </form> note: servers can be configured with a size limit for files and http requests in order to prevent abuse.
... you should avoid many/most problems if you follow these three rules, but it's always a good idea to get a security review performed by a competent third party.
Styling web forms - Learn web development
previous overview: forms next in the previous few articles we looked at all the html you'll need to create and structure your web forms.
... take the following example: to position the legend in this manner, we used the following css (other declarations removed for brevity): fieldset { position: relative; } legend { position: absolute; bottom: 0; right: 0; } the <fieldset> needs to be positioned too, so that the <legend> is positioned relative to it (otherwise the <legend> would be positioned relative to the <body>.) the <legend> element is very important for accessibility — it will be spoken by assistive technologies as part of the label of each f...
...while our design is a fixed-size design, and we could use the resize property to prevent users from resizing our multi-line text field, it is best to not prevent users from resizing a textarea if they so choose.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for fo...
HTML basics - Learn web development
previous overview: getting started with the web next html (hypertext markup language) is the code that is used to structure a web page and its content.
... an attribute should always have the following: a space between it and the element name (or the previous attribute, if the element already has one or more attributes).
...let's revisit the code we put into our index.html example (which we first met in the dealing with files article): <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="images/firefox-icon.png" alt="my test image"> </body> </html> here, we have the following: <!doctype html> — the doctype.
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
Define terms with HTML - Learn web development
special case: abbreviations it's best to mark abbreviations specially with <abbr>, so that screen readers read them appropriately and so that you can operate on all abbreviations uniformly.
... just as with any new keyword, you should define your abbreviations the first time they occur.
...</p> the html spec does indeed set aside the title attribute for expanding the abbreviation.
...the contents of title are completely hidden from your users, unless they're using a mouse and they happen to hover over the abbreviation.
Adding vector graphics to the Web - Learn web development
previous overview: multimedia and embedding next vector graphics are very useful in many circumstances — they have small file sizes and are highly scalable, so they don't pixelate when zoomed in or blown up to a large size.
... you can assign classes and ids to svg elements and style them with css, either within the svg or wherever you put the css style rules for your html document.
... here's a quick review: <iframe src="triangle.svg" width="500" height="500" sandbox> <img src="triangle.png" alt="triangle with three unequal sides" /> </iframe> this is definitely not the best method to choose: cons iframes do have a fallback mechanism, as you can see, but browsers only display the fallback if they lack support for iframes altogether.
...value = userentry; solution.value = 'show solution'; } updatecode(); }); const htmlsolution = ''; let solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back;...
Video and audio content - Learn web development
previous overview: multimedia and embedding next now that we are comfortable with adding simple images to a webpage, the next step is to start adding video and audio players to your html documents!
...fortunately, there are things you can do to help prevent this from being a problem.
... the codecs described in the previous section exist to compress video and audio into manageable files, since raw audio and video are both exceedingly large.
... other than this, <audio> supports all the same features as <video> — review the above sections for more information about them.
General asynchronous programming concepts - Learn web development
note: the previous example is very unrealistic.
...this is a rewrite of our previous example that calculates the 10 million dates in a separate worker thread.
...this becomes a problem when a function relies on the results of multiple previous processes to function.
... conclusion modern software design increasingly revolves around using asynchronous programming, to allow programs to do more than one thing at a time.
Build your own function - Learn web development
previous overview: building blocks next with most of the essential theory dealt with in the previous article, this article provides practical experience.
... delete the previous line you added.
...add the following line to your code, above the function definition: const btn = document.queryselector('button'); finally, add the following line below the previous one: btn.onclick = displaymessage; in a similar way to our closebtn.onclick...
... previous overview: building blocks next in this module making decisions in your code — conditionals looping code functions — reusable blocks of code build your own function function return values introduction to events image gallery ...
Client-Server Overview - Learn web development
previous overview: first steps next now that you know the purpose and potential benefits of server-side programming we're going to examine in detail what happens when a server receives a "dynamic request" from a browser.
...the format of the request is almost the same as the get request example shown previously, though the first line identifies this request as a post.
...if anything prevents the html from being returned then the web application will return another code — for example "404" to indicate that the team does not exist.
... previous overview: first steps next in this module introduction to the server side client-server overview server-side web frameworks website security ...
Server-side web frameworks - Learn web development
previous overview: first steps next the previous article showed you what the communication between web clients and servers looks like, the nature of http requests and responses, and what a server-side web application needs to do in order to respond to requests from a web browser.
...continuing the "youngest team" example from the previous section, the html template is passed a list variable called youngest_teams by the view.
...caching can be implemented in your code or in the server (see reverse proxy).
... previous overview: first steps next in this module introduction to the server side client-server overview server-side web frameworks website security ...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
previous overview: client-side javascript frameworks next now it's time to start tackling the footer functionality in our app.
... get todocountisone() { return this.incomplete.length === 1; } then go back over to footer.hbs and update the previous template section we edited to the following: <strong>{{this.todos.incomplete.length}}</strong> {{#if this.todos.todocountisone}} todo {{else}} todos {{/if}} left now save and test, and you'll see the correct pluralization used when you only have one todo item present!
...nts/todo.js file and update the contents to look like so, to give the todo component access to the service: import component from '@glimmer/component'; import { inject as service } from '@ember/service'; export default class todocomponent extends component { @service('todo-data') todos; } next, go back again to our todo-data.js service file and add the following action just below the previous ones, which will allow us to toggle a completion state for each todo: @action togglecompletion(todo) { todo.iscompleted = !todo.iscompleted; } updating the template to show completed state finally, we will edit the todo.hbs template such that the checkbox's value is now bound to the iscompleted property on the todo, and so that on change, the togglecompletion() method on the todo ...
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Ember interactivity: Events, classes and state - Learn web development
previous overview: client-side javascript frameworks next at this point we'll start adding some interactivity to our app, providing the ability to add and display new todo items.
... add the following import statement below the existing one: import { tracked } from '@glimmer/tracking'; now add the following class below the previous line you added: class todo { @tracked text = ''; @tracked iscompleted = false; constructor(text) { this.text = text; } } this class represents a todo — it contains a @tracked text property containing the text of the todo, and a @tracked iscompleted property that specifies whether the todo has been completed or not.
... first add another import statement below the previous one, to make actions available inside the service: import { action } from '@ember/object'; update the existing export default class tododataservice extends service { … } block as follows: export default class tododataservice extends service { @tracked todos = []; @action add(text) { let newtodo = new todo(text); this.todos = [...this.todos, newtodo]; } } here, the todo...
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Getting started with React - Learn web development
previous overview: client-side javascript frameworks next in this article we will say hello to react.
...the jsx approach allows us to nest our elements within each other, just like we do with html: const header = ( <header> <h1>mozilla developer network</h1> </header> ); note: the parentheses in the previous snippet aren't unique to jsx, and don’t have any effect on your application.
...when you are done, your code should look something like this: reactdom.render(<app subject="clarice" />, document.getelementbyid('root')); back in app.js, let's revisit the app function itself, which reads like this (with the return statement shortened for brevity): function app() { const subject = "react"; return ( // return statement ); } change the signature of the app function so that it accepts props as a parameter, and delete the subject const.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
React interactivity: Editing, filtering, conditional rendering - Learn web development
previous overview: client-side javascript frameworks next as we near the end of our react journey (for now at least), we'll add the finishing touches to the main areas of functionality in our todo list app.
...update it as follows: <input id={props.id} classname="todo-text" type="text" value={newname} onchange={handlechange} /> finally, we need to create a function to handle the edit form’s onsubmit event; add the following just below the previous function you added: function handlesubmit(e) { e.preventdefault(); props.edittask(props.id, newname); setnewname(""); setediting(false); } remember that our edittask() callback prop needs the id of the task we're editing as well as its new name.
... beneath our previous addition, add the following — here we are using the object.keys() method to collect an array of filter_names: const filter_names = object.keys(filter_map); note: we are defining these constants outside our app() function because if they were defined inside it, they would be recalculated every time the <app /> component re-renders, and we don’t want that.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Using Vue computed properties - Learn web development
previous overview: client-side javascript frameworks next in this article we'll add a counter that displays the number of completed todo items, using a feature of vue called computed properties.
... to create a computed property, we need to add a computed property to our component object, much like the methods property we've used previously.
...however, if you try checking and unchecking some items, you'll reveal a bug.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Vue conditional rendering: editing existing todos - Learn web development
previous overview: client-side javascript frameworks next now it is time to add one of the major parts of functionality that we're still missing — the ability to edit existing todo items.
... copy the following code into that file: <template> <form class="stack-small" @submit.prevent="onsubmit"> <div> <label class="edit-label">edit name for &quot;{{label}}&quot;</label> <input :id="id" type="text" autocomplete="off" v-model.lazy.trim="newlabel" /> </div> <div class="btn-group"> <button type="button" class="btn" @click="oncancel"> cancel <span class="visually-hidden">editing {{label}}</span> </button> <button type="s...
... add this method below the previous one: editcancelled() { this.isediting = false; } last for this section, we'll add event handlers for the events emitted by the todoitemeditform component, and attach the appropriate methods to each event.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Getting started with Vue - Learn web development
previous overview: client-side javascript frameworks next now let's introduce vue, the third of our frameworks.
...navigate to "eslint with error prevention only" and hit enter again.
... so if you wanted to create the moz-todo-vue project with npm and you'd previously chosen yarn, you’d run vue create moz-todo-vue --packagemanager=npm.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Rendering a list of Vue components - Learn web development
previous overview: client-side javascript frameworks next at this point we've got a fully working component; we're now ready to add multiple todoitem components to our app.
...we could use lodash.uniqueid(), however, like we did in the previous article.
... to prevent name collisions, remove the id field from your data attribute.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Styling Vue components with CSS - Learn web development
previous overview: client-side javascript frameworks next the time has finally come to make our app look a bit nicer.
... update your todoform template so that it looks like this: <template> <form @submit.prevent="onsubmit"> <h2 class="label-wrapper"> <label for="new-todo-input" class="label__lg"> what needs to be done?
...this is where the scoped attribute can be useful — this attaches a unique html data attribute selector to all of your styles, preventing them from colliding globally.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Mozilla accessibility architecture
this tree traversal is accomplished via toolkit-specific calls which end up as calls into nsiaccessible methods getaccparent(), getaccnextsibling(), getaccprevioussibling(), getaccfirstchild(), getacclastchild(), getaccchildcount() and getchildat(childnum).
...in that case we also override ::getaccnextsibling(), ::getaccprevioussibling() for the dom-less children; otherwise they do not know how to find each other.
...therefore, ownership is reversed -- accessible nodes own their dom objects.
... events: we must ensure that the accessible for an event is not released before the accessible client has a chance to review its data.
Lightweight themes
firefox may reveal more of the lower portion of the image if another toolbar or other ui element is added to the top of the window.
... the upper right-hand side of the image should have the most important information - as a user increases the width of the browser window, the browser reveals more of the left-hand side of the image.
...keep in mind that a reviewer may reject your theme if it is obvious that your category and/or tags are unrelated to your theme.
...keep in mind that a reviewer may reject your theme if your description is not an accurate representation of your theme.
Command line options
some options have abbreviations, for example, "-editor" can be abbreviated as "-edit" (available abbreviations are described in the text below).
... user profile -allow-downgrade firefox 67's downgrade protection prevents accidentally starting firefox in a profile running a later version of firefox.
...note profile_name and profile_dir are quoted together, and are separated by exactly 1 space (as with the previous syntax, profile_name must not contain spaces).
...useful with those command-line arguments that open their own windows but don't already prevent default windows from opening.
Debugging Frame Reflow
it provides the following information for each frame at the start of its reflow reflow reason available width, available height computed width, computed height the previous and the next frame in flow and a count number.
...the second table reflow is started at rowg 00b984a4 r=2 a=1500,uc c=1500,uc cnt=879 where the previous information is used.
...element size only once and it reports now: block 02d7bcf8 d=1410,300 the block shows the same address as the previous one.
...advanced reflow debugging the previously described technique dumps the data for every frame.
The Firefox codebase: CSS Guidelines
basics here are some basic tips that can optimize reviews if you are changing css: avoid !important but if you have to use it, make sure it's obvious why you're using it (ideally with a comment).
...if this isn't possible, you can also try introducing a :not() to prevent the other rule from applying, this is especially relevant for different element states (:hover, :active, [checked] or [disabled]).
... using inheriting or using currentcolor will prevent repetition of the value and it is usually good practice to do so.
... if you are not using windows, one way to test against those adjustments on other platforms is: going to about:preferences clicking on the "colors..." button in the "fonts & colors" sub-section of the "language and appearance" section under "override the colors specified by the page with your selections above", select the "always" option chrome area the automatic adjustments previously mentioned only apply to pages rendered in the content area.
Eclipse CDT Manual Setup
henever you create a new workspace for a mozilla source tree, you should be sure to turn off the following two settings in the workspace preferences (window > preferences, or eclipse > preferences) before creating a project in that workspace: in "general > workspace", disable "build automatically" in "c/c++ > indexer", disable "automatically update the index" turning off automatic indexing prevents the cpu intensive indexer from running at various stages during the steps below before we're ready.
... select "general > workspace" and select "refresh using native hooks or polling" and "refresh on access" to prevent eclipse giving you annoying "resource is out of sync" messages when files change from under it due to mercurial or other external activity.
...this prevents the (useless if not debugging) "searching for binaries" action from constantly interrupting everything.
...doing this prevents the "searching for binaries" which eclipse constantly starts from taking too long.
CustomizableUI.jsm
onwidgetaftercreation(awidgetid, aarea) fired after a widget with id awidgetid has been created, and has been added to either its default area or the area in which it was placed previously.
... undoreset() undoes a previous reset, restoring the state of the ui to the state prior to the reset.
... removeextratoolbar() remove a custom toolbar added in a previous version of firefox or using an add-on.
... canundoreset bool whether the "restore defaults" operation can be reverted.
DeferredTask.jsm
void disarm(); finalize ensure that any pending task is executed from start to finish, while preventing any attempt to arm the timer again.
...the task cannot be re-entered while running, but can be executed again after a previous run finished.
...to guarantee that the task is executed for the last time, the method prevents any attempt to arm the timer again.
... for example, during shutdown, you may want to ensure that any pending write is processed, using the latest version of the data if the timer is armed: asyncshutdown.profilebeforechange.addblocker( "example service: shutting down", () => savedeferredtask.finalize() ); instead, if you are going to delete the saved data from disk anyways, you might as well prevent any pending write from starting, while still ensuring that any write that is currently in progress terminates, so that the file is not in use any more: savedeferredtask.disarm(); savedeferredtask.finalize().then(() => os.file.remove(...)) .then(null, components.utils.reporterror); ...
Using JavaScript code modules
modules can also be used to create global javascript singletons that previously required using javascript xpcom objects.
...//app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "6" alert(dummy); // displays "dummy is not defined" because 'dummy' was not exported from the module note: when you're testing changes to a code module, be sure to change the application's build id (e.g., the version) before your next test run; otherwise, you may find yourself running the previous version of your module's code.
... sharing objects using code modules an extremely important behavior of components.utils.import() is that modules are cached when loaded and subsequent imports do not reload a new version of the module, but instead use the previously cached version.
... unloading code modules requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) components.utils.unload() allows you to unload a previously imported code module.
Localization content best practices
if you're reviewing a patch, check also strings for grammar errors, capitalization or inconsistencies.
...if you have any doubts about the quality of strings, ask a copywriter to do a copy review of this text.
... ideally, all strings landing in code should originate from approved ux wireframes, any copy review should be part of the initial stage of creating these wireframes.
...a bug marked with l12y describes an issue that prevents localizers to create a good quality localization.
Translation phase
this tool includes workspaces for translating strings, reviewing string submissions, and project dashboards.
... firefox mobile by adding firefox® to your mobile phone, you can access rich web content and enjoy your favorite firefox features wherever you go.
... this tutorial will walk you through performing these productization tasks, creating productization patches, and submitting them for review.
... « previousnext » ...
Mozilla DOM Hacking Guide
for example, getproperty() is used when retrieving an attribute that was not defined in idl, and newresolve() is used when resolving for the first time an attribute or method that was not previously resolved.
... we already know what nsixpcscriptable is used for (see the previous section).
... user's guide to class info warning: this document has not yet been reviewed by the dom gurus, it might contain some errors.
...the three parameters passed to the macro, as described in the previous section, are the dom object name, the scriptable helper class, and the scriptable flags.
Gecko Profiler FAQ
a better idea would be picking up a real browser workload where through previous profiling we know that malloc overhead contributes a measurable percentage of overhead to the overall time and then study the change to that workload after replacing the allocator.
... [ehsan] this is similar to the previous question to some extent, but the specific answer really depends on what kind of compiler flag we’re talking about and what performance impact we’re interested to study.
...then go to the previous step.
... [jesup] ok, that's the equivalent to itimer_real, kinda, except that per the previous question it doesn't interrupt every thread at once and snapshot the thread you started the itimer on, it interrupts each thread one at a time, which likely means distortion of the measurement if the number of threads monitored is significant (especially at high sample rates).
Memory reporting
and please ask nnethercote to co-review any memory reporter patch.
...it helps prevent accidentally having small differences in the function signatures (e.g.
... forgetting a const) that prevent the overriding from happening.
... if you write a memory reporter, please get two people to review it: (a) someone who knows the data structures being measured, and (b) nnethercote, who can check for all the things covered by this document.
TimerFirings logging
-991946880[7f46c365ba00]: [6775] fn timer (one_shot 0 ms): [content] chrome://browser/content/tabbrowser.xml:1816:0 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://edition.cnn.com/:5:7231 711637568[7f3219c48000]: [6835] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 these js timers are annotated with [content] and show the javascript source location where they were created.
... 204 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] http://widgets.outbrain.com/outbrain.js:20:330 135 -495057024[7f74e105ba00]: [7108] fn timer (one_shot 4 ms): [content] https://self-repair.mozilla.org/repair/:7:13669 118 801266240[7f7c1f248000]: [7163] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 103 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] http://static.dynamicyield.com/scripts/12086/dy-min.js?v=12086:3:3389 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] https://ad.doubleclick.net/ddm/adi/n7921.1283839cadreon.com.au/b9038144.122190976;sz=300x600;click=http://pixel.mathtag.com/click/img?mt_aid=...
... sed 's/^[^:]\+: //' # strip thread ids sed 's/\[[0-9]\+\] //' # strip process ids sed 's/ \+[0-9]\+ ms//' # strip timer periods the following is the previous sample output with all three of these commands added into the pipeline.
... 204 fn timer (one_shot): [content] http://widgets.outbrain.com/outbrain.js:20:330 186 fn timer (one_shot): nsbrowserstatusfilter::timeouthandler 138 fn timer (one_shot): [content] https://self-repair.mozilla.org/repair/:7:13669 118 fn timer (one_shot): [content] http://a.visualrevenue.com/vrs.js:6:9423 108 fn timer (slack): layeractivitytracker 104 fn timer (slack): nsidocument::selectorcache 104 fn timer (slack): cctimerfired ...
NSS functions
m mxr 3.2 and later ssl_preencryptedstreamtofile mxr 3.2 and later ssl_rehandshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake mxr 3.2 and later ssl_restarthandshakeaftercertreq mxr 3.2 and later ssl_restarthandshakeafterservercert mxr 3.2 and later ssl_revealcert mxr 3.2 and later ssl_revealpinarg mxr 3.2 and later ssl_revealurl mxr 3.2 and later ssl_securitystatus mxr 3.2 and later ssl_setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg mxr 3.2 and later ssl_setsockpeerid mxr 3.2 and later ssl_seturl mxr 3.2 and later ss...
...ter cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr 3.3 and later cert_comparename mxr 3.2 and later cert_comparevaliditytimes mxr 3.11 and later cert_completecrldecodeentries mxr 3.6 and later cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificater...
...mxr 3.10 and later cert_getocspresponsestatus mxr 3.6 and later cert_getocspstatusforcertid mxr 3.6 and later cert_getoidstring mxr 3.9 and later cert_getorgname mxr 3.2 and later cert_getorgunitname mxr 3.2 and later cert_getocspauthorityinfoaccesslocation mxr 3.4 and later cert_getpkixverifynistrevocationpolicy mxr 3.12 and later cert_getprevgeneralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_getstatename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnsp...
... mxr 3.4 and later pk11_getnextsymkey mxr 3.4 and later pk11_getpadmechanism mxr 3.4 and later pk11_getpbecryptomechanism mxr 3.12 and later pk11_getpbeiv mxr 3.6 and later pk11_getpqgparamsfromprivatekey mxr 3.4 and later pk11_getprevgenericobject mxr 3.9.2 and later pk11_getprivatekeynickname mxr 3.4 and later pk11_getprivatemoduluslen mxr 3.2 and later pk11_getpublickeynickname mxr 3.4 and later pk11_getslotfromkey mxr 3.2 and later pk11_getslotfromprivatekey mxr 3.2 and late...
NSS tools : vfychain
name vfychain — vfychain [options] [revocation options] certfile [[options] certfile] ...
...prints root cert subject(double the argument for whole root cert info) -w password database password -w pwfile password file revocation options for pkix api (invoked with -pp options) is a collection of the following flags: [-g type [-h flags] [-m type [-s flags]] ...] ...
...-h test flags sets revocation flags for the test type it follows.
...-s method flags sets revocation flags for the method it follows.
NSS tools : vfychain
name vfychain — vfychain [options] [revocation options] certfile [[options] certfile] ...
...prints root cert subject(double the argument for whole root cert info) -w password database password -w pwfile password file revocation options for pkix api (invoked with -pp options) is a collection of the following flags: [-g type [-h flags] [-m type [-s flags]] ...] ...
... -h test flags sets revocation flags for the test type it follows.
... -s method flags sets revocation flags for the method it follows.
JS_ParseJSON
syntax jsbool js_parsejson(jscontext *cx, const jschar *chars, uint32 len, jsval *vp); jsbool js_parsejsonwithreviver(jscontext *cx, const jschar *chars, uint32 len, jsval reviver, jsval *vp); name type description cx jscontext * pointer to a js context.
... index jsint (in js_parsejsonwithreviver only) a reviver function to apply to the created value after parsing; see json.parse.
...*vp receives the value after parsing (and optionally, processing by the reviver).
...mxr id search for js_parsejson mxr id search for js_parsejsonwithreviver ...
SpiderMonkey 1.8.8
it continues to improve performance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... spidermonkey 1.8.8 is not binary-compatible with previous releases, nor is it source-code compatible.
...removal of jscontext* parameters to many methods the js_getclass method now takes only a jsobject*, where previously it also required a jscontext* in threadsafe builds.
SpiderMonkey 17
it continues to improve performance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... spidermonkey 17 is not binary-compatible with previous releases, nor is it source-code compatible.
...removal of jscontext* parameters to many methods the js_getclass method now takes only a jsobject*, where previously it also required a jscontext* in threadsafe builds.
SpiderMonkey 45
it continues to improve performance over previous spidermonkey releases.
... on remaining platforms the jit is disabled; javascript code runs in an interpreter, as it has in previous versions.
... migrating to spidermonkey 45 spidermonkey 45 is not binary-compatible with previous releases, nor is it source-code compatible.
... many jsapi types; functions, and callback signatures, have changed though most functions that have retain their previous name, providing relatively unchanged functionality.
Animated PNG graphics
MozillaTechAPNG
it is strongly recommended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image.
... 2 apng_dispose_op_previous the frame's region of the output buffer is to be reverted to the previous contents before rendering the next frame.
... if the first 'fctl' chunk uses a dispose_op of apng_dispose_op_previous it should be treated as apng_dispose_op_background.
... revisions to this specification from 0.1 renamed chunks to 'anim' and 'fram' to comply with chunk naming conventions in the png spec.
Building the WebLock UI
« previousnext » up until now, we've been building a component that can be installed in any gecko application.
... in the previous section, we outlined the javascript that interacts with the weblock component.
... weblockoverlay.xul the xul that defines the new icon is small: it's a little icon that calls a javascript function to load the weblock.xul file we defined previously.
... « previousnext » copyright (c) 2003 by doug turner and ian oeschger.
Using XPCOM Utilities to Make Things Easier
« previousnext » this chapter goes back over the code you've already created in the first part of the tutorial (see weblock1.cpp in the previous chapter) and uses xpcom tools that make coding a lot easier and more efficient.
... generic xpcom module macros the work in the previous chapter was useful in setting up the generic component code.
...to get an idea about how much can be handled with the macros described in this section, compare the code listing in weblock2.cpp at the end of the chapter with weblock1.cpp in the previous chapter.
... « previousnext » copyright (c) 2003 by doug turner and ian oeschger.
imgIContainer
note: -1 means forever.
... clear() the whole image, revealing.
... obsolete since gecko 2.0 kdisposeclear 2 clear() the frame's area, revealing bg.
... obsolete since gecko 2.0 kdisposerestoreprevious 3 restore the previous(composited) frame.
nsIDOMWindowInternal
this interface no longer has any members; it exists solely to prevent add-ons that reference it from failing completely.
... method overview firefox 3.5 note the prompt() and find() methods changed in firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required.
... status domstring sets the text in the status bar at the bottom of the browser or returns the previously set text.
... url nsidommozurlproperty readonly: a dom url object, which provides the window.url.createobjecturl() and window.url.revokeobjecturl() methods.
nsIDialogParamBlock
methods getint() get a previously set integer.
... return value the previously set integer, or 0 if no integer has been previously set at that index.
... getstring() get a previously set string.
... return value the string at the given index, or the empty string if no string has previously been set at that index.
nsIRequest
constant value description inhibit_caching 1 << 7 this flag prevents caching of any kind.
... it does not, however, prevent cached content from being used to satisfy this request.
... inhibit_persistent_caching 1 << 8 this flag prevents caching on disk (or other persistent media), which may be needed to preserve privacy.
... note: this will prevent proxy authentications from working, so use this flag with caution.
nsITraceableChannel
method overview nsistreamlistener setnewlistener(in nsistreamlistener alistener); methods setnewlistener() replaces the channel's current listener with a new one, returning the listener previously assigned to the channel.
... return value the previous listener for the channel.
... each listener call through to the previous listener for every call, in order to establish a call chain to allow all interested parties a chance to act on each event.
... note: it is critical that you pass along requests to the previous listener as soon as possible -- especially for onstartrequest.
nsITreeColumn
nsitreecolumn getnext(); nsitreecolumn getprevious(); void invalidate(); attributes attribute type description atom nsiatom the atom attribute of nsitreecolumn which returns an nsiatom for the column, making it fast to do comparisons.
...getprevious() get the previous column in the nsitreecolumn.
... nsitreecolumn getprevious(); parameters none.
... return value the previous nsitreecolumn in the nsitreecolumns.
Getting Started Guide
nscomptr is a tool to help prevent leaks.
...do_queryinterface prevents xpcom type errors.
... prevent it in advance // by not returning pointers as function results, or else by returning // an |already_addrefed<t>| as above.
... void f( nscomptr<t>* ) avoid passing an nscomptr by address, if possible this practice requires callers to have an nscomptr, and requires them to do a little extra work, as operator& for nscomptrs is private (to help prevent leaks caused by casting; also see bug 59414).
Initialization and Destruction - Plugins
« previousnext » this chapter describes the methods that provide the basic processes of initialization, instance creation and destruction, and shutdown.
...when the user returns to the page, the previous frame number is passed to the new instance of the plug-in, so it can initially display the same frame.
... in npp_new, the saved parameter contains previously saved data for this instance of the plug-in (saved by npp_destroy).
...*/ if (useragent != null) npn_memfree(useragent); return nperr_no_error; } « previousnext » ...
Plug-in Development Overview - Plugins
« previousnext » writing plug-ins once you decide what you want your plug-in to do, creating it is a simple process.
...for example, this description list corresponds to the types in the previous example: string 1: "quicktime video", string 4: "aiff audio", and string 5: "jpeg image format." str#' 126: string 1 can contain a descriptive message about the plug-in.
... streams produced by the plug-in to send to the browser are like normal-mode streams produced by the browser, but in reverse.
... building plug-ins once you have added the special code and additional files to make your plug-in scriptable as described in the previous section, the build process is quite straightforward.
Streams - Plugins
« previousnext » this chapter describes using plug-in api functions to receive and send streams.
...use this feature only as a last resort; plug-ins should implement an incremental stream-based interface wherever possible.
... streams sent by the plug-in to the browser are like normal-mode streams produced by the browser, but in reverse.
... « previousnext » ...
Set a breakpoint - Firefox Developer Tools
if the breakpoint is a conditional breakpoint, you'll get an option edit condition, which allows you to change the previously set condition.
... inline variable preview new in firefox 71, the source pane now gives you an inline preview of the variables on each line of code you've stepped through: this is a very useful timesaver when stepping through your code.
... previously you’d have to scroll through the scopes panel to find variable values, or hover over a variable in the source pane.
... note: there is also a new option in the context menu for the actual code in the source pane — hide inline preview/show inline preview — which allows you to turn the inline variables on/off.
DevTools API - Firefox Developer Tools
if unspecified the previously active tool is shown.
... selectprevioustool() selects the previous tool in the toolbox.
... preventclosingonkey boolean, optional.
... off(eventname, listener) removes the previously added listener from the event.
Using images - Web APIs
« previousnext » until now we have created our own shapes and applied styles to them.
... example: framing an image in this example, we'll use the same rhino as in the previous example, but we'll slice out its head and composite it into a picture frame.
...ttribute('height', 150); // insert before the image document.images[i].parentnode.insertbefore(canvas,document.images[i]); ctx = canvas.getcontext('2d'); // draw image to canvas ctx.drawimage(document.images[i], 15, 20); // add frame ctx.drawimage(document.getelementbyid('frame'), 0, 0); } } } controlling image scaling behavior as mentioned previously, scaling images can result in fuzzy or blocky artifacts due to the scaling process.
...you can disable this feature like this: ctx.mozimagesmoothingenabled = false; ctx.webkitimagesmoothingenabled = false; ctx.msimagesmoothingenabled = false; ctx.imagesmoothingenabled = false; « previousnext » ...
ConvolverNode - Web APIs
the convolvernode interface is an audionode that performs a linear convolution on a given audiobuffer, often used to achieve a reverb effect.
... convolvernode.buffer a mono, stereo, or 4-channel audiobuffer containing the (possibly multichannel) impulse response used by the convolvernode to create the reverb effect.
... let audioctx = new window.audiocontext(); async function createreverb() { let convolver = audioctx.createconvolver(); // load impulse response from file let response = await fetch("path/to/impulse-response.wav"); let arraybuffer = await response.arraybuffer(); convolver.buffer = await audioctx.decodeaudiodata(arraybuffer); return convolver; } ...
... let reverb = await createreverb(); // someotheraudionode -> reverb -> destination someotheraudionode.connect(reverb); reverb.connect(audioctx.destination); specifications specification status comment web audio apithe definition of 'convolvernode' in that specification.
FileReader.readAsDataURL() - Web APIs
example html <input type="file" onchange="previewfile()"><br> <img src="" height="200" alt="image preview..."> javascript function previewfile() { const preview = document.queryselector('img'); const file = document.queryselector('input[type=file]').files[0]; const reader = new filereader(); reader.addeventlistener("load", function () { // convert image file to base64 string preview.src = reader.result; }, false); if (...
...file) { reader.readasdataurl(file); } } live result example reading multiple files html <input id="browse" type="file" onchange="previewfiles()" multiple> <div id="preview"></div> javascript function previewfiles() { var preview = document.queryselector('#preview'); var files = document.queryselector('input[type=file]').files; function readandpreview(file) { // make sure `file.name` matches our extensions criteria if ( /\.(jpe?g|png|gif)$/i.test(file.name) ) { var reader = new filereader(); reader.addeventlistener("load", function () { var image = new image(); image.height = 100; image.title = file.name; image.src = this.result; preview.appendchild( image ); }, false); reader.readasdataurl(file)...
...; } } if (files) { [].foreach.call(files, readandpreview); } } note: the filereader() constructor was not supported by internet explorer for versions before 10.
... for a full compatibility code you can see our crossbrowser possible solution for image preview.
Introduction to the File and Directory Entries API - Web APIs
browsers impose storage quotas to prevent a web app from using up the entire disk, browsers might impose a quota for each app and allocate storage among web apps.
... the security boundary imposed on file system prevents applications from accessing data with a different origin.
... this protects private data by preventing access and deletion.
... the file and directory entries api does not let you create and rename executable files to prevent malicious apps from running hostile executables, you cannot create executable files within the sandbox of the file and directory entries api.
GlobalEventHandlers.onerror - Web APIs
error events are fired at various targets for different kinds of errors: when a javascript runtime error (including syntax errors and exceptions thrown within handlers) occurs, an error event using interface errorevent is fired at window and window.onerror() is invoked (as well as handlers attached by window.addeventlistener (not only capturing)).
... source: url of the script where the error was raised (string) lineno: line number where error was raised (number) colno: column number for the line where the error occurred (number) error: error object (object) when the function returns true, this prevents the firing of the default event handler.
...}) event of type errorevent contains all the information about the event and the error.
... notes when an error occurs in a script, loaded from a different origin, the details of the error are not reported to prevent leaking information (see bug 363897).
HTMLImageElement.loading - Web APIs
by specifying the value lazy for loading, you prevent the image from delaying the load attribute by the amount of time it takes to request, fetch, and process the image.
... preventing element shift during image lazy loads when an image whose loading has been delayed by the loading attribute being set to lazy is finally loaded, the browser will determine the final size of the <img> element based on the style and intrinsic size of the image, then reflow the document as needed to update the positions of elements based on any size change made to the element to fit the image...
... to prevent this reflow from occurring, you should explicitly specify the size of the image's presentation using the image element's width and height attributes.
... by establishing the intrinsic aspect ratio in this manner, you prevent elements from shifting around while the document loads, which can be disconcerting or offputting at best and can cause users to click the wrong thing at worst, depending on the exact timing of the deferred loads and reflows.
IDBCursor.direction - Web APIs
prev this direction causes the cursor to be opened at the end of the source.
... prevunique this direction causes the cursor to be opened at the end of the source.
...within each iteration we log the direction of the cursor, something like this: prev note: we can't change the direction of travel of the cursor using the direction property, as it is read-only.
...for a complete working example, see our idbcursor example (view example live.) function backwards() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readonly'); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor(null,'prev').onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.direction); cursor.continue(); } else { console.log('entries display...
MSSiteModeEvent - Web APIs
preventdefault cancels the default action of an event.
... stopimmediatepropagation prevents any further propagation of an event.
... stoppropagation prevents propagation of an event beyond the current target.
... defaultprevented gets a value that indicates whether the default action should be canceled.
Using the Notifications API - Web APIs
granted the user has granted permission to display notifications, after having been asked previously.
... n.close(); } }); note: this api shouldn't be used just to have the notification removed from the screen after a fixed delay (on modern browsers) since this method will also remove the notification from any notification tray, preventing users from interacting with it after it was initially shown.
...if a notification already has the same tag and has not been displayed yet, the new notification replaces that previous notification.
... if the notification with the same tag has already been displayed, the previous notification is closed and the new one is displayed.
Permissions - Web APIs
the permissions interface of the permissions api provides the core permission api functionality, such as methods for querying and revoking permissions methods permissions.query() returns the user permission status for a given api.
... permissions.revoke() revokes the permission currently set on a given api.
... safari ios no support nosamsung internet android full support 5.0revoke experimentalnon-standardchrome full support 46edge full support 79firefox full support 51disabled full support 51disabled disabled from version 51: this feature is behind the dom.permissions.revoke.enable preference...
... nowebview android full support 46chrome android full support 46firefox android full support 51disabled full support 51disabled disabled from version 51: this feature is behind the dom.permissions.revoke.enable preference (needs to be set to true).
Pointer Lock API - Web APIs
as it has recently unprefixed, you would currently declare it something like this, for example if you wanted to request pointer lock on a canvas element: canvas.requestpointerlock = canvas.requestpointerlock || canvas.mozrequestpointerlock; canvas.requestpointerlock() if a user has exited pointer lock via the default unlock gesture, or pointer lock has not previously been entered for this document, an event generated as a result of an engagement gesture must be received by the document before requestpointerlock will succeed.
...the values of the parameters are the same as the difference between the values of mouseevent properties, screenx and screeny, which are stored in two subsequent mousemove events, enow and eprevious.
... in other words, the pointer lock parameter movementx = enow.screenx - eprevious.screenx.
...it also includes a check whether a requestanimationframe() call has previously been made, and if so, calls it again as required, and calls the canvasdraw() function that updates the canvas scene.
ReadableStream.pipeThrough() - Web APIs
piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it.
...available options are: preventclose: if this is set to true, the source readablestream closing will no longer cause the destination writablestream to be closed.
... preventabort: if this is set to true, errors in the source readablestream will no longer abort the destination writablestream.
... preventcancel: if this is set to true, errors in the destination writablestream will no longer cancel the source readablestream.
ReadableStream.pipeTo() - Web APIs
piping a stream will generally lock it for the duration of the pipe, preventing other readers from locking it.
...available options are: preventclose: if this is set to true, the source readablestream closing will no longer cause the destination writablestream to be closed.
... preventabort: if this is set to true, errors in the source readablestream will no longer abort the destination writablestream.
... preventcancel: if this is set to true, errors in the destination writablestream will no longer cancel the source readablestream.
SVGLengthList - Web APIs
if the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
SVGNumberList - Web APIs
if the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
... if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
SVGPathSegList - Web APIs
if the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
... if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
SVGPointList - Web APIs
if the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
SVGStringList - Web APIs
if the inserted item is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
...if newitem is already in a list, it is removed from its previous list before it is inserted into this list.
SubtleCrypto.verify() - Web APIs
*/ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsassa-pkcs1 .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "rsassa-pkcs1-v1_5", publickey, signature, encoded ); signaturevalue.classlist.add(result ?
...*/ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsa-pss .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( { name: "rsa-pss", saltlength: 32, }, publickey, signature, encoded ); signaturevalue.classlist.add(result ?
...*/ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".ecdsa .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( { name: "ecdsa", hash: {name: "sha-384"}, }, publickey, signature, encoded ); signaturevalue.classlist.add(result ?
...*/ async function verifymessage(key) { const signaturevalue = document.queryselector(".hmac .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "hmac", key, signature, encoded ); signaturevalue.classlist.add(result ?
Multi-touch interaction - Web APIs
it also calls preventdefault() to keep the browser from applying further event handling (for example, mouse event emulation).
... ev.preventdefault(); // cache the touch points for later processing of 2-touch pinch/zoom if (ev.targettouches.length == 2) { for (var i=0; i < ev.targettouches.length; i++) { tpcache.push(ev.targettouches[i]); } } if (logevents) log("touchstart", ev, true); update_background(ev); } touch move handler the touchmove handler calls preventdefault() for the same reason mentioned above, and invokes the pinch/zoom handler.
... // ev.preventdefault(); if (logevents) log("touchmove", ev, false); // to avoid too much color flashing many touchmove events are started, // don't update the background if two touch points are active if (!(ev.touches.length == 2 && ev.targettouches.length == 2)) update_background(ev); // set the target element's border to dashed to give a clear visual // indication the element received a move event.
... function end_handler(ev) { ev.preventdefault(); if (logevents) log(ev.type, ev, false); if (ev.targettouches.length == 0) { // restore background and border to original values ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; } } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and clear the log.
Lighting in WebGL - Web APIs
« previousnext » as should be clear by now, webgl doesn't have much built-in knowledge.
...instead, we'll have our ambient lighting plus a single directional light source, aimed at the rotating cube from the previous demo.
... value computed by the vertex shader: const fssource = ` varying highp vec2 vtexturecoord; varying highp vec3 vlighting; uniform sampler2d usampler; void main(void) { highp vec4 texelcolor = texture2d(usampler, vtexturecoord); gl_fragcolor = vec4(texelcolor.rgb * vlighting, texelcolor.a); } `; here we fetch the color of the texel, just like we did in the previous example, but before setting the color of the fragment, we multiply the texel's color by the lighting value to adjust the texel's color to take into account the effect of our light sources.
... « previousnext » ...
WebGL best practices - Web APIs
for unchanged vaos, browsers can cache the fetch limits, whereas when vaos change, browsers must revalidate and recalculate limits.
... the overhead for this is relatively low, but re-using vaos means fewer vertexattribpointer calls too, so it's worth doing wherever it's easy.
...these triangles are effectively skipped, which lets you start a new triangle strip unattached to your previous one, without having to split into multiple draw calls.
... highp float; precision highp int; precision lowp sampler2d; precision lowp samplercube; the fragment language has the following predeclared globally scoped default precision statements: precision mediump int; precision lowp sampler2d; precision lowp samplercube; in webgl 1, "highp float" support is optional in fragment shaders using highp precision unconditionally in fragment shaders will prevent your content from working on some older mobile hardware.
Web Video Text Tracks Format (WebVTT) - Web APIs
inner structure of a webvtt file let's re-examine one of our previous examples, and look at the cue structure in a bit more detail.
...the end time must be greater than the start time, and the start time must be greater than or equal to all previous start times.
... timestamp tag the timestamp must be greater that the cue's start timestamp, greater than any previous timestamp in the cue payload, and less than the cue's end timestamp.
...any text before the active text in the payload is previous text .
Using Web Workers - Web APIs
it receives an event named error which implements the errorevent interface.
... the event doesn't bubble and is cancelable; to prevent the default action from taking place, the worker can call the error event's preventdefault() method.
...previously executed code (including code deferred using window.settimeout()) will still be functional though.
...so for example, suppose a document is served with the following header: content-security-policy: script-src 'self' among other things, this will prevent any scripts it includes from using eval().
Window: beforeunload event - Web APIs
according to the specification, to show the confirmation dialog an event handler should call preventdefault() on the event.
... attaching an event handler/listener to window or document's beforeunload event prevents browsers from using in-memory page navigation caches, like firefox's back-forward cache or webkit's page cache.
... examples the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue.
... event.preventdefault(); // chrome requires returnvalue to be set.
Window: unhandledrejection event - Web APIs
you can prevent this by calling preventdefault() on the promiserejectionevent; see preventing default handling below for an example.
... window.addeventlistener("unhandledrejection", event => { console.warn(`unhandled promise rejection: ${event.reason}`); }); you can also use the onunhandledrejection event handler property to set up the event listener: window.onunhandledrejection = event => { console.warn(`unhandled promise rejection: ${event.reason}`); }; preventing default handling many environments (such as node.js) report unhandled promise rejections to the console by default.
... you can prevent that from happening by adding a handler for unhandledrejection events that—in addition to any other tasks you wish to perform—calls preventdefault() to cancel the event, preventing it from bubbling up to be handled by the runtime's logging code.
... // prevent the default handling (such as outputting the // error to the console) event.preventdefault(); }); specifications specification status comment html living standardthe definition of 'unhandledrejection' in that specification.
Using XMLHttpRequest - Web APIs
submitting..."); */ submitdata (odata); } function pushsegment (ofrevt) { this.owner.segments[this.segmentidx] += ofrevt.target.result + "\r\n"; this.owner.status--; processstatus(this.owner); } function plainescape (stext) { /* how should i treat a text/plain form encoding?
...for didactic purposes here is a translation of the previous example transformed to use the formdata api.
... note the brevity of the code: <!doctype html> <html> <head> <meta http-equiv="content-type" charset="utf-8" /> <title>sending forms with formdata &ndash; mdn</title> <script> "use strict"; function ajaxsuccess () { console.log(this.responsetext); } function ajaxsubmit (oformelement) { if (!oformelement.action) { return; } var oreq = new xmlhttprequest(); oreq.onload = ajaxsuccess; if (oformelement.method.tolowercase() === "post") { oreq.open("post", oformelement.action); oreq.send(new formdata(oformelement)); } else { var ofield, sfieldtype, nfile, ssearch = ""; for (var nitem = 0; nitem < oformelement.elements.length; nitem++) { ofield = oformelement.elements[nitem]; if (!ofield.hasattribute("name")) { continue; } sfieldtype = ofield.nodenam...
...if you want to stringify a submitted data, use the previous pure-ajax example.
ARIA: listbox role - Accessibility
up arrow: moves focus to the previous option.
... shift + up arrow (optional): moves focus to and toggles the selected state of the previous option.
... required javascript features selecting an option in a single select listbox when the user selects an option, the following must occur: deselect the previously selected option, setting the aria-selected to false, or removing the attribute altogether, changing the appearance of the newly unselected option to appear not selected.
...ly been handled with the native html <select> and <label> elements <label for="listbox1">select a color:</label> <select id="listbox1"> <option selected>green</option> <option>orange</option> <option>red</option> <option>blue</option> <option>violet</option> <option>periwinkle</option> </select> more examples scrollable listbox example: single-select listbox that scrolls to reveal more options, similar to html select with size attribute greater than one.
Keyboard-navigable JavaScript widgets - Accessibility
note that updating the tabindex to "0" requires also updating the previously selected item to tabindex="-1".
...to do this: bind a key down handler to each element in the group, and when an arrow key is used to move to another element: programmatically apply focus to the new element, update the tabindex of the focused element to "0", and update the tabindex of the previously focused element to "-1".
... prevent used key events from performing browser functions if your widget handles a key event, prevent the browser from also handling it (for example, scrolling in response to the arrow keys) by using your event handler's return code.
... for example: <span tabindex="-1" onkeydown="return handlekeydown();"> if handlekeydown() returns false, the event will be consumed, preventing the browser from performing any action based on the keystroke.
Web accessibility for seizures and physical reactions - Accessibility
this article introduces concepts behind making web content accessibile for those with vestibular disorders, and how to measure and prevent content leading to seizures and / or other physical reactions.
...in its article, "a revised definition of epilepsy" the epilepsy foundation notes that…"a seizure is an event and epilepsy is the disease involving recurrent unprovoked seizures." according to the epilepsy foundation's page "how serious are seizures?" , "sudden unexpected death in epilepsy (sudep) is likely the most common disease-related cause of death in with epilepsy.
...the css below is from the article, css-tricks revisiting prefers-reduced-motion, the reduced motion media query.
... @media screen and (prefers-reduced-motion: reduce), (update: slow) { * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; /* hat tip nick/cssremedy (https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/#comment-1700170) */ transition-duration: 0.001ms !important; } } from w3.org's page on media queries 4: the update media feature is used to query the ability of the output device to modify the appearance of content once it has been rendered.
Cubic Bezier Generator - CSS: Cascading Style Sheets
ext to use the canvas for drawing var ctx = canvas.getcontext('2d'); scaling = math.min(canvas.height - rulers - margin, canvas.width - rulers - margin); canvas.onmousedown = mousedown; canvas.onmouseup = mouseup; } else { alert('you need safari or firefox 1.5+ to see this demo.'); } } function cx(x) { return x * scaling + rulers; } function reversex(x) { return (x - rulers) / scaling; } function lx(x) { //used when drawing vertical lines to prevent subpixel blur var result = cx(x); return math.round(result) == result ?
... result + 0.5 : result; } function cy(y) { return (1 - y) * scaling + margin; } function reversey(y) { return (margin - y) / scaling + 1; } function ly(y) { // used when drawing horizontal lines to prevent subpixel blur var result = cy(y); return math.round(result) == result ?
...m != 0) { var canvas = document.getelementbyid('bezier'); var x = e.pagex - canvas.offsetleft; var y = e.pagey - canvas.offsettop; var output = document.getelementbyid('output'); output.value = "drag!"; if (dragsm == 1) { var x1 = document.getelementbyid('x1'); var y1 = document.getelementbyid('y1'); x1.value = reversex(x); x1.value = math.round(x1.value * 10000) / 10000; y1.value = reversey(y); y1.value = math.round(y1.value * 10000) / 10000; if (x1.value < 0) { x1.value = 0; } if (x1.value > 1) { x1.value = 1; } } else if (dragsm == 2) { var x2 = document.getelementbyid('x2'); var y2 = document.getelementbyid('y2')...
...; x2.value = reversex(x); x2.value = math.round(x2.value * 10000) / 10000; y2.value = reversey(y); y2.value = math.round(y2.value * 10000) / 10000; if (x2.value < 0) { x2.value = 0; } if (x2.value > 1) { x2.value = 1; } } updatecanvas(); } } initcanvas(); updatecanvas(); this is a sample tool; it lets you edit bezier curves.
animation - CSS: Cascading Style Sheets
WebCSSanimation
/* @keyframes duration | timing-function | delay | iteration-count | direction | fill-mode | play-state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* @keyframes name | duration | timing-function | delay */ animation: 3s linear 1s slidein; /* @keyframes name | duration */ animation: slidein 3s; <div class="grid"> <div class="col"> <div class="note"> given the following animation: <pre>@keyframes slidein { from { transform: scalex(0); } to { transform: scalex(1); } }</pre> </div> <...
...div class="row"> <div class="cell"> <button class="play" title="play"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s ease-in 1s 2 reverse both paused slidein;</div> <div class="animation a1"></div> </div> </div> <div class="row"> <div class="cell"> <button class="pause" title="pause"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s linear 1s slidein;</div> <div class="animation a2"></div> </div> </div> <div class="row"> <div class="cell"> <button class="pause" title="pause"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s slidein;</div> <div class="animation a3">...
...x; margin: .5em; padding: 0; background-color: #fff; overflow: hidden; text-align: left; } .flx { flex: 1 0; } .note { background: #fff3d4; padding: 1em; margin: .5em; font: .8em sans-serif; text-align: left; flex: none; } .overlay { padding: .5em; } @keyframes slidein { from { transform: scalex(0); } to { transform: scalex(1); } } .a1 { animation: 3s ease-in 1s 2 reverse both paused slidein; } .a2 { animation: 3s linear 1s slidein; } .a3 { animation: 3s slidein; } .animation { background: #3f87a6; width: 100%; height: calc(100% - 1.5em); transform-origin: left center; } window.addeventlistener('load', function () { var animation = array.from(document.queryselectorall('.animation')); var button = array.from(document.queryselectorall('button'))...
...ngle-animation> = <time> | <timing-function> | <time> | <single-animation-iteration-count> | <single-animation-direction> | <single-animation-fill-mode> | <single-animation-play-state> | [ none | <keyframes-name> ]where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function><single-animation-iteration-count> = infinite | <number><single-animation-direction> = normal | reverse | alternate | alternate-reverse<single-animation-fill-mode> = none | forwards | backwards | both<single-animation-play-state> = running | paused<keyframes-name> = <custom-ident> | <string>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinato...
flex-wrap - CSS: Cascading Style Sheets
WebCSSflex-wrap
syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below.
... wrap-reverse behaves the same as wrap but cross-start and cross-end are permuted.
... formal definition initial valuenowrapapplies toflex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax nowrap | wrap | wrap-reverse examples setting flex container wrap values html <h4>this is an example for flex-wrap:wrap </h4> <div class="content"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> <h4>this is an example for flex-wrap:nowrap </h4> <div class="content1"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> <h4>this is an example for flex-wrap:wrap-reverse </h4> <div class="content2"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> css /* common styles */ .content, .content1, .content2 { color: #fff; fo...
...text-align: center; } .content div, .content1 div, .content2 div { height: 50%; width: 300px; } .red { background: orangered; } .green { background: yellowgreen; } .blue { background: steelblue; } /* flexbox styles */ .content { display: flex; flex-wrap: wrap; } .content1 { display: flex; flex-wrap: nowrap; } .content2 { display: flex; flex-wrap: wrap-reverse; } results specifications specification status comment css flexible box layout modulethe definition of 'flex-wrap' in that specification.
Audio and Video Delivery - Developer guides
get","http://jplayer.org/audio/mp3/riomez-01-sleep_together.mp3",true); request.responsetype = "arraybuffer"; request.onload = function() { context.decodeaudiodata(request.response, function(buffer) { source = context.createbuffersource(); source.buffer = buffer; source.connect(context.destination); // auto play source.start(0); // start was previously noteon }); }; request.send(); } catch(e) { alert('web audio api not supported'); } in this example we retrieve an mp3 file via xhr, load it into a source and play it (try it for yourself).
... one of the principle uses of eme is to allow browsers to implement drm (digital rights management), which helps to prevent web-based content (especially video) from being copied.
... error handling starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), error handling has been revised to match the latest version of the html5 specification.
... video player styling basics with the cross-browser video player put in place in the previous article, this article now looks at providing some basic, reponsive styling for the player.
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
the html5 specification provides a more detailed description than previous html standards of how to turn a stream of bytes into a dom tree.
...if you previously tested your code in ie and opera, then you probably don't have any tags like this.
... in an inline script, in order to use the literal strings <script, </script>, and <!--, you should prevent them from being parsed literally by expressing them as \u003cscript,\u003c/script>, and \u003c!--.
...this means that you can now use svg and mathml inline in text/html similarly to what has previously been possible in application/xhtml+xml.
Introduction to HTML5 - Developer guides
html5 is the fifth revision and newest version of the html standard.
... it offers new features that provide not only rich media support but also enhance support for creating web applications that can interact with users, their local data, and servers more easily and effectively than was previously possible.
...in previous versions of html, it was done using a very complex <meta> element.
...this was done to tighten security and prevent some types of attacks.
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
external resource not allowed not allowed prev indicates that the current document is a part of a series, and that the previous document in the series is the referenced document.
... note: the obsolete rev="made" is treated as rel="alternate" bookmark relevant as the rel attribute value for the <a> and <area> elements, the bookmark provides a permalink for ancestor section, which is the nearest ancestor <article> or <section>, if there is at least one, otherwise, the nearest heading sibling or ancestor descendant, to the next..
... prev similar to the next keyword, relevant to <form>, <link>, <a>, and <area>, the prev values indicates that the current document is a part of a series, and that the link references a previous document in the series is the referenced document.
... note: the synonym previous is incorrect and should not be used.
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
without sending the origin: http header), preventing its non-tainted used in <canvas> elements.
...if the audio's metadata isn't available yet—thereby preventing you from knowing the media's start time or duration—currenttime instead indicates, and can be used to change, the time at which playback will begin.
...captions, which are specified using webvtt, allow people who are experiencing hearing loss to understand an audio recording's content as the recording is being played, while transcripts allow people who need additional time to be able to review the recording's content at a pace and format that is comfortable for them.
... if automatic captioning services are used, it is important to review the generated content to ensure it accurately represents the source audio.
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
the element must still have text within it, but that text may be an abbreviation (perhaps using <abbr>) or another form of the term.
... result the resulting content looks like this: using abbreviations and definitions together in some cases, you may wish to use an abbreviation for a term when defining it.
...the former establishes that the term is an abbreviation ("hst") and specifies the full term ("hubble space telescope") in its title attribute.
... the latter indicates that the abbreviated term represents a term being defined.
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
results the maximum number of items that should be displayed in the drop-down list of previous search queries.
... results the results attribute—supported only by safari—is a numeric value that lets you override the maximum number of entries to be displayed in the <input> element's natively-provided drop-down menu of previous search queries.
...the following screenshot comes from chrome: in addition, modern browsers also tend to automatically store search terms previously entered across domains, which then come up as autocomplete options when subsequent searches are performed in search inputs on that domain.
... let's have a look at an example: <form role="search"> <div> <input type="search" id="mysearch" name="q" placeholder="search the site..." aria-label="search through site content"> <button>search</button> </div> </form> you can see how this is rendered below: there is no visual difference from the previous example, but screenreader users have way more information available to them.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
without sending the origin: http header), preventing its non-tainted used in <canvas> elements.
... disablepictureinpicture prevents the browser from suggesting a picture-in-picture context menu or to request picture-in-picture automatically in some cases.
...captions allow people who are experiencing hearing loss to understand a video's audio content as the video is being played, while transcripts allow people who need additional time to be able to review audio content at a pace and format that is comfortable for them.
... if automatic captioning services are used, it is important to review the generated content to ensure it accurately represents the source video.
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<abbr> the html abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation.
... <select> the html <select> element represents a control that provides a menu of options <textarea> the html <textarea> element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.
... element description <acronym> the html acronym element (<acronym>) allows authors to clearly indicate a sequence of characters that compose an acronym or abbreviation for a word.
... <nobr> the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
a policy needs to include a default-src or script-src directive to prevent inline scripts from running, as well as blocking the use of eval().
... example 4 a web site administrator for an online banking site wants to ensure that all its content is loaded using tls, in order to prevent attackers from eavesdropping on requests.
...additionally, a report-only header can be used to test a future revision to a policy without actually deploying it.
...in summary, this is done to prevent leaking sensitive information about cross-origin resources.
Content negotiation - HTTP
the vary response header in opposition to the previous accept-* headers which are sent by the client, the vary http header is sent by the web server in its response.
...the header is needed in order to inform the cache of the decision criteria so that it can reproduce it, allowing the cache to be functional while preventing serving erroneous content to the user.
...obviously, the wildcard '*' prevents caching from occurring, as the cache cannot know what element is behind it.
... unfortunately, the http standard does not specify the format of the page allowing to choose between the available resource, which prevents to easily automatize the process.
Firefox user agent string reference - HTTP
though fixed in firefox 69, previous 32-bit versions of firefox running on 64-bit processors would report that the system is using a 32-bit cpu.
...ko user agent string phone mozilla/5.0 (android 4.4; mobile; rv:41.0) gecko/41.0 firefox/41.0 tablet mozilla/5.0 (android 4.4; tablet; rv:41.0) gecko/41.0 firefox/41.0 focus for android from version 1, focus is powered by android webview and uses the following user agent string format: mozilla/5.0 (linux; <android version> <build tag etc.>) applewebkit/<webkit rev> (khtml, like gecko) version/4.0 focus/<focusversion> chrome/<chrome rev> mobile safari/<webkit rev> tablet versions on webview mirror mobile, but do not contain a mobile token.
... firefox for fire tv version 3 (and probably earlier) of firefox for fire tv use a user agent string with the following format: mozilla/5.0 (linux; <android version>) applewebkit/537.36 (khtml, like gecko) version/4.0 focus/<firefoxversion> chrome/<chrome rev> safari/<webkit rev> firefox tv version user agent string v3.0 mozilla/5.0 (linux; android 7.1.2) applewebkit/537.36 (khtml, like gecko) version/4.0 focus/3.0 chrome/59.0.3017.125 safari/537.36 firefox for echo show from version 1.1, firefox for echo show uses a user agent string with the following format: mozilla/5.0 (linux; <android version>) applewebkit/537.36...
... (khtml, like gecko) version/4.0 focus/<firefoxversion> chrome/<chrome rev> safari/<webkit rev> firefox for echo show version user agent string v1.1 mozilla/5.0 (linux; android 5.1.1) applewebkit/537.36 (khtml, like gecko) version/4.0 focus/1.1 chrome/59.0.3017.125 safari/537.36 firefox os form factor gecko user agent string phone mozilla/5.0 (mobile; rv:26.0) gecko/26.0 firefox/26.0 tablet mozilla/5.0 (tablet; rv:26.0) gecko/26.0 firefox/26.0 tv mozilla/5.0 (tv; rv:44.0) gecko/44.0 firefox/44.0 device-specific mozilla/5.0 (mobile; nnnn; rv:26.0) gecko/26.0 firefox/26.0 device-specific user agent strings although it is strongly discouraged by mozilla, some handset manufacturers unfortunately ...
Closures - JavaScript
closure consider the following code example: function makefunc() { var name = 'mozilla'; function displayname() { alert(name); } return displayname; } var myfunc = makefunc(); myfunc(); running this code has exactly the same effect as the previous example of the init() function above.
... in previous examples, each closure had its own lexical environment.
... consider the following case: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); this.getname = function() { return this.name; }; this.getmessage = function() { return this.message; }; } because the previous code does not take advantage of the benefits of using closures in this particular instance, we could instead rewrite it to avoid using closure as follows: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); } myobject.prototype = { getname: function() { return this.name; }, getmessage: function() { return this.message; } }; ...
...the following example instead appends to the existing prototype: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); } myobject.prototype.getname = function() { return this.name; }; myobject.prototype.getmessage = function() { return this.message; }; in the two previous examples, the inherited prototype can be shared by all objects and the method definitions need not occur at every object creation.
JavaScript data types and data structures - JavaScript
wherever possible, comparisons with other languages are drawn.
... false obsolete attributes (as of ecmascript 3, renamed in ecmascript 5) attribute type description read-only boolean reversed state of the es5 [[writable]] attribute.
... dontenum boolean reversed state of the es5 [[enumerable]] attribute.
... dontdelete boolean reversed state of the es5 [[configurable]] attribute.
Control flow and error handling - JavaScript
« previousnext » javascript supports a compact set of statements, specifically control flow statements, that you can use to incorporate a great deal of interactivity in your application.
...production, regardless of any return statements in the try and catch blocks: function f() { try { console.log(0); throw 'bogus'; } catch(e) { console.log(1); return true; // this return statement is suspended // until finally block has completed console.log(2); // not reachable } finally { console.log(3); return false; // overwrites the previous "return" console.log(4); // not reachable } // "return false" is executed now console.log(5); // not reachable } console.log(f()); // 0, 1, 3, false overwriting of return values by the finally block also applies to exceptions thrown or re-thrown inside of the catch block: function f() { try { throw 'bogus'; } catch(e) { console.log('caught inner "bogus"'); throw...
... e; // this throw statement is suspended until // finally block has completed } finally { return false; // overwrites the previous "throw" } // "return false" is executed now } try { console.log(f()); } catch(e) { // this is never reached!
...n dosomethingerrorprone() { if (ourcodemakesamistake()) { throw (new error('the message')); } else { dosomethingtogetajavascripterror(); } } ⋮ try { dosomethingerrorprone(); } catch (e) { // now, we actually use `console.error()` console.error(e.name); // logs 'error' console.error(e.message); // logs 'the message', or a javascript error message } « previousnext » ...
Introduction - JavaScript
« previousnext » this chapter introduces javascript and discusses some of its fundamental concepts.
... prevent stupid semantics in javascript that trip up beginners.
... prevent code snippets executed in the console from interacting with one-another (e.g., having something created in one console execution being used for a different console execution).
... « previousnext » ...
Using Promises - JavaScript
« previousnext » a promise is an object representing the eventual completion or failure of an asynchronous operation.
... chaining a common need is to execute two or more asynchronous operations back to back, where each subsequent operation starts when the previous operation succeeds, with the result from the previous step.
...you might see this expressed with arrow functions instead: dosomething() .then(result => dosomethingelse(result)) .then(newresult => dothirdthing(newresult)) .then(finalresult => { console.log(`got the final result: ${finalresult}`); }) .catch(failurecallback); important: always return results, otherwise callbacks won't catch the result of a previous promise (with arrow functions () => x is short for () => { return x; }).
...you can capture these for analysis and handling by your code—or just to avoid having them cluttering up your output—by adding a handler for the unhandledrejection event, like this: window.addeventlistener("unhandledrejection", event => { /* you might start here by adding code to examine the promise specified by event.promise and the reason in event.reason */ event.preventdefault(); }, false); by calling the event's preventdefault() method, you tell the javascript runtime not to do its default action when rejected promises go unhandled.
JavaScript language resources - JavaScript
this is the second revision of the ecmascript standard; also iso standard 16262.
...this is the third revision of the ecmascript standard; corresponds to javascript 1.5.
...this is the fifth revision of the ecmascript standard.
... you can participate in or just track the work on the next revisions of the ecmascript language specification, code-named "harmony", and the ecmascript internationalization api specification via public wiki and the es-discuss mailing list linked from ecmascript.org.
WeakMap - JavaScript
these references prevent the keys from being garbage collected, even if there are no other references to the object.
... this would also prevent the corresponding values from being garbage collected.
... by contrast, native weakmaps hold "weak" references to key objects, which means that they do not prevent garbage collection in case there would be no other reference to the key object.
... this also avoids preventing garbage collection of values in the map.
Transitioning to strict mode - JavaScript
differences from non-strict to strict syntax errors when adding 'use strict';, the following cases will throw a syntaxerror before the script is executing: octal syntax var n = 023; with statement using delete on a variable name delete myvariable; using eval or arguments as variable or function argument name using one of the newly reserved keywords (in prevision for ecmascript 2015): implements, interface, let, package, private, protected, public, static, and yield declaring function in blocks if (a < b) { function f() {} } obvious errors declaring twice the same name for a property name in an object literal {a: 1, b: 3, a: 7} this is no longer the case in ecmascript 2015 (bug 1041128).
... declaring two function parameters with the same name function f(a, b, b) {} these errors are good, because they reveal plain errors or bad practices.
...careful review of your code base will probably be necessary to be sure these differences don't affect the semantics of your code.
... fortunately, this careful review can be done gradually down the function granularity.
Strict mode - JavaScript
converting mistakes into errors strict mode changes some previously-accepted mistakes into errors.
...rror var infinity = 5; // throws a typeerror // assignment to a non-writable property var obj1 = {}; object.defineproperty(obj1, 'x', { value: 42, writable: false }); obj1.x = 9; // throws a typeerror // assignment to a getter-only property var obj2 = { get x() { return 17; } }; obj2.x = 5; // throws a typeerror // assignment to a new property on a non-extensible object var fixed = {}; object.preventextensions(fixed); fixed.newprop = 'ohai'; // throws a typeerror third, strict mode makes attempts to delete undeletable properties throw (where before the attempt would simply have no effect): 'use strict'; delete object.prototype; // throws a typeerror fourth, strict mode prior to gecko 34 requires that all properties named in an object literal be unique.
...in normal code the last duplicated argument hides previous identically-named arguments.
... those previous arguments remain available through arguments[i], so they're not completely inaccessible.
Web video codec guide - Web media technologies
motion compression of video typically works by comparing frames, finding where they differ, and constructing records containing enough information to update the previous frame to approximate the appearance of the following frame.
... wagon-wheel effect the wagon-wheel effect (or stroboscopic effect) is the visual effect that's commonly seen in film, in which a turning wheel appears to rotate at the wrong speed, or even in reverse, due to an interaction between the frame rate and the compression algorithm.
... for example, each coding tree unit (ctu)—similar to the macroblock used in previous codecs—consists of a tree of luma values for each sample as well as a tree of chroma values for each chroma sample used in the same coding tree unit, as well as any required syntax elements.
...be sure to review the latest license terms and requirements before making a decision on whether or not to use hevc in your app or web site!
Codecs used by WebRTC - Web media technologies
this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc.
...this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc.
...this is due to a change in google play store requirements that prevent firefox from downloading and installing the openh264 codec needed to handle h.264 in webrtc connections.
... customizing the codec list once you have a list of the available codecs, you can alter it and then send the revised list to rtcrtptransceiver.setcodecpreferences() to rearrange the codec list.
Privacy, permissions, and information security
good security practices aim to prevent unauthorized access to systems or data, regardless of what the target is.
... modern browsers take steps to help prevent fingerprinting-based attacks by either not allowing information to be accessed or, where the information must be made available, by introducing variations that prevent it from being used for identification purposes.
... description certificate transparency an open standard for monitoring and auditing certificates, creating a database of public logs that can be used to help identify incorrect or malicious certificates content security policy provides the ability to define the extent to which a document's content can be accessed by other devices over the web; used in particular to prevent or mitigate attacks on the server feature policy lets web developers selectively enable, disable, and modify the behavior of certain features and apis both for a document and for subdocuments loaded in <iframe>s <iframe>'s allow attribute technically part of feature policy, the allow attribute on an <iframe> specifies which web features the document in the frame should ...
...for example, in firefox 73, the user permission requests were revised so that when an <iframe> uses the allow keyword to delegate permission to the embeded document, the browser asks the user to grant the parent document permission to use the resource, and that permission is then shared with the embedded content that requested the resource to begin with.
Introduction to progressive web apps - Progressive web apps (PWAs)
it's not a brand new concept—such ideas have been revisited many times on the web platform with various approaches in the past.
...the basic ideas behind network independence are to be able to: revisit a site and get its contents even if no network is available.
... browse any kind of content the user has previously visited at least once, even under situations of poor connectivity.
... safety the web platform provides a secure delivery mechanism that prevents snooping while simultaneously ensuring that content hasn’t been tampered with, as long as you take advantage of https and develop your apps with security in mind.
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
the display attribute only affects the direct rendering of a given element, whereas it does not prevent elements from being referenced by other elements.
... for example, setting it to none on a <path> element will prevent that element from getting rendered directly onto the canvas, but the <path> element can still be referenced by a <textpath> element; furthermore, its geometry will be used in text-on-a-path processing even if the <path> has a display value of none.
...thus, setting display="none" on a child of a <mask> will prevent the given child element from being rendered as part of the mask.
... similarly, setting display="none" on a child of a <clippath> element will prevent the given child element from contributing to the clipping path.
Filter effects - SVG: Scalable Vector Graphics
« previousnext » there are situations, where basic shapes do not provide the flexibility you need to achieve a certain effect.
...between the filter tags, goes a list of primitives, basic operations that build on top of the previous operations (like blurring, adding a lighting effect, etc).
... step 2 <feoffset in="blur" dx="4" dy="4" result="offsetblur"/> <feoffset> takes in "blur", which we previously created, shifts the result 4 to the right and 4 to the bottom, and stores the result in the buffer "offsetblur".
... source graphic primitive 1 primitive 2 primitive 3 primitive 4 primitive 5 primitive 6 « previousnext » ...
Transport Layer Security - Web security
encryption data is encrypted while being transmitted between the user agent and the server, in order to prevent it from being read and interpreted by unauthorized parties.
...the configuration file may need some adjustments to include custom settings, so be sure to review the generated configuration before using it; installing the configuration file without ensuring any references to domain names and the like are correct will result in a server that just doesn't work.
... tls 1.3 rfc 8446: tls 1.3 is a major revision to tls.
... tls 1.3 changes much of the protocol fundamentals, but preserves almost all of the basic capabilities as previous versions of tls.
Reddit Example - Archive of obsolete content
if (t.nodename != "a") return; // don't intercept the click if it was on one of the links in the header // or next/previous footer, since those links should load in the panel itself.
... if ($(t).parents('#header').length || $(t).parents('.nextprev').length) return; // intercept the click, passing it to the addon, which will load it in a tab.
... event.stoppropagation(); event.preventdefault(); self.port.emit('click', t.tostring()); }); this script uses jquery to interact with the dom of the page and the self.port.emit function to pass urls back to the add-on script.
Classes and Inheritance - Archive of obsolete content
we can now use the above constructor to create instances of the class circle: let circle = circle(2, 3, 5); circle instanceof circle; // => true circle.x; // => 2 circle.y; // => 3 circle.radius; // => 5 inheritance and prototypes there is a problem with the definition of circle in the previous section that we have glossed over thus far.
... inheritance and instanceof the single line of code we added in the previous section solved the problem with prototypes, but introduced a new problem with the instanceof operator.
...ar circle = class({ extends: shape, initialize: function(x, y, radius) { shape.prototype.initialize.call(this, x, y); this.radius = radius; }, draw: function (context) { context.beginpath(); context.arc(this.x, this.y, this.radius, 0, 2 * math.pi, false); context.fill(); } }); unlike the definition of circle in the previous section, we no longer have to override its prototype, or set its constructor property.
Modules - Archive of obsolete content
to prevent scripts from interfering with each other, loadscript should evaluate each script to be loaded in the scope of their own global object, and then return the global object as its result.
...return global.exports; } among other things, this allows us to import loadscript to scripts being loaded, allowing them to load further scripts: // index.js: loadscript("www.foo.com/a.js", { loadscript: loadscript }).foo; => 5 // a.js: exports.foo = imports.loadscript("www.foo.com/b.js").bar; // b.js: exports.bar = 5; sandboxes and compartments the loadscript function as defined in the previous section still has some serious shortcomings.
...if the script being loaded is less privileged than the loading script, the access is prevented, as the following example shows: // index.js: let a = loadscript("www.foo.com/a.js", { components: components }); // index.js has chrome privileges components.utils; // => [object nsxpccomponents_utils] // a.js: // a.js has content privileges imports.components.utils; // => undefined modules in the add-on sdk the module system used by the sdk is based on what we learned so far: it f...
net/xhr - Archive of obsolete content
if access to the filesystem isn't prevented, it could easily be used to access sensitive user data, though this may be inconsequential if the client can't access the network.
... if access to local area networks isn't prevented, malicious code could access sensitive data.
... if transmission of cookies isn't prevented, malicious code could access sensitive data.
remote/child - Archive of obsolete content
methods forevery calls the callback for every existing frame and any new frames created in the future.
... removeeventlistener removes an event listener that was previously registered.
... removeeventlistener(event, listener, iscapturing) removes an event listener that was previously registered.
remote/parent - Archive of obsolete content
ocess } = require("sdk/remote/child"); const { processid } = require("sdk/system/runtime"); process.port.on("fetchid", () => { process.port.emit("id", processid); }); // main.js const { processes, remoterequire } = require("sdk/remote/parent"); // load "remote.js" into every current and future process remoterequire("./remote.js", module); // for every current and future process processes.forevery(process => { // ask for the process id process.port.emit("fetchid"); // first argument is always the process, then the message payload process.port.once("id", (process, id) => { console.log("child process is remote:" + process.isremote); console.log("child process id:" + id); }); }); content frame manipulation this demonstrates telling every current frame to link to a spec...
...listen to attach and detach events to hear as processes are started and stopped: const { processes } = require("sdk/remote/parent"); processes.on("attach", function(process) { console.log("new process is remote: " + process.isremote); }); methods forevery(callback) calls the callback for every existing process and any new processes created in the future.
... const { frames } = require("sdk/remote/parent"); frames.on("attach", function(frame) { console.log("frame is attached: " + frame.frameelement); }); methods forevery(callback) calls the callback for every existing frame and any new frames created in the future.
jpm - Archive of obsolete content
listed add-ons will require a manual review before they can be signed.
...you should revoke and regenerate compromised api credentials immediately.
... when you make updates to your add-on to add features or fix bugs, you'll want any previously installed versions of the add-on to update themselves to the new version.
Storing annotations - Archive of obsolete content
tentscriptfile: data.url('editor/annotation-editor.js'), onmessage: function(annotationtext) { if (annotationtext) handlenewannotation(annotationtext, this.annotationanchor); annotationeditor.hide(); }, onshow: function() { this.postmessage('focus'); } }); listing stored annotations to prove that this works, let's implement the part of the add-on that displays all the previously entered annotations.
...notationlist.empty(); storedannotations.foreach( function(storedannotation) { var annotationhtml = $('#template .annotation-details').clone(); annotationhtml.find('.url').text(storedannotation.url) .attr('href', storedannotation.url); annotationhtml.find('.url').bind('click', function(event) { event.stoppropagation(); event.preventdefault(); self.postmessage(storedannotation.url); }); annotationhtml.find('.selection-text') .text(storedannotation.anchortext); annotationhtml.find('.annotation-text') .text(storedannotation.annotationtext); annotationlist.append(annotationhtml); }); }); it builds the dom for the panel from the array of annotations i...
...a real add-on should give the user a chance to choose which data to keep, and prevent the user from adding any more data until the add-on is back under quota.) respecting private browsing since annotations record the user's browsing history we should avoid recording annotations in private windows.
Forms related code snippets - Archive of obsolete content
it is not supported in internet explorer 6-9, or in the preview of internet explorer 10.
... image preview before upload the filereader.prototype.readasdataurl() method can be useful, for example, to get a preview of an image before uploading it.[article] this example shows how to use it in this way.
...for a full compatibility code you can see our crossbrowser possible solution for image preview.
Enhanced Extension Installation - Archive of obsolete content
there are not enough guards in the upgrade and uninstall process to handle failure and abort the operation, restoring the previous state.
...this property is ignored for extensions installed into unrestricted locations, such as the profile location, to prevent abuse.
...this should prevent against random file deletions and allow developers to easily reset their state by deleting one of the required system files.
Extension Versioning, Update and Compatibility - Archive of obsolete content
previously, it was possible to wind up with two copies of the same add-on installed.
...aa4gbamo1o2gwsccth1gwymgscfanakpn40pjfowt ub2hvdg8+oxmcif8d/9evwm8eh/ixuxyzlmrzts3o5tv9eway5ubctqdf1wgtsgk jrgzow1fitkzi7w0//c8ekdmlatguegfns2iltd5p/0kh/hf1rpc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> </rdf:rdf> some people prefer this alternate format (note that much of the information has been trimmed from this example for brevity in order to show the basic structure): <?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <!-- this description resource includes all the update and compatibility information for a single add-on with the id foobar@developer.mozilla.org.
... </em:updates> <em:signature>migtma0gcsqgsib3dqebbquaa4gbamo1o2gwsccth1gwymgscfanakpn40pjfowt ub2hvdg8+oxmcif8d/9evwm8eh/ixuxyzlmrzts3o5tv9eway5ubctqdf1wgtsgk jrgzow1fitkzi7w0//c8ekdmlatguegfns2iltd5p/0kh/hf1rpc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> <!-- this represents the same description within the li from the previous example --> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org:2.2"> <em:version>2.2</em:version> <!-- trimmed the rest of the contents here --> </rdf:description> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org:2.5"> <em:version>2.5</em:version> <!-- trimmed the rest of the contents here --> </rdf:description> <...
Install Manifests - Archive of obsolete content
firefox 2 and previous supported a value of 16 to represent plug-ins.
...previous versions of these applications will ignore the restrictions and install the add-on regardless of the platform.
... note: this property is no longer supported under gecko 1.9.2 (firefox 3.6) or later, to prevent extensions from being installed in such a way that the user might not be able to tell they're installed.
Interaction between privileged and non-privileged pages - Archive of obsolete content
lback could look like this: in the extension: var myextension = { mylistener: function(evt) { alert("received from web page: " + evt.target.getattribute("attribute1") + "/" + evt.target.getattribute("attribute2")); /* the extension answers the page*/ evt.target.setattribute("attribute3", "the extension"); var doc = evt.target.ownerdocument; var answerevt = doc.createelement("myextensionanswer"); answerevt.setattribute("part1", "answers this."); doc.documentelement.appendchild(answerevt); var event = doc.createevent("htmlevents"); event.initevent("myanswerevent", true, false); answerevt.dispatchevent(event); } } document.addeventlistener("myextensionevent", function(e) { myextension.mylistener(e); }, false, true); // the ...
... in the web page: document.addeventlistener("myanswerevent",function(e) { extensionanswer(e); },false); var element; function callextension() { var element = document.createelement("myextensiondataelement"); element.setattribute("attribute1", "foobar"); element.setattribute("attribute2", "hello world"); document.documentelement.appendchild(element); var evt = document.createevent("events"); evt.initevent("myextensionevent", true, false); element.dispatchevent(evt); } function extensionanswer(evtanswer) { alert(element.getattribute("attribute3") + " " + evtanswer.target.getattribute("part1")); } basic example of similar idea, extension passes information via attr...
...gecko prevents chrome to access custom object properties added by the content, because that can create security holes.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
« previousnext » this document was authored by hiroshi shimoda of clear code inc.
... the minimum knowledge required in the interest of brevity, i will omit explanations of widely understood technologies, and focus instead on introducing new technologies you will need to understand in order to develop for firefox.
... listing 4: an example manipulation using the dom var bar = document.getelementbyid('toolbar'); bar.removechild(bar.childnodes[1]); bar.appendchild(document.createelement('button')); bar.lastchild.setattribute('label', 'hello!'); « previousnext » ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
« previousnext » fixme: we should include a link to the mdc list of snippets fixme: we need to add a part about 'why and how to create your own component' c++/js this document was authored by hiroshi shimoda of clear code inc.
...nicode to euc-jp var converter = components.classes['@mozilla.org/intl/scriptableunicodeconverter'] .getservice(components.interfaces.nsiscriptableunicodeconverter); converter.charset = 'euc-jp'; var unicode_str = '\u5909\u63db\u30c6\u30b9\u30c8'; var eucjp_str = converter.convertfromunicode(unicode_str); converting from other encodings to unicode listing 18 shows how to do the reverse, converting from text saved as iso-2022-jp to unicode.
...eateinstance(components.interfaces.nsistringinputstream); content = 'content-type: application/x-www-form-urlencoded\n'+ 'content-length: '+content.length+'\n\n'+ content; postdata.setdata(content, content.length); var flags = components.interfaces.nsiwebnavigation.load_flags_none; browser.loaduriwithflags('http://piro.sakura.ne.jp/', flags, referrer, null, postdata); « previousnext » ...
Adding menus and submenus - Archive of obsolete content
« previousnext » the hello world example in the previous sections shows the two most common ways to add menus.
... adding elements to existing menus just as explained in the previous sections, the best place to overlay your extension menu is inside the tools menu.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Connecting to Remote Content - Archive of obsolete content
« previousnext » using xmlhttprequest xmlhttprequest is an api for transferring xml between a local script and a remote server via http.
...xpath can also be used to extract information from web pages once they load, along with the page load interception techniques discussed previously.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Custom XUL Elements with XBL - Archive of obsolete content
« previousnext » xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents.
...javascript code is enclosed in cdata sections to prevent js and xml syntax conflicts.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
for security reasons, and to prevent errors, care needs to be taken to avoid evaluating arbitrary text as html.
.../g, (m) => ({ "&": "&amp;", '"': "&quot;", "'": "&#39;", "<": "&lt;", ">": "&gt;" })[m]); } or slightly more verbose, but slightly more efficient: function escapehtml(str) { return str.replace(/[&"'<>]/g, (m) => escapehtml.replacements[m]); } escapehtml.replacements = { "&": "&amp;", '"': "&quot;", "'": "&#39;", "<": "&lt;", ">": "&gt;" }; note that quotation marks must be escaped in order to prevent fragments escaping attribute values.
...generating scripts in this matter is deprecated and should be avoided wherever possible, but is relatively safe and sometimes acceptable.
JavaScript Object Management - Archive of obsolete content
« previousnext » chrome javascript in this section we'll look into how to handle javascript data effectively, beginning with chrome code, in ways which will prevent pollution of shared namespaces and conflicts with other add-ons resulting from such global namespace pollution.
...we have defined two files, one to declare namespaces and another one for the message count functionality mentioned in the previous exercise.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Observer Notifications - Archive of obsolete content
« previousnext » sometimes you need your code to send a message to other parts of your code.
...as we saw in previous sections, you can use javascript code module and xpcom objects very easily from the chrome.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
The Box Model - Archive of obsolete content
« previousnext » in order to master xul, you'll need to have a fairly good understanding of its box model.
...as their names should make clear, you can control the flexibility boundaries of elements, thus preventing them from growing or shrinking too much.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
User Notifications and Alerts - Archive of obsolete content
« previousnext » it is often the case that extensions need to notify users about important events, often requiring some response.
...you should look for the level that better fits your message, and use the lowest applicable level, to prevent the user from getting used to dismissing high-level notifications.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
XPCOM Objects - Archive of obsolete content
« previousnext » xpcom xpcom is a cross platform component object model, similar to microsoft com.
... using xpcom components is relatively simple, as you've seen in previous examples.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Setting up an extension development environment - Archive of obsolete content
this prevents the browser debugger from prompting for connection permission every time.
...to see them, prevent the automatic restart by setting the environment no_em_restart to 1 before starting the application.) nglayout.debug.disable_xul_fastload = true.
...for example, rather than having content myextension jar:chrome/myextension.jar!/content/ use content myextension chrome/content/ preventing the first launch extension selector requires gecko 8.0(firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) starting in firefox 8, on the first launch of a new version of firefox, it presents user interface letting users select which third party add-ons to keep.
Firefox addons developer guide - Archive of obsolete content
these should use the previous, next, and prevnext templates to add quick routes to get from chapter to chapter.
... todo: all fixme notes inside the documents; add abbreviation definition to acronyms; add some link to the internal mdc documentation when it makes sense; indent source code; make sure documentation is relevant for all platforms: gnu/linux, macos, windows; add anchor links to figures & listings; add credits to original authors and license; completed sometimes, interfaces names are misspelled: s/nsl/nsi; talk about fuel; titles of chapters and ...
...sub-headings should have caps for first letter of each word; we should add a part about bad and good practices (leaks, global scopes, ...); add external resources (mozdev.org/community/books.html); add to chapter 3 or 5 more informations about overlay (how to overlay some interesting part of firefox like status bar, menus or toolbar) add previous/next at the end of each chapter questions: opensource appendix.
Promises - Archive of obsolete content
this interface replaces the previous, complicated xpcom nsifile and streams apis, and their related javascript helper modules.
... notifyuser(xhr.responsetext); }); downloading remote files nearly all previous methods of downloading remote files have been superseded by the much simpler downloads.jsm module.
... // failure to do this will prevent firefox from shutting down // cleanly.
Images, Tables, and Mysterious Gaps - Archive of obsolete content
it isn't possible for an author to change the baseline's position directly, so wherever it ends up is where it will be.
...the lack of a doctype will prevent validation, and so is not recommended.
...this will prevent browsers from using standards-based rendering, and thus all the image-layout problems are avoided.
Visualizing an audio spectrum - Archive of obsolete content
('loadedmetadata', loadedmetadata, false); // fft from dsp.js, see below var fft = function(buffersize, samplerate) { this.buffersize = buffersize; this.samplerate = samplerate; this.spectrum = new float32array(buffersize/2); this.real = new float32array(buffersize); this.imag = new float32array(buffersize); this.reversetable = new uint32array(buffersize); this.sintable = new float32array(buffersize); this.costable = new float32array(buffersize); var limit = 1, bit = buffersize >> 1; while ( limit < buffersize ) { for ( var i = 0; i < limit; i++ ) { this.reversetable[i + limit] = this.reversetable[i] + bit; } limi...
...1; bit = bit >> 1; } for ( var i = 0; i < buffersize; i++ ) { this.sintable[i] = math.sin(-math.pi/i); this.costable[i] = math.cos(-math.pi/i); } }; fft.prototype.forward = function(buffer) { var buffersize = this.buffersize, costable = this.costable, sintable = this.sintable, reversetable = this.reversetable, real = this.real, imag = this.imag, spectrum = this.spectrum; if ( buffersize !== buffer.length ) { throw "supplied buffer is not the same size as defined fft.
... fft size: " + buffersize + " buffer size: " + buffer.length; } for ( var i = 0; i < buffersize; i++ ) { real[i] = buffer[reversetable[i]]; imag[i] = 0; } var halfsize = 1, phaseshiftstepreal, phaseshiftstepimag, currentphaseshiftreal, currentphaseshiftimag, off, tr, ti, tmpreal, i; while ( halfsize < buffersize ) { phaseshiftstepreal = costable[halfsize]; phaseshiftstepimag = sintable[halfsize]; currentphaseshiftreal = 1.0; currentphaseshiftimag = 0.0; for ( var fftstep = 0; fftstep < halfsize; fftstep++ ) { i = fftstep; while ( i < buffersize ) {...
Making it into a static overlay - Archive of obsolete content
its next line is the stylesheet reference we previously added to navigator.xul.
...within that element is the script reference we previously added to navigator.xul.
... « previousnext » ...
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
directories inside classic.jar is one directory, skin, as well as two files, preview.png and icon.png.
...into this directory put the browser, global, communicator, help, and mozapps directories from above, as well as the icon.png and preview.png files.
... repackaging jar now all you need to do is repackage a jar file with the following directory structure, using your favorite archive manager to create a zip archive: /browser/* /communicator/* /global/* /help/* /mozapps/* /contents.rdf /install.rdf /icon.png /preview.png make sure not to just zip up the my_theme parent directory since that will cause the drag and drop install in the next section to fail without error messages.
Documentation for BiDi Mozilla - Archive of obsolete content
where the system is capable of tasks such as reversing and shaping text, symmetric swapping, numeric translation, etc., no special text rendering is needed, though there may be a call to a native api to set the base text direction (for example settextalign on windows).
... in some circumstances, even on a platform with bidi capability, the layout code has to reverse text fragments or to allow for the fact that they are displayed in reverse.
... text in visual mode must also be reversed before display on a bidi platform.
Hidden prefs - Archive of obsolete content
this page has been flagged by editors or users as needing technical review.
... until it is fully reviewed, it may contain inaccurate or incorrect information.
... address book "get map" button pref ("mail.addr_book.mapit_url.format" ) the format for this pref is: @a1 == address, part 1 @a2 == address, part 2 @ci == city @st == state @zi == zip code @co == country if the pref is set to "", no "get map" button will appear in the addressbook card preview pane.
Modularization techniques - Archive of obsolete content
use them wherever possible.
...extern "c" ns_export prbool nscanunload(); the implementation of nsgetfactory() in the simplest case is nearly identical to that of getsamplefactory() in our previous example.
... links the component object model specification revision history feb 25, 1998, created oct 19, 1998, dusted off momentarily oct 10, 1999, added comments about xpidl, language-independentness original document information author(s): will scullin last updated date: september 13, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons licen...
Mozilla Crypto FAQ - Archive of obsolete content
shortly thereafter the nss developers began work on an open source implementation of the rsa algorithm; that code, together with code previously developed for other cryptographic algorithms, will be included in a new version 3.1 of the nss open source cryptographic and pki library.
... yes, as long as patent or other legal issues do not prevent such code from being used by the general community of mozilla developers.
... new contributions of crypto code should also be reviewed and approved by the appropriate mozilla module owners, just as with any other mozilla contributions.
Supporting private browsing mode - Archive of obsolete content
} }; canceling shutting off private browsing mode extensions can prevent private browsing mode from being shut off.
... an extension might wish to do this if it's currently in the middle of an operation that prevents safely turning off private browsing (such as a database update operation, for example).
...f we are leaving the private mode /* you should display some user interface here */ asubject.data = true; // cancel the operation } } }, "private-browsing-cancel-vote", false); note: a well-mannered extension should display some sort of user interface to indicate that private browsing mode will be kept on, and possibly offer the option to cancel whatever operation is preventing the extension from allowing private browsing to be shut off.
The new nsString class implementation (1999) - Archive of obsolete content
the i18n team correctly points out that that anarchy will prevail if judicious control over their use is not mandated.
...(these are stubbed out today awaiting their review and implementation).
... second, they are concerned that programmers be prevented from abusing the string classes in a number of ways.
init - Archive of obsolete content
method of installversion object syntax init ( int maj, int min, int rev, int bld ); init ( string version ); parameters the init method has the following parameters: maj the major version number.
... rev revision number.
... when maj, min, rev, and bld are provided as parameters, all four parameters are required, but all of them can be zero.
List of commands - Archive of obsolete content
tion): cmd_copy - copy a selection to the clipboard cmd_cut - cut a selection into the clipboard cmd_paste - paste a selection from the clipboard cmd_selectall cmd_selectnone cmd_copylink cmd_copyimagelocation cmd_copyimagecontents cmd_scrolltop cmd_scrollbottom cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_scrollleft cmd_scrollright cmd_selectcharprevious cmd_selectcharnext cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_selectlineprevious cmd_selectlinenext cmd_selectpageprevious cmd_selectpagenext cmd_selectmovetop cmd_selectmovebottom editor commands (legal when the focus is anywhere where you can type text): cmd_paste - paste a s...
...election from the clipboard cmd_pastequote cmd_delete cmd_deletecharbackward cmd_deletecharforward cmd_deletewordbackward cmd_deletewordforward cmd_deletetobeginningofline cmd_deletetoendofline cmd_scrolltop cmd_scrollbottom cmd_movetop cmd_movebottom cmd_selecttop cmd_selectbottom cmd_linenext cmd_lineprevious cmd_selectlinenext cmd_selectlineprevious cmd_charprevious cmd_charnext cmd_selectcharprevious cmd_selectcharnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_wordprevious cmd_wordnext cmd_selectwordprevious cmd_selectwordnext cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_movepageup cmd_movepagedown cmd_selectpageup cmd_selectpagedown other commands the following list other commands (prefixed ...
...zilla.org/seamonkey/sou...kmarks-temp.js http://lxr.mozilla.org/seamonkey/sou.../bookmarks.xml http://lxr.mozilla.org/seamonkey/sou...rksoverlay.xul http://lxr.mozilla.org/seamonkey/sou...okmarkstree.js list of commands (listed alphabetically) browser:addbookmark browser:addbookmarkas browser:addgroupmarkas browser:back browser:editpage browser:find browser:findagain browser:findprev browser:forward browser:home browser:managebookmark browser:open browser:openfile browser:print browser:printpreview browser:savepage browser:searchinternet browser:sendpage browser:uploadfile cmd_bm_copy cmd_bm_cut cmd_bm_delete cmd_bm_expandfolder cmd_bm_export cmd_bm_find cmd_bm_import cmd_bm_managefolder cmd_bm_movebookmark cmd_bm_newbookmark cmd_bm_newfolder cmd_bm_new...
Panels - Archive of obsolete content
preventing panels from automatically closing a panel will be closed when a user clicks outside of the panel or when the escape key is pressed.
...you can prevent the focus from being removed by setting the noautofocus attribute to true as above.
... in addition, the norestorefocus attribute should be set to true in order to prevent the previously focused element from being refocused.
canRewind - Archive of obsolete content
« xul reference canrewind type: boolean this property is set to true if the user can press the back button to go to the previous page.
... if this property is false, the user cannot navigate to the previous page.
...set to false to disallow moving to the previous page.
Actions - Archive of obsolete content
« previousnext » the content to generate in a template is specified using the <xul:action> element which should either be the next sibling of the <xul:query> element (if no rules need be specified) or be a direct child of a <xul:rule> element.
...additional content the previous example generated only a set of buttons, but the action body may contain additional content.
...here is an image of [this example] (note: see the next section for an explanation of why there are extra buttons here.) « previousnext » ...
Bindings - Archive of obsolete content
« previousnext » we can add more triples to the previous example to show more information.
...<query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> it works similarly to the previous triple.
... « previousnext » ...
Building Menus With Templates - Archive of obsolete content
« previousnext » menus may be generated using a template in the same manner as other elements.
...here is an example using an xml source: <button type="menu" datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <menupopup> <menuitem uri="?" label="?name"/> </menupopup> </action> </template> </button> <button label="children" oncommand="alert(this.previoussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button.
...uri="http://www.xulplanet.com/rdf/garden/18" label="18"/> </menupopup> </menu> <menu uri="http://www.xulplanet.com/rdf/garden" label="garden avenue"> <menupopup> <menuitem uri="http://www.xulplanet.com/rdf/garden/25" label="25"/> <menuitem uri="http://www.xulplanet.com/rdf/garden/37" label="37"/> </menupopup> </menu> </menupopup> </button> « previousnext » ...
Filtering - Archive of obsolete content
« previousnext » adjusting the query sometimes you may wish to change the query at a later time.
...in the previous example, we hard-coded a menulist with the list of countries, but we could also generate this list from the datasource.
... « previousnext » ...
Multiple Rule Example - Archive of obsolete content
« previousnext » the most common use of multiple rules is to apply different action bodies to different results.
...if you reversed the order of the two rules in the example above, three photos would still be displayed, but the larger rule that displays the image details would be dropped as the other rule has a higher priority.
... « previousnext » ...
RDF Modifications - Archive of obsolete content
« previousnext » one of the most useful aspects of using templates with rdf datasources is that when the rdf datasource changes, for instance a new triple is added, or a triple is removed, the template updates accordingly, adding or removing result output as needed.
...the previous triple will fill in a value for the ?title variable, since we now have a value for the ?photo variable referred to by the triple's subject attribute.
... « previousnext » ...
Recursive Generation - Archive of obsolete content
« previousnext » in the previous example, the template builder generated an extra set of two buttons for the second row.
...naturally, the parent will be the new result's content, rather than the outer containing element, and the starting point will be the endpoint of the previous iteration.
... « previousnext » ...
Sorting Results - Archive of obsolete content
« previousnext » when results are generated from a query, content is generated in the same order as the results.
...when the sort is descending, the tree rows will be sorted in the reverse order.
... « previousnext » ...
Static Content - Archive of obsolete content
« previousnext » creating a menuitem in the filter list to show all items is fairly easy.
...-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <menupopup> <menuitem uri="?country" label="?countrytitle" value="?country"/> </menupopup> </action> </template> </menulist> the only difference between the previous example and this one is that the menulist element has some additional content added before the template.
... « previousnext » ...
Template Logging - Archive of obsolete content
« previous debugging problems with a template can be difficult as many problems are logic errors that are often not possible to determine automatically.
...neither subject or object variables of <triple> has a value similar to the previous error but for the <triple> element.
... « previous ...
XML Assignments - Archive of obsolete content
« previousnext » sometimes, you will want to use a more complex substitution apart from just taking an attribute from the xml.
...here, the two attributes 'name' and 'gender' will be taken from the xml data, as in previous examples.
... « previousnext » ...
Adding Event Handlers - Archive of obsolete content
« previousnext » the find files dialog so far looks quite good.
...the bubbling phase is essentially the reverse of the capturing phase.
... « previousnext » ...
Additional Install Features - Archive of obsolete content
« previous this section describes some more specifics of installers.
... installer file manipulation the previous section described a basic installer.
... « previous ...
Box Model Details - Archive of obsolete content
« previousnext » we've seen a lot of features of the box model.
...you can also prevent this stretching by placing a maximum height on the elements or, better, on the box itself.
... « previousnext » ...
Broadcasters and Observers - Archive of obsolete content
« previousnext » there may be times when you want several elements to respond to events or changes of state easily.
...we saw something like this in a previous section where the disabled attribute was adjusted once and propagated to other elements.
... « previousnext » ...
Content Panels - Archive of obsolete content
« previousnext » in this section, we'll look at how to add panels that can display html pages or other xul files.
...this prevents the content from traversing up to the xul window.
... « previousnext » ...
Creating a Window - Archive of obsolete content
« previousnext » we're going to be creating a simple find files utility throughout this tutorial.
...create a file called findfile.xul and put it in the content directory specified in the findfile.manifest file (we've created in the previous section).
... « previousnext » ...
Document Object Model - Archive of obsolete content
« previousnext » the document object model (dom) can be used with xul elements to get information about them or modify them.
...some common properties are listed below: firstchild reference to the first child node of an element lastchild reference to the last child node of an element childnodes holds a list of the children of an element parentnode reference to the parent of an node nextsibling reference to the next sibling in sequence previoussibling reference to the previous sibling in sequence these properties allow you to navigate through a document is various ways.
... « previousnext » ...
Focus and Selection - Archive of obsolete content
« previousnext » the section will describe how to handle the focus and selection of elements.
...these methods move the focus to the next element in sequence or the previous element respectively.
... « previousnext » ...
List Controls - Archive of obsolete content
« previousnext » xul has a number of types of elements for creating list boxes.
...for example, the url field in the browser has a drop-down for selecting previously typed urls, but you can also type them in yourself.
... « previousnext » ...
Manifest Files - Archive of obsolete content
« previousnext » in this section, we'll see how to put chrome and xul files into a package and create the manifest files for them.
...this flag was added to prevent this problem and should always be used for newer extensions, but is left out for older extensions that might not be compatible with the change.
... « previousnext » ...
Modifying a XUL Interface - Archive of obsolete content
« previousnext » the dom provides various functions to modify the document.
...in this next example, we reverse the state of the checked property whenever the button is pressed.
... « previousnext » ...
More Menu Features - Archive of obsolete content
« previousnext » in this section, we'll look at creating submenus and checked menus creating submenus you can create submenus inside other menus (nested menus) using the existing elements.
...when another item is selected, the previously selected item is unchecked.
... « previousnext » ...
More Wizards - Archive of obsolete content
« previousnext » this section describes some additional features of wizards.
...for this, use the handlers described in the previous section.
... « previousnext » ...
Numeric Controls - Archive of obsolete content
« previousnext » xul has two elements used for the entry of numeric values or ranges, and well as two elements for entering dates and times.
...<scale orient="vertical" dir="reverse"/> this scale will be shown vertical with lower values at the bottom and higher values at the top.
...<datepicker type="popup"/> « previousnext » ...
Styling a Tree - Archive of obsolete content
« previousnext » the following describes how to style a tree.
...let's make every fourth row have blue text, using the example from a previous section.
... « previousnext » ...
Tabboxes - Archive of obsolete content
« previousnext » it is common in preference dialogs for tabbed pages to appear.
...alternatively, you could set the dir attribute to reverse on the tabbox.
... « previousnext » ...
Templates - Archive of obsolete content
« previousnext » in this section, we'll find out how to populate elements with data.
...if you don't understand this, try re-reading the last part of the previous section.
... « previousnext » ...
Tree Selection - Archive of obsolete content
« previousnext » the section will describe how to get and set the selected items in a tree.
...there is also a clearselection() function to clear the selection, and an invertselection function to reverse the selection, that is, deselect all selected rows and select all unselected rows.
... « previousnext » ...
Tree View Details - Archive of obsolete content
« previousnext » this section will describe some more features of tree views.
... review of the methods here is a review of the methods needed to implement hierarchical views: getlevel(row) hasnextsibling(row, afterindex) getparentindex(row) iscontainer(row) iscontainerempty(row) iscontaineropen(row) toggleopenstate(row) the afterindex argument to hasnextsibling function is used as optimization to only start looking for the next sibling after that point.
... « previousnext » ...
XUL element attributes - Archive of obsolete content
reverse for scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales).
...this is reverse of the order in which they appear in the xul code.
...in order to revert to the normal cursor state call the method removeattribute("wait-cursor") when the process effectively has ended otherwise the wait cursor might never disappear.
XUL accessibility guidelines - Archive of obsolete content
it is hoped that these guidelines will be sufficiently clear and detailed that everyone—even someone with no previous background in accessibility—can understand them.
...(firefox's "print preview" window uses this fallback technique.) this should only be used as a last resort, and it should be consistent throughout a window (that is either all toolbar buttons are tabbable or none of them are).
...to prevent this, move the focus to the next element before disabling, hiding, or destroying the focus element.
The Implementation of the Application Object Model - Archive of obsolete content
by keeping the dom tree in a sandbox (safely insulated from the containing aom tree in which it might occur), you have an easy means of distinguishing the two trees and preventing scripts in the dom tree from manipulating the aom tree.
... statement #1 the two points raised in the previous two paragraphs, namely (1) redundancy of methods in the interfaces as well as a likely code redundancy in the implementation of some of those methods, and (2) the desire to be insulated from the layout dll should those interfaces change, imply that a layer needs to exist between the pluggable content and the content tree interfaces.
... preventing the persistence of attributes: the discardable attribute individual attributes can be specified as non-persistent (i.e.,discardable) through the use of the discardable attribute.
button - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
... reverse for scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales).
...this is reverse of the order in which they appear in the xul code.
menupopup - Archive of obsolete content
returning false from this event handler prevents the popup from appearing.
... openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location.
... triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup).
panel - Archive of obsolete content
ArchiveMozillaXULpanel
returning false from this event handler prevents the popup from appearing.
... openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location.
... triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup).
toolbarbutton - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
... reverse for scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales).
...this is reverse of the order in which they appear in the xul code.
wizard - Archive of obsolete content
canrewind type: boolean this property is set to true if the user can press the back button to go to the previous page.
... if this property is false, the user cannot navigate to the previous page.
...set to false to disallow moving to the previous page.
Logging Multi-Process Plugins - Archive of obsolete content
make sure you have write permissions to wherever you wish to save the log.
...from within a command prompt: c:\> set nspr_log_modules=ipcplugins:5 c:\> set nspr_log_file=c:\plugins.log c:\> cd c:\program files\mozilla firefox c:\> firefox.exe the log file will be saved to c:\plugins.log (or wherever nspr_log_file is set).
...from within a bash shell: $ export nspr_log_modules=ipcplugins:5 $ export nspr_log_file=~/plugins.log $ /usr/bin/firefox the file will be saved to ~/plugins.log (or wherever nspr_log_file is set).
Version - Archive of obsolete content
netscape's rss 0.91 (revision 1), netscape's rss 0.91 revision 3 and userland's rss 0.91.
... name status release date based on author rss 0.90 march 1999 rdf netscape netscape's rss 0.91 (revision 1) ?
... xml netscape netscape's rss 0.91 revision 3 july 10, 1999 xml netscape userland's rss 0.91 june 4, 2000 xml userland rss 1.0 standard december 9, 2000 rdf rss-dev working group rss 0.92 december 25, 2000 xml userland rss 0.93 april 20, 2001 xml userland rss 0.94 august 19, 2002 xml userland rss 2.0 september 2002 xml userland rss 2.0 (post 2002-11-11) november 11, 2002 xml userland rss 2.0 (post 2003-01-21) standard january 21, 2003 xml userland ...
Common Firefox theme issues and solutions - Archive of obsolete content
it is a companion document to the amo editors guide common theme problems, which provides editors with "boilerplate" copy and paste review notes for common theme issues.
...er:active > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon, #identity-box[open=true] > #identity-box-inner > #page-proxy-stack > #page-proxy-favicon { -moz-image-region: rect(0, 48px, 16px, 32px); } #page-proxy-favicon[pageproxystate="invalid"] { opacity: 0.5; } for more information about identity boxes please see the identity box section of the amo editors theme review guidelines no visual clue for disabled url bars there needs to be a visual clue when url bar is disabled.
... resources amo editors theme testing guidelines when developing and testing your themes, please refer to the theme testing guidelines amo editors use to review themes.
Accessing XML children - Archive of obsolete content
« previousnext » accessing xml children warning: e4x is deprecated.
...var elem = <foo> <bar>1</bar> </foo> elem.bar = 2; will replace the previous value of 1 with 2.
... var element = <foo bar="1"/> element.@bar = 2; which gives <foo bar="2"/> « previousnext » ...
New in JavaScript 1.1 - Archive of obsolete content
--> new features in javascript 1.1 new objects array boolean function number new properties number.max_value number.min_value nan number.negative_infinity number.positive_infinity new methods array.prototype.join() array.prototype.reverse() array.prototype.sort() array.prototype.split() new operators typeof void other new features <noscript> liveconnect.
... eval() is now a method of every object (was previously a built-in function); it evaluates a string of javascript code in the context of the specified object.
... isnan() now works on every platform (not only unix anymore) parsefloat() and parseint() now return nan on all platforms, if the first character of the specified string cannot be converted to a number; in previous releases, it returned nan on solaris and irix and zero on all other platforms.
LiveConnect Overview - Archive of obsolete content
for example, you can create a java string object and assign it to the javascript variable mystring by using the new operator with the java constructor, as follows: var mystring = new java.lang.string("hello world"); in the previous example, the variable mystring is a javaobject because it holds an instance of the java object string.
...starting with javascript 1.2, these classes are delivered in a .jar file; in previous versions of javascript, these classes are delivered in a .zip file.
...the previous example uses getmember to assign the value of the javascript property jsdog.breed to the java data member javadog.dogbreed.
Archived open Web documentation - Archive of obsolete content
this article reviews several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection.
... writing javascript for xhtml technical review completed.
... editorial review completed.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
named anchor problems in addition to the effects described previously, there are two other relatively common effects that authors may not expect.
...furthermore, combining pseudo-classes prevents hover styles from being applied to non-hyperlink anchors.
...meyer, netscape communications last updated date: published 07 mar 2003; revised 21 mar 2003 copyright information: copyright © 2001-2003 netscape.
RDF in Mozilla FAQ - Archive of obsolete content
for example, mozilla mail/news reveals the folder hierarchy in the toolbar, the "folder pane", in several menus, and in some of the dialogs.
...it is either: an abbreviated contractid for a locally installed component.
...note that a polling reload generates a set of differences between the current and previous contents of the rdf/xml file.
Windows Media in Netscape - Archive of obsolete content
netscape 7.1 is the first netscape gecko™ browser to support the windows media player as an activex control -- previous netscape browsers did not support any activex controls, and thus detecting which versions of netscape support the windows media activex control is an important first step towards building multimedia experiences using html, javascript, and the windows media activex control.
...for the sake of brevity, we've made the following code snippet shorter to illustrate the relevant points about the api: var player; try { if(window.activexobject) { player = new activexobject("wmplayer.ocx.7"); } else if (window.geckoactivexobject) { player = new geckoactivexobject("wmplayer.ocx.7"); } } catch(e) { // handle error -- no wmp 7 or 9 control // can use wmp 6 also if necessary, but th...
...this differs from what previous netscape gecko browsers did -- those browsers only supported the netscape-plugin architecture, and not the activex architecture, and thus the markup used for browsers prior to netscape version 7.1 (devedge-temp) was distinct.
Archive of obsolete content
case sensitivity in class and id names creating a dynamic status bar extension concepts covered in the previous sample won't be reiterated here; instead, refer to the downloadable sample code or to the previous sample for further details.
... localizing an extension this article expands upon the previous samples on extension writing by adding localization support to our stock watcher extension.
...we'll build upon the stock watcher extension created in earlier articles in this series, updating it so it can also be used in thunderbird and sunbird (previous versions worked only in firefox).
Game promotion - Game development
most portals offer revenue share deals or will buy non exclusive license.
... free portals offer traffic, but only the best ones are popular enough to generate revenues from advertisements on in-app purchases.
...you should also be realistic however — don't think this alone will skyrocket your downloads or visits, and be prepared to deal with bad reviews as well as good ones.
Bounding volume collision detection with THREE.js - Game development
a more simple alternative that fixes the previous issue is to set those boundaries later on with box3.setfromobject, which will compute the dimensions taking into account a 3d entity's transformations and any child meshes as well.
...box and sphere using boxhelper as an alternative to using raw box3 and sphere objects, three.js has a useful object to make handling bounding boxes easier: boxhelper (previously boundingboxhelper, which has been deprecated).
...this results in a new box mesh representing the bounding box, which shows the bounding box's shape, and can passed to the previously seen setfromobject method in order to have a bounding box matching the mesh.
Building up a basic demo with A-Frame - Game development
looking around would give an impression of being inside an open sky, a wooden barn — wherever you like!
...add the new code below your previous additions — this uses the standard <a-light> element: <a-light type="directional" color="#fff" intensity="0.5" position="-1 1 2"> </a-light> <a-light type="ambient" color="#fff"> </a-light> the directional light has a white color, its intensity is set to 0.5, and it is placed at position -1 1 2.
...let's try adding a torus — add this element below the previous code: <a-entity geometry=" primitive: torus; radius: 1; radiustubular: 0.1; segmentstubular: 12;" rotation="10 0 0" position="-3 1 0"> </a-entity> our entity has a torus primitive, which represents its shape.
Build the brick field - Game development
« previousnext » this is the 6th step out of 10 of the gamedev canvas tutorial.
...add the following lines to your code below the variables which you have previously declared in your program.
... « previousnext » ...
Create the Canvas and draw on it - Game development
« previousnext » this is the 1st step out of 10 of the gamedev canvas tutorial.
...add this below your previous lines of javascript, then load your index.html in a browser to try it out.
... « previousnext » ...
Mouse controls - Game development
« previousnext » this is the 9th step out of 10 of the gamedev canvas tutorial.
...add the following function to your code, below the previous line you added: function mousemovehandler(e) { var relativex = e.clientx - canvas.offsetleft; if(relativex > 0 && relativex < canvas.width) { paddlex = relativex - paddlewidth/2; } } in this function we first work out a relativex value, which is equal to the horizontal mouse position in the viewport (e.clientx) minus the distance between the left edge of the canvas and l...
... « previousnext » ...
Track the score and win - Game development
« previousnext » this is the 8th step out of 10 of the gamedev canvas tutorial.
...= 0; score++; } } } } } calling drawscore() from the draw() function keeps the score up to date with every new frame — add the following line inside draw(), just below the drawpaddle() call: drawscore(); displaying a winning message when all bricks have been destroyed collecting the points works well, but you won't be adding them forever — what about when all the bricks have been destroyed?
... « previousnext » ...
Bounce off the walls - Game development
« previousnext » this is the 6th step out of 16 of the gamedev phaser tutorial.
...add the following line below the previous one: ball.body.bounce.set(1); try reloading index.html again — now you should see the ball bouncing off all the walls and moving inside the canvas area.
... « previousnext » ...
Extra lives - Game development
« previousnext » this is the 13th step out of 16 of the gamedev phaser tutorial.
...instead of executing an anonymous function and showing the alert right away : ball.events.onoutofbounds.add(function(){ alert('game over!'); location.reload(); }, this); we will assign a new function called ballleavescreen; delete the previous event handler (shown above) and replace it with the following line: ball.events.onoutofbounds.add(ballleavescreen, this); we want to decrease the number of lives every time the ball leaves the canvas.
... « previousnext » ...
Game over - Game development
« previousnext » this is the 8th step out of 16 of the gamedev phaser tutorial.
...add the following lines just below the previous new one: ball.checkworldbounds = true; ball.events.onoutofbounds.add(function(){ alert('game over!'); location.reload(); }, this); adding those lines will make the ball check the world (in our case canvas) bounds and execute the function bound to the onoutofbounds event.
... « previousnext » ...
Physics - Game development
« previousnext » this is the 5th step out of 16 of the gamedev phaser tutorial.
...add the following line, again at the bottom of create(): ball.body.velocity.set(150, 150); removing our previous update instructions remember to remove our old method of adding values to x and y from the update() function: function update() { ball.x += 1; ball.y += 1; } we are now handling this properly, with a physics engine.
... « previousnext » ...
Scaling - Game development
« previousnext » this is the 2nd step out of 16 of the gamedev phaser tutorial.
... show_all — scales the canvas, but keeps the aspect ratio untouched, so images won't be skewed like in the previous mode.
... « previousnext » ...
The score - Game development
« previousnext » this is the 11th step out of 16 of the gamedev phaser tutorial.
... new variables add two new variables right after the previously defined ones: // ...
... « previousnext » ...
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
there are specific headers in the response, like cache-control, that prevents caching.
... note that some non-cacheable requests/responses to a specific uri may invalidate previously cached responses on the same uri.
...moreover, it invalidates cached data for request to the same uri done via head or get: put /pagex.html http/1.1 (…) 200 ok (…) a specific cache-control header in the response can prevent caching: get /pagex.html http/1.1 (…) 200 ok cache-control: no-cache (…) ...
Assessment: Accessibility troubleshooting - Learn web development
previous overview: accessibility in the assessment for this module, we present to you a simple site with a number of accessibility issues that you need to diagnose and fix.
... prerequisites: basic computer literacy, a basic understanding of html, css, and javascript, an understanding of the previous articles in the course.
... previous overview: accessibility in this module what is accessibility?
Backgrounds and borders - Learn web development
previous overview: building blocks next in this lesson, we will take a look at some of the creative things you can do with css backgrounds and borders.
...the backgrounds will layer with the last listed background image at the bottom of the stack, and each previous image stacking on top of the one that follows it in the code.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Cascade and inheritance - Learn web development
note: there is also a newer value, revert, which has limited browser support.
...its value can be any one of the inheritance values (inherit, initial, unset, or revert).
...because of the !important declaration in the second rule — including this after border: none means that this declaration will win over the border value in the previous rule, even though the id has higher specificity.
Debugging CSS - Learn web development
previous overview: building blocks next sometimes when writing css you will encounter an issue where your css doesn't seem to be doing what you expect.
... understanding the box model in previous lessons we have discussed the box model, and the fact that we have an alternate box model that changes how the size of elements are calculated based on the size you give them, plus the padding and borders.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Handling different text directions - Learn web development
previous overview: building blocks next many of the properties and values that we have encountered so far in our css learning have been tied to the physical dimensions of our screen.
...we will revisit it later on.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Images, media, and form elements - Learn web development
previous overview: building blocks next in this lesson we will take a look at how certain special elements are treated in css.
... as we learned in our previous lesson, a common technique is to make the max-width of an image 100%.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debu...
Overflowing content - Learn web development
previous overview: building blocks next overflow is what happens when there is too much content to fit in a container.
... wherever possible, css does not hide content.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Combinators - Learn web development
previous overview: building blocks next the final selectors we will look at are called combinators, because they combine other selectors in a way that gives them a useful relationship to each other and the location of content in the document.
... using combinators you can combine any of the selectors that we discovered in previous lessons with combinators in order to pick out part of your document.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Pseudo-classes and pseudo-elements - Learn web development
previous overview: building blocks next the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements.
...try editing the previous live example so it uses the following css.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Sizing items in CSS - Learn web development
previous overview: building blocks next in the various lessons so far you have come across a number of ways to size items on a web page using css.
...as we discovered in our previous lesson on overflow, a set height can cause content to overflow if there is more content than the element has space to fit inside it.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
CSS values and units - Learn web development
previous overview: building blocks next every property used in css has a value or set of values that are allowed for that property, and taking a look at any property page on mdn will help you understand the values that are valid for any particular property.
... images the <image> data type is used wherever an image is a valid value.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Grids - Learn web development
previous overview: css layout next css grid layout is a two-dimensional layout system for the web.
...this contains a container with a 12 column grid defined, and the same markup as we used in the previous two examples.
... see also css grid guides css grid inspector: examine grid layouts previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Beginner's guide to media queries - Learn web development
previous overview: css layout next the css media query gives you a way to apply css only when the browser and device environment matches a rule that you specify, for example "viewport is wider than 480 pixels".
...this reverses the meaning of the entire media query.
... previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Normal Flow - Learn web development
previous overview: css layout next this article explains normal flow, or the way that webpage elements lay themselves out if you have not changed their layout.
... before digging deeper into different layout methods, it is worth revisiting some of the things you will have studied in previous modules with regard to normal document flow.
... previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
Supporting older browsers - Learn web development
previous overview: css layout next in this module, we recommend using flexbox and grid as the main layout methods for your designs.
... older versions of flexbox in older versions of browsers, you can find previous iterations of the flexbox specification.
... cascading web design with feature queries using feature queries (video) previous overview: css layout next in this module introduction to css layout normal flow flexbox grid floats positioning multiple-column layout responsive design beginner's guide to media queries legacy layout methods supporting older browsers fundamental layout comprehension assessment ...
How CSS works - Learn web development
previous overview: first steps next we have learned the basics of css, what it is for and how to write simple stylesheets.
...the span nodes are also parents, with text nodes as their children: p ├─ "let's use:" ├─ span | └─ "cascading" ├─ span | └─ "style" └─ span └─ "sheets" this is how a browser interprets the previous html snippet —it renders the above dom tree and then outputs it in the browser like so: p {margin:0;} applying css to the dom let's say we added some css to our document, to style it.
... previous overview: first steps next in this module what is css?
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
this means that a previous rule for a single attribute could be implicitly overridden.
...</div> in the previous example the problem occurred on rules belonging to different elements, but it could happen also for the same element, because rule order is important.
...they allow use of experimental and non-standard features in browsers without polluting the regular namespace, preventing future incompatibilities to arise when the standard is extended.
Styling lists - Learn web development
previous overview: styling text next lists behave like any other text for the most part, but there are some css properties specific to lists that you need to know about, and some best practices to consider.
...the following example: <ol start="4"> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this output: reversed the reversed attribute will start the list counting down instead of up.
... the following example: <ol start="4" reversed> <li>toast pita, leave to cool, then slice down the edge.</li> <li>fry the halloumi in a shallow, non-stick pan, until browned on both sides.</li> <li>wash and chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> gives you this output: note: if there are more list items in a reversed list than the value of the start attribute, the count will continue to zero and then into negative values.
Sending forms through JavaScript - Learn web development
gaining control of the global interface standard html form submission, as described in the previous article, loads the url where the data was sent, which means the browser window navigates with a full page load.
... form.addeventlistener( "submit", function ( event ) { event.preventdefault(); senddata(); } ); } ); here's the live result: you can even get more involved with the process by using the form's elements property to get a list of all of the data elements in the form and manually manage them one at a time.
... const form = document.getelementbyid( "theform" ); // ...to take over the submit event form.addeventlistener( 'submit', function ( event ) { event.preventdefault(); senddata(); } ); } ); here's the live result: conclusion depending on the browser and the type of data you are dealing with, sending form data through javascript can be easy or difficult.
CSS basics - Learn web development
previous overview: getting started with the web next css (cascading style sheets) is the code that styles web content.
... first, find the output from google fonts that you previously saved from what will your website look like?.
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
Marking up a letter - Learn web development
previous overview: introduction to html next we all learn to write a letter sooner or later; it is also a useful example to test our text formatting skills.
... mark up the five acronyms/abbreviations in the main text of the letter to provide expansions of each acronym/abbreviation.
... previous overview: introduction to html next in this module getting started with html what’s in the head?
Images in HTML - Learn web development
rp teeth"\n width="200"\n height="171"\n title="a t-rex on display in the manchester university museum">'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caret...
... active learning: creating a figure in this active learning section, we'd like you to take the finished code from the previous active learning section, and turn it into a figure: wrap it in a <figure> element.
...ight="171">\n <figcaption>a t-rex on display in the manchester university museum</figcaption>\n</figure>'; var solutionentry = htmlsolution; textarea.addeventlistener('input', updatecode); window.addeventlistener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caret...
Responsive images - Learn web development
previous overview: multimedia and embedding next in this article, we'll learn about the concept of responsive images — images that work well on devices with widely differing screen sizes, resolutions, and other such features — and look at what tools html provides to help implement them.
... you might think that vector images would solve these problems, and they do to a certain degree — they are small in file size and scale well, and you should use them wherever possible.
...each set of image information is separated from the previous one by a comma.
Choosing the right approach - Learn web development
previous overview: asynchronous to finish this module off, we'll provide a brief discussion of the different coding techniques and features we've discussed throughout, looking at which one you should use when, with recommendations and reminders of common pitfalls where appropriate.
...: true }).then(function (result) { let docs = result.rows; docs.foreach(function(element) { localdb.put(element.doc).then(function(response) { alert("pulled doc with id " + element.doc._id + " and added to local db."); }).catch(function (err) { if (err.name == 'conflict') { localdb.get(element.doc._id).then(function (resp) { localdb.remove(resp._id, resp._rev).then(function (resp) { // et cetera...
... further information making asynchronous programming easier with async and await async function reference await operator reference previous overview: asynchronous in this module general asynchronous programming concepts introducing asynchronous javascript cooperative asynchronous javascript: timeouts and intervals graceful asynchronous programming with promises making asynchronous programming easier with async and await choosing the right approach ...
Manipulating documents - Learn web development
previous overview: client-side web apis next when writing web pages and apps, one of the most common things you'll want to do is manipulate the document structure in some way.
...add the following line below the previous one: link.textcontent = 'mozilla developer network'; we should also change the url the link is pointing to, so that it doesn't go to the wrong place when it is clicked on.
... delete the previous five lines you added to the javascript.
Working with JSON - Learn web development
previous overview: objects next javascript object notation (json) is a standard text-based format for representing structured data based on javascript object syntax.
...add the following code below your previous code: request.onload = function() { const superheroes = request.response; populateheader(superheroes); showheroes(superheroes); } here we are storing the response to our request (available in the response property) in a variable called superheroes; this variable now contains the javascript object based on the json!
...first of all, add the following function definition below the previous code: function populateheader(jsonobj) { const myh1 = document.createelement('h1'); myh1.textcontent = jsonobj['squadname']; header.appendchild(myh1); const mypara = document.createelement('p'); mypara.textcontent = 'hometown: ' + jsonobj['hometown'] + ' // formed: ' + jsonobj['formed']; header.appendchild(mypara); } we named the parameter jsonobj, to remind ourselves that this...
Introducing JavaScript objects - Learn web development
guides object basics in the first article looking at javascript objects, we'll look at fundamental javascript object syntax, and revisit some javascript features we've already looked at earlier on in the course, reiterating the fact that many of the features you've already dealt with are in fact objects.
... object building practice in previous articles we looked at all the essential javascript object theory and syntax details, giving you a solid base to start from.
... assessments adding features to our bouncing balls demo in this assessment, you are expected to use the bouncing balls demo from the previous article as a starting point, and add some new and interesting features to it.
CSS performance optimization - Learn web development
previous overview: performance next painting an unstyled page, and then repainting it once styles are parsed would be bad user experience.
...by splitting the css into multiple files based on media queries, you can prevent render blocking during download of unused css.
... conclusion previous overview: performance next in this module the "why" of web performance what is web performance?
Measuring performance - Learn web development
previous overview: performance next meauring performance provides an important metric to help you asses the success of your app, site, or web service.
... you can use the navigation timing api to measure client-side web performance; including the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load handler, and more.
... previous overview: performance next in this module the "why" of web performance what is web performance?
Perceived performance - Learn web development
previous overview: performance next perceived performance is how fast a website seems to the user.
... prevent jumping content and other reflows images or other assets causing content to be pushed down or jump to a different location, like the loading of third party advertisements, can make the page feel like it is still loading and is bad for perceived performance.
... previous overview: performance next in this module the "why" of web performance what is web performance?
Ember resources and troubleshooting - Learn web development
previous overview: client-side javascript frameworks next our final ember article provides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other information.
... this is the most common question ember folks hear from people who have previous experience with react.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Routing in Ember - Learn web development
previous overview: client-side javascript frameworks next in this article we learn about routing, or url-based filtering as it is sometimes referred to.
... updating the todos display inside todolist one small final thing that we need to fix is that previously, inside todomvc/app/components/todo-list.hbs, we were accessing the todo-data service directly and looping over all todos, as shown here: {{#each this.todos.all as |todo| }} since we now want to have our todolist component show a filtered list, we'll want to pass an argument to the todolist component representing the "current list of todos", as shown here: {{#each @todos as |todo| }} an...
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Ember app structure and componentization - Learn web development
previous overview: client-side javascript frameworks next in this article we'll get right on with planning out the structure of our todomvc ember app, adding in the html for it, and then breaking that html structure into components.
...--}} {{outlet}} <welcomepage /> is a component provided by an ember addon that renders the default welcome page we saw in the previous article, when we first navigated to our server at localhost:4200.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Handling common HTML and CSS problems - Learn web development
previous overview: cross browser testing next with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur.
... stackoverflow.com (so) is a forum site where you can ask questions and have fellow developers share their solutions, look up previous posts, and help other developers.
... previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Strategies for carrying out testing - Learn web development
previous overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross-browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing.
... upload the changes to the development server, or wherever else you need your code.
... previous overview: cross browser testing next in this module introduction to cross-browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Accessibility/LiveRegionDevGuide
however, many of the concepts were also used during the development of firevox, an at using iaccessible2.
...the event should be filtered out as early as possible to prevent performance degradation.
... container-relevant politeness advancing setting all off persisting politeness level navigation navigate to next and previous live regions bookmarking ...
Accessibility information for UI designers and developers
only one element has focus at a given time, typically revealed by browsers with a dotted outline.
...or provide an opportunity to review the input before submitting it.
... see also: understanding success criterion 2.3.3: animation from interactions content on hover or focus if content is revealed on hover or focus, for example in tooltips, there are some things to keep in mind: if the extra content obscures existing content, there should be a way to close it without moving focus if the extra content is opened on hover, hovering the additional content itself should not cause it to disappear consistent navigation navigation should be consistent across different pages on your sit...
Accessibility and Mozilla
in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users.
...however, many of the concepts were also used during the development of firevox, an at using iaccessible2.accessible toolkit checklistplease contact the mozilla accessibility community with questions or feedback.csun firefox materialsfirefox 1.5 is a fast, free, standards compliant web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the web.
...this article reviews the progress and technology as it has developed.zoomtextwe've made a lot of progress with mozilla/zoomtext compatibility.
Index
676 index add-ons, glossary, guide, index found 689 pages: 677 signing and distributing your add-on add-ons, extensions, webextensions, distribution, publication, reviews, signing add-ons need to be signed before they can be installed into release and beta versions of firefox.
... 683 source code submission add-ons, extensions, review policy, distribution to complete the review process at addons.mozilla.org (amo), reviewers must be able to read the code in your extension.
... 688 third party library usage add-ons, extensions, review policy to complete the review process at addons.mozilla.org (amo), reviewers must be able to verify the code in your extension.
Frequently Asked Questions for Lightweight themes
you can easily preview a design and install it without needing to restart.
...preview any theme by clicking "tap to preview"; the design appears in your browser header so you can "try it on." when you're ready, just click the blue install theme button.
...please review the terms of service and conditions of use for authoritative and complete language.
What to do and what not to do in Bugzilla
this isn't mandatory, but can help prevent accidental filing of duplicates of a bug that's already been fixed.
...basically, anything that prevents builds from building, running, or being used for dogfood (able to use bugzilla, tinderbox, lxr, etc.) is a blocker.
...continued abuse will result in revocation of your bugzilla privileges.
Continuous Integration
when sheriffs see a build or test has been broken, they are empowered to take one of several actions, including backing out a patch which caused the problem and closing the tree (i.e., preventing any additional commits).
... clobber builds mean the directory hierarchy, including the local source and object directory are deleted if it exists from a previous build.
...performance sheriffs review the list of alerts on a regular basis and file bugs if appropriate.
Commenting IDL for better documentation
keep in mind that people for whom english is not their native language will be reading your comments (as well as the generated documentation), so try to avoid slang and abbreviations when possible.
...nested lists should be indented from the previous level by two spaces.
...nested lists should be indented from the previous level by two spaces.
Performance
the following examples omit some boilerplate code for the sake of brevity the "better" examples also omit some best practices and only demonstrate how to fix the problem described in their respective subtopics.
... see the previous chapter on how to efficiently replicate addon state to each process.
... clean up on addon unload bad: all the previous examples, *even the "better" ones* if your addon is restartless or uses the sdk then updates or the user turning it off and on will load to unload/reload events.
Browser API
htmliframeelement.goback() changes the location of the <iframe> for the previous location in its browsing history.
... htmliframeelement.findnext() highlights the next or previous instance of a search result after a findall() search has been carried out.
... htmliframeelement.removenextpaintlistener() removes a handler previously set with addnextpaintlistener().
Index
17 localization sign-off reviews guide, localization, mozilla this article presents an overview of why we do sign-off reviews of localizations, the details on the criteria used for the sign-off reviews, and the process for requesting a review and for following its progress.
... 18 localization technical reviews guide, localization, mozilla this guide provides details on what a localization technical review is, what criteria are used for the technical reviews, and the process for requesting one and following its progress.
...this data describes the extension, and doesn't necessarily change with each revision (but it can).
Localizing with Mozilla Translator
like most cat tools, mozillatranslator employs glossaries and translation memory to leverage your work from previous translations, thus cutting time and effort when localizing new versions of mozilla applications.
...most of the strings will be automatically filled, although if you do this you should review them, because for en-us strings with several possible translations, mt will choose one of them, which could not be the one you want.
...to migrate the existing translation in the old product, you need to export partial glossaries from the old product, selecting the ''link'' origin (see the previous section) and importing them into the ''link'' target.
Initial setup
hg (mercurial) mercurial is the revision control environment that houses the main mozilla source code as well as localized code for each official mozilla localization.
... svn svn is a revision control environment that mozilla uses to house mozilla source websites and their localizations for each official mozilla localization.
... « previousnext » ...
Setting up the infrastructure
this way the localizers will be able to preview their changes almost in real-time.
... review the english content following the web content localizability guidelines.
... review your code following the web applications localizability guidelines.
A guide to searching crash reports
much smaller than the previous search.
... grouping in the previous section we saw one example of grouping, in the "signature facet" tab that is shown by default.
... facets in the search form to do a search with non-signature grouping first click on the "more options..." text, which reveals the additional fields shown in the following screenshot.
PRIOMethods
available64 same as previous field, except 64-bit.
... seek64 same as previous field, except 64-bit.
... fileinfo64 same as previous field, except 64-bit.
FIPS Mode - an explanation
(note, the current version of fips 140 is revision 2, a.k.a.
... mozilla's nss cryptographic software has been tested by government-approved independent testing labs and certified by nist as being fips 140 compliant when operated in fips mode on 4 previous occasions.
... the user is not required to enter the master password to visit ordinary https servers, nor to view certificates he has previously stored.
NSS 3.14.1 release notes
new functions in ocspt.h cert_createocspsingleresponsegood cert_createocspsingleresponseunknown cert_createocspsingleresponserevoked cert_createencodedocspsuccessresponse cert_createencodedocsperrorresponse new types in ocspt.h ​certocspresponderidtype notable changes in nss 3.14.1 windows ce support has been removed from the code base.
... bug 802429 - in previous versions of nss, the "cipherorder" slot configuration flag was not respected, causing the most recently added slot that supported the requested pkcs#11 mechanism to be used instead.
...in previous versions of nss, these algorithms would be handled by the most recently added pkcs#11 token that supported them.
NSS 3.35 release notes
notable changes in nss 3.35 previously, nss used the dbm file format by default.
... nss 3.30 had introduced a regression, preventing nss from reading some aes encrypted data, produced by older versions of nss.
...this is not expected to cause problems; code compiled against previous versions of tls will now refer to an unsupported codepoint, if this value was used.
NSS 3.48 release notes
because using an iteration count higher than 1 with the legacy dbm (key3.db) storage creates files that are incompatible with previous versions of nss, applications that wish to enable it for key3.db are required to set environment variable nss_allow_legacy_dbm_iteration_count=1.
... bugs fixed in nss 3.48 bug 1600775 - require nspr 4.24 for nss 3.48 bug 1593401 - fix race condition in self-encrypt functions bug 1599545 - fix assertion and add test for early key update bug 1597799 - fix a crash in nssckfwobject_getattributesize bug 1591178 - add entrust root certification authority - g4 certificate to nss bug 1590001 - prevent negotiation of versions lower than 1.3 after helloretryrequest bug 1596450 - added a simplified and unified mac implementation for hmac and cmac behind pkcs#11 bug 1522203 - remove an old pentium pro performance workaround bug 1592557 - fix prng known-answer-test scripts bug 1586176 - encryptupdate should use maxout not block size (cve-2019-11745) bug 1593141 - add `notbefore` or similar ...
..."beginning-of-validity-period" parameter to mozilla::pkix::trustdomain::checkrevocation bug 1591363 - fix a pbkdf2 memory leak in nsc_generatekey if key length > max_key_len (256) bug 1592869 - use arm neon for ctr_xor bug 1566131 - ensure sha-1 fallback disabled in tls 1.2 bug 1577803 - mark pkcs#11 token as friendly if it implements ckp_public_certificates_token bug 1566126 - power ghash vector acceleration bug 1589073 - use of new pr_assert_arg in certdb.c bug 1590495 - fix a crash in pk11_makecertfromhandle bug 1591742 - ensure des iv length is valid before usage from pkcs#11 bug 1588567 - enable mozilla::pkix gtests in nss ci bug 1591315 - update nsc_decrypt length in constant time bug 1562671 - increase nss mp kdf default iteration count, by default for modern key4 storage, o...
nss tech note7
to prevent denial-of-service attacks with huge public keys, nss disallows modulus size greater than 8192 bits.
...here is the asn.1 type definition: rsapublickey ::= sequence { modulus integer, -- n publicexponent integer -- e } the following sample code (error handling omitted for brevity) encodes a rsapublickey from a modulus and a public exponent and imports the public key into nss.
... perhaps this change made in pkcs #1 v2.0 confused many people, so it was reversed in v2.1.
Notes on TLS - SSL 3.0 Intolerant Servers
servers currently known to exhibit this intolerant behavior as of this writing, this problem has been reported for the following servers: (wherever there is an upgraded version which fixes the problem, it is indicated by an asterisked remark in the parentheses.
... netscape 6.1 preview release 1, or mozilla 0.9.1 and earlier these versions shipped with the tls option turned on as the default but with no way to deal with the problem servers.
... post a note on your site instructing users of old versions of browsers like netscape 6.0/6.01/6.1 preview release 1 and mozilla 0.9.1 and earlier to turn off the tls option at: edit | preferences | privacy and security | ssl | enable tls.
pkfnc.html
to retrieve its current value, use ssl_revealpinarg.
...to retrieve its current value, use ssl_revealpinarg.
...this implies that the callback has previously returned the wrong password.
NSS Tools certutil
if you create a new key pair for such a card, the previous pair is overwritten.
...be sure to prevent unauthorized access to this file.
...this extension identifies the url of a certificate's associated certificate revocation list (crl).
Creating JavaScript tests
testing your test run your new test locally before checking it in (or posting it for review).
... checking in completed tests tests are usually reviewed and pushed just like any other code change.
... it is ok under certain circumstances to push new tests to certain repositories without a code review.
Bytecode Descriptions
it must not have been previously suspended.
...this is checked by the jsop::checkglobalorevaldecl bytecode instruction that must appear before jsop::def{var,let,const,fun}.) throw a syntaxerror if the current variableenvironment is the global environment and a binding with the same name exists on the global lexical environment.
...format: jof_atom checkglobalorevaldecl check for conflicting bindings before jsop::def{var,let,const,fun} in global or sloppy eval scripts.
JS::CompileOptions
ntattributename(jsstring *p) owningcompileoptions &setintroductionscript(jsscript *s) owningcompileoptions &setmutederrors(bool mute) owningcompileoptions &setversion(jsversion v) owningcompileoptions &setutf8(bool u) owningcompileoptions &setcolumn(unsigned c) owningcompileoptions &setcompileandgo(bool cng) owningcompileoptions &setforeval(bool eval) owningcompileoptions &setnoscriptrval(bool nsr) owningcompileoptions &setselfhostingmode(bool shm) owningcompileoptions &setcanlazilyparse(bool clp) owningcompileoptions &setsourceislazy(bool l) owningcompileoptions &setintroductiontype(const char *t) bool setintroductioninfo(jscontext *cx, const char *introducerfn, const char *in...
...ject *e) compileoptions &setelementattributename(jsstring *p) compileoptions &setintroductionscript(jsscript *s) compileoptions &setmutederrors(bool mute) compileoptions &setversion(jsversion v) compileoptions &setutf8(bool u) compileoptions &setcolumn(unsigned c) compileoptions &setcompileandgo(bool cng) compileoptions &setforeval(bool eval) compileoptions &setnoscriptrval(bool nsr) compileoptions &setselfhostingmode(bool shm) compileoptions &setcanlazilyparse(bool clp) compileoptions &setsourceislazy(bool l) compileoptions &setintroductiontype(const char *t) compileoptions &setintroductioninfo(const char *introducerfn, const char *intro, unsigned line, jsscript *scri...
... foreval bool true if the code is for eval().
JS_SetGCCallback
obsolete since jsapi 13 js_setgccallback returns a pointer to the previously used callback function upon completion.
...the callback may prevent gc from starting by returning false.
... in a js_threadsafe build, a jsgc_begin callback can happen on one thread before or while a jsgc_end callback for the previous gc cycle runs on another thread.
JS_SetOptions
enables and disables options on a jscontext, replacing all previously set options.
...this function returns a uint32 value containing the previous values of the flags.
... mxr id search for jsoption_native_branch_callback jsoption_dont_report_uncaught when returning from the outermost api call, prevent uncaught exceptions from being converted to error reports.
SpiderMonkey 1.8
migrating to spidermonkey 1.8 spidermonkey 1.8 is not binary-compatible with previous releases.
... in certain cases, the javascript engine no longer calls jsclass.resolve callbacks repeatedly, as it did in previous versions.
...this makes gc-related problems easier to reproduce, reveals gc problems that you may not have noticed before, and causes gc-safety bugs to surface much closer to their cause.
SpiderMonkey 24
it continues to improve performance over previous spidermonkey releases, with a significantly improved garbage collector, a new jit compilation mode, and other features.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... jaegermonkey has been removed and replaced by ionmonkey spidermonkey 24 is not binary-compatible with previous releases, nor is it source-code compatible.
SpiderMonkey 31
it continues to improve performance over previous spidermonkey releases, with a significantly improved garbage collector and other features.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in previous versions.
... xxx list removed features here spidermonkey 31 is not binary-compatible with previous releases, nor is it source-code compatible.
History Service Design
the user can query his visits based on a date range, meta contents or revisit behavior.
...if a page can be added we first check if it exists already, then it is added or updated accordingly to the previous check, and common attributes are set based on concurrent visit properties.
...thanks to the underlying database, history size has increased far more than 10 times from the previous mork based implementation, thus the need for a simple and efficient way to extract slices of data.
Avoiding leaks in JavaScript XPCOM components
programmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks.
...the situation with javascript properties on dom nodes may also improve—see bug 283129—but it requires substantial changes.) things not to do everybody writing, reviewing, or checking in javascript code to mozilla cvs should understand why these things are bad.
...but the tree walker owns a reference to the wrapper for that function, so the wrapper maintains a garbage collection root to keep the function from being destroyed, so we have a cycle that prevents both objects from being freed.
An Overview of XPCOM
« previousnext » this is a book about xpcom.
... xpcom identifiers in addition to the iid interface identifier discussed in the previous section, xpcom uses two other very important identifiers to distinguish classes and components.
... « previousnext » copyright (c) 2003 by doug turner and ian oeschger.
Using XPCOM Components
« previousnext » one of the best ways to begin working with xpcom - especially when you are designing the interface to a component that will be used by others, as we do in starting weblock - is to look at how clients are already using xpcom components.
...in fact, a search of the mozilla source code reveals that this cookiemanager component is called only from javascript.
... « previousnext » copyright (c) 2003 by doug turner and ian oeschger.
Observer Notifications
em-action-requested item-cancel-action a previous action has been cancelled.
... topic data description lightweight-theme-preview-requested json sent when the user requests to preview a lightweight theme, but before existing windows are styled with the new theme.
... lightweight-theme-styling-update json sent when the current theme being used is changed; this is sent even when the user is previewing a theme, not just when the theme is actually selected.
imgIEncoder
"0" will repeat forever.
...dispose=[none|background|previous] -- default: "none" what to do with the image's canvas before rendering the next frame.
... quality >= 90 prevents down-sampling of the color channels.
nsIAutoCompleteSearch
method overview void startsearch(in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener); void stopsearch(); methods startsearch() search for a given string and notify a listener (either synchronously or asynchronously) of the result.
... void startsearch( in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener ); parameters searchstring the string to search for.
...previousresult the previous nsiautocompleteresult to use for faster searching.
nsIComponentRegistrar
if afactory is null, the contract will be associated with a previously registered classid.
...void unregisterfactorylocation( in nscidref aclass, in nsifile afile ); parameters aclass the classid that was previously registered.
... afile the component file that was previously registered.
nsIContentViewer
previousviewer nsicontentviewer the previous content viewer, which has been closed but not destroyed.
...if it is non-null, the document will not be destroyed, and the following actions will happen when destroy() is called: sanitize() will be called on the viewer's document the content viewer will set the contentviewer property on the history entry, and release its reference (ownership reversal).
... pagehide() void pagehide( in boolean isunload ); parameters isunload missing description exceptions thrown missing exception missing description permitunload() determins whether or not the document wants to prevent unloading by firing beforeunload on the document, and if it does, prompts the user.
nsIDOMSimpleGestureEvent
consumers should use event.preventdefault() to prevent default behavior when consuming events.
...for update events, this indicates the movement since the previous update; for the mozrotategesture and mozmagnifygesture events, this indicates the total movement that occurred while the event was being processed.
...on windows, the units indicate the difference between the previous and current width between the two touch points, in pixels.
nsIFileView
to create an instance, use: var fileview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); method overview void setdirectory(in nsifile directory); void setfilter(in astring filterstring); void sort(in short sorttype, in boolean reversesort); attributes attribute type description reversesort boolean if true results will be sorted in ascending order.
...void sort( in short sorttype, in boolean reversesort ); parameters sorttype one of the sort* constants.
... reversesort true, results will be sorted in ascending order.
nsIFrameLoader
method overview void activateframeevent(in astring atype, in boolean capture); void activateremoteframe(); void destroy(); void loadframe(); void loaduri(in nsiuri auri); void sendcrossprocesskeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); void sendcrossprocessmouseevent(in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignorerootscrollframe); void updatepositionandsize(in nsiframe aiframe); native code only!
... void sendcrossprocesskeyevent( in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault ); parameters atype the event type.
... apreventdefault whether or not to prevent default actions from being performed.
nsIJetpack
unregisterreceiver() this unregisters a callback previously registered with registerreceiver() void unregisterreceiver( in astring amessagename, in jsval areceiver ); parameters amessagename the name of the message on which the callback should no longer be triggered.
... unregisterreceivers() this unregisters all callbacks previously registered with registerreceiver() for a particular message.
...warning: bug 589308 prevents this message from being sent in some situations.
nsILocalFile
void reveal(); void setrelativedescriptor(in nsilocalfile fromfile, in acstring relativedesc); attributes attribute type description diskspaceavailable print64 the number of bytes available to non-superuser on the disk volume containing the nsilocalfile.
... } if (n < 0) rv = ns_error_unexpected; pr_close(fd); return rv; } reveal() ask the operating system to open the folder which contains this file or folder.
... void reveal(); parameters none.
nsISHistoryListener
the listener can prevent any action (except adding a new session history entry) from happening by returning false from the corresponding callback method.
...ew boolean onhistorygoback(in nsiuri abackuri); boolean onhistorygoforward(in nsiuri aforwarduri); boolean onhistorygotoindex(in long aindex, in nsiuri agotouri); void onhistorynewentry(in nsiuri anewuri); boolean onhistorypurge(in long anumentries); boolean onhistoryreload(in nsiuri areloaduri, in unsigned long areloadflags); methods onhistorygoback() called when navigating to a previous session history entry, for example due to an nsiwebnavigation.goback() call.
...entries can be removed from session history for various reasons; for example to control the browser's memory usage, to prevent users from loading documents from history, to erase evidence of prior page loads, etc.
nsIScriptError
you may pass null if you are lazy; that will prevent showing the source line in javascript console.
...you may pass null if you are lazy; that will prevent showing the source line in javascript console.
...you may pass null if you are lazy; that will prevent showing the source line in javascript console.
nsISessionStartup
constants session type constants constant value description no_session 0 there's no data available from the previous session.
... resume_session 2 the previous session should be restored at startup.
... defer_session 3 the previous session is viable but shouldn't be restored without explicit action (with the exception of app tabs, which are always restored in this case).
nsISmsDatabaseService
, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void createmessagelist(in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long requestid, [optional] in unsigned long long processid); void clearmessagelist(in long listid); void markmessageread(in long messageid, in boolean value, in long requestid, [optional] in unsigned long long processid) methods savereceivedmessage() void savereceivedmessage...
... createmessagelist() void createmessagelist( in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid ); parameters filter a smsfilter to filter out sms messages from a list.
... reverse a boolean indicating whether to reverse the ordering.
nsIWebBrowserChromeFocus
inherits from: nsisupports last changed in gecko 1.7 method overview void focusnextelement(); void focusprevelement(); methods focusnextelement() set the focus at the next focusable element in the chrome.
...focusprevelement() set the focus at the previous focusable element in the chrome.
... void focusprevelement(); parameters none.
nsIWebNavigation
it provides methods and attributes to direct an object to navigate to a new location, stop or restart an in process load, or determine where the object has previously gone.
... load_flags_charset_change 1024 this flag specifies that a reload was triggered as a result of detecting an incorrect character encoding while parsing a previously loaded document.
... methods goback() tells the object to navigate to the previous session history item.
nsIXFormsModelElement
1.0 66 introduced gecko 1.8 obsolete gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomdocument getinstancedocument(in domstring instanceid); void rebuild(); void recalculate(); void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned.
...revalidate() signals the xforms processor to perform a full revalidation of the given xforms model.
... void revalidate(); parameters none.
nsMsgNavigationType
previousmessage 3 go to the previous message in the view.
... previousunreadmessage 8 go to the previous unread message in the view.
... nextunreadthread 10 nextunreadfolder 11 nextfolder 12 readmore 13 back 15 go back to the previous visited message forward 16 go forward to the previous visited message firstflagged 17 nextflagged 18 previousflagged 19 firstnew 20 editundo 21 editredo 22 togglesubthreadkilled 23 ...
Storage
by binding the parameters, you prevent possible sql injection attacks since a bound parameter can never be executed as sql.
... warning: if you fail to reset a write statement, it will continue to hold a lock on the database preventing future writes or reads.
... additionally, if you fail to reset a read statement, it will prevent any future writes to the database.
XUL Overlays
MozillaTechXULOverlays
for instance, you can use the name of your extension, or an abbreviation of it.
...using the id attribute on an otherwise empty node in the base file, you can essentially reference a subtree defined in an overlay file and merge it in wherever it's needed.
...toolbars, submenus, boxes, and any other subtrees that appear in multiple places can be defined in overlays files in this way and referenced for reuse wherever necessary.
nsIMsgCloudFileProvider
acstring urlforfile(in nsilocalfile afile); parameters afile the previously uploaded file to get the url for.
... deletefile() attempts to delete a file that had previously been uploaded using this instance.
... void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); parameters afile the file that was previously uploaded using this nsimsgcloudfileprovider instance that should be deleted.
Working with windows in chrome code
you can find the window's opener using its window.opener property or via a callback function passed to the window in a way described in the previous section.
... let's add code to the previous example to notify the opener when the user presses cancel on the progress dialog.
...alternatively, the opener window can pass a callback function to the progress dialog in the same way we passed the status string in the previous example: function oncancel() { alert("operation canceled!"); } ...
Add to iPhoto
we'll be using a number of these methods, but for brevity's sake, since these are generally simple declarations, let's look at only the cfrelease() and cfretain() declarations.
...we actually aren't using any carbon methods, but we are using one carbon data type, the previously mentioned fsref structure.
... a cfindex indicating the size of the array specified by the previous parameter.
Memory - Plugins
« previousnext » this chapter describes the plug-in api functions that allocate and free memory as needed by the plug-in.
... void npn_memfree (void *ptr); the ptr parameter represents a block of memory previously allocated using npn_memalloc.
... « previousnext » ...
Scripting plugins - Plugins
« previousnext » xxx: dummy p element this document describes the new cross-browser npapi extensions, commonly called npruntime, that have been developed by a group of browser and plugin vendors, including the mozilla foundation, adobe, apple, opera, and sun microsystems (see press release).
...future revisions to this api might provide a mechanism for proxying calls from one thread to another to aid in using this api from other threads.
... npn_utf8fromidentifier npn_intfromidentifier npobject npn_construct (since firefox 3.0b1) npn_createobject npn_retainobject npn_releaseobject npn_invoke npn_invokedefault npn_enumerate (since mozilla 1.9a1) npn_evaluate npn_getproperty npn_setproperty npn_removeproperty npn_hasproperty npn_hasmethod npn_setexception npclass « previousnext » ...
Network request details - Firefox Developer Tools
the results through a json validator): { "response headers (1.113 kb)": { "headers": [ { "name": "accept-ranges", "value": "bytes" }, { "name": "age", "value": "0" }, { "name": "backend-timing", "value": "d=74716 t=1560258099074460" }, { "name": "cache-control", "value": "private, must-revalidate, max-age=0" }, { "name": "content-disposition", "value": "inline; filename=api-result.js" }, { "name": "content-encoding", "value": "gzip" }, { "name": "content-length", "value": "673" }, { "name": "content-type", "value": "text/javascript; charset=utf-8" }, { ...
...if the response is html, js, or css, it will be shown as text: if the response is json, it will be shown as an inspectable object: if the response is an image, the tab displays a preview: for network responses that are initiated by a websocket connection, the details pane shows any associated messages.
... html preview if the response is html, a preview of the rendered html appears inside the response tab, above the response payload.
Page inspector keyboard shortcuts - Firefox Developer Tools
command windows macos linux delete the selected node delete delete delete undo delete of a node ctrl + z cmd + z ctrl + z redo delete of a node ctrl + shift + z / ctrl + y cmd + shift + z / cmd + y ctrl + shift + z / ctrl + y move to next node (expanded nodes only) down arrow down arrow down arrow move to previous node up arrow up arrow up arrow move to first node in the tree.
...+ f ctrl + f edit as html f2 f2 f2 stop editing html f2 / ctrl +enter f2 / cmd + return f2 / ctrl + enter copy the selected node's outer html ctrl + c cmd + c ctrl + c scroll the selected node into view s s s find the next match in the markup, when searching is active enter return enter find the previous match in the markup, when searching is active shift + enter shift + return shift + enter breadcrumbs bar these shortcuts work when the breadcrumbs bar is focused.
... command windows macos linux move to the previous element in the breadcrumbs bar left arrow left arrow left arrow move to the next element in the breadcrumbs bar right arrow right arrow right arrow focus the html pane shift + tab shift + tab shift + tab focus the css pane tab tab tab css pane these shortcuts work when you're in the inspector's css pane.
Console messages - Firefox Developer Tools
when it calls window.getcomputedstyle(thing).height: var thing = document.getelementbyid("the-thing"); thing.style.display = "inline-block"; var thingheight = window.getcomputedstyle(thing).height; because of this, it's a good idea to avoid interleaving write and read calls to an element's styles when manipulating the dom, because every time you read back a style that has been invalidated by a previous write call, you force a synchronous reflow.
... for responses that contain objects or variables, the following context menu options are available: reveal in inspector shows the selected dom node in the inspector pane.
...this prevents errors that have already been loged from reappearing when you reopen the console.
The JavaScript input interpreter - Firefox Developer Tools
you can initiate a reverse search through the expression history, much like you can in bash on linux and mac or powershell on windows.
...on mac press ctrl+r (note: not cmd+r!) to initiate the reverse search.
... once you have initiated the reverse search, you can use shift + f9 on windows or linux ( ctrl+s on mac) to search forward in the list of matches.
about:debugging - Firefox Developer Tools
above the usual list of tools, you can see information about the device you are connected to, including the fact that you are connected (in this example) via usb, to firefox preview, on a pixel 2, as well as the title of the page that you are debugging, and the address of the page.
...until such time as firefox for android is updated to a newer major release, in synch with desktop firefox, you should use one of the following firefox for android versions: firefox preview, if your desktop firefox is the main release or developer edition firefox for android nightly if you prefer to test with the main release of firefox for android (i.e., based on release 68), you can do so with the desktop firefox extended support release (esr), which is also based on version 68.
...for more information, see what happens to my profile if i downgrade to a previous version of firefox?
Animation - Web APIs
WebAPIAnimation
animation.finish() seeks either end of an animation, depending on whether the animation is playing or reversing.
... animation.play() starts or resumes playing of an animation, or begins the animation again if it previously finished.
... animation.reverse() reverses playback direction, stopping at the start of the animation.
Managing screen orientation - Web APIs
adjusting layout based on the orientation one of the most common cases for orientation changes is when you want to revise the layout of your content based on the orientation of the device.
... the screen orientation api is made to prevent or handle such a change.
... screen.addeventlistener("orientationchange", function () { console.log("the orientation of the screen is: " + screen.orientation); }); preventing orientation change any web application can lock the screen to suits its own needs.
CanvasRenderingContext2D - Web APIs
canvasrenderingcontext2d.clearrect() sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.
... canvasrenderingcontext2d.arcto() adds an arc to the current path with the given control points and radius, connected to the previous point by a straight line.
...the following methods help you to work with that state: canvasrenderingcontext2d.save() saves the current drawing style state using a stack so you can revert any change you make to it using restore().
Basic animations - Web APIs
« previousnext » since we're using javascript to control <canvas> elements, it's also very easy to make (interactive) animations.
... basic animation steps these are the steps you need to take to draw a frame: clear the canvas unless the shapes you'll be drawing fill the complete canvas (for instance a backdrop image), you need to clear any shapes that have been drawn previously.
... « previousnext » ...
Constraint validation API - Web APIs
even though client-side validation can prevent many common kinds of invalid values, invalid ones can still be sent by older browsers or by attackers trying to trick your web application.
...if you don't do this, and a custom validity was previously set, the input will register as invalid, even if it current contains a valid value on submission.
... recommendation no change from the previous snapshot html5.
DataTransferItem.webkitGetAsEntry() - Web APIs
first, we prevent the dragover event from being handled by the default handler, so that our drop zone can receive the drop: dropzone.addeventlistener("dragover", function(event) { event.preventdefault(); }, false); the event handler that kicks everything off, of course, is the handler for the drop event: dropzone.addeventlistener("drop", function(event) { let items = event.datatransfer.items; event...
....preventdefault(); listing.innerhtml = ""; for (let i=0; i<items.length; i++) { let item = items[i].webkitgetasentry(); if (item) { scanfiles(item, listing); } } }, false); this fetches the list of datatransferitem objects representing the items dropped from event.datatransfer.items.
... then we call event.preventdefault() to prevent the event from being handled further after we're done.
Document.createElement() - Web APIs
options optional an optional elementcreationoptions object, containing a single property named is, whose value is the tag name of a custom element previously defined via customelements.define().
... // create a class for the element class expandinglist extends htmlulistelement { constructor() { // always call super first in constructor super(); // constructor definition left out for brevity ...
... note: for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name.
Document: pointercancel event - Web APIs
bubbles yes cancelable no interface pointerevent event handler property onpointercancel some examples of situations that will trigger a pointercancel event: a hardware event occurs that cancels the pointer activities.
...this can happen if, for example, the hardware supports palm rejection to prevent a hand resting on the display while using a stylus from accidentally triggering events.
... the touch-action css property prevents the input from continuing.
EffectTiming.direction - Web APIs
syntax var timingproperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; timingproperties.direction = "normal" | "reverse" | "alternate" | "alternate-reverse"; value a domstring which specifies the direction in which the animation should play as well as what to do when the playback reaches the end of the animation sequence in the current direction.
... "reverse" the animation runs backwards, or "rewinds." "alternate" the animation switches direction after each iteration, going forward through the animation sequence the first iteration, then backward through the sequence the second iteration, and so forth.
... "alternate-reverse" similar to "alternate", except the animation playback starts by going from the end of the animation sequence toward the beginning the first iteration, then goes forward during the second, and so forth.
Element: contextmenu event - Web APIs
any right-click event that is not disabled (by calling the event's preventdefault() method) will result in a contextmenu event being fired at the targeted element.
... bubbles yes cancelable yes interface mouseevent event handler property oncontextmenu examples in this example, the default action of the contextmenu event is canceled using preventdefault() when the contextmenu event is fired at the first paragraph.
... html <p id="nocontextmenu">the context menu has been disabled on this paragraph.</p> <p>but it has not been disabled on this one.</p> javascript nocontext = document.getelementbyid('nocontextmenu'); nocontext.addeventlistener('contextmenu', e => { e.preventdefault(); }); result specifications specification status comment html living standardthe definition of 'contextmenu' in that specification.
Element: cut event - Web APIs
WebAPIElementcut event
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault().
... note though that cancelling the default action will also prevent the document from being updated.
... border: 1px solid gray; margin: .5rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const source = document.queryselector('div.source'); source.addeventlistener('cut', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.tostring().touppercase()); selection.deletefromdocument(); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Event.stopPropagation() - Web APIs
the stoppropagation() method of the event interface prevents further propagation of the current event in the capturing and bubbling phases.
... it does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed.
... if you want to stop those behaviors, see the preventdefault() method.
FetchEvent.respondWith() - Web APIs
the respondwith() method of fetchevent prevents the browser's default fetch handling, and allows you to provide a promise for a response yourself.
... this prevents the leaking of private data.
... addeventlistener('fetch', event => { // prevent the default, and handle the request ourselves.
FetchEvent - Web APIs
fetchevent.resultingclientid read only the id of the client that replaces the previous client during a page navigation.
... fetchevent.respondwith() prevent the browser's default fetch handling, and provide (a promise for) a response yourself.
... if (event.request.method != 'get') return; // prevent the default, and handle the request ourselves.
FileSystemDirectoryReader.readEntries() - Web APIs
first, we prevent the dragover event from being handled by the default handler, so that our drop zone can receive the drop: dropzone.addeventlistener("dragover", function(event) { event.preventdefault(); }, false); the event handler that kicks everything off, of course, is the handler for the drop event: dropzone.addeventlistener("drop", function(event) { let items = event.datatransfer.items; event...
....preventdefault(); listing.innerhtml = ""; for (let i=0; i<items.length; i++) { let item = items[i].webkitgetasentry(); if (item) { scanfiles(item, listing); } } }, false); this fetches the list of datatransferitem objects representing the items dropped from event.datatransfer.items.
... then we call event.preventdefault() to prevent the event from being handled further after we're done.
GlobalEventHandlers.oncontextmenu - Web APIs
unless the default behavior is prevented, the browser context menu will activate.
... examples disabling context menus this snippet prevents context menus from opening in the window.
...is it disabled?<p> javascript window.oncontextmenu = (e) => { e.preventdefault(); } result pausing an animation this example pauses a spinning shape whenever you open the context menu.
HTMLAnchorElement - Web APIs
htmlanchorelement.rev is a domstring representing that the rev html attribute, specifying the relationship of the link object to the target object.
... note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete.
... the following properties are now obsolete: charset, coords, name, rev, and shape.
HTMLElement: pointercancel event - Web APIs
bubbles yes cancelable no interface pointerevent event handler property onpointercancel some examples of situations that will trigger a pointercancel event: a hardware event occurs that cancels the pointer activities.
...this can happen if, for example, the hardware supports palm rejection to prevent a hand resting on the display while using a stylus from accidentally triggering events.
... the touch-action css property prevents the input from continuing.
HTMLFormElement: submit event - Web APIs
in this case, the validation prevents form submission, and thus there is no submit event.
... examples this example uses eventtarget.addeventlistener() to listen for form submit, and logs the current event.timestamp whenever that occurs, then prevents the default action of submitting the form.
...time stamp: ${event.timestamp}`; event.preventdefault(); } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addeventlistener('submit', logsubmit); result specifications specification status comment html living standardthe definition of 'submit' in that specification.
HTMLLinkElement - Web APIs
htmllinkelement.rev is a domstring representing the reverse relationship of the linked resource from the resource to the document.
... note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg living standard still has it labeled obsolete.
... recommendation the following properties are now obsolete: charset, rev, and shape.
File drag and drop - Web APIs
function drophandler(ev) { console.log('file(s) dropped'); // prevent default behavior (prevent file from being opened) ev.preventdefault(); if (ev.datatransfer.items) { // use datatransferitemlist interface to access the file(s) for (var i = 0; i < ev.datatransfer.items.length; i++) { // if dropped items aren't files, reject them if (ev.datatransfer.items[i].kind === 'file') { var file = ev.datatransfer.items[i].getasfile(); ...
...file[' + i + '].name = ' + ev.datatransfer.files[i].name); } } } prevent the browser's default drag behavior the following dragover event handler calls preventdefault() to turn off the browser's default drag and drop handler.
... function dragoverhandler(ev) { console.log('file(s) in drop zone'); // prevent default behavior (prevent file from being opened) ev.preventdefault(); } see also html drag and drop api drag operations html5 living standard: drag and drop ...
HTML Drag and Drop API - Web APIs
function dragstart_handler(ev) { ev.datatransfer.dropeffect = "copy"; } for more details, see: drag effects define a drop zone by default, the browser prevents anything from happening when dropping something onto most html elements.
... <script> function dragover_handler(ev) { ev.preventdefault(); ev.datatransfer.dropeffect = "move"; } function drop_handler(ev) { ev.preventdefault(); // get the id of the target and add the moved element to the target's dom const data = ev.datatransfer.getdata("text/plain"); ev.target.appendchild(document.getelementbyid(data)); } </script> <p id="target" ondrop="drop_handler(event)" ondragover="dragover_handler(event)">drop zone</p> note that each handler calls preventdefault() to prevent additional event processing for...
...lowing example shows a drop handler getting the source element's id from the drag data, and then using the id to move the source element to the drop element: <script> function dragstart_handler(ev) { // add the target element's id to the data transfer object ev.datatransfer.setdata("application/my-app", ev.target.id); ev.datatransfer.dropeffect = "move"; } function dragover_handler(ev) { ev.preventdefault(); ev.datatransfer.dropeffect = "move" } function drop_handler(ev) { ev.preventdefault(); // get the id of the target and add the moved element to the target's dom const data = ev.datatransfer.getdata("application/my-app"); ev.target.appendchild(document.getelementbyid(data)); } </script> <p id="p1" draggable="true" ondragstart="dragstart_handler(event)">this element is draggable.
History - Web APIs
WebAPIHistory
back() this asynchronous method goes to the previous page in session history, the same action as when the user clicks the browser's back button.
... go() asynchronously loads a page from the session history, identified by its relative location to the current page, for example -1 for the previous page or 1 for the next page.
... if you specify an out-of-bounds value (for instance, specifying -1 when there are no previously-visited pages in the session history), this method silently has no effect.
IDBCursor.continuePrimaryKey() - Web APIs
a typical use case, is to resume the iteration where a previous cursor has been closed, without having to compare the keys one by one.
... the key is greater than or equal to this cursor's position and this cursor's direction is prev or prevunique.
... invalidaccesserror the cursor's direction is not prev or next.
KeyboardEvent: code values - Web APIs
"" 0x007d "intlyen" "intlyen" 0x007e "numpadcomma" "" 0x007f "unidentified" "" 0xe000 ~ 0xe007 "unidentified" "" 0xe008 "unidentified" "undo" 0xe009 "unidentified" "" 0xe00a "" "paste" 0xe00b ~ 0xe00f "" "" 0xe010 "mediatrackprevious" "mediatrackprevious" 0xe011 ~ 0xe016 "" "" 0xe017 "unidentified" "cut" 0xe018 "unidentified" "copy" 0xe019 "mediatracknext" "mediatracknext" 0xe01a, 0xe01b "unidentified" "" 0xe01c "numpadenter" "numpadenter" 0xe01d "controlright" "controlright" 0x...
... "browserfavorites" "" 0x00a5 "unidentified" "" 0x00a6 "browserback" "browserback" 0x00a7 "browserforward" "browserforward" 0x00a8 "unidentified" "" 0x00a9 "eject" "" 0x00aa "unidentified" "" 0x00ab "mediatracknext" "" 0x00ac "mediaplaypause" "" 0x00ad "mediatrackprevious" "" 0x00ae "mediastop" "" 0x00af ~ 0x00b2 "unidentified" "" 0x00b3 "launchmediaplayer" "" 0x00b4 "browserhome" "" 0x00b5 "browserrefresh" "browserrefresh" 0x00b6 ~ 0x00ba "unidentified" "" 0x00bb "unidentified" "numpadparenleft" 0x00bc "unidentified" ...
...0x009b "unidentified" 0x009c "browserfavorites" 0x009d "unidentified" 0x009e "browserback" 0x009f "browserforward" 0x00a0 "unidentified" 0x00a1 "eject" 0x00a2 "unidentified" 0x00a3 "mediatracknext" 0x00a4 "mediaplaypause" 0x00a5 "mediatrackprevious" 0x00a6 "mediastop" 0x00a7 ~ 0x00ac "unidentified" 0x00ad "browserrefresh" 0x00ae ~ 0x00b6 "unidentified" 0x00b7 "f13" 0x00b8 "f14" 0x00b9 "f15" 0x00ba "f16" 0x00bb "f17" 0x00bc "f18" 0x00bd "f19" 0x00be "f20" 0x00bf "f21" ...
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
for a given key press, the sequence of keyboardevents fired is as follows assuming that event.preventdefault is not called: a keydown event is first fired.
... window.addeventlistener("keydown", function (event) { if (event.defaultprevented) { return; // do nothing if the event was already processed } switch (event.key) { case "down": // ie/edge specific value case "arrowdown": // do something for "down arrow" key press.
... } // cancel the default action to avoid it being handled twice event.preventdefault(); }, true); specification specification status comment ui eventsthe definition of 'keyboardevent.key' in that specification.
MSGestureEvent - Web APIs
msgestureevent.rotation read only amount of rotation (in radians) since the previous msgestureevent of the current gesture.
... msgestureevent.scale read only the difference in scale (for zoom gestures) from the previous msgestureevent of the current gesture.
... msgestureevent.translationx read only distance traversed along the x-axis since the previous msgestureevent of the current gesture msgestureevent.translationy read only distance traversed along the y-axis since the previous msgestureevent of the current gesture msgestureevent.velocityangular read only angular velocity.
MediaDevices.getUserMedia() - Web APIs
possible errors are: aborterror although the user and operating system both granted access to the hardware device, and no hardware issues occurred that would cause a notreadableerror, some problem occurred which prevented the device from being used.
... notreadableerror although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or web page level which prevented access to the device.
... getusermedia() is a powerful feature which can only be used in secure contexts; in insecure contexts, navigator.mediadevices is undefined, preventing access to getusermedia().
MediaSession.setActionHandler() - Web APIs
it will be one of play, pause, seekbackward, seekforward, seekto, skipad,previoustrack, or nexttrack.
... description to remove a previously-established action handler, call setactionhandler() again, specifying null as the callback.
... previoustrack moves back to the previous track.
MouseEvent - Web APIs
instead of using this deprecated (and non-standard) property, you should instead use pointerevent and look at its pressure property.
...<p><label><input type="checkbox" id="checkbox"> checked</label> <p><button id="button">click me</button> javascript function simulateclick() { var evt = new mouseevent("click", { bubbles: true, cancelable: true, view: window }); var cb = document.getelementbyid("checkbox"); //element to click on var canceled = !cb.dispatchevent(evt); if(canceled) { // a handler called preventdefault alert("canceled"); } else { // none of the handlers called preventdefault alert("not canceled"); } } document.getelementbyid("button").addeventlistener('click', simulateclick); result specifications specification status comment css object model (cssom) view modulethe definition of 'mouseevent' in that specification.
...this means that a pointerevent whose pointertype is mouse will be a double.
NodeIterator - Web APIs
previously it was telling the engine that the nodeiterator was no more used, but this is now useless.
... nodeiterator.previousnode() returns the previous node in the document, or null if there are none.
... the methods previousnode() and nextnode() don't raise an exception any more.
PerformanceNavigationTiming.unloadEventEnd - Web APIs
the unloadeventend read-only property returns a timestamp representing the time value equal to the time immediately after the user agent finishes the unload event of the previous document.
... if there is no previous document, this property value is 0.
... syntax perfentry.unloadeventend; return value a timestamp representing a time value equal to the time immediately after the user agent finishes the unload event of the previous document.
PerformanceNavigationTiming.unloadEventStart - Web APIs
the unloadeventstart read-only property returns a timestamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document.
... if there is no previous document, this property returns 0.
... syntax perfentry.unloadeventstart; return value a timestamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document.
SpeechSynthesisUtterance - Web APIs
error fired when an error occurs that prevents the utterance from being succesfully spoken.
... inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), use the constructor to create a new utterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
...= document.queryselector('form'); var inputtxt = document.queryselector('input'); var voiceselect = document.queryselector('select'); for(var i = 0; i < voices.length; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; option.value = i; voiceselect.appendchild(option); } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); utterthis.voice = voices[voiceselect.value]; synth.speak(utterthis); inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesisutterance' in that specification.
Storage Access API - Web APIs
this also prevents embedded content on the page from spamming the browser or user with excessive access requests.
...prompting heuristics currently vary across the two implementers of the storage access api — safari shows prompts for all embedded tracking content that has not previously received storage access, while firefox only prompts users after a tracking origin has requested storage access on more than a threshold number of sites.
... if an embedded page from tracker.example has previously successfully obtained storage access on top-level origin foo.example, all embedded subresources from tracker.example on foo.example (e.g.
Using readable streams - Web APIs
also note that the previous example can be reduced by one step, as response.body is synchronous and so doesn't need the promise: // fetch the original image fetch('./tortoise.png') // retrieve its body as readablestream .then(response => { const reader = response.body.getreader(); reading the stream now you’ve got your reader attached, you can read data chunks out of the stream using the readablestreamdef...
... in addition, when we are done reading the fetch body we use the controller’s close() method to close the custom stream — any previously-enqueued chunks can still be read from it, but no more can be enqueued, and the stream is closed when reading has finished.
...as we said before, any previously enqueued chunks will still be read, but no more can be enqueued because it is closed.
Supporting both TouchEvent and MouseEvent - Web APIs
consequently, if an application does not want mouse events fired on a specific touch target element, the element's touch event handlers should call preventdefault() and no additional mouse events will be dispatched.
... here is a code snippet of the touchmove event handler calling preventdefault().
... // touchmove handler function process_touchmove(ev) { // call preventdefault() to prevent any further handling ev.preventdefault(); } event order although the specific ordering of touch and mouse events is implementation-defined, the standard indicates the following order is typical: for single input: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend mousemove mousedown mouseup click if the touchstart, touchmove or touchend event is canceled during an interaction, no mouse or click events will be fired, and the resulting sequence of events would just be: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend community touch events community group mail list w3c #touchevents irc channel ...
Using Touch Events - Web APIs
to prevent the emulated mouse events from being sent, use the preventdefault() method in the touch event handlers.
... // create touchstart handler someelement.addeventlistener('touchstart', function(ev) { // iterate through the touch points that were activated // for this element and process each event 'target' for (var i=0; i < ev.targettouches.length; i++) { process_target(ev.targettouches[i].target); } }, false); prevent the browser from processing emulated mouse events.
... // touchmove handler function process_touchmove(ev) { // set call preventdefault() ev.preventdefault(); } best practices here are some best practices to consider when using touch events: minimize the amount of work that is done in the touch handlers.
WebGLRenderingContext.blendEquationSeparate() - Web APIs
must be either: gl.func_add: source + destination (default value), gl.func_subtract: source - destination, gl.func_reverse_subtract: destination - source, when using the ext_blend_minmax extension: ext.min_ext: minimum of source and destination, ext.max_ext: maximum of source and destination.
...must be either: gl.func_add: source + destination (default value), gl.func_subtract: source - destination, gl.func_reverse_subtract: destination - source, when using the ext_blend_minmax extension: ext.min_ext: minimum of source and destination, ext.max_ext: maximum of source and destination.
... examples to set the blend equations, use: gl.blendequationseparate(gl.func_add, gl.func_subtract); to get the current blend equations, query the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext.
Raining rectangles - Web APIs
« previousnext » a simple webgl game that demonstrates clearing with solid colors, scissoring, animation, and user interaction.
...it is a preview of a full graphical application that manipulates various phases of the webgl graphics pipeline and state machine.
... « previousnext » ...
WebGL constants - Web APIs
each vertex connects to the previous and the first vertex in the fan.
... func_reverse_subtract 0x800b passed to blendequation or blendequationseparate to specify a reverse subtraction blend function (destination - source).
... rg32ui 0x823c r8_snorm 0x8f94 rg8_snorm 0x8f95 rgb8_snorm 0x8f96 rgba8_snorm 0x8f97 rgb10_a2ui 0x906f texture_immutable_format 0x912f texture_immutable_levels 0x82df pixel types constant name value description unsigned_int_2_10_10_10_rev 0x8368 unsigned_int_10f_11f_11f_rev 0x8c3b unsigned_int_5_9_9_9_rev 0x8c3e float_32_unsigned_int_24_8_rev 0x8dad unsigned_int_24_8 0x84fa half_float 0x140b rg 0x8227 rg_integer 0x8228 int_2_10_10_10_rev 0x8d9f queries constant name val...
Animating textures in WebGL - Web APIs
« previous in this demonstration, we build upon the previous example by replacing our static textures with the frames of an mp4 video file that's playing.
...it's nearly identical to the image onload function in the previous example — except when we call teximage2d(), instead of passing an image object, we pass in the <video> element.
... then in main() in place of the call to loadtexture() in the previous example, we call inittexture() followed by setupvideo() .
WebRTC connectivity - Web APIs
for example, when renegotiating a connection—for example, to adapt to changing hardware or network configurations—it's possible that negotiation could reach a dead end, or some form of error might occur that prevents negotiation at all.
... in addition, the ice agent will automatically initiate a rollback when a peer that had previously created an offer receives an offer from the remote peer.
... in other words, if the local peer is in the state have-local-offer, indicating that the local peer had previously sent an offer, calling setremotedescription() with a received offer triggers rollback so that the negotiation switches from the remote peer being the caller to the local peer being the caller.
Introduction to WebRTC protocols - Web APIs
it needs to bypass firewalls that would prevent opening connections, give you a unique address if like most situations your device doesn’t have a public ip address, and relay data through a server if your router doesn’t allow you to directly connect with peers.
... stun session traversal utilities for nat (stun) (acronym within an acronym) is a protocol to discover your public address and determine any restrictions in your router that would prevent a direct connection with a peer.
...this means the router will only accept connections from peers you’ve previously connected to.
Writing WebSocket servers - Web APIs
websocket servers are often separate and specialized servers (for load-balancing or other practical reasons), so you will often use a reverse proxy (such as a regular http server) to detect websocket handshakes, pre-process them, and send those clients to a real websocket server.
...in many common setups, a reverse proxy has already dealt with them.
...client: fin=0, opcode=0x1, msg="and a" server: (listening, new message containing text started) client: fin=0, opcode=0x0, msg="happy new" server: (listening, payload concatenated to previous message) client: fin=1, opcode=0x0, msg="year!" server: (process complete message) happy new year to you too!
Using bounded reference spaces - Web APIs
there are many uses for bounded reference spaces, including projects such as virtual paint studios or 3d construction, modeling, or sculpting systems; training simulations or lesson scenarios; dance or other performance-based games; or the preview of 3d objects in the real world using augmented reality.
... understanding boundaries as mentioned previously, the boundary is defined as an array of points located at floor level, each defining a corner of the boundary area, going around the origin in a clockwise manner.
...this approximates human height, though it assumes we've previously transformed the coordinate system so that the value of each coordinate is no longer constrained to -1 to 1, while maintaining the definition that a value of 1 represents one meter).
Starting up and shutting down a WebXR session - Web APIs
permissions and security there are a number of security measures in place revolving around webxr.
... detecting when the session has ended as previously established, you can detect when the webxr session has ended—whether because you've called its end() method, the user turned off their headset, or some sort of irresolvable error occurred in the xr system—by watching for the end event to be sent to the xrsession.
... session.onend = (event) => { /* the session has shut down */ freeresources(); }; here, when the session has ended and the end event is received, a freeresources() function is called to release the resources previously allocated and/or loaded to handle the xr presentation.
Advanced techniques: Creating and sequencing audio - Web APIs
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 expose 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="5" /> let noiseduration = 1; const durcontrol = document.queryselector('#duration'); durcontrol.addeventlistener('input', function() { ...
...tion nextnote() { const secondsperbeat = 60.0 / tempo; nextnotetime += secondsperbeat; // add beat length to last beat time // advance the beat number, wrap to zero currentnote++; if (currentnote === 4) { currentnote = 0; } } we want to create a reference queue for the notes that are to be played, and the functionality to play them using the functions we've previously created: const notesinqueue = []; function schedulenote(beatnumber, time) { // push the note on the queue, even if we're not playing.
...() } if (pads[2].queryselectorall('button')[currentnote].getattribute('aria-checked') === 'true') { playnoise() } if (pads[3].queryselectorall('button')[currentnote].getattribute('aria-checked') === 'true') { playsourcenode(audioctx, sample); } } here we look at the current time and compare it to the time for the next note; when the two match it will call the previous two functions.
Web Audio API - Web APIs
a simple, typical workflow for web audio would look something like this: create audio context inside the context, create sources — such as <audio>, oscillator, stream create effects nodes, such as reverb, biquad filter, panner, compressor choose final destination of audio, for example your system speakers connect the sources up to the effects, and the effects to the destination.
... convolvernode the convolvernode interface is an audionode that performs a linear convolution on a given audiobuffer, and is often used to achieve a reverb effect.
... dynamicscompressornode the dynamicscompressornode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once.
WindowEventHandlers.onbeforeunload - Web APIs
the html specification states that authors should use the event.preventdefault() method instead of using event.returnvalue to prompt the user.
... window.addeventlistener('beforeunload', function (e) { // cancel the event e.preventdefault(); // if you prevent default behavior in mozilla firefox prompt will always be shown // chrome requires returnvalue to be set e.returnvalue = ''; }); guarantee the browser unload by removing the returnvalue property of the event window.addeventlistener('beforeunload', function (e) { // the absence of a returnvalue property on the event will guarantee the browser unload happens delete e['returnvalue']; }); notes when your page uses javascript to render content, the javascript may stop when leaving and then navigating back to the page.
... you can bind to window.onbeforeunload to prevent the browser from fully caching the page.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
note also that we set oncontextmenu up to be ignored by calling preventdefault() on those events.
... this prevents the right-clicks from causing the context menu from appearing in the browser.
... canvas.oncontextmenu = (event) => { event.preventdefault(); }; canvas.addeventlistener("mousemove", (event) => { if (event.buttons & 2) { rotateviewby(event.movementx, event.movementy); } }); next, the rotateviewby() function, which updates the mouse look direction's yaw and pitch based on the mouse delta values from the mousemove event.
XRReferenceSpace: reset event - Web APIs
note: a reset event will not occur if the reference space is able to regain tracking of its previous origin, since that means the origin has not been forced to be relocated.
...if a jump in the viewer's position coincides with emulatedposition toggling from true to false, the viewer has regained tracking, and that their new position represents a correction from the previously emulated values.
...instead of allowing this to happen, you can integrate the emulatedposition into the teleportation offset calculated prior to calling getoffsetreferencespace() to create a new reference space whose updated effective origin is adjusted by the distance the viewer's position jumped since the previous frame.
XRSystem - Web APIs
WebAPIXRSystem
usage notes thsi interface was previously known as simply xr in earlier versions of the specification; if you see references to xr in code or documentation, simply replace that with xrsystem.
...er("click", onbuttonclicked); navigator.xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { immersivebutton.disabled = false; } else { immersivebutton.disabled = true; }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then(() => { // onsessionstarted() not shown for reasons of brevity and clarity.
...if immersive vr isn't available, the button is disabled to prevent its use.
ARIA annotations - Accessibility
an editorial comment related to a part of a document under review).
... role="comment" — semantically denotes a comment/reaction to some content on the page, or to a previous comment.
...ple: <input type="radio" name="fruit" value="apple"></label></li> <li><label>orange: <input type="radio" name="fruit" value="orange"></label></li> <li><label>banana: <input type="radio" name="fruit" value="banana"></label></li> </ul> </form> </section> insertions and deletions a common wish in online document systems like google docs is to be able to track changes, to see what reviewers or editors have suggested as changes to the text, before the managing editor or author accepts or rejects those changes.
Accessibility: What users can do to browse more safely - Accessibility
taking advantage of personalization settings can help prevent exposure to content leading to seizures and / or other physical reactions.
...examples include: transitionrun transitionstart transitionend transitioncancel edge 75 and above (desktop, in windows 10) according to eric bailey, in his april 30, 2019 article revisiting prefers-reduced-motion, the reduced motion media query, "while microsoft edge does not have support for prefers-reduced-motion, it will become chrome under the hood soon." safari 10.1 and above (desktop) do not enable auto-play (does not work for gifs) ios safari 10.3 and above (mobile and tablet) select the "reduce motion option" in os accessibility settings for apple (image source: ...
...to reverse it, you will have to change the value back to "normal" use browser extensions gif blocker for chrome, gif blocker is an extension available at the web store.
Accessibility and Spacial Patterns - Accessibility
they revised the guidelines to their fundamental core, and came up with a surprisingly simple, but powerful test.
... which they published in the paper, characterizing the patterned images that precipitate seizures and optimizing guidelines to prevent them the steps necessary to evaluate material reduce to the following: look at the screen are there more than five stripes?
...in brailleblaster (4 of 5) government literature nasa: designing with blue math spatial reasoning: why math talk is about more than numbers scientific literature colour constancy in context: roles for local adaptation and levels of reference gamma oscillations and photosensitive epilepsy characterizing the patterned images that precipitate seizures and optimizing guidelines to prevent them arnold wilkins, john emmett, and graham harding contributers: heartfelt thanks to jim allan of the diagram center for his discussions on the topic of alternative means of education.
@media - CSS: Cascading Style Sheets
WebCSS@media
print intended for paged material and documents viewed on a screen in print preview mode.
... because of this potential, a browser may opt to fudge the returned values in some manner in order to prevent them from being used to precisely identify a computer.
... css level 2 (revision 1)the definition of '@media' in that specification.
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
if flex-direction is set to row-reverse then the items will start from the end edge of the container and lay themselves out in reverse ordered lines.
... note that the reversing is only happening in the inline, row direction.
...we aren’t reversing in both directions, starting from the bottom coming up the container!
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
values: row (default) | row-reverse | column | column-reverse spec: https://drafts.csswg.org/css-flexbox/#flex-direction-property @mixin flex-direction($value: row) { @if $value == row-reverse { -webkit-box-direction: reverse; -webkit-box-orient: horizontal; -moz-box-direction: reverse; -moz-box-orient: horizontal; } @else if $value == column { -webkit-box-direction: normal; -webkit-box-orient: v...
...ertical; -moz-box-direction: normal; -moz-box-orient: vertical; } @else if $value == column-reverse { -webkit-box-direction: reverse; -webkit-box-orient: vertical; -moz-box-direction: reverse; -moz-box-orient: vertical; } @else { -webkit-box-direction: normal; -webkit-box-orient: horizontal; -moz-box-direction: normal; -moz-box-orient: horizontal; } -webkit-flex-direction: $value; -ms-flex-direction: $value; flex-direction: $value; } // shorter version: @mixin flex-dir($args...) { @include flex-direction($args...); } flexbox wrap the flex-wrap property controls whether the flex container is single-lined or multi-lined and the direction of the cross-axis, which determines the direction in which the new lines are stacked in.
... values: nowrap (default) | wrap | wrap-reverse spec: https://drafts.csswg.org/css-flexbox/#flex-wrap-property @mixin flex-wrap($value: nowrap) { // no webkit/ff box fallback.
OpenType font features guide - CSS: Cascading Style Sheets
try changing the line font-variant-alternates: styleset(alt-a); to font-variant-alternates: styleset(alt-g); and notice that the lower case 'a' reverts to its regular form and the lower case 'g' changes instead.
...these are capital letters sized to fit better amongst lower case letters and are generally used for acronyms and abbreviations.
...because of this, it's best to use the standard properties shown above wherever possible.
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
they prevent the browser being able to do the work to switch writing mode, as they make the assumption that the text is flowing left to right and top to bottom.
...we need a new reference point, and this is where understanding the block and inline axes, that we met previously in the guide to alignment, becomes very useful.
...so the reverse of what we do for margins and padding.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
WebCSSCascade
all lets you opt to immediately restore all properties to any of their initial (default) state, the state inherited from the previous level of the cascade, a specific origin (the user-agent stylesheet, the author stylesheet, or the user stylesheet), or even to clear the values of the properties entirely.
... specifications specification status comment css cascading and inheritance level 4 candidate recommendation added the revert keyword, which allows rolling a property back a cascade level.
... css level 2 (revision 1)the definition of 'the cascade' in that specification.
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
width: 75px; } .four { color: white; background-color: var(--main-bg-color); margin: 10px; width: 100px; } .five { background-color: var(--main-bg-color); } <div> <div class="one"></div> <div class="two">text <span class="five">- more text</span></div> <input class="three"> <textarea class="four">lorem ipsum</textarea> </div> this leads to the same result as the previous example, yet allows for one canonical declaration of the desired property value; very useful if you want to change the value across the entire page later.
...the previous declaration will then be used.
... // get variable from inline style element.style.getpropertyvalue("--my-var"); // get variable from wherever getcomputedstyle(element).getpropertyvalue("--my-var"); // set variable on inline style element.style.setproperty("--my-var", jsvar + 4); ...
animation-fill-mode - CSS: Cascading Style Sheets
the last keyframe depends on the value of animation-direction and animation-iteration-count: animation-direction animation-iteration-count last keyframe encountered normal even or odd 100% or to reverse even or odd 0% or from alternate even 0% or from alternate odd 100% or to alternate-reverse even 100% or to alternate-reverse odd 0% or from backwards the animation will apply the values defined in the first relevant keyframe as soon as it is applied to the target, and retain this during the a...
...the first relevant keyframe depends on the value of animation-direction: animation-direction first relevant keyframe normal or alternate 0% or from reverse or alternate-reverse 100% or to both the animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions.
...it demonstrates how, for an animation that runs for an infinite time, you can cause it to remain in its final state rather than reverting to the original state (which is the default).
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
if the children in a horizontal box still do not fit on a line after being reduced to their minimum widths, then children are moved one by one onto a new line, until the elements remaining on the previous line fit.
...the later lines are placed below the earlier lines in normal direction boxes and above in reverse direction boxes.
...later lines in normal direction boxes are placed to the right of earlier lines and to the left in reverse direction boxes.
Computed value - CSS: Cascading Style Sheets
it is calculated from the specified value by: handling the special values inherit, initial, unset, and revert.
... specifications specification status comment css level 2 (revision 2)the definition of 'computed-value' in that specification.
... css level 2 (revision 1)the definition of 'computed value' in that specification.
<custom-ident> - CSS: Cascading Style Sheets
it is case-sensitive, and certain values are forbidden in various contexts to prevent ambiguity.
... to prevent ambiguity, each property that uses <custom-ident> forbids the use of specific values: animation-name forbids the global css values (unset, initial, and inherit), as well as none.
... css level 2 (revision 1)the definition of '<identifier>' in that specification.
flex-flow - CSS: Cascading Style Sheets
WebCSSflex-flow
constituent properties this property is a shorthand for the following css properties: flex-direction flex-wrap syntax /* flex-flow: <'flex-direction'> */ flex-flow: row; flex-flow: row-reverse; flex-flow: column; flex-flow: column-reverse; /* flex-flow: <'flex-wrap'> */ flex-flow: nowrap; flex-flow: wrap; flex-flow: wrap-reverse; /* flex-flow: <'flex-direction'> and <'flex-wrap'> */ flex-flow: row nowrap; flex-flow: column wrap; flex-flow: column-reverse wrap-reverse; /* global values */ flex-flow: inherit; flex-flow: initial; flex-flow: unset; values see flex-direction and f...
... formal definition initial valueas each of the properties of the shorthand:flex-direction: rowflex-wrap: nowrapapplies toflex containersinheritednocomputed valueas each of the properties of the shorthand:flex-direction: as specifiedflex-wrap: as specifiedanimation typediscrete formal syntax <'flex-direction'> | <'flex-wrap'> examples setting column-reverse and wrap element { /* main-axis is the block direction with reversed main-start and main-end.
... flex items are laid out in multiple lines */ flex-flow: column-reverse wrap; } specifications specification status comment css flexible box layout modulethe definition of 'flex-flow' in that specification.
ime-mode - CSS: Cascading Style Sheets
WebCSSime-mode
this property should only be used for private web applications or to undo the property if it was previously set by legacy code.
...users may correct the inappropriate behavior of sites that don't follow this recommendation by placing the following css into their user stylesheet: input[type=password] { ime-mode: auto !important; } the mac version of gecko 1.9 (firefox 3) can't recover the previous state of the ime when a field for which it is disabled loses focus, so mac users may get grumpy when you use the disabled value.
... <input type="text" name="name" value="initial value" style="ime-mode: disabled"> note: you shouldn't rely on disabling ime to prevent extended characters from passing through your form.
initial - CSS: Cascading Style Sheets
WebCSSinitial
you should consider using the inherit, unset, or revert keywords instead.
... use revert to reset a property to the value established by the user-agent stylesheet (or by user styles, if any exist).
... the all property lets you reset all properties to their initial, inherited, reverted, or unset state at once.
offset-rotate - CSS: Cascading Style Sheets
syntax /* follow the path direction, with optional additional angle */ offset-rotate: auto; offset-rotate: auto 45deg; /* follow the path direction but facing the opposite direction of `auto` */ offset-rotate: reverse; /* keep a constant rotation regardless the position on the path */ offset-rotate: 90deg; offset-rotate: .5turn; auto the element is rotated by the angle of the direction of the offset-path, relative to the positive x-axis.
... reverse the element is rotated similar to auto, except it faces the opposite direction.
... formal definition initial valueautoapplies totransformable elementsinheritednocomputed valueas specifiedanimation typeas <angle>, <basic-shape> or <path()> formal syntax [ auto | reverse ] | <angle> examples setting element orientation along its offset path html <div></div> <div></div> <div></div> css div { width: 40px; height: 40px; background: #2bc4a2; margin: 20px; clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%); animation: move 5000ms infinite alternate ease-in-out; offset-path: path('m20,20 c20,50 180,-10 180,20'); } div:nth-child(1) { offset-rotate: auto; } div:nth-child(2) { offset-rotate: auto 90deg; } div:nth-child(3) { offset-rotate: 30deg; } @keyframes move { 100% { ...
overscroll-behavior - CSS: Cascading Style Sheets
none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ contain | none | auto ]{1,2} examples preventing an underlying element from scrolling in our overscroll-behavior example (see the source code also), we present a full-page list of fake contacts, and a dialog box containing a chat window.
...this can be prevented by setting overscroll-behavior: none on the <body> element: body { margin: 0; overscroll-behavior: none; } specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior' in that specification.
right - CSS: Cascading Style Sheets
WebCSSright
when both left and right are defined, if not prevented from doing so by other properties, the element will stretch to satisfy both.
...ative { width: 100px; height: 100px; background-color: #ffc7e4; position: relative; top: 20px; left: 20px; } #absolute { width: 100px; height: 100px; background-color: #ffd7c2; position: absolute; bottom: 10px; right: 20px; } result declaring both left and right when both left and right are declared, the element will stretch to meet both, unless other constraints prevent it from doing so.
... css level 2 (revision 1)the definition of 'right' in that specification.
text-transform - CSS: Cascading Style Sheets
none is a keyword that prevents the case of all characters from being changed.
... working draft from css level 2 (revision 1)the definition of 'text-transform' in that specification., extends letters to any unicode character in the number or letter general category.
... css level 2 (revision 1)the definition of 'text-transform' in that specification.
touch-action - CSS: Cascading Style Sheets
applications using touch events disable the browser handling of gestures by calling preventdefault(), but should also use touch-action to ensure the browser knows the intent of the application before any event listeners have been invoked.
...once scrolling has started, the direction may still be reversed.
...this will prevent people experiencing low vision conditions from being able to read and understand page content.
The HTML autocomplete attribute - HTML: Hypertext Markup Language
note: in most modern browsers, setting autocomplete to "off" will not prevent a password manager from asking the user if they would like to save username and password information, or from automatically filling in those values in a site's login form.
...this may be used by the browser both to avoid accidentally filling in an existing password and to offer assistance in creating a secure password (see also preventing autofilling with autocomplete="new-password").
... japan an address in japan is typically written in one line, in an order from the least-specific to more-specific portions (in reverse order to the united states).
HTML attribute reference - HTML: Hypertext Markup Language
hidden global attribute prevents rendering of given element, while keeping child elements, e.g.
... reversed <ol> indicates whether the list should be displayed in a descending order instead of a ascending.
... step <input> style global attribute defines css styles which will override styles previously set.
Date and time formats used in HTML - HTML: Hypertext Markup Language
it's worth reviewing the descriptions of the formats you're using in order to ensure that your strings are in fact compatible with html, as the html specification includes algorithms for parsing these strings that is actually more precise than iso 8601, so there can be subtle differences in how date and time strings are expected to look.
...that means it's possible for the first few days of january to be considered part of the previous week-year, and for the last few days of december to be considered part of the following week-year.
...rmalized date/time string actual date and time 1986-01-28t11:38:00.01 1986-01-28t11:38:00.01 january 28, 1986 at 11:38:00.01 am 1986-01-28 11:38:00.010 1986-01-28t11:38:00.011 january 28, 1986 at 11:38:00.01 am 0170-07-31t22:00:00 0170-07-31t22:002 july 31, 170 at 10:00 pm notice that after normalization, this is the same string as the previous datetime-local string.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
when the user clicks on the widget or focuses it then presses the space bar, it "twists" open, revealing its contents: from there, you can use css to style the disclosure widget, and you can programmatically open and close the widget by setting/removing its open attribute.
...idth: 620px; } details > summary { padding: 2px 6px; width: 15em; background-color: #ddd; border: none; box-shadow: 3px 3px 4px black; cursor: pointer; } details > p { border-radius: 0 0 10px 10px; background-color: #ddd; padding: 2px 6px; margin: 0; box-shadow: 3px 3px 4px black; } this css creates a look similar to a tabbed interface, where clicking the tab opens it to reveal its contents.
... border: none; box-shadow: 3px 3px 4px black; cursor: pointer; list-style: none; } details > summary::-webkit-details-marker { display: none; } details > p { border-radius: 0 0 10px 10px; background-color: #ddd; padding: 2px 6px; margin: 0; box-shadow: 3px 3px 4px black; } this css creates a look similar to a tabbed interface, where activating the tab expands and opens it to reveal its contents.
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
daynum = 29 : daynum = 28; } // inject the right number of new <option> elements into the day <select> for(i = 1; i <= daynum; i++) { var option = document.createelement('option'); option.textcontent = i; dayselect.appendchild(option); } // if previous day has already been set, set dayselect's value // to that day, to avoid the day jumping back to 1 when you // change the year if(previousday) { dayselect.value = previousday; // if the previous day was set to a high number, say 31, and then // you chose a month with less total days in it (e.g.
... february), // this part of the code ensures that the highest day available // is selected, rather than showing a blank dayselect if(dayselect.value === "") { dayselect.value = previousday - 1; } if(dayselect.value === "") { dayselect.value = previousday - 2; } if(dayselect.value === "") { dayselect.value = previousday - 3; } } } function populateyears() { // get this year as a number var date = new date(); var year = date.getfullyear(); // make this year, and the 100 years before it available in the year <select> for(var i = 0; i <= 100; i++) { var option = document.createelement('option'); option.textcontent = year-i; yearselect.appendchild(option); } } // when the month or year <select> values are changed, rer...
...un populatedays() // in case the change affected the number of available days yearselect.onchange = function() { populatedays(monthselect.value); } monthselect.onchange = function() { populatedays(monthselect.value); } //preserve day selection var previousday; // update what day has been set to previously // see end of populatedays() for usage dayselect.onchange = function() { previousday = dayselect.value; } note: remember that some years have 53 weeks in them (see weeks per year)!
<input type="datetime-local"> - HTML: Hypertext Markup Language
daynum = 29 : daynum = 28; } // inject the right number of new <option> elements into the day <select> for(i = 1; i <= daynum; i++) { var option = document.createelement('option'); option.textcontent = i; dayselect.appendchild(option); } // if previous day has already been set, set dayselect's value // to that day, to avoid the day jumping back to 1 when you // change the year if(previousday) { dayselect.value = previousday; // if the previous day was set to a high number, say 31, and then // you chose a month with less total days in it (e.g.
... february), // this part of the code ensures that the highest day available // is selected, rather than showing a blank dayselect if(dayselect.value === "") { dayselect.value = previousday - 1; } if(dayselect.value === "") { dayselect.value = previousday - 2; } if(dayselect.value === "") { dayselect.value = previousday - 3; } } } function populateyears() { // get this year as a number var date = new date(); var year = date.getfullyear(); // make this year, and the 100 years before it available in the year <select> for(var i = 0; i <= 100; i++) { var option = document.createelement('option'); option.textcontent = year-i; yearselect.appendchild(option); } } function populatehours() { // populate the hours <select...
...("0" + i) : i; minuteselect.appendchild(option); } } // when the month or year <select> values are changed, rerun populatedays() // in case the change affected the number of available days yearselect.onchange = function() { populatedays(monthselect.value); } monthselect.onchange = function() { populatedays(monthselect.value); } //preserve day selection var previousday; // update what day has been set to previously // see end of populatedays() for usage dayselect.onchange = function() { previousday = dayselect.value; } note: remember that some years have 53 weeks in them (see weeks per year)!
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
the html is revised to add a <pre> block to output the form data into: <form> <p>please select your preferred contact method:</p> <div> <input type="radio" id="contactchoice1" name="contact" value="email"> <label for="contactchoice1">email</label> <input type="radio" id="contactchoice2" name="contact" value="phone"> <label for="contactchoice2">phone</label> <input t...
...istener on the submit event, which is sent when the user clicks the "submit" button: var form = document.queryselector("form"); var log = document.queryselector("#log"); form.addeventlistener("submit", function(event) { var data = new formdata(form); var output = ""; for (const entry of data) { output = output + entry[0] + "=" + entry[1] + "\r"; }; log.innertext = output; event.preventdefault(); }, false); try this example out and see how there's never more than one result for the contact group.
... selecting a radio button by default to make a radio button selected by default, you simply include checked attribute, as shown in this revised version of the previous example: <form> <p>please select your preferred contact method:</p> <div> <input type="radio" id="contactchoice1" name="contact" value="email" checked> <label for="contactchoice1">email</label> <input type="radio" id="contactchoice2" name="contact" value="phone"> <label for="contactchoice2">phone</label> <input type="radio" id="cont...
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
html we use the same html as in the previous examples: <input type="range" min="0" max="11" value="7" step="1"> css we target just the inputs with a type of range: input[type="range"] { -webkit-appearance: slider-vertical; } orient attribute in firefox only, there is a non-standard orient property.
... 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 purposes, but can be used for special effects.
... html we use the same html as in the previous examples: <input type="range" min="0" max="11" value="7" step="1"> css we target just the inputs with a type of range, changing the writing mode from the default to bt-lr, or bottom-to-top and left-to-right: input[type="range"] { writing-mode: bt-lr; } putting it all together as each of the above examples works in different browsers, you can put all of them in a single example to make it work cross browser: html we keep the orient attribute with a value of vertical for firefox: <input type="range" min="0" max="11" value="7" step="1" orient="vertical"> css we target just the inputs with a type of range, changing the writing mode from the default to bt-lr, or bottom-to-top and left-to-right, for edge and internet explorer, and ad...
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
min a string specifying the earliest time to accept, given in the time value format described previously.
...be prepared for this situation to arise: const input = document.createelement('input'); input.type = 'time'; input.min = '23:00'; input.max = '01:00'; input.value = '23:59'; if (input.validity.valid && input.type === 'time') { // <input type=time> reversed range supported } else { // <input type=time> reversed range unsupported } making times required in addition, you can use the required attribute to make filling in the time mandatory.
... the second problem is the more serious; as mentioned previously, time inputs' values are always normalized to the format hh:mm or hh:mm:ss.
<sup>: The Superscript element - HTML: Hypertext Markup Language
WebHTMLElementsup
displaying superior lettering, which is used in some languages when rendering certain abbreviations.
... for example, in french, the word "mademoiselle" can be abbreviated "mlle"); this is an acceptable use case.
...among the most common uses of superior lettering is the presentation of certain abbreviations in french: <p>robert a présenté son rapport à m<sup>lle</sup> bernard.</p> the resulting output: ordinal numbers ordinal numbers, such as "fourth" in english or "quinto" in spanish may be abbreviated using numerals and language-specific text rendered in superscript: <p>the ordinal number "fifth" can be abbreviated in various languages as follows:</p> <ul> <li>english: 5<sup>th<...
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
the html <textarea> element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.
... on: the browser can automatically complete the value based on values that the user has entered during previous uses.
...unlike the disabled attribute, the readonly attribute does not prevent the user from clicking or selecting in the control.
contextmenu - HTML: Hypertext Markup Language
example html <body contextmenu="share"> <menu type="context" id="share"> <menu label="share"> <menuitem label="twitter" onclick="shareviatwitter()"></menuitem> <menuitem label="facebook" onclick="shareviafacebook()"></menuitem> </menu> </menu> <ol> <li> anywhere in the example you can share the page on twitter and facebook using the share menu from your context menu.
...mage below, you can fire the "change image" action in your context menu.<br /> <img src="https://udn.realityripple.com/samples/a2/b601bdfc0c.png" contextmenu="changeimage" id="promobutton" /> <menu type="context" id="changeimage"> <menuitem label="change image" onclick="changeimage()"></menuitem> </menu> </li> </ol> </body> javascript function shareviatwitter() { window.open("https://twitter.com/intent/tweet?text=" + "hurray!
... i am learning contextmenu from mdn via mozilla"); } function shareviafacebook() { window.open("https://facebook.com/sharer/sharer.php?u=" + "https://developer.mozilla.org/en/html/element/using_html_context_menus"); } function incfont() { document.getelementbyid("fontsizing").style.fontsize = "larger"; } function decfont() { document.getelementbyid("fontsizing").style.fontsize = "smaller"; } function changeimage() { var index = math.ceil(math.random() * 39 + 1); document.images[0].src = "https://developer.mozilla.org/media/img/promote/promobutton_mdn" + index + ".png"; } result specifications specification status comment html 5.1the definition of 'contextmenu' in that specification.
itemprop - HTML: Hypertext Markup Language
er element <div itemscope itemtype="http://schema.org/product"> <span itemprop="name">panasonic white 60l refrigerator</span> <img src="panasonic-fridge-60l-white.jpg" alt=""> <div itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> <meter itemprop="ratingvalue" min=0 value=3.5 max=5>rated 3.5/5</meter> (based on <span itemprop="reviewcount">11</span> customer reviews) </div> </div> similarly, for date- and time-related data, the time element and its datetime attribute can be used.
... all the properties separated from their items this example is the same as the previous one, but all the properties are separated from their items <div itemscope id="amanda" itemref="a b"></div> <p id="a">name: <span itemprop="name">amanda</span></p> <div id="b" itemprop="band" itemscope itemref="c"></div> <div id="c"> <p>band: <span itemprop="name">jazz band</span></p> <p>size: <span itemprop="size">12</span> players</p> </div> this gives the same result as the ...
...previous example.
itemtype - HTML: Hypertext Markup Language
<br> </span> product #: <span itemprop="mpn">925872<br></span> <span itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> rating: <span itemprop="ratingvalue">4.4</span> stars, based on <span itemprop="reviewcount">89 </span> reviews </span><p> <span itemprop="offers" itemscope itemtype="http://schema.org/offer"> regular price: $179.99<br> <meta itemprop="pricecurrency" content="usd" /> <span itemprop="price">sale price: $119.99<br></span> (sale ends <time itemprop="pricevaliduntil" datetime="2020-11-05"> 5 november!</time>)<br> available from: <span itemprop="sel...
...ler" itemscope itemtype="http://schema.org/organization"> <span itemprop="name">executive objects<br></span> </span> condition: <link itemprop="itemcondition" href="http://schema.org/usedcondition"/>previously owned, in excellent condition<br> <link itemprop="availability" href="http://schema.org/instock"/>in stock!
... itemprop mpn 925872 itemprop brand [thing] itemprop name acme itemscope itemprop[itemtype] aggregaterating[aggregaterating] itemprop ratingvalue 4.4 itemprop reviewcount 89 itemprop offers [offer] http://schema.org/offer itemprop pricecurrency usd itemprop price 119.99 itemprop pricevaliduntil 2020-11-05 itemprop itemcondition http://schema.org/usedcondition itemprop availability http://schema.org/instock itemscope itemprop[itemtype] seller [organiz...
HTTP authentication - HTTP
from firefox 59 onwards, image resources loaded from different origins to the current document are no longer able to trigger http authentication dialogs (bug 1423146), preventing user credentials being stolen if attackers were able to embed an arbitrary image into a third-party page.
... security of basic authentication as the user id and password are passed over the network as clear text (it is base64 encoded, but base64 is a reversible encoding), the basic authentication scheme is not secure.
...(apache is usually configured to prevent access to .ht* files).
MIME types (IANA media types) - HTTP
only a few image types are used commonly enough to be considered safe for use on web pages: abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari gif graphics interchange format image/gif .gif chrome, edge, firefox, i...
....png chrome, edge, firefox, internet explorer, opera, safari svg scalable vector graphics image/svg+xml .svg chrome, edge, firefox, internet explorer, opera, safari tiff tagged image file format image/tiff .tif, .tiff none built-in; add-ons required webp web picture format image/webp .webp chrome, edge, firefox, opera the abbreviation for each format links to a longer description of the format, its capabilities, and detailed browser compatibility information; including which versions introduced support and specific special features that may have been introduced later.
...servers can prevent mime sniffing by sending the x-content-type-options header.
Browser detection using the user agent - HTTP
can you prevent it by adding some non-semantic <div> or <span> elements?
... making the best of user agent sniffing after reviewing all of the above better alternatives to user agent sniffing, there are still some potential cases where user agent sniffing is appropriate and justified.
...from gecko 14 for the mobile version and gecko 17 for the desktop version, it also puts this value in the gecko/version token (previous version put there the build date, then a fixed date called the geckotrail).
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
therefore, sites that prevent cross-site request forgery have nothing new to fear from http access control.
... note: webkit nightly and safari technology preview place additional restrictions on the values allowed in the accept, accept-language, and content-language headers.
...the previous section gives an overview of these in action.
Cross-Origin Resource Policy (CORP) - HTTP
cross-origin resource policy complements cross-origin read blocking (corb), which is a mechanism to prevent some cross-origin reads by default.
... as this policy is expressed via a response header, the actual request is not prevented—rather, the browser prevents the result from being leaked by stripping the response body.
... usage note: due to a bug in chrome, setting cross-origin-resource-policy can break pdf rendering, preventing visitors from being able to read past the first page of some pdfs.
ETag - HTTP
WebHTTPHeadersETag
additionally, etags help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions").
...this means weak etags prevent caching when byte range requests are used, but strong etags mean range requests can still be cached.
...often, a hash of the content, a hash of the last modification timestamp, or just a revision number is used.
Strict-Transport-Security - HTTP
the http strict-transport-security response header (often abbreviated as hsts) lets a web site tell browsers that it should only be accessed using https, instead of using http.
... strict transport security resolves this problem; as long as you've accessed your bank's web site once using https, and the bank's web site uses strict transport security, your browser will know to automatically use only https, which prevents hackers from performing this sort of man-in-the-middle attack.
... whenever the strict-transport-security header is delivered to the browser, it will update the expiration time for that site, so sites can refresh this information and prevent the timeout from expiring.
Loops and iteration - JavaScript
« previousnext » loops offer a quick and easy way to do something repeatedly.
...the statements in the following while loop execute forever because the condition never becomes false: // infinite loops are bad!
...while for...in iterates over property names, for...of iterates over property values: const arr = [3, 5, 7]; arr.foo = 'hello'; for (let i in arr) { console.log(i); // logs "0", "1", "2", "foo" } for (let i of arr) { console.log(i); // logs 3, 5, 7 } « previousnext » ...
Arrow function expressions - JavaScript
correction: start note: the previous statement seems false.
... strict mode should prevent creating global variables when assigning to an undeclared identifier in a function.
... function foo(n) { var f = (...args) => args[0] + n; return f(10); } foo(1); // 11 arrow functions used as methods as stated previously, arrow function expressions are best suited for non-method functions.
Functions - JavaScript
the function constructor note: using the function constructor to create functions is not recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems.
... note: using the generatorfunction constructor to create functions is not recommended since it needs the function body as a string which may prevent some js engine optimizations and can also cause other problems.
...attempting to use it outside the function's body results in an error (or undefined if the function name was previously declared via a var statement).
Array.prototype.reduceRight() - JavaScript
syntax arr.reduceright(callback(accumulator, currentvalue[, index[, array]])[, initialvalue]) parameters callback function to execute on each value in the array, taking four arguments: accumulator the value previously returned in the last invocation of the callback, or initialvalue, if supplied.
... description reduceright executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring.
...onsole.log, 5) // -> 14 // same as: const computation2 = (input, callback) => { const f6 = x=> div4(callback, x); const f5 = (x, y) => add(f6, x, y); const f4 = x => split(f5, x); const f3 = x => sub2(f4, x); const 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 compose function is simple it combines n functions.
Date.prototype.setDate() - JavaScript
for example, if 0 is provided for dayvalue, the date will be set to the last day of the previous month.
... if a negative number is provided for dayvalue, the date will be set counting backwards from the last day of the previous month.
... -1 would result in the date being set to 1 day before the last day of the previous month.
Math.clz32() - JavaScript
now, inversing the bits reveals the lowest bits return 32 - clz(~integer) |0; // `|0` ensures integer coercion } function ctron(integer){ // count trailing ones // no shift-filling-in-with-ones operator is available in // javascript, so the below code is the fastest return ctrz(~integer); /* alternate implementation for demonstrational purposes: // 1.
...now, inversing the bits reveals the lowest zeros return 32 - clon(~integer) |0; */ } make these helper functions into asm.js module; then, you have a true performance masterpiece.
...now, inversing the bits reveals the lowest bits return 32 - clz(~integer) |0; } function ctron(integer) { // count trailing ones integer = integer | 0; // coerce to an integer return ctrz(~integer) |0; } // unfourtunately, asm.js demands slow crummy objects: return {a: ctrz, b: ctron}; })(window, null, null); var ctrz = counttrailsmethods.a; var ctron = counttrailsmethods.b; poly...
Object.defineProperty() - JavaScript
object.defineproperty(obj, 'key', withvalue('static')); // if freeze is available, prevents adding or // removing the object prototype properties // (value, get, set, enumerable, writable, configurable) (object.freeze || object)(object.prototype); examples if you want to see how to use the object.defineproperty method with a binary-flags-like syntax, see additional examples.
... var o = {}; object.defineproperty(o, 'a', { get() { return 1; }, configurable: false }); object.defineproperty(o, 'a', { configurable: true }); // throws a typeerror object.defineproperty(o, 'a', { enumerable: true }); // throws a typeerror object.defineproperty(o, 'a', { set() {} }); // throws a typeerror (set was undefined previously) object.defineproperty(o, 'a', { get() { return 1; } }); // throws a typeerror // (even though the new get does exactly the same thing) object.defineproperty(o, 'a', { value: 12 }); // throws a typeerror // ('value' can be changed when 'configurable' is false but not in this case due to 'get' accessor) console.log(o.a); // logs 1 delete o.a; // nothing happens console.log(o.a); // logs...
...however, if a non-writable value property is inherited, it still prevents from modifying the property on the object.
Object.freeze() - JavaScript
a frozen object can no longer be changed; freezing an object prevents new properties from being added to it, existing properties from being removed, prevents changing the enumerability, configurability, or writability of existing properties, and prevents the values of existing properties from being changed.
... in addition, freezing an object also prevents its prototype from being changed.
... the result of calling object.freeze(object) only applies to the immediate properties of object itself and will prevent future property addition, removal or value re-assignment operations only on object.
Object.seal() - JavaScript
the object.seal() method seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable.
...sealing an object prevents new properties from being added and marks all existing properties as non-configurable.
...making all properties non-configurable also prevents them from being converted from data properties to accessor properties and vice versa, but it does not prevent the values of data properties from being changed.
Object - JavaScript
(this is the reverse of object.entries).
... object.preventextensions() prevents any extensions of an object.
... object.seal() prevents other code from deleting properties of an object.
Promise.race() - JavaScript
if the iterable passed is empty, the promise returned will be forever pending.
...ray); // immediately logging the value of p console.log(p); // using settimeout we can execute code after the stack is empty settimeout(function(){ console.log('the stack is now empty'); console.log(p); }); // logs, in order: // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "fulfilled", <value>: 33 } an empty iterable causes the returned promise to be forever pending: var foreverpendingpromise = promise.race([]); console.log(foreverpendingpromise); settimeout(function(){ console.log('the stack is now empty'); console.log(foreverpendingpromise); }); // logs, in order: // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "pending" } if the iterable contains one or more non-promise value and/or an already settle...
...d promise, then promise.race will resolve to the first of these values found in the array: var foreverpendingpromise = promise.race([]); var alreadyfulfilledprom = promise.resolve(100); var arr = [foreverpendingpromise, alreadyfulfilledprom, "non-promise value"]; var arr2 = [foreverpendingpromise, "non-promise value", promise.resolve(100)]; var p = promise.race(arr); var p2 = promise.race(arr2); console.log(p); console.log(p2); settimeout(function(){ console.log('the stack is now empty'); console.log(p); console.log(p2); }); // logs, in order: // promise { <state>: "pending" } // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "fulfilled", <value>: 100 } // promise { <state>: "fulfilled", <value>: "non-promise value" } using promise.race – ex...
String.prototype.charAt() - JavaScript
h surrogate without following low surrogate'; } var next = str.charcodeat(i + 1); if (0xdc00 > next || next > 0xdfff) { throw 'high surrogate without following low surrogate'; } return str.charat(i) + str.charat(i + 1); } // low surrogate (0xdc00 <= code && code <= 0xdfff) if (i === 0) { throw 'low surrogate without preceding high surrogate'; } var prev = str.charcodeat(i - 1); // (could change last hex to 0xdb7f to treat high private // surrogates as single characters) if (0xd800 > prev || prev > 0xdbff) { throw 'low surrogate without preceding high surrogate'; } // we can pass over low surrogates now as the second component // in a pair which we have already processed return false; } in an ecmascript 2016 environment which...
...ogate without following low surrogate' } let next = str.charcodeat(i + 1) if (0xdc00 > next || next > 0xdfff) { throw 'high surrogate without following low surrogate' } return [str.charat(i) + str.charat(i + 1), i + 1] } // low surrogate (0xdc00 <= code && code <= 0xdfff) if (i === 0) { throw 'low surrogate without preceding high surrogate' } let prev = str.charcodeat(i - 1) // (could change last hex to 0xdb7f to treat high private surrogates // as single characters) if (0xd800 > prev || prev > 0xdbff) { throw 'low surrogate without preceding high surrogate' } // return the next character instead (and increment) return [str.charat(i + 1), i + 1] } fixing charat() to support non-basic-multilingual-plane (bmp) characters whi...
...le the previous example may be more useful for programs that must support non-bmp characters (since it does not require the caller to know where any non-bmp character might appear), in the event that one does wish, in choosing a character by index, to treat the surrogate pairs within a string as the single characters they represent, one can use the following: function fixedcharat(str, idx) { let ret = '' str += '' let end = str.length let surrogatepairs = /[\ud800-\udbff][\udc00-\udfff]/g while ((surrogatepairs.exec(str)) != null) { let lastidx = surrogatepairs.lastindex if (lastidx - 2 < idx) { idx++ } else { break } } if (idx >= end || idx < 0) { return '' } ret += str.charat(idx) if (/[\ud800-\udbff]/.test(ret) && /[\udc00-\udfff]/.t...
Image file type and format guide - Web media technologies
abbreviation file format mime type file extension(s) browser compatibility apng animated portable network graphics image/apng .apng chrome, edge, firefox, opera, safari bmp bitmap file image/bmp .bmp chrome, edge, firefox, internet explorer, opera, safari gif graphics interchange format image/gif .gif chrome, edge, firefox, i...
....png chrome, edge, firefox, internet explorer, opera, safari svg scalable vector graphics image/svg+xml .svg chrome, edge, firefox, internet explorer, opera, safari tiff tagged image file format image/tiff .tif, .tiff none built-in; add-ons required webp web picture format image/webp .webp chrome, edge, firefox, opera the abbreviation for each format links to a longer description of the format, its capabilities, and detailed browser compatibility information; including which versions introduced support and specific special features that may have been introduced later.
... bmp (bitmap file) the bmp (bitmap image) file type is most prevalent on windows computers, and is generally used only for special cases in web apps and content.
Progressive loading - Progressive web apps (PWAs)
previous overview: progressive web apps in previous articles we covered apis that help us make our js13kpwa example a progressive web app: service workers, web manifests, notifications and push.
... intersection observer this is a progressive enhancement to the previously working example — intersection observer will load target images only when the user scrolls down, causing them to display in the viewport.
... previous overview: progressive web apps ...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
previous overview: progressive web apps next now that we’ve seen what the structure of js13kpwa looks like and have seen the basic shell up and running, let's look at how the offline capabilities using service worker are implemented.
... self.addeventlistener('install', (e) => { e.waituntil( caches.open('js13kpwa-v2').then((cache) => { return cache.addall(contenttocache); }) ); }); a new service worker is installed in the background, and the previous one (v1) works correctly up until there are no pages using it — the new service worker is then activated and takes over management of the page from the old one.
... previous overview: progressive web apps next ...
accumulate - SVG: Scalable Vector Graphics
it is frequently useful for repeated animations to build upon the previous results, accumulating with each iteration.
... this attribute said to the animation if the value is added to the previous animated attribute's value on each iteration.
... four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> usage notes value none | sum default value none animatable no sum specifies that each repeat iteration after the first builds upon the last value of the previous iteration.
in - SVG: Scalable Vector Graphics
WebSVGAttributein
the value can be either one of the six keywords defined below, or a string which matches a previous result attribute value within the same <filter> element.
...if no value is provided and this is a subsequent filter primitive, then this filter primitive will use the result from the previous filter primitive as its input.
...atrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <fegaussianblur>, <femergenode>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile> usage notes value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes sourcegraphic this keyword represents the graphics elements that were the original input into the <filter> element.
in2 - SVG: Scalable Vector Graphics
WebSVGAttributein2
value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes fecomposite for <fecomposite>, in2 defines the second input image to the compositing operation.
... value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes fedisplacementmap for <fedisplacementmap>, in2 defines the second input image, which is used to displace the pixels in the image defined in the in attribute.
... value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes specifications specification status comment filter effects module level 1the definition of 'in2 for <fedisplacementmap>' in that specification.
rotate - SVG: Scalable Vector Graphics
WebSVGAttributerotate
usage notes value auto | auto-reverse | <number> default value 0 animatable no the auto and auto-reverse values allow the animated element's rotation to change dynamically as it travels along the path.
...if the value is auto-reverse, it turns its left-hand side in the current direction of motion.
...ite" rotate="auto"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> <g transform="translate(200, 0)"> <use href="#themotionpath"/> <!-- blue arrow which will rotate backwards along the motion path --> <path fill="blue" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="auto-reverse"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> <g transform="translate(300, 0)"> <use href="#themotionpath"/> <!-- purple arrow which will have a static rotation of 210 degrees --> <path fill="purple" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indefinite" rotate="210"> <...
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalreview, svg, types, data types svg makes use of a number of data types.
...this additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space.
... 379 scripting graphics, svg, scripting, default, eventlisteners, preventing, setproperty one can override default browser behaviors with the evt.preventdefault( ) method, add eventlisteners to objects with the syntax element.addeventlistener(event, function, usecapture), and set element properties with syntax svgelement.style.setproperty("fill-opacity", "0.0", "").
Basic Transformations - SVG: Scalable Vector Graphics
« previousnext » now we're ready to start distorting our beautiful images.
...to combine several transformations, one can set the resulting matrix directly with the matrix(a, b, c, d, e, f) transformation which maps coordinates from a previous coordinate system into a new coordinate system by {xnewcoordsys=axprevcoordsys+cyprevcoordsys+eynewcoordsys=bxprevcoordsys+dyprevcoordsys+f\left{ \begin{matrix} x_{\mathrm{prevcoordsys}} = a x_{\mathrm{newcoordsys}} + c y_{\mathrm{newcoordsys}} + e \\ y_{\mathrm{prevcoordsys}} = b x_{\mathrm{newcoordsys}} + d y_{\mathrm{newcoordsys}} + f \end{matrix} \right.
... « previousnext » ...
Clipping and masking - SVG: Scalable Vector Graphics
« previousnext » erasing part of what one has created might at first sight look contradictory.
...for reverting a previously set display: none it is important to know, that the initial value for all svg elements is inline.
... « previousnext » ...
Getting started - SVG: Scalable Vector Graphics
« previousnext » a simple example let us dive straight in with a simple example.
...the globally valid rule for svg files is, that later elements are rendered atop previous elements.
... « previousnext » ...
Gradients in SVG - SVG: Scalable Vector Graphics
« previousnext » perhaps more exciting than just fills and strokes is the fact that you can also create and apply gradients as either fills or strokes.
..."reflect" causes the gradient to continue on, but reflected in reverse, starting with the color offset at 100% and moving back to the offset at 0%, and then back up again.
... « previousnext » ...
Certificate Transparency - Web security
potentially malicious certificates, such as those that violate the ca/b forum baseline requirements, can be detected and revoked much more quickly.
...users will be prevented from visiting sites using non-compliant tls certificates.
... chrome had previously required ct inclusion for extended validation (ev) and symantec-issued certificates.
Subdomain takeovers - Web security
you must cut power at the breaker or fuse box (dns) to prevent the outlet from being used by someone else.
... how can i prevent them?
... preventing subdomain takeovers is a matter of order of operations in lifecycle management for virtual hosts and dns.
Axes - XPath
WebXPathAxes
this axis can be abbreviated with the at sign (@).
...it can be abbreviated as two periods (..).
...it can be abbreviated as a single period (.).
Index - XPath
WebXPathIndex
this axis can be abbreviated with the at sign (@).
...it can be abbreviated as two periods (..).
...it can be abbreviated as a single period (.).
Understanding WebAssembly text format - WebAssembly
thus you could rewrite our previous signature like so: (func (param $p1 i32) (param $p2 f32) (local $loc f64) …) and then could write local.get $p1 instead of local.get 0, etc.
... for example, local.get is defined to push the value of the local it read onto the stack, and i32.add pops two i32 values (it implicitly grabs the previous two values pushed onto the stack), computes their sum (modulo 2^32) and pushes the resulting i32 value.
...the index provided is 0 — again, it implicitly pops the previous value off the stack.
Communicating With Other Scripts - Archive of obsolete content
sages from the content script: <!doctype html> <html> <head></head> <body> <script> window.addeventlistener('message', function(event) { window.alert(event.data); // message from content script }, false); </script> </body> </html> messaging from page script to content script sending messages from the page script to the content script is just the same, but in reverse.
...ng" : "hello world"}; var cloned = cloneinto(greeting, document.defaultview); var event = document.createevent('customevent'); event.initcustomevent("addon-message", true, true, cloned); document.documentelement.dispatchevent(event); } messaging from page script to content script sending messages using custom dom events from the page script to the content script is just the same, but in reverse.
Communicating using "port" - Archive of obsolete content
var pagemodscript = "window.addeventlistener('click', function(event) {" + " self.port.emit('click', event.target.tostring());" + " event.stoppropagation();" + " event.preventdefault();" + "}, false);" + "self.port.on('warning', function(message) {" + "window.alert(message);" + "});" var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.port.on('click', function(html) { worker.port.emit('warning'...
... due to bug 816272 the page-mod's removelistener() function does not prevent the listener from receiving messages that are already queued.
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 supposed to be private.
... from weakmap to namespace in the previous section, a separate weakmap was used to associate each private property with an object.
XUL Migration Guide - Archive of obsolete content
low-level modules like xhr, tab-browser and window-utils are much more powerful than the modules in addon-kit, so your add-on needs correspondingly more rigorous security design and review.
...ory, we can rewrite main.js to use it as follows: require("sdk/ui/button/action").actionbutton({ id: "xpcom-example", label: "hello from xpcom", icon: "./icon-16.png", onclick: function() { require("./alert").alert("my add-on", "hello from xpcom"); } }); one of the benefits of this is that we can control which parts of the add-on are granted chrome privileges, making it easier to review and secure the code.
context-menu - Archive of obsolete content
likewise, any items that were previously in the menu but are not bound to the current context are automatically removed from the menu.
...this makes your code easier to maintain, secure, debug and review.
page-mod - Archive of obsolete content
this makes your code easier to maintain, secure, debug and review.
...this makes your code easier to maintain, secure, debug and review.
timers - Archive of obsolete content
example var { settimeout } = require("sdk/timers"); settimeout(function() { // do something in 0 ms }, 0) cleartimeout(id) given an id returned from settimeout(), prevents the callback with the id from being called (if it hasn't yet been called).
... example var { setinterval } = require("sdk/timers"); setinterval(function() { // do something every 1 sec }, 1000) clearinterval(id) given an id returned from setinterval(), prevents the callback with the id from being called again.
places/bookmarks - Archive of obsolete content
save(bookmarks).on("data", function (saved, input) { // a data event is called once for each item saved, as well // as implicit items, like `group` console.log(input === group || ~bookmarks.indexof(input)); // true }).on("end", function (saves, inputs) { // like the previous example, the "end" event returns an // array of all of our updated saves.
... updating items: for an item referenced from a previous save() or from the result of a search() query, changing the properties and calling save() will update the item on the server.
cfx - Archive of obsolete content
use this flag to reverse that behavior: if this flag is set and the add-on includes its own copies of the sdk modules, then the add-on will use the sdk modules in the add-on, not the ones built into firefox.
... use this flag to reverse that behavior: if this flag is set and the add-on includes its own copies of the sdk modules, then the add-on will use the sdk modules in the add-on, not the ones built into firefox.
Creating Event Targets - Archive of obsolete content
it duplicates the previous code, but with a few changes: import emit(), on(), once(), and off() from event/core replace listener functions with calls to emit(), passing the appropriate event type export its own event api.
...in its initialize() function, we: call the base class initializer use merge() to copy any supplied options into the newly created object call createobserver(), passing in the newly created object as the event target createobserver() is the same as in the previous example, except that in emit() we pass the newly created bookmarkmanager as the event target to use this event target we can create it and call the on(), once(), and removelistener() functions that it has inherited: var bookmarks = require("./bookmarks"); var bookmarkmanager = bookmarks.bookmarkmanager({}); function logadded(uri) { console.log("added: " + uri); } function logvisited(ur...
File I/O - Archive of obsolete content
use nsifile directly wherever possible.
... // you can read it into a string with var data = netutil.readinputstreamtostring(inputstream, inputstream.available()); }); read with content type hint it's useful to provide a content type hint to prevent the file system from doing a potentially expensive content type look up (which would be synchronous i/o).
Miscellaneous - Archive of obsolete content
addeventlistener("blur", function(e) {onblurinput(e);}, false); } } function onfocusinput(focusevent) { focusedcontrol = focusevent.originaltarget; } function onblurinput(blurevent) { focusedcontrol = null; } or var element = document.commanddispatcher.focusedelement; inserting text at the cursor function inserttext(element, snippet) { var selectionend = element.selectionstart + snippet.length; var currentvalue = element.value; var beforetext = currentvalue.substring(0, element.selectionstart); var aftertext = currentvalue.substring(element.selectionend,...
...bserver topic: observerservice.addobserver(observer, 'http-on-modify-request', false); where "observer" is an object that has a method "observe": function observe(subject, topic, data) { subject.queryinterface(components.interfaces.nsiuploadchannel); postdata = subject.uploadstream; } here again, postdata is not a string, but an nsiinputstream, so you can use the last code snippet of the previous section to get the data as a string.
Preferences - Archive of obsolete content
var value = prefs.getboolpref("typeaheadfind"); // get a pref (accessibility.typeaheadfind) prefs.setboolpref("typeaheadfind", !value); // set a pref (accessibility.typeaheadfind) complex types as noted in the previous section, each entry in the preferences database (prefs.js) must have a string, an integer, or a boolean value.
...e observing (after appropriate qi) // adata is the name of the pref that's been changed (relative to asubject) switch (adata) { case "pref1": // extensions.myextension.pref1 was changed break; case "pref2": // extensions.myextension.pref2 was changed break; } } } myprefobserver.register(); and next, here is a more evolved version of the previous code better fit for code reuse both within a project and across projects (for example, using javascript code modules): /** * @constructor * * @param {string} branch_name * @param {function} callback must have the following arguments: * branch, pref_leaf_name */ function preflistener(branch_name, callback) { // keeping a reference to the observed preference branch or it will get /...
Rosetta - Archive of obsolete content
|*| http://www.gnu.org/licenses/gpl-3.0.html |*| |*| syntax: |*| |*| rosetta.appendcompiler([ "text/x-csrc", "text/x-c" ], yourcompiler); |*| \*/ var rosetta = new (function () { function createscript (oscript, oxhr200) { var smimetype = oscript.getattribute("type").tolowercase(), obaton = document.createcomment(" the previous code has been automatically translated from \"" + smimetype + "\" to \"text/ecmascript\".
...the previous example shows a possible solution for all these cases, from the simplest to the hardest one.
StringView - Archive of obsolete content
|*| |*| :: number.isinteger() polyfill :: |*| |*| /docs/web/javascript/reference/global_objects/number/isinteger |*| \*/ if (!number.isinteger) { number.isinteger = function isinteger (nval) { return typeof nval === "number" && isfinite(nval) && nval > -9007199254740992 && nval < 9007199254740992 && math.floor(nval) === nval; }; } /*\ |*| |*| stringview mdndeveloper network |*| |*| revision #12, march 21st, 2017 |*| |*| https://developer.mozilla.org/add-ons/code_snippets/stringview |*| https://developer.mozilla.org/docs/user:fusionchess |*| https://github.com/madmurphy/stringview.js |*| |*| this framework is released under the gnu lesser general public license, version 3 or later.
... clikeregexp("&nbsp;", "g"); alert(omystringview.replace(omyregexp, " ")); // "hello, strange people!\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" /* stringview.replace() will be different from string.replace() because it act also on the source: */ alert(omystringview); // "hello, strange people!\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" as you can see, the previous example needs you to create two new algorithms: the clikeregexp() constructor – a constructor of c-like regular expression objects – and stringview.prototype.replace() – the new method, able to act on stringview instances.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
here's a comprehensive looking guide that's gotten good reviews.
...personally i would discourage this practice (among other things, static linking means the same code gets loaded more than once into memory, and the code won't be available from javascript or other non-c++ languages) and encourage the use of xpcom wherever possible.
Jetpack Processes - Archive of obsolete content
unregisterreceiver(amessagename, areceiver) similar to nsijetpack.unregisterreceiver(), this function unregisters a callback previously registered with registerreceiver().
...to prevent such memory leaks, a process can either invalidate a handle, immediately preventing it from being passed as a message argument, or it can unroot the handle, allowing it to be passed as a message argument until all references to it are removed, at which point it is garbage collected.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
« previous this document was authored by taro (btm) matsuzawa and was originally published in japanese for the firefox developers conference summer 2007.
... fixme: figure a: gonzui 1 - http://quicknote.mozdev.org 2 - http://www5f.biglobe.ne.jp/~t-susumu/ 3 - reverse-polish notation.
Chapter 1: Introduction to Extensions - Archive of obsolete content
« previousnext » note: if you want contribute to this document please following guidelines from the contribute page.
... « previousnext » ...
Adding Events and Commands - Archive of obsolete content
« previousnext » event handlers just like with html, most javascript code execution is triggered by event handlers attached to dom elements.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Adding sidebars - Archive of obsolete content
« previousnext » the sidebar in firefox is a relatively large and flexible space to add rich interfaces without requiring new windows or complicated overlays.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Adding windows and dialogs - Archive of obsolete content
« previousnext » opening windows and dialogs to open a new window, use the javascript window.open function just like with html windows.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Appendix D: Loading Scripts - Archive of obsolete content
the examples below which make use of the services global assume that you're previously imported the services.jsm module.
...this behavior can be reversed by setting the wantsxrays parameter to false when constructing the sandbox.
Getting Started with Firefox Extensions - Archive of obsolete content
« previousnext » what's a firefox extension?
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
The Essentials of an Extension - Archive of obsolete content
« previousnext » the install.rdf file in the last section we looked at the contents of the hello world extension.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Search Extension Tutorial (Draft) - Archive of obsolete content
pref("browser.search.defaultenginename", "data:text/plain,browser.search.defaultenginename=example engine"); in the case or restartless extensions, the preferences need to be changed manually, and reverted when the extension is disabled if they have not been changed in the meantime.
...lue]] in iterator(savedprefs)) { if (defaultprefs.getcharpref(name) == value) defaultprefs.setcharpref(name, origvalue); } } function install() {} function uninstall() {} changing the default search engine this change comes in two parts: 1) installing a new search engine (and removing it when your extension is disabled), and 2) setting it as a default (and restoring the previous default when your extension is uninstalled).
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
with the wired news design process, the scenario was reversed.
...we were hoping to go all the way with the xhtml conversion, but our ad units and some other third-party content prevent us from doing so.
Index of archived content - Archive of obsolete content
tamarin acceptance test template actionscript performance tests cmdline tests running tamarin acceptance tests running tamarin performance tests tamarin build system documentation tamarin releases tamarin-central rev 703:2cee46be9ce0 tamarin roadmap tamarin build documentation tamarin mercurial commit hook the download manager schema the life of an html http request the new nsstring class implementation (1999) tracevis transforming xml with xslt:mozilla xslt transfo...
... displaying a graphic with audio samples fixing incorrectly sized list item markers fixing table inheritance in quirks mode issues arising from arbitrary-element hover mozilla's doctype sniffing parsing microformats in javascript popup window controls rdf in fifty words or less rdf in mozilla faq styling abbreviations and acronyms the business benefits of web standards using the right markup to invoke plugins windows media in netscape xquery xul booster xul parser in python input archive ...
Adding the structure - Archive of obsolete content
« previousnext » the ui for our extension is an icon in the status bar.
... « previousnext » ...
Conclusion - Archive of obsolete content
« previous you now have a working mozilla extension installer!
... « previous ...
Enabling the behavior - updating the status bar panel - Archive of obsolete content
when it finds a color, it sets the panel's status attribute to the corresponding status, which causes the previously defined css rules to switch to the icon appropriate for that status.
... « previousnext » ...
Tinderbox - Archive of obsolete content
the tool enables mozilla.org to be immediately notified of changes to the code that prevent mozilla from compiling and running (or compromise performance and footprint) so they can get someone to fix the problem or reverse the changes.
... « previousnext » ...
Getting Started - Archive of obsolete content
(yes, this means that the structure of your new directory and classic.jar will be slightly different.) creating the install files icon.png and preview.png these are some png images containing the icon and the preview of the theme.
...wing directory structure, using your favorite archive manager to create a zip archive: /chrome/my_theme.jar!/communicator/* /chrome/my_theme.jar!/editor/* /chrome/my_theme.jar!/global/* /chrome/my_theme.jar!/help/* /chrome/my_theme.jar!/messenger/* /chrome/my_theme.jar!/messenger-newsblog/* /chrome/my_theme.jar!/mozapps/* /chrome/my_theme.jar!/navigator/* /chrome.manifest /install.rdf /icon.png /preview.png make sure not to just zip up the my_theme parent directory since that will cause the drag and drop install in the next section to fail without error messages.
Creating a Microsummary - Archive of obsolete content
in each step of revising the transform sheet and other code in this tutorial, new material added will be shown in boldface so you can follow along more easily.
... by default, generators don't apply to any page, so you have to explicitly list the pages they apply to, and you don't have to exclude any pages unless you've previously included them.
In-Depth - Archive of obsolete content
values: normal, reverse -moz-image-region this is useful for dividing up an image into multiple smaller images.
...now you can point the image to wherever you like.
Installing Dehydra - Archive of obsolete content
building spidermonkey it is recommended that you use spidermonkey revision aurora_base_20110705 when building dehydra.
...mkdir gcc-objdir mkdir gcc-dist cd gcc-objdir ../gcc-4.5.3/configure --disable-bootstrap --enable-languages=c,c++ --prefix=$pwd/../gcc-dist make make install building dehydra and treehydra building dehydra requires spidermonkey development headers from the previous step.
Drag and Drop Example - Archive of obsolete content
« previous gecko 1.9.1 (firefox 3.5) and later supports a newer and simpler api.
... ondragover: function (event, flavour, session) {}, ondrop: function (event, dropdata, session) { if (dropdata.data != "") { var elem = document.createelement(dropdata.data); event.target.appendchild(elem); elem.setattribute("left", "" + event.pagex); elem.setattribute("top", "" + event.pagey); elem.setattribute("label", dropdata.data); } } }; « previous original document information author(s): neil deakin original document: http://xulplanet.com/tutorials/mozsdk/dragex.php copyright information: copyright (c) neil deakin ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
« previousnext » gecko 1.9.1 (firefox 3.5) and later supports a newer and simpler api.
... « previousnext » original document information author(s): neil deakin original document: http://xulplanet.com/tutorials/mozsdk/dragwrap.php copyright information: copyright (c) neil deakin ...
Layout FAQ - Archive of obsolete content
block(body)(1)@035ff490 {120,120,8820,600} [state=00000010] sc=035ff264(i=2,b=0)< line 035ffc18: count=1 state=inline,clean,prevmarginclean,not impacted,not wrapped,before:nobr,after:linebr[0x5100] {0,0,330,300} < inline(span)(0)@035ffa04 next=035ffc48 next-continuation=035ffc48 {0,7,330,285} [content=0359ed50] [sc=035ff990]< text(0)@035ffa8c[0,4,t] next=035ffb1c {0,0,330,285} [state=41600020] sc=035ffa3c pst=:-moz-non-element< "\nabc" > frame(br)(1)@035ffb1c {330,225,0,0} [state=00000020] [c...
...try using event.preventdefault() what is the purpose of the ns_lossyconvertucs2toascii() function?
Repackaging Firefox - Archive of obsolete content
we call this extension a "distro extension" (sometimes abbreviated as "dex"), because it is used to create a new "distribution" of firefox, with different branding, etc.
...check this if the homepage needs to be different from the default to prevent the migration wizard from overwriting it.
Tabs - Archive of obsolete content
ArchiveMozillaJetpackUITabs
blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded.
... urlurl to be openedstring jetpack.tabs.open("http://www.example.com/"); blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded.
Bundles - Archive of obsolete content
this can slow the overall launch time and the unpacking is redundant if the bundle has been launched previously.
... this is why the preferred method of launching is to use the "-webapp [webapp-id]" command line, which looks for the previously installed (unpacked) web application in the prism webapps/{webapp-id} folder.
Proxy UI - Archive of obsolete content
the previously selected radio button becomes unselected, and the related ui of the previous button is disabled (and is not editable).
...if configured, socks is used as a default: if the protocol was proxyable and did not match any of the previous protocols), then use socks.
compareTo - Archive of obsolete content
rev revision number.
... installversion.minor_diff installversion.rel_diff installversion.bld_diff installversion.equal installversion.major_diff_minus installversion.minor_diff_minus installversion.rel_diff_minus installversion.bld_diff_minus example this code uses the compareto method to determine whether or not version 3.2.1 of the royal airways software has been previously installed: existingvi = installtrigger.getversion("/royalairways/royalsw"); if ( existingvi.compareto("3.2.1") <= 0 ) { // ...
toString - Archive of obsolete content
returns the major, minor, revision, and build numbers represented as a single string.
...to get the version number out of an installversion object in order to compare it with other versions, you can call tostring() and get back the version as a string in the format "maj.min.rev.bld." example var vi = new installversion(); vi.init("999.888.777.666"); //random string vistring = vi.tostring(); ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
first, a quick scan of the contents of the xpi file (which you can open using with any unzip utility) reveals the following high-level directory structure: install.js bin\ chrome\ components defaults\ icons\ plugins\ res\ note that this high-level structure parallels the directory structure of the installed browser very closely: as you will see in the installation script, the contents of the archive are installed onto the file system in much the same way that they are stored in the ...
...in the example in the executing the installation section and in many places in the installation script, the logcomment api is used to write data to a log file that can then be reviewed when things don't go as planned.
dir - Archive of obsolete content
ArchiveMozillaXULAttributedir
reverse for scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales).
...this is reverse of the order in which they appear in the xul code.
close - Archive of obsolete content
if an event handler is placed on the window element, it can be prevented to close (see example below).
... example window.addeventlistener("close", function( event ) { // make the close button ineffective event.preventdefault(); }, false); ...
onFindAgainCommand - Archive of obsolete content
« xul reference home onfindagaincommand( findprevious ) return type: no return value call this method to handle your application's "find next" and "find previous" commands.
... you should specify true as the input parameter to perform a "find previous" operation, or false to perform a "find next." example typically, you'll simply bind this method to your "find next" and "find previous" commands, like this: <command name="cmd_find_previous" oncommand="gfindbar.onfindagaincommand(true);"/> <command name="cmd_find_next" oncommand="gfindbar.onfindagaincommand(false);"/> ...
openPopup - Archive of obsolete content
« xul reference home openpopup( anchor , position , x , y , iscontextmenu, attributesoverride, triggerevent ) return type: no return value opens the popup relative to a specified node at a specific location.
... triggerevent the event that triggered the popup (such as a mouse click, if the user clicked something to open the popup).
Methods - Archive of obsolete content
focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirstvisiblerow getindexofitem getitematindex getnextitem getnotificationbox getnotificationwithvalue getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto gotoindex goup hidepopup increase increasepage insertitem insertitemat invertselection loadgro...
...up loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwithflags removeallitems removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification removeprogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange selecttabatindex setselectionrange showpane showpopup sizeto starte...
ContextMenus - Archive of obsolete content
to cancel a context menu event, you can use the preventdefault method of the event object.
... function checkcontextmenu(event) { if (event.target.localname == "textbox") event.preventdefault(); } function init() { var container = document.getelementbyid("container"); container.addeventlistener("contextmenu", checkcontextmenu, true); } the 'checkcontextmenu' function checks to see if the textbox was the target of the context menu and, if so, cancels the event using the preventdefault method.
MenuItems - Archive of obsolete content
one possibility is to simply reverse the checkbox state again.
...note that the code has been reversed in the condition blocks to hide the toolbar when the menuitem is checked and show the toolbar when the menuitem is not checked because the checked state hasn't been modified.
Menus - Archive of obsolete content
the example below has the same effect as the previous example, however it uses a command element instead of listening to the command event directly.
... it should be noted that setting the active item in this way will not affect the selected property or selected attribute of the previously and newly activated item.
Sorting and filtering a custom tree view - Archive of obsolete content
this is useful if this is an editable table //to prevent the user from losing the row they edited var topvisiblerow = null; if (table) { topvisiblerow = gettopvisiblerow(); } if (data == null) { //put object loading code here.
...1 : -1; //if the column is passed and it's already sorted by that column, reverse sort if (column) { columnname = column.id; if (tree.getattribute("sortresource") == columnname) { order *= -1; } } else { columnname = tree.getattribute("sortresource"); } function columnsort(a, b) { if (prepareforcomparison(a[columnname]) > prepareforcomparison(b[columnname])) return 1 * order; if (prepareforcomparison(a[columnname]) < prepareforcomparison(b[columnname]))...
Additional Template Attributes - Archive of obsolete content
« previousnext » referencing templates all the templates used so far have had the template placed inside the root element with the datasources attribute.
... « previousnext » ...
Attribute Substitution - Archive of obsolete content
« previousnext » so far, attribute replacement in an action body has been used to replace an entire attribute with the value of a variable.
... « previousnext » ...
Building Hierarchical Trees - Archive of obsolete content
« previousnext » a template may be used to generate hierarchical trees.
...ml" rows="10" flags="dont-build-content"> <treecols> <treecol id="name" primary="true" label="name" flex="1"/> </treecols> <template> <query expr="*"/> <action> <treechildren> <treeitem uri="?"> <treerow> <treecell label="?name"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> « previousnext » ...
Building Trees - Archive of obsolete content
« previousnext » the most common element to use with a template is the tree.
... « previousnext » ...
RDF Query Syntax - Archive of obsolete content
« previousnext » let's look at a simple query with two statements.
... « previousnext » ...
Result Generation - Archive of obsolete content
« previousnext » rdf in this section, we'll look at generating template output using rdf datasources.
... « previousnext » ...
Rule Compilation - Archive of obsolete content
« previousnext » query a xul template is made up of a query and a series of rules.
... « previousnext » ...
SQLite Templates - Archive of obsolete content
« previousnext » templates may use a datasource that is retrieved from an sqlite database, such as those used by the mozstorage api.
... « previousnext » ...
Simple Query Syntax - Archive of obsolete content
« previousnext » when iterating over the children of an rdf container, there is a simpler query syntax which may used.
... « previousnext » ...
Template Builder Interface - Archive of obsolete content
« previousnext » when inserting an element into a xul document, the element is checked to see if it has a datasources attribute.
... « previousnext » ...
Template and Tree Listeners - Archive of obsolete content
« previousnext » there are several listeners (or observers) used during the template build process, each used for different purposes.
... « previousnext » ...
Using Multiple Queries to Generate More Results - Archive of obsolete content
« previousnext » combining results together one interesting technique is to use several queries to combine two sets of unrelated data together.
... <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <queryset> <query expr="group[@name='male']/*"/> <action> <checkbox uri="?" label="?name"/> </action> </queryset> <queryset> <query expr="group[@name='female']/*"/> <action> <label uri="?" value="?name"/> </action> </queryset> </template> </vbox> « previousnext » ...
XML Templates - Archive of obsolete content
« previousnext » mozilla also supports the use of xml datasources.
... « previousnext » ...
Adding HTML Elements - Archive of obsolete content
« previousnext » now that we've added some buttons, let's add some other elements.
... « previousnext » ...
Adding Labels and Images - Archive of obsolete content
« previousnext » this section describes a way to add labels and images to a window.
... « previousnext » ...
Adding Methods to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add custom methods to xbl-defined elements.
... « previousnext » ...
Adding more elements - Archive of obsolete content
« previousnext » we will conclude the discussion of boxes by adding some boxes to the find files dialog.
... « previousnext » ...
Adding Properties to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add custom properties to xbl-defined elements.
... « previousnext » ...
Adding Style Sheets - Archive of obsolete content
« previousnext » we have hardly modified the look of the elements we have created so far.
... « previousnext » ...
Advanced Rules - Archive of obsolete content
« previousnext » this section describes the more advanced rule syntax.
... « previousnext » ...
Anonymous Content - Archive of obsolete content
« previousnext » in this section we'll look at creating content with xbl.
... « previousnext » ...
Commands - Archive of obsolete content
« previousnext » a command is an operation which may be invoked.
... « previousnext » ...
Creating Dialogs - Archive of obsolete content
« previousnext » a xul application will often require dialogs to be displayed.
... « previousnext » ...
Creating a Skin - Archive of obsolete content
« previousnext » this documentation has not updated for firefox quantum.
... « previousnext » ...
Creating a Wizard - Archive of obsolete content
« previousnext » many applications use wizards to help the user through complex tasks.
... « previousnext » ...
Creating an Installer - Archive of obsolete content
« previousnext » this section will describe packaging a xul application into an installer.
... « previousnext » ...
Custom Tree Views - Archive of obsolete content
« previousnext » the tree view holds the data to be displayed in the tree.
... « previousnext » ...
Features of a Window - Archive of obsolete content
« previousnext » we've already seen some features of windows.
... « previousnext » ...
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
« previousnext » xul has a set of elements for creating tabular grids.
... « previousnext » ...
Groupboxes - Archive of obsolete content
« previousnext » this section describes a way to include elements into groups groupboxes the groupbox element is used to group related xul elements together, much like the html fieldset element is used to group html elements.
... « previousnext » ...
Input Controls - Archive of obsolete content
« previousnext » xul has elements that are similar to the html form controls.
... « previousnext » looking for a guide to using input controls and forms on the web?
Install Scripts - Archive of obsolete content
« previousnext » this section describes the install script.
... « previousnext » ...
Introduction to RDF - Archive of obsolete content
« previousnext » in this section, we'll look at rdf (resource description framework).
... « previousnext » ...
Introduction to XBL - Archive of obsolete content
« previousnext » xul has a sister language, xbl (extensible bindings language).
... « previousnext » ...
Keyboard Shortcuts - Archive of obsolete content
« previousnext » you could use keyboard event handlers to respond to the keyboard.
... « previousnext » ...
Localization - Archive of obsolete content
this means that wherever the text "&findlabel;" appears in the xul file, it will be replaced with the text "find".
... « previousnext » see also how to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: bootstrapped extensions :: localization (l10n) ...
Modifying the Default Skin - Archive of obsolete content
« previousnext » as of firefox 69, you must set the toolkit.legacyuserprofilecustomizations.stylesheets preference to true in about:config in order to load userchrome.css or usercontent.css files.
... « previousnext » ...
More Tree Features - Archive of obsolete content
« previousnext » here, we'll see more features of trees.
... « previousnext » ...
Open and Save Dialogs - Archive of obsolete content
« previousnext » a common type of dialog is one where the user can select a file to open or save.
... « previousnext » ...
Persistent Data - Archive of obsolete content
« previousnext » this section describes how to save the state of a xul window.
... « previousnext » ...
Popup Menus - Archive of obsolete content
« previousnext » in the last section, we looked at creating a menu on a menu bar.
... « previousnext » ...
Progress Meters - Archive of obsolete content
« previousnext » in this section, we'll look at creating progress meters.
... « previousnext » ...
Property Files - Archive of obsolete content
« previousnext » in a script, entities cannot be used.
... « previousnext » see also how to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: bootstrapped extensions :: localization (l10n) ...
RDF Datasources - Archive of obsolete content
« previousnext » here, we'll look at additional datasources and how to use your own rdf files as datasources.
... « previousnext » ...
Scroll Bars - Archive of obsolete content
« previousnext » now, let's find out to add scroll bars to a window.
... « previousnext » ...
Scrolling Menus - Archive of obsolete content
« previousnext » this section will describe scrolling menus and how to use the mechanism with other elements.
... « previousnext » ...
Simple Menu Bars - Archive of obsolete content
« previousnext » in this section, we'll see how to create a menu bar with menus on it.
... « previousnext » ...
Splitters - Archive of obsolete content
« previousnext » we'll now look at how to add splitters to a window.
... « previousnext » ...
Stack Positioning - Archive of obsolete content
« previousnext » this section will describe how to position items in a stack.
... « previousnext » ...
Stacks and Decks - Archive of obsolete content
« previousnext » there may be need to display elements as a set of overlapping cards.
... « previousnext » ...
The Chrome URL - Archive of obsolete content
« previousnext » the following section will describe how to refer to xul documents and other chrome files.
... « previousnext » ...
Toolbars - Archive of obsolete content
« previousnext » a toolbar is usually placed along the top of a window and contains a number of buttons that perform common functions.
... « previousnext » ...
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
« previousnext » xul provides a way to create tabular or hierarchical lists using a tree.
... « previousnext » ...
Updating Commands - Archive of obsolete content
« previousnext » in this section, we will look at how to update commands.
... « previousnext » ...
Using Spacers - Archive of obsolete content
« previousnext » in this section, we will find out how to add some spacing in between the elements we have created.
... « previousnext » ...
XBL Attribute Inheritance - Archive of obsolete content
« previousnext » in this section we'll see how attributes can be inherited.
... « previousnext » ...
XBL Inheritance - Archive of obsolete content
« previousnext » in this section, we'll look at how to extend existing xbl definitions.
... « previousnext » ...
XPCOM Examples - Archive of obsolete content
« previousnext » this section provides some examples of using xpcom along with some additional interfaces.
... « previousnext » ...
XPCOM Interfaces - Archive of obsolete content
« previousnext » in this section, we'll take a brief look at xpcom (cross-platform component object model), which is the object system that mozilla uses.
... « previousnext » ...
XUL Structure - Archive of obsolete content
« previousnext » we'll begin by looking at how the xul is handled in mozilla.
... « previousnext » ...
Using Visual Studio as your XUL IDE - Archive of obsolete content
that has to do with the way mozilla implemented localization: < !doctype window system "chrome://loomo/locale/main.dtd"> visual studio doesn't recognize the chrome uri prefix, what will give you an error at the previous line ("the uri prefix is not recognized").
... as vs doesn't know how the chrome protocol works it can't detect where the dtd file is really located and thus will give you errors wherever you use the entities that are declared in this file.
dropmarker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a dropmarker is a button with an arrow which will reveal more details when pressed.
...for instance the menulist and the popup type of datepicker use a dropmarker, that when pressed, will reveal a popup menu.
preference - Archive of obsolete content
inverted type: boolean for boolean preferences, if this attribute is set to true, it indicates that the value of the preference is the reverse of the user interface element attached to it.
... locked type: boolean if true, the preference has been locked and disabled in the system configuration, preventing the value from being changed.
scale - Archive of obsolete content
ArchiveMozillaXULscale
reverse for scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales).
...this is reverse of the order in which they appear in the xul code.
tabbrowser - Archive of obsolete content
gobackgroup() not in firefox return type: no return value returns to the previous group of tabs.
...if the event argument is supplied, the default event handling will be prevented and propagation stopped.
tree - Archive of obsolete content
ArchiveMozillaXULtree
it is similar to the previous type but is used when the tree does not have dont-build-content in its flags attribute.
...otherwise the cell label is reverted to the value it had prior to editing.
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
xulrunner 1.8.0.1 is the first stable developer preview release of xulrunner.
...this is a developer preview release: additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases.
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
xulrunner 1.8.0.4 is a stable developer preview of the mozilla xulrunner application framework.
...this is a developer preview release: additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases.
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
ription: xul runner runtime; types: full custom [tasks] name: desktopicon; description: {cm:createdesktopicon}; groupdescription: {cm:additionalicons}; flags: unchecked name: quicklaunchicon; description: {cm:createquicklaunchicon}; groupdescription: {cm:additionalicons}; flags: unchecked [files] source: c:\develop\xulrunnerinstaller\myapp\myapp.exe; destdir: {app}; components: main; flags: ignoreversion source: c:\develop\xulrunnerinstaller\myapp\application.ini; destdir: {app}; components: main; flags: ignoreversion source: c:\develop\xulrunnerinstaller\myapp\chrome\*; excludes: .svn; destdir: {app}\chrome; components: main; flags: ignoreversion recursesubdirs createallsubdirs source: c:\develop\xulrunnerinstaller\myapp\defaults\*; excludes: .svn; destdir: {app}\defaults; components: main...
...; flags: ignoreversion recursesubdirs createallsubdirs source: c:\develop\xulrunnerinstaller\myapp\xulrunner\*; destdir: {app}\xulrunner; components: runtime; flags: ignoreversion recursesubdirs createallsubdirs ; note: don't use "flags: ignoreversion" on any shared system files [icons] name: {group}\my app; filename: {app}\myapp.exe name: {group}\{cm:uninstallprogram,xul explorer}; filename: {uninstallexe} name: {userdesktop}\my app; filename: {app}\myapp.exe; tasks: desktopicon name: {userappdata}\microsoft\internet explorer\quick launch\my app; filename: {app}\myapp.exe; tasks: quicklaunchicon [run] filename: {app}\myapp.exe; description: {cm:launchprogram,my app}; onlybelowversion: 0,6; flags: nowait postinstall skipifsilent step 4: building an installer once your script is ready, s...
Deploying XULRunner - Archive of obsolete content
current xulrunner is a stable developer preview release.
... linux most linux applications are distributed as simple .tar.bz2 archives which can be unpacked by the user wherever they wish.
Dialogs in XULRunner - Archive of obsolete content
« previous the last article in this series covered some simple xul for creating windows, menus, and toolbars.
... see also dialog xul tutorial:creating dialogs nsifilepicker xul tutorial:open and save dialogs « previous original document information author: mark finkle last updated date: october 2, 2006 ...
Getting started with XULRunner - Archive of obsolete content
on windows, i created the root in a new c:\program files\myapp folder, but you can create it wherever you like, using whatever os you like.
... note: in xulrunner 2.0, the chrome.manifest is now used to register xpcom components in addition to its previous uses.
Windows and menus in XULRunner - Archive of obsolete content
« previousnext » our quest to build a basic desktop application using xulrunner continues.
... see also xul:windows xul tutorial:creating a window commandset command xul tutorial:commands xul tutorial:simple menu bars xul tutorial:toolbars « previousnext » original document information author: mark finkle last updated date: october 2, 2006 ...
application/http-index-format specification - Archive of obsolete content
note that multiple 200 lines override previous 200 lines.
...a valid 201 line consists of one or more white space separated tokens that represent data described by a previous 200 line.
Gecko Compatibility Handbook - Archive of obsolete content
review your results the following scenarios all relate to browser detection.
...correct any errors and replace proprietary code wherever possible.
2006-12-01 - Archive of obsolete content
basic feature that i think is a must in any web broswer a discussion revolving around the idea of having firefox automatically convert mistaken non-english characters to english so that web addresses will be completed.
... mozstorage documentation up a revisted discussion surround the mozstorage documentation.
2006-10-20 - Archive of obsolete content
discussions october 16, 2006, 5:10pm - david marteau notes that using "persist" on templatized content prevents from restoring values for the persistent attributes.
... neil notes that the format of localstore has changed from previous versions and that "persist" is not functioning properly using the new format.
NPEvent - Archive of obsolete content
values: 0 nullevent 1 mousedown 2 mouseup 3 keydown 4 keyup 5 autokey 6 updateevt 7 diskevt 8 activateevt 15 osevt 23 khighlevelevent getfocusevent 0, 1 (true, false) losefocusevent adjustcursorevent 0, 1 (true, false) for information about these events, see the mac os developer documentation.
... adjustcursorevent: sent when the mouse enters or leaves the bounds of the instance.
NPP_New - Archive of obsolete content
saved pointer to data saved by npp_destroy for a previous instance of this plug-in at the same url.
... if instance data was saved from a previous instance of the plug-in by the npp_destroy function, it is returned in the saved parameter for the current instance to use.
NPP_URLNotify - Archive of obsolete content
notifydata plug-in-private value for associating a previous npn_geturlnotify() or npn_posturlnotify() request with a subsequent npp_urlnotify() call.
... the parameter notifydata is the plug-in-private value passed as an argument by a previous npn_geturlnotify() or npn_posturlnotify() call, and can be used as an identifier for the request.
Encryption and Decryption - Archive of obsolete content
with most modern cryptography, the ability to keep encrypted information secret is based not on the cryptographic algorithm, which is widely known, but on a number called a key that must be used with the algorithm to produce an encrypted result or to decrypt previously encrypted information.
... as it happens, the reverse of the scheme shown in figure 2 also works: data encrypted with your private key can be decrypted only with your public key.
TCP/IP Security - Archive of obsolete content
the payload consists of the information passed down from the previous layer, while the header contains layer-specific information such as addresses.
... as previously explained, data is passed from the highest to the lowest layer, with each layer adding more information.
Sunbird Theme Tutorial - Archive of obsolete content
making an icon and preview the themes window can display an icon and a preview graphic.
...make an image file about 200 by 100 pixels, and save it as <tt>preview.png</tt> in your theme directory.
Building a Theme - Archive of obsolete content
an example of the content within a typical xpi file for a theme: example.xpi: /install.rdf /chrome.manifest /preview.png /icon.png /chrome/ browser/ communicator/ global/ mozapps/ we'll want to create a file structure similar to the one above for our tutorial, so let's begin by creating a folder for your theme somewhere on your hard disk (e.g.
...the file preview.png is shown as a preview of the theme in the themes panel of the add-ons window.
Theme changes in Firefox 4 - Archive of obsolete content
then copy all of icon.png, install.rdf and preview.png from <firefox-app-bundle>/contents/macos/extensions/{...} into my_theme.
...e/browser/ skin communicator classic/1.0 chrome/communicator/ skin global classic/1.0 chrome/global/ skin mozapps classic/1.0 chrome/mozapps/ this results in the following structure : /my_theme/chrome/browser/* /my_theme/chrome/communicator/* /my_theme/chrome/global/* /my_theme/chrome/mozapps/* /my_theme/chrome.manifest /my_theme/icon.png /my_theme/install.rdf /my_theme/preview.png note: for more information (and how to package into a jar) consult creating a skin for firefox which still mostly applies.
References - Archive of obsolete content
<- previous section: summary of changes you can learn more on using web standards from these sites (listed in no particular order): what are web standards and why should i use them?
... <- previous section: summary of changes ...
Using the W3C DOM - Archive of obsolete content
« previousnext » the document object has properties for accessing collections of elements, such as document.images and document.forms.
...he dom whitespace in the dom by david baron element.innerhtml speed and performance comparison between innerhtml attribute and dom's nodevalue when modifying the text data of a text node by gérard talbot interactive dom level 2 characterdata interface attributes and methods tests: other ways to modify (replace, delete, manipulate) efficiently text nodes in the dom by gérard talbot <- previous section: using web standards: how next section: developing cross-browser pages -> ...
-moz-stack-sizing - Archive of obsolete content
/* keyword values */ -moz-stack-sizing: auto; -moz-stack-sizing: ignore; /* global values */ -moz-stack-sizing: inherit; -moz-stack-sizing: initial; -moz-stack-sizing: unset; if you wish to prevent the stack from resizing automatically to accommodate its children, you can set -moz-stack-sizing to ignore on the child element.
... note: in previous versions of gecko it was possible to work around the problem by setting very large negative bottom and right margins on the stack element and equally large positive bottom and right margins on the children whose size you didn't want to ignore.
CSS - Archive of obsolete content
ArchiveWebCSS
a slider control is one possible representation of <input type="range">.::-ms-revealthe ::-ms-reveal css pseudo-element is a microsoft extension that is used to display a password reveal button for use with a password field created by <input type="password">.
... the user presses the button to reveal the actual field value rather than asterisks.::-ms-thumbthe ::-ms-thumb css pseudo-element is a microsoft extension that represents the thumb that the user moves within the track of a slider control to alter its numerical value.
Descendants and Filters - Archive of obsolete content
« previousnext » accessing descendants in many cases, the node that you're interested in is not the direct child of the top xml element.
... « previousnext » ...
Introduction - Archive of obsolete content
« previousnext » basic syntax with e4x enabled, basic xml elements are valid syntax for variables.
... « previousnext » ...
Namespaces - Archive of obsolete content
« previousnext » e4x and namespaces oftentimes, xml documents will contain elements from a variety of namespaces.
... « previousnext » ...
The global XML object - Archive of obsolete content
« previous the global xml object e4x-capable javascript engines put a new property on the global object.
... « previous ...
Generator comprehensions - Archive of obsolete content
var numbers = [1, 2, 3]; // generator function (function*() { for (let i of numbers) { if (i < 3) { yield i * 1; } } })(); // generator comprehension (for (i of numbers) if (i < 3) i); // result: both return a generator which yields [1, 2] specifications generator comprehensions were initially in the ecmascript 2015 draft, but got removed in revision 27 (august 2014).
... please see older revisions of es2015 for specification semantics.
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
the debug.mstraceasynccallbackstarting function associates the callback stack with a previously specified asynchronous operation.
... asyncoperationid must correspond to the operation name previously returned from debug.mstraceasyncoperationstarting.
Debug - Archive of obsolete content
functions debug.mstraceasynccallbackcompleted indicates that the callback stack associated with a previously specified asynchronous operation has completed.
... debug.mstraceasynccallbackstarting associates the callback stack with a previously specified asynchronous operation.
New in JavaScript 1.8.5 - Archive of obsolete content
bug 518663 object.preventextensions() prevents any extensions of an object.
...bug 492849 object.seal() prevents other code from deleting properties of an object.
Object.observe() - Archive of obsolete content
if omitted, the array ["add", "update", "delete", "reconfigure", "setprototype", "preventextensions"] will be used.
...e: 2}] object.defineproperty(obj, 'foo', {writable: false}); // [{name: 'foo', object: <obj>, type: 'reconfigure'}] object.setprototypeof(obj, {}); // [{name: '__proto__', object: <obj>, type: 'setprototype', oldvalue: <prototype>}] object.seal(obj); // [ // {name: 'foo', object: <obj>, type: 'reconfigure'}, // {name: 'bar', object: <obj>, type: 'reconfigure'}, // {object: <obj>, type: 'preventextensions'} // ] data binding // a user model var user = { id: 0, name: 'brendan eich', title: 'mr.' }; // create a greeting for the user function updategreeting() { user.greeting = 'hello, ' + user.title + ' ' + user.name + '!'; } updategreeting(); object.observe(user, function(changes) { changes.foreach(function(change) { // any time name or title change, update the greeti...
Old Proxy API - Archive of obsolete content
object.freeze(proxy) object.seal(proxy) object.preventextensions(proxy) fix: function() -> propertydescriptor map (indexed on property names) | undefined should return an object that maps property names to property descriptors.
...moreover, the respective method (freeze(), seal(), or preventextension()) is immediately called on the fixed object.
background-size - Archive of obsolete content
these tables should be revised over time to list gecko, webkit, internet explorer, and opera, with perhaps a tooltip on each that provides details on which browsers are encompassed by each.
... and anyway, it's more the -moz-border-image that seems to be the problem - that gets inherited even if i add in -moz-border-image: none, to <body> or <html>, and setting the height to 100% is more a matter of covering it up rather than stopping it happening (see further examples a, b and c - b and c look ok, but adding margin or padding reveals that the image applies to both <body> and <html> even though explicitly set to none) user:robertc 2009-08-14 see also bug 509681 and bug 497995.
forEach - Archive of obsolete content
jswisher 01 october 2011 <hr> there is some mistype in array.prototype.foreach: kvalue = o[ pk ]; should be kvalue = o[ k ]; <hr> this page has been the target of a revert war, and so write access to it has been restricted.
... if you wish to make changes, and especially if you wish to revert another user's changes, please either add a comment here, or post to dev-mdc@lists.mozila.org, explaining the change you desire.
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
however, when mac os x was released, apple completely revamped the interface and desktop metaphor.
...on the other hand, by adopting open technology standards and participating in the development and direction of those standards, an organization is providing a path for future development, growth and revenue.
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
since this rule is not valid css, it will prevent the validation of any stylesheet that contains it.
...meyer, netscape communications last updated date: published 04 oct 2002; revised 07 mar 2003 copyright information: copyright © 2001-2003 netscape.
Index - Game development
you might however also focus on selling licenses, doing branding, or earning on a revenue share basis from the advertisements.
... 67 move the ball 2d, beginner, canvas, games, javascript, loop, tutorial, movement you already know how to draw a ball from working through the previous article, so now let's make it move.
Introduction to game development for the Web - Game development
you don't have to hand over 30% of your revenues to someone else just because your game is in their ecosystem.
... pointer lock api the pointer lock api lets you lock the mouse or other pointing device within your game's interface so that instead of absolute cursor positioning you receive coordinate deltas that give you more precise measurements of what the user is doing, and prevent the user from accidentally sending their input somewhere else, thereby missing important action.
Game distribution - Game development
you can concatenate and minify the code to make it smaller and uglify it so it's a lot harder to reverse engineer your game.
...whether you should go that way or not depends on what your plan is for having your game distributed: do you want to send it wherever possible, or do you want to restrict its presence to those who've bought an exclusive license?
Desktop mouse and keyboard controls - Game development
previous overview: control mechanisms next now when we have our mobile controls in place and the game is playable on touch-enabled devices, it would be good to add mouse and keyboard support, so the game can be playable also on desktop.
... previous overview: control mechanisms next ...
Mobile touch controls - Game development
touchhandler); document.addeventlistener("touchmove", touchhandler); the touchhandler function looks like this: function touchhandler(e) { if(e.touches) { playerx = e.touches[0].pagex - canvas.offsetleft - playerwidth / 2; playery = e.touches[0].pagey - canvas.offsettop - playerheight / 2; output.innerhtml = "touch: "+ " x: " + playerx + ", y: " + playery; e.preventdefault(); } } if the touch occurs (touches object is not empty), then we will have all the info we need in that object.
...the preventdefault() function is needed to prevent the browser from moving — without it you'd have the default behaviour, and the canvas would be dragged around the page, which would show the browser scroll bars and look messy.
Unconventional controls - Game development
previous overview: control mechanisms having different control mechanisms in your game helps reach broader audiences.
... previous overview: control mechanisms ...
Collision detection - Game development
« previousnext » this is the 7th step out of 10 of the gamedev canvas tutorial.
... « previousnext » ...
Finishing up - Game development
« previous this is the 10th and final step of the gamedev canvas tutorial.
... « previous ...
Game over - Game development
« previousnext » this is the 5th step out of 10 of the gamedev canvas tutorial.
... « previousnext » ...
Animations and tweens - Game development
« previousnext » this is the 14th step out of 16 of the gamedev phaser tutorial.
... « previousnext » ...
Buttons - Game development
« previousnext » this is the 15th step out of 16 of the gamedev phaser tutorial.
... « previousnext » ...
Collision detection - Game development
« previousnext » this is the 10th step out of 16 of the gamedev phaser tutorial.
... « previousnext » ...
Initialize the framework - Game development
« previousnext » this is the first of 16 tutorials to learn how to use gamedev phaser.
... « previousnext » ...
Load the assets and print them on screen - Game development
« previousnext » this is the 3rd step out of 16 in the gamedev phaser tutorial.
... « previousnext » ...
Move the ball - Game development
« previousnext » this is the 4th step out of 16 of the gamedev phaser tutorial.
... « previousnext » ...
Randomizing gameplay - Game development
« previous this is the 16th step out of 16 of the gamedev phaser tutorial.
... « previous ...
Win the game - Game development
« previousnext » this is the 12th step out of 16 of the gamedev phaser tutorial.
... « previousnext » ...
CSRF - MDN Web Docs Glossary: Definitions of Web-related terms
there are many ways to prevent csrf, such as implementing restful api, adding secure tokens, etc.
... learn more general knowledge cross-site request forgery on wikipedia prevention measures ...
Cross Axis - MDN Web Docs Glossary: Definitions of Web-related terms
the cross axis in flexbox runs perpendicular to the main axis, therefore if your flex-direction is either row or row-reverse then the cross axis runs down the columns.
... if your main axis is column or column-reverse then the cross axis runs along the rows.
Lossless compression - MDN Web Docs Glossary: Definitions of Web-related terms
lossless compression methods are reversible.
... examples of lossless compression include gzip, brotli, webp, and png, lossy compression, on the other hand, uses inexact approximations by discarding some data from the original file, making it an irreversible compression method.
Main Axis - MDN Web Docs Glossary: Definitions of Web-related terms
these are: row row-reverse column column-reverse should you choose row or row-reverse then your main axis will run along the row in the inline direction.
... choose column or column-reverse and your main axis will run top to bottom of the page in the block direction.
Mutable - MDN Web Docs Glossary: Definitions of Web-related terms
(you can make a variable name point to a new value, but the previous value is still held in memory.
... on appending the "immutablestring" with a string value, following events occur: existing value of "immutablestring" is retrieved "world" is appended to the existing value of "immutablestring" the resultant value is then allocated to a new block of memory "immutablestring" object now points to the newly created memory space previously created memory space is now available for garbage collection.
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
how to prevent before executing the queries for the user credentials, make some changes like the following: $id = $_get['id'] (1) $id = stripslashes($id) (2) $id = mysql_real_escape_string($id) so due to (1) each single quote (') in the input string is replaced with double quotes ("), and due to (2) before every (') it adds (/).
... the revised magical string fails to bypass the authentication, and your database stays secure.
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
just like keyboard navigation without voiceover, you can navigate through interactive elements using the tab key and the arrow keys: next interactive element: tab previous interactive element: shift + tab next radio button in a same named-group: right or down arrow previous radio button in a same named-group: left or up arrow navigating through the content of a page is done with the tab key and a series of other keys along with control + option keys next heading: control + option + h next list: control + option + x next graphic: control + option + g n...
...ext table: control + option + t down an html hierarchical order control + option + right arrow previous heading: shift + control + option + h previous list: shift + control + option + x previous graphic: shift + control + option + g previous table: shift + control + option + t up an html hierarchical order: control + option + left arrow learn more aria ...
lossy compression - MDN Web Docs Glossary: Definitions of Web-related terms
lossy compression, or irreversible compression, is a data-compression method that uses inexact approximations and partial-data discarding to represent content.
...the process of such compression is irreversible; once lossy compression of the content has been performed, the content cannot be restored to its original state.
MDN Web Docs Glossary: Definitions of Web-related terms
web technologies contain long lists of jargon and abbreviations that are used in documentation and coding.
... this glossary provides definitions of words and abbreviations you need to know to successfully understand and build for the web.
Creating fancy letterheaded paper - Learn web development
add a background declaration to the letter that: fixes the top image to the top of the letter fixes the bottom image to the bottom of the letter adds a semi-transparent gradient over the top of both of the previous backgrounds that gives the letter a bit of texture.
... add another background declaration that just adds the top image to the top of the letter, as a fallback for browsers that don't support the previous declaration.
Organizing your CSS - Learn web development
previous overview: building blocks as you start to work on larger stylesheets and big projects you will discover that maintaining a huge css file can be challenging.
... previous overview: building blocks in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables debug...
Attribute selectors - Learn web development
previous overview: building blocks next as you know from your study of html, elements can have attributes that give further detail about the element being marked up.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Type, class, and ID selectors - Learn web development
previous overview: building blocks next in this lesson we will take a look at the simplest selectors that are available, which you will probably use the most in your work.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
CSS selectors - Learn web development
previous overview: building blocks next in css, selectors are used to target the html elements on our web pages that we want to style.
... previous overview: building blocks next reference table of selectors the below table gives you an overview of the selectors you have available to use, along with links to the pages in this guide which will show you how to use each type of selector.
Test your skills: backgrounds and borders - Learn web development
this aim of this skill test is to get you working with css backgrounds and borders using the skills you have learned in the previous lesson.
... make sure that the heading text does not overlay the image, and that it is centered — you will need to use techniques learned in previous lessons to achieve this.
The box model - Learn web development
previous overview: building blocks next everything in css has a box around it, and understanding these boxes is key to being able to create layouts with css, or to align items with other items.
... previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo-classes and pseudo-elements combinators the box model backgrounds and borders handling different text directions overflowing content values and units sizing items in css images, media, and form elements styling tables...
Multiple-column layout - Learn web development
previous overview: css layout next the multiple-column layout specification gives you a method of laying content out in columns, as you might see in a newspaper.
...in a similar way to the border property that you encountered in previous lessons, column-rule is a shorthand for column-rule-color, column-rule-style, and column-rule-width, and accepts the same values as border.
Getting started with CSS - Learn web development
previous overview: first steps next in this article we will take a simple html document and apply css to it, learning some practical things about the language along the way.
... previous overview: first steps next in this module what is css?
Using your new knowledge - Learn web development
previous overview: first steps with the things you have learned in the last few lessons you should find that you can format simple text documents using css, to add your own style to them.
... previous overview: first steps in this module what is css?
Typesetting a community school homepage - Learn web development
previous overview: styling text in this assessment we'll test your understanding of all the text styling techniques we've covered throughout this module by getting you to style the text for a community school's homepage.
... previous overview: styling text in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
Web fonts - Learn web development
previous overview: styling text next in the first article of the module, we explored the basic css features available for styling fonts and text.
... previous overview: styling text next in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
How much does it cost to do something on the Web? - Learn web development
objective: review the complete process for creating a website and find out how much each step can cost.
... image editors your system likely includes a simple image editor, or viewer: paint on windows, eye of gnome on ubuntu, preview on mac.
What are browser developer tools? - Learn web development
click a property name or value to bring up a text box, where you can key in a new value to get a live preview of a style change.
...ore out about the inspector in different browsers: firefox page inspector ie dom explorer chrome dom inspector (opera's inspector works the same as this) safari dom inspector and style explorer the javascript debugger the javascript debugger allows you to watch the value of variables and set breakpoints, places in your code that you want to pause execution and identify the problems that prevent your code from executing properly.
What are hyperlinks? - Learn web development
back in 1989, tim berners-lee, the web's inventor, spoke of the three pillars on which the web stands: url, an address system that keeps track of web documents http, a transfer protocol to find documents when given their urls html, a document format allowing for embedded hyperlinks as you can see in the three pillars, everything on the web revolves around documents and how to access them.
...this is where hyperlinks revolutionized everything.
What is a web server? - Learn web development
deeper dive to review: to fetch a webpage, your browser sends a request to the web server, which searches for the requested file in its own storage space.
... stateless neither the server nor the client remember previous communications.
Basic native form controls - Learn web development
previous overview: forms next in the previous article, we marked up a functional web form example, introducing some form controls and common structural elements, and focusing on accessibility best practices.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for fo...
Example 4 - Learn web development
ect, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- //...
...); }); select.addeventlistener('blur', function (event) { deactivateselect(select); }); }); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventlistener('click', function (event) { updatevalue(select, index); }); }); select.addeventlistener('keyup', function (event) { var length = optionlist.length, index = getindex(select); if (event.keycode === 2...
Example 5 - Learn web development
ect, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[index].setattribute('aria-selected', 'true'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionli...
...st[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventliste...
Other form controls - Learn web development
previous overview: forms next we now look at the functionality of non-<input> form elements in detail, from other control types such as drop-down lists and multi-line text fields, to other useful form features such as the <output> element (which we saw in action in the previous article), and progress bars.
... previous overview: forms next in this module your first form how to structure a web form basic native form controls the html5 input types other form controls styling web forms advanced form styling ui pseudo-classes client-side form validation sending form data advanced topics how to build custom form controls sending forms through javascript property compatibility table for fo...
Dealing with files - Learn web development
previous overview: getting started with the web next a website consists of many files: text content, code, stylesheets, media content, and so on.
...your folder structure should look something like this: previous overview: getting started with the web next in this module installing basic software what will your website look like?
Publishing your website - Learn web development
previous overview: getting started with the web next once you finish writing the code and organizing the files that make up your website, you need to put it all online so people can find it.
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
What will your website look like? - Learn web development
previous overview: getting started with the web next what will your website look like?
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
Document and website structure - Learn web development
previous overview: introduction to html next in addition to defining individual parts of your page (such as "a paragraph" or "an image"), html also boasts a number of block level elements used to define areas of your website (such as "the header", "the navigation menu", "the main content column").
...all rights reversed.</p> </footer> </body> </html> take some time to look over the code and understand it — the comments inside the code should also help you to understand it.
Structuring a page of content - Learn web development
previous overview: introduction to html structuring a page of content ready for laying it out using css is a very important skill to master, so in this assessment you'll be tested on your ability to think about how a page might end up looking, and choose appropriate structural semantics to build a layout on top of.
... previous overview: introduction to html in this module getting started with html what’s in the head?
Mozilla splash page - Learn web development
previous overview: multimedia and embedding in this assessment, we'll test your knowledge of some of the techniques discussed in this module's articles, getting you to add some images and video to a funky splash page all about mozilla!
... previous overview: multimedia and embedding in this module images in html video and audio content from <object> to <iframe> — other embedding technologies adding vector graphics to the web responsive images mozilla splash page ...
Assessment: Structuring planet data - Learn web development
previous overview: tables in our table assessment, we provide you with some data on the planets in our solar system, and get you to structure it into an html table.
... previous overview: tables in this module html table basics html table advanced features and accessibility structuring planet data ...
Image gallery - Learn web development
previous overview: building blocks now that we've looked at the fundamental building blocks of javascript, we'll test your knowledge of loops, functions, conditionals and events by getting you to build a fairly common item you'll see on a lot of websites — a javascript-powered image gallery.
... previous overview: building blocks in this module making decisions in your code — conditionals looping code functions — reusable blocks of code build your own function function return values introduction to events image gallery ...
Test your skills: Loops - Learn web development
you should use a type of loop that you've not used in the previous task.
... you should use a type of loop that you've not used in the previous two tasks.
JavaScript building blocks - Learn web development
get started prerequisites before starting this module, you should have some familiarity with the basics of html and css, and you should have also worked through our previous module, javascript first steps.
... build your own function with most of the essential theory dealt with previously, this article provides a practical experience.
Basic math in JavaScript — numbers and operators - Learn web development
previous overview: first steps next at this point in the course we discuss math in javascript — how we can use operators and other features to successfully manipulate numbers to do our bidding.
... previous overview: first steps next in this module what is javascript?
Silly story generator - Learn web development
previous overview: first steps in this assessment you'll be tasked with taking some of the knowledge you've picked up in this module's articles and applying it to creating a fun app that generates random silly stories.
... previous overview: first steps in this module what is javascript?
Test your skills: Strings - Learn web development
use a combination of the variables you have and available string properties/methods to trim down the original quote to "i do not like green eggs and ham.", and store it in a variable called revisedquote.
... strings 3 in the next string task, you are given the same quote that you ended up with in the previous task, but it is somewhat broken!
Storing the information you need — Variables - Learn web development
previous overview: first steps next after reading the last couple of articles you should now know what javascript is, what it can do for you, how you use it alongside other web technologies, and what its main features look like from a high level.
... previous overview: first steps next in this module what is javascript?
What went wrong? Troubleshooting JavaScript - Learn web development
previous overview: first steps next when you built up the "guess the number" game in the previous article, you may have found that it didn't work.
... fixing syntax errors earlier on in the course we got you to type some simple javascript commands into the developer tools javascript console (if you can't remember how to open this in your browser, follow the previous link to find out how).
JavaScript First Steps - Learn web development
get started prerequisites before starting this module, you don't need any previous javascript knowledge, but you should have some familiarity with html and css.
...troubleshooting javascript when you built up the "guess the number" game in the previous article, you may have found that it didn't work.
Adding features to our bouncing balls demo - Learn web development
previous overview: objects in this assessment, you are expected to use the bouncing balls demo from the previous article as a starting point, and add some new and interesting features to it.
... previous overview: objects in this module object basics object-oriented javascript for beginners object prototypes inheritance in javascript working with json data object building practice adding features to our bouncing balls demo ...
Inheritance in JavaScript - Learn web development
previous overview: objects next with most of the gory details of oojs now explained, this article shows how to create "child" object classes (constructors) that inherit features from their "parent" classes.
... add the following line below your previous addition: teacher.prototype = object.create(person.prototype); here our friend create() comes to the rescue again.
HTML performance features - Learn web development
previous overview: performance next html is by default fast and accessible.
... elements & attributes impacting performance the <picture> element the <video> element the <source> element the <img> srcset attribute responsive images preloading content with rel="preload" - (https://w3c.github.io/preload/ ) async / defer attributes <iframe> <object> <script> rel attribute conclusion previous overview: performance next in this module the "why" of web performance what is web performance?
Multimedia: Images - Learn web development
previous overview: performance next media, namely images and video, account for over 70% of the bytes downloaded for the average website.
... previous overview: performance next in this module the "why" of web performance what is web performance?
What is web performance? - Learn web development
previous overview: performance next web performance is all about making web sites fast, including making slow processes seem fast.
... previous overview: performance next in this module the "why" of web performance what is web performance?
JavaScript performance - Learn web development
previous overview: performance next while images and video account for over 70% of the bytes downloaded for the average website, byte per byte, javascript has a greater negative impact on performance.
... previous overview: performance next in this module the "why" of web performance what is web performance?
Multimedia: video - Learn web development
previous overview: performance next as we learned in the previous section, media, namely images and video, account for over 70% of the bytes downloaded for the average website.
... previous overview: performance next in this module the "why" of web performance what is web performance?
Getting started with Ember - Learn web development
previous overview: client-side javascript frameworks next in our first ember article we will look at how ember works and what it's useful for, install the ember toolchain locally, create a sample app, and then do some initial setup to get it ready for development.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Introduction to client-side frameworks - Learn web development
accessibility on a framework-driven web let's build on what we said in the previous section, and talk a bit more about accessibility.
... static site generators have been around for quite a long time, but they have seen a bit of a revival in the recent history of the web.
Componentizing our React app - Learn web development
previous overview: client-side javascript frameworks next at this point, our app is a monolith.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
React resources - Learn web development
previous overview: client-side javascript frameworks next our final article provides you with a list of react resources that you can use to go further in your learning.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Beginning our React todo list - Learn web development
previous overview: client-side javascript frameworks next let's say that we’ve been tasked with creating a proof-of-concept in react – an app that allows users to add, edit, and delete tasks they want to work on, and also mark tasks as complete without deleting them.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Starting our Svelte Todo list app - Learn web development
previous overview: client-side javascript frameworks next now that we have a basic understanding of how things work in svelte, we can start building our example app: a todo list.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Getting started with Svelte - Learn web development
previous overview: client-side javascript frameworks next in this article we'll provide a quick introduction to the svelte framework.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Creating our first Vue component - Learn web development
previous overview: client-side javascript frameworks next now it's time to dive deeper into vue, and create our own custom component — we'll start by creating a component to represent each item in the todo list.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Focus management with Vue refs - Learn web development
previous overview: client-side javascript frameworks next we are nearly done with vue.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Vue resources - Learn web development
previous overview: client-side javascript frameworks next now we'll round off our study of vue by giving you a list of resources that you can use to go further in your learning, plus some other useful tips.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ...
Cross browser testing - Learn web development
handling common html and css problems with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur.
...we will also look at how to integrate your local testing environment with commercial apps like the ones discussed in the previous article.
Git and GitHub - Learn web development
all developers will use some kind of version control system (vcs), a tool to allow them to collaborate with other developers on a project without danger of them overwriting each other's work, and roll back to previous versions of the code base if a problem is discovered later on.
...git is an example of a vcs, and github is a web site + infrastructure that provides a git server plus a number of really useful tools for working with git repositories individually or in teams, such as reporting issues with the code, reviewing tools, project management features such as assigning tasks and task statuses, and more.
Accessibility API cross-reference
note the reversed logic in some apis invisible visible visible aria-hidden hidden (boolean attribute) indicates whether the object is in an iconified or minimized state.
... n/a <q> <quote> note the reversed logic in some apis readonly editable editable aria-readonly=true this object can be selected selectable selectable selectable this object is selected selected selected selected aria-selected=true selected (boolean attribute) for a button that is "consistent".
Accessible Toolkit Checklist
general dialogs/windows/general escape key cancels dialogs and refocuses the previously focused on the parent window.
... accnavigate: navigate to the first/last child, previous/next sibling, up, down, left or right from this iaccessible.
Bugzilla
bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects.
... testopia - test case management extension bugzilla.org - the project site wikipedia:bugzilla - general description of bugzilla (not specific to mozilla projects) bmo on wiki.mozilla.org - information about mozilla's customized bugzilla installation, including how to contribute to it tools bugzilla todos lists review and flag requests, patches to check in, unfulfilled requests you made of other people, and assigned bugs.
How Mozilla's build system works
python 2 is prevalent in a mozilla build system.
... topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = layout library_name = gkbase_s # requires and cppsrcs omitted here for brevity # # we don't want the shared lib, but we want to force the creation of a static lib.
Old Thunderbird build
first, cd into the comm-central subdirectory (created automatically by the previous command): cd comm-central then run: python client.py checkout on some types of network connections, "hg clone" might fail because it gets interrupted.
...you can clean out previous build artefacts using ./mozilla/mach clobber references general build documentation comm-central using the mozilla symbol server ...
ESLint
in order to help people write standard-compliant code from the start and avoid wasting time during code reviews, a set of eslint configuration files have been added to the code base so that javascript can be analyzed automatically.
...meeting these rules before review will help reduce the amount of review time, and the revisions necessary to have a review granted.
Interface Compatibility
any changes, including new features, must have super-review.
... one exception to this rule is apis which are explicitly shipped with mozilla prefixes as a technology preview.
Performance best practices for Firefox front-end engineers
for example, transitioning the background-color of a dom node from red to blue will result in a repaint for every frame of the animation, and paint flashing will reveal that.
...see this comment and a few previous comments on that bug for more information.
Tracking Protection
for example, you should not use google analytics in the following way: <a href="http://www.example.com" onclick="tracklink('http://www.example.com', event);"> visit example.com </a> <script> function tracklink(url,event) { event.preventdefault(); ga('send', 'event', 'outbound', 'click', url, { 'transport': 'beacon', 'hitcallback': function() { document.location = url; } }); } </script> instead, you should account for the case when google analytics is missing by checking to see if the ga object has initialized: <a href="http://www.example.com" onclick="tracklink('http://www.example.com', event);"...
...> visit example.com </a> <script> function tracklink(url,event) { event.preventdefault(); if (window.ga && ga.loaded) { ga('send', 'event', 'outbound', 'click', url, { 'transport': 'beacon', 'hitcallback': function() { document.location = url; } }); } else { document.location = url; } } </script> more information about this technique is available at google analytics, privacy, and event tracking.
HTMLIFrameElement.findNext()
the findnext() method of the htmliframeelement highlights the next or previous instance of a search result after a findall() search has been carried out.
... prev.addeventlistener('touchend',function() { browser.findnext('backward'); }); next.addeventlistener('touchend',function() { browser.findnext('forward'); }); specification not part of any specification.
HTMLIframeElement.removeNextPaintListener()
the removenextpaintlistener() method of the htmliframeelement interface is used to remove a handler previously set with the addnextpaintlistener method.
... parameters listener a function handler previously set with addnextpaintlistener.
HTML parser threading
if another tree op that attempts to execute a script is generated while speculating, another speculation object is initialized as described above and placed in the queue of speculation objects after the previous one.
...if there is data in document.write() input after a an external script (or any data at all if a previous document.write() call has contained an external script and blocked the parser), the data is left in a linked list of nshtml5owningutf16buffer objects.
Script security
objects in a privileged scope are allowed complete access to objects in a less privileged scope, but by default they see a restricted view of such objects, designed to prevent them from being tricked by the untrusted code.
... xrays are designed to prevent untrusted code from confusing trusted code by redefining objects in unexpected ways.
Getting Started with Chat
these operate very much in the same way as the previously mentioned desktop clients and chatzilla.
... nickserv this bot allows you to register your nickname which prevents other users from using it.
How to implement a custom autocomplete search component
nction providerautocompletesearch() { } providerautocompletesearch.prototype = { classid: class_id, classdescription : class_name, contractid : contract_id, /** * searches for a given string and notifies a listener (either synchronously * or asynchronously) of the result * * @param searchstring the string to search for * @param searchparam an extra parameter * @param previousresult a previous result to use for faster searchinig * @param listener the listener to notify when the search is complete */ startsearch: function(searchstring, searchparam, previousresult, listener) { var results = ['mary', 'john']; var autocomplete_result = new providerautocompleteresult(searchstring, ci.nsiautocompleteresult.result_success, 0, "", results, null); ...
...s.ns_error_no_interface; return this; } }; // implements nsiautocompletesearch function simpleautocompletesearch() { } simpleautocompletesearch.prototype = { /* * search for a given string and notify a listener (either synchronously * or asynchronously) of the result * * @param searchstring - the string to search for * @param searchparam - an extra parameter * @param previousresult - a previous result to use for faster searchinig * @param listener - a listener to notify when the search is complete */ startsearch: function(searchstring, searchparam, result, listener) { // this autocomplete source assumes the developer attached a json string // to the the "autocompletesearchparam" attribute or "searchparam" property // of the <textbox> element.
Addon
screenshots read only addonscreenshot[] an array of addonscreenshot objects containing urls of preview images for the add-on.
... fulldescription read only string developercomments read only string eula read only string icon64url read only string supporturl read only string contributionurl read only string contributionamount read only string averagerating read only number reviewcount read only integer reviewurl read only string totaldownloads read only integer weeklydownloads read only integer dailyusers read only integer repositorystatus read only integer callbacks datadirectorycallback() a callback which is passed a directory path, and, when an error has occur...
AsyncShutdown.jsm
if, for some reason, promise is never resolved/rejected, firefox will crash during shutdown to avoid blocking system shutdown, preventing the user from restarting firefox or burning through a battery.
... // execute this code during profilebeforechange // no specific guarantee about completion of profilebeforechange }); if the promise returned by condition is not resolved/rejected within one minute, the process will crash to avoid blocking system shutdown, preventing the user from restarting firefox or burning through battery.
Download
if the download is in progress, the method returns the same promise as the previous call.
... note: this method should be used in place of the cancel() and removepartialdata() methods while shutting down or disposing of the download object, to prevent other callers from interfering with the operation.
Downloads.jsm
calling this function may cause the download list to be reloaded from the previous session, if it wasn't loaded already.
... calling this function does not cause the list of public downloads to be reloaded from the previous session.
Examples
using a promise returned by a function (compact) the same code as the previous example is usually written with a more compact syntax: components.utils.import("resource://gre/modules/osfile.jsm") let path = os.path.join(os.constants.path.tmpdir, "file.txt"); os.file.exists(path).then(exists => { console.log(exists ?
..."you have .mozconfig in " + currentdir : "you don't have .mozconfig in " + currentdir); }); }).then(null, components.utils.reporterror); parallel promise (this example needs more work) so when chaining promises, consequent promises run after the previous promise completes.
XPCOMUtils.jsm
to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/xpcomutils.jsm"); using xpcomutils exposing a javascript class as a component using these utility methods requires four key steps: import xpcomutils.jsm, as explained previously.
... create the nsgetfactory() or nsgetmodule() entry point finally, you need to implement the nsgetmodule() entry point so gecko can start up your component: // "components" is the array created in the previous section if ("generatensgetfactory" in xpcomutils) var nsgetfactory = xpcomutils.generatensgetfactory(components); // gecko 2.0+ else var nsgetmodule = xpcomutils.generatensgetmodule(components); // gecko 1.9.x method overview function definelazygetter(aobject, aname, alambda); function definelazymodulegetter(aobject, aname, aresource, [optional] asymbol); ...
Mozilla Content Localized in Your Language
your language's style guide abbreviations how are abbreviations expressed in your language?
... articles -- avoid them articles (such as the word "the" in english) should be avoided wherever possible.
Localizing extension descriptions
the following example demonstrates this (most normal manifest properties have been removed for brevity): <?xml version="1.0"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>tabsidebar@blueprintit.co.uk</em:id> <em:localized> <description> <em:locale>de-de</em:locale> <em:name>tab sidebar</em:name> <em:description>zeigt in einer sideb...
...ar vorschaubilder der inhalte aller offenen tabs an.</em:description> </description> </em:localized> <em:localized> <description> <em:locale>es-es</em:locale> <em:name>tab sidebar</em:name> <em:description>muestra una vista previa de sus pestañas en su panel lateral.</em:description> </description> </em:localized> <em:localized> <description> <em:locale>nl-nl</em:locale> <em:name>tab sidebar</em:name> <em:description>laat voorbeeldweergaven van uw tabbladen in de zijbalk zien.</em:description> </description> </em:localized> <em:name>tab sidebar</em:name> <em:description>displays previews of your tabs in your sidebar.</em:description> </description> </rdf> all of the metadata mentione...
Localizing with Mercurial
the commit message should take the form of "bug 123456 - change this thing to work better by doing something; r=reviewers" if you are to fix a bug.
...write access to the hg repositories requires a ''voucher'', which, for the owner, will be done based on the review by mozilla.
Localizing without a specialized tool
$ compare-locales mozilla-1.9.2/browser/locales/l10n.ini l10n-mozilla-1.9.2 x-testing for convenience, try saving the output of this command to a text file on your desktop so you can review it as you go.
...going one-by-one with your compare-locales output open for review, we will start with the first file with "// add and localize this file" note.
QA phase
let's see what the last revision in this repository is.
... « previousnext » ...
What every Mozilla translator should know
some branch/release names identified: mozilla source + en-us localization files for [ab-cd] locale corresponding firefox version branches in hg mozilla-central l10n-central firefox.next (trunk) mozilla-1.9.2 l10n-mozilla-1.9.2 firefox 3.6 mozilla-1.9.1 l10n-mozilla-1.9.1 firefox 3.5 and, on the former revision control system, cvs: cvs trunk (the default branch) -> firefox/thunderbird 3.0.x branch mozilla_1_8_branch -> firefox/thunderbird 2.0 branch mozilla cross-reference mozilla cross-reference is a web site mirroring the content of the hg server.
...eate a bug, if you want the person in charge of the l10n to follow up your bug you should cc: l10n@mozilla.com if you choose to make changes to your localization, you should make the changes local to your disk, push them to your hg repository on merucial, test the changes on a nightly/tinderbox build, fix any errors if some are found and test again, and send the new changeset id as your "opt-in" revisions to the l10-drivers.
Mozilla Web Developer FAQ
contrary to a popular belief stemming from the behavior of a couple browsers running on the windows platform, alt isn’t an abbreviation for ‘tooltip’ but for ‘alternative’.
... instead of putting time and effort into reverse-engineering and cloning legacy browsers, it makes more sense to focus on implementing standards.
Mozilla Style System Documentation
matters dealing with dynamic style changes are also tricky because the style contexts don't have pointers to their frames, but instead, we have the reverse and is probably the biggest flaw in the design of this part of the system.
...i'm reluctant to write it both since i don't know much about it.] problems:a bunch the code needs to be rewritten to prevent stylesheets from blocking the parser and to reduce string copying (although that partly goes with parsing).] parsing stylesheet representation problems: the stylesheet representation uses way too much memory.
A brief guide to Mozilla preferences
preferences files to protect privacy by preventing inadvertent loading of a preferences file in the browser, the first line of the file is made un-parseable and skipped on loading.
... note the application never changes user.js, so on launch user.js overrides conflicting preferences from the previous application session.
L20n Javascript API
error - fired when an error occurs which prevents the context instance from working correctly or when the existing translations are buggy.
... ctx.removeeventlistener(event: string, callback: function) remove an event listener previously registered with addeventlistener.
Localization Use Cases
byteunit-b = b byteunit-kb = kb byteunit-mb = mb byteunit-gb = gb byteunit-tb = tb for example in french, the unit abbreviations are as follows: byteunit-b = o byteunit-kb = ko byteunit-mb = mo byteunit-gb = go byteunit-tb = to solution in l20n, the french localizer could provide the translation of unit abbreviations locally in the localization file, without impacting the english localization file.
...calized value: function showformatedsize(element, l10nid, size) { // … element.textcontent = document.l10n.get(l10nid, { size: sizeinfo.size, unit: sizeinfo.unit }); } and then use the $unit variable verbatim in the english message: <availablesize "{{ $size }} {{ $unit }} available"> in french, the localizer can then use the value of $unit to match it against a translated abbreviation, like so: <_unitedemesure { b: "o", kb: "ko", mb: "mo", gb: "go", tb: "to" }> <availablesize "il reste {{ $size }} {{ _unitedemesure[unit] }}"> similarly, other local variables could be used to provide better and more natural translations in french and other languages alike.
Midas
redo this command will redo the previous undo action.
... undo this command will undo the previous action.
Nonblocking IO In NSPR
introduction previously, all i/o in the netscape portable runtime (nspr) was blocking (or synchronous).
...the socket returned by <tt>pr_accept()</tt> or <tt>pr_acceptread()</tt> on a blocking, listening socket may be a recycled socket previously used in a <tt>pr_transmitfile()</tt> call.
PLHashComparator
pl_comparevalues compares the values of the arguments v1 and v2 numerically.
... see also pl_comparestrings, pl_comparevalues ...
PR_FreeLibraryName
syntax #include <prlink.h> void pr_freelibraryname(char *mem); parameters the function has this parameter: mem a reference to a character array that was previously allocated by the dynamic library runtime.
... description this function deletes the storage allocated by the runtime in the functions described previously.
Certificate functions
ter cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr 3.3 and later cert_comparename mxr 3.2 and later cert_comparevaliditytimes mxr 3.11 and later cert_completecrldecodeentries mxr 3.6 and later cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificater...
...mxr 3.10 and later cert_getocspresponsestatus mxr 3.6 and later cert_getocspstatusforcertid mxr 3.6 and later cert_getoidstring mxr 3.9 and later cert_getorgname mxr 3.2 and later cert_getorgunitname mxr 3.2 and later cert_getocspauthorityinfoaccesslocation mxr 3.4 and later cert_getpkixverifynistrevocationpolicy mxr 3.12 and later cert_getprevgeneralname mxr 3.10 and later cert_getprevnameconstraint mxr 3.10 and later cert_getsloptime mxr 3.2 and later cert_getsslcacerts mxr 3.2 and later cert_getstatename mxr 3.2 and later cert_getusepkixforvalidation mxr 3.12 and later cert_getvaliddnsp...
Encrypt Decrypt MAC Keys As Session Objects
_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); /* read a buffer of plaintext from input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { /* encrypt using it using cbc, using previously created iv */ if (ptextlen != blocksize) { paddinglength = blocksize - ptextlen; for ( j=0; j < paddinglength; j++) { ptext[ptextlen+j] = (unsigned char)paddinglength; } ptextlen = blocksize; } rv = encrypt(ctxenc, encbuf, &encbuflen, sizeof(encbuf), ptext, ptextlen); ...
... * loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, * store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned ch...
Encrypt and decrypt MAC using token
_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); /* read a buffer of plaintext from input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { /* encrypt using it using cbc, using previously created iv */ if (ptextlen != blocksize) { paddinglength = blocksize - ptextlen; for ( j=0; j < paddinglength; j++) { ptext[ptextlen+j] = (unsigned char)paddinglength; } ptextlen = blocksize; } rv = encrypt(ctxenc, encbuf, &encbuflen, sizeof(encbuf), ptext, ptextlen); ...
... * loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, * store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned ch...
NSS 3.12.6 release notes
bug 275744: support for tls compression rfc 3749 bug 494603: update nss's copy of sqlite3 to 3.6.22 to get numerous bug fixes bug 496993: add accessor functions for ssl_implementedciphers bug 515279: cert_pkixverifycert considers a certificate revoked if cert_processocspresponse fails for any reason bug 515870: gcc compiler warnings in nss 3.12.4 bug 518255: the input buffer for sgn_update should be declared const bug 519550: allow the specification of an alternate library for sqlite bug 524167: crash in [[@ find_objects_by_template - nsstoken_findcertificatebyissuerandserialnumber] bug 526910: ...
...new and revised documents available since the release of nss 3.11 include the following: build instructions nss shared db compatibility nss 3.12.6 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.17.2 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
...previously nss would only validate the peer's public key before performing ecdh key agreement.
NSS 3.21 release notes
nss 3.21 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_21_rtm/src/ security fixes in nss 3.21 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures.
...ure and hash algorithm is available ssl_error_unsupported_signature_algorithm - error code for when an unsupported signature and hash algorithm is configured ssl_error_missing_extended_master_secret - error code for when the extended master secret is missing after having been negotiated ssl_error_unexpected_extended_master_secret - error code for receiving an extended master secret when previously not negotiated in sslt.h ssl_enable_extended_master_secret - configuration to enable the tls extended master secret extension (rfc 7627) ssl_preinfo_version - used with sslpreliminarychannelinfo to indicate that a tls version has been selected ssl_preinfo_cipher_suite - used with sslpreliminarychannelinfo to indicate that a tls cipher suite has been selected ssl_preinfo...
NSS 3.24 release notes
counter mode and galois/counter mode (gcm) have checks to prevent counter overflow.
...in fips mode, you may move from level 1 to level 2 (by setting an appropriate password), but not the reverse.
NSS 3.39 release notes
previous versions of nss accepted an rsa pkcs#1 v1.5 signature where the digestinfo structure was missing the null parameter.
... the tstclnt and selfserv test utilities no longer accept the -z parameter, as support for tls compression was removed in a previous nss version.
Enc Dec MAC Output Public Key as CSR
r_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); /* read a buffer of plaintext from input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { /* encrypt using it using cbc, using previously created iv */ if (ptextlen != blocksize) { paddinglength = blocksize - ptextlen; for ( j=0; j < paddinglength; j++) { ptext[ptextlen+j] = (unsigned char)paddinglength; } ptextlen = blocksize; } rv = encrypt(ctxenc, encbuf, &encbuflen, sizeof(encbuf), ptext, ptextlen); ...
...value to use as iv for aes cbc * open an input file and an output file, * wrap the symmetric and mac keys using public key * write a header to the output that identifies the two wrapped keys * and public key * loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, * store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; seckeypublickey *pubkey = null; secitem *pubkeydata = null; prfiledesc *infile = null; prfiledesc *headerfile = null; ...
Encrypt Decrypt_MAC_Using Token
*/ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { /* encrypt using it using cbc, using previously created iv.
... * loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, * store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned ch...
NSS Sample Code Sample_3_Basic Encryption and MACing
_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); /* read a buffer of plaintext from input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { /* encrypt using it using cbc, using previously created iv */ if (ptextlen != blocksize) { paddinglength = blocksize - ptextlen; for ( j=0; j < paddinglength; j++) { ptext[ptextlen+j] = (unsigned char)paddinglength; } ptextlen = blocksize; } rv = encrypt(ctxenc, encbuf, &encbuflen, sizeof(encbuf), ptext, ptextlen); ...
... * loop until eof(input) * read a buffer of plaintext from input file * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv * store the last block of ciphertext as the new iv * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char...
EncDecMAC using token object - sample 3
, cka_sign, mk, &noparams); if (ctxmac == null) { pr_fprintf(pr_stderr, "can't create mac context\n"); rv = secfailure; goto cleanup; } rv = macinit(ctxmac); if (rv != secsuccess) { goto cleanup; } ctxenc = encryptinit(ek, iv, ivlen, ckm_aes_cbc); /* read a buffer of plaintext from input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { /* encrypt using it using cbc, using previously created iv */ if (ptextlen != blocksize) { paddinglength = blocksize - ptextlen; for ( j=0; j < paddinglength; j++) { ptext[ptextlen+j] = (unsigned char)paddinglength; } ptextlen = blocksize; } rv = encrypt(ctxenc, encbuf, &encbuflen, sizeof(encbuf), ptext, ptextlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encrypt failure\n"); goto cleanup; } /* save the last block of ciphertext as ...
...* loop until eof(input) * read a buffer of plaintext from input file, * mac it, append the mac to the plaintext * encrypt it using cbc, using previously created iv, * store the last block of ciphertext as the new iv, * write the cipher text to intermediate file * close files * report success */ secstatus rv; prfiledesc *infile; prfiledesc *headerfile; prfiledesc *encfile; unsigned char *enckeyid = (unsigned char *) "encrypt key"; unsigned char *mackeyid = (unsigned char *) "mac key"; secitem enckeyid = { siasciistring, enckeyid, pl_strlen(e...
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
nss can use the cka_label attribute to identify user certificates (see previous question) and presents this label to the user.
...the motivation for this is that some hardware tokens will prevent extraction of symmetric keys by design.
PKCS #11 Module Specs
when this flag is not specified, softoken will allocate large tables to prevent lock contention.
...when this flag is not specified, softoken will allocate large tables to prevent lock contention.
FC_GetTokenInfo
ulsessioncount: number of sessions that this application currently has open with the token ulrwsessioncount: number of read/write sessions that this application currently has open with the token hardwareversion: hardware version number, for example, 8.3 (major=0x08, minor=0x03), which are the version numbers of the certificate and key databases, respectively.
... firmwareversion: firmware version number, 0.0 (major=0x00, minor=0x00).
NSS tools : modutil
please contribute to the initial review in mozilla nss bug 836477[1] description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens.
... the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o secmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously.
sslcrt.html
to obtain the value to pass in the wincx parameter, call ssl_revealpinarg.
...to obtain the value to pass in the wincx parameter, call ssl_revealpinarg.
sslintro.html
if ssl can locate the information about a previous connection in the local session cache, it can reestablish the connection much more quickly than it can without the connection information.
... callback functions, including these: cert_checkcertvalidtimes cert_getdefaultcertdb cert_destroycertificate cert_dupcertificate cert_findcertbyname cert_freenicknames cert_getcertnicknames cert_verifycertname cert_verifycertnow pk11_findcertfromnickname pk11_findkeybyanycert pk11_setpasswordfunc pl_strcpy pl_strdup pl_strfree pl_strlen ssl_peercertificate ssl_revealurl ssl_revealpinarg cleanup this portion of an ssl-enabled application consists primarily of closing the socket and freeing memory.
NSS Tools modutil
: netscape internal pkcs #11 modulelibrary file: **internal only module**manufacturer: netscape communications corp description: communicator internal crypto svcpkcs #11 version 2.0library version: 4.0cipher enable flags: nonedefault mechanism flags: rsa:dsa:rc2:rc4:des:sha1:md5:md2slot: communicator internal cryptographic services version 4.0manufacturer: netscape communications corp type: softwareversion number: 4.1firmware version: 0.0status: enabledtoken name: communicator generic crypto svcstoken manufacturer: netscape communications corp token model: libsec 4.0 token serial number: 0000000000000000token version: 4.0token firmware version: 0.0access: write protectedlogin type: public (no login required)user pin: not initializedslot: communicator user private key and certificate servicesm...
...anufacturer: netscape communications corp type: softwareversion number: 3.0firmware version: 0.0status: enabledtoken name: communicator certificate db token manufacturer: netscape communications corp token model: libsec 4.0 token serial number: 0000000000000000token version: 7.0token firmware version: 0.0access: not write protectedlogin type: login requireduser pin: not initialized setting a default provider this example makes the specified module a default provider for the rsa, dsa, and rc2 security mechanisms: modutil -default "cryptographic module" -dbdir c:\databases -mechanisms rsa:dsa:rc2 the security module database tool displays a warning: warning: performing this operation while communicator is running couldcause corruption of your security databases.
NSS tools : signver
MozillaProjectsNSStoolssignver
signver -v -s signature_file -i signed_file -d sql:/home/my/sharednssdb signaturevalid=yes printing signature data the -a option prints all of the information contained in a signature file.
... the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o secmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously.
Rebranding SpiderMonkey (1.8.5)
after installing the build pre-requisites and downloading the spidermonkey source tarball issue the following commands at the terminal: cd js/src autoconf-2.13 for the remainder of this document wherever you see the text $brand you will substitute that text with the name of your brand.
...if you have failed to insert your brand name in any of the previous steps where it is called for, you must delete this build directory and restart this process from the beginning.
Exact Stack Rooting
by using js::handlet in the interface instead of direct gcpointers, we ensure that the gcthing is already rooted on some previous stack frame, freeing us from having to worry about rooting the gcthing for the duration of the call.
...this prevents an entire class of bugs where return values are not rooted properly before the next js-api call.
JIT Optimization Outcomes
singleton one of the types present in the typeset was a singleton type, preventing the optimization from being enabled.
... unboxedconvertedtonative the object whose property is being accessed was previously unboxed but was deoptimized and converted to a native object.
JSAPI Cookbook
*/ js::autosaveexceptionstate savedstate(cx); if (!js_callfunctionname(cx, global, "cleanup", 0, null, &r)) { /* the new error replaces the previous one, so discard the saved exception state.
...specify writable: false to make the property read-only and configurable: false to prevent it from being deleted or redefined.
JSNewEnumerateOp
jsenumerate_next a previously allocated opaque iterator state is passed in via statep.
... jsenumerate_destroy destroy the opaque iterator state previously allocated in *statep by a call to this function when enum_op was jsenumerate_init or jsenumerate_init_all.
JSVAL_LOCK
locks a js value to prevent garbage collection on it.
...jsval_lock locks a js value, v, to prevent the value from being garbage collected.
JS_ClearContextThread
js_setcontextthread returns the thread id of the thread previously associated with this context.
... when the function is used properly, the return value is always zero, indicating that no thread was previously associated with the context.
JS_DropExceptionState
destroys a jsexceptionstate object previously created using js_saveexceptionstate.
...this object should previously have been created using js_saveexceptionstate.
JS_NewExternalString
this must be an id number previously returned by a successful call to js_addexternalstringfinalizer.
...if you use this as a pointer, you should clean it up in the external string finalizer that was previously set up using js_addexternalstringfinalizer.
JS_PopArguments
mark void * pointer to a void * which holds the stack frame pointer previously supplied by js_pusharguments.
... description js_poparguments frees the stack frame pointer previously allocated by js_pusharguments and unroots the jsvals which have been associated with it (those returned by js_pusharguments as well).
JS_RestoreExceptionState
restores the exception state from a jsexceptionstate object previously created using js_saveexceptionstate.
... description this function permits to restore any previously saved exception state which was saved into a jsexceptionstate object created by the js_saveexceptionstate function.
JS_SealObject
prevent modification of object fields.
... description js_sealobject prevents all write access to the object, either to add a new property, delete an existing property, or set the value or attributes of an existing property.
JS_SetContextCallback
for example, the callback my call js_getcontextprivate(cx) in order to free up resources previously allocated by js_setcontextprivate.
...this function returns the previous context callback, if any, else null.
JS_SetProperty
if obj is a proxy, the js_setproperty [[set]] internal method defined in es2015 (rev 29 9.5.9) is performed.
... otherwise, [[set]] internal method defined in es2015 (rev 29 9.1.9) is performed.
JS_malloc
p void * (js_realloc and js_free only) pointer to a previously allocated region of memory to resize or deallocate.
...js_free deallocates a region of memory allocated a previous call to js_malloc, js_realloc, or js_strdup.
Mozilla Projects
these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions.
...to that end, this document will be revised over time as we find new and better ways of helping developers.
A Web PKI x509 certificate primer
the attributes of the certificates in the verification path have valid parameters for that verification (for example the validity period of all the certificates are valid for the time the verification is being done) revocation checks are considered ok for that particular validation.
... authority information access this extension is primarily used to to describe the ocsp location for revocation checking.
Setting up an update server
this is a security measure designed to prevent anyone from serving malicious updates.
... installing the update you may want to start by deleting any pending updates to ensure that no previously found updates interfere with installing the desired update.
AT Development
this article (from 2007) reviews the progress and technology as it has developed.
... accessibility architecture how the accessibility hierarchy is implemented in mozilla (some issues aren't addressed by previous guide).
XPCOM array guide
MozillaTechXPCOMGuideArrays
array guidelines here are a few simple rules which will keep your code clean and your developers happy: use typesafe arrays like nscomarray<t> nstarray<t> wherever possible.
...good thing the interface is under review.
Component Internals
« previousnext » where the previous chapter described components from the perspective of a client of xpcom components, this chapter discusses components from the perspective of the software developer.
... « previousnext » copyright (c) 2003 by doug turner and ian oeschger.
Packaging WebLock
« previousnext » in this final part of the tutorial, we'll put all of the pieces of the web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be installed on other systems.
... « previousnext » copyright (c) 2003 by doug turner and ian oeschger.
Preface
although basic ideas such as inheritance and encapsulation should be familar to you, wherever possible they are explained in the book as they are used.
... acknowledgements thanks to peter lubczynski, john gaunt, ellen evans, and alec flett for technical reviews.
Resources
« previous this last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the gecko developer.
...etscape portable runtime environment embedding mozilla current module owners xpinstall xul xpcom resources the xpcom project page xulplanet's online xpcom reference information on xpconnect and scriptable components the smart pointer guide xpidl xpidl compiler reference general development resources the world wide web consortium url specification at the w3 gnu make « previous copyright (c) 2003 by doug turner and ian oeschger.
Setting up the Gecko SDK
« previousnext » this chapter provides basic setup information for the gecko software development kit (sdk) used to build the weblock component in this tutorial.
...t: %.idl $(xpidl) -m typelib $(gecko_includes) $< %.o: %.cpp makefile $(cxx) -c $(cppflags) $(cxxflags) $(gecko_config_include) $(gecko_defines) $(gecko_includes) $< $(module).so: $(xpidlsrcs:%.idl=%.h) $(xpidlsrcs:%.idl=%.xpt) $(cppsrcs:%.cpp=%.o) $(cxx) -o $@ -wl,-soname=$(module).so $(cppsrcs:%.cpp=%.o) $(gecko_ldflags) chmod +x $@ build: $(module).so clean: rm $(module).so « previousnext » copyright (c) 2003 by doug turner and ian oeschger.
Receiving startup notifications
registering with the category manager to register with the category manager, simply call its nsicategorymanager.addcategoryentry() method: categorymanager->addcategoryentry(appstartup_category, "mycomponentname", "contract-id", pr_true, pr_true, getter_copies(previous)); this causes your component to be instantiated using nsicomponentmanager.createinstance().
... if you want your component to be started as a service, prepend "service," to the contract id: categorymanager->addcategoryentry(appstartup_category, "mycomponentname", "service,contract-id", pr_true, pr_true, getter_copies(previous)); with "service," specified, the component is instantiated using nsicomponentmanager.getservice().
Components.classes
note that components.classes reflects only those component classes that have been previously installed and registered with the component manager using contractids.
... shortcuts it's a common practice to abbreviate components.classes and components.interfaces by storing a reference to the object as a constant: const cc = components.classes, ci = components.interfaces; var os = cc["@mozilla.org/observer-service;1"] .getservice(ci.nsiobserverservice); a less known trick, useful when creating multiple instances of the same component, is to use the new operator on the class object: var clazz = ...
Language bindings
it returns a reference to the clone:components.utils.createobjectincomponents.utils.createobjectin creates a new javascript object in the scope of the specified object's compartment.components.utils.evalinsandboxthe evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.components.utils.evalinwindowthis function enables code running in a more-privileged javascript context to evaluate a string in a less-privileged javascript context.
...this can be particularly handy with restartless (boostrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.components.utils.unwaivexraysundo a previous call to components.utils.waivexrays(), restoring xray vision for the caller.components.utils.waivexrayswaives xray vision for an object, giving the caller a transparent wrapper to the underlying object.javaxpcomjavaxpcom allows for communication between java and xpcom, such that a java application can access xpcom objects, and xpcom can access any java class that implements an xpcom interface...
IAccessibleTable
selectcolumn() selects a column and unselects all previously selected columns.
...selectrow() selects a row and unselects all previously selected rows.
IAccessibleTable2
selectcolumn() selects a column and unselects all previously selected columns.
...selectrow() selects a row and unselects all previously selected rows.
imgILoader
libpr0n does not keep a strong ref to the observer; this prevents reference cycles.
...libpr0n does not keep a strong ref to the observer; this prevents reference cycles.
mozIStorageConnection
return value returns the previous registered handler.
... return value returns the previous registered handler, or null if none was previously registered.
nsIAccessible
nsiaccessible.parent to get the parent accessible nsiaccessible.nextsibling, nsiaccessible.previoussibling to get sibling accessibles nsiaccessible.firstchild, nsiaccessible.lastchild to get first and last child nsiaccessible.children, nsiaccessible.getchildat(), nsiaccessible.childcount to navigate through the children by index accessible position you can use nsiaccessible.indexinparent to get accessible index in its parent.
... previoussibling previous sibling in accessible tree.
nsIAccessibleRelation
note: the label and description (see relation_described_by) relations may be used to prevent redundant information from being presented by the screen reader, since the label and description can occur both on their own, and in the name or description fields of an nsiaccessible.
... note: the label (see relation_labelled_by) and description relations may be used to prevent redundant information from being presented by the screen reader, since the label and description can occur both on their own, and in the name or description fields of an nsiaccessible.
nsIAccessibleTable
selectcolumn() select a column and unselects all previously selected columns.
... selectrow() select a row and unselects all previously selected rows.
nsIAppShell
the default is to prevent native event starvation.
...when the number of calls that pass pr_true is subtracted from the number of calls that pass pr_false is greater than 0, performance is given precedence over preventing event starvation.
nsICachingChannel
holding a reference to this key does not prevent the cached data from being removed.
...holding a reference to this token prevents the cached data from being removed.
nsICategoryManager
return value the previous value for the given category entry (if any).
...let categorymanager = cc['@mozilla.org/categorymanager;1']; categorymanager.getservice(ci.nsicategorymanager).deletecategoryentry('gecko-content-viewers', content_type, false); // update pref manager to prevent plugins from loading in future var stringtypes = ''; var types = []; var pref_disabled_plugin_types = 'plugin.disable_full_page_plugin_for_types'; if (services.prefs.prefhasuservalue(pref_disabled_plugin_types)) { stringtypes = services.prefs.getcharpref(pref_disabled_plugin_types); } if (stringtypes !== '') { types = stringtypes.split(','); } if (types.indexof(content_type) === -1) ...
nsIClipboardDragDropHooks
use this to do things such as prevent a drag from starting, adding or removing data and flavors, or preventing the drop.
...allowstartdrag() prevents the drag from starting.
nsICommandLine
preventdefault boolean there may be a command-line handler which performs a default action if there was no explicit action on the command line (open a default browser window, for example).
... this flag allows the default action to be prevented.
nsICookie
constants constant value description status_unknown 0 the cookie collected in a previous session, and its information no longer exists.
... policy_unknown 0 the cookie collected in a previous session, and its information no longer available.
nsICookieService
note: this function is redundant and will most likely be removed in a future revision of this interface.
... note: this function is redundant and will most likely be removed in a future revision of this interface.
nsICryptoHash
the result is computed as a hex string as in the previous example.
...as in the previous example, we convert the binary result to a hex string.
nsILoginManager
to create an instance, use: var loginmanager = components.classes["@mozilla.org/login-manager;1"] .getservice(components.interfaces.nsiloginmanager); method overview void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); boolean fillform(in nsidomhtmlformelement aform); void findlogins(out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); vo...
... nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement ); parameters asearchstring missing description apreviousresult missing description aelement missing description return value missing description countlogins() returns the number of logins matching the specified criteria.
nsINavHistoryResult
this is used to prevent rapid flickering of changes when performing batch or temporary operations on the result structure.
... removeobserver() removes an observer that was added by a previous call to addobserver().
nsINavHistoryResultTreeViewer
1.0 66 introduced gecko 1.8 inherits from: nsinavhistoryresultobserver last changed in gecko 1.9 (firefox 3) this object removes itself from the associated result when the tree is detached; this prevents circular references.
...this prevents you from seeing multiple entries for things when you have selected to get visits.
nsIPermissionManager
this must have been previously registered using the add() method.
...this must have been previously registered using the add() method.
Component; nsIPrefBranch
aobserver an observer previously registered with addobserver.
...unlocking a previously locked preference allows the preference service to once again return the user set value of the preference.
nsIPrincipal
void revertcapability(in string capability, inout voidptr annotation); native code only!
... native code only!iscapabilityenabled boolean iscapabilityenabled( in string capability, in voidptr annotation ); parameters capability missing description annotation missing description return value missing description exceptions thrown missing exception missing description native code only!revertcapability void revertcapability( in string capability, inout voidptr annotation ); parameters capability missing description annotation missing description exceptions thrown missing exception missing description native code only!setcanenablecapability void setcanenablecapability( in string capability, in short canenable ); parameters capability mi...
nsIPrintingPrompt
isforprinting true - for printing, false for print preview.
...if false is returned it means the observer (usually the caller) shouldn't wait for print preview progress there is intermediate progress.
nsIProtocolProxyService
use resolveasync instead previous doc this method returns a nsiproxyinfo instance that identifies a proxy to be used for loading the given uri.
...a proxy is disabled if it had previously failed-over to another proxy (see getfailoverforproxy()).
nsIScreen
lockminimumbrightness() locks the minimum brightness of the screen, preventing it from becoming any dimmer than that brightness level.
... unlockminimumbrightness() releases a lock on the minimum brightness of the screen, which was previously established through a corresponding call to lockminimumbrightness().
nsIScriptableIO
nsiinputstream: a stream returned by a previous call to this method, or any other object that implements nsiinputstream.
... nsioutputstream: a stream returned by a previous call to this method, or any other object that implements nsioutputstream.
nsIStreamListener
aoffset number of bytes that were sent in previous ondataavailable() calls for this request.
... in other words, the sum of all previous count parameters.
nsITransaction
boolean merge( in nsitransaction atransaction ); parameters atransaction the previously executed transaction to merge.
...can only be called on a transaction that was previously undone.
nsITreeBoxObject
prevents scrolling off the end of the tree.
...this method prevents scrolling off the end of the tree.
nsIUpdate
ideally, this page is not the release notes but some other page that summarizes the differences between this update and the previous, which also links to the release notes.
... previousappversion astring the application version prior to the application being updated.
nsIWebBrowser
the embedder may set this property to their own implementation if they intend to override or prevent how certain kinds of content are loaded.
... removewebbrowserlistener() removes a previously registered listener.
nsIWebProgress
removeprogresslistener() removes a previously registered listener of progress events.
... void removeprogresslistener( in nsiwebprogresslistener alistener ); parameters alistener the listener interface previously registered with a call to addprogresslistener().
nsIWindowMediator
note: starting in gecko 8.0, the returned value is an nsidomwindow; previously, it was an nsidomwindowinternal.
...note this interface makes no requirement that a window couldn't be revisited if windows are re-ordered while z-order enumerators are active.
nsIXPCScriptable
jsenumerate_next a previously allocated opaque iterator state is passed in via statep.
... jsenumerate_destroy this function should destroy the opaque iterator state previously allocated in statep by this function when enum_op was jsenumerate_init.
nsIXULTemplateBuilder
templates may generate content recursively, using the same template, but with the previous iteration's results as the reference point.
...templates may generate content recursively, using the previous iteration's results as reference point to invoke the same queries.
XPCOM Interface Reference
mstorageeventobsoletensidomstorageitemnsidomstoragelistnsidomstoragemanagernsidomstoragewindownsidomuserdatahandlernsidomwindownsidomwindow2nsidomwindowinternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionnsidomxpathresultnsidomxulcontrolelementnsidomxulelementnsidomxullabeledcontrolelementnsidomxulselectcontrolelementnsidomxulselectcontrolitemelementnsidatasignatureverifiernsidebugnsidebug2nsidevicemotionnsidevicemotiondatansidevicemotionlistenernsidialogcreatornsidialogparamblocknsidictionarynsidirindexnsidirindexlistenernsidirindexparsernsidirectoryenumeratornsidirectoryiteratornsidirectoryservicensidirectoryserviceprovidernsidirectoryserviceprovider2nsidiskcachestreaminternalnsidispatchsupportnsidocshellnsidocumentloadernsidownloadnsidownloadhistorynsidown...
...ortsdoublensisupportsfloatnsisupportsidnsisupportsinterfacepointernsisupportsprboolnsisupportsprint16nsisupportsprint32nsisupportsprint64nsisupportsprtimensisupportspruint8nsisupportspruint16nsisupportspruint32nsisupportspruint64nsisupportsprimitivensisupportsprioritynsisupportsstringnsisupportsvoidnsisupportsweakreferencensisyncjpakensisyncmessagesendernsitxttohtmlconvnsitaggingservicensitaskbarpreviewnsitaskbarpreviewbuttonnsitaskbarpreviewcontrollernsitaskbarprogressnsitaskbartabpreviewnsitaskbarwindowpreviewnsitelemetrynsitextinputprocessornsitextinputprocessorcallbacknsitextinputprocessornotificationnsithreadnsithreadeventfilternsithreadinternalnsithreadmanagernsithreadobservernsithreadpoolnsithreadpoollistenernsitimernsitimercallbacknsitoolkitnsitoolkitprofilensitoolkitprofileservicensi...
XPCOM ownership guidelines
parents own their children (and not the reverse).
... containers own the things they contain (and not the reverse).
XPCOM
if you have a class that you think is involved in a cyclical-ownership leak, this page is for you.introduction to xpcom for the domwarning: this document has not yet been reviewed by the dom gurus, it might contain some errors.language bindingsan xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.monitoring http activitygecko includes the nsihttpactivityobserver int...
...this implementation will allow you to get(), set(), define(), and undefine() nsifile.using nsipasswordmanagertechnical review completed.using nsisimpleenumeratorusing the clipboardthis section provides information about cutting, copying, and pasting to and from the clipboard.using the gecko sdkweak referencein xpcom, a weak reference is a special object that contains a pointer to an xpcom object, but doesnot keep that object alive.
XPIDL Syntax
MozillaTechXPIDLSyntax
status of this document this is a partial reverse-engineering of the libidl source code's parser, limited mostly to the subset of functionality that is supported by the mozilla xpidl binary.
...unlike the c preprocessor, when a file is included multiple times, it acts as if the subsequent includes did not happen; this prevents the need for include guards.
XPIDL
note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk.
...if a method is declared notxpcom, the mangling of the return type is prevented, so it is called mostly as it looks.
Index
43 mailnews and mail code review requirements this document describes the process for reviewing patches to the mozilla/mailnews and mozilla/mail directories.
... 55 thunderbird binaries branch, trunk, comm-central, thunderbird described below are three types of generally available thunderbird packages - releases, early preview releases, and nightly builds (including trunk development builds) - and their downloaded locations.
Creating a Custom Column
looking in messenger.xul reveals that the columns reside inside a tree with the id "threadtree" whose columns (treecols) reside in "threadcols".
... as you develop your custom extension, please revisit this article and add any helpful hints that you find along the way!
Activity Manager examples
" is processed", null, "no junk found", process.starttime, // start time date.now()); // completion time event.contexttype = process.contexttype; // optional event.contextobj = process.contextobj; // optional gactivitymanager.addactivity(event); showing a user-defined activity with cancel capability (javascript) this sample improves the previous one by providing an nsiactivitycancelhandler to allow the user to cancel the process.
... // assuming that the initiator has some way to cancel // the junk processing for given folder if (initiator.cancelfolderop(folder)) { aactivity.state = components.interfaces.nsiactivityprocess.state_canceled; gactivitymanager.removeactivity(aactivity.id); return cr.ns_success; } } return cr.ns_failure; } } // step 2: modify the previous sample to add initiator, subject // and associate a nsiactivitycancelhandler component ...
Theme Packaging
theme file layout thunderbird themes are packaged in an xpi file with the following structure: theme.xpi: install.rdf preview.png icon.png chrome/ browser/files communicator/files global/files mozapps/files ...
... preview.png is a preview image which will show when double-clicked on a theme in the appearance section of the add-ons manager.
Browser Side Plug-in API - Plugins
« previousnext » this chapter describes methods in the plug-in api that are available from the browser.
... netscape plug-in method summary « previousnext » npn_destroystream closes and deletes a stream.
Constants - Plugins
« previous this section is a reference to the program definitions used by the plug-in api.
... « previous ...
Plug-in Side Plug-in API - Plugins
« previousnext » this chapter describes methods in the plug-in api that are available for the plug-in object.
... « previousnext » ...
Structures - Plugins
« previousnext » this chapter describes the data structures that are used to represent the various objects in the plug-in api.
... « previousnext » ...
URLs - Plugins
« previousnext » this chapter describes retrieving urls and displaying them on specified target pages, posting data to an http server, uploading files to an ftp server, and sending mail.
... « previousnext » ...
Version, UI, and Status Information - Plugins
« previousnext » this chapter describes the functions that allow a plug-in to display a message on the status line, get agent information, and check on the current version of the plug-in api and the browser.
... « previousnext » ...
Accessibility Inspector - Firefox Developer Tools
items with nested children have arrows that can be clicked to reveal the children, so you can move deeper into the hierarchy.
...note, however, that if you hold the shift key down when "performing a pick", you can "preview" the accessibility object in the tree (and its properties in the right-hand pane), but then continue picking as many times as you like (the picker does not get cancelled) until you release the shift key.
DOM Inspector internals - Firefox Developer Tools
these overlays are: browseroverlay.xul tasksoverlay-cz.xul tasksoverlay-ff.xul tasksoverlay-mobile.xul tasksoverlay-sb.xul tasksoverlay-tb.xul tasksoverlay.xul venkmanoverlay.xul prefs/prefsoverlay.xul further examination of the chrome manifest will reveal that dom inspector also uses conditional overlays on its primary window: overlay chrome://inspector/content/inspector.xul chrome://communicator/content/utilityoverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} overlay chrome://inspector/content/inspector.xul chrome://communicator/content/tasksoverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} overlay chrome://inspect...
... shared structure overlays taking a look at the contents of inspector.xul, dom inspector's primary ui, will reveal that it contains almost no visible elements.
Debugging service workers - Firefox Developer Tools
from updating your service worker: if your service worker has previously been installed, but then a new version of the worker is available on refresh or page load, the new version is installed in the background, but not yet activated.
...when you fill up the cache with assets, but then want to alter the behavior slightly, you previously had to manually write code to empty the cache, and then fill it again.
Break on DOM mutation - Firefox Developer Tools
inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
Step through code - Firefox Developer Tools
inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
Set an XHR breakpoint - Firefox Developer Tools
inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
Set event listener breakpoints - Firefox Developer Tools
inline variable preview new in firefox 71, the source pane now gives you an instant preview of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable preview for more information.
UI Tour - Firefox Developer Tools
the name of the selected directory is shown at the top of the source list pane; clicking this name reverts the pane to showing all source items.
... inline variable preview: enabled by default, this option displays variable values within the source pane when the debugger is paused.
Debugger - Firefox Developer Tools
setting this to false prevents this debugger instance from requiring any code coverage instrumentation, but it does not guarantee that the instrumentation is not present.
... unlike findscripts, this function is deterministic and will never return debugger.objects referring to previously unreachable objects that had not been collected yet.
Index - Firefox Developer Tools
72 view background images in the rules view, you can see a preview of images specified using background-image.
...starting in firefox 80, a disclosure triangle within the tooltip reveals a stack trace.
Inspecting web sockets - Firefox Developer Tools
clicking on a web socket request opens the usual sidebar to reveal additional details.
... expanding each message selecting a message in the list shows a preview of the data being sent in that message, at the bottom of the response pane.
Examine and edit HTML - Firefox Developer Tools
if a shadow dom contains a "slotted" element (an element with a slot attribute after it has been inserted inside a <slot> element — see adding flexibility with slots for an explanation of how these are used), the "slotted" element will be shown inside its corresponding <slot> element, with a "reveal" link alongside it.
... clicking the "reveal" link will highlight the element with the slot attribute as it exists outside the shadow dom this is very useful when you've got a <slot> element and you can't find the source of its content.
Settings - Firefox Developer Tools
uncheck this box to prevent this behavior.
... note that this option was called "disable cache" in firefox versions previous to 49, but it was renamed to make it clearer that this affects the http cache, and not service workers/the cache api.
Style Editor - Firefox Developer Tools
this makes it easy to experiment with, revise, and test changes.
... this means that if you use, for example, sass, then the style editor will show you, and allow you to edit, sass files, rather than the css that is generated from them: for this to work, you must: use a css preprocessor that understands the source map revision 3 proposal.
Web console keyboard shortcuts - Firefox Developer Tools
put (only if the command line is empty) end end end page up through console output page up page up page up page down through console output page down page down page down go backward through command history up arrow up arrow up arrow go forward through command history down arrow down arrow down arrow initiate reverse search through command history/step backwards through matching commands f9 ctrl + r f9 step forward through matching command history (after initiating reverse search) shift + f9 ctrl + s shift + f9 move to the beginning of the line home ctrl + a ctrl + a move to the end of the line end ctrl + e ctrl + e execute the curren...
... add a new line, for entering multiline expressions shift + enter shift + return shift + enter autocomplete popup these shortcuts apply while the autocomplete popup is open: command windows macos linux choose the current autocomplete suggestion tab tab tab cancel the autocomplete popup esc esc esc move to the previous autocomplete suggestion up arrow up arrow up arrow move to the next autocomplete suggestion down arrow down arrow down arrow page up through autocomplete suggestions page up page up page up page down through autocomplete suggestions page down page down page down scroll to start of autocomplete suggestions home home ...
Animation.playbackRate - Web APIs
negative values reverse the animation.
... examples in the growing/shrinking alice game example, clicking or tapping the bottle causes alice's growing animation (alicechange) to reverse, causing her to shrink: var shrinkalice = function() { alicechange.playbackrate = -1; alicechange.play(); } // on tap or click, alice will shrink.
Attr - Web APIs
WebAPIAttr
you should revise your code accordingly.
... previoussibling this property now always returns null.
AudioParam - Web APIs
the change starts at the time specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
...the change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
BaseAudioContext.createConvolver() - Web APIs
the createconvolver() method of the baseaudiocontext interface creates a convolvernode, which is commonly used to apply reverb effects to your audio.
...the example below uses a short sample of a concert hall crowd, so the reverb effect applied is really deep and echoey.
Cache.delete() - Web APIs
WebAPICachedelete
ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
Cache.keys() - Web APIs
WebAPICachekeys
ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
Cache.match() - Web APIs
WebAPICachematch
ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e.
Cache.matchAll() - Web APIs
WebAPICachematchAll
ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e.
CacheStorage.match() - Web APIs
ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
CanvasRenderingContext2D.drawWindow() - Web APIs
notes: if "rgba(0,0,0,0)" is used for the background color, the drawing will be transparent wherever the window is transparent.
... ted mielczarek's tab preview extension uses this technique in chrome to provide thumbnails of web pages, and the source is available for reference.
CanvasRenderingContext2D.globalAlpha - Web APIs
values outside that range, including infinity and nan, will not be set, and globalalpha will retain its previous value.
... with each new circle, the opacity of the previous circles underneath is effectively increased.
Basic usage of canvas - Web APIs
« previousnext » let's start this tutorial by looking at the <canvas> html element itself.
... ctx = canvas.getcontext('2d'); ctx.fillstyle = 'rgb(200, 0, 0)'; ctx.fillrect(10, 10, 50, 50); ctx.fillstyle = 'rgba(0, 0, 200, 0.5)'; ctx.fillrect(30, 30, 50, 50); } } </script> </head> <body onload="draw();"> <canvas id="canvas" width="150" height="150"></canvas> </body> </html> this example looks like this: screenshotlive sample « previousnext » ...
Compositing example - Web APIs
o = [ 'source-over','source-in','source-out','source-atop', 'destination-over','destination-in','destination-out','destination-atop', 'lighter', 'copy','xor', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity' ].reverse(); var gcotext = [ 'this is the default setting and draws new shapes on top of the existing canvas content.', 'the new shape is drawn only where both the new shape and the destination canvas overlap.
...trast.', 'preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.', 'preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.', 'preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.', 'preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.' ].reverse(); var width = 320; var height = 340; main program when the page loads, this code runs to set up and run the example: window.onload = function() { // lum in srgb var lum = { r: 0.33, g: 0.33, b: 0.33 }; // resize canvas canvas1.width = width; canvas1.height = height; canvas2.width = width; canvas2.height = height; lightmix() ...
Compositing and clipping - Web APIs
« previousnext » in all of our previous examples, shapes were always drawn one on top of the other.
... screenshotlive sample « previousnext » ...
Drawing text - Web APIs
« previousnext » after having seen how to apply styles and colors in the previous chapter, we will now have a look at how to draw text onto the canvas.
... « previousnext » ...
Finale - Web APIs
WebAPICanvas APITutorialFinale
« previous congratulations!
... « previous ...
Using channel messaging - Web APIs
ame to load iframe.addeventlistener("load", onload); function onload() { // listen for button clicks button.addeventlistener('click', onclick); // listen for messages on port1 port1.onmessage = onmessage; // transfer port2 to the iframe iframe.contentwindow.postmessage('init', '*', [channel.port2]); } // post a message on port1 when the button is clicked function onclick(e) { e.preventdefault(); port1.postmessage(input.value); } // handle messages received on port1 function onmessage(e) { output.innerhtml = e.data; input.value = ''; } we start off by creating a new message channel by using the messagechannel() constructor.
... when our button is clicked, we prevent the form from submitting as normal and then send the value entered in our text input to the iframe via the messagechannel.
ConvolverNode.buffer - Web APIs
the buffer property of the convolvernode interface represents a mono, stereo, or 4-channel audiobuffer containing the (possibly multichannel) impulse response used by the convolvernode to create the reverb effect.
...for example, if you want to model the reverb in your bathroom, you might set up a microphone near the door to record the sound of a balloon pop or synthesized impulse from the sink.
DataTransfer.items - Web APIs
style> <script> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("...
...items[" + i + "].kind = " + ev.datatransfer.items[i].kind + " ; type = " + ev.datatransfer.items[i].type); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </script> <body> <h1>examples of <code>datatransfer</code>.{<code>types</code>, <code>items</code>} properties</h1> <ul> <li id="i1" ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the...
DataTransfer.types - Web APIs
style> <script> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfer.types != null) { for (var i=0; i < ev.datatransfer.types.length; i++) { console.log("...
...items[" + i + "].kind = " + ev.datatransfer.items[i].kind + " ; type = " + ev.datatransfer.items[i].type); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </script> <body> <h1>examples of <code>datatransfer</code>.{<code>types</code>, <code>items</code>} properties</h1> <ul> <li id="i1" ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the...
DataTransferItemList.DataTransferItem() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind ...
...drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; // clear any remaining drag data datalist.clear(); } html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it...
DataTransferItemList.add() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].ki...
...drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } result result link specifications specification status com...
DataTransferItemList.clear() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].ki...
...drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } result result link specifications specification status comment ...
DataTransferItemList.length - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind ...
...drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; // clear any remaining drag data datalist.clear(); } html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it...
DataTransferItemList.remove() - Web APIs
paragraph ...</p>", "text/html"); datalist.add("http://www.example.org","text/uri-list"); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; // loop through the dropped items and log their data for (var i = 0; i < data.length; i++) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].ki...
...drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } html <h1>example uses of <code>datatransferitemlist</code> methods and property</...
Document.createElementNS() - Web APIs
optionsoptional an optional elementcreationoptions object containing a single property named is, whose value is the tag name for a custom element previously defined using customelements.define().
... for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name.
Document: drag event - Web APIs
on the dragged elem dragged = event.target; // make it half transparent event.target.style.opacity = .5; }, false); document.addeventlistener("dragend", function(event) { // reset the transparency event.target.style.opacity = ""; }, false); /* events fired on the drop targets */ document.addeventlistener("dragover", function(event) { // prevent default to allow drop event.preventdefault(); }, false); document.addeventlistener("dragenter", function(event) { // highlight potential drop target when the draggable element enters it if (event.target.classname == "dropzone") { event.target.style.background = "purple"; } }, false); document.addeventlistener("dragleave", function(event) { // reset background of potential drop...
... target when the draggable element leaves it if (event.target.classname == "dropzone") { event.target.style.background = ""; } }, false); document.addeventlistener("drop", function(event) { // prevent default action (open as link for some elements) event.preventdefault(); // move dragged elem to the selected drop target if (event.target.classname == "dropzone") { event.target.style.background = ""; dragged.parentnode.removechild( dragged ); event.target.appendchild( dragged ); } }, false); specifications specification status comment html living standardthe definition of 'drag event' in that specification.
Document.exitFullscreen() - Web APIs
the document method exitfullscreen() requests that the element on this document which is currently being presented in full-screen mode be taken out of full-screen mode, restoring the previous state of the screen.
... this usually reverses the effects of a previous call to element.requestfullscreen().
Introduction to the DOM - Web APIs
note: because the vast majority of code that uses the dom revolves around manipulating html documents, it's common to refer to the nodes in the dom as elements, although strictly speaking not every node is an element.
...these elements may also have specific interfaces for dealing with the kind of data those elements hold, as in the table object example in the previous section.
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
for example, if you want to create a new <p> element as a child of the <body> element, you can use the mybody in the previous example and append a new element node.
... reviewing the html table structure creating element nodes and inserting them into the document tree the basic steps to create the table in sample1.html are: get the body object (first item of the document object).
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
forwards makes the rabbit retain its last keyframe rather than reverting to its unanimated state: // create a set of keyframes to slide the rabbit down the hole--and keep him down with 'fill'!
...when used to persist the effect of an animation indefinitely, however, they have a number of drawbacks: the forwards fill of an animation (or backwards fill if the animation is playing in reverse) will continue to override any changes to specified style indefinitely which can lead to confusing behavior.
Element: DOMMouseScroll event - Web APIs
bubbles yes cancelable yes interface mousescrollevent if you want to prevent the default action of mouse wheel events, it's not enough to handle only this event on gecko because if scroll amount by a native mouse wheel event is less than 1 line (or less than 1 page when the system setting is by page scroll), other mouse wheel events may be fired without this event.
... on gecko 17 (firefox 17) or later, you need to call preventdefault() of wheel events which must be fired for every native event.
Element.animate() - Web APIs
WebAPIElementanimate
direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
... replace overwrites the previous value with the new one.
Element.classList - Web APIs
WebAPIElementclassList
string.prototype.trim polyfill if (!"".trim) string.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+$/g, ''); }; (function(window){"use strict"; // prevent global namespace pollution if(!window.domexception) (domexception = function(reason){this.message = reason}).prototype = new error; var wsre = /[\11\12\14\15\40]/, wsindex = 0, checkifvalidclasslistentry = function(o, v) { if (v === "") throw new domexception( "failed to execute '" + o + "' on 'domtokenlist': the token provided must not be empty." ); if((wsindex=v.search(wsre))!==-1) t...
...prop !== "classlist") return; skippropchange = 1, target.classlist = restokenlist, target.classname = strval; skippropchange = 0, restokenlist.length = tokens.length - sub; } } function polyfillclasslist(ele){ if (!ele || !("innerhtml" in ele)) throw typeerror("illegal invocation"); ele.detachevent( "onpropertychange", whenpropchanges ); // prevent duplicate handler infinite loop allowtokenlistconstruction = 1; try{ function protoobj(){} protoobj.prototype = new domtokenlist(); } finally { allowtokenlistconstruction = 0 } var protoobjproto = protoobj.prototype, restokenlist = new protoobj(); a: for(var toks=ele.classname.trim().split(wsre), ci=0, clen=toks.length, sub=0; ci !== clen; ++ci){ ...
Element: copy event - Web APIs
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault().
...v> css div.source, div.target { border: 1px solid gray; margin: .5rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const source = document.queryselector('div.source'); source.addeventlistener('copy', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.tostring().touppercase()); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
warning: if your project is one that will undergo any form of security review, using innerhtml most likely will result in your code being rejected.
... for example, if you use innerhtml in a browser extension and submit the extension to addons.mozilla.org, it will not pass the automated review process.
Element: paste event - Web APIs
to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually.
....queryselector('div.target'); target.addeventlistener('paste', (event) => { let paste = (event.clipboarddata || window.clipboarddata).getdata('text'); paste = paste.touppercase(); const selection = window.getselection(); if (!selection.rangecount) return false; selection.deletefromdocument(); selection.getrangeat(0).insertnode(document.createtextnode(paste)); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element.releasePointerCapture() - Web APIs
the releasepointercapture() method of the element interface releases (stops) pointer capture that was previously set for a specific (pointerevent) pointer.
... syntax targetelement.releasepointercapture(pointerid); parameters pointerid the pointerid of a pointerevent object.
Element.setPointerCapture() - Web APIs
overview of pointer capture pointer capture allows events for a particular pointer event (pointerevent) to be re-targeted to a particular element instead of the normal (or hit test) target at a pointer's location.
... syntax targetelement.setpointercapture(pointerid); parameters pointerid the pointerid of a pointerevent object.
Element - Web APIs
WebAPIElement
nondocumenttypechildnode.previouselementsibling read only is a element, the element immediately preceding the given one in the tree, or null if there is no sibling element.
... element.releasepointercapture() releases (stops) pointer capture that was previously set for a specific pointer event.
EventTarget.removeEventListener() - Web APIs
the eventtarget.removeeventlistener() method removes from the eventtarget an event listener previously registered with eventtarget.addeventlistener().
... return value undefined matching event listeners for removal given an event listener previously added by calling addeventlistener(), you may eventually come to a point at which you need to remove it.
Using Fetch - Web APIs
this kind of functionality was previously achieved using xmlhttprequest.
...instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the request from completing.
Fetch API - Web APIs
WebAPIFetch API
this will allow them to be used wherever they are needed in the future, whether it’s for service workers, cache api, and other similar things that handle or modify requests and responses, or any kind of use case that might require you to generate your responses programmatically (that is, the use of computer program or personal programming instructions).
...instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the request from completing.
FileReader: abort event - Web APIs
no interface progressevent event handler property filereader.onabort examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-are...
...as: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReader: load event - Web APIs
e no interface progressevent event handler property filereader.onload examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-are...
...as: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReader: loadend event - Web APIs
no interface progressevent event handler property filereader.onloadend examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-are...
...as: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReader: loadstart event - Web APIs
no interface progressevent event handler property filereader.onloadstart examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-are...
...as: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReader: progress event - Web APIs
no interface progressevent event handler property filereader.onprogress examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-are...
...as: "select log" "preview log"; } .file-select { grid-area: select; } .preview { grid-area: preview; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const preview = document.queryselector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
Using FormData Objects - Web APIs
orm); odata.append("customfield", "this is some extra data"); var oreq = new xmlhttprequest(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { ooutput.innerhtml = "uploaded!"; } else { ooutput.innerhtml = "error " + oreq.status + " occurred when trying to upload your file.<br \/>"; } }; oreq.send(odata); ev.preventdefault(); }, false); note: if you pass in a reference to the form, the request method specified in the form will be used over the method specified in the open() call.
... typically this is used as shown in our simple formdata event demo — in the javascript we reference a form: const formelem = document.queryselector('form'); in our submit event handler we use preventdefault to stop the default form submission, then invoke a formdata constructor to trigger the formdata event: formelem.addeventlistener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); when the formdata event fires we can access the formdata object using formdataev...
GlobalEventHandlers.onmousedown - Web APIs
example this example reveals part of an image when you press and hold a mouse button.
...div> css .container { width: 320px; height: 213px; background: black; } .view { position: absolute; width: 100px; height: 100px; background: white; border-radius: 50%; } img { mix-blend-mode: darken; } javascript function showview(event) { view.removeattribute('hidden'); view.style.left = event.clientx - 50 + 'px'; view.style.top = event.clienty - 50 + 'px'; event.preventdefault(); } function moveview(event) { view.style.left = event.clientx - 50 + 'px'; view.style.top = event.clienty - 50 + 'px'; } function hideview(event) { view.setattribute('hidden', ''); } const container = document.queryselector('.container'); const view = document.queryselector('.view'); container.onmousedown = showview; container.onmousemove = moveview; document.onmouseup = hid...
HTMLImageElement - Web APIs
this prevents rendering of the next frame from having to pause to decode the image, as would happen if an undecoded image were added to the dom.
... the specified image is corrupted in some way that prevents it from being loaded.
HTMLOListElement - Web APIs
htmlolistelement.reversed is a boolean value reflecting the reversed and defining if the numbering is descending, that is its value is true, or ascending (false).
... recommendation added the reversed property.
Working with the History API - Web APIs
here too, going back doesn't change the document's contents from what they were in the previous step, although the document might update its contents manually upon receiving the popstate event.
...note that this doesn't prevent the creation of a new entry in the global browser history.
IDBCursor - Web APIs
WebAPIIDBCursor
prev : "prev" : the cursor shows all records, including duplicates.
... prevunique : "prevunique" : the cursor shows all records, excluding duplicates.
IDBCursorSync - Web APIs
prev 2 this cursor includes duplicates, and its direction is monotonically decreasing in the order of keys.
... prev_no_duplicate 3 this cursor does not include duplicates, and its direction is monotonically decreasing in the order of keys.
IDBDatabase.transaction() - Web APIs
previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
... exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase instance.
IDBOpenDBRequest: blocked event - Web APIs
eateindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.addeventlistener('blocked', () => { console.log('request was blocked'); }); }; using the onblocked property: // open the database const dbopenrequest = window.indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = (event) => { const db = event.target.resu...
...eateindex('hours', 'hours', { unique: false }); objectstore.createindex('minutes', 'minutes', { unique: false }); objectstore.createindex('day', 'day', { unique: false }); objectstore.createindex('month', 'month', { unique: false }); objectstore.createindex('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.onblocked = () => { console.log('request was blocked'); }; }; ...
IDBTransaction - Web APIs
this can be prevented by using preventdefault() on the error event on the request.
... firefox durability guarantees note that as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
Basic concepts - Web APIs
requests are objects that receive the success or failure dom events that were mentioned previously.
... the security boundary imposed on indexeddb prevents applications from accessing data with a different origin.
Checking when a deadline is due - Web APIs
when the form's submit button is pressed, we run the adddata() function, which starts like this: function adddata(e) { e.preventdefault(); if(title.value == '' || hours.value == null || minutes.value == null || day.value == '' || month.value == '' || year.value == null) { note.innerhtml += '<li>data not submitted — form incomplete.</li>'; return; } in this segment, we check to see if the form fields have all been filled in.
... switch(cursor.value.month) { case "january": var monthnumber = 0; break; case "february": var monthnumber = 1; break; // other lines removed from listing for brevity case "december": var monthnumber = 11; break; default: alert('incorrect month entered in database.'); } the first thing we do is convert the month names we have stored in the database into a month number that javascript will understand.
KeyboardEvent.code - Web APIs
window.addeventlistener("keydown", function(event) { if (event.defaultprevented) { return; // do nothing if event already handled } switch(event.code) { case "keys": case "arrowdown": // handle "back" updateposition(-moverate); break; case "keyw": case "arrowup": // handle "forward" updateposition(moverate); break; case "keya": case "arrowleft": // handle "turn left" angle -= turnrate; ...
... break; case "keyd": case "arrowright": // handle "turn right" angle += turnrate; break; } refresh(); // consume the event so it doesn't get handled twice event.preventdefault(); }, true); try it out to ensure that keystrokes go to the sample code, click inside the black game play field below before pressing keys.
KeyboardEvent.keyCode - Web APIs
example window.addeventlistener("keydown", function (event) { if (event.defaultprevented) { return; // should do nothing if the default action has been cancelled } var handled = false; if (event.key !== undefined) { // handle the event with keyboardevent.key and set handled true.
... } if (handled) { // suppress "double action" if event handled event.preventdefault(); } }, true); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.keycode' in that specification.
KeyframeEffectOptions - Web APIs
replace overwrites the previous value with the new one.
... direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
Location - Web APIs
WebAPILocation
le]:hover:before, :target:before {background:black; color:yellow;} [title] [title]:before {margin-top:1.5em;} [title] [title] [title]:before {margin-top:3em;} [title]:hover, :target {position:relative; z-index:1; outline:50em solid rgba(255,255,255,.8);} javascript [].foreach.call(document.queryselectorall('[title][id]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins is a static domstringlist containing, ...
...in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
MediaError.code - Web APIs
WebAPIMediaErrorcode
media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available.
... media_err_decode 3 despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error.
MediaError - Web APIs
media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available.
... media_err_decode 3 despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error.
MediaPositionState.playbackRate - Web APIs
for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
...negative values can be specified to indicate the media is playing in reverse, with decreasing values then indicating faster and faster reverse playback.
MediaRecorder.onerror - Web APIs
the error object is of type mediarecordererrorevent, and its error property contains a domexception object that describes the error that occurred.
...in addition to other general errors that might occur, the following errors are specifically possible when using the mediastream recording api; to determine which occurred, check the value of mediarecordererrorevent.error.name.
MediaRecorder - Web APIs
the received event is based on the mediarecordererrorevent interface, whose error property contains a domexception that describes the actual error that occurred.
...some lines have been omitted for brevity; refer to the source for the complete code.
MediaSessionActionDetails - Web APIs
a "fast" seek is a seek being performed in a rapid sequence, such as when fast-forwarding or reversing through the media, rapidly skipping through it.
... previoustrack moves back to the previous track.
MediaStream Recording API - Web APIs
} } function download() { var blob = new blob(recordedchunks, { type: "video/webm" }); var url = url.createobjecturl(blob); var a = document.createelement("a"); document.body.appendchild(a); a.style = "display: none"; a.href = url; a.download = "test.webm"; a.click(); window.url.revokeobjecturl(url); } // demo: to download after 9sec settimeout(event => { console.log("stopping"); mediarecorder.stop(); }, 9000); examining and controlling the recorder status you can also use the properties of the mediarecorder object to determine the state of the recording process, and its pause() and resume() methods to pause and resume recording of the source media.
... mediarecordererrorevent the interface that represents errors thrown by the mediastream recording api.
MouseEvent.button - Web APIs
WebAPIMouseEventbutton
a mouse configured for left-handed use may have the button actions reversed.
... example html <button id="button" oncontextmenu="event.preventdefault();">click here with your mouse...</button> <p id="log"></p> javascript let button = document.queryselector('#button'); let log = document.queryselector('#log'); button.addeventlistener('mouseup', logmousebutton); function logmousebutton(e) { if (typeof e === 'object') { switch (e.button) { case 0: log.textcontent = 'left button clicked.'; break; case 1: log.textcontent = 'middle button clicked.'; break; case 2: log.textcontent = 'right button clicked.
MouseEvent.movementX - Web APIs
the movementx read-only property of the mouseevent interface provides the difference in the x coordinate of the mouse pointer between the given event and the previous mousemove event.
... in other words, the value of the property is computed like this: currentevent.movementx = currentevent.screenx - previousevent.screenx.
MouseEvent.movementY - Web APIs
the movementy read-only property of the mouseevent interface provides the difference in the y coordinate of the mouse pointer between the given event and the previous mousemove event.
... in other words, the value of the property is computed like this: currentevent.movementy = currentevent.screeny - previousevent.screeny.
MutationObserverInit.attributes - Web APIs
attributeoldvalue lets you specify whether or not you want the previous value of changed attributes to be included in the mutationrecord's oldvalue property.
... when observe() is called, the specified options are attributes and attributeoldvalue, which means that changes to attribute values will be reported, and each mutation record will include the oldvalue property specifying the attribute's previous value.
MutationObserverInit - Web APIs
attributeoldvalue optional set to true to record the previous value of any attribute that changes when monitoring the node or nodes for attribute changes; see monitoring attribute values in mutationobserver for details on watching for attribute changes and value recording.
... characterdataoldvalue optional set to true to record the previous value of a node's text whenever the text changes on nodes being monitored.
Using Navigation Timing - Web APIs
case performancenavigation.type_reload: output += "reload"; break; case performancenavigation.type_back_forward: output += "history"; break; default: output += "unknown"; break; } output += "<br/>redirects: " + performance.navigation.redirectcount; document.queryselector(".output").innerhtml = output; }, false); this amends the previous example by looking at the contents of the performance.navigation object.
...this information is output to the screen just like the page load time was previously: by inserting it into the element with class "output".
Navigation Timing API - Web APIs
this api lets you measure data that was previously difficult to obtain, such as the amount of time needed to unload the previous page, how long domain lookups take, the total time spent executing the window's load handler, and so forth.
... the navigation timing api can be used to gather performance data on the client side to be sent to a server via xhr as well as measure data that was very difficult to measure by other means such as time to unload a previous page, domain look up time, window.onload total time, etc.
Node.setUserData() - Web APIs
WebAPINodesetUserData
syntax var prevuserdata = somenode.setuserdata(userkey, userdata, handler); parameters userkey is used as the key by which one may subsequently obtain the stored data.
...if null, any previously registered object and userdatahandler associated to userkey on this node will be removed.
NonDocumentTypeChildNode - Web APIs
nondocumenttypechildnode.previouselementsibling read only returns the element immediately prior to this node in its parent's children list, or null if there is no element in the list prior to this node.
...the previouselementsibling and nextelementsibling are now defined on the latter.
Notification.close() - Web APIs
the close() method of the notification interface is used to close/remove a previously displayed notification.
... note: this api shouldn't be used just to have the notification removed from the screen after a fixed delay since this method will also remove the notification from any notification tray, preventing users from interacting with it after it was initially shown.
Notification.onclick - Web APIs
if you don't want that behaviour, call preventdefault() on the event object.
... examples in the following example, we use an onclick handler to open a webpage in a new tab (specified by the inclusion of the '_blank' parameter) once a notification is clicked: notification.onclick = function(event) { event.preventdefault(); // prevent the browser from focusing the notification's tab window.open('http://www.mozilla.org', '_blank'); } specifications specification status comment notifications apithe definition of 'onclick' in that specification.
PaymentRequest.shippingAddress - Web APIs
// initialization of paymentrequest arguments are excerpted for the sake of // brevity.
... var payment = new paymentrequest(supportedinstruments, details, options); payment.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for brevity.
PaymentRequest.show() - Web APIs
if any fields have unacceptable values, or if an exception is thrown by the previous code, complete() is called with the string "fail", which indicates that the payment process is complete and failed.
... button.onclick = async function handlepurchase() { // initialization of paymentrequest arguments are excerpted for the sake of // brevity.
PaymentResponse.shippingAddress - Web APIs
// initialization of paymentrequest arguments are excerpted for brevity.
... var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity.
PaymentResponse.shippingOption - Web APIs
// initialization of paymentrequest arguments are excerpted for brevity.
... var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingoptionchange', function(evt) { evt.updatewith(new promise(function(resolve, reject) { updatedetails(details, request.shippingoption, resolve, reject); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of brevity.
PerformanceNavigationTiming - Web APIs
performancenavigationtiming.unloadeventend read only a domhighrestimestamp representing the time value equal to the time immediately after the user agent finishes the unload event of the previous document.
... performancenavigationtiming.unloadeventstart read only a domhighrestimestamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document.
PerformanceTiming.navigationStart - Web APIs
the legacy performancetiming.navigationstart read-only property returns an unsigned long long representing the moment, in milliseconds since the unix epoch, right after the prompt for unload terminates on the previous document in the same browsing context.
... if there is no previous document, this value will be the same as performancetiming.fetchstart.
PromiseRejectionEvent.promise - Web APIs
event.preventdefault() is called to indicate that the promise has now been handled.
... window.onunhandledrejection = function(event) { if (event.reason.code && event.reason.code == "module not ready") { window.requestidlecallback(function(deadline) { loadmodule(event.reason.modulename) .then(performstartup); }); event.preventdefault(); } } specifications specification status comment html living standardthe definition of 'promiserejectionevent.promise' in that specification.
RTCConfiguration.iceTransportPolicy - Web APIs
this can be used to prevent the remote endpoint from receiving the user's ip addresses, which may be important in some security situations.
... for example, in a video calling application, the app may want to prevent unknown callers from learning the callee's ip addresses until the callee has agreed to receive the call.
RTCDTMFToneChangeEvent - Web APIs
properties in addition to the properties of event, this interface offers the following: rtcdtmftonechangeevent.tone read only a domstring specifying the tone which has begun playing, or an empty string ("") if the previous tone has finished playing.
...it appends each tone to a display box as it's played, and, once all tones have been sent, re-enabled a previously-disabled "send" button, allowing the next dmtf string to be entered.
RTCDataChannel.onerror - Web APIs
when an error occurs on the data channel, the function receives as input an errorevent object describing the error which occurred.
...this function receives as its only input an errorevent object describing the event which was received.
RTCIceCandidate.address - Web APIs
the candidate ip addresses are always exposed 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 exposed, but reduces the pool of available candidates to choose from.
RTCInboundRtpStreamStats.packetsDuplicated - Web APIs
the packetsduplicated property of the rtcinboundrtpstreamstats dictionary indicates the total number of packets discarded because they were duplicates of previously-received packets.
... usage notes duplicate packets are detected when a packet has the same rtp sequence number as another packet that has previously been processed.
RTCPeerConnection.addTrack() - Web APIs
var mediaconstraints = { audio: true, // we want an audio track video: true // ...and we want a video track }; var desc = new rtcsessiondescription(sdp); pc.setremotedescription(desc).then(function () { return navigator.mediadevices.getusermedia(mediaconstraints); }) .then(function(stream) { previewelement.srcobject = stream; stream.gettracks().foreach(track => pc.addtrack(track, stream)); }) this code takes sdp which has been received from the remote peer and constructs a new rtcsessiondescription to pass into setremotedescription().
... if that succeeds, the resulting stream is assigned as the source for a <video> element which is referenced by the variable previewelement.
RTCPeerConnection: icecandidateerror event - Web APIs
the event object is of type rtcpeerconnectioniceerrorevent, and contains information describing the error in some amount of detail.
... bubbles no cancelable no interface rtcpeerconnectioniceerrorevent event handler property rtcpeerconnection.onicecandidateerror description the error object's errorcode property is one of the numeric stun error codes.
RTCPeerConnection.onidpassertionerror - Web APIs
the rtcpeerconnection.onidpassertionerror event handler is a property containing the code to execute whent the idpassertionerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection.
...an event handler always has one single parameter, containing the event, here of type rtcidentityerrorevent.
RTCPeerConnection.onidpvalidationerror - Web APIs
the rtcpeerconnection.onidpvalidationerror event handler is a property containing the code to execute whent the idpvalidationerror event, of type rtcidentityerrorevent, is received by this rtcpeerconnection.
...an event handler always has one single parameter, containing the event, here of type rtcidentityerrorevent.
RTCPeerConnection.setRemoteDescription() - Web APIs
these states indicate that either an existing connection is being renegotiated or that an offer previously specified by an earlier call to setremotedescription() is to be replaced with the new offer.
... upon starting the new negotiation with the newly-established offer, the local peer is now the callee, even if it was previously the caller.
RTCSessionDescription() - Web APIs
pranswer the session description object describes a provisional answer; that is, a response to a previous offer that is not the final answer.
... rollback this special type with an empty session description is used to roll back to the previous stable state.
RTCSessionDescription - Web APIs
pranswer the session description object describes a provisional answer; that is, a response to a previous offer that is not the final answer.
... rollback this special type with an empty session description is used to roll back to the previous stable state.
ReadableStream.tee() - Web APIs
teeing a stream will generally lock it for the duration, preventing other readers from locking it.
... examples in the following simple example, a previously-created stream is teed, then both resulting streams (contained in two members of a generated array) are passed to a function that reads the data out of the two streams and prints each stream's chunks sequentially to a different part of the ui.
Request.mode - Web APIs
WebAPIRequestmode
no-cors — prevents the method from being anything other than head, get or post, and the headers from being anything other than simple headers.
...this ensures that serviceworkers do not affect the semantics of the web and prevents security and privacy issues arising from leaking data across domains.
SVGGraphicsElement: copy event - Web APIs
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault().
...lns="http://www.w3.org/1999/xhtml" placeholder="paste it here"/> </foreignobject> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementsbytagname("text")[0].addeventlistener("copy", evt => { evt.clipboarddata.setdata('text/plain', document.getselection().tostring().touppercase()); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
SVGGraphicsElement: cut event - Web APIs
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault().
... note though that cancelling the default action will also prevent the document from being updated.
SVGGraphicsElement: paste event - Web APIs
to override the default behavior (for example to insert some different data or a transformation of the clipboard contents) an event handler must cancel the default action using event.preventdefault(), and then insert its desired data manually.
...ect> <text x="5" y="30" id="element-to-paste-text" tabindex="1">paste it here</text> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementbyid("element-to-paste-text").addeventlistener("paste", evt => { evt.target.textcontent = evt.clipboarddata.getdata("text/plain").touppercase(); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
Selection - Web APIs
WebAPISelection
a user may make a selection from left to right (in document order) or right to left (reverse of document order).
... the behavior is as follows: an editing host gains focus if the previous selection was outside of it.
Using server-sent events - Web APIs
note: the comment line can be used to prevent connections from timing out; a server can send a comment periodically to keep the connection alive.
...as mentioned previously, this can be useful as a keep-alive mechanism if messages might not be sent regularly.
ServiceWorkerContainer.onerror - Web APIs
syntax serviceworkercontainer.onerror = function(errorevent) { ...
... } example navigator.serviceworker.onerror = function(errorevent) { console.log(`received error message: ${errorevent.message}`); } ...
Service Worker API - Web APIs
note: service workers win over previous attempts in this area such as; appcache because they don't make assumptions about what you are trying to do, and then break when those assumptions are not exactly right; you have granular control over everything.
...the point where this event fires is generally a good time to clean up old caches and other things associated with the previous version of your service worker.
SpeechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
...ces[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = pitch.value; utterthis.rate = rate.value; synth.speak(utterthis); inputtxt.blur(); }...
SpeechSynthesisUtterance: error event - Web APIs
the error event of the web speech api speechsynthesisutterance object is fired when an error occurs that prevents the utterance from being succesfully spoken.
... bubbles no cancelable no interface speechsynthesiserrorevent event handler property onerror examples you can use the error event in an addeventlistener method: utterthis.addeventlistener('error', function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error'); }); or use the onerror event handler property: utterthis.onerror = function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error'); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specification.
SpeechSynthesisUtterance.onerror - Web APIs
the onerror property of the speechsynthesisutterance interface represents an event handler that will run when an error occurs that prevents the utterance from being succesfully spoken (when the error event fires.) syntax speechsynthesisutteranceinstance.onerror = function() { ...
... inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onerror = function(event) { console.log('an error has occurred with the speech synthesis: ' + event.error); } inputtxt.blur(); } specifications specification ...
Storage API - Web APIs
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 purposes.
... quotas are conservative estimates of the space available for the origin's use, and should be less than the available space on the device to help prevent overruns.
Using writable streams - Web APIs
the difference is that when close is called, any previously enqueued chunks are written and finished with before the stream is closed.
... when abort is called, any previously enqueued chunks are just thrown away immediately and then the stream is moved to an errored state.
TreeWalker - Web APIs
treewalker.previoussibling() moves the current node to its previous sibling, if any, and returns the found sibling.
... treewalker.previousnode() moves the current node to the previous visible node in the document order, and returns the found node.
URL.createObjectURL() - Web APIs
to release an object url, call revokeobjecturl().
...each of these must be released by calling url.revokeobjecturl() when you no longer need them.
URL - Web APIs
WebAPIURL
revokeobjecturl() revokes an object url previously created using url.createobjecturl().
... working draft added the static methods url.createobjecturl() and url.revokeobjecturl().
ValidityState - Web APIs
note: this property is never true in gecko, because elements' values are prevented from being longer than maxlength.
... recommendation no change from the previous snapshot html5.
WebGLRenderingContext.blendEquation() - Web APIs
must be either: gl.func_add: source + destination, gl.func_subtract: source - destination, gl.func_reverse_subtract: destination - source when using the ext_blend_minmax extension: ext.min_ext: minimum of source and destination, ext.max_ext: maximum of source and destination.
... examples to set the blend equation, use: gl.blendequation(gl.func_add); gl.blendequation(gl.func_subtract); gl.blendequation(gl.func_reverse_subtract); to get the blend equations, query the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext.
WebGLRenderingContext.vertexAttribPointer() - Web APIs
[2], true); dv.setint8(20 * i + 12, vertices[i].normal[0] * 0x7f); dv.setint8(20 * i + 13, vertices[i].normal[1] * 0x7f); dv.setint8(20 * i + 14, vertices[i].normal[2] * 0x7f); dv.setint8(20 * i + 15, 0); dv.setuint16(20 * i + 16, vertices[i].texcoord[0] * 0xffff, true); dv.setuint16(20 * i + 18, vertices[i].texcoord[1] * 0xffff, true); } for higher performance, we could also do the previous json to arraybuffer conversion on the server-side, e.g.
...signed_short, true, 20, 16); gl.enablevertexattribarray(2); //set the attributes in the vertex shader to the same indices gl.bindattriblocation(shaderprogram, 0, 'position'); gl.bindattriblocation(shaderprogram, 1, 'normal'); gl.bindattriblocation(shaderprogram, 2, 'texuv'); //since the attribute indices have changed, we must re-link the shader //note that this will reset all uniforms that were previously set.
Basic scissoring - Web APIs
« previousnext » in this example, we see how to draw simple rectangles and squares using webgl scissoring operations.
... « previousnext » ...
Boilerplate 1 - Web APIs
« previousnext » this example describes repeated pieces of code that will be hidden from now on, as well as defining a javascript utility function to make webgl initialization easier.
... « previousnext » ...
Canvas size and WebGL - Web APIs
« previousnext » this webgl example explores the effect of setting (or not setting) the canvas size to its element size in css pixels, as it appears in the browser window.
... « previousnext » ...
Clearing by clicking - Web APIs
« previousnext » this example demonstrates how to combine user interaction with webgl graphics operations by clearing the rendering context with a random color when the user clicks.
... « previousnext » ...
Clearing with colors - Web APIs
« previousnext » an example showing how to clear a webgl rendering context to a solid color.
... « previousnext » ...
Color masking - Web APIs
« previousnext » this webgl example modifies random colors by applying color masking to limit the range of displayed colors to specific shades.
... « previousnext » ...
Detect WebGL - Web APIs
« previousnext » this example demonstrates how to detect a webgl rendering context and reports the result to the user.
... « previousnext » ...
Hello GLSL - Web APIs
« previousnext » this webgl example demonstrates a very basic glsl shader program that draws a solid color square.
... « previousnext » ...
Hello vertex attributes - Web APIs
« previousnext » this webgl example demonstrates how to combine shader programming and user interaction by sending user input to the shader using vertex attributes.
... « previousnext » ...
Scissor animation - Web APIs
« previousnext » a simple webgl example in which we have some animation fun using scissoring and clearing operations.
... « previousnext » ...
Simple color animation - Web APIs
« previousnext » a very basic color animation created using webgl, performed by clearing the drawing buffer with a different random color every second.
... « previousnext » ...
Textures from code - Web APIs
« previousnext » this webgl example provides a simple demonstration of procedural texturing with fragment shaders.
... « previousnext » ...
Video textures - Web APIs
« previous this example demonstrates how to use video files as textures for webgl surfaces.
... textures from video « previous ...
WebGL by example - Web APIs
sometimes we revisit a topic several times, such as when needing to discuss it initially at a basic level, and later at intermediate and advanced levels.
...you should read all comments, because more advanced examples could not repeat comments about parts of the code that were previously explained.
Adding 2D content to a WebGL context - Web APIs
« previousnext » once you've successfully created a webgl context, you can start rendering into it.
... see also matrices on webglfundamentals matrices on wolfram mathworld matrix on wikipedia « previousnext » ...
Animating objects with WebGL - Web APIs
« previousnext » in this example, we'll actually rotate our square plane.
... view the complete code | open this demo on a new page « previousnext » ...
Creating 3D objects using WebGL - Web APIs
« previousnext » let's take our square plane into three dimensions by adding five more faces to create a cube.
... view the complete code | open this demo on a new page « previousnext » ...
A simple RTCDataChannel sample - Web APIs
<div class="messagebox" id="receivebox"> <p>messages received:</p> </div> the javascript code while you can just look at the code itself on github, below we'll review the parts of the code that do the heavy lifting.
... disconnecting the peers when the user clicks the "disconnect" button, the disconnectpeers() method previously set as that button's handler is called.
Taking still photos with WebRTC - Web APIs
finally, we set the streaming variable to true to prevent us from inadvertently running this setup code again.
... handle clicks on the button to capture a still photo each time the user clicks the startbutton, we need to add an event listener to the button, to be called when the click event is issued: startbutton.addeventlistener('click', function(ev){ takepicture(); ev.preventdefault(); }, false); this method is simple enough: it just calls our takepicture() function, defined below in the section capturing a frame from the stream, then calls event.preventdefault() on the received event to prevent the click from being handled more than once.
Using DTMF with WebRTC - Web APIs
if so, we log the fact that we're about to send the dtmf, then we call dtmf.insertdtmf() to send the dtmf on the same track as the audio data method on the rtcdtmfsender object we previously stored in dtmfsender.
...as previously mentioned, our example is simplified somewhat because we control both the caller and the receiver, so handlecallernegotiationneeded() is able to quickly construct the connection by chaining the required calls together for both the caller and receiver, as shown below.
Fundamentals of WebXR - Web APIs
together, these technologies are referred to as mixed reality, which is abbreviated xr.
...some platforms may provide previously-cleared frames to you, while others may optimize performance by not erasing the framebuffers in order to avoid having to touch each pixel twice per frame.
Inputs and input sources - Web APIs
the list in profiles is in order of reverse specificity; that is, the most precise description is first, and the least precise description is last.
... assuming inputs are used to control an avatar within the simulation, which is the most common use case, webxr inputs are used to affect the avatar in the following ways, using data collected from the non-xr input device: position the avatar's position is changed by applying a delta to the previously known position, then replacing the avatar's reference space with a new one whose transform reflects the new position.
Basic concepts behind Web Audio API - Web APIs
create effects nodes, such as reverb, biquad filter, panner, or compressor.
...the channels are usually represented by standard abbreviations detailed in the table below: mono 0: m: mono stereo 0: l: left 1: r: right quad 0: l: left 1: r: right 2: sl: surround left 3: sr: surround right 5.1 0: l: left 1: r: right 2: c: center 3: lfe: subwoofer 4: sl: surround left 5: sr: surround right up-mixing and down-mixing when the number of channel...
Background audio processing using AudioWorklet - Web APIs
t samplecount = input[channelnum].length; for (let i = 0; i < samplecount; i++) { let sample = output[channelnum][i] + input[channelnum][i]; if (sample > 1.0) { sample = 1.0; } else if (sample < -1.0) { sample = -1.0; } output[channelnum][i] = sample; } } }; return true; } this is similar code to the previous sample in many ways, but only the first output—outputlist[0]—is altered.
... each sample is added to the corresponding sample in the output buffer, with a simple code fragment in place to prevent the samples from exceeding the legal range of -1.0 to 1.0 by capping the values; there are other ways to avoid clipping that are perhaps less prone to distortion, but this is a simple example that's better than nothing.
Web audio spatialization basics - Web APIs
function moveboombox(direction, prevmove) { switch (direction) { case 'left': if (transform.xaxis > leftbound) { transform.xaxis -= 5; panner.positionx.value -= 0.1; } break; case 'up': if (transform.yaxis > topbound) { transform.yaxis -= 5; panner.positiony.value -= 0.3; } break; ...
... x = panner.orientationx.value; panner.orientationx.value = x; panner.orientationy.value = y; panner.orientationz.value = z; break; } boombox.style.transform = 'translatex('+transform.xaxis+'px) translatey('+transform.yaxis+'px) scale('+transform.zaxis+') rotatey('+transform.rotatey+'deg) rotatex('+transform.rotatex+'deg)'; const move = prevmove || {}; move.frameid = requestanimationframe(() => moveboombox(direction, move)); return move; } wiring up our controls wiring up out control buttons is comparatively simple — now we can listen for a mouse event on our controls and run this function, as well as stop it when the mouse is released: // for each of our controls, move the boombox and change the position values movecontr...
Web Authentication API - Web APIs
this proves to the server that a user is in possession of the private key required for authentication without revealing any secrets over the network.
...the primary differences between registration and authentication are that: 1) authentication doesn't require user or relying party information; and 2) authentication creates an assertion using the previously generated key pair for the service rather than creating an attestation with the key pair that was burned into the authenticator during manufacturing.
Using the Web Speech API - Web APIs
]; var grammar = '#jsgf v1.0; grammar colors; public <color> = ' + colors.join(' | ') + ' ;' the grammar format used is jspeech grammar format (jsgf) — you can find a lot more about it at the previous link to its spec.
... inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = pitch.value; utterthis.rate = rate.value; synth.speak(utterthis); in the final part of...
Using the Web Storage API - Web APIs
these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's recommended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores.
... testing whether your storage has been populated to start with, in main.js, we test whether the storage object has already been populated (i.e., the page was previously accessed): if(!localstorage.getitem('bgcolor')) { populatestorage(); } else { setstyles(); } the storage.getitem() method is used to get a data item from storage; in this case, we are testing to see whether the bgcolor item exists; if not, we run populatestorage() to add the existing customization values to the storage.
window.postMessage() - Web APIs
this mechanism provides control over where messages are sent; for example, if postmessage() was used to transmit a password, it would be absolutely critical that this argument be a uri whose origin is the same as the intended receiver of the message containing the password, to prevent interception of the password by a malicious third party.
...web context scripts can use custom events to communicate with content scripts (with randomly generated event names, if needed, to prevent snooping from the guest page).
Window.requestAnimationFrame() - Web APIs
when callbacks queued by requestanimationframe() begin to fire multiple callbacks in a single frame, each receives the same timestamp even though time has passed during the computation of every previous callback's workload.
... living standard no change, supersedes the previous one.
Window.speechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
...ces[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); inputtxt.blur(); } specifications specification status comment ...
WritableStream.WritableStream() - Web APIs
this method will be called only after previous writes have succeeded, and never after the stream is closed or aborted (see below).
...calling close() too early can prevent data from being written.
XRSession.cancelAnimationFrame() - Web APIs
the cancelanimationframe() method of the xrsession interface cancels an animation frame which was previously requested by calling requestanimationframe.
... syntax xrsession.cancelanimationframe(handle); parameters handle the unique value returned by the call to requestanimationframe() that previously scheduled the animation callback.
XRSession.onsqueeze - Web APIs
this is determined by comparing the input source's handedness against the value of a handedness property on a user object we've established previously.
... xrsession.onsqueeze = event => { if (event.inputsource.handedness != user.handedness) { handleoffhandsqueeze(event.inputsource, event.frame); } }; finishing an ongoing squeeze action this example exapnds somewhat on the previous example by demonstrating a way to implement the ability for the user to drop an object that was previously picked up by the user..
XRSession.requestAnimationFrame() - Web APIs
you can cancel a previously scheduled animation by calling cancelanimationframe().
...to prevent two loops from // rendering in parallel, skip drawing in this one until the session ends.
XRView - Web APIs
WebAPIXRView
so you should process the view list every time without making assumptions based on previous frames.
...the createteleporttransform() function returns the transform needed to move and rotate an object whose current situation is described by the reference space refspace to a new position and orientation which is computed using previously recorded mouse and keyboard input data which has generated offsets for yaw, pitch, and position along all three axes.
x-ms-aria-flowfrom - Accessibility
the x-ms-aria-flowfrom property specifies the id of the previous element in an alternative reading order, allowing assistive technology to override the general default of reading in document source order.
... syntax x-ms-aria-flowfrom="elementid"; value the x-ms-aria-flowfrom property value uses an id selector to define which previous element the reading order will flow from.
ARIA: feed role - Accessibility
providing reading mode keys that move dom focus to the next and previous articles.
... page up: move focus to previous article.
ARIA: grid role - Accessibility
result; do { result = moveto(i, event.target.dataset.col); i++; } while (result == false); break; case "pagedown": var i = maxrow; var result; do { result = moveto(i, event.target.dataset.col); i--; } while (result == false); break; case "enter": alert(event.target.textcontent); break; } event.preventdefault(); }); html <table role="grid" aria-labelledby="calendarheader"> <caption id="calendarheader">september 2018</caption> <thead role="rowgroup"> <tr role="row"> <td></td> <th role="columnheader" aria-label="sunday">s</th> <th role="columnheader" aria-label="monday">m</th> <th role="columnheader" aria-label="tuesday">t</th> <th role="columnheader...
...result; do { result = moveto(i, event.target.dataset.col); i++; } while (result == false); break; case "pagedown": var i = maxrow; var result; do { result = moveto(i, event.target.dataset.col); i--; } while (result == false); break; case "enter": alert(event.target.textcontent); break; } event.preventdefault(); }); more examples data grid examples layout grids examples w3c/wai tutorial: tables accessibility concerns even if the keyboard use is properly implemented, some users might not be aware that they have to use the arrow keys.
ARIA: tab role - Accessibility
← focuses and optionally activates the previous tab in the tab list.
...each tab is a button with the attributes previously mentioned.
An overview of accessible web applications and widgets - Accessibility
this provides a much more consistent user experience than was possible in the previous generation of web applications, since assistive technology users can apply all of their knowledge of how desktop applications work when they are using web-based applications.
...for example, using the left and right arrow keys should move focus to the previous and next menu items.
Architecture - Accessibility
previously the hyper link interface was really only for links, but the design could not fully represent an html document hierarchy.
...navigating previous requires returning to the embed character in the parent accessible when the point of regard reaches the end of text in the corresponding child accessible for the embed.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
[important] accnavigate: navigate to the first/last child, previous/next sibling, up, down, left or right from this iaccessible.
...realize that it's about both pride and revenue for these companies, and that they need to sell a lot of copies of their software to make up the work they put in to support your app.
Web Accessibility: Understanding Colors and Luminance - Accessibility
understaning color, luminance, and saturation is important in meeting wcag 2 accessibility guidelines in terms of ensuring enough color contrast for sighted users with color blindness or reduced vision and preventing seizures and other physical reactions in people with vestibular disorders.
... light adaptation is the reverse.
Operable - Accessibility
the only exception to this is where a page is one step in a process, so should only logically have links to the previous and next steps.
... understanding pointer gestures 2.5.2 pointer cancellation (a) added in 2.1 for functionality that can be operated using a single-pointer at least one of the following is true: no down-event, abort/undo, up reversal or essential.
Accessibility
accessibility (often abbreviated to a11y—as in "a" then 11 characters then "y") in web development means enabling as many people as possible to use web sites, even when those people's abilities are limited in some way.
... wai-aria basics following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult.
-moz-image-rect - CSS: Cascading Style Sheets
function rotate() { var prevstyle = window.getcomputedstyle(document.getelementbyid("box4"), null).getpropertyvalue("background-image"); // now that we've saved the last one, start rotating for (var i=1; i<=4; i++) { var curid = "box" + i; // shift the background images var curstyle = window.getcomputedstyle(document.getelementbyid(curid), null).getpropertyvalue("background-image"); document.getelemen...
...tbyid(curid).style.backgroundimage = prevstyle; prevstyle = curstyle; } } this uses window.getcomputedstyle() to fetch the style of each element, shifting it to the following element.
::after (:after) - CSS: Cascading Style Sheets
WebCSS::after
working draft no significant changes to the previous specification.
... css level 2 (revision 1)the definition of '::after' in that specification.
::before (:before) - CSS: Cascading Style Sheets
WebCSS::before
working draft no significant changes to the previous specification.
... css level 2 (revision 1)the definition of '::before' in that specification.
@page - CSS: Cascading Style Sheets
WebCSS@page
working draft no change from css level 2 (revision 1), though more css at-rules can be used inside a @page.
... css level 2 (revision 1)the definition of '@page' in that specification.
Typical use cases of Flexbox - CSS: Cascading Style Sheets
to prevent the image growing too large, add a max-width to the image.
... .media .content { flex: 3; padding: 10px; } .image { flex: 1; } flipping the media object to switch the display of the media object so that the image is on the right and the content is on the left we can use the flex-direction property set to row-reverse.
In Flow and Out of Flow - CSS: Cascading Style Sheets
in the previous guide i explained block and inline layout in normal flow.
... when you do anything to remove, or shift an item from where it would be placed in normal flow, you can expect to need to do some managing of the content and the content around it to prevent overlaps.
Grid template areas - CSS: Cascading Style Sheets
in the previous guide we looked at grid lines, and how to position items against those lines.
... .wrapper { display: grid; grid: "hd hd hd hd hd hd hd hd hd" minmax(100px, auto) "sd sd sd main main main main main main" minmax(100px, auto) "ft ft ft ft ft ft ft ft ft" minmax(100px, auto) / 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ; } we will revisit the other functionality offered by this shorthand later in these guides when we take a look at auto placement and the grid-auto-flow property.
Layout using named grid lines - CSS: Cascading Style Sheets
in previous guides we’ve looked at placing items by the lines created by defining grid tracks and also how to place items using named template areas.
... implicit grid lines from named areas we have seen how named lines create a named area, and this also works in reverse.
Stacking context example 2 - CSS: Cascading Style Sheets
there are the same four divs of the previous example, but now z-index properties are assigned on both levels of the hierarchy.
...div #4 belongs to the stacking context created by div #3, and as explained previously div #3 (and all its content) is under div #2.
The stacking context - CSS: Cascading Style Sheets
the stacking context in the previous part of this article, using z-index, the rendering order of certain elements is influenced by their z-index value.
... within a stacking context, child elements are stacked according to the same rules previously explained.
CSS values and units - CSS: Cascading Style Sheets
a fourth value of revert was added in the cascade level 4 specification, but it does not currently have good browser support.
... css level 2 (revision 1) recommendation css level 1 recommendation initial definition.
Comments - CSS: Cascading Style Sheets
WebCSSComments
a css comment is used to add explanatory notes to the code or to prevent the browser from interpreting specific parts of the style sheet.
... syntax comments can be placed wherever white space is allowed within a style sheet.
Pseudo-classes - CSS: Cascading Style Sheets
no significant change for pseudo-classes defined in css level 2 (revision 1).
... css level 2 (revision 1) recommendation defined :lang(), :first-child, :hover, and :focus.
Shorthand properties - CSS: Cascading Style Sheets
that sounds anecdotal, but it really means that it overrides previously set values.
... note: there is also a newer value, revert, which has limited browser support.
background-image - CSS: Cascading Style Sheets
candidate recommendation from css2 revision 1, the property has been extended to support multiple backgrounds and any <image> css data type.
... css level 2 (revision 1)the definition of 'background-image' in that specification.
border-width - CSS: Cascading Style Sheets
ngthborder-left-width: a lengthborder-right-width: a lengthborder-top-width: a length formal syntax <line-width>{1,4}where <line-width> = <length> | thin | medium | thick examples a mix of values and lengths html <p id="sval"> one value: 6px wide border on all 4 sides</p> <p id="bival"> two different values: 2px wide top and bottom border, 10px wide right and left border</p> <p id="treval"> three different values: 0.3em top, 9px bottom, and zero width right and left</p> <p id="fourval"> four different values: "thin" top, "medium" right, "thick" bottom, and 1em left</p> css #sval { border: ridge #ccc; border-width: 6px; } #bival { border: solid red; border-width: 2px 10px; } #treval { border: dotted orange; border-width: 0.3em 0 9px; } #fourval { border: s...
... css level 2 (revision 1)the definition of 'border-width' in that specification.
break-inside - CSS: Cascading Style Sheets
/* keyword values */ break-inside: auto; break-inside: avoid; break-inside: avoid-page; break-inside: avoid-column; break-inside: avoid-region; /* global values */ break-inside: inherit; break-inside: initial; break-inside: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
... notes on compatibility prior to firefox 65, the older property of page-break-inside will work in firefox to prevent breaks in columns, as well as pages.
<dimension> - CSS: Cascading Style Sheets
WebCSSdimension
3sec the seconds unit is abbreviated "s" not "sec".
... candidate recommendation adds ch, rem, vw, vw, vmin, vmax, q css level 2 (revision 1)the definition of '<dimension>' in that specification.
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
the css below is nearly identical to the previous example.
... css level 2 (revision 1)the definition of 'font-size' in that specification.
font-variant - CSS: Cascading Style Sheets
you can also set the css level 2 (revision 1) values of font-variant, (that is, normal or small-caps), by using the font shorthand.
... css level 2 (revision 1)the definition of 'font-variant' in that specification.
font - CSS: Cascading Style Sheets
WebCSSfont
as with any shorthand property, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties).
... css level 2 (revision 1)the definition of 'font-weight' in that specification.
inherit - CSS: Cascading Style Sheets
WebCSSinherit
candidate recommendation no significant change from css level 2 (revision 1).
... css level 2 (revision 1)the definition of 'inherit' in that specification.
Inheritance - CSS: Cascading Style Sheets
for example: font { all: revert; font-size: 200%; font-weight: bold; } this reverts the style of the font property to the user agent's default unless a user stylesheet exists, in which case that is used instead.
... see also css values for controlling inheritance: inherit, initial, unset, and revert introducing the css cascade cascade and inheritance css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed, resolved, specified, used, and actual values.
left - CSS: Cascading Style Sheets
WebCSSleft
when both left and right are defined, and width constraints don't prevent it, the element will stretch to satisfy both.
... css level 2 (revision 1)the definition of 'left' in that specification.
max-height - CSS: Cascading Style Sheets
it prevents the used value of the height property from becoming larger than the value specified for max-height.
... css level 2 (revision 1)the definition of 'max-height' in that specification.
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
it prevents the used value of the width property from becoming larger than the value specified by max-width.
... css level 2 (revision 1)the definition of 'max-width' in that specification.
min-height - CSS: Cascading Style Sheets
it prevents the used value of the height property from becoming smaller than the value specified for min-height.
... css level 2 (revision 1)the definition of 'min-height' in that specification.
min-width - CSS: Cascading Style Sheets
WebCSSmin-width
it prevents the used value of the width property from becoming smaller than the value specified for min-width.
... css level 2 (revision 1)the definition of 'min-width' in that specification.
overflow-wrap - CSS: Cascading Style Sheets
the overflow-wrap css property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
... anywhere to prevent overflow, an otherwise unbreakable string of characters — like a long word or url — may be broken at any point if there are no otherwise-acceptable break points in the line.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
browsers always display scrollbars whether or not any content is actually clipped, preventing scrollbars from appearing or disappearing as content changes.
... working draft changed syntax to allow one or two keywords instead of only one css level 2 (revision 1)the definition of 'overflow' in that specification.
overscroll-behavior-block - CSS: Cascading Style Sheets
none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-inline - CSS: Cascading Style Sheets
none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other.
overscroll-behavior-x - CSS: Cascading Style Sheets
none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other.
overscroll-behavior-y - CSS: Cascading Style Sheets
none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.
... formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling vertically .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } see overscroll-behavior for a full example and explanation.
<percentage> - CSS: Cascading Style Sheets
candidate recommendation no significant change from css level 2 (revision 1).
... css level 2 (revision 1)the definition of '<percentage>' in that specification.
Specified value - CSS: Cascading Style Sheets
however, the border is not an inheriting property.</p> </div> css .fun { border: 1px dotted pink; font-family: fantasy; } p { color: green; } result specifications specification status comment css level 2 (revision 2)the definition of 'cascaded value' in that specification.
... working draft css level 2 (revision 1)the definition of 'cascaded value' in that specification.
<string> - CSS: Cascading Style Sheets
WebCSSstring
candidate recommendation no significant change from css level 2 (revision 1).
... css level 2 (revision 1)the definition of '<string>' in that specification.
url() - CSS: Cascading Style Sheets
WebCSSurl()
candidate recommendation no significant change from css level 2 (revision 1).
... css level 2 (revision 1)the definition of 'uri()' in that specification.
<url> - CSS: Cascading Style Sheets
WebCSSurl
candidate recommendation no significant change from css level 2 (revision 1).
... css level 2 (revision 1)the definition of '<uri>' in that specification.
Used value - CSS: Cascading Style Sheets
computed value and used value: (taken from css 2.1 changes: specified, computed, and actual values): background-position bottom, left, right, top height, width margin-bottom, margin-left, margin-right, margin-top min-height, min-width padding-bottom, padding-left, padding-right, padding-top text-indent specification specification status comment css level 2 (revision 2)the definition of 'used value' in that specification.
... css level 2 (revision 1)the definition of 'used value' in that specification.
word-break - CSS: Cascading Style Sheets
the word-break css property sets whether line breaks appear wherever the text would otherwise overflow its content box.
... break-all to prevent overflow, word breaks should be inserted between any two characters (excluding chinese/japanese/korean text).
word-spacing - CSS: Cascading Style Sheets
working draft replaces the previous values with a <spacing-limit> value that defines the same thing, plus the <percentage> value.
... css level 2 (revision 1)the definition of 'word-spacing' in that specification.
CSS: Cascading Style Sheets
WebCSS
previously development of various parts of css specification was done synchronously, which allowed versioning of the latest recommendation.
... get started tutorials our css learning area features multiple modules that teach css from the ground up — no previous knowledge required.
Adding captions and subtitles to HTML5 video - Developer guides
modifications to the html and css this section summarises the modifications made to the previous article's code in order to facilitate the addition of subtitles to the video.
... subtitle implementation a lot of what we do to access the video subtitles revolves around javascript.
Creating and triggering events - Developer guides
function simulateclick() { const event = new mouseevent('click', { view: window, bubbles: true, cancelable: true }); const cb = document.getelementbyid('checkbox'); const cancelled = !cb.dispatchevent(event); if (cancelled) { // a handler called preventdefault.
... alert("cancelled"); } else { // none of the handlers called preventdefault.
Rich-Text Editing in Mozilla - Developer guides
starting in firefox 3, mozilla also supports internet explorer's contenteditable attribute which allows any element to become editable or non-editable (the latter for when preventing change to fixed elements in an editable environment).
... firefox 3 and contenteditable original document information author(s): doron rosenberg, netscape communications published: 04 apr 2003 revised: 01 jul 2003 revised: 24 apr 2005, joel coreson revised: 28 nov 2006, ken kuhns, computronicsusa revised: 19 dec 2007, mark finkle ...
Localizations and character encodings - Developer guides
unfortunately, using utf-8 and declaring that utf-8 was used was not always the prevalent way of offering web content.
...note that the fallback encoding as defined by the previous sentence does not necessarily need to be able to represent the characters needed for the language of the localization!
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
revobsolete since html5 specified a reverse link; the opposite of the rel attribute.
... onclick events anchor elements are often abused as fake buttons by setting their href to # or javascript:void(0) to prevent the page from refreshing, then listening for their click events .
<article>: The Article Contents element - HTML: Hypertext Markup Language
WebHTMLElementarticle
examples <article class="film_review"> <header> <h2>jurassic park</h2> </header> <section class="main_review"> <p>dinos were great!</p> </section> <section class="user_reviews"> <article class="user_review"> <p>way too scary for me.</p> <footer> <p> posted on <time datetime="2015-05-16 19:00">may 16</time> by lisa.
... </p> </footer> </article> <article class="user_review"> <p>i agree, dinos are my favorite.</p> <footer> <p> posted on <time datetime="2015-05-17 19:00">may 17</time> by tom.
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
this is very similar to the previous example, except that the disabled attribute is set on the <fieldset> when the first button is pressed — this causes all three buttons to be disabled until the two second timeout has passed.
... examples the below example shows a very simple drawing app created using a <canvas> element and some simple css and javascript (we'll hide the css for brevity).
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
colorwell.select(); appearance variations as previously mentioned, when a browser doesn't support a color picker interface, its implementation of color inputs will be a text box that validates the contents automatically to ensure that the value is in the correct format.
... as you make changes in the color picker, the first paragraph's color changes, as a preview (this uses the <code>input</code> event).
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
this kind of attack is called a cross site request forgery (csrf); pretty much any reputable server-side framework uses hidden secrets to prevent such attacks.
... as stated previously, placing the secret in a hidden input doesn't inherently make it secure.
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
using password inputs password input boxes generally work just like other textual input boxes; the main difference is the obscuring of the content to prevent people near the user from reading the password.
...this example expands on the previous one by specifying that the user's pin must be at least four and no more than eight digits.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
reversed this boolean attribute specifies that the list’s items are in reverse order.
... recommendation added reversed and start attributed; un-deprecated type html 4.01 specificationthe definition of '<ol>' in that specification.
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
let's take the previous example, add some more students to the list, and update the table so that instead of listing each student's major on every row, the students are grouped by major, with heading rows for each major.
... result first, the resulting table, so you know what we're building: html the revised html looks like this: <table> <thead> <tr> <th>student id</th> <th>name</th> </tr> </thead> <tbody> <tr> <th colspan="2">computer science</th> </tr> <tr> <td>3741255</td> <td>jones, martha</td> </tr> <tr> <td>4077830</td> <td>pierce, benjamin</td> </tr> <tr> <td>5151701</td> <td>kirk, james</td> </tr> </tbody> <tbody> <tr> <th colspan="2">russian literature</th> </tr> <tr> <td>3971244</td> <td>nim, victor</td> </tr> </tbody> <tbody> <tr> <th colspan="2">astrophysics</th> </tr> <tr> <td>4100332</td> <td>petrov, alexandra</td> </t...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
deprecated attributes abbr this attribute contains a short abbreviated description of the cell's content.
...alternatively, you can put the abbreviated description inside the cell and place the long content in the title attribute.
itemscope - HTML: Hypertext Markup Language
i like to add a dash of nutmeg.</span> <br> <span itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> <span itemprop="ratingvalue">4.0</span> stars based on <span itemprop="reviewcount">35</span> reviews </span> <br> prep time: <time datetime="pt30m" itemprop="preptime">30 min</time><br> cook time: <time datetime="pt1h" itemprop="cooktime">1 hou</time>r<br> total time: <time datetime="pt1h30m" itemprop="totaltime">1 hour 30 min</time><br> yield: <span itemprop="recipeyield">1 9" pie (8 servings)</span><br> <span itemprop="nutrition" itemscope itemtype="htt...
... itemprop author [person] itemprop name carol smith itemscope itemprop[itemtype] aggregaterating [aggregaterating] itemprop ratingvalue 4.0 itemprop reviewcount 35 itemscope itemprop[itemtype] nutrition [nutritioninformation] itemprop servingsize 1 medium slice itemprop calories 250 cal itemprop fatcontent 12 g note: a handy tool for extracting microdata structures from html is google's structured data testing tool.
Microdata - HTML: Hypertext Markup Language
commonly used vocabularies: creative works: creativework, book, movie, musicrecording, recipe, tvseries embedded non-text objects: audioobject, imageobject, videoobject event health and medical types: notes on the health and medical types under medicalentity organization person place, localbusiness, restaurant product, offer, aggregateoffer review, aggregaterating action thing intangible major search engine operators like google, microsoft, and yahoo!
...for example, yandex, a major search engine in russia, supports microformats such as hcard (company contact information), hrecipe (food recipe), hreview (market reviews) and hproduct (product data) and provides its own format for the definition of the terms and encyclopedic articles.
Microformats - HTML: Hypertext Markup Language
summary microformats (sometimes abbreviated μf) are standards used to embed semantics & structured data in html, and provide an api to be used by search engines, aggregators, and other tools.
...microformats2 is an update to microformats that provides a simpler way of annotating html structured syntax & vocabularies than previous approaches of using rdfa and microdata which require learning new attributes.
Evolution of HTTP - HTTP
more than 15 years of extensions thanks to its extensibility – creating new headers or methods is easy – and even if the http/1.1 protocol was refined over two revisions, rfc 2616 published in june 1999 and the series of rfc 7230-rfc 7235 published in june 2014 in prevision of the release of http/2, this protocol has been extremely stable over more than 15 years.
...like with http/1.x previously, http's extensibility is still being used to add new features.
Resource URLs - HTTP
for example, a script on browserleaks highlights what firefox reveals when queried by a simple script running on the site (you can find the code in https://browserleaks.com/firefox#more).
...for example: http://searchfox.org/mozilla-central/rev/48ea452803907f2575d81021e8678634e8067fc2/browser/app/profile/firefox.js#575 web sites can easily collect firefox default preferences by overriding this pref() function and using the script resource:///defaults/preferences/firefox.js.
Connection management in HTTP/1.x - HTTP
this connection will not stay open forever: idle connections are closed after some time (a server may use the keep-alive header to specify a minimum time the connection should be kept open).
...most http/2 implementations use a technique called connection coalescing to revert eventual domain sharding.
Using Feature Policy - HTTP
you can use feature policies to specify the desired best practices, and rely on the browser to enforce the policies to prevent regressions.
...preventing the use of the sub-optimal functionality requires explicitly specifying a policy that disables the features.
Cross-Origin-Resource-Policy - HTTP
note: due to a bug in chrome, setting cross-origin-resource-policy can break pdf rendering, preventing visitors from being able to read past the first page of some pdfs.
... due to a bug in firefox, setting cross-origin-resource-policy can prevent some resources (such as pdfs) from being downloaded in some circumstances.
If-Match - HTTP
WebHTTPHeadersIf-Match
there are two common use cases: for get and head methods, used in combination with a range header, it can guarantee that the new ranges requested comes from the same resource than the previous one.
... for other methods, and in particular for put, if-match can be used to prevent the lost update problem.
Referer - HTTP
WebHTTPHeadersReferer
the referer request header contains the address of the previous web page from which a link to the currently requested page was followed.
... header type request header forbidden header name yes syntax referer: <url> directives <url> an absolute or partial address of the previous web page from which a link to the currently requested page was followed.
Warning - HTTP
WebHTTPHeadersWarning
note: the warning header is soon to be deprecated; see warning (https://github.com/httpwg/http-core/issues/139) and warning: header & stale-while-revalidate (https://github.com/whatwg/fetch/issues/913) for more details.
... 111 revalidation failed an attempt to validate the response failed, due to an inability to reach the server.
Redirections in HTTP - HTTP
there are several types of redirects, sorted into three categories: permanent redirections temporary redirections special redirections permanent redirections these redirections are meant to last forever.
... 304 not modified sent for revalidated conditional requests.
500 Internal Server Error - HTTP
WebHTTPStatus500
the hypertext transfer protocol (http) 500 internal server error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
...sometimes, server administrators log error responses like the 500 status code with more details about the request to prevent the error from happening again in the future.
Expressions and operators - JavaScript
« previousnext » this chapter describes javascript's expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more.
...super.functiononparent([arguments]); « previousnext » ...
Grammar and types - JavaScript
« previousnext » this chapter discusses javascript's basic grammar, variable declarations, data types and literals.
... « previousnext » ...
Iterators and generators - JavaScript
« previousnext » processing each of the items in a collection is a very common operation.
... « previousnext » ...
Keyed collections - JavaScript
« previousnext » this chapter introduces collections of data which are indexed by a key; map and set objects contain elements which are iterable in the order of insertion.
... « previousnext » ...
JavaScript modules - JavaScript
« previous this guide gives you all you need to get started with javascript module syntax.
...in our renaming directory you'll see the same module system as in the previous example, except that we've added circle.js and triangle.js modules to draw and report on circles and triangles.
Numbers and dates - JavaScript
« previousnext » this chapter introduces the concepts, objects and functions used to work with and perform calculations using numbers and dates in javascript.
... « previousnext » ...
Regular expressions - JavaScript
« previousnext » regular expressions are patterns used to match character combinations in strings.
... the roles of "class" and "argument" get reversed: in the case of .match(), the string class (or data type) owns the method and the regular expression is just an argument, while in the case of .exec(), it is the regular expression that owns the method, with the string being the argument.
Text formatting - JavaScript
« previousnext » this chapter introduces how to work with strings and text in javascript.
... « previousnext » ...
TypeError: can't access dead object - JavaScript
the javascript exception "can't access dead object" occurs when firefox disallows add-ons to keep strong references to dom objects after their parent document has been destroyed to improve in memory usage and to prevent memory leaks.
... to improve in memory usage and to prevent memory leaks, firefox disallows add-ons to keep strong references to dom objects after their parent document has been destroyed.
Array.prototype.flat() - JavaScript
flatdeep(val, d - 1) : val), []) : arr.slice(); }; flatdeep(arr, infinity); // [1, 2, 3, 4, 5, 6] use a stack // non recursive flatten deep using a stack // note that depth control is hard/inefficient as we will need to tag each value with its own depth // also possible w/o reversing on shift/unshift, but array ops on the end tends to be faster function flatten(input) { const stack = [...input]; const res = []; while(stack.length) { // pop value from stack const next = stack.pop(); if(array.isarray(next)) { // push back array items, won't modify the original input stack.push(...next); } else { res.push(next); } } // revers...
...e to restore input order return res.reverse(); } const arr = [1, 2, [3, 4, [5, 6]]]; flatten(arr); // [1, 2, 3, 4, 5, 6] use generator function function* flatten(array, depth) { if(depth === undefined) { depth = 1; } for(const item of array) { if(array.isarray(item) && depth > 0) { yield* flatten(item, depth - 1); } else { yield item; } } } const arr = [1, 2, [3, 4, [5, 6]]]; const flattened = [...flatten(arr, infinity)]; // [1, 2, 3, 4, 5, 6] please do not add polyfills on this article.
Array.prototype.push() - JavaScript
do not use this method if the second array (morevegs in the example) is very large because the maximum number of parameters that one function can take is limited in practice.
... let vegetables = ['parsnip', 'potato'] let morevegs = ['celery', 'beetroot'] // merge the second array into the first one // equivalent to vegetables.push('celery', 'beetroot') array.prototype.push.apply(vegetables, morevegs) console.log(vegetables) // ['parsnip', 'potato', 'celery', 'beetroot'] using an object in an array-like fashion as mentioned above, push is intentionally generic, and we can use that to our advantage.
BigInt - JavaScript
const previousmaxsafe = bigint(number.max_safe_integer) // ↪ 9007199254740991n const maxplusone = previousmaxsafe + 1n // ↪ 9007199254740992n const thefuture = previousmaxsafe + 2n // ↪ 9007199254740993n, this works now!
... const multi = previousmaxsafe * 2n // ↪ 18014398509481982n const subtr = multi – 10n // ↪ 18014398509481972n const mod = multi % 10n // ↪ 2n const bign = 2n ** 54n // ↪ 18014398509481984n bign * -1n // ↪ –18014398509481984n the / operator also works as expected with whole numbers.
BigInt64Array - JavaScript
bigint64array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
BigUint64Array - JavaScript
biguint64array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Float32Array - JavaScript
float32array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Float64Array - JavaScript
float64array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Int16Array - JavaScript
int16array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Int32Array - JavaScript
int32array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Int8Array - JavaScript
int8array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
JSON - JavaScript
static methods json.parse(text[, reviver]) parse the string text as json, optionally transform the produced value and its properties, and return the value.
...the reviver option allows for interpreting what the replacer has used to stand in for other datatypes.
Object.fromEntries() - JavaScript
object.fromentries() performs the reverse of object.entries().
..., 'bar'], ['baz', 42] ]); const obj = object.fromentries(map); console.log(obj); // { foo: "bar", baz: 42 } converting an array to an object with object.fromentries, you can convert from array to object: const arr = [ ['0', 'a'], ['1', 'b'], ['2', 'c'] ]; const obj = object.fromentries(arr); console.log(obj); // { 0: "a", 1: "b", 2: "c" } object transformations with object.fromentries, its reverse method object.entries(), and array manipulation methods, you are able to transform objects like this: const object1 = { a: 1, b: 2, c: 3 }; const object2 = object.fromentries( object.entries(object1) .map(([ key, val ]) => [ key, val * 2 ]) ); console.log(object2); // { a: 2, b: 4, c: 6 } please do not add polyfills on mdn pages.
Object.isExtensible() - JavaScript
an object can be marked as non-extensible using object.preventextensions(), object.seal(), or object.freeze().
...object.preventextensions(empty); object.isextensible(empty); // === false // sealed objects are by definition non-extensible.
Object.isSealed() - JavaScript
object.preventextensions(empty); object.issealed(empty); // === true // the same is not true of a non-empty object, // unless its properties are all non-configurable.
... var hasprop = { fee: 'fie foe fum' }; object.preventextensions(hasprop); object.issealed(hasprop); // === false // but make them all non-configurable // and the object becomes sealed.
Promise.prototype.then() - JavaScript
print helpful messages about how the code in this section will be run // before the string is actually processed by the mocked asynchronous code in the // previous then block.
...in the following example, the first then() will return 42 wrapped in a resolving promise even though the previous promise in the chain was rejected.
Comparing Reflect and Object methods - JavaScript
preventextensions() object.preventextensions() returns the object that is being made non-extensible.
... reflect.preventextensions() returns true if the object has been made non-extensible, and false if it has not.
String.prototype.split() - JavaScript
reversing a string using split() this is not a robust way to reverse a string: const str = 'asdfghjkl' const strreverse = str.split('').reverse().join('') // 'lkjhgfdsa' // split() returns an array on which reverse() and join() can be applied it doesn't work if the string contains grapheme clusters, even when using a unicode-aware split.
... (use, for example, esrever instead.) const str = 'résumé' const strreverse = str.split(/(?:)/u).reverse().join('') // => "́emuśer" bonus: use === operator to test if the original string was a palindrome.
Symbol - JavaScript
it creates a new symbol each time: symbol('foo') === symbol('foo') // false the following syntax with the new operator will throw a typeerror: let sym = new symbol() // typeerror this prevents authors from creating an explicit symbol wrapper object instead of a new symbol value and might be surprising as creating explicit wrapper objects around primitive data types is generally possible (for example, new boolean, new string and new number).
...this prevents you from silently creating a new string property name from a symbol, for example.
TypedArray - JavaScript
typedarray.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Uint16Array - JavaScript
uint16array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Uint32Array - JavaScript
uint32array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Uint8Array - JavaScript
uint8array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
Uint8ClampedArray - JavaScript
uint8clampedarray.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
... see also array.prototype.reverse().
WeakRef - JavaScript
a weakref object lets you hold a weak reference to another object, without preventing that object from getting garbage-collected.
...a weak reference to an object is a reference that does not prevent the object from being reclaimed by the garbage collector.
WebAssembly.Memory.prototype.grow() - JavaScript
return value the previous size of the memory, in units of webassembly pages.
... var memory = new webassembly.memory({initial:1, maximum:10}); we can then grow the instance by one page like so: const bytesperpage = 64 * 1024; console.log(memory.buffer.bytelength / bytesperpage); // "1" console.log(memory.grow(1)); // "1" console.log(memory.buffer.bytelength / bytesperpage); // "2" note the return value of grow() here is the previous number of webassembly pages.
Right shift (>>) - JavaScript
since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change.
...since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change.
new operator - JavaScript
(normally constructors don't return a value, but they can choose to do so if they want to override the normal object creation process.) you can always add a property to a previously defined object.
... you can add a shared property to a previously defined object type by using the function.prototype property.
this - JavaScript
in the above code example, function b's this is set to function a's this which is obj, so it remains set to obj even when called in a manner that would normally set its this to undefined or the global object (or any other method as in the previous example in the global execution context).
...in the previous example, we defined the function inline as the f member during the definition of o.
Template literals (Template strings) - JavaScript
started by "\0o" and followed by one or more digits, for example \0o251 this means that a tagged template like the following is problematic, because, per ecmascript grammar, a parser looks for valid unicode escape sequences, but finds malformed syntax: latex`\unicode` // throws in older ecmascript versions (es2016 and earlier) // syntaxerror: malformed unicode character escape sequence es2018 revision of illegal escape sequences tagged templates should allow the embedding of languages (for example dsls, or latex), where other escapes sequences are common.
... the ecmascript proposal template literal revision (stage 4, to be integrated in the ecmascript 2018 standard) removes the syntax restriction of ecmascript escape sequences from tagged templates.
JavaScript
for complete beginners head over to our learning area javascript topic if you want to learn javascript but have no previous experience of javascript or programming.
... javascript guide javascript guide a much more detailed guide to the javascript language, aimed at those with previous programming experience either in javascript or another language.
Web audio codec guide - Web media technologies
g.722 audio is encoded using adaptive differential pulse code modulation (adpcm), in which each sample is represented not by its absolute value, but as a value indicating how much the new sample differs from the previous sample.
... when mp3-format audio is stored inside an mpeg container, the resulting file is also referred to as just an "mp3 file" or simply "mp3." files with the ubiquitous .mp3 extension are stored in what is perhaps the most widely distributed audio file format in the world, which is in large part responsible for the digital audio revolution of the late 1990s and early 2000s.
Digital audio concepts - Web media technologies
as: any situation in which the listener expects precise audio reproduction and may have an ear for sound that's good enough to make out the intricate details of unaltered audio audio loops and samples used in music and sound effects production work situations in which audio clips or samples may be remixed and then compressed; using lossless audio for the mastering process avoids compressing previously compressed data, resulting in additional quality loss factors that may recommend the use of lossy compression include: very large source audio constrained storage (either because the storage space is small, or because there's a large amount of sound to store into it) a need to constrain the network bandwidth required to broadcast the audio; this is especially important for live strea...
...the options tend to revolve around choosing the method by which the encoder performs the encoding and how much time and processor power it's allowed to consume in order to do so.
Media container formats (file types) - Web media technologies
through quicktime, mac applications (including web browsers, through the quicktime plugin or direct quicktime integration) were able to read and write audio formats including aac, aiff, mp3, pcm, and qualcomm purevoice; and video formats including avi, dv, pixlet, prores, flac, cinepak, 3gp, h.261 through h.265, mjpeg, mpeg-1 and mpeg-4 part 2, sorenson, and many more.
...if you're going to be manipulating the media data, using an uncompressed format can improve performance, while using a lossless compressed format at least prevent the accumulation of noise as compression artifacts are multiplied with each re-compression that occurs.
Performance fundamentals - Web Performance
applications that constantly fire timers or keep unnecessary animations running prevent cpus from entering low-power mode.
...this will save battery life and prevent users from cursing your name into the night sky.
Performance budgets - Web Performance
a performance budget is a limit to prevent regressions.
... their primary goal is to prevent regressions, but they can provide insights to forecast trends (i.e.
Add to Home screen - Progressive web apps (PWAs)
we can then use a handler like the one below to handle the installation: window.addeventlistener('beforeinstallprompt', (e) => { // prevent chrome 67 and earlier from automatically showing the prompt e.preventdefault(); // stash the event so it can be triggered later.
...deferredprompt.prompt(); // wait for the user to respond to the prompt deferredprompt.userchoice.then((choiceresult) => { if (choiceresult.outcome === 'accepted') { console.log('user accepted the a2hs prompt'); } else { console.log('user dismissed the a2hs prompt'); } deferredprompt = null; }); }); }); so here we: call event.preventdefault() to stop chrome 67 and earlier from calling the install prompt automatically (this behavior changed in chrome 68).
Progressive web app structure - Progressive web apps (PWAs)
previous overview: progressive web apps next now that we know the theory behind pwas, let's look at the recommended structure of an actual app.
... previous overview: progressive web apps next ...
How to make PWAs installable - Progressive web apps (PWAs)
previous overview: progressive next in the last article, we read about how the example application, js13kpwa, works offline thanks to its service worker, but we can go even further and allow users to install the web app on mobile and desktop browers that support doing so.
... previous overview: progressive next ...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
previous overview: progressive next having the ability to cache the contents of an app to work offline is a great feature.
... previous overview: progressive next ...
The building blocks of responsive design - Progressive web apps (PWAs)
you can then view previously-captured images and delete them.
...we've also altered the width of the images inside the third container (no longer a column — this is the gallery) so that now you get five per line (it was previously three per line).
Progressive web apps (PWAs)
progressive loadingin previous articles we covered apis that help us make our js13kpwa example a progressive web app: service workers, web manifests, notifications and push.
... everything below this point is left over from the old version of this page and will be revamped as other content is overhauled.
transform - SVG: Scalable Vector Graphics
matrix(a,b,c,d,e,f) is equivalent to applying the transformation matrix:(acebdf001)\begin{pmatrix} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{pmatrix} which maps coordinates from a previous coordinate system into a new coordinate system by the following matrix equalities:(xnewcoordsysynewcoordsys1)=(acebdf001)(xprevcoordsysyprevcoordsys1)=(axprevcoordsys+cyprevcoordsys+ebxprevcoordsys+dyprevcoordsys+f1) \begin{pmatrix} x_{\mathrm{newcoordsys}} \\ y_{\mathrm{newcoordsys}} \\ 1 \end{pmatrix} = \begin{pmatrix} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x_{\ma...
...thrm{prevcoordsys}} \\ y_{\mathrm{prevcoordsys}} \\ 1 \end{pmatrix} = \begin{pmatrix} a x_{\mathrm{prevcoordsys}} + c y_{\mathrm{prevcoordsys}} + e \\ b x_{\mathrm{prevcoordsys}} + d y_{\mathrm{prevcoordsys}} + f \\ 1 \end{pmatrix} example html,body,svg { height:100% } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="30" height="20" fill="green" /> <!-- in the following example we are applying the matrix: [a c e] [3 -1 30] [b d f] => [1 3 40] [0 0 1] [0 0 1] which transform the rectangle as such: top left corner: oldx=10 oldy=10 newx = a * oldx + c * oldy + e = 3 * 10 - 1 * 10 + 30 = 50 newy = b * oldx + d * oldy + f = 1 * 10 + 3 * 10 + 40 = 80 top right corner: oldx=40 oldy=10 newx = a * oldx + c * oldy + e ...
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
svg attributes a to z a accent-height accumulate additive alignment-baseline allowreorder alphabetic amplitude arabic-form ascent attributename attributetype autoreverse azimuth b basefrequency baseline-shift baseprofile bbox begin bias by c calcmode cap-height class clip clippathunits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering contentscripttype contentstyletype cursor cx cy d d decelerate descent diffuseconstant direction display divisor dominant-baselin...
...s height, result, width, x, y transfer function attributes type, tablevalues, slope, intercept, amplitude, exponent, offset animation attributes animation attribute target attributes attributetype, attributename animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by, autoreverse, accelerate, decelerate animation addition attributes additive, accumulate event attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondraglea...
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <defs> <!-- arrowhead marker definition --> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <!-- simple dot marker definition --> <marker id="dot" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="5" markerheight="5"> <circle cx="5" cy="5" r="5" fill="red" /> </marker> </defs> <!-- coordinate axes with a arrowhead in both direction --> <polyline points="10,10 10,90 90,90" fill="none" stroke="...
... value type: auto|auto-start-reverse|<angle> ; default value: 0; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
value type: <length>|<percentage> ; default value: 0; animatable: yes dx shifts the text position horizontally from a previous text element.
... value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a previous text element.
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
value type: <length>|<percentage> ; default value: none; animatable: yes dx shifts the text position horizontally from a previous text element.
... value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a previous text element.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
mented yet (bug 1318208) vector-effect has no effect within 3d rendering context implementation status unknown consider clip and overflow on svg document referenced by <image> implementation status unknown paths change notes b and b path commands implementation status unknown z and z path commands to add path coordinate data to previous command implementation status unknown not render <path>, <polygon> and <polyline> with no data implementation status unknown svgpathseg*, svganimatedpathdata and related methods removed from svgpathelement implementation status unknown d attribute as css property implementation status unknown basic shapes change notes pat...
...efox 26.0 / thunderbird 26.0 / seamonkey 2.23)) child keyword for <paint> values and marker properties implementation status unknown vector-effect property only none and non-scaling-stroke values are supported (bug 528332 (firefox 15 / thunderbird 15 / seamonkey 2.12), bug 1318208) arcs value for stroke-linejoin not implemented (bug 1239142) auto-start-reverse value for <marker>'s orient attribute implemented (bug 879659) svgpaint removed implementation status unknown fill and stroke taking multiple paints implementation status unknown z-index not implemented (bug 360148 child(<integer>) paint value implementation status unknown display of zero-length subpaths depends on stroke-linecap att...
Basic shapes - SVG: Scalable Vector Graphics
« previousnext » there are several basic shapes used for most svg drawing.
... « previousnext » ...
Fills and Strokes - SVG: Scalable Vector Graphics
« previousnext » there are several ways to color shapes (including specifying attributes on the object) using inline css, an embedded css section, or an external css file.
...ify an external stylesheet for your css rules through normal xml-stylesheet syntax: <?xml version="1.0" standalone="no"?> <?xml-stylesheet type="text/css" href="style.css"?> <svg width="200" height="150" xmlns="http://www.w3.org/2000/svg" version="1.1"> <rect height="10" width="10" id="myrect"/> </svg> where style.css looks something like: #myrect { fill: red; stroke: black; } « previousnext » ...
Introduction - SVG: Scalable Vector Graphics
« previousnext » svg is an xml language, similar to xhtml, which can be used to draw vector graphics, such as the ones shown to the right.
... « previousnext » ...
Other content in SVG - SVG: Scalable Vector Graphics
« previousnext » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well.
... « previousnext » ...
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
« previousnext » patterns patterns are arguably one of the more confusing fill types to use in svg.
... « previousnext » ...
Positions - SVG: Scalable Vector Graphics
« previousnext » in this article, we examine how scalable vector graphics (svg) represents the positions and sizes of objects within a drawing context, including coordinate system and what a "pixel" measurement means in a scalable context.
...then, for all processing of svg content: [...] "1cm" equals "35.43307px" (and therefore 35.43307 user units) « previousnext » ...
SVG image element - SVG: Scalable Vector Graphics
« previousnext » the svg <image> element allows for raster images to be rendered within an svg object.
... « previousnext » ...
SVG fonts - SVG: Scalable Vector Graphics
« previousnext » when svg was specified, support for web fonts was not widespread in browsers.
...> <text font-family="super sans">my text uses super sans</text> option: reference a remote font the above mentioned font-face-uri element allows you to reference an external font, hence allowing greater re-usability: <font> <font-face font-family="super sans"> <font-face-src> <font-face-uri xlink:href="fonts.svg#super_sans" /> </font-face-src> </font-face> </font> « previousnext » ...
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
« previousnext » when talking about text in svg we have to differentiate two almost completely separate topics.
... </textpath> </text> <style><![cdata[ text{ dominant-baseline: hanging; font: 28px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> « previousnext » ...
Tools for SVG - SVG: Scalable Vector Graphics
« previous now that we covered the basics of the svg internals, we will take a look at some tools to work with svg files.
... « previous ...
Referer header: privacy and security concerns - Web security
the referrer problem the referer (sic) header contains the address of the previous web page from which a link to the currently requested page was followed, which has lots of fairly innocent uses including analytics, logging, or optimized caching.
... you should use post rather than get wherever possible, to avoid passing sensitive data to other locations via urls.
Types of attacks - Web security
ed: <form action="https://bank.example.com/withdraw" method="post"> <input type="hidden" name="account" value="bob"> <input type="hidden" name="amount" value="1000000"> <input type="hidden" name="for" value="mallory"> </form> <script>window.addeventlistener('domcontentloaded', (e) => { document.queryselector('form').submit(); }</script> there are a few techniques that should be used to prevent this from happening: get endpoints should be idempotent—actions that enact a change and do not simply retrieve data should require sending a post (or other http method) request.
... for more prevention tips, see the owasp csrf prevention cheat sheet.
Web Components
web components aims to solve such problems — it consists of three main technologies, which can be used together to create versatile custom elements with encapsulated functionality that can be reused wherever you like without fear of code collisions.
... use your custom element wherever you like on your page, just like you would any regular html element.
Using the WebAssembly JavaScript API - WebAssembly
see webassembly debugging with firefox devtools for a video preview.
... note: since an arraybuffer’s bytelength is immutable, after a successful memory.prototype.grow() operation the buffer getter will return a new arraybuffer object (with the new bytelength) and any previous arraybuffer objects become “detached”, or disconnected from the underlying memory they previously pointed to.
2015 MDN Fellowship Program - Archive of obsolete content
to support our efforts, the fellow will review various technical specifications to identify gaps between the documentation and current situation and refine existing tests to adapt to this cross-browser test harness.
Loading Content Scripts - Archive of obsolete content
this makes your code easier to maintain, secure, debug and review.
port - Archive of obsolete content
due to bug 816272 the page-mod's removelistener() function does not prevent the listener from receiving messages that are already queued.
SDK API Lifecycle - Archive of obsolete content
the amo validator will throw errors when deprecated modules are used, and these add-ons will therefore fail amo review.
Working with Events - Archive of obsolete content
the listener must have been previously been added using one of the methods described above.
Guides - Archive of obsolete content
contributor's guide getting started learn how to contribute to the sdk: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help.
hotkeys - Archive of obsolete content
the following commonly used hotkey combinations will not pass amo review: accel-z, accel-c, accel-x, accel-v or accel-q if you choose to use a key combination that's already defined, choose one which makes sense for the operation it will perform.
page-worker - Archive of obsolete content
this makes your code easier to maintain, secure, debug and review.
simple-storage - Archive of obsolete content
you may also need to include the --no-copy option to prevent firefox from copying the profile to a temporarry directory each time it starts.
tabs - Archive of obsolete content
this means that if the user loads a page, loads a new page, then moves back to the previous page using the "back" button, the pageshow event is emitted when the user moves back to the previous page, while the load and ready events are not.
ui - Archive of obsolete content
you initialize a toolbar with an array of buttons and frames: var ui = require("sdk/ui"); var { actionbutton } = require("sdk/ui/button/action"); var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var previous = ui.actionbutton({ id: "previous", label: "previous", icon: "./icons/previous.png" }); var next = ui.actionbutton({ id: "next", label: "next", icon: "./icons/next.png" }); var play = ui.actionbutton({ id: "play", label: "play", icon: "./icons/play.png" }); var frame = ui.frame({ url: "./frame-player.html" }); var toolbar = ui.toolbar({ title: "player", items: [pre...
widget - Archive of obsolete content
this makes your code easier to maintain, secure, debug and review.
chrome - Archive of obsolete content
if you use this api you can expect your add-on to get an extra security review by addons.mozilla.org.
lang/functional - Archive of obsolete content
let { once } = require("sdk/lang/functional"); let setup = once(function (env) { // initializing important things console.log("successfully initialized " + env); return 1; // assume success and return 1 }); setup('dev'); // returns 1 // prints "successfully initialized dev" // future attempts to call this function just return the cached // value that was returned previously setup('production'); // returns 1 // no print message is displayed since the function isn't executed parameters fn : function the function that will be executed only once inside the once wrapper.
places/favicon - Archive of obsolete content
the platform service (moziasyncfavicons) retrieves favicon data stored from previously visited sites, and as such, will only return favicon urls for visited sites.
ui/frame - Archive of obsolete content
if you know the target uri, you should use it, as this is more secure: it prevents another window from intercepting messages that were intended for someone else.
ui/toolbar - Archive of obsolete content
you can supply three sorts of ui components: action buttons toggle buttons frames this add-on builds part of the user interface for a music player using action buttons for the controls and a frame to display art and the currently playing song: var { actionbutton } = require('sdk/ui/button/action'); var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var previous = actionbutton({ id: "previous", label: "previous", icon: "./icons/previous.png" }); var next = actionbutton({ id: "next", label: "next", icon: "./icons/next.png" }); var play = actionbutton({ id: "play", label: "play", icon: "./icons/play.png" }); var frame = new frame({ url: "./frame-player.html" }); var toolbar = toolbar({ title: "player", items: [previous, next...
package.json - Archive of obsolete content
previously was --update-link in cfx.
Displaying annotations - Archive of obsolete content
', function onmessage(annotations) { annotations.foreach( function(annotation) { if(annotation.url == document.location.tostring()) { createanchor(annotation); } }); $('.annotated').css('border', 'solid 3px yellow'); $('.annotated').bind('mouseenter', function(event) { self.port.emit('show', $(this).attr('annotation')); event.stoppropagation(); event.preventdefault(); }); $('.annotated').bind('mouseleave', function() { self.port.emit('hide'); }); }); function createanchor(annotation) { annotationanchorancestor = $('#' + annotation.ancestorid); annotationanchor = $(annotationanchorancestor).parent().find( ':contains(' + annotation.anchortext + ')').last(); $(annotationanchor).addclass('annotated'); $(annotat...
Implementing the widget - Archive of obsolete content
ntent script the widget's content script just listens for left- and right- mouse clicks and posts the corresponding message to the add-on code: this.addeventlistener('click', function(event) { if(event.button == 0 && event.shiftkey == false) self.port.emit('left-click'); if(event.button == 2 || (event.button == 0 && event.shiftkey == true)) self.port.emit('right-click'); event.preventdefault(); }, true); save this in your data/widget directory as widget.js.
Overview - Archive of obsolete content
because we are recording potentially sensitive information, we want to prevent the user creating annotations when in private browsing mode.
Getting Started (jpm) - Archive of obsolete content
this file was created for you in the previous step.
Getting started (cfx) - Archive of obsolete content
this file was created for you in the previous step.
Modifying Web Pages Based on URL - Archive of obsolete content
this makes the code easier to maintain, debug, and review.
Modifying the Page Hosted by a Tab - Archive of obsolete content
this makes the code easier to maintain, debug, and review.
Localization - Archive of obsolete content
any previously existing content is just replaced.
Bootstrapped extensions - Archive of obsolete content
oldversion string the previously installed version, if the reason is addon_upgrade or addon_downgrade, and the method is install or startup.
Alerts and Notifications - Archive of obsolete content
this works on windows, linux and (if growl is installed) mac os x: function popup(title, text) { try { components.classes['@mozilla.org/alerts-service;1'] .getservice(components.interfaces.nsialertsservice) .showalertnotification(null, title, text, false, '', null); } catch(e) { // prevents runtime error on platforms that don't implement nsialertsservice } } if you need to display a comparable alert on a platform that doesn't support nsialertsservice, you can do this: function popup(title, msg) { var image = null; var win = components.classes['@mozilla.org/embedcomp/window-watcher;1'] .getservice(components.interfaces.nsiwindowwatcher) ...
Bookmarks - Archive of obsolete content
var thisuri = bmsvc.getbookmarkuri(newbkmkid); assuming you've run all the code samples previous to this one, this will output "http://google.com".
Dialogs and Prompts - Archive of obsolete content
the possible values for the attribute are the names of buttons listed above, and the default is "accept", for compatibility with previous versions.
JS XPCOM - Archive of obsolete content
with the preferences service from the previous example we can do the following: var preferences = preferences.queryinterface(components.interfaces.nsiprefbranch2); this allows you to use the methods in the nsiprefbranch2 interface.
Sidebar - Archive of obsolete content
for this snippet to work, you have to declare mainwindow as in the previous code block then write: mainwindow.document.getelementbyid("sidebar-splitter").hidden = true; be aware that if you change the splitter's hidden attribute, you need to reset it to a safe value when your sidebar is closed, or replaced by another sidebar.
Windows - Archive of obsolete content
re-using and focusing named windows while specifying the name parameter to window.open or window.opendialog will prevent multiple windows of that name from opening, each call will actually re-initialize the window and thus lose whatever state the user has put it in.
xml:base support in old browsers - Archive of obsolete content
olpos+skipfile); // find first path separator ('/') after protocol if (att2 !== -1) { att = att.substring(0, att2 - 1); // don't want any trailing slash, as the absolute path to be added already has one } } else if (!att.match(/\/$/)) { // if no trailing slash, add one, since it is being attached to a relative path att += '/'; } xmlbase = att + xmlbase; // if previous path was not absolute, resolve against the full uri here' break; } else if (att.indexof('/') === 0) { // if absolute (/), need to prepare for next time to strip out after slash xmlbase = att + xmlbase; abs = true; // once the protocol is found on the next round, make sure any extra path is ignored } else { // if relative, just add it xmlbase = att + xmlbase; } ...
Common Pitfalls - Archive of obsolete content
these are the sort of things that super-review should be catching for code that goes into the tree; avoiding these to start with saves super-reviewers a lot of effort.
Displaying web content in an extension without security issues - Archive of obsolete content
er on the frame tag (meaning that it is outside the restricted document and can execute without restrictions): <iframe type="content" onclick="handleclick(event);"/> and the event handler would look like that: function handlebrowserclick(event) { // only react to left mouse clicks if (event.button != 0) return; // default action on link clicks is to go to this link, cancel it event.preventdefault(); if (event.target instanceof htmlanchorelement && event.target.href) openlinkinbrowser(event.target.href); } safe html manipulation functions when it comes to displaying the data, it is tempting to generate some html code and to insert it into the document via innerhtml.
Downloading JSON and JavaScript in extensions - Archive of obsolete content
this practice is dangerous and will not, in fact, pass an amo review.
Hiding browser chrome - Archive of obsolete content
var prevfunc = xulbrowserwindow.hidechromeforlocation; xulbrowserwindow.hidechromeforlocation = function(alocation) { return (/* your test goes here */) || prevfunc.apply(xulbrowserwindow, [alocation]); } this works by saving a reference to the current implementation of the hidechromeforlocation() method, then replacing it with a new method that calls through to the previous implementation.
Inline options - Archive of obsolete content
y the optionstype as 2: <em:optionsurl>chrome://myaddon/content/name_of_my_file_to_use_for_inline_opts.xul</em:optionsurl> <em:optionstype>2</em:optionstype> your chrome.manifest file should contain the following, otherwise the path chrome://myaddon/content/name_of_my_file_to_use_for_inline_opts.xul will not exist content myaddon ./ this method allows you to maintain compatibility with previous versions of firefox by adding an override to your chrome.manifest: ...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
for errors about undeclared do_createinstance: #include "nscomponentmanagerutils.h" for errors about undeclared do_getservice: #include "nsservicemanagerutils.h" for errors about undeclared ns_getspecialdirectory: #include "nsdirectoryserviceutils.h" utility classes some utility classes could previously be created with ns_new* utility functions.
Multiple item extension packaging - Archive of obsolete content
there is currently no feature to prevent or warn the user when installing an older version of an extension.
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
remember that the user can revert this decision.
Appendix F: Monitoring DOM changes - Archive of obsolete content
it is worth noting, however, that while the animation-based implementation will fire any time an element which previously did not match the given selector is changed so that it does (when a class is added, for instance), the fallback will only match nodes when they are inserted into the dom tree.
Session store API - Archive of obsolete content
in order to properly restore your extension's state when a tab is restored, it needs to use the session store api's settabvalue() method to save any data it will need in order to restore its state, and then call gettabvalue() to retrieve the previous setting when the tab is restored.
Using the Stylesheet Service - Archive of obsolete content
vice;1"] .getservice(components.interfaces.nsistylesheetservice); var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("chrome://myext/content/myext.css", null, null); if(!sss.sheetregistered(uri, sss.user_sheet)) sss.loadandregistersheet(uri, sss.user_sheet); removing a previously registered stylesheet if you wish to remove a stylesheet that you previously registered, simply use the unregistersheet method.
Creating reusable content with CSS and XBL - Archive of obsolete content
use the dom inspector tool to inspect the document, revealing the added content.
XML data - Archive of obsolete content
previous section: svg next section: xbl binding information: xml data xml (extensible markup language) is a general-purpose language for any kind of structured data.
CSS3 - Archive of obsolete content
motion path module level 1 working draft css fonts module level 4 working draft css easing functions level 1 working draft css logical properties and values level 1 editor's draft modules in the revising phase modules that are in the revising phase are much less stable than those in the refining phase.
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
; // ie fix if(document.all) tagname="nde:"+tagname; paraa=article.getelementsbytagname(tagname).item(0).firstchild.nodevalue; linkk=article.getattribute("url"); strvalue="<div class='nde-blurb'><h3><a href='"+linkk+"'>"+valuee+"</a></h3><p>"+paraa+"</p></div>"; document.getelementbyid("container").innerhtml+=strvalue; } } if(previousele) { previousele.style.backgroundcolor="white"; } ele.style.backgroundcolor="#ddeeff"; previousele=ele; } var previousele=null; </script> <style> .tab { position:relative;top:1px; border: 1px solid #dddddd; color:white; background-color:white; padding-left: 5px; border-bottom:white;padding-right: 5px; padding-top:3px; text-decoration:none;} .tab:hover { background-color:#ddee...
cert_override.txt - Archive of obsolete content
domainname:port : port 443 for https (ssl) hash algorithm oid sha1-256: oid.2.16.840.1.101.3.4.2.1 (most used) sha-384: oid.2.16.840.1.101.3.4.2.2 sha-512: oid.2.16.840.1.101.3.4.2.3 certificate fingerprint using previous hash algorithm one or more characters for override type: m : allow mismatches in the hostname u : allow untrusted certs (whether it's self signed cert or a missing or invalid issuer cert) t : allow errors in the validity time, for example, for expired or not yet valid certs certificate's serial number and the issuer name as a base64 encoded string ...
Creating a Web based tone generator - Archive of obsolete content
setinterval(function() { var written; // check if some data was not written in previous attempts.
Autodial for Windows NT - Archive of obsolete content
the only way the service will work in this case is if the internet address has been accessed some previous time via the modem.
Protecting Mozilla's registry.dat file - Archive of obsolete content
in order to prevent this, it's preferable to have mozilla's registry.dat file copied over from the server using the logon script.
Bonsai - Archive of obsolete content
checkins to any branch of xfe by ramiro between 26-feb-1998 and 12-may-1998 differences between revisions 3.1 and 3.3 of the file mozilla/cmd/xfe/forms.c that's a small sample, but it should be enough to get you started.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
« previousnext » ...
Enabling the behavior - updating the status periodically - Archive of obsolete content
« previousnext » ...
Finding the code to modify - Archive of obsolete content
« previousnext » ...
Finding the file to modify - Archive of obsolete content
[explain further, http://www.mozilla.org/xpfe/configchromespec.html] « previousnext » ...
Making a Mozilla installation modifiable - Archive of obsolete content
[mention that if you have perl, you can also do this with patch maker] « previousnext » ...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
« previousnext » ...
Prerequisites - Archive of obsolete content
« previousnext » ...
Specifying the appearance - Archive of obsolete content
« previousnext » ...
contents.rdf - Archive of obsolete content
ied by this theme --> <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:myskin/1.0" /> </rdf:seq> <rdf:description about="urn:mozilla:skin:myskin/1.0" chrome:displayname="my skin" chrome:accesskey="m" chrome:author="me" chrome:description="this is my custom skin for mozilla" chrome:name="myskin/1.0" chrome:image="preview.png"> <chrome:packages> <rdf:seq about="urn:mozilla:skin:myskin/1.0:packages"> <rdf:li resource="urn:mozilla:skin:myskin/1.0:communicator"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:editor"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:global"/> <rdf:li resource="urn:mozilla:skin:myskin/1.0:messenger"/> <rdf:li resource="urn:mozilla:skin...
Creating regular expressions for a microsummary generator - Archive of obsolete content
for example, both of the following urls might point to the same page: http://www.example.com/index.html https://www.example.com/index.html to make a regular expression that matches both pages, we just need to start the expression with "https" and then add a question mark (?) after that string, for example: ^https?://www\.example\.com/index\.html the question mark makes the previous character optional, so the regular expression matches strings that include the "s" in "https" as well as ones that don't.
Download Manager improvements in Firefox 3 - Archive of obsolete content
note: these changes will require some modest revisions to code using the download manager; several methods have had minor changes.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
first, the java application must find a suitable xulrunner installation: mozilla mozilla = mozilla.getinstance(); greversionrange[] range = new greversionrange[1]; range[0] = new greversionrange("1.8.0", true, "1.9", false); // work with trunk nightly version 1.9a1 ^^ try { file grepath = mozilla.getgrepathwithproperties(range, null); locationprovider locprovider = new locationprovider(grepath); mozilla.initembedding(grepath, grepath, locprovider); } catch (filenotfoundexception e) { // this e...
Error Console - Archive of obsolete content
types of errors error usually a syntax error that prevents the program from compiling.
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
if this can't handle the content type, we loop over our stored list of possible listeners (previously registered via registercontentlistener) and ask each one in turn whether it can handle the data.
Layout System Overview - Archive of obsolete content
presumably it is more time and space-efficient to prevent frame creation for elements with no display.) the frame manager also maintains a list of forms and form controls, as content nodes.
Style System Overview - Archive of obsolete content
style data computation all the style struct computation described in the previous few slides happens lazily.
GRE Registration - Archive of obsolete content
each subkey is searched for gre registration information: hklm/software/mozilla.org/gre/1.8_1 version=1.8 grehome=c:\path\to\installed-dir feature=value feature2=value2 hklm/software/mozilla.org/gre/1.8_2 version=1.8 grehome=c:\path\to\second-installation when installing a gre via the mozilla suite gre installer, the installer will blindly overwrite any previous gre information in hklm/software/mozilla.org/gre/<version>.
GRE - Archive of obsolete content
this prevents dynamically finding a compatible gre at runtime.
Creating a Help Content Pack - Archive of obsolete content
the previous document had a lot of places where ideas were simply introduced without explanation, and i've tried to go through things a bit more slowly with better descriptions.
Introducing the Audio API extension - Archive of obsolete content
we can extend the previous example to visualize the timestamp and the first two samples in a <div> element: <!doctype html> <html> <head> <title>javascript visualization example</title> </head> <body> <audio id="audio-element" src="revolve.ogg" controls="true" style="width: 512px;"> </audio> <pre id="raw">hello</pre> <script> function loadedmetadata() { ...
generateCRMFRequest() - Archive of obsolete content
can be used for key recovery or revocation requests.
Basics - Archive of obsolete content
blah(lengthstringfocusedstringtostringstringpopstringpushstringreversestringshiftstringsortstringsplicestringunshiftstring)this is some default text lengththe number of open tabsstring focusedthe current tab in your browserstring tostringstuffstring popstuffstring pushstuffstring reversestuffstring shiftstuffstring sortstuffstring splicestuffstring unshiftstuffstring onready()when the inherited document is fully loaded.
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
reset() reverts all the changes to the menu that the feature has made.
slideBar - Archive of obsolete content
when a slidebar feature is selected, its contents will be revealed from behind the current web page.
slideBar - Archive of obsolete content
when a slidebar feature is selected its contents will be revealed from behind the current webpage.
Metro browser chrome tests - Archive of obsolete content
setup(), teardown(), and run() each have individual exception handlers to prevent one method from interfering with the execution of another.
Microsummary topics - Archive of obsolete content
for example, you might include the following header in your response to prevent firefox from making another microsummary-related request for one hour: cache-control: max-age=3600 note: because of a technical limitation (bug 346820), firefox uses the same cache for both microsummary-related requests and user-initiated requests, so the cache headers you return apply to both.
Monitoring downloads - Archive of obsolete content
although it was possible to do so in previous versions of firefox, it was previously only possible for one observer to do so at a time.
Nanojit - Archive of obsolete content
hence, guards are needed to prevent certain erroneous behaviour that might result from the assumptions that are generally made while jit is generated.
Plug-n-Hack Phase1 - Archive of obsolete content
configuresectoolactivated - this notifies the document that pnh support (perhaps previously unavailable, e.g.
BlogPosts - Archive of obsolete content
just browsing: mozilla prism update thanscorner: mozilla prism - webrunner with pazzaz mozilla prism - a revolution in web apps thanscorner: mozilla webrunner 0.7 site specific browsers webrunner using webrunner webrunner + gears = offline desktop reader webrunner 0.5 webrunner 0.5 - mac support webrunner 0.5 - linux install webrunner, google reader, and google notebook distraction free gtd - 32+ web app files for online todo lists mozilla webrunner: a one-window, tabless browser with no url bar webrunner becomes prism - a mozilla labs project mozilla labs: prism alex faaborg: prism mozilla prism: bringing web apps to the desktop everyone should use site specific browsers mozilla prism portable (spanish) prism, l'avenir des applications web selon mozilla (french) mozilla prism : bundl...
Frequently Asked Questions - Archive of obsolete content
other than reviewing patches and fixing the occassional bug, alex is currently taking a break from active svg development to concentrate on 'real work' and cool stuff like xtf and jssh.
Space Manager High Level Design - Archive of obsolete content
an instance is created the blockreflowstate's previous space manager is saved off.
SpiderMonkey coding conventions - Archive of obsolete content
the spidermonkey project owners enforce coding conventions pretty strictly during code reviews.
Archived SpiderMonkey docs - Archive of obsolete content
between resolving conflicts, finding a good time to land, watching the tree, and marking bugs as fixed, it takes around half a day.spidermonkey coding conventionsthe spidermonkey project owners enforce coding conventions pretty strictly during code reviews.
Supporting per-window private browsing - Archive of obsolete content
function pbobserver() { /* clear private data */ } var os = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); os.addobserver(pbobserver, "last-pb-context-exited", false); preventing a private session from ending if there are unfinished transactions involving private data, where the transactions will be terminated by the ending of a private session, an add-on can vote to prevent the session from ending (prompting the user is recommended).
Table Layout Regression Tests - Archive of obsolete content
execute mozilla -layoutdebug - p foo >outputfile.txt execute the verify test make a note which tests have failed grep 'failed' outputfile.txt check how many tests have failed and analyze your results: if the regression tests have failed at the same place as the previous diagnosed false positives => ignore try to figure out what the other regressions are: are they improving the picture or are they regressions?
Tamarin Releases - Archive of obsolete content
upcoming release name(s)release datelinks tc next~ april 2009roadmap current release namerelease datelinks tc "mar 2009" a5c9ed928c9603/27/09tamarin-devel announcement prior release name(s)release datelinks tc "feb 2009" a5c9ed928c9602/19/09tamarin-devel announcement tamarin-central rev 703:2cee46be9ce0 12/02/08tamarin-devel announcement ...
Tamarin mercurial commit hook - Archive of obsolete content
when a violation is found the following will be displayed: > hg commit -m "change with a tab" tab(s) found in test/test.txt for rev 1458 (change 53543674b8e6): @@ -65,4 +65,6 @@ +# tab here ^ (n)o, (y)es, (a)llow tabs for current file are you sure you want to commit this change?
Tuning Pageload - Archive of obsolete content
this is an optimization designed to prevent long text from ending up being o(n^2).
Using cross commit - Archive of obsolete content
otherwise cross-commit will end up waiting forever for you to type a cvs checkin message in an editor that it never shows you!
Using gdb on wimpy computers - Archive of obsolete content
/usr/lib/libstdc++-libc6.1-1.so.2 0x40491000 0x404ad9d8 yes /lib/libm.so.6 0x404ae000 0x405a285c yes /lib/libc.so.6 0x40000000 0x40013ed0 yes /lib/ld-linux.so.2 0x40607000 0x4061554c no /usr/lib/libz.so.1 0x40763000 0x4088af74 no /usr/lib/libgtk-1.2.so.0 0x4088b000 0x408c04d4 no /usr/lib/libgdk-1.2.so.0 [...] gdb is taking forever to load a shared library.
Venkman Internals - Archive of obsolete content
scriptmanager in initdebugger() the previous loaded scripts are passed to an onscriptcreated() method which binds them to a scriptmanager.
Venkman Introduction - Archive of obsolete content
the up and down arrows can be used to revisit these previous commands.
Using Breakpoints in Venkman - Archive of obsolete content
resources venkman introduction—previous article on venkman.
Video presentations - Archive of obsolete content
learn how to properly file a good bug report, how the bug reports are handled, and how to submit and get reviews for patches.
When To Use ifdefs - Archive of obsolete content
if you are introducing a makefile ifdef of any sort, please ask review from one of the build-config peers: benjamin smedberg is generally happy to review these changes.
Binding Attachment and Detachment - Archive of obsolete content
if the binding document is loaded prior to the firing of the load event, then any binding attachments that are placed following the load will be synchronous if they come from one of these previously loaded binding documents.
Event Handlers - Archive of obsolete content
a derived handler then has a way of preventing the event from flowing to its base binding handlers.
XBL - Archive of obsolete content
see also: xbl removal design review packet, problems with xbl and the xbl and web components comparison.
Install script template - Archive of obsolete content
+ " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } } else { logcomment("cancelling current browser install due to lack of space..."); cancellinstall(); } // secondary install block, which sets up plugins and xpt in another location in addition to the current browser errblock2 = createsecondaryinstall(); // performinstall block, in which error conditions from previous blocks are checked.
Using XPInstall to Install Plugins - Archive of obsolete content
a definition of terms xpinstall is an installer technology, and the name itself stands for "cross platform install" (hence "xp" -- an abbreviation for "cross platform").
getComponentFolder - Archive of obsolete content
description the getcomponentfolder method to find the location of a previously installed software package.
XPInstall API reference - Archive of obsolete content
xecute gestalt getcomponentfolder getfolder getlasterror getwinprofile getwinregistry initinstall loadresources logcomment patch performinstall refreshplugins registerchrome reseterror setpackagefolder installtrigger no properties methods compareversion enabled getversion install installchrome startsoftwareupdate installversion properties methods compareto init tostring file no properties methods copy dircreate dirgetparent dirremove dirrename diskspaceavailable execute ...
A XUL Bestiary - Archive of obsolete content
when you invoke mozilla from the command line with the -chrome flag, you can specify a chrome just as you would in the previous example: mozilla -chrome chrome://help/content/help.xul brings up the help package mentioned in the previous example as a "stand-alone" chrome.
browser.type - Archive of obsolete content
this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document.
crop - Archive of obsolete content
ArchiveMozillaXULAttributecrop
if the box direction is reversed, the cropping is reversed.
disablefastfind - Archive of obsolete content
this is used to prevent the find bar from being displayed when it's not supported by the content (such as in the add-ons manager tab).
handleCtrlTab - Archive of obsolete content
if the shift key is also held down, the previous tab will be displayed.
inverted - Archive of obsolete content
« xul reference home inverted type: boolean for boolean preferences, if this attribute is set to true, it indicates that the value of the preference is the reverse of the user interface element attached to it.
negate - Archive of obsolete content
« xul reference home negate type: boolean set to true to indicate that the comparison should be reversed.
noinitialfocus - Archive of obsolete content
this lets you prevent things like descriptions and labels from inadvertently receiving initial focus.
onbeforeaccept - Archive of obsolete content
returning false doesn't currently prevent the dialog from closing, but does prevent saving (bug 474527).
onpopupshowing - Archive of obsolete content
returning false from this event handler prevents the popup from appearing.
reserved - Archive of obsolete content
reserved="true"/> if the keyboard shortcut for that is accel-t, then this code will not work as expected, as compared to when it is run from web content: document.addeventlistener("keydown", handlekey, true); function handlekey(event) { // listen for the "new tab" shortcut if (event.metakey && (event.key == "t")) { // log a message console.log("intercepted accel-t"); // prevent the default browser action event.preventdefault(); event.stoppropagation(); } } currently, this event handler as coded above runs and logs the message, but the default behavior persists.
separator.orient - Archive of obsolete content
note that the values are the reverse of what seems more likely.
wait-cursor - Archive of obsolete content
in order to revert to the normal cursor state call the method removeattribute("wait-cursor") when the process effectively has ended otherwise the wait cursor might never disappear.
Attribute (XUL) - Archive of obsolete content
onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizardcancel onwizardfinish onwizardnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore r...
Deprecated and defunct markup - Archive of obsolete content
{many elements on this page are wrongly marked as deprecated, this page needs review} the following xul tags and attribute should be considered deprecated, if not defunct.
popupshowing - Archive of obsolete content
the default action of the event can be prevented to prevent the popup to appear.
Writing to Files - Archive of obsolete content
in this example, the nocreate flag is used to prevent the creation of new files, and the append flag is used to append to an existing file.
Introduction to XUL - Archive of obsolete content
javascript is most safely kept in a separate file and included in the xul file <html:script language="javascript" src="our.js"/> or relegated to the contents of a cdata section, to prevent the xml parser from choking on javascript which may look like xml content (a < character, for instance.) <html:script type="application/javascript"> <![cdata[ function lesser(a,b) { return a < b ?
advanceSelectedTab - Archive of obsolete content
if the argument dir is set to -1, the currently selected tab changes to the previous tab.
appendNotification - Archive of obsolete content
omponents.interfaces.nsiwindowmediator) .getmostrecentwindow("navigator:browser"); } if (typeof gbrowser === "undefined") { //if there is no gbrowser defined, get it var gbrowser = window.gbrowser; } function testnotificationbutton1callback(thenotification, buttoninfo, eventtarget) { window.alert("button 1 pressed"); //prevent notification from closing: return true; }; function testnotificationbutton2callback(thenotification, buttoninfo, eventtarget) { window.alert("button 2 pressed"); //do not prevent notification from closing: }; function testnotificationcallback(reason) { window.alert("reason is: " + reason); }; let notifybox = gbrowser.getnotificationbox...
checkAdjacentElement - Archive of obsolete content
if it is false, the previous radio button is selected.
goBackGroup - Archive of obsolete content
« xul reference home gobackgroup() not in firefox return type: no return value returns to the previous group of tabs.
invertSelection - Archive of obsolete content
« xul reference home invertselection() return type: no return value reverses the selected state of all items.
selectTabAtIndex - Archive of obsolete content
if the event argument is supplied, the default event handling will be prevented and propagation stopped.
stopEditing - Archive of obsolete content
otherwise the cell label is reverted to the value it had prior to editing.
Namespaces - Archive of obsolete content
although there's nothing preventing someone else from using the namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul, it's fairly unlikely anyone would choose that accidentally.
OpenClose - Archive of obsolete content
a menu may be closed by a script by setting the open property to false, the reverse of what would be done to open the menu.
locked - Archive of obsolete content
« xul reference locked type: boolean if true, the preference has been locked and disabled in the system configuration, preventing the value from being changed.
Property - Archive of obsolete content
:element.clonenode dom:element.firstchild dom:element.firstelementchild dom:element.lastchild dom:element.lastelementchild dom:element.localname dom:element.namespaceuri dom:element.nextelementsibling dom:element.nextsibling dom:element.nodename dom:element.nodetype dom:element.nodevalue dom:element.ownerdocument dom:element.parentnode dom:element.prefix dom:element.previouselementsibling dom:element.previoussibling dom:element.scrollheight dom:element.scrollleft dom:element.scrolltop dom:element.scrollwidth dom:element.tagname dom:element.textcontent ...
Providing Command-Line Options - Archive of obsolete content
]), /* nsicommandlinehandler */ handle : function clh_handle(cmdline) { try { // changeme: change "viewapp" to your command line flag that takes an argument var uristr = cmdline.handleflagwithparam("viewapp", false); if (uristr) { // convert uristr to an nsiuri var uri = cmdline.resolveuri(uristr); openwindow(chrome_uri, uri); cmdline.preventdefault = true; } } catch (e) { components.utils.reporterror("incorrect parameter passed to -viewapp on the command line."); } // changeme: change "myapp" to your command line flag (no argument) if (cmdline.handleflag("myapp", false)) { openwindow(chrome_uri, null); cmdline.preventdefault = true; } }, // changeme: change the help info as app...
Complete - Archive of obsolete content
have a bug that prevents this from working.
Tree Widget Changes - Archive of obsolete content
previously the value existed but was not implemented.
XUL Template Primer - Bindings - Archive of obsolete content
for example, the sample in this document wouldn't work if the two <binding> elements were reversed, because of the dependency on the ?addr variable.
Accessibility/XUL Accessibility Reference - Archive of obsolete content
tcell member observes preference preferences prefpane prefwindow resizer richlistbox richlistitem resizer rule scrollbar scrollbox scrollcorner separator template textnode titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip treeseparator triple wizard wizardpage cases to revisit: ...
XUL accessibility tool - Archive of obsolete content
add the tool into the addons.mozilla.org review process go through the most useful/popular extensions with tool and fix a11y issues add checker to tinderbox so that bugs are caught at checkin time some or all of this work could be done through grants, and a likely person to oversee the grant deliverables and milestones would be mark finkle.
XUL Coding Style Guidelines - Archive of obsolete content
to prevent them from being localized, you may insert a line of comment following the xml declaration as follows.
XUL Event Propagation - Archive of obsolete content
introduction xul events were introduced in a very general way in a previous xulnote.
browser - Archive of obsolete content
this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document.
caption - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
checkbox - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
description - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
dialogheader - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
iframe - Archive of obsolete content
this boundary has a number of special effects, such as making window.top == window (unless the browser is added to a chrome document), and preventing documents from inheriting the principal of the parent document.
label - Archive of obsolete content
ArchiveMozillaXULlabel
if the box direction is reversed, the cropping is reversed.
listbox - Archive of obsolete content
invertselection() return type: no return value reverses the selected state of all items.
listcell - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
listitem - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
if the box direction is reversed, the cropping is reversed.
menuitem - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
menulist - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
menuseparator - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
notificationbox - Archive of obsolete content
the notifications may be placed at the bottom by setting the dir attribute to reverse.
prefwindow - Archive of obsolete content
returning false doesn't currently prevent the dialog from closing, but does prevent saving (bug 474527).
radio - Archive of obsolete content
ArchiveMozillaXULradio
if the box direction is reversed, the cropping is reversed.
radiogroup - Archive of obsolete content
if it is false, the previous radio button is selected.
richlistbox - Archive of obsolete content
invertselection() return type: no return value reverses the selected state of all items.
separator - Archive of obsolete content
note that the values are the reverse of what seems more likely.
stack - Archive of obsolete content
ArchiveMozillaXULstack
the first element is placed on the bottom and each successive child is placed above the previous.
<statusbarpanel> - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
tab - Archive of obsolete content
ArchiveMozillaXULtab
if the box direction is reversed, the cropping is reversed.
tabbox - Archive of obsolete content
if the shift key is also held down, the previous tab will be displayed.
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
if the argument dir is set to -1, the currently selected tab changes to the previous tab.
treecol - Archive of obsolete content
if the box direction is reversed, the cropping is reversed.
where - Archive of obsolete content
ArchiveMozillaXULwhere
negate type: boolean set to true to indicate that the comparison should be reversed.
window - Archive of obsolete content
this is used to prevent the find bar from being displayed when it's not supported by the content (such as in the add-ons manager tab).
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
building your application if you decided that you needed a custom-built xulrunner and read the previous section then you're way ahead of the game.
Debugging a XULRunner Application - Archive of obsolete content
precompiled binaries are available in the zipped archive https://github.com/matthewkastor/redirector/archive/master.zip under redirector-master\gecko\console redirector\bin\release copy all the dll's and the exe to wherever you want.
XULRunner FAQ - Archive of obsolete content
this is a developer preview release: additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases.
MacFAQ - Archive of obsolete content
(note this document has not been reviewed for accuracy or completeness.) special build notes enable libxul.
XULRunner/Old Releases - Archive of obsolete content
xulrunner 1.8.0.4 this is the last official stable developer preview release from the 1.8.0 branch.
mozilla.dev.platform FAQ - Archive of obsolete content
please make sure you're using 1.8.0.4 or later (not 1.8.0.1, which had a bug that prevented this from working properly).
nsIContentPolicy - Archive of obsolete content
char* previous = nsnull; nscomptr<nsicategorymanager> catman; servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); rv = catman->addcategoryentry("content-policy", component_classname, component_contractid, pr_true, pr_true, &previous); javascript developers can also implement an xpcom component that extends nsicontentpolicy.
reftest opportunities files - Archive of obsolete content
if you create a reftest for any of these bugs please attach the reftest to the bug and ask for review from the assignee (or anyone else that seems appropriate judging from comments in the bug).
2006-11-10 - Archive of obsolete content
access keys in firefox 2 previous versions of firefox used the <alt> key as a modifier.
2006-10-20 - Archive of obsolete content
ie7 rss reader better - say reviewers a discussion revolving around the quality of rss readers in ie7, firefox and other assorted browsers.
Extentsions FAQ - Archive of obsolete content
could someone make an extension for thunderbird that preview upcomeing events and number of new messages?
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.l10n - october 27, 2006 announcements drafts of eulas for several lanugages available for review drafts of eulas for several lanugages available for review final ff release already announced a french site has already announced final ff 2.0 and gives download links on its own site.
2006-11-3 - Archive of obsolete content
revisiting mozillatranslator bugs in bugzilla revisiting mozillatranslator bugs in bugzilla dictionary packages there are some dictionaries at http://dictionaries.mozdev.org/installation.html which are not at https://addons.mozilla.org/en/dictionaries.
2006-10-20 - Archive of obsolete content
nickolay ponomarev, benjamin smedberg, axel hecht clarify some misconceptions about front-end and back-end programming with xulrunner, including the difficulty of writing the backends in c++ (since that would require a recompilation on every platform frank wanted to support).
2006-11-17 - Archive of obsolete content
nickolay ponomarev lets us know that processing instructions are now added to xul document's dom this also means, you can no longer use document.firstchild in xul scripts to get the root element of a xul document and the xml-stylesheet and xul-overlay processing instructions outside the prolog no longer have any effect peter.sei...@gmail.com runs into some difficulties deploying xulrunner 1.8 on os x?
2006-10-13 - Archive of obsolete content
discussions extended privileges prompt mitchi asked if it was possible to revoke the checkbox auto approving some scripts.
2006-11-10 - Archive of obsolete content
good ideas a splinter off of the extended validation certificates discussion going over whether or not fraudulent websites may get these certificates and if so how to prevent this from happening.
2006-11-24 - Archive of obsolete content
a user writes that the licensing incompatibilities between gpl and mpl would prevent java code to be added in mozilla.
2006-10-27 - Archive of obsolete content
the presshells are currently used for printing, but should or could have been used for print previews and multiple views in editors.
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.tech.xul - nov 11-nov 17, 2006 return to mozilla-dev-tech-xul announcements processing instructions are now added to xul document's dom on november 12, 2006, nickolay ponomarev announces the results of the recently fixed bug 319654.
NPAPI plugin developer guide - Archive of obsolete content
mozilla encourages website developers to avoid using plugins wherever possible.
Monitoring plugins - Archive of obsolete content
opic == "experimental-notify-plugin-call") //in case your class is registered to listen to other topics //this gets executed each time a runtime notification arrives // --your code goes here-- } }, //takes care of registering the observer services for the "experimental-notify-plugin-call" topic register: function() { if (this.registered == false) { //this check prevents double registration -- something you want to avoid!!
NPEmbedPrint - Archive of obsolete content
description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in.
NPFullPrint - Archive of obsolete content
mac os: thprint ms windows: printer's device context description the npp_print function passes the plug-in a pointer to an npprint object (previously allocated by the browser).
NPN_MemFree - Archive of obsolete content
syntax #include <npapi.h> void npn_memfree (void* ptr); parameters the function has the following parameters: ptr block of memory previously allocated using npn_memalloc.
NPN_PostURL - Archive of obsolete content
description npn_posturl works similarly to npn_geturl, but in reverse.
NPP_SetWindow - Archive of obsolete content
before setting the window parameter to point to a new window, it is a good idea to compare the information about the new window to the previous window (if one existed) to account for any changes.
NPP_StreamAsFile - Archive of obsolete content
npp_streamasfile is called for streams whose mode is set to np_asfileonly or np_asfile only in a previous call to npp_newstream.
NPP_Write - Archive of obsolete content
description the browser calls the npp_write function to deliver the data specified in a previous npp_writeready call to the plug-in.
NPPrint - Archive of obsolete content
description the npp_print function passes a pointer to an npprint object (previously allocated by the browser) to the plug-in.
NPSavedData - Archive of obsolete content
if the user revisits a web page that contains a plug-in, the browser returns the npsaveddata to the new instance of the plug-in in a call to npp_new().
NPWindow - Archive of obsolete content
clipping to the cliprect prevents the plug-in from overwriting the status bar, scroll bars, and other page elements when partially scrolled off the screen.
NP_Port - Archive of obsolete content
restore the previous port settings after drawing.
Adobe Flash - Archive of obsolete content
the description string is broken into an array of constituent strings based on an invocation of the match method with a regular expression that assumes that the string format will be in the format flash major rminor where major can be a major revision such as "5" or "6" and minor is the subsidiary version number.
Plugins - Archive of obsolete content
mozilla encourages website developers to avoid using plugins wherever possible and use standard web apis instead.
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
n below: <?xml version="1.0"> <rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <title>example</title> <description>an rss example with slash</description> <lastbuilddate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate> <link>http://www.example.com</link> <item> <title>review of sin city</title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubdate>sun, 15 may 2005 13:02:08 -0500</lastbuilddate></pubdate> <link>http://www.example.com/blog/2005/05/15/114</link> <slash:comments>43</slash:comments> </item> <item> <title>what is the 3571st prime number<...
Entity list - Archive of obsolete content
there is netscape's rss 0.91 (revision 1) (n 0.91 r1), netscape's rss 0.91 revision 3 (n 0.91 r3) and userland's rss 0.91 (u 0.91).
Getting Started - Archive of obsolete content
how to use this tutorial although each page in this tutorial has been written so that it can act as a "standalone" tutorial, it does assume you already possess the knowledge of the information taught in previous pages of this tutorial.
Proposal - Archive of obsolete content
draft exists source guid when an rss item is posted in response to a previous item (called the source item) rss 2.0 offers the source element which allows the item to refer to the rss feed which contains the source item.
0.90 - Archive of obsolete content
ArchiveRSSVersion0.90
rss 0.90 rss 0.90 is the earliest known version of rss released to the public, and was replaced by netscape's rss 0.91 (revision 1).
0.91 - Archive of obsolete content
ArchiveRSSVersion0.91
rss 0.91 there are 3 different version of rss 0.91: netscape's rss 0.91 (revision 1) netscape's rss 0.91 revision 3 userland's rss 0.91 ...
title - Archive of obsolete content
netscape rss 0.91 revision 3 example <?xml version="1.0"?> <!doctype rss system "http://my.netscape.com/publish/formats/rss-0.91.dtd"> <rss version="0.91"> <channel> <title>advogato</title> <link>http://www.advogato.org/article/</link> <description>recent advogato articles</description> <language>en-us</language> <image> <link>http://www.advogato.org/</link> <title>advogato</title> ...
Confidentiality, Integrity, and Availability - Archive of obsolete content
once the secret has been revealed, there's no way to un-reveal it.
Security Controls - Archive of obsolete content
the motivation for having multiple layers is that if one layer fails or otherwise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system.
Threats - Archive of obsolete content
link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation original document information author(s): joint task force transformation initiative title: national institute of standards and technology (nist) special publication 800-30 revision 1, guide for conducting risk assessments last updated date: september 2012 copyright information: this document is not subject to copyright.
Tamarin Tracing Build Documentation - Archive of obsolete content
revision: specify the revision number that will be built.
contents.rdf - Archive of obsolete content
ns being supplied by this theme --> <rdf:seq about="urn:mozilla:skin:root"> <rdf:li resource="urn:mozilla:skin:my_theme"/> </rdf:seq> <rdf:description about="urn:mozilla:skin:my_theme" chrome:displayname="my theme" chrome:accesskey="n" chrome:author="" chrome:authorurl="" chrome:description="" chrome:name="my_theme" chrome:image="preview.png"> <chrome:packages> <rdf:seq about="urn:mozilla:skin:my_theme:packages"> <rdf:li resource="urn:mozilla:skin:my_theme:browser"/> <rdf:li resource="urn:mozilla:skin:my_theme:communicator"/> <rdf:li resource="urn:mozilla:skin:my_theme:global"/> <rdf:li resource="urn:mozilla:skin:my_theme:mozapps"/> <rdf:li resource="urn:mozilla:skin:my_theme:he...
Theme changes in Firefox 2 - Archive of obsolete content
global/browser.css revised to support new styles for the main browser window.
Using SSH to connect to CVS - Archive of obsolete content
if you wish to keep your previous pserver trees, you'll need to update the root files in each cvs subdirectory in your tree.
-ms-filter - Archive of obsolete content
<div id="filterfrom" style="position: absolute; width: 200px; height: 250px; background-color: white; filter: revealtrans()"> <img id="imagefrom" style="position: absolute; top: 20px; left: 20px;" src="sphere.jpg" alt="sphere"> <div id="filterto" style="position: absolute; width: 200px; height: 250px; top: 20px; left: 20px; background: white...
azimuth - Archive of obsolete content
ArchiveWebCSSazimuth
examples h1 { azimuth: 30deg; } td.a { azimuth: far-right; } /* 60deg */ #12 { azimuth: behind far-right; } /* 120deg */ p.comment { azimuth: behind; } /* 180deg */ specifications specification status comment css level 2 (revision 1)the definition of 'azimuth' in that specification.
Processing XML with E4X - Archive of obsolete content
compatibility issues prior to widespread browser support for the <script> element, it was common for javascript embedded in a page to be surrounded by html comment tags to prevent <script> unaware browsers from displaying javascript code to the user.
Array.unobserve() - Archive of obsolete content
the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
implemented; in other browsers) regexp unicode property escapes (not yet implemented; in other browsers) regexp named capture groups (not yet implemented; in other browsers) ecmascript 2019 array.flat() (firefox 62) array.flatmap() (firefox 62) object.fromentries() (firefox 63) string.trimstart() and string.trimend() (firefox 61) optional catch binding (firefox 58) function.tostring() revision (firefox 54) symbol.description (firefox 63) well-formed json.stringify() (firefox 64) ecmascript 2020 this is the current es.next version.
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
indicates that the callback stack associated with a previously specified asynchronous operation has completed.
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
asyncoperationid must correspond to the operation id previously returned from debug.mstraceasyncoperationstarting.
VBArray.toArray - Archive of obsolete content
each successive dimension is appended to the end of the previous one.
New in JavaScript 1.8 - Archive of obsolete content
previously it was possible to destructure the keys/values of an array by using for ( var [key, value] in array ).
ECMAScript 2015 support in Mozilla - Archive of obsolete content
etprototypeof() (firefox 31) object.assign() (firefox 34) object.getownpropertysymbols() (firefox 33) additions to the date object date.prototype is an ordinary object (firefox 41) generic date.prototype.tostring (firefox 41) date.prototype[@@toprimitive] (firefox 44) new promise object promise (firefox 24, enabled by default in firefox 29) new proxy object proxy (firefox 18) preventextensions() trap (firefox 22) isextensible() trap (firefox 31) getprototypeof() and setprototypeof() traps (firefox 49) new reflect object reflect (firefox 42) additions to the regexp object regexp sticky (y) flag (firefox 38) regexp unicode (u) flag (firefox 46) generic regexp.prototype.tostring (firefox 39) regexp.prototype[@@match]() (firefox 49) regexp.prototype[@@replace](...
ECMAScript 5 support in Mozilla - Archive of obsolete content
improvements laid out by ecmascript 5 have been made in the parsing algorithm that prevents evaluating xhtml as javascript code in certain circumstances.
Number.toInteger() - Archive of obsolete content
number.tointeger() was part of the draft ecmascript 6 specification, but has been removed on august 23, 2013 in draft rev 17.
Object.prototype.__noSuchMethod__ - Archive of obsolete content
if this method cannot be called, either as if undefined by default, if deleted, or if manually set to a non-function, the javascript engine will revert to throwing typeerrors.
Object.unobserve() - Archive of obsolete content
the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer.
Object.prototype.watch() - Archive of obsolete content
note: calling watch() on an object for a specific property overrides any previous handler attached for that property.
JavaClass - Archive of obsolete content
x = java.awt.font; myfont = x("helv", x.bold, 10); // creates a font object the previous example omits the packages keyword and uses the java synonym because the font class is in the java package.
Packages - Archive of obsolete content
examples example: javascript function to create a java dialog box the following javascript function creates a java dialog box: function createwindow() { var theowner = new packages.java.awt.frame(); var thewindow = new packages.java.awt.dialog(theowner); thewindow.setsize(350, 200); thewindow.settitle("hello, world"); thewindow.setvisible(true); } in the previous example, the function instantiates thewindow as a new packages object.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
however, taking advantage of frameworks such as aptana jaxer (spidermonkey) and helma (rhino) can reveal even greater rewards as a great deal of work has already been done for you.
Standards-Compliant Authoring Tools - Archive of obsolete content
html-kit is a full-featured, low priced editor designed to help html, xhtml and xml authors to edit, format, lookup help, validate, preview and publish web pages.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
conclusion redesigning a classic is something like being asked to revisemoby dick for modern audiences: you're thrilled at the opportunity, but afraid of doing injustice to the original.
XForms Custom Controls - Archive of obsolete content
if aforceupdate is true then the * xforms model will rebuild/recalculate/revalidate/refresh.
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
if previously you was forced to use ajax for this then now xforms makes this for you automatically.
Displaying a graphic with audio samples - Archive of obsolete content
<!doctype html> <html> <head> <title>javascript spectrum example</title> </head> <body> <audio id="audio-element" src="revolve.ogg" controls="true" style="width: 512px;"> </audio> <div><canvas id="fft" width="512" height="200"></canvas></div> <img id="mozlogo" style="display:none" src="mozilla2.png"></img> <script> var canvas = document.getelementbyid('fft'), ctx = canvas.getcontext('2d'), channels, rate, framebufferlength, fft; function loadedmetadata() { chan...
The Business Benefits of Web Standards - Archive of obsolete content
because standards are very well documented, another person taking over some standard-compliant code can hit the ground running - and will not need to become familiar with the previous developer's coding practices.
2D collision detection - Game development
this article provides a review of the most common techniques used to provide collision detection in 2d games.
Building up a basic demo with PlayCanvas editor - Game development
add the following line inside this function, to rotate the cube on every frame: this.entity.rotate(dt*10, dt*20, dt*30); in the line above this.entity refers to the object to which the script will be attached (the box); using the dt variable, which contains the delta time passed since the previous frame, we can rotate the box by a different amount around all three axes.
Async scripts for asm.js - Game development
instead of using eval or innerhtml, both of which trigger synchronous compilation, you should use a blob with an object url: var blob = new blob([codestring]); var script = document.createelement('script'); var url = url.createobjecturl(blob); script.onload = script.onerror = function() { url.revokeobjecturl(url); }; script.src = url; document.body.appendchild(script); the setting of src rather than innerhtml is what makes this script async.
Square tilemaps implementation: Scrolling maps - Game development
note: when writing this article, we assumed previous reader knowledge of canvas basics such as how get a 2d canvas context, load images, etc., which is all explained in the canvas api tutorial, as well as the basic information included in our tilemaps introduction article.
Square tilemaps implementation: Static maps - Game development
note: when writing this article, we assumed previous reader knowledge of canvas basics such as how get a 2d canvas context, load images, etc., which is all explained in the canvas api tutorial, as well as the basic information included in our tilemaps introduction article.
2D maze game with device orientation - Game development
to load specific levels, we make sure the previous levels are hidden, and show the current one: showlevel: function(level) { var lvl = level | this.level; if(this.levels[lvl-2]) { this.levels[lvl-2].visible = false; } this.levels[lvl-1].visible = true; } thanks to that the game gives the player a challenge - now he have to roll the ball across the play area and guide it through the labyrinth built from the blocks.
Tutorials - Game development
2d breakout game using phaser in this step-by-step tutorial you'll implement the same breakout clone as the previous tutorial series, except that this time you'll do it using thephaser html5 game framework.
Gecko FAQ - Gecko Redirect 1
gecko has been known previously by the code names "raptor" and "nglayout"; the new name was chosen following a trademark infringement dispute.
ARPA - MDN Web Docs Glossary: Definitions of Web-related terms
.arpa (address and routing parameter area) is a top-level domain used for internet infrastructure purposes, especially reverse dns lookup (i.e., find the domain name for a given ip address).
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
the term asynchronous refers to two or more objects or events not existing or happening at the same time (or multiple related things happening without waiting for the previous one to complete).
Code splitting - MDN Web Docs Glossary: Definitions of Web-related terms
to prevent the requirement of downloading ginormous files, scripts can be split into multiple smaller files.
DNS - MDN Web Docs Glossary: Definitions of Web-related terms
by contrast, a reverse dns lookup (rdns) is used to determine the domain name associated with an ip address.
DoS attack - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of service) is a network attack that prevents legitimate use of server resources by flooding the server with requests.
Decryption - MDN Web Docs Glossary: Definitions of Web-related terms
decryption is the reverse of encryption and if the key stays secret, decryption without knowing the specific secret, decryption is mathematically hard to perform.
Delta - MDN Web Docs Glossary: Definitions of Web-related terms
likewise, given the new value of x and its old value, you might compute the delta like this: let deltax = newx - oldx; more commonly, you receive the delta and use it to update a saved previous condition: let newx = oldx + deltax; learn more technical reference mouse wheel events (wheelevent offer the amount the wheel moved since the last event in its deltax, deltay, and deltaz properties, for example.
Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of service) is a network attack that prevents legitimate use of server resources by flooding the server with requests.
Digest - MDN Web Docs Glossary: Definitions of Web-related terms
ideally, a digest is quick to calculate, irreversible, and unpredictable, and therefore indicates whether someone has tampered with a given message.
Doctype - MDN Web Docs Glossary: Definitions of Web-related terms
its sole purpose is to prevent a browser from switching into so-called “quirks mode” when rendering a document; that is, the "<!doctype html>" doctype ensures that the browser makes a best-effort attempt at following the relevant specifications, rather than using a different rendering mode that is incompatible with some specifications.
Encryption - MDN Web Docs Glossary: Definitions of Web-related terms
without knowing the secret, the reverse operation, decryption, is mathematically hard to perform.
Garbage collection - MDN Web Docs Glossary: Definitions of Web-related terms
often abbreviated "gc," garbage collection is a fundamental component of the memory management system used by javascript.
Git - MDN Web Docs Glossary: Definitions of Web-related terms
what sets it apart from previous scm systems is the ability to do common operations (branching, committing, etc.) on your local development machine, without having to change the master repository or even having write access to it.
HTTP - MDN Web Docs Glossary: Definitions of Web-related terms
http is textual (all communication is done in plain text) and stateless (no communication is aware of previous communications).
HTTP/2 - MDN Web Docs Glossary: Definitions of Web-related terms
http/2 is a major revision of the http network protocol.
HTTP/3 - MDN Web Docs Glossary: Definitions of Web-related terms
http/3 is the upcoming major revision of the http network protocol, succeeding http/2.
IIFE - MDN Web Docs Glossary: Definitions of Web-related terms
this prevents accessing variables within the iife idiom as well as polluting the global scope.
IMAP - MDN Web Docs Glossary: Definitions of Web-related terms
imap4 revision 1 is the current version, defined by rfc 3501.
NaN - MDN Web Docs Glossary: Definitions of Web-related terms
fortunately, since the result will be nan and i know my divisor may turn out to be 0, i can set up testing conditions that prevent any such computations in the first place or notify me of where they happen.
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
although this reason for polyfilling is very rare today, it was especially prevalent back in the days of ie6, netscape, and nnav where each browser implemented javascript very differently.
Proxy server - MDN Web Docs Glossary: Definitions of Web-related terms
a reverse proxy taking requests from the internet and forwarding them to servers in an internal network.
Random Number Generator - MDN Web Docs Glossary: Definitions of Web-related terms
these include: that it's computationally unfeasible for an attacker (without knowledge of the seed) to predict its output that if an attacker can work out its current state, this should not enable the attacker to work out previously emitted numbers.
Repo - MDN Web Docs Glossary: Definitions of Web-related terms
in a revision control system like git or svn, a repo (i.e.
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
"c561c68d0ba92bbeb8b0f612a9199f722e3a621a" keep-alive: timeout=5, max=997 last-modified: mon, 18 jul 2016 02:36:04 gmt server: apache set-cookie: mykey=myvalue; expires=mon, 17-jul-2017 16:06:00 gmt; max-age=31449600; path=/; secure transfer-encoding: chunked vary: cookie, accept-encoding x-backend-server: developer2.webapp.scl3.mozilla.com x-cache-info: not cacheable; meta data too large x-kuma-revision: 1085259 x-frame-options: deny ...
Robots.txt - MDN Web Docs Glossary: Definitions of Web-related terms
for example, the site admin can forbid crawlers to visit a certain folder (and all the files therein contained) or to crawl a specific file, usually to prevent those files being indexed by other search engines.
SCM - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge revision control on wikipedia ...
SEO - MDN Web Docs Glossary: Definitions of Web-related terms
if you follow those rules closely when doing seo for a website, you give the site the best chances of showing up among the first results, increasing traffic and possibly revenue (for ecommerce and ads).
Style origin - MDN Web Docs Glossary: Definitions of Web-related terms
the style origins are used to determine where to stop rolling back (or backtracking through) the cascade of styles that have been applied to an element when removing styles, such as when using the unset or revert keywords.
Symmetric-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
this is usually contrasted with public-key cryptography, in which keys are generated in pairs and the transformation made by one key can only be reversed using the other key.
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
it prevents the appearance of network congestion whose capabilities are initially unknown, and slowly increases the volume of information diffused until the network's maximum capacity is found.
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
transport layer security (tls), formerly known as secure sockets layer (ssl), is a protocol used by applications to communicate securely across a network, preventing tampering with and eavesdropping on email, web browsing, messaging, and other protocols.
Type - MDN Web Docs Glossary: Definitions of Web-related terms
comparison between structured types is not always an easy assumption, as even if the previous data structure is the same, there could be inherited structures inside of the prototype chain.
Vendor Prefix - MDN Web Docs Glossary: Definitions of Web-related terms
browser vendors sometimes add prefixes to experimental or nonstandard css properties and javascript apis, so developers can experiment with new ideas while—in theory—preventing their experiments from being relied upon and then breaking web developers' code during the standardization process.
Challenge-response authentication - MDN Web Docs Glossary: Definitions of Web-related terms
challenge-response protocols are one way to fight against replay attacks where an attacker listens to the previous messages and resends them at a later time to get the same credentials as the original message.
Test your skills: WAI-ARIA - Learn web development
wai-aria 3 for this final wai-aria task, we return to an example we previously saw in the css and javascript skilltest.
What is accessibility? - Learn web development
centers for disease control and prevention disability and functioning (noninstitutionalized adults 18 years and over) reports the usa "percent of adults with any physical functioning difficulty: 16.1%".
Accessibility - Learn web development
wai-aria basics following on from the previous article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult.
Introduction to CSS layout - Learn web development
overview: css layout next this article will recap some of the css layout features we've already touched upon in previous modules — such as different display values — and introduce some of the concepts we'll be covering throughout this module.
CSS layout - Learn web development
introduction to css layout this article will recap some of the css layout features we've already touched upon in previous modules — such as different display values — and introduce some of the concepts we'll be covering throughout this module.
create fancy boxes - Learn web development
i want to be fancy.</div> let's have an example by turning our box into a cloud: .fancy { text-align: center; /* same trick as previsouly used to make circles */ box-sizing: border-box; width : 150px; height : 150px; padding : 80px 1em 0 1em; /* we make room for the "ears" of our cloud */ margin : 0 100px; position: relative; background-color: #a4c9cf; /* well, actually we are not making a full circle as we want the bottom of our cloud to be flat.
How do you make sure your website works properly? - Learn web development
this will not prevent the page from loading but you will feel something went wrong.
How can we design for all types of users? - Learn web development
relative units are expressed in em, % and rem: percent-based sizes: % this unit tells your browser that an element's font size must be n% of the previous element whose font size was expressed.
What is the difference between webpage, website, web server, and search engine? - Learn web development
in our previous example, if we said, "my web server is not responding", it means that multiple websites on that web server are not available.
How do I start to design my website? - Learn web development
in short, since these goals all revolve around the same topic, having everything in one place will help us meet our goals and help our followers connect with us.
HTML forms in legacy browsers - Learn web development
*/ border: revert; } see the global css revert value for more information.
Test your skills: Form validation - Learn web development
form validation 2 now we want you to take the same form you saw in the previous task (use your previous answer if you want to), and add some more specific pattern validation to the first three fields using regular expressions.
Front-end web developer - Learn web development
prerequisites you don't need any previous knowledge to start this course.
How the Web works - Learn web development
previous overview: getting started with the web how the web works provides a simplified view of what happens when you view a webpage in a web browser on your computer or phone.
Installing basic software - Learn web development
we recommend starting with visual studio code, which is a free editor, that offers live previews and code hints.
Tips for authoring fast-loading HTML pages - Learn web development
this not only speeds the display of the page but prevents annoying changes in a page's layout when the page completes loading.
Use JavaScript within a webpage - Learn web development
people may have javascript turned off to improve speed and security, and users often face network issues that prevent loading scripts.
Use HTML to solve common problems - Learn web development
LearnHTMLHowto
how to create a list of items with html how to stress or emphasize content how to indicate that text is important how to display computer code with html how to annotate images and graphics how to mark abbreviations and make them understandable how to add quotations and citations to web pages how to define terms with html hyperlinks one of the main reasons for html is making navigation easy with hyperlinks, which can be used in many different ways: how to create a hyperlink how to create a table of contents with html images & multimedia how to add images to a webpage how to add video ...
Introduction to HTML - Learn web development
get started prerequisites before starting this module, you don't need any previous html knowledge, but you should have at least basic familiarity with using computers and using the web passively (i.e., just looking at it and consuming content).
Multimedia and Embedding - Learn web development
get started prerequisites before starting this module, you should have a reasonable understanding of the basics of html, as previously covered in introduction to html.
Asynchronous JavaScript - Learn web development
handling async operations gracefully with promises promises are a comparatively new feature of the javascript language that allow you to defer further actions until after the previous action has completed, or respond to its failure.
Functions — reusable blocks of code - Learn web development
previous overview: building blocks next another essential concept in coding is functions, which allow you to store a piece of code that does a single task inside a defined block, and then call that code whenever you need it using a single short command — rather than having to type out the same code multiple times.
Client-side web APIs - Learn web development
get started prerequisites to get the most out of this module, you should have worked your way through the previous javascript modules in the series (first steps, building blocks, and javascript objects).
What is JavaScript? - Learn web development
this demo has exactly the same functionality as in the previous two sections, except that the <button> element includes an inline onclick handler to make the function run when the button is pressed.
Solve common problems in your JavaScript code - Learn web development
how do you prevent default event behaviour?
JavaScript object basics - Learn web development
overview: objects next in this article, we'll look at fundamental javascript object syntax, and revisit some javascript features that we've already seen earlier in the course, reiterating the fact that many of the features you've already dealt with are objects.
JavaScript — Dynamic client-side scripting - Learn web development
start by working through the following modules: getting started with the web introduction to html introduction to css having previous experience with other programming languages might also help.
Aprender y obtener ayuda - Learn web development
when you find solutions to such problems, it is worth writing down notes on what you did, and keeping some minimal code examples in a directory somewhere so you can look back on previous work.
Web performance resources - Learn web development
below is a quick review of best practices, tools, apis with links to provide more information about each topic.
The "why" of web performance - Learn web development
site speed directly affects bounce rates, conversion, revenue, user satisfaction, and search engine ranking.
Client-side tooling overview - Learn web development
safety net tooling should also help you either prevent mistakes or correct mistakes automatically without having to build your code from scratch each time.
Understanding client-side web development tools - Learn web development
deploying our app in the final article in our series, we take the example toolchain we built up in the previous article and add to it so that we can deploy our sample app.
Tools and testing - Learn web development
git and github all developers will use some kind of version control system (vcs), a tool to allow them to collaborate with other developers on a project without danger of them overwriting each other's work, and roll back to previous versions of the code base if a problem is discovered later on.
Learn web development
the aim of this area of mdn is not to take you from "beginner" to "expert" but to take you from "beginner" to "comfortable." from there, you should be able to start making your way, learning from the rest of mdn, and other intermediate to advanced resources that assume a lot of previous knowledge.
omni.ja (formerly omni.jar)
this change was needed to prevent firefox from becoming corrupted.
Accessibility Features in Firefox
in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users.
CSUN Firefox Materials
in recent articles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users.
Multiprocess on Windows
as mentioned previously, the interceptor will automatically wrap outparams.
Software accessibility: Where are we today?
this article reviews the progress and technology as it has developed.
Mozilla’s UAAG evaluation report
(p2) vg provides forward and reverse text search capability from the element with the current focus/selection, with and without case sensitivity very slow on larger documents.
Theme concepts
additionally, firefox color can be used to preview customizations to the browser's theme with options to share and export a theme.
Adding a new event
if all information of the event is stored by its internal event, c++ event handlers can access them with following code: ns_imethodimp aneventlistener::handleevent(nsidomevent* aevent) { internalfooevent* internalevent = aevent->getinternalnsevent()->asfooevent(); if (ns_warn_if(!internalevent)) { return ns_error_unexpected; } dosomethingwith(internalevent->mbar); aevent->preventdefault(); return ns_ok; } implement dom event class generate dom event implementation if it's possible if you're creating simple dom event class, it might be generated automatically.
Adding a new CSS property
then you should get review on the work you've done so far and move on to implementing whatever the property does (which should be in a separate patch or patches).
Adding a new word to the en-US dictionary
move the revised dictionary file into position: mv en-us.dic ..
Application cache implementation overview
falling back on a resource load failure when a resource previously matching a fallback namespace failed to load from the network, we perform fallback to the previously remembered fallback entry.
Browser chrome tests
in a timeout, event handler, etc) will not be caught, but will result in a timed out test if they prevent finish() from being called.
Testopia
if you are upgrading, please reverse the existing version's patch before installing.
Chrome registration
note: there are no security restrictions preventing web content from including content at resource: uris, so take care what you make visible there.
Creating JavaScript callbacks in components
such: void addeventlistener(in domstring type, in nsidomeventlistener listener, in boolean usecapture); however, it is extremely common to see developers pass a normal javascript function for the listener instead of an nsidomeventlistener implementation: function doload(event) { // do something here } window.addeventlistener("load", doload, false); revealing the magic how is this possible?
Creating reftest-based unit tests
or, alternatively, the conditions can be reversed (a != test rather than an == test).
Creating Sandboxed HTTP Connections
since the channel that causes the notification is passed in as the first argument, comparing it to the globally stored channel (gchannel) in the previous section (which also gets updated each time a redirect happens).
Debugging on Mac OS X
add "-p profilename", where profilename is the name of a profile you created previously.
HTTP logging
when you specify rotate, on every start all the files (including any previous non-rotated log file) are deleted to avoid any mixture of information.
Configuring Build Options
this can be useful since certain warnings coincide with reviewbot lints which must be fixed before merging.
Simple Instantbird build
first, cd into the comm-central subdirectory (created automatically by the previous command): cd comm-central then run: python client.py checkout note: unless you have a very good network connection, "hg clone" might fail because it gets interrupted.
Simple Thunderbird build
you can clean out previous build artefacts using ./mach clobber references general build documentation comm-central using the mozilla symbol server ...
Updating NSPR or NSS in mozilla-central
check for new or removed files $ hg addremove -n review the output to make sure it looks correct update the minimum required system nss version in old-configure.in.
Windows SDK versions
windows 7 sdk features that depend on this sdk include: windows 7 taskbar previews windows 7 download taskbar progress windows 7 jump lists you can download the sdk (v7.0 [web setup or iso image] or unsupported v7.1 [web setup or iso image]) from the microsoft download center.
Creating Custom Events That Can Pass Data
your event in order for your event to work you must do the following: create a scriptable interface called nsidom{youreventname} inheriting from nsidomevent.
Eclipse CDT
gdb unexpectedly detaching if gdb starts ignoring your breakpoints, or unexpectedly terminates or detaches from the firefox process, this may be caused by out of date breakpoints (breakpoints that you set during a previous debug session, after which you've since rebuilt).
Inner and outer windows
as the user navigates in each of the documents in the various frames, each of those inner windows has its own history that can be moved forward and backward through, just like in the previous diagram.
Obsolete Build Caveats and Tips
from firefox 10, the compilator is visual studio 2010; if you want to use it, you must use a previous version of it !), or 2005 professional from build_instructions those who need to work with the code for firefox 3/mozilla 1.9 and earlier can check out the latest source using cvs.
Listening to events on all tabs
removing a listener to remove a previously installed progress listener, call removetabsprogresslistener(): gbrowser.removetabsprogresslistener(myprogresslistener); implementing a listener the listener object itself has five methods it can implement to handle various events: onlocationchange called when the uri of the document displayed in the tab changes.
Working with Mozilla source code
creating a patch once you've made a change to the mozilla code, the next step (after making sure it works) is to create a patch and submit it for review.
mach
please flag firefox-build-system-reviewers for review.
Error codes returned by Mozilla APIs
this error might occur if a previous attempt to write to the file had failed.
Experimental features in Firefox
the intent is to prevent mixed-content conditions in which some content is loaded securely while other content is insecure.
Multiple Firefox profiles
you can view previously viewed web pages, and experiment with your profile.
Cross Process Object Wrappers
it’s possible that the request for the documenturi property will be processed before the "changedocumenturi" message, in which case uri will have its previous value.
Communicating with frame scripts
this is an intentional design decision made to prevent content code from making chrome code unresponsive.
Multiprocess Firefox
this page is an informal index of leftovers, mostly revolving around the message manager and the related cross process object wrappers.
HTMLIFrameElement.clearMatch()
searchtoggle.addeventlistener('touchend',function() { if(search.getattribute('class') === 'search') { search.setattribute('class', 'search shifted'); } else if(search.getattribute('class') === 'search shifted') { search.setattribute('class', 'search'); if(searchactive) { browser.clearmatch(); searchactive = false; prev.disabled = true; next.disabled = true; searchbar.value = ''; } } }); specification not part of any specification.
HTMLIFrameElement.findAll()
searchform.addeventlistener('submit', function(e) { e.preventdefault(); browser.findall(searchbar.value, 'case-sensitive'); searchactive = true; prev.disabled = false; next.disabled = false; searchbar.blur(); }); specification not part of any specification.
HTMLIFrameElement.goBack()
by calling this method, the browser <iframe> changes its location for the previous location available in its navigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart, and so on.
mozbrowsershowmodalprompt
note that if the embedder calls preventdefault() on this event, the iframe is blocked until unblock() is called.
HTMLIFrameElement.reload()
parameters hardreload optional a boolean that indicates whether all the resources to reload must be revalidated (true) or may be taken directly from the browser cache (false).
Hacking with Bonsai
there is a web page, which records if the tree is open or closed what the date stamp of the last known good tree is who is on the hook for the current tree before the tree is opened, the list of checkins that happened when the tree was closed is reviewed to insure that only build related checkins took place.
IPDL Best Practices
this document is intended to help correct these before the formal review process is initiated.
IPDL Tutorial
}; virtual pexamplechild* toplevelchild::allocpexample() { refptr<examplechild*> actor = new examplechild(); return actor.forget(); } virtual bool toplevelchild::deallocpexample(pexamplechild* actor) { ns_release(static_cast<examplechild*>(actor)); return true; } if an object that implements a protocol can't be constructed inside allocpfoo, has been previously constructed and doesn't require an ipdl connection throughout its lifetime, or implements a refcounted protocol where the first form of constructor is not available, there is a second form of sendpfooconstructor which can be used: class examplechild { public: void dosomething() { amanagerchild->sendpexampleconstructor(this, ...); } }; internally, the first constructor for...
IPDL Type Serialization
serializers and deserializers are security-sensitive and must always receive two reviews from module owners who understand ipc serialization well.
Implementing Download Resuming
otherwise, call resumeat with the desired start position, and the previously stored entity id.
JavaScript Tips
prefer to loop through childnodes rather than using first/lastchild with next/previoussibling.
AddonManager
starting in firefox 8, you can also set the value of the preference extensions.autodisabledscopes to prevent firefox from automatically installing add-ons from the specified scopes.
DownloadLastDir.jsm
when the user exits private browsing mode, the last download directory value is reverted to the preference's value.
DownloadList
removeview() removes a view that was previously added using addview().
DownloadSummary
removeview() removes a view that was previously added using addview().
Interfacing with the Add-on Repository
for example: searchsucceeded: function(addons, addoncount, totalresults) { var num = math.floor(math.random() * addoncount); this.shownotification("would you like to try the " + addons[num].name + " addon?", "install", addons[num].install); }, this routine randomly selects one of the returned add-ons, then calls the previously mentioned shownotification() routine, passing in as parameters a prompt including the name of the returned add-on, a label for the button to show in the notification ("install"), and the addoninstall object that can be used with the add-on manager api to install the add-on.
Following the Android Toasts Tutorial from a JNI Perspective
this is special: because a charsequence is an array of byte characters, we can pass simple javascript strings to jni.jsm wherever a charsequence is needed.
NetUtil.jsm
in previous versions of gecko, you must use a string to specify the uri.
Promise
rejected, if an error prevented the final value from being determined.
Promise.jsm
rejected, if an error prevented the final value from being determined.
PromiseUtils.jsm
this method was previously implemented as promise.defer(), which is obsolete since gecko 30.
Sqlite.jsm
note: callers are encouraged to pass objects rather than arrays for bound parameters because they prevent foot guns.
Webapps.jsm
n(aoldapp, anewapp, aislocalfileinstall, aisupdate,) _checksignature: function(aapp, aissigned, aislocalfileinstall) _saveetag: function(aisupdate, aoldapp, arequestchannel, ahash, amanifest) _checkorigin: function(aissigned, aoldapp, amanifest, aisupdate) _getids: function(aissigned, azipreader, aconverter, anewapp, aoldapp,) _checkforstoreidmatch: function(aisupdate, anewapp, astoreid, astoreversion) revertdownloadpackage: function(aid, aoldapp, anewapp, aisupdate, aerror) uninstall: function(amanifesturl) _promptforuninstall: function(adata) confirmuninstall: function(adata) denyuninstall: function(adata, areason = "error_unknown_failure") getself: function(adata, amm) checkinstalled: function(adata, amm) getinstalled: function(adata, amm) getnotinstalled: function(adata, amm...
L10n testing with xcode
navigate to the newly opened ios simulator window many strings are accessibility strings and are only revieled when a user hovers their finger over the button.
Localizing extension metadata on addons.mozilla.org
this data describes the extension, and doesn't necessarily change with each revision (but it can).
Localizing with Pontoon
we call all of these translation helpers and here's how each of them will help you as you translate strings: history displays previously suggested translations, including from other users.
Patching a Localization
hg diff browser/chrome/browser/browser.dtd attach the patch to an existing bug for reference or review or create a new one if one doesn't currently exist.
Localization formats
localizers had to revisit an en-us repository to find the exact msgid, review the change, and return to their repository to make changes.
Web Localizability
by reviewing your content and code for l12y, you will find and fix bugs in your original language too.
gettext
# #, fuzzy msgid "" msgstr "" "project-id-version: package version\n" "report-msgid-bugs-to: \n" "pot-creation-date: 2009-09-28 16:18+0200\n" "po-revision-date: year-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "mime-version: 1.0\n" "content-type: text/plain; charset=charset\n" "content-transfer-encoding: 8bit\n" "plural-forms: nplurals=integer; plural=expression;\n" #.
Basics
rather, the math fragment will zoom, and if you right-click a second time, you will see the mathml wysiwyg markup of the fragment, and if you right-click again a third time, the fragment will revert to its initial state.
Extras
mathml extras this is a technology demonstration of some of the extras in mozilla but not defined in the mathml spec, and not prevented by the spec either.
Fonts for Mozilla 2.0's MathML engine
reset old preferences if users have previously changed the "font.mathfont-family" preference for a previous version of mozilla, then it is best to reset this to the default value.
MathML Demo: <mtable> - tables and matrices
ab ab ab ab ab ab , or perhaps the reverse ---...
Using the viewport meta tag to control layout on mobile browsers
if web developers want their scale settings to remain consistent when switching orientations on the iphone, they must add a maximum-scale value to prevent this zooming, which has the sometimes-unwanted side effect of preventing users from zooming in: <meta name="viewport" content="initial-scale=1, maximum-scale=1"> suppress the small zoom applied by many smartphones by setting the initial scale and minimum-scale values to 0.86.
Mozilla Port Blocking
by default, mozilla now blocks access to specific ports which are used by vulnerable services in order to prevent security vulnerabilites due to "cross-protocol scripting".
Mozilla Web Services Security Model
please do not depend on anything in it being correct for security.) to prevent the browser from being used as a tool for web sites to obtain priveleges that belong to the browser's user (such as being behind a firewall or getting the benefits of the user's cookies), web browsers restrict what web pages can do when accessing things in other domains.
BloatView
perl tools/bloatview/bloatdiff.pl <previous-log> <current-log> this will give you output of the form: bloat/leak delta report current file: dist/win32_d.obj/bin/bloatlogs/all-1999-10-22-133450.txt previous file: dist/win32_d.obj/bin/bloatlogs/all-1999-10-16-010302.txt -------------------------------------------------------------------------- class leaks delta bloat delta --------------------...
GC and CC logs
as noted in the previous section, with multiprocess firefox, you can't record logs from the content process, due to sandboxing.
Leak-hunting strategies and tips
this is the wrapper object in the reverse direction -- when a js object is used to implement an xpcom interface and be used transparently by native code.
TraceMalloc
tracemallocchangelogfd(logfd) - change the current log file to the one identified by logfd, returning the previous fd (so you can maintain a number of open files; keep their fds in a js array!).
Phishing: a short definition
after all, the browser plays an essential role in the scheme: a fake website is loaded in a browser and here is the maker’s last chance to preventing fraud.
Preference reference
javascript.options.showinconsolethe preference javascript.options.showinconsole controls whether errors or warnings in chrome code are shown in the error console.javascript.options.stricttechnical review completed.mail.tabs.drawintitlebarstarting in thunderbird 17.0, the tabs are drawn in the title bar.
MailNews automated testing
it allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases.
MailNews
it allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases.
McCoy
however, there are several external and unofficial tools which enable signing from command line: uhura - part of the mxtools package from softlights http://www.softlights.net/projects/mxtools/uhura.html signontheline - an extension to mccoy - important: you have to checkout rev 222, later revisions are not working in mccoy!
Optimizing Applications For NSPR
the implementation is well suited for high performance application, such as a server, but clients may find the win-95 version more suited (and adequate) for interactive applications such as are prevalent on today's workstations.
Hash Tables
hash table types and constants hash table functions hash table types and constants plhashentry plhashtable plhashnumber plhashfunction plhashcomparator plhashenumerator plhashallocops hash table functions pl_newhashtable pl_hashtabledestroy pl_hashtableadd pl_hashtableremove pl_hashtablelookup pl_hashtableenumerateentries pl_hashstring pl_comparestrings pl_comparevalues see also xpcom hashtable guide ...
Introduction to NSPR
locking prevents access to some resource, such as a piece of shared data: that is, it enforces mutual exclusion.
Linked Lists
linked list macros macros that create and operate on linked lists are: pr_init_clist pr_init_static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link pr_remove_and_init_link pr_insert_before pr_insert_after pr_clist_is_empty pr_list_head pr_list_tail ...
Long Long (64-bit) Integers
« previousnext » this chapter describes the global functions you use to perform 64-bit integer operations.
PRBool
syntax #include <prtypes.h> typedef enum { pr_false = 0, pr_true = 1 } prbool; description wherever possible, do not use prbool in mozilla c++ code.
PRCList
syntax #include <prclist.h> typedef struct prcliststr prclist; typedef struct prcliststr { prclist *next; prclist *previous; }; description prclist defines a node in a circular linked list.
PRIntervalTime
they indicate that the process should wait no time (return immediately) or wait forever (never time out), respectively.
PR_AtomicSet
atomically sets a 32-bit value and return its previous contents.
PR_AttachSharedMemory
attaches a memory segment previously opened with pr_opensharedmemory and maps it into the process memory space.
PR_CExitMonitor
syntax #include <prcmon.h> prstatus pr_cexitmonitor(void *address); parameters the function has the following parameters: address the address of the protected object--the same address previously passed to pr_centermonitor.
PR_CWait
syntax #include <prcmon.h> prstatus pr_cwait( void *address, printervaltime timeout); parameters the function has the following parameters: address the address of the protected object--the same address previously passed to pr_centermonitor.
PR_CancelJob
causes a previously queued job to be canceled.
PR_ClearInterrupt
therefore it is sometimes necessary to call pr_clearinterrupt to clear a previous interrupt request.
PR_CloseDir
note that after a pr_closedir call, any prdirentry object returned by a previous pr_readdir call on the same prdir object becomes invalid.
PR_DeleteSemaphore
syntax #include <pripcsem.h> nspr_api(prstatus) pr_deletesemaphore(const char *name); parameter the function has the following parameter: name the name of a semaphore that was previously created via a call to pr_opensemaphore.
PR_DestroyPollableEvent
syntax nspr_api(prstatus) pr_destroypollableevent(prfiledesc *event); parameter the function has the following parameter: event pointer to a prfiledesc structure previously created via a call to pr_newpollableevent.
PR_ExportFileMapAsString
returns prstatus description creates an identifier, as a string, from a prfilemap object previously created with pr_openanonfilemap.
PR_GetHostByAddr
description pr_gethostbyaddr is used to perform reverse lookups of network addresses.
PR_GetInheritedFileMap
imports a prfilemap previously exported by my parent process via pr_createprocess.
PR_ImportFileMapFromString
description pr_importfilemapfromstring creates a prfilemap object from a string previously created by pr_exportfilemapasstring.
PR ImportTCPSocket
the caller must not do anything to the native file descriptor before the pr_importtcpsocket call that will prevent the native file descriptor from working in non-blocking mode.
PR_JoinThreadPool
syntax #include <prtpool.h> nspr_api(prstatus) pr_jointhreadpool( prthreadpool *tpool ); parameter the function has the following parameter: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_OpenSharedMemory
description pr_opensharedmemory creates a new shared memory segment or associates a previously created memory segment with the specified name.
PR_PushIOLayer
if the containers are allocated by some method other than pr_createiolayerstub, it may be required that the stack have the layers popped off (in reverse order that they were pushed) before calling pr_close.
PR_QueueJob
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob( prthreadpool *tpool, prjobfn fn, void *arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_QueueJob_Accept
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob_accept( prthreadpool *tpool, prjobiodesc *iod, prjobfn fn, void *arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_QueueJob_Connect
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob_connect( prthreadpool *tpool, prjobiodesc *iod, const prnetaddr *addr, prjobfn fn, void * arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_QueueJob_Read
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob_read( prthreadpool *tpool, prjobiodesc *iod, prjobfn fn, void *arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_QueueJob_Timer
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob_timer( prthreadpool *tpool, printervaltime timeout, prjobfn fn, void * arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_QueueJob_Write
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob_write( prthreadpool *tpool, prjobiodesc *iod, prjobfn fn, void *arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_STATIC_ASSERT
prevents code from compiling when an expression has the value false at compile time.
PR_Seek
a negative value causes seeking in the reverse direction.
PR_Seek64
a negative value causes seeking in the reverse direction.
PR_SetErrorText
if there is error text already present in the thread, the previous value is first deleted.
PR_SetPollableEvent
syntax nspr_api(prstatus) pr_setpollableevent(prfiledesc *event); parameter the function has the following parameter: event pointer to a prfiledesc structure previously created via a call to pr_newpollableevent.
PR_ShutdownThreadPool
syntax #include <prtpool.h> nspr_api(prstatus) pr_shutdownthreadpool( prthreadpool *tpool ); parameter the function has the following parameter: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
PR_UnloadLibrary
syntax #include <prlink.h> prstatus pr_unloadlibrary(prlibrary *lib); parameters the function has this parameter: lib a reference previously returned from pr_loadlibrary.
PR_WaitForPollableEvent
syntax nspr_api(prstatus) pr_waitforpollableevent(prfiledesc *event); parameter the function has the following parameter: event pointer to a prfiledesc structure previously created via a call to pr_newpollableevent.
Threads
pr_clearinterrupt clears a previous interrupt request.
NSPR API Reference
allocation macros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted printing linked lists linked list types prclist linked list macros pr_init_clist pr_init_static_clist pr_append_link pr_insert_link pr_next_link pr_prev_link pr_remove_link pr_remove_and_init_link pr_insert_before pr_insert_after dynamic library linking library linking types prlibrary prstaticlinktable library linking functions pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding sym...
NSS CERTVerify Log
*/ unsigned int depth; /* how far up the chain are we */ void *arg; /* error specific argument */ struct certverifylognodestr *next; /* next in the list */ struct certverifylognodestr *prev; /* next in the list */ }; the list is a doubly linked null terminated list sorted from low to high based on depth into the cert chain.
NSS Certificate Download Specification
this document is currently being revised and has not yet been reviewed for accuracy.
Cryptography functions
mxr 3.4 and later pk11_getnextsymkey mxr 3.4 and later pk11_getpadmechanism mxr 3.4 and later pk11_getpbecryptomechanism mxr 3.12 and later pk11_getpbeiv mxr 3.6 and later pk11_getpqgparamsfromprivatekey mxr 3.4 and later pk11_getprevgenericobject mxr 3.9.2 and later pk11_getprivatekeynickname mxr 3.4 and later pk11_getprivatemoduluslen mxr 3.2 and later pk11_getpublickeynickname mxr 3.4 and later pk11_getslotfromkey mxr 3.2 and later pk11_getslotfromprivatekey mxr 3.2 and late...
Build instructions for JSS 4.3.x
unix setenv java_home /usr/local/jdk1.5.0 (or wherever your jdk is installed) windows set java_home=c:\programs\jdk1.5.0 (or wherever your jdk is installed) windows (cygnus) java_home=/cygdrive/c/programs/jdk1.5.0 (or wherever your jdk is installed) export java_home windows build configurations winnt vs win95 as of nss 3.15.4, nspr/nss/jss build generates a "win95" configuration by default on windows.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
in version previous to jss 3.1, jss removes the default sun provider on startup.
NSS_3.11.10_release_notes.html
new and revised documents available since the release of nss 3.9 include the following: build instructions for nss 3.11.4 and above compatibility nss 3.11.10 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS_3.12.1_release_notes.html
new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.1 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS_3.12.2_release_notes.html
new and revised documents available since the release of nss 3.11 include the following: build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.12.5 release_notes
new and revised documents available since the release of nss 3.11 include the following: build instructions nss shared db compatibility nss 3.12.5 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.12.9 release notes
new and revised documents available since the release of nss 3.11 include the following:</for> build instructions for nss 3.11.4 and above nss shared db compatibility nss 3.12.9 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.14.2 release notes
they are still under review, and contributions are welcome.
NSS 3.14.3 release notes
in addition, thanks to adam langley (google) for the development of a mitigation for the issues raised in the paper, along with emilia kasper and bodo möller (google) for assisting in the review and improvements to the initial patches.
NSS 3.14 release notes
previous releases were released under a mpl 1.1/gpl 2.0/lgpl 2.1 tri-license.
NSS 3.15.3.1 release notes
this is a patch release to revoke trust of a subordinate ca certificate that was mis-used to generate a certificate used by a network appliance.
NSS 3.15.4 release notes
new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post.
NSS 3.16.2.2 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
NSS 3.16.2.3 release notes
previously nss would only validate the peer's public key before performing ecdh key agreement.
NSS 3.16.4 release notes
the intention is to mitigate the effects of the previous removal of the 1024-bit entrust.net root certificate, because many public internet sites still use the "usertrust legacy secure server ca" intermediate certificate that is signed by the 1024-bit entrust.net root certificate.
NSS 3.16.6 release notes
this fixes a regression introduced in nss 3.16.2 that prevented nss from importing some rsa private keys (such as in pkcs #12 files) generated by other crypto libraries.
NSS 3.16 release notes
previously, they had to be referred to with their names in ssl 3.0, with the ssl_ prefix.
NSS 3.18.1 release notes
so, to give website administrators more time to update their web servers, we reverted the trust bits back to being enabled.
NSS 3.19.1 release notes
nss 3.19.2 reverts the behaviour to the nss 3.19 and earlier limits.
NSS 3.19.2.2 release notes
nss 3.19.2.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_2_2_rtm/src/ security fixes in nss 3.19.2.2 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures.
NSS 3.19.2 release notes
in nss 3.19.2, this change in freebl behaviour has been reverted.
NSS 3.20.2 release notes
nss 3.20.2 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_20_2_rtm/src/ security fixes in nss 3.20.2 bug 1158489 / cve-2015-7575 - prevent md5 downgrade in tls 1.2 signatures.
NSS 3.23 release notes
the build time environment variable nss_disable_chachapoly was added, which can be used to prevent compilation of the chacha20/poly1305 code.
NSS 3.25.1 release notes
previously, with rare server configurations, an md5 signature algorithm might have been selected for client authentication and caused the client to abort the connection soon after.
NSS 3.26.2 release notes
previously, with rare server configurations, an md5 signature algorithm might have been selected for client authentication and caused the client to abort the connection soon after.
NSS 3.27.1 release notes
previous versions of nss made tls 1.3 (draft) available only when compiled with nss_enable_tls_1_3.
NSS 3.27.2 Release Notes
previous versions of nss leaked the memory used to store distinguished names when ssl_settrustanchors() was used.
NSS 3.28.3 release notes
the change has been reverted to the original state in bug 1334108.
NSS 3.28 release notes
this was previously possible by replacing certain nss source files.
NSS 3.29.1 release notes
the change has been reverted to the original state in bug 1334108.
NSS 3.31 release notes
previously, ssl_versionrangeset and ssl_versionrangesetdefault returned a failure if the requested version range wasn't fully allowed by the systemwide crypto policy.
NSS 3.34.1 release notes
it was previously removed in nss 3.34, but now re-added with only the email trust bit set.
NSS 3.37 release notes
added hacl* poly1305 32-bit the code to support the npn protocol, which had already been disabled in a previous release, has been fully removed.
NSS 3.45 release notes
bug 1546477 - various changes in response to the ongoing fips review note: the source package size has increased substantially due to the new fips test vectors.
NSS Sample Code Sample1
this program shows the following: rsa key pair generation naming rsa key pairs looking up a previously generated key pair by name creating aes and mac keys (or encryption and mac keys in general) wrapping symmetric keys using your own rsa key pair so that they can be stored on disk or in a database.
nss tech note6
any offer of binary support that may have been previously made to you by nss developers is null and void.
Overview of NSS
every nss release is backward compatible with previous releases, allowing nss users to upgrade to the new nss shared libraries without recompiling or relinking their applications.
FC_Decrypt
description fc_decrypt decrypts a block of data according to the attributes of the previous call to fc_decryptinit.
FC_DecryptUpdate
description fc_decryptupdate decrypts a block of data according to the attributes of the previous call to fc_decryptinit.
FC_Digest
description fc_digest digests a message in a single operation according to the attributes of the previous call to fc_digestinit.
FC_Encrypt
description fc_encrypt encrypts a block of data according to the attributes of the previous call to fc_encryptinit.
FC_EncryptUpdate
description fc_encryptupdate encrypts a block of data according to the attributes of the previous call to fc_encryptinit.
FC_FindObjects
description fc_findobjects returns the next set of object handles matching the criteria set up by the previous call to fc_findobjectsinit and sets the object count variable to their number or to zero if there are none.
FC_Sign
description fc_sign signs a message in a single operation according to the attributes of the previous call to fc_signinit.
NSS_Initialize
the following limitation applies when this is set : secmod_waitforanytokenevent will not use c_waitforslotevent, in order to prevent the need for c_finalize.
NSS tools : pk12util
the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o secmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously.
NSS tools : ssltab
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
NSS tools : ssltap
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
troubleshoot.html
cd c:/programs/cygnus/bin (or wherever your gnu tools are installed) cp shmsdos.exe shmsdos.bak (backup shmsdos) cp sh.exe shmsdos.exe (substitute alternative shell) making this change will probably break other builds you are making on the same machine.
OLD SSL Reference
callback ssl communication functions ssl_invalidatesession ssl_datapending ssl_securitystatus ssl_getsessionid ssl_setsockpeerid ssl functions used by callbacks ssl_peercertificate ssl_revealurl ssl_revealpinarg ssl handshake functions ssl_forcehandshake ssl_rehandshake ssl_resethandshake nss shutdown function nss_shutdown deprecated functions ssl_enabledefault...
ssltyp.html
as long as you use the form shown here, your code will not need revision.
SSL functions
m mxr 3.2 and later ssl_preencryptedstreamtofile mxr 3.2 and later ssl_rehandshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake mxr 3.2 and later ssl_restarthandshakeaftercertreq mxr 3.2 and later ssl_restarthandshakeafterservercert mxr 3.2 and later ssl_revealcert mxr 3.2 and later ssl_revealpinarg mxr 3.2 and later ssl_revealurl mxr 3.2 and later ssl_securitystatus mxr 3.2 and later ssl_setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg mxr 3.2 and later ssl_setsockpeerid mxr 3.2 and later ssl_seturl mxr 3.2 and later ss...
TLS Cipher Suite Discovery
each new release of a tls implementation may contain support for new cipher suites not supported in previous versions.
NSS Tools
source, documentation crlutil manage certificate revocation lists (crls).
NSS Tools ssltap
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o secmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously.
NSS tools : pk12util
the last versions of these legacy databases are: o cert8.db for certificates o key3.db for keys o secmod.db for pkcs #11 module information berkeleydb has performance limitations, though, which prevent it from being easily used by multiple applications simultaneously.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
Necko walkthrough
note: this callback may be a proxy object, nsinputstreamreadyevent: it is a runnable that dispatches itself to a previously set target thread, and calls its internal mcallback->oninputstreamready function.
Personal Security Manager (PSM)
these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions.
Installing Pork
index: src/set_mcpp.sh =================================================================== --- src/set_mcpp.sh (revision 78) +++ src/set_mcpp.sh (working copy) @@ -35,14 +35,14 @@ echo " cd ${inc_dir}/mcpp-gcc" cd ${inc_dir}/mcpp-gcc if test !
Pork Tool Development
cppsourceloc will change the previously provided location information (in variable cpp_source_loc._loc) from post-location to pre-location.
Download Rhino
previous versions were released under mpl 1.1/gpl 2.0 license.
New in Rhino 1.7R4
ing conversion several regexp fixes regexp performance improvements es5 compliance fixes improved interpreter performance improved commonjs module implementation javascript 1.8 generator expressions many parser and ast fixes use javascript 1.7 as default version in rhino shell javaadapter improvements fixes in js to java access include mozilla test suite a list of bugs that were fixed since the previous release.
Rhino optimization
note some language features (indirect calls to eval, use of the arguments property of function objects) were previously not supported in higher optimization levels.
Rhino overview
these features are generally not broadly useful, yet they impose significant constraints on implementations that hamper or prevent optimization.
Performance Hints
with using the with statement prevents the compiler from generating code for fast access to local variables.
Rhino serialization
if you are using rhino serialization in an environment where you always define, say, a constructor foo, you should add the following code before calling writeobject: out.addexcludedname("foo"); out.addexcludedname("foo.prototype"); this code will prevent foo and foo.prototype from being serialized and will cause references to foo or foo.prototype to be resolved to the objects in the new scope upon deserialization.
Rhino shell
deserialize(filename) restore from the specified file an object previously written by a call to serialize.
SpiderMonkey compartments
in previous versions of spidermonkey, the garbage collector would walk the entire heap of all javascript objects when garbage collection was needed.
GCIntegration - SpiderMonkey Redirect 1
write barriers all the schemes for preventing this sort of thing require write barriers.
Garbage collection
but this also means that pre-barriers are inadequate to prevent incremental gc from missing edges due to graph mutation.
Invariants
(we can probably loop forever if that happens.
Tracing JIT
it is important to keep in mind that this pass runs backwards from the last lins in the input lir code to the first, generating native code in reverse.
Self-hosted builtins in SpiderMonkey
this is to prevent accidentally calling content functions when assuming that content can't interfere with behavior.
Introduction to the JavaScript shell
anything other than 0 will make javascript run extremely slow but may help reveal or reproduce gc-related bugs.
JIT Optimization Strategies
it provides information on what they attempt to do, what general level of speed-up they provide, what kind of program characteristics can prevent them from being used, and common ways to enable the engine to utilize that optimization.
JSAPI User Guide
a minimal example each of the three key elements described in the previous section requires a few jsapi calls: the runtime: use js_newruntime to create it and js_destroyruntime to clean it up when you're done.
JS::OrdinaryToPrimitive
description js::ordinarytoprimitive converts a javascript object to a specified type value, by the algorithm specified in es6 draft rev 28 (2014 oct 14) 7.1.1, second algorithm.
JS::ToString
syntax #include "js/conversions.h" // as of spidermonkey 38; previously in jsapi.h jsstring* js::tostring(jscontext *cx, js::handlevalue v) name type description cx jscontext * the context in which to perform the conversion.
JSVAL_UNLOCK
jsval_unlock unlocks a previously locked js value, v, so it can be garbage collected.
JS_AddExternalStringFinalizer
this is always a string that the application previously created by calling js_newexternalstring.
JS_AddFinalizeCallback
js_removefinalizecallback removes the previously added callback function.
JS_DestroyRuntime
js_destroyruntime garbage collects and frees the memory previously allocated by js_newruntime.
JS_EnterCompartment
on success, js_entercompartment returns a pointer to the previously entered compartment.
JS_ExecuteScript
description js_executescript executes a previously-compiled script, script.
JS_ExecuteScriptPart
description js_executescriptpart executes part of a previously compiled script, script.
JS_ExecuteScriptVersion
description js_executescript executes a previously-compiled script, script.
JS_ForwardGetPropertyTo
onbehalfof is receiver in [[get]] internal method of proxy, defined in es2015 draft spec (rev 29, 9.5.8).
JS_Init
syntax #include "js/initialization.h" // previously "jsapi.h" bool js_init(void); description initialize spidermonkey, returning true only if initialization succeeded.
JS_IsExtensible
see also mxr id search for js_preventextensions js_preventextensions bug 492845 ...
JS_LeaveCompartment
oldcompartment jscompartment * value returned by previous call to js_entercompartment.
JS_LeaveCrossCompartmentCall
syntax void js_leavecrosscompartmentcall(jscrosscompartmentcall *call); name type description call jscrosscompartmentcall * value returned by previous call to js_entercrosscompartmentcall.
JS_MaybeGC
calling js_maybegc when the application is idle can help prevent garbage collection from happening at less convenient times.
JS_NewObject
previous behaviour obsolete since jsapi 45 here's how the process works in detail: first, we must identify a global object.
JS_NextProperty
iterobj js::handleobject the opaque iterator object returned by a previous call to js_newpropertyiterator.
JS_SetArrayLength
if you call js_setarraylength on an existing array, and length is less than the highest index number for previously defined elements, all elements greater than or equal to length are automatically deleted.
JS_SetCheckObjectAccessCallback
js_setcheckobjectaccesscallback returns the previous check-object-access callback.
JS_SetObjectPrincipalsFinder
js_setobjectprincipalsfinder returns the previous object-principals-finder callback.
JS_SetPrincipalsTranscoder
js_setprincipalstranscoder returns the previous principals transcoder.
JS_SuspendRequest
js_resumerequest resumes the previously suspended requests.
JS_Unlock
unlock a previously locked js run-time environment.
JSAPI reference
ctprototype added in jsapi 17 js_getfunctionprototype added in spidermonkey 17 js_getarrayprototype added in spidermonkey 24 js_getconstructor js_getglobalforobject js_getinstanceprivate js_getprototype js_setprototype js_getprivate js_setprivate js_freezeobject added in spidermonkey 1.8.5 js_deepfreezeobject added in spidermonkey 1.8.5 js_isextensible added in spidermonkey 1.8.5 js_preventextensions added in spidermonkey 45 js_instanceof js_hasinstance js_isnative added in spidermonkey 17 js::toprimitiveadded in spidermonkey 45 js::newfunctionfromspecadded in spidermonkey 45 js_defaultvalueobsolete since jsapi 44 js_get_class obsolete since jsapi 13 js_sealobject obsolete since javascript 1.8.5 js_getparent obsolete since jsapi 39 js_setparent obsolete since jsapi 3...
SpiderMonkey 52
it continues to improve performance over previous spidermonkey releases.
Thread Sanitizer
runtime suppressions to prevent races from showing up at runtime, tsan also provides a runtime suppression list.
WebReplayRoadmap
to that end, this document will be revised over time as we find new and better ways of helping developers.
compare-locales
if you want to test the localization for de, run $ compare-locales browser/locales/l10n.toml ./l10n/ de to check mobile, replace the previous line with: $ compare-locales mobile/android/locales/l10n.toml ./l10n/ zh-tw to check mail, suite, calendar that lives on comm-central, you can either rely on the check-out of mozilla within comm-central repository that the regular comm-central build instructions generate: $ compare-locales ./comm-central/mail/locales/l10n.toml ./l10n/ zh-tw if you don't want to use a copy of mozilla-ce...
The Rust programming language
it prevents segmentation faults and guarantees thread safety, all with an easy-to-learn syntax.
Exploitable crashes
the last number, in this case 0x00000000, is the memory address firefox was prevented from accessing.
Browser security
secure development guidelinesthe following content will likely see significant revision, though can be used as a reference for security best practices to follow when developing code for mozilla.security and the jar protocolthis article discusses security concerns with the jar: protocol, which only firefox has ever implemented for web content.
Signing Mozilla apps for Mac OS X
mac os x's gatekeeper functionality prevents users from launching applications that haven't been code-signed, in order to help keep their computers secure.
Gecko states
state_traversed the object is a hyperlink that has been visited (previously clicked) by a user.
XForms Accessibility
xforms sample tests at mozilla xforms project there are set of tests at beaufour.dk w3c's xforms test at w3.org keyboard navigation issues navigation sequence though xforms spec declares navindex attribute to define the navigation sequence (see 1.0 specs or 1.1 specs) but rich schwerdtfeger (distinguished engineer, swg accessibility architect/strategist chair, ibm accessibility architecture review board) gave some clarification about navindex.
Accessibility API Implementation Details
this article (from 2007) reviews the progress and technology as it has developed.
Embedded Dialog API
an example of this can be found in the mfc embedding testbed application, in the method cmfcembedapp::initializewindowcreator (lxr link accurate at revision 1.20 of that file; search for the method name in later revisions).
Frecency algorithm
this score is determined by the amount of revisitation, the type of those visits, how recent they were, and whether the uri was bookmarked or tagged.
Manipulating bookmarks using Places
var thisuri = bmsvc.getbookmarkuri(newbkmkid); assuming you've run all the code samples previous to this one, this will output "http://google.com".
Places Developer Guide
uri var mytags = tagssvc.gettagsforuri(myuri, {}); // get an array of uris for a tag var taggeduris = tagssvc.geturisfortag("mozilla"); // get an array of all tags var arrayofalltags = tagssvc.alltags; // remove tags from a uri tagssvc.untaguri(myuri, ["mozilla", "firefox"]); this service currently integrates with and is internally dependent upon bookmarks: if you tag a uri that is not previously bookmarked, a new bookmark is created in the unfiled bookmarks folder.
Places Expiration
common expiration runs on a timer, every 3 minutes and uses a simple adaptive algorithm: if the last step was unable to expire enough entries the next one will expire more entries, otherwise if the previous step completed the cleanup the next step will be delayed.
Querying Places
// |query| and |options| are objects created in the previous section query.setparents([placesutils.bookmarks.toolbarguid], 1); let result = placesutils.history.executequery(query, options); serializing queries query and options objects can be serialized into a string starting with "place:" using queriestoquerystring.
Retrieving part of the bookmarks tree
you can also get folder ids from a previous query.
Using the Places keywords API
note this is the same feature previously known as bookmark keywords, the key difference is that keywords are not bound to a specific bookmark, but to a specific url.
places.sqlite Database Troubleshooting
nn must be replaced with the number we had noted previously: sqlite> pragma user_version = nn; let's update the page_size value: sqlite> pragma journal_mode = truncate; sqlite> pragma page_size = 32768; sqlite> vacuum; sqlite> pragma journal_mode = wal; sqlite> .exit copy the new places.sqlite to the profile folder, overwriting the existing one.
XPCOM changes in Gecko 2.0
previously, whenever gecko detected that the application version had changed, or one or more extensions was added, removed, enabled, or disabled, it was necessary to throw away all existing component registrations, then restart the application (what we call the "extension manager restart") during its startup process.
Making cross-thread calls using runnables
mcallback(mresult); // if we don't destroy the thread when we're done with it, it will hang around forever...
XPCOM guide
MozillaTechXPCOMGuide
avoiding leaks in javascript xpcom componentsprogrammers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks.
Components.Constructor
using components.constructor(); the latter is much easier to read than the former (particularly if you're creating instances of a component in many different places): var bis = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // assumes binaryinputstream was initialized previously var bis = new binaryinputstream(someinputstream); components.constructor() is purely syntactic sugar (albeit speedy and pretty syntactic sugar) for actions that can be accomplished using other common methods.
Components.results
note the common use of an abbreviation for components.results, cr: const ci = components.interfaces, cr = components.results; function class() { /* ...
Components.utils.evalInSandbox
the evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.
Components.utils.exportFunction
this prevents passing cross-origin objects (like window or location) to privileged functions, since the privileged code will have full access to those objects and might unintentionally do something dangerous.
Components.utils.getWeakReference
in gecko 12.0, the previous behavior of silently failing has been restored.
Components.utils.unwaiveXrays
undo a previous call to components.utils.waivexrays(), restoring xray vision for the caller.
XPConnect wrappers
note that a previous version of the current page recommended using __exposedprops__ to expose objects from chrome to content.
NS_Realloc
this pointer must have been previously allocated by the xpcom memory manager, or this parameter may be null in which case this function behaves like ns_alloc.
nsCStringEncoding
reverse conversion is done by truncating every other byte.
IAccessibleImage
the user can edit the content that includes an image and therefore the user needs to be able to review the image's position.
imgIDecoderObserver
this will be revisited in bug 505385.
inIDOMUtils
return value void setcontentstate() sets the given element as the current owner of the specified state, and removes that state from the previous owner.
mozIPersonalDictionary
getcorrection() gets a list of previous corrections for the word.
nsIAccessNode
obsolete since gecko 2.0 previoussiblingnode nsiaccessnode the previous nsiaccessnode sibling.
ChildCount
attribute long childcount; see also nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.previoussibling ...
Children
see also nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.childcount nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.previoussibling ...
FirstChild
see also nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.previoussibling ...
GetChildAt
see also nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.previoussibling ...
LastChild
see also nsiaccessible.firstchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.previoussibling ...
NextSibling
see also nsiaccessible.parent nsiaccessible.previoussibling nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() ...
Parent
see also nsiaccessible.nextsibling nsiaccessible.previoussibling nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() ...
nsIAccessibleStates
state_traversed 0x00800000 the object is a hyperlink that has been visited (previously clicked) by a user.
nsIAccessibleTreeCache
acount the number of treeitem accessibles to invalidate, the number sign specifies whether rows have been inserted (plus) or removed (minus) treeviewchanged() invalidates children created for the previous tree view.
nsIAppShellService
if the browser is exited, this windowless browser will not prevent firefox from exiting.
nsIAuthInformation
previous_failed 16 we have already tried to log in for this channel (with auth values from a previous promptauth call), but it failed, so we now ask the user to provide a new, correct login.
nsIAuthPrompt2
this way we prevent multiple dialogs shown to the user because consumer may fall back to synchronous prompt on synchronous failure of this method.
nsIBoxObject
previoussibling nsidomelement the previous sibling of the box, in box-ordinal-group order.
nsICRLInfo
security/manager/ssl/public/nsicrlinfo.idlscriptable information on a certificate revocation list (crl) issued by a certificate authority (ca).
nsICacheEntryDescriptor
checked before we write to the cache entry, to prevent ever taking up space in the cache for an entry that we know up front is going to have to be evicted anyway.
nsIChannelEventSink
if the sink wants to prevent this loading it must explicitly deal with it, e.g.
nsICollection
result comparison result of the previous two parameters.
nsIComponentManager
removebootstrappedmanifestlocation() unregisters the chrome.manifest file previously registered with the addbootstrappedmanifestlocation() method.
nsICompositionStringSynthesizer
boolean dispatchevent(); return value if dispatched event's default is prevented, returns true.
nsIConsoleService
you may pass null if you are lazy; this will prevent the source line showing in the error console.
nsIDOMNode
prefix domstring previoussibling nsidomnode read only.
nsIDOMStorageItem
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) gecko 1.9.1 note starting in gecko 1.9.1 (firefox 3.5), this is only used for session storage; previously, it was also used for global storage.
nsIDirectoryService
unregisterprovider() unregister a provider that was previously registered with the directory service.
nsIDownloadProgressListener
void ondownloadstatechange( in short astate, in nsidownload adownload ); parameters astate the previous state of the download.
nsIDroppedLinkHandler
this prevents a source document from tricking the user into a dragging a chrome url for example.
nsIEditor
ntstatelistener listener); debug methods void dumpcontenttree(); void debugdumpcontent() ; void debugunittests(out long outnumtests, out long outnumtestsfailed); [notxpcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags constant value description enone 0 enext 1 eprevious 2 enextword 3 epreviousword 4 etobeginningofline 5 etoendofline 6 attributes attribute type description contentsmimetype string the mime type of the document.
nsIEditorSpellCheck
note: this does not clear any suggestions left over from previous calls to checkcurrentword(), so there may be suggestions, but they will be invalid.
nsIFile
void normalize(); file openansifiledesc(in string mode); prfiledescstar opennsprfiledesc(in long flags, in long mode); void renameto(in nsifile newparentdir, in astring newname); void remove(in boolean recursive); void reveal(); void setrelativedescriptor(in nsifile fromfile, in acstring relativedesc); attributes attribute type description directoryentries nsisimpleenumerator returns an enumeration of the elements in a directory.
nsIFocusManager
movefocus_backwarddoc 4 move focus forward to the previous frame document, used when pressing shift+f6.
nsIFrameMessageManager
removemessagelistener() removes a message listener previously added by calling addmessagelistener().
nsIHttpChannel
this attribute is true by default, though other factors may prevent pipelining.
nsIJumpListBuilder
to prevent repeatedly adding entires users have removed, applications are encouraged to track removed items internally.
nsIMacDockSupport
enuitem.addeventlistener('command', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); docksupport.activateapplication(true); services.wm.getmostrecentwindow(null).focus() }) services.appshell.hiddendomwindow.document.getelementbyid('menu_mac_dockmenu').appendchild(macmenuitem) this adds the "show most recent window" menuitem from the previous example as a third item.
nsIMarkupDocumentViewer
prevdoccharacterset acstring textzoom float the amount by which to scale all text.
nsIMemory
free frees a previously allocated block of memory.
nsIMessenger
if they want a list suitable for display, they should pass in an ahistory pointer, and they'll get returned an array with strings containing something like subject and sender of the message - other possible info is the folder containing the message, and the preview text, if available.
Building an Account Manager Extension
therefore we add the following code to the previous.
nsIMsgAccountManagerExtension
return value a true indicates, that the account manager can display the panel for the given account, while false prevents the panel to be loaded.
nsIMsgDBHdr
it is also mandatory to set msghdr.folder.msgdatabase = null after performing this kind of operations to prevent leaking.
nsIMsgDBView
the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other xpcom based mail cients.
nsINavBookmarksService
dynamic containers were removed in gecko 11, but the type index remains to prevent reuse.
nsINavHistoryQueryOptions
at this time, sorting methods are not supported; results will always be returned in reverse order of insertion.
nsINavHistoryResultObserver
the item previously at the specified index (if any) and everything below it is shifted down by one.
nsINavHistoryResultViewer
remarks the item previously at the specified index (if any) as well as everything below it, is shifted down by one.
nsIPrefBranch2
aobserver an observer previously registered with addobserver.
nsIPromptService
button_title_cancel 2 button_title_yes 3 button_title_no 4 button_title_save 5 button_title_dont_save 6 button_title_revert 7 button_title_is_string 127 this flag indicates that the label is passed as a separate string.
nsIPushSubscription
a subscription expires if its service worker exceeds the quota, or if the desktop-notification permission for its origin is revoked.
nsISHistory
for example to control memory usage of the browser, to prevent users from loading documents from history, to erase evidence of prior page loads and so on.
nsIScriptError2
you may pass null if you are lazy; that will prevent showing the source line in javascript console.
nsISecurityCheckedComponent
note that if wrapper creation is prevented, the properties and methods will not be defined on the javascript object, whereas if wrapper creation succeeds but methods/properties are prevented, the properties and methods will be visible, not not usable.
nsISeekableStream
a negative value causes seeking in the reverse direction.
nsISelectionPrivate
tableselection_cell 1 tableselection_row 2 tableselection_column 3 tableselection_table 4 tableselection_allcells 5 methods addselectionlistener() void addselectionlistener( in nsiselectionlistener newlistener ); parameters newlistener endbatchchanges() will resume user interface updates after a previous call to startbatchchanges().
nsIStyleSheetService
return value returns true if a style sheet at sheeturi has previously been added to the list of style sheets specified by type.
nsITelemetry
scalars(); test only void flushbatchedchildtelemetry(); void recordevent(in acstring acategory, in acstring amethod, in acstring aobject, [optional] in jsval avalue, [optional] in jsval extra); void seteventrecordingenabled(in acstring acategory, in boolean aenabled); jsval snapshotevents(in uint32_t adataset, [optional] in boolean aclear); void registerevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data).
nsIThreadInternal
methods popeventqueue() reverts a call to pusheventqueue().
nsITimer
however this timer type guarantees that it will not queue up new events to fire the callback until the previous callback event finishes firing.
nsIURI
this is useful for authentication, managing sessions, or for checking the origin of an uri to prevent cross-site scripting attacks while using methods such as window.postmessage().
nsIUpdateManager
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes a global application service that maintains a list of previously installed updates, as well as the currently in use update.
nsIVersionComparator
return value if a and b are two version being compared, and the return value is smaller than 0, then a < b equals 0 then version, then a==b is bigger than 0, then a > b example function compareversions(a,b) { var x = services.vc.compare(a,b); if(x == 0) return a + "==" + b; else if(x > 0) return a + ">" + b; return a + "<" + b; } dump(compareversions("1.0pre", "1.0")); example - compare current browser version this example here uses nsixulappinfo component to get the version of the browser that the code is running in.
nsIWebProgressListener
constant value description state_restoring 0x01000000 this flag indicates that the state transition corresponds to the start or stop of activity for restoring a previously-rendered presentation.
nsIWindowWatcher
for example the following code will block the system because it will open windows continuously: function mywindowobserver() { this.observe=function(asubject, atopic, adata) { alert("window event: " + atopic) //and this is where the bugs origins because opening this alert will cause a window-open //event and the call of this method again (forever) } } var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); ww.registernotification(new mywindowobserver()) alert("") //generate the first window-open event aobserver the nsiobserver to be notified when windows are opened or closed.
nsIXPConnect
ptions thrown missing exception missing description varianttojs() jsval varianttojs( in jscontextptr ctx, in jsobjectptr scope, in nsivariant value ); parameters ctx missing description scope missing description value missing description return value missing description exceptions thrown missing exception missing description wrapjs() wrapjs() will yield a new or previously existing xpcom interface pointer to represent the jsobject passed in.
nsIXSLTProcessor
getparameter() gets a parameter if previously set by setparameter().
nsIXULBrowserWindow
return value a string indicating the revised target for the link.
nsIXULRuntime
if a component encounters startup errors that might prevent the app from showing proper ui, it should set this flag to true.
nsIXULTemplateQueryProcessor
the value of aquery must be the result of a previous call to compilequery() from this query processor.
nsIZipReaderCache
otherwise the previously created nsizipreader is returned.
XPCOM Interface Reference by grouping
rorlistener stream stream nsipipe nsitraceablechannel nsitransport nsitransporteventsink nsitransportsecurityinfo timer nsitimer nsitimercallback ui windows nsitaskbarpreview nsitaskbarpreviewbutton nsitaskbarpreviewcontroller nsitaskbarprogress nsitaskbartabpreview nsitaskbarwindowpreview nsiwintaskbar nsialertsservice nsiwebprogress nsiwebprogresslistener nsiwebprogresslistener2 update nsiupdate nsiupdatec...
nsMsgViewCommandType
reload or print preview) are available.
Setting HTTP request headers
while the previous version we showed before was good for learning, in an actual real-world application, you'd probably want to code it more like the following.
Reference Manual
to help prevent this, we are trying to make the first form, above, illegal by making operator& private.
Status, Recent Changes, and Plans
bug 59414: making operator& private may help prevent some leaks caused by casting move the factored nscomptr routines into their own library, to reduce nscomptr clients' dependency on the xpcom library.
Using nsIPasswordManager
review and cleanup would be appreciated.
Using the Gecko SDK
(<tt>about:buildconfig</tt> can be loaded in mozilla to reveal details about the compiler that was used.) for the remainder of this guide, we'll assume you are developing components under linux.
Using the clipboard
the first steps are similar to that used for copying: var trans = transferable(); trans.adddataflavor("text/unicode"); recall that transferable() is a function from the boilerplate in the previous section.
Weak reference
the nsobservable doesn't want to keep the observers alive just to prevent a dangling pointer, however.
XSLT 2.0
error and diagnostics output from saxon-ce can be reviewed in the firefox developer console or in firebug.
Xray vision
if a script has created a property on an object instance that shadows a property on the prototype, the shadowing property is not visible in the xray second, we want to prevent the chrome code from running content code, so functions and accessor properties of the object are not visible in the xray.
Autoconfiguration in Thunderbird
the component is actively watched for new bugs (as of november 2015) so there is no need to request review on the file.
Creating a gloda message query
so if we had a "shape" constraint such as query.shape("square") and we combined it with the previous color constraint it would match a red square, a green square, or a blue square.
Mail and RDF
an aside: rational behind the design after reviewing this design, it might seem unnecessary to have the double-levels of notification/registration.
Mail composition back end
(see send later above) the nsimsgsendlater is the interface that allows the caller to send all of the files previously stored.
Main Windows
its main focus is on handling the folderpane, threadpane, and the message preview sections shown above.
Message Interfaces
nsimsgdbview nsimsgdbview - the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other xpcom based mail cients.
Building a Thunderbird extension 2: extension file layout
« previous next » ...
Building a Thunderbird extension 3: install manifest
« previous next » ...
Building a Thunderbird extension 5: XUL
« previousnext » ...
Building a Thunderbird extension 6: Adding JavaScript
« previousnext » ...
Demo Addon
" *" : "") + "\n"; if (folder.hassubfolders) for each (let folder in fixiterator(folder.subfolders, ci.nsimsgfolder)) print(indent + " ", folder); }; print(" ", folder); as in the previous example, we get the incomingserver of the account in question.
Finding the code for a feature
looking that up in mxr, its underlying function uses a very strange call prevhdrfolder[toggler](messages, key) to change the key.
Styling the Folder Pane
specialfolder-smart -- indicates that the folder is a child of a unified folder (previously known as smart folder) in the smart folders view.
Tips and Tricks from the newsgroups
message has been flagged as junk imap: getting message key of copied message by nsimsgcopyservice::copyfilemessage access the plain text content of the email body get information about attachment without selecting message repeat image display using css sprites scan for new messages at startup and manually scan a folder initiated by user force listeners to run consecutively to prevent pop messages from getting garbled during message retrieval ...
Thunderbird extensions
read about the main windows to learn about « thread pane », « preview pane », and « folder pane ».
Using the Multiple Accounts API
the current plans prevent sharing of information between accounts using the ui.
libmime content type handlers
libmime has a homegrown object system written in c, and since the content type handler plugins need to exist in this module, a description of the libmime object system should be reviewed and understood.
Thunderbird
there's also information about how the review process works and how to use the mozilla symbol server to help with debugging.
Using the Mozilla symbol server
symbols are available for at least 30 previous days worth of nightly builds, and firefox releases from 2.0.0.4.
Using Objective-C from js-ctypes
globalblock; // global flags bl.flags = block_const.block_has_stret; bl.reserved = 0; bl.invoke = afunctypeptr; // create descriptor var desc = block_descriptor_1(); desc.reserved = 0; desc.size = block_literal_1.size; // set descriptor into block literal bl.descriptor = desc.address(); return bl; } an example of this function in use can be seen here: _ff-addon-snippet-objc_monitorevents - shows how to monitor and block mouse and key events on mac os x ...
Standard OS Libraries
wms on ubuntu work a little differently but we'll revisit this topic later in this article (did you know they have a *special* firefox build for ubuntu?).
Working with data
as review, making a null-terminated string happens like this: var cstr_nullterminated = ctypes.jschar.array()('rawr'); console.log(cstr_nullterminated); // outputs to browserconsole: `cdata { length: 5 }` console.log(cstr_nullterminated.tostring()); // outputs to browser console: `"ctypes.char16_t.array(5)(["r", "a", "w", "r", "\x00"])"` the console.log shows that the length is greater then the lengt...
ABI
a calling convention is an implementation-level (low-level) scheme regarding how subroutines receive parameters from their caller and how they revert.
StructType
method overview define(fields) methods inherited from ctype ctype array([n]) string tosource() string tostring() methods define() defines a previously declared opaque type's fields.
Plug-in Basics - Plugins
plug-in references the mozilla plug-ins project page « previousnext » ...
DOM Inspector FAQ - Firefox Developer Tools
those nodes whose white-space css property value prevents the user-agent from collapsing sequences of whitespace will not be hidden.
Introduction to DOM Inspector - Firefox Developer Tools
(note that there are bugs which prevent the flasher from dom inspector apis from working correctly on certain platforms.) if you inspect the main browser window, for example, and select nodes in the dom nodes viewer (other than the elements which have no visible ui as is the case with the endless list of script elements that are loaded into browser.xul), you will see the various parts of the browser interface being highlighted with...
Breaking on exceptions - Firefox Developer Tools
starting in firefox 80, a disclosure triangle within the tooltip reveals a stack trace.
Source map errors - Firefox Developer Tools
the message looks a little different in this case: in this case, the error will also be displayed in the source tab in the debugger: networkerror when attempting to fetch resource a bug in firefox prevents it from loading source maps for web extensions.
Debugger.Environment - Firefox Developer Tools
setvariable(name,value) storevalue as the value of the variable bound toname in this environment.name must be a string that is a valid ecmascript identifier name;value must be a debuggee value.
Debugger.Memory - Firefox Developer Tools
known values include the following: “api” “eager_alloc_trigger” “destroy_runtime” “last_ditch” “too_much_malloc” “alloc_trigger” “debug_gc” “compartment_revived” “reset” “out_of_nursery” “evict_nursery” “full_store_buffer” “shared_memory_limit” “periodic_full_gc” “incremental_too_slow” “dom_window_utils” “component_utils” “mem_pressure” “cc_waiting” “cc_forced” “load_end” “page_hide” “nsjscontext_destroy” “set_new_document” “set_doc_...
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
(we will probably revise the allocation log to present such allocations in a way that is more informative, and that exposes less of firefox's internal structure.) as expected, the onclick handler is responsible for all allocation done by the page's own code.
Dominators - Firefox Developer Tools
these concepts matter in memory analysis, because often an object may itself be small, but may hold references to other much larger objects, and by doing this will prevent the garbage collector from freeing that extra memory.
Dominators view - Firefox Developer Tools
otherwise, you might want to review the article on dominators concepts.
Network request list - Firefox Developer Tools
image thumbnails if the request is for an image, hovering over its filename shows a preview of the image in a tooltip: security icons the network monitor displays an icon in the domain column: this gives you extra information about the security status of the request: icon meaning https weak https (for example, a weak cipher was used) failed https (for example, a certificate was invalid) http loca...
Edit fonts - Firefox Developer Tools
the default text for the sample is "abc" but the preview text can be edited by clicking on the input field at the top of the section and entering a new value.
Examine and edit CSS - Firefox Developer Tools
when on, any rules defined for printing the page will be displayed similar to the "print preview" mode that many word processing applications provide.
View background images - Firefox Developer Tools
in the rules view, you can see a preview of images specified using background-image.
Animation inspector (Firefox 41 and 42) - Firefox Developer Tools
note that the animation inspector's ui was revamped in firefox 43.
Animation inspector example: Web Animations API - Firefox Developer Tools
nkeyframeoptions); var noteanimation = note.animate(notekeyframeset, notekeyframeoptions); iconanimation.pause(); noteanimation.pause(); var firsttime = true; function animatechannel(e) { if (e.button != 0) { return; } if (e.target.id != "icon") { return; } if (firsttime) { iconanimation.play(); noteanimation.play(); firsttime = false; } else { iconanimation.reverse(); noteanimation.reverse(); } } document.addeventlistener("click", animatechannel); ...
Work with animations - Firefox Developer Tools
click the icon again to reverse the effect.
Call Tree - Firefox Developer Tools
using an inverted, aka bottom-up, call tree an inverted call tree reverses the order of all stacks, putting the leafmost function calls at the top.
Flame Chart - Firefox Developer Tools
an example to see how the flame chart can reveal the behavior of your program, we'll look at a simple example.
UI Tour - Firefox Developer Tools
the performance tool's ui consists of 4 main pieces: toolbar recordings pane recording overview details pane, which may contain any one of: waterfall call tree flame chart toolbar the toolbar contains buttons to: start and stop a recording import a recording you previously saved clear the recordings pane.
Responsive Design Mode - Firefox Developer Tools
each device can have its own: name size devicepixelratio user agent string touch screen also, you can preview the properties of existing devices by hovering over the name in the device modal, where they display in a tooltip.
Taking screenshots - Firefox Developer Tools
prevents saving to a file unless you use the --file option to force file writing.
Web Console Helpers - Firefox Developer Tools
no error is given if the string was not previously blocked.
AbstractWorker - Web APIs
event handlers abstractworker.onerror an eventlistener which is invoked whenever an errorevent of type error bubbles through the worker.
AnalyserNode.smoothingTimeConstant - Web APIs
if 0 is set, there is no averaging done, whereas a value of 1 means "overlap the previous and current buffer quite a lot while computing the value", which essentially smoothes the changes across analysernode.getfloatfrequencydata/analysernode.getbytefrequencydata calls.
Animation.finish() - Web APIs
WebAPIAnimationfinish
that is, if the animation is playing forward, it sets the playback time to the length of the animation sequence, and if the animation is playing in reverse (having had its reverse() method called), it sets the playback time to 0.
Animation.onfinish - Web APIs
hide(endingui); // when the credits are later faded in, // we re-add the pointer events when they're done bringui.onfinish = function() { endingui.style.pointerevents = 'auto'; }; specifications specification status comment web animationsthe definition of 'animation.onfinish' in that specification.
Animation.playState - Web APIs
previously, web animations defined a pending value to indicate that some asynchronous operation such as initiating playback was yet to complete.
Attr.localName - Web APIs
WebAPIAttrlocalName
in previous dom specifications this api was defined within the node interface.
AudioBufferSourceNode - Web APIs
the most recent call replaces the previous one, if the audiobuffersourcenode has not already reached the end of the buffer.
AudioContext.close() - Web APIs
this function does not automatically release all audiocontext-created objects, unless other references have been released as well; however, it will forcibly release any system audio resources that might prevent additional audiocontexts from being created and used, suspend the progression of audio time in the audio context, and stop processing audio data.
AudioContext.resume() - Web APIs
the resume() method of the audiocontext interface resumes the progression of time in an audio context that has previously been suspended.
AudioContext - Web APIs
audiocontext.resume() resumes the progression of time in an audio context that has previously been suspended/paused.
AudioListener - Web APIs
in a previous version of the specification, the dopplerfactor and speedofsound properties and the setposition() method could be used to control the doppler effect applied to audiobuffersourcenodes connected downstream — these would be pitched up and down according to the relative speed of the pannernode and the audiolistener.
AudioNode.connect() - Web APIs
WebAPIAudioNodeconnect
notsupportederror the specified connection would create a cycle (in which the audio loops back through the same nodes repeatedly) and there are no delaynodes in the cycle to prevent the resulting waveform from getting stuck constructing the same audio frame indefinitely.
AudioNode - Web APIs
WebAPIAudioNode
after a design review in october 2013, it was decided to add constructors because they have numerous benefits over factory methods.
AudioParam.exponentialRampToValueAtTime() - Web APIs
the change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
AudioParam.linearRampToValueAtTime() - Web APIs
the change starts at the time specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
AudioParam.value - Web APIs
WebAPIAudioParamvalue
if the current time equals or exceeds the time specified by a previous call to setvalueattime(), the value is changed to the value passed into setvalueattime().
AudioScheduledSourceNode.stop() - Web APIs
each time you call stop() on the same node, the specified time replaces any previously-scheduled stop time that hasn't occurred yet.
AudioTrack.enabled - Web APIs
setting enabled to false effectively mutes the audio track, preventing it from contributing to the media's audio performance.
AudioWorkletProcessor.process - Web APIs
however, plans are already in place to revise the specification to allow the size of the audio blocks to be changed depending on circumstances (for example, if the audio hardware or cpu utilization is more efficient with larger block sizes).
AuthenticatorAssertionResponse.authenticatorData - Web APIs
the server will ensure that this hash matches a hash of its own origin in order to prevent phishing or other man-in-the-middle attacks.
Background Tasks API - Web APIs
because event handling and screen updates are two of the most obvious ways users notice performance issues, it's important for your code to be a good citizen of the web and help to prevent stalls in the execution of the event loop.
BaseAudioContext.createChannelMerger() - Web APIs
fer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
BaseAudioContext.createChannelSplitter() - Web APIs
fer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
BaseAudioContext - Web APIs
baseaudiocontext.createconvolver() creates a convolvernode, which can be used to apply convolution effects to your audio graph, for example a reverberation effect.
Battery Status API - Web APIs
this can be used to adjust your app's resource usage to reduce battery drain when the battery is low, or to save changes before the battery runs out in order to prevent data loss.
BeforeInstallPromptEvent.prompt() - Web APIs
example var istoosoon = true; window.addeventlistener("beforeinstallprompt", function(e) { if (istoosoon) { e.preventdefault(); // prevents prompt display // prompt later instead: settimeout(function() { istoosoon = false; e.prompt(); // throws if called more than once or default not prevented }, 10000); } // the event was re-dispatched in response to our request // ...
BeforeUnloadEvent - Web APIs
ext></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} bubbles no cancelable yes target objects defaultview interface event examples window.addeventlistener("beforeunload", function( event ) { event.returnvalue = "\o/"; }); // is equivalent to window.addeventlistener("beforeunload", function( event ) { event.preventdefault(); }); webkit-derived browsers don't follow the spec for the dialog box.
Body.text() - Web APIs
WebAPIBodytext
let myarticle = document.queryselector('article'); let mylinks = document.queryselectorall('ul a'); for(let i = 0; i <= mylinks.length-1; i++) { mylinks[i].onclick = function(e) { e.preventdefault(); let linkdata = e.target.getattribute('data-page'); getdata(linkdata); } }; function getdata(pageid) { console.log(pageid); var myrequest = new request(pageid + '.txt'); fetch(myrequest).then(function(response) { return response.text().then(function(text) { myarticle.innerhtml = text; }); }); } specifications specification status comme...
CSSRule - Web APIs
WebAPICSSRule
or future use 9 should be used to define color profiles in the future cssrule.namespace_rule 10 cssnamespacerule cssrule.counter_style_rule 11 csscounterstylerule cssrule.supports_rule 12 csssupportsrule cssrule.document_rule 13 cssdocumentrule cssrule.font_feature_values_rule 14 cssfontfeaturevaluesrule cssrule.viewport_rule 15 cssviewportrule cssrule.region_style_rule 16 cssregionstylerule cssrule.unknown_rule 0 cssunknownrule cssrule.charset_rule 2 csscharsetrule (removed in most browsers.) an up-to-date informal list of constants can be found on the csswg wiki.
CSS Object Model (CSSOM) - Web APIs
reference animationevent caretposition css csscharsetrule cssconditionrule csscounterstylerule cssfontfacerule cssfontfeaturevaluesmap cssfontfeaturevaluesrule cssgroupingrule cssimportrule csskeyframerule csskeyframesrule cssmarginrule cssmediarule cssnamespacerule csspagerule cssrule cssrulelist cssstyledeclaration cssstylesheet cssstylerule csssupportsrule cssvariablesmap cssviewportrule elementcssinlinestyle fontface fontfaceset fontfacesetloadevent geometryutils getstyleutils linkstyle medialist mediaquerylist mediaquerylistevent mediaqueryli...
Cache.add() - Web APIs
WebAPICacheadd
note: add() will overwrite any key/value pair previously stored in the cache that matches the request.
Cache.addAll() - Web APIs
WebAPICacheaddAll
note: addall() will overwrite any key/value pairs previously stored in the cache that match the request, but will fail if a resulting put() operation would overwrite a previous cache entry stored by the same addall() method.
Cache.put() - Web APIs
WebAPICacheput
fetch(url).then(function(response) { if (!response.ok) { throw new typeerror('bad response status'); } return cache.put(url, response); }) note: put() will overwrite any key/value pair previously stored in the cache that matches the request.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
to prevent automatic capture of frames, so that frames are only captured when requestframe() is called, specify a value of 0 for the capturestream() method when creating the stream.
CanvasRenderingContext2D.clip() - Web APIs
it replaces any previous clipping region.
CanvasRenderingContext2D.lineJoin - Web APIs
this property has no effect wherever two connected segments have the same direction, because no joining area will be added in this case.
CanvasRenderingContext2D.stroke() - Web APIs
if you don't, the previous sub-paths will remain part of the current path, and get stroked every time you call the stroke() method.
Manipulating video using canvas - Web APIs
f (g > 100 && r > 100 && b < 43) frame.data[i * 4 + 3] = 0; } this.ctx2.putimagedata(frame, 0, 0); return; } when this routine is called, the video element is displaying the most recent frame of video data, which looks like this: in line 2, that frame of video is copied into the graphics context ctx1 of the first canvas, specifying as the height and width the values we previously saved to draw the frame at half size.
Advanced animations - Web APIs
« previousnext » in the last chapter we made some basic animations and got to know ways to get things moving.
Hit regions and accessibility - Web APIs
« previousnext » the <canvas> element on its own is just a bitmap and does not provide information about any drawn objects.
Optimizing canvas - Web APIs
« previousnext » the <canvas> element is one of the most widely used tools for rendering 2d graphics on the web.
Pixel manipulation with canvas - Web APIs
« previousnext » until now we haven't looked at the actual pixels of our canvas.
ChannelMergerNode - Web APIs
fer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
ChannelSplitterNode - Web APIs
fer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
Channel Messaging API - Web APIs
hat created the channel uses port1, and the app at the other end of the port uses port2 — you send a message to port2, and transfer the port over to the other browsing context using window.postmessage along with two arguments (the message to send, and the object to transfer ownership of, in this case the port itself.) when these transferable objects are transferred, they are 'neutered' on the previous context — the one they previously belonged to.
CharacterData - Web APIs
nondocumenttypechildnode.previouselementsibling read only returns the element immediately prior to the specified one in its parent's children list, or null if the specified element is the first one in the list.
ChildNode - Web APIs
WebAPIChildNode
previouselementsibling and nextelementsibling are now defined on the latter.
Clients.openWindow() - Web APIs
in chrome for android, the method may instead open the url in an existing browsing context provided by a standalone web app previously added to the user's home screen.
Clipboard.read() - Web APIs
WebAPIClipboardread
be sure to review the compatibility table before using these methods.
CloseEvent.initCloseEvent() - Web APIs
cancelable whether or not the event's default action can be prevented.
CloseEvent - Web APIs
1011 internal error the server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.
Console.groupCollapsed() - Web APIs
the user will need to use the disclosure button next to it to expand it, revealing the entries created in the group.
Console.profileEnd() - Web APIs
the profileend method stops recording a profile previously started with console.profile().
Console.timeEnd() - Web APIs
WebAPIConsoletimeEnd
stops a timer that was previously started by calling console.time().
Console.timeLog() - Web APIs
WebAPIConsoletimeLog
logs the current value of a timer that was previously started by calling console.time() to the console.
ConvolverNode() - Web APIs
options optional options are as follows: audiobuffer: a mono, stereo, or 4-channel audiobuffer containing the (possibly multichannel) impulse response used by the convolvernode to create the reverb effect.
CredentialsContainer - Web APIs
credentialscontainer.preventsilentaccess()secure context sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty promise.
CustomElementRegistry.get() - Web APIs
the get() method of the customelementregistry interface returns the constructor for a previously-defined custom element.
DOMHighResTimeStamp - Web APIs
if during the process of unloading the previous document which was loaded in the window, a confirmation dialog was displayed to let the user confirm whether or not to leave the previous page, the time origin is the time at which the user confirmed that navigating to the new page was acceptable.
DOMPointReadOnly.x - Web APIs
in general, positive values x mean to the right, and negative values of x means to the left, assuming no transforms have resulted in a reversal.
DOMPointReadOnly.y - Web APIs
in general, positive values of y mean downward, and negative values of y mean upward, assuming no transforms have resulted in a reversal.
DOMPointReadOnly.z - Web APIs
in general, positive values of z mean toward the user (out from the screen), and negative values of z mean away from the user (into the screen), assuming no transforms have resulted in a reversal.
DataTransfer.clearData() - Web APIs
eventlistener('dragstart', dragstarthandler); draggable.removeeventlistener('dragend', dragendhandler); dropable.removeeventlistener('dragover', dragoverhandler); dropable.removeeventlistener('dragleave', dragleavehandler); dropable.removeeventlistener('drop', drophandler); } } function dragoverhandler (event) { status.innerhtml = 'drop available'; event.preventdefault(); } function dragleavehandler (event) { status.innerhtml = 'drag in process (drop was available)'; event.preventdefault(); } function drophandler (event) { dropped = true; status.innerhtml = 'drop done'; event.preventdefault(); // get data linked to event format « text » var _data = event.datatransfer.getdata('text/plain'); var element = ...
DataTransfer.dropEffect - Web APIs
ev.datatransfer.effectallowed); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // set the dropeffec...
DataTransfer.effectAllowed - Web APIs
d = " + ev.datatransfer.effectallowed); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // set the dropeffect to mo...
DataTransfer.getData() - Web APIs
ag" draggable="true" ondragstart="drag(event)">drag me to the other box</span> </div> <div id="div2" ondrop="drop(event)" ondragover="allowdrop(event)"></div> css content #div1, #div2 { width:100px; height:50px; padding:10px; border:1px solid #aaaaaa; } javascript content function allowdrop(allowdropevent) { allowdropevent.target.style.color = 'blue'; allowdropevent.preventdefault(); } function drag(dragevent) { dragevent.datatransfer.setdata("text", dragevent.target.id); dragevent.target.style.color = 'green'; } function drop(dropevent) { dropevent.preventdefault(); var data = dropevent.datatransfer.getdata("text"); dropevent.target.appendchild(document.getelementbyid(data)); document.getelementbyid("drag").style.color = 'black'; } re...
DataTransfer.setData() - Web APIs
use the event target's id for the data ev.datatransfer.setdata("text/plain", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); // get the data, which is the id of the drop target var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // clear the drag data cache (for all formats/types) ev.datatransfer.cleardata(); } </script> <body> <h1>examples of <code>datatransfer</code>: <code>setdat...
DataTransfer.setDragImage() - Web APIs
var img = new image(); img.src = 'example.gif'; ev.datatransfer.setdragimage(img, 10, 10); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); // get the data, which is the id of the drop target var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } </script> <body> <h1>example of <code>datatransfer.setdragimage()</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="tr...
DataTransferItem.getAsFile() - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match(...
DataTransferItem.getAsString() - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^t...
DataTransferItem.kind - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = event.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match(...
DataTransferItem.type - Web APIs
function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.items; for (var i = 0; i < data.length; i += 1) { if ((data[i].kind == 'string') && (data[i].type.match('^text/plain'))) { // this item is the target node data[i].getasstring(function (s){ ev.target.appendchild(document.getelementbyid(s)); }); } else if ((data[i].kind == 'string') && (data[i].type.match('^t...
Detecting device orientation - Web APIs
warning: chrome and firefox do not handle the angles the same way, so on some axes the direction are reversed.
Document.createTouch() - Web APIs
note: previous versions of this method included the following additional parameters but those parameters are not included in either of the standards listed below.
Document.execCommand() - Web APIs
redo redoes the previous undo command.
Document.exitPointerLock() - Web APIs
the exitpointerlock() method asynchronously releases a pointer lock previously requested through element.requestpointerlock.
Document.fonts - Web APIs
WebAPIDocumentfonts
the fontfaceset interface is useful for loading new fonts, checking the status of previously loaded fonts etc.
Document: gotpointercapture event - Web APIs
bubbles no cancelable no interface pointerevent event handler property ongotpointercapture examples this example gets a <p> element and listens for the gotpointercapture event.
Document: lostpointercapture event - Web APIs
bubbles no cancelable no interface pointerevent event handler property onlostpointercapture examples this example listens for the lostpointercapture event, and captures the pointer for an element on pointerdown.
Document.ononline - Web APIs
WebAPIDocumentononline
both events are non-cancellable (you can't prevent the user from coming online, or going offline).
Document: pointerdown event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerdown examples using addeventlistener(): document.addeventlistener('pointerdown', (event) => { console.log('pointer down event'); }); using the onpointerdown event handler property: document.onpointerdown = (event) => { console.log('pointer down event'); }; specifications specification status pointer events ...
Document: pointerenter event - Web APIs
bubbles no cancelable no interface pointerevent event handler property onpointerenter examples using addeventlistener(): document.addeventlistener('pointerenter', (event) => { console.log('pointer entered element'); }); using the onpointerenter event handler property: document.onpointerenter = (event) => { console.log('pointer entered element'); }; specifications specification status pointer events obsolete ...
Document: pointerleave event - Web APIs
bubbles no cancelable no interface pointerevent event handler property onpointerleave examples using addeventlistener(): document.addeventlistener('pointerleave', (event) => { console.log('pointer left element'); }); using the onpointerleave event handler property: document.onpointerleave = (event) => { console.log('pointer left element'); }; specifications specification status pointer events obsolete ...
Document: pointermove event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointermove examples using addeventlistener(): document.addeventlistener('pointermove', (event) => { console.log('pointer moved'); }); using the onpointermove event handler property: document.onpointermove = (event) => { console.log('pointer moved'); }; specifications specification status pointer events obsolete ...
Document: pointerout event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerout examples using addeventlistener(): document.addeventlistener('pointerout', (event) => { console.log('pointer moved out'); }); using the onpointerout event handler property: document.onpointerout = (event) => { console.log('pointer moved out'); }; specifications specification status pointer events obsol...
Document: pointerover event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerover examples using addeventlistener(): document.addeventlistener('pointerover', (event) => { console.log('pointer moved in'); }); using the onpointerover event handler property: document.onpointerover = (event) => { console.log('pointer moved in'); }; specifications specification status pointer events obsolete ...
Document: pointerup event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerup examples using addeventlistener(): document.addeventlistener('pointerup', (event) => { console.log('pointer up'); }); using the onpointerup event handler property: document.onpointerup = (event) => { console.log('pointer up'); }; specifications specification status pointer events obsolete ...
Document: transitionend event - Web APIs
bubbles yes cancelable yes interface transitionevent event handler property ontransitionend the transitionend event is fired in both directions - as it finishes transitioning to the transitioned state, and when it fully reverts to the default or non-transitioned state.
Document.visibilityState - Web APIs
typical use of this can be to prevent the download of some assets when the document is solely prerendered, or stop some activities when the document is in the background or minimized.
Document: wheel event - Web APIs
<div>scale me with your mouse wheel.</div> body { min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; } div { width: 105px; height: 105px; background: #cdf; padding: 5px; } function zoom(event) { event.preventdefault(); if (event.deltay < 0) { // zoom in scale *= event.deltay * -2; } else { // zoom out scale /= event.deltay * 2; } // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale transform el.style.transform = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); document.onwheel = zoom; addeventlistener equiva...
Document - Web APIs
WebAPIDocument
globaleventhandlers.onerror is an onerroreventhandler representing the code to be called when the error event is raised.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
example this example inserts line breaks wherever you click.
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
syntax object.mselementsfromrect(left, top, width, height, retval) parameters left [in] type: floating-point top[in] type: floating-point width[in] type: floating-point height [in] type: floating-point retval [out, reval] type: nodelist example to find all of the elements under a given point, use mselementsfrompoint(x, y).
Examples of web and XML development using the DOM - Web APIs
wherever possible, the examples use common apis, tricks, and patterns in javascript for manipulating the document object.
How to create a DOM tree - Web APIs
you can automate the creation of a dom tree using a jxon reverse algorithm in association with the following json representation: { "people": { "person": [{ "address": [{ "@street": "321 south st", "@city": "denver", "@state": "co", "@country": "usa" }, { "@street": "123 main st", "@city": "arlington", "@state": "ma", "@country": "usa" }], "@first-name": "eric", ...
DynamicsCompressorNode() - Web APIs
the dynamicscompressornode() constructor creates a new dynamicscompressornode object which provides a compression effect, which lowers the volume of the loudest parts of the signal, in order to help prevent clipping and distortion.
DynamicsCompressorNode - Web APIs
the dynamicscompressornode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once.
EffectTiming.easing - Web APIs
var spriteframes = [ { transform: 'translatey(0)' }, { transform: 'translatey(-100%)' } ]; // get the element that represents alice and the red queen var redqueen_alice_sprite = document.getelementbyid('red-queen_and_alice_sprite'); // animate alice and the red queen using steps() var redqueen_alice = redqueen_alice_sprite.animate( spriteframes, { easing: 'steps(7, end)', direction: "reverse", duration: 600, playbackrate: 1, iterations: infinity }); specifications specification status comment web animationsthe definition of 'easing' in that specification.
EffectTiming - Web APIs
direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
Element: beforescriptexecute event - Web APIs
cancelling the event prevents the script from executing.
Element.getAttributeNode() - Web APIs
common node attributes like parentnode, previoussibling, and nextsibling are null for an attr node.
Element.getBoundingClientRect() - Web APIs
with ie and edge, not being able to add missing properties to their returned clientrect, object prevents backfilling x and y.
Element.hasPointerCapture() - Web APIs
syntax targetelement.haspointercapture(pointerid); parameters pointerid the pointerid of a pointerevent object.
Element.localName - Web APIs
WebAPIElementlocalName
in previous dom specifications this api was defined within the node interface.
Element: mouseenter event - Web APIs
#mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetarget'); const unorderedlist = document.getelementbyid('unorderedlist'); mousetarget.addeventlistener('mouseenter', e => { mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave',...
Element: mouseleave event - Web APIs
#mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetarget'); const unorderedlist = document.getelementbyid('unorderedlist'); mousetarget.addeventlistener('mouseenter', e => { mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave',...
Element: webkitmouseforcewillbegin event - Web APIs
to instruct macos not to engage any default force touch actions if the user apply enough pressure to activate a force touch event, call preventdefault() on the webkitmouseforcewillbegin event object.
Element: wheel event - Web APIs
<div>scale me with your mouse wheel.</div> body { min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; } div { width: 105px; height: 105px; background: #cdf; padding: 5px; } function zoom(event) { event.preventdefault(); scale += event.deltay * -0.01; // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale transform el.style.transform = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); el.onwheel = zoom; addeventlistener equivalent the event handler can also be set up using the addeventlistener() method: el.addeventlistener('wheel', ...
Comparison of Event Targets - Web APIs
entbyid('target').innerhtml = e.target; document.getelementbyid('relatedtarget').innerhtml = e.relatedtarget; } document.addeventlistener('click', handleclicks, false); document.addeventlistener('mouseover', handlemouseover, false); </script> </body> </html> use of target and relatedtarget the relatedtarget property for the mouseover event holds the node that the mouse was previously over.
Event.cancelBubble - Web APIs
setting its value to true before returning from an event handler prevents propagation of the event.
Event.eventPhase - Web APIs
WebAPIEventeventPhase
event.bubbling_phase 3 the event is propagating back up through the target's ancestors in reverse order, starting with the parent, and eventually reaching the containing window.
Event.stopImmediatePropagation() - Web APIs
the stopimmediatepropagation() method of the event interface prevents other listeners of the same event from being called.
EventSource: error event - Web APIs
bubbles no cancelable no interface event or errorevent event handler property eventsource.onerror examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('error', (e) => { console.log("an error occurred while attempting to connect."); }); // onerror version evtsource.onerror = (e) => { console.log("an error occurred while attempting to connect."); }; specifications specification status html living standardthe definition of 'error event' in that specification.
EventTarget.dispatchEvent() - Web APIs
return value the return value is false if event is cancelable and at least one of the event handlers which received event called event.preventdefault().
EventTarget - Web APIs
0, l = stack.length; i < l; i++) { if (stack[i] === callback){ stack.splice(i, 1); return; } } }; eventtarget.prototype.dispatchevent = function(event) { if (!(event.type in this.listeners)) { return true; } var stack = this.listeners[event.type].slice(); for (var i = 0, l = stack.length; i < l; i++) { stack[i].call(this, event); } return !event.defaultprevented; }; specifications specification status comment domthe definition of 'eventtarget' in that specification.
FetchEvent() - Web APIs
preloadresponse read only a promise which returns a previously-loaded response to the client.
FetchEvent.resultingClientId - Web APIs
the resultingclientid read-only property of the fetchevent interface is the id of the client that replaces the previous client during a page navigation.
FileError - Web APIs
WebAPIFileError
no_modification_allowed_err 6 the state of the underlying file system prevents any writing to a file or a directory.
FileException - Web APIs
no_modification_allowed_err 6 the state of the underlying file system prevents any writing to a file or a directory.
FileSystemFlags - Web APIs
note that these option flags currently don't have any useful meaning when used in the scope of web content, where security precautions prevent the creation of new files or the replacement of existing ones.
FileHandle API - Web APIs
api overview this api is based on the following interfaces: idbdatabase.mozcreatefilehandle (was called idbdatabase.mozcreatefilehandle.) idbmutablefile (was previously filehandle.) lockedfile filerequest it also has connections with the file api, especially the file and blob interfaces.
File and Directory Entries API - Web APIs
asynchronous api the asynchronous api should be used for most operations, to prevent file system accesses from blocking the entire browser if used on the main thread.
Force Touch events - Web APIs
its main use is that it can be event.preventdefault()ed.
FormDataEvent.formData - Web APIs
examples // grab reference to form const formelem = document.queryselector('form'); // submit handler formelem.addeventlistener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit th...
FormDataEvent - Web APIs
examples // grab reference to form const formelem = document.queryselector('form'); // submit handler formelem.addeventlistener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit th...
GainNode - Web APIs
WebAPIGainNode
to prevent this from happening, never change the value directly but use the exponential interpolation methods on the audioparam interface.
GamepadHapticActuator.pulse() - Web APIs
note: repeated calls to pulse() override the previous calls if they are still ongoing.
Geolocation.clearWatch() - Web APIs
the geolocation.clearwatch() method is used to unregister location/error monitoring handlers previously installed using geolocation.watchposition().
Geolocation - Web APIs
geolocation.clearwatch() secure context removes the particular handler previously installed using watchposition().
Geolocation API - Web APIs
interfaces geolocation the main class of this api — contains methods to retrieve the user's current position, watch for changes in their position, and clear a previously-set watch.
GlobalEventHandlers.oncancel - Web APIs
this event handler prevents the event from bubbling, so any parent handlers are not notified of the event.
GlobalEventHandlers.ondrag - Web APIs
urce { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code>ondrop</code>, <code>ondragstart</code>, <code>ondragover</code></h1> <div> <!-- <div class="source"> --> <p id="source" ondrag="drag_han...
GlobalEventHandlers.ondragend - Web APIs
) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragenter_handler(ev) { console.log("dragenter"); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) {...
GlobalEventHandlers.ondragenter - Web APIs
) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragenter_handler(ev) { console.log("dragenter"); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) {...
GlobalEventHandlers.ondragexit - Web APIs
) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragenter_handler(ev) { console.log("dragenter"); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) {...
GlobalEventHandlers.ondragleave - Web APIs
) { console.log("dragstart"); // change the source element's border to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's background color to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragenter_handler(ev) { console.log("dragenter"); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) {...
GlobalEventHandlers.ondragover - Web APIs
urce { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code>ondrop</code>, <code>ondragstart</code>, <code>ondragover</code></h1> <div> <p id="source" ondrag="drag_handler(event);" ondragstart="dra...
GlobalEventHandlers.ondragstart - Web APIs
urce { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code>ondrop</code>, <code>ondragstart</code>, <code>ondragover</code></h1> <div> <p id="source" ondrag="drag_handler(event);" ondragstart="dra...
GlobalEventHandlers.ondrop - Web APIs
urce { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code>ondrop</code>, <code>ondragstart</code>, <code>ondragover</code></h1> <div class="source"> <p id="source" ondrag="drag_handler(event);" o...
GlobalEventHandlers.onformdata - Web APIs
examples // grab reference to form const formelem = document.queryselector('form'); // submit handler formelem.addeventlistener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.onformdata = (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit the data via xhr ...
GlobalEventHandlers.ongotpointercapture - Web APIs
the function receives a pointerevent object as its sole argument.
GlobalEventHandlers.oninvalid - Web APIs
nt.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) { error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specification specification status comment html living standardthe definition of 'oninvalid' in that specification.
GlobalEventHandlers.onkeypress - Web APIs
html <label>enter numbers only: <input> </label> javascript function numbersonly(event) { return event.charcode === 0 || /\d/.test(string.fromcharcode(event.charcode)); } const input = document.queryselector('input'); input.onkeypress = numbersonly; // prevent pasting (since pasted content might include non-number characters) input.onpaste = event => false; result capture the typing of a hidden word the following javascript function will do something after the user types the word "exit" in any point of a page.
GlobalEventHandlers.onkeyup - Web APIs
the keyup event fires when the user releases a key that was previously pressed.
GlobalEventHandlers.onlostpointercapture - Web APIs
the function receives a pointerevent object as its sole argument.
GlobalEventHandlers.onsubmit - Web APIs
nt.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) { error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specifications specification status comment html living standardthe definition of 'onsubmit' in that specification.
GlobalEventHandlers.onwheel - Web APIs
html <div>scale me with your mouse wheel.</div> css body { min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center; } div { width: 80px; height: 80px; background: #cdf; padding: 5px; transition: transform .3s; } javascript function zoom(event) { event.preventdefault(); if (event.deltay < 0) { // zoom in scale *= event.deltay * -2; } else { // zoom out scale /= event.deltay * 2; } // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale transform el.style.transform = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); document.onwheel = zoom; result specification ...
GlobalEventHandlers - Web APIs
globaleventhandlers.onerror is an onerroreventhandler representing the code to be called when the error event is raised.
HTMLCanvasElement.toBlob() - Web APIs
var canvas = document.getelementbyid('canvas'); canvas.toblob(function(blob) { var newimg = document.createelement('img'), url = url.createobjecturl(blob); newimg.onload = function() { // no longer need to read the blob so it's revoked url.revokeobjecturl(url); }; newimg.src = url; document.body.appendchild(newimg); }); note that here we're creating a png image; if you add a second parameter to the toblob() call, you can specify the image type.
HTMLCanvasElement.toDataURL() - Web APIs
color in this example): html <img class="grayscale" src="mypicture.png" alt="description of my picture" /> javascript window.addeventlistener('load', removecolors); function showcolorimg() { this.style.display = 'none'; this.nextsibling.style.display = 'inline'; } function showgrayimg() { this.previoussibling.style.display = 'inline'; this.style.display = 'none'; } function removecolors() { var aimages = document.getelementsbyclassname('grayscale'), nimgslen = aimages.length, ocanvas = document.createelement('canvas'), octx = ocanvas.getcontext('2d'); for (var nwidth, nheight, oimgdata, ograyimg, npixel, apix, npixlen, nimgid = 0; nimgid < nimgslen; nimgid++) { ...
HTMLDetailsElement: toggle event - Web APIs
</details> </section> css body { display: flex; flex-direction: row-reverse; } #log { flex-shrink: 0; padding-left: 3em; } #summaries { flex-grow: 1; } javascript function logitem(e) { const item = document.queryselector(`[data-id=${e.target.id}]`); item.toggleattribute('hidden'); } const chapters = document.queryselectorall('details'); chapters.foreach((chapter) => { chapter.addeventlistener('toggle', logitem); }); result specifications ...
HTMLElement: gotpointercapture event - Web APIs
bubbles yes cancelable no interface pointerevent event handler property ongotpointercapture examples this example gets a <p> element and listens for the gotpointercapture event.
HTMLElement.hidden - Web APIs
appropriate use cases for hidden include: content that isn't yet relevant but may be needed later content that was previously needed but is not any longer content that is reused by other parts of the page in a template-like fashion creating an offscreen canvas as a drawing buffer inappropriate use cases include: hiding panels in a tabbed dialog box hiding content in one presentation while intending it to be visible in others elements that are not hidden must not link to elements which are.
inert - Web APIs
WebAPIHTMLElementinert
according to the spec: when a node is inert, then the user agent must act as if the node was absent for the purposes of targeting user interaction events, may ignore the node for the purposes of text search user interfaces (commonly known as "find in page"), and may prevent the user from selecting text in that node.
HTMLElement: lostpointercapture event - Web APIs
bubbles yes cancelable no interface pointerevent event handler property onlostpointercapture examples this example listens for the lostpointercapture event for an element, and captures the pointer for the element on pointerdown.
HTMLElement.oncopy - Web APIs
html <h3>play with this text area:</h3> <textarea id="editor" rows="3">try copying and pasting text into this field!</textarea> <h3>log:</h3> <p id="log"></p> javascript const log = document.getelementbyid('log'); function logcopy(event) { log.innertext = 'copy blocked!\n' + log.innertext; event.preventdefault(); } function logpaste(event) { log.innertext = 'paste blocked!\n' + log.innertext; event.preventdefault(); } const editor = document.getelementbyid('editor'); editor.oncopy = logcopy; editor.onpaste = logpaste; result specification whatwg standard ...
HTMLElement.oncut - Web APIs
WebAPIHTMLElementoncut
html <h3>play with this text area:</h3> <textarea id="editor" rows="3">try copying and cutting the text in this field!</textarea> <h3>log:</h3> <p id="log"></p> javascript function logcopy(event) { log.innertext = 'copied!\n' + log.innertext; } function preventcut(event) { event.preventdefault(); log.innertext = 'cut blocked!\n' + log.innertext; } const editor = document.getelementbyid('editor'); const log = document.getelementbyid('log'); editor.oncopy = logcopy; editor.oncut = preventcut; result specification whatwg standard ...
HTMLElement: pointerdown event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerdown examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerdown', (event) => { console.log('pointer down event'); }); using the onpointerdown event handler property: const para = document.queryselector('p'); para.onpointerdown = (event) => { console.log('pointer down event'); }; s...
HTMLElement: pointerenter event - Web APIs
bubbles no cancelable no interface pointerevent event handler property onpointerenter examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerenter', (event) => { console.log('pointer entered element'); }); using the onpointerenter event handler property: const para = document.queryselector('p'); para.onpointerenter = (event) => { console.log('pointer entered element'); }; specifications specification status pointer event...
HTMLElement: pointerleave event - Web APIs
bubbles no cancelable no interface pointerevent event handler property onpointerleave examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerleave', (event) => { console.log('pointer left element'); }); using the onpointerleave event handler property: const para = document.queryselector('p'); para.onpointerleave = (event) => { console.log('pointer left element'); }; specifications specification status pointer events obsolete ...
HTMLElement: pointermove event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more.
HTMLElement: pointerout event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerout examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerout', (event) => { console.log('pointer moved out'); }); using the onpointerout event handler property: const para = document.queryselector('p'); para.onpointerout = (event) => { console.log('pointer moved out'); }; specifi...
HTMLElement: pointerover event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerover examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerover', (event) => { console.log('pointer moved in'); }); using the onpointerover event handler property: const para = document.queryselector('p'); para.onpointerover = (event) => { console.log('pointer moved in'); }; specifications specification status pointer events obsolete ...
HTMLElement: pointerup event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointerup examples using addeventlistener(): const para = document.queryselector('p'); para.addeventlistener('pointerup', (event) => { console.log('pointer up'); }); using the onpointerup event handler property: const para = document.queryselector('p'); para.onpointerup = (event) => { console.log('pointer up'); }; specifications specification status pointer events obsolete ...
HTMLElement: transitionend event - Web APIs
bubbles yes cancelable yes interface transitionevent event handler property ontransitionend the transitionend event is fired in both directions - as it finishes transitioning to the transitioned state, and when it fully reverts to the default or non-transitioned state.
HTMLFormElement: formdata event - Web APIs
general info bubbles no cancelable no interface formdataevent event handler property globaleventhandlers.onformdata examples // grab reference to form const formelem = document.queryselector('form'); // submit handler formelem.addeventlistener('submit', (e) => { // on form submission, prevent default e.preventdefault(); // construct a formdata object, which fires the formdata event new formdata(formelem); }); // formdata handler to retrieve data formelem.addeventlistener('formdata', (e) => { console.log('formdata fired'); // get the form data from the event object let data = e.formdata; for (var value of data.values()) { console.log(value); } // submit th...
HTMLFrameSetElement - Web APIs
recommendation snapshot of a previous html living standard frames are now obsolete.
HTMLImageElement.alt - Web APIs
html in the html for this example, shown below, the <img> element includes the alt property, which will prevent the image from having any alternate text, since it's simply a decorational detail.
HTMLImageElement.complete - Web APIs
the image element has previously determined that the image is fully available and ready for use.
HTMLImageElement.decode() - Web APIs
this, in turn, prevents the rendering of the next frame after adding the image to the dom from causing a delay while the image loads.
HTMLInputElement - Web APIs
possible values are: on: the browser can autocomplete the value using previously stored value off: the user must explicity enter a value max string: returns / sets the element's max attribute, containing the maximum (numeric or date-time) value for this item, which must not be less than its minimum (min attribute) value.
HTMLMediaElement.autoplay - Web APIs
note: some browsers offer users the ability to override autoplay in order to prevent disruptive audio or video from playing without permission or in the background.
HTMLMediaElement.initialTime - Web APIs
specifications this was previously defined within the whatwg html living standard, though was removed because of missing use cases.
HTMLObjectElement.typeMustMatch - Web APIs
recommendation the w3c specification is a latest of a previous version of html living standard first snapshot with this property.
HTMLObjectElement - Web APIs
recommendation the w3c specification is a latest of a previous version of html living standard technically, the property tabindex is now defined on htmlelement.
HTMLOrForeignElement.nonce - Web APIs
nonce hiding helps preventing that attackers exfiltrate nonce data via mechanisms that can grab data from content attributes like this: script[nonce~=whatever] { background: url("https://evil.com/nonce?whatever"); } specifications specification html living standardthe definition of 'nonce' in that specification.
HTMLTableCellElement - Web APIs
usually the value of abbr is an abbreviation or acronym, but can be any text that's appropriate contextually.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
the addition of queuemicrotask(), exposing it to web developers, creates a unified queue for microtasks which is used wherever it's necessary to have the ability to schedule code to run safely when there are no execution contexts left on the javascript execution context stack.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
microtask from a function this example expands slightly on the previous one by adding a function that does some work.
The HTML DOM API - Web APIs
domstringlist domstringmap errorevent htmlallcollection mimetype mimetypearray promiserejectionevent interfaces belonging to other apis several interfaces are technically defined in the html specification while actually being part of other apis.
Dragging and Dropping Multiple Items - Web APIs
} catch (ex) { output("<<error>>\n"); dump(ex); } } } } function output(text) { document.getelementbyid("output").textcontent += text; dump(text); } </script> </head> <body> <div id="output" style="min-height: 100px; white-space: pre; border: 1px solid black;" ondragenter="document.getelementbyid('output').textcontent = ''; event.stoppropagation(); event.preventdefault();" ondragover="event.stoppropagation(); event.preventdefault();" ondrop="event.stoppropagation(); event.preventdefault(); dodrop(event);"> <div> fix</div> </div> </body> </html> this example cancels both the dragenter and dragover events by calling the preventdefault().
HashChangeEvent.oldURL - Web APIs
the oldurl read-only property of the hashchangeevent interface returns the previous url from which the window was navigated.
HashChangeEvent - Web APIs
hashchangeevent.oldurl read only the previous url from which the window was navigated.
History.back() - Web APIs
WebAPIHistoryback
if there is no previous page, this method call does nothing.
History.scrollRestoration - Web APIs
const scrollrestoration = history.scrollrestoration if (scrollrestoration === 'manual') { console.log('the location on the page is not restored, user will need to scroll manually.'); } prevent automatic page location restoration if (history.scrollrestoration) { history.scrollrestoration = 'manual'; } specifications specification status comment html living standardthe definition of 'scroll restoration mode' in that specification.
IDBCursor.continue() - Web APIs
the key is greater than or equal to this cursor's position and this cursor's direction is prev or prevunique.
IDBDatabase.createObjectStore() - Web APIs
has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) constrainterror an object store with the given name (based on case-sensitive comparison) already exists in the connected database.
IDBDatabase.deleteObjectStore() - Web APIs
has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror you are trying to delete an object store that does not exist.
IDBDatabase.onversionchange - Web APIs
que: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; db.onversionchange = function(event) { note.innerhtml += '<li>a database change has occurred; you should refresh this browser window, or close it down and use the other open version of this application, wherever it exists.</li>'; }; }; specifications specification status comment indexed database api 2.0the definition of 'onversionchange' in that specification.
IDBEnvironment - Web APIs
important: the indexeddb property that was previously defined in this mixin is instead now windoworworkerglobalscope.indexeddb (that is, defined as a member of the windoworworkerglobalscope mixin).
IDBObjectStore.createIndex() - Web APIs
has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) example in the following example you can see the idbopendbrequest.onupgradeneeded handler being used to update the database structure if a database with a higher version number is loaded.
IDBObjectStore.deleteIndex() - Web APIs
has been deleted or removed.) in firefox previous to version 41, an invalidstateerror was raised in this case as well, which was misleading; this has now been fixed (see bug 1176165.) notfounderror occurs if there is no index with the given name (case-sensitive) in the database.
IDBObjectStore.openCursor() - Web APIs
valid values are "next", "nextunique", "prev", and "prevunique".
IDBObjectStore.openKeyCursor() - Web APIs
valid values are "next", "nextunique", "prev", and "prevunique".
IDBOpenDBRequest.onupgradeneeded - Web APIs
request.onupgradeneeded = function(event) { db = request.result; db.onerror = function(errorevent) { note.innerhtml += '<li>error loading database.</li>'; }; if (event.oldversion < 1) { // version 1 is the first version of the database.
IDBTransaction.oncomplete - Web APIs
previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
IIRFilterNode - Web APIs
as an iir filter, the non-zero input continues forever, but this can be limited after some finite time in practice, when the output has approached zero closely enough.
ImageBitmapRenderingContext.transferFromImageBitmap() - Web APIs
this method was previously named transferimagebitmap(), but was renamed in a spec change.
ImageBitmapRenderingContext - Web APIs
this was previously named transferimagebitmap(), but was renamed in a spec change.
IndexedDB API - Web APIs
they are still documented in case you need to update previously written code: idbversionchangerequest represents a request to change the version of a database.
InstallTrigger - Web APIs
compareversion compares the version of a file or package with the version of an existing file or package.
IntersectionObserverEntry.target - Web APIs
syntax var target = intersectionobserverentry.target; value the intersectionobserverentry's target property specifies which element previously targeted by calling intersectionobserver.observe() experienced a change in intersection with the root.
KeyboardEvent - Web APIs
in the case of ui events, this is important for security reasons, as it prevents scripts from simulating user actions that interact with the browser itself.
KeyframeEffect.KeyframeEffect() - Web APIs
direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
KeyframeEffect.iterationComposite - Web APIs
accumulate subsequent iterations of the keyframeeffect build on the final value of the previous iteration.
LayoutShiftAttribution - Web APIs
layoutshiftattribution.previousrect returns a domrect representing the position of the element before the shift.
LocalMediaStream - Web APIs
this interface was previously part of media capture and streams but was removed in 2013.
Location: ancestorOrigins - Web APIs
the ancestororigins read-only property of the location interface is a static domstringlist containing, in reverse order, the origins of all ancestor browsing contexts of the document associated with the given location object.
Lock - Web APIs
WebAPILock
the lock interface of the the web locks api provides the name and mode of a previously requested lock, which is received in the callback to lockmanager.request().
MIDIConnectionEvent - Web APIs
this occurs any time a new port becomes available, or when a previously available port becomes unavailable.
MSManipulationEvent.initMSManipulationEvent() - Web APIs
cancelablearg [in] type: boolean indicates whether the event’s default action can be prevented.
MediaDevices.getDisplayMedia() - Web APIs
notreadableerror the user selected a screen, window, tab, or other source of screen data, but a hardware or operating system level error or lockout occurred, preventing the sharing of the selected source.
MediaMetadata.MediaMetadata() - Web APIs
host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } specifications specification status comment media session standardthe definition of 'mediametadata()' in that specification.
MediaPositionState.duration - Web APIs
for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
MediaPositionState.position - Web APIs
for example, a browser might use this information along with the position property and the navigator.mediasession.playbackstate, as well as the session's metadata to provide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
MediaPositionState - Web APIs
negative values indicate that the media is playing in reverse; -1 indicates playback at the normal speed but backward, -2 is double speed in reverse, and so on.
MediaQueryList - Web APIs
this method has been kept for backward compatibility; if possible, you should generally use removeeventlistener() to remove change notification callbacks (which should have previously been added using addeventlistener()).
MediaRecorder: error event - Web APIs
bubbles no cancelable no interface mediarecordererrorevent event handler property onerror for details of the all the possible errors see the documentation for the event handler property: onerror.
MediaRecorder.resume() - Web APIs
the mediarecorder.resume() method (part of the mediarecorder api) is used to resume media recording when it has been previously paused.
MediaSession.metadata - Web APIs
host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } specifications specification status comment media session standardthe definition of 'mediasession.metadata' in that specification.
MediaSession - Web APIs
host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } the following example sets up event handlers for pausing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; navigator.mediasession.setactionhandler('play', play); navigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); naviga...
Media Session action types - Web APIs
previoustrack moves back to the previous track.
MediaSessionActionDetails.action - Web APIs
previoustrack moves back to the previous track.
MediaSource.clearLiveSeekableRange() - Web APIs
the clearliveseekablerange() method of the mediasource interface clears a seekable range previously set with a call to setliveseekablerange().
MediaSource - Web APIs
mediasource.clearliveseekablerange() clears a seekable range previously set with a call to setliveseekablerange().
MediaStreamTrack: ended event - Web APIs
the user revoked the permissions needed for the data to be sent.
MediaStreamTrack.onended - Web APIs
this event occurs when the track will no longer provide data to the stream for any reason, including the end of the media input being reached, the user revoking needed permissions, the source device being removed, or the remote peer ending a connection.
MediaStreamTrack.onoverconstrained - Web APIs
an event handler always has one single parameter, containing the event, here of type mediastreamerrorevent.
MediaTrackSettings.echoCancellation - Web APIs
echo cancellation is a feature which attempts to prevent echo effects on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their input device.
MediaTrackSettings - Web APIs
these values will adhere as closely as possible to any constraints previously described using a mediatrackconstraints object and set using applyconstraints(), and will adhere to the default constraints for any properties whose constraints haven't been changed, or whose customized constraints couldn't be matched.
Media Session API - Web APIs
*/ }); navigator.mediasession.setactionhandler('previoustrack', function() { /* code excerpted.
Media Source API - Web APIs
this is in direct contrast with previous streaming solutions that required expensive licenses for proprietary non-standard client/server protocol implementations.
Capabilities, constraints, and settings - Web APIs
function keydownhandler(event) { if (event.key == "tab") { let elem = event.target; let str = elem.value; let position = elem.selectionstart; let newstr = str.substring(0, position) + " " + str.substring(position, str.length); elem.value = newstr; elem.selectionstart = elem.selectionend = position + 2; event.preventdefault(); } } videoconstrainteditor.addeventlistener("keydown", keydownhandler, false); audioconstrainteditor.addeventlistener("keydown", keydownhandler, false); show constrainable properties the browser supports the last significant piece of the puzzle: code that displays, for the user's reference, a list of the constrainable properties which their browser supports.
MerchantValidationEvent.complete() - Web APIs
the merchantvalidationevent method complete() takes merchant-specific information previously received from the validationurl and uses it to validate the merchant.
MouseEvent.initMouseEvent() - Web APIs
cancelable whether or not the event's default action can be prevented.
MouseEvent.pageX - Web APIs
WebAPIMouseEventpageX
see browser compatibility to learn which browsers have been updated to use the revised data type.
MouseEvent.which - Web APIs
WebAPIMouseEventwhich
syntax var buttonpressed = instanceofmouseevent.which return value a number representing a given button: 0: no button 1: left button 2: middle button (if present) 3: right button for a mouse configured for left-handed use, the button actions are reversed.
msPlayToPreferredSourceUri - Web APIs
o = document.createelement('video'); document.body.appendchild(video); video.src = "http://www.contoso.com/videos/video.mp4"; video.msplaytopreferredsourceuri = "http://www.contoso.com/catalogid=1234"; see also microsoft playready content access and protection technology is a set of technologies that can be used to distribute audio/video content more securely over a network, and help prevent the unauthorized use of this content.
MutationEvent - Web APIs
moreover, removing the listeners does not reverse the damage.
MutationObserver.MutationObserver() - Web APIs
the attribute name is in mutation.attributename, and its previous value is in mutation.oldvalue.
MutationObserver.observe() - Web APIs
this prevents you from missing changes that occur after the connection is severed and before you have a chance to specifically begin monitoring the moved node or subtree for changes.
MutationObserverInit.attributeFilter - Web APIs
note the use of mutationrecord.oldvalue to get the previous value of the "username" property so we have that information when doing lookups in our local array of users.
MutationObserverInit.attributeOldValue - Web APIs
when observe() is called, the specified options are attributes and attributeoldvalue, which means that changes to attribute values will be reported, and each mutation record will include the oldvalue property specifying the attribute's previous value.
MutationObserverInit.characterData - Web APIs
you can expand the capabilities of attribute mutation monitoring using other options: characterdataoldvalue lets you specify whether or not you want the previous value of changed text nodes to be provided using the mutationrecord's oldvalue property.
MutationObserverInit.characterDataOldValue - Web APIs
the mutationobserverinit dictionary's optional characterdataoldvalue property is used to specify whether or not the mutationrecord.oldvalue property for dom mutations should be set to the previous value of text nodes which changed.
MutationRecord - Web APIs
mutationrecord.previoussibling node return the previous sibling of the added or removed nodes, or null.
NameList - Web APIs
WebAPINameList
note: although this interface was previously implemented in gecko, there was no way to actually create one.
Navigator.cookieEnabled - Web APIs
note: web browsers may prevent writing certain cookies in certain scenarios.
Navigator.sendBeacon() - Web APIs
there is nothing the next page can do to avoid this, so the new page seems slow, even though it's the previous page's fault.
Navigator.vibrate() - Web APIs
WebAPINavigatorvibrate
if a vibration pattern is already in progress when this method is called, the previous pattern is halted and the new one begins instead.
Navigator.wakeLock - Web APIs
while a screen wake lock is active, the user agent will try to prevent the device from dimming the screen, turning it off completely, or showing a screensaver.
Navigator - Web APIs
WebAPINavigator
navigator.wakelock read only returns a wakelock interface you can use to request screen wake locks and prevent screen from dimming, turning off, or showing a screen saver.
NavigatorID.userAgent - Web APIs
gecko-based browsers comply with the following general structure: useragent = appcodename/appversion number (platform; security; os-or-cpu; localization; rv: revision-version-number) product/productsub application-name application-name-version example alert(window.navigator.useragent) // alerts "mozilla/5.0 (windows; u; win98; en-us; rv:0.9.2) gecko/20010725 netscape6/6.1" specifications specification status comment html living standardthe definition of 'navigatorid.useragent' in that specification.
Online and offline events - Web APIs
both events are non-cancellable (you can't prevent the user from coming online, or going offline).
Node.getUserData() - Web APIs
WebAPINodegetUserData
the node.getuserdata() method returns any user domuserdata set previously on the given node by node.setuserdata().
Node.insertBefore() - Web APIs
WebAPINodeinsertBefore
in the previous example, sp1 could be inserted after sp2 using: parentdiv.insertbefore(sp1, sp2.nextsibling) if sp2 does not have a next sibling, then it must be the last child — sp2.nextsibling returns null, and sp1 is inserted at the end of the child node list (immediately after sp2).
Node.nextSibling - Web APIs
WebAPINodenextSibling
therefore a node obtained, for example, using node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get.
Node.rootNode - Web APIs
WebAPINoderootNode
therefore a node obtained, for example, using node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get.
Node.textContent - Web APIs
WebAPINodetextContent
moreover, using textcontent can prevent xss attacks.
Node - Web APIs
WebAPINode
node.previoussiblingread only returns a node representing the previous node in the tree, or null if there isn't such node.
Notification.onerror - Web APIs
these events occur when something goes wrong with a notification (in many cases an error preventing the notification from being displayed.) syntax notification.onerror = function() { ...
Notification.requestPermission() - Web APIs
}); previously, the syntax was based on a simple callback; this version is now deprecated: notification.requestpermission(callback); parameters callback optional deprecated since gecko 46 an optional callback function that is called with the permission value.
OfflineAudioContext - Web APIs
deprecated methods offlineaudiocontext.resume() resumes the progression of time in an audio context that has previously been suspended.
OffscreenCanvas - Web APIs
a call to imagebitmaprenderingcontext.transferfromimagebitmap() with the previously rendered and saved imagebitmap from the offscreencanvas, will display the imagebitmap on the canvas and transfer its ownership to the canvas.
PannerNode.refDistance - Web APIs
r.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay immediately and fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower and later than the previous one scheduletesttone(4, context.currenttime + note_length); // this tone should decay only slightly, and only start decaying fairly late scheduletesttone(7, context.currenttime + note_length * 2); after running this code, the resulting waveforms should look something like this: specifications specification status comment web audio apithe definition of 'refdistance...
PannerNode.rolloffFactor - Web APIs
schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower than the previous one scheduletesttone(0.5, context.currenttime + note_length); // this tone should decay only slightly scheduletesttone(0.1, context.currenttime + note_length * 2); after running this code, the resulting waveforms should look something like this: specifications specification status comment web audio apithe definition of 'rollofffactor' in that specification.
PannerNode - Web APIs
in a previous version of the specification, the pannernode had a velocity that could pitch up or down audiobuffersourcenodes connected downstream.
PasswordCredential.additionalData - Web APIs
//the options object was previously created.
Path2D - Web APIs
WebAPIPath2D
path2d.arcto() adds a circular arc to the path with the given control points and radius, connected to the previous point by a straight line.
PaymentRequest: shippingaddresschange event - Web APIs
that is, the paymentaddress which contains the shipping address may have some portions of its content altered, obscured, or left out entirely in order to prevent identifying the user without their consent (since if they choose to have you ship products to them, you'll need their address).
PaymentRequest: shippingoptionchange event - Web APIs
the revised total is submitted back to the payment request by calling the event's updatewith() method.
PaymentRequestEvent.respondWith() - Web APIs
the respondwith property of the paymentrequestevent interface prevents the default event handling and allows you to provide a promise for a paymentresponse object yourself.
PaymentRequestEvent - Web APIs
respondwith() prevents the default event handling and allows you to provide a promise for a paymentresponse object yourself.
PaymentResponse.complete() - Web APIs
// initialization of paymentrequest arguments are excerpted for the // sake of brevity.
PaymentResponse - Web APIs
allows the developer to revalidate any requested user data (e.g., the phone number or the email address) if it changes.
performance.now() - Web APIs
WebAPIPerformancenow
coop process-isolates your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks.
PerformanceTiming.unloadEventEnd - Web APIs
if there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0.
PerformanceTiming.unloadEventStart - Web APIs
if there is no previous document, or if the previous document, or one of the needed redirects, is not of the same origin, the value returned is 0.
Permissions API - Web APIs
permissions provides the core permission api functionality, such as methods for querying and revoking permissions.
Multi-touch interaction - Web APIs
to prevent the browser's default touch behavior from overriding this application's pointer handling, the touch-action property is applied to the <body> element.
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
this is provided by the relying party's server if it wants to prevent creation of new credentials for an existing user.
PublicKeyCredentialCreationOptions.extensions - Web APIs
in other words, this may be used server side to check if the current operation is based on the same biometric data that the previous authentication.
PublicKeyCredentialRequestOptions.extensions - Web APIs
in other words, this may be used server side to check if the current operation is based on the same biometric data that the previous authentication.
PushManager - Web APIs
note: this interface replaces functionality previously offered by the obsolete pushregistrationmanager interface.
Web Push API Notifications best practices - Web APIs
this at least prevents the user from getting spontaneously asked this question on web pages thaty've only glanced at once may rarely if ever look at again.
Push API - Web APIs
WebAPIPush API
see the following articles for more information: cross-site request forgery (csrf) prevention cheat sheet preventing csrf and xsrf attacks for an app to receive push messages, it has to have an active service worker.
RTCDTMFSender.insertDTMF() - Web APIs
calling insertdtmf() will append the specified tones to the end of the current tone buffer, so that those tones play after the previously-enqueued tones.
RTCDTMFSender: tonechange event - Web APIs
the tonechange event is sent to an rtcdtmfsender by the webrtc api to indicate when dtmf tones previously queued for sending (by calling rtcdtmfsender.insertdtmf()) begin and end.
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
options a dictionary of type rtcdtmftonechangeeventinit, which may contain one or more of the following fields: tone a domstring containing a single dtmf tone character which has just begun to play, or an empty string ("") to indicate that the previous tone has stopped playing.
RTCDataChannel: error event - Web APIs
bubbles yes cancelable no interface rtcerrorevent event handler property onerror the rtcerrorevent object provides details about the error that occurred; see that article for details.
RTCDataChannel.readyState - Web APIs
it is no longer possible to queue new messages to be sent, but previously queued messages may still be send or received before entering the "closed" state.
RTCDataChannel - Web APIs
when an error occurs on the data channel, the function receives as input an errorevent object describing the error which occurred.onmessage the rtcdatachannel.onmessage property stores an eventhandler which specifies a function to be called when the message event is fired on the channel.
RTCIceCandidate.priority - Web APIs
example this candidate examines the priority of the candidate and, if it's greater than the priority of a previously-seen candidate, remembers the candidate for later use.
RTCIceCandidateStats.address - Web APIs
usage notes the address property was previously known as ip, and only permitted ipv4 and ipv6 addresses to be used.
RTCIceCandidateStats - Web APIs
this property was previously named ip and only accepted ip addresses.
RTCIceTransport.getSelectedCandidatePair() - Web APIs
as ice negotiation continues, any time a pair of candidates is discovered that is better than the currently-selected pair, the new pair is selected, replacing the previous pairing, and the selectedcandidatepairchange event is fired again.
RTCIceTransport.state - Web APIs
the transport may revert from the "connected" state to the "checking" state if either peer decides to cancel consent to use the selected candidate pair, and may revert to "disconnected" if there are no candidates left to check but one or both clients are still gathering candidates.
RTCIceTransportState - Web APIs
the transport may revert from the "connected" state to the "checking" state if either peer decides to cancel consent to use the selected candidate pair, and may revert to "disconnected" if there are no candidates left to check but one or both clients are still gathering candidates.
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
this can happen if the packets covered by the fec packets have already been received successfully or have already been reconstructed using a previously-received fec packet.
RTCPeerConnection.close() - Web APIs
make sure that you delete all references to the previous rtcpeerconnection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser.
RTCPeerConnection.getStats() - Web APIs
obsolete syntax previously, getstats() used success and failure callbacks to report the results to you, instead of using a promise.
RTCPeerConnection.iceGatheringState - Web APIs
if something happens that requires collecting new candidates, such as a new interface being added or the addition of a new ice server, the state will revert to "gathering" to gather those candidates.
RTCPeerConnection: icecandidate event - Web APIs
as you see in the code in the previous section, every candidate is sent to the other peer, including any that might have an empty candidate string.
RTCPeerConnection: idpassertionerror event - Web APIs
bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpassertionerror warning: this event is no longer used; instead, you can detect an assertion error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected.
RTCPeerConnection: idpvalidationerror event - Web APIs
bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror warning: this event is no longer used; instead, you can detect a validation error by detecting when the promise returned by rtcpeerconnection.peeridentity is rejected.
RTCPeerConnection.onicecandidateerror - Web APIs
syntax rtcpeerconnection.onicecandidateerror = eventhandler; value this should be set to a function you provide which is passed a single parameter: an rtcpeerconnectioniceerrorevent object describing the icecandidateerror event.
RTCPeerConnection.setConfiguration() - Web APIs
this prevents successful login to the server.
RTCPeerConnection.signalingState - Web APIs
"have-remote-pranswer" a provisional answer has been received and successfully applied in response to an offer previously sent and established by calling setlocaldescription().
RTCPeerConnection: idpvalidationerror event - Web APIs
bubbles no cancelable no interface rtcidentityerrorevent event handler property onidpvalidationerror important: this event is no longer used; it was removed from the specification long ago.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
we use the findreportentry() function described in the previous section for that, storing the located inbound-rtp records in startinboundstats and endinboundstats.
RTCRtpSendParameters - Web APIs
transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
RTCRtpSender.setParameters() - Web APIs
transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
RTCRtpStreamStats.kind - Web APIs
this property was previously called mediatype.
RTCRtpStreamStats - Web APIs
previously called mediatype.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
this lets you prevent the use of codecs you don't wish to use.
RTCSessionDescription.sdp - Web APIs
iondescription.sdp = value; value the value is a domstring containing an sdp message like this one: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 example // the remote description has been set previously on pc, an rtcpeerconnection alert(pc.remotedescription.sdp); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.sdp' in that specification.
RTCSessionDescription.type - Web APIs
example // the remote description has been set previously on pc, a rtcpeerconnection alert(pc.remotedescription.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.type' in that specification.
ReadableByteStreamController.close() - Web APIs
note: readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed.
ReadableStream.getReader() - Web APIs
examples in the following simple example, a previously-created custom readablestream is read using a readablestreamdefaultreader created using getreader().
ReadableStreamDefaultController.close() - Web APIs
readers will still be able to read any previously-enqueued chunks from the stream, but once those are read, the stream will become closed.
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
examples in the following simple example, a previously-created custom readablestream is read using a readablestreamdefaultreader created using getreader().
ReadableStreamDefaultReader.cancel() - Web APIs
examples in the following simple example, a previously-created custom readablestream is read using a readablestreamdefaultreader created using getreader().
ReadableStreamDefaultReader.closed - Web APIs
examples in this snippet, a previously-created reader is queried to see if the stream has been closed.
ReadableStreamDefaultReader.read() - Web APIs
in this example stream is a previously-created custom readablestream.
ReportingObserver.disconnect() - Web APIs
the disconnect() method of the reportingobserver interface stops a reporting observer that had previously started observing from collecting reports.
ReportingObserver - Web APIs
methods reportingobserver.disconnect() stops a reporting observer that had previously started observing from collecting reports.
Request.cache - Web APIs
WebAPIRequestcache
fetch("some.json", {cache: "force-cache"}) .then(function(response) { /* consume the response */ }); // naive stale-while-revalidate client-level implementation.
Resize Observer API - Web APIs
concepts and usage there are a whole raft of use cases for responsive design techniques (and others besides) that respond to changes in an element's size, but previously their implementations have often been hacky and/or brittle.
Response.redirected - Web APIs
relying on redirected to filter out redirects makes it easy for a forged redirect to prevent your content from working as expected.
RsaHashedKeyGenParams - Web APIs
this should be at least 2048: see for example see nist sp 800-131a rev.
SVGSVGElement - Web APIs
svgsvgelement.unsuspendredraw() cancels a specified suspendredraw() by providing a unique suspend handle id that was returned by a previous suspendredraw() call.
Screen.unlockOrientation() - Web APIs
the screen.unlockorientation() method removes all the previous screen locks set by the page/app.
Using the Screen Capture API - Web APIs
async function startcapture() { logelem.innerhtml = ""; try { videoelem.srcobject = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); dumpoptionsinfo(); } catch(err) { console.error("error: " + err); } } after clearing the contents of the log in order to get rid of any leftover text from the previous attempt to connect, startcapture() calls getdisplaymedia(), passing into it the constraints object defined by displaymediaoptions.
ScrollToOptions.behavior - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
ScrollToOptions.left - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
ScrollToOptions.top - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
ScrollToOptions - Web APIs
when the form is submitted, an event handler is run that puts the entered values into a scrolltooptions dictionary, and then invokes the window.scrollto() method, passing the dictionary as a parameter: form.addeventlistener('submit', (e) => { e.preventdefault(); var scrolloptions = { left: leftinput.value, top: topinput.value, behavior: scrollinput.checked ?
Selection.anchorNode - Web APIs
a user may make a selection from left to right (in document order) or right to left (reverse of document order).
Selection.focusNode - Web APIs
a user may make a selection from left to right (in document order) or right to left (reverse of document order).
Selection.selectAllChildren() - Web APIs
previous selection is lost.
Selection.setBaseAndExtent() - Web APIs
note: if the focus position appears before the anchor position in the document, the direction of the selection is reversed — the caret is placed at the beginning of the text rather the end, which matters for any keyboard command that might follow.
Sensor APIs - Web APIs
sensorerroreventsecure context provides information about errors thrown by a sensor or related interface.
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
previously, it was defined as the event interface that is fired whenever a push subscription has been invalidated (or is about to become so).
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
this may occur if the subscription was refreshed by the browser, but it may also happen if the subscription has been revoked or lost.
ServiceWorkerRegistration.update() - Web APIs
the fetch of the worker bypasses any browser caches if the previous fetch occurred over 24 hours ago.
SharedWorker - Web APIs
abstractworker.onerror is an eventlistener that is called whenever an errorevent of type error bubbles through the worker.
SourceBuffer.changeType() - Web APIs
invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still being processed.
SpeechRecognition: error event - Web APIs
bubbles no cancelable no interface speechrecognitionerrorevent event handler property onerror examples you can use the error event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('error', function(event) { console.log('speech recognition error detected: ' + event.error'); }); or use the onerror event handler property: recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error'); } specifications specification status comment web speech apithe definit...
SpeechRecognitionError.error - Web APIs
this speechrecognitionerror interface was renamed to speechrecognitionerrorevent in the web speech api specification.
SpeechRecognitionError.message - Web APIs
this speechrecognitionerror interface was renamed to speechrecognitionerrorevent in the web speech api specification.
SpeechRecognitionError - Web APIs
this speechrecognitionerror interface was renamed to speechrecognitionerrorevent in the web speech api specification.
SpeechSynthesis.speak() - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); inputtxt.blur(); } specifications specification status comment ...
SpeechSynthesisUtterance.SpeechSynthesisUtterance() - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); inputtxt.blur(); } specifications specification status comment ...
SpeechSynthesisUtterance.lang - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.lang = 'en-us'; synth.speak(utterthis); inputtxt.blur(); } specifications specificat...
SpeechSynthesisUtterance.onboundary - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onboundary = function(event) { console.log(event.name + ' boundary ...
SpeechSynthesisUtterance.onend - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onend = function(event) { console.log('utterance has finished being...
SpeechSynthesisUtterance.onmark - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onmark = function(event) { console.log('a mark was reached: ' + eve...
SpeechSynthesisUtterance.onpause - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onpause = function(event) { console.log('speech paused after ' + ev...
SpeechSynthesisUtterance.onresume - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onresume = function(event) { console.log('speech resumed after ' + ...
SpeechSynthesisUtterance.onstart - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onstart = function(event) { console.log('we have started uttering t...
SpeechSynthesisUtterance.pitch - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = 1.5; synth.speak(utterthis); inputtxt.blur(); } specifications specification...
SpeechSynthesisUtterance.rate - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.rate = 1.5; synth.speak(utterthis); inputtxt.blur(); } specifications specification ...
SpeechSynthesisUtterance.text - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } console.log(utterthis.text); synth.speak(utterthis); inputtxt.blur(); } specifications specifi...
SpeechSynthesisUtterance.voice - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); inputtxt.blur(); } specifications specification status comment ...
SpeechSynthesisUtterance.volume - Web APIs
inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.volume = 0.5; synth.speak(utterthis); inputtxt.blur(); } specifications specificatio...
SpeechSynthesisVoice - Web APIs
ces[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = pitch.value; utterthis.rate = rate.value; synth.speak(utterthis); utterthis.onpause ...
StorageEstimate.quota - Web APIs
this value is an estimate to help prevent its use for fingerprinting—that is, identifying a device using an amalgamation of the values of seemingly innocuous properties.
StorageEstimate.usage - Web APIs
the value is an estimate because the user agent may use compression, duplication prevention techniques, and other methods to improve storage efficiency.
StorageEstimate - Web APIs
these values are only estimates for several reasons, including both performance and preventing storage capacity data from being used for fingerprinting purposes.
StorageEvent - Web APIs
the oldvalue is null when the key has been newly added and therefore doesn't have any previous value.
Using the Storage Access API - Web APIs
if that call returns false, we can then call document.requeststorageaccess(), returning the result so that then we can chain it onto the previous promise call.
Streams API - Web APIs
previously, if we wanted to process a resource of some kind (be it a video, or a text file, etc.), we'd have to download the entire file, wait for it to be deserialized into a suitable format, then process the whole lot after it is fully received.
StyleSheet.disabled - Web APIs
the disabled property of the stylesheet interface determines whether the style sheet is prevented from applying to the document.
TextDecoder.prototype.encoding - Web APIs
it is used to prevent attacks that mismatch encodings between the client and server.
TextEncoder.prototype.encodeInto() - Web APIs
if your wasm program uses c strings, it's your responsibility to write the 0x00 sentinel and you can't prevent your wasm program from seeing a logically truncated string if the javascript string contained u+0000.
TextRange - Web APIs
WebAPITextRange
textrange.pastehtml() paste the html content into the given range and replace any previous text and html elements in the range.
Touch() - Web APIs
WebAPITouchTouch
(for example, the user agent may use the rotationangle value from the previous touch event, to avoid sudden changes.).
Touch.pageX - Web APIs
WebAPITouchpageX
var i; for (i=0; i < e.changedtouches.length; i++) { console.log("touchpoint[" + i + "].pagex = " + e.changedtouches[i].pagex); console.log("touchpoint[" + i + "].pagey = " + e.changedtouches[i].pagey); } }, false); specifications specification status comment touch events – level 2 draft no change from the previous version.
Touch.radiusX - Web APIs
WebAPITouchradiusX
</div> var src = document.getelementbyid("src"); src.addeventlistener('touchstart', rotate); src.addeventlistener('touchmove', rotate); src.addeventlistener('touchend', rotate); function rotate (e) { var touch = e.changedtouches.item(0); // turn off default event handling e.preventdefault(); // rotate element 'src'.
TransformStream - Web APIs
let responses = [ /* conjoined response tree */ ] let {readable, writable} = new transformstream responses.reduce( (a, res, i, arr) => a.then(() => res.pipeto(writable, {preventclose: (i+1) !== arr.length})), promise.resolve() ) note that this is not resilient to other influences.
URLUtilsReadOnly - Web APIs
the obsolete urlutilsreadonly interface previously defined utility methods for working with urls.
USB - Web APIs
WebAPIUSB
event handlers usb.onconnect an event handler called whenever a previously paired device is connected.
User Timing API - Web APIs
interoperability as shown in the performance interface's browser compatibility table, the user timing methods are broadly implemented by desktop and mobile browsers (the only exceptions are desktop safari and mobile safari, however the safari technology preview 24 has support).
validityState.badInput - Web APIs
recommendation no change from the previous snapshot html5.
Visual Viewport API - Web APIs
the pendingupdate flag serves to prevent multiple invocations of the transfrom that can occur when onresize and onscroll fire at the same time.
WakeLock.request() - Web APIs
WebAPIWakeLockrequest
prevents devices from dimming or locking the screen.
WakeLock - Web APIs
WebAPIWakeLock
the wakelock interface of the screen wake lock api prevents device screens from dimming or locking when an application needs to keep running.
WakeLockSentinel.type - Web APIs
prevents devices from dimming or locking the screen.
WakeLockSentinel - Web APIs
prevents devices from dimming or locking the screen.
WebGL2RenderingContext.texImage3D() - Web APIs
gl.byte gl.unsigned_short gl.short gl.unsigned_int gl.int gl.half_float gl.float gl.unsigned_int_2_10_10_10_rev gl.unsigned_int_10f_11f_11f_rev gl.unsigned_int_5_9_9_9_rev gl.unsigned_int_24_8 gl.float_32_unsigned_int_24_8_rev (pixels must be null) source one of the following objects can be used as a pixel source for the texture: arraybufferview, imagebitmap, imagedata, htmlimageelement, htmlcanvaselement, htmlvideoelement.
WebGL2RenderingContext.texSubImage3D() - Web APIs
gl.byte gl.unsigned_short gl.short gl.unsigned_int gl.int gl.half_float gl.float gl.unsigned_int_2_10_10_10_rev gl.unsigned_int_10f_11f_11f_rev gl.unsigned_int_5_9_9_9_rev gl.unsigned_int_24_8 gl.float_32_unsigned_int_24_8_rev (pixels must be null) pixels one of the following objects can be used as a pixel source for the texture: arraybufferview, a uint8array must be used if type is gl.unsigned_byte.
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
they are abbreviated in 2, 3, and 4, respectively.
WebGLRenderingContext.detachShader() - Web APIs
the webglrenderingcontext.detachshader() method of the webgl api detaches a previously attached webglshader from a webglprogram.
WebGLRenderingContext.finish() - Web APIs
the webglrenderingcontext.finish() method of the webgl api blocks execution until all previously called commands are finished.
WebGLRenderingContext.readPixels() - Web APIs
possible values: gl.unsigned_byte gl.unsigned_short_5_6_5 gl.unsigned_short_4_4_4_4 gl.unsigned_short_5_5_5_1 gl.float webgl2 adds gl.byte gl.unsigned_int_2_10_10_10_rev gl.half_float gl.short gl.unsigned_short gl.int gl.unsigned_int gl.unsigned_int_10f_11f_11f_rev gl.unsigned_int_5_9_9_9_rev pixels an arraybufferview object to read data into.
WebGLRenderingContext.texImage2D() - Web APIs
oes_texture_float extension: gl.float when using the oes_texture_half_float extension: ext.half_float_oes (constant provided by the extension) when using a webgl 2 context, the following values are available additionally: gl.byte gl.unsigned_short gl.short gl.unsigned_int gl.int gl.half_float gl.float gl.unsigned_int_2_10_10_10_rev gl.unsigned_int_10f_11f_11f_rev gl.unsigned_int_5_9_9_9_rev gl.unsigned_int_24_8 gl.float_32_unsigned_int_24_8_rev (pixels must be null) pixels one of the following objects can be used as a pixel source for the texture: arraybufferview, a uint8array must be used if type is gl.unsigned_byte.
WebGLRenderingContext.texSubImage2D() - Web APIs
when using the oes_texture_float extension: gl.float when using the oes_texture_half_float extension: gl.half_float_oes when using a webgl 2 context, the following values are available additionally: gl.byte gl.unsigned_short gl.short gl.unsigned_int gl.int gl.half_float gl.float gl.unsigned_int_2_10_10_10_rev gl.unsigned_int_10f_11f_11f_rev gl.unsigned_int_5_9_9_9_rev gl.unsigned_int_24_8 gl.float_32_unsigned_int_24_8_rev (pixels must be null) pixels one of the following objects can be used as a pixel source for the texture: arraybufferview, a uint8array must be used if type is gl.unsigned_byte.
WebGLRenderingContext - Web APIs
webglrenderingcontext.finish() blocks execution until all previously called commands are finished.
Using WebGL extensions - Web APIs
oes_ and khr_: extensions that mirror functionality from opengl es (oes) or opengl api extensions approved by the respective architecture review boards (khronos).
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
a good place to start if you don't have previous webgl experience.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
async function disablehold(micstream) { await audiotransceiver.sender.replacetrack(micstream.getaudiotracks()[0]); audiotransceiver.receiver.track.enabled = true; audiotransceiver.direction = "sendrecv"; } this reverses the steps taken in enablehold() as follows: the audio transceiver's rtcrtpsender's track is replaced with the specified stream's first audio track.
Lifetime of a WebRTC session - Web APIs
this article doesn't get into details of the actual apis involved in establishing and handling a webrtc connection; it simply reviews the process in general with some information about why each step is required.
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 purpose—to perform the computations needed for each frame to be rendered.
Lighting a WebXR setting - Web APIs
ambient light is commonly present simply to prevent shadowed areas from becoming too dark, although it affects the entire scene; however, the amount of ambient light in a scene should be very low.
WebXR performance guide - Web APIs
this section will combine information from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-depth-precision and https://github.com/immersive-web/webxr/blob/master/explainer.md#preventing-the-compositor-from-using-the-depth-buffer optimizing memory use when using libraries that perform things such as matrix mathematics, you typically have a number of working variables through which various vectors, matrices, and quaternions pass over time.
WebXR permissions and security - Web APIs
these mostly revolve around the fully-immersive immersive-vr session mode, but there are things to be aware of when setting up an ar session, as well.
WebXR Device API - Web APIs
geometry and reference spaces in webxr in this guide, the required concepts of 3d geometry are briefly reviewed, and the fundamentals of how that geometry is represented in webxr are detailed.
Web Audio API best practices - Web APIs
if for example, you want the gain value to be raised to 1 in 2 seconds time, you can do this: gainnode.gain.setvalueattime(1, audioctx.currenttime + 2); it will override the previous example (as it should), even if it were to come later in your code.
Example and tutorial: Simple synth keyboard - Web APIs
several octaves not shown for brevity ...
Visualizations with Web Audio API - Web APIs
creating a waveform/oscilloscope to create the oscilloscope visualisation (hat tip to soledad penadés for the original code in voice-change-o-matic), we first follow the standard pattern described in the previous section to set up the buffer: analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); next, we clear the canvas of what had been drawn on it before to get ready for the new visualization display: canvasctx.clearrect(0, 0, width, height); we now define the draw() function: function draw() { in here, we use requestanimationfram...
Attestation and Assertion - Web APIs
assertion when a user chooses to log into a service, the server sends a challenge and the authenticator signs over it with a key pair previously registered to that service.
Web Locks API - Web APIs
interfaces lock provides the name and mode of a previously requested lock, which is received in the callback to lockmanager.request().
Web Speech API - Web APIs
speechsynthesiserrorevent contains information about any errors that occur while processing speechsynthesisutterance objects in the speech service.
Functions and classes available to Web Workers - Web APIs
20 (20) no support no support no support url workers can use the static methods url.createobjecturl and url.revokeobjecturl with blob objects accesible to the worker.
The structured clone algorithm - Web APIs
it clones by recursing through the input object while maintaining a map of previously visited references, to avoid infinitely traversing cycles.
Window: afterprint event - Web APIs
the afterprint event is fired after the associated document has started printing or the print preview has been closed.
Window.alert() - Web APIs
WebAPIWindowalert
the following text is shared between this article, dom:window.prompt and dom:window.confirm dialog boxes are modal windows - they prevent the user from accessing the rest of the program's interface until the dialog box is closed.
Window.back() - Web APIs
WebAPIWindowback
the obsolete and non-standard method back() on the window interface returns the window to the previous item in the history.
Window: beforeprint event - Web APIs
the beforeprint event is fired when the associated document is about to be printed or previewed for printing.
window.cancelAnimationFrame() - Web APIs
the window.cancelanimationframe() method cancels an animation frame request previously scheduled through a call to window.requestanimationframe().
window.cancelIdleCallback() - Web APIs
summary the window.cancelidlecallback() method cancels a callback previously scheduled with window.requestidlecallback().
Window.closed - Web APIs
WebAPIWindowclosed
refreshing a previously opened popup in this example the function refreshpopupwindow() calls the reload() method of the popup's location object to refresh its data.
Window.confirm() - Web APIs
WebAPIWindowconfirm
example if (window.confirm("do you really want to leave?")) { window.open("exit.html", "thanks for visiting!"); } produces: notes the following text is shared between this article, dom:window.prompt and dom:window.alert dialog boxes are modal windows — they prevent the user from accessing the rest of the program's interface until the dialog box is closed.
Window.convertPointFromNodeToPage() - Web APIs
please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses).
Window.convertPointFromPageToNode - Web APIs
please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses).
Window.customElements - Web APIs
the customelements read-only property of the window interface returns a reference to the customelementregistry object, which can be used to register new custom elements and get information about previously registered custom elements.
window.dump() - Web APIs
WebAPIWindowdump
precompiled binaries are available in the zipped archive https://github.com/matthewkastor/redirector/archive/master.zip under redirector-master\gecko\console redirector\bin\release copy all the dll's and the exe to wherever you want.
Window.fullScreen - Web APIs
WebAPIWindowfullScreen
this is to prevent scripts designed to set this property in internet explorer from breaking.
window.location - Web APIs
WebAPIWindowlocation
note that security settings, like cors, may prevent this to effectively happen.
Window.onbeforeinstallprompt - Web APIs
window.addeventlistener("beforeinstallprompt", function(beforeinstallpromptevent) { beforeinstallpromptevent.preventdefault(); // prevents immediate prompt display // shows prompt after a user clicks an "install" button installbutton.addeventlistener("click", function(mouseevent) { // you should not use the mouseevent here, obviously beforeinstallpromptevent.prompt(); }); installbutton.hidden = false; // make button operable }); ...
Window.ondragdrop - Web APIs
WebAPIWindowondragdrop
note how event.stoppropagation(); prevents the browser from loading the dropped tab, link or file.
Window: online event - Web APIs
network problems or firewalls might still prevent the website from being reached.
Privileged features - Web APIs
the dependent feature is currently under revision to be removed (bug 214867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method.
Window.opener - Web APIs
WebAPIWindowopener
in modern browsers, a rel="noopener noreferrer" attribute on the originating <a> element will prevent the window.opener reference from being set, in which case this property will return null.
Window.pageYOffset - Web APIs
this prevents us from falling off the edge of the document.
Window: pagehide event - Web APIs
for example, when the user clicks the browser's back button, the current page receives a pagehide event before the previous page is shown.
Window.prompt() - Web APIs
WebAPIWindowprompt
the following text is shared between this article, dom:window.confirm and dom:window.alert dialog boxes are modal windows; they prevent the user from accessing the rest of the program's interface until the dialog box is closed.
Window: transitionend event - Web APIs
bubbles yes cancelable yes interface transitionevent event handler property ontransitionend the transitionend event is fired in both directions - as it finishes transitioning to the transitioned state, and when it fully reverts to the default or non-transitioned state.
WindowEventHandlers.onafterprint - Web APIs
the beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed.
WindowEventHandlers.onbeforeprint - Web APIs
the beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed.
WindowEventHandlers.onhashchange - Web APIs
oldurl domstring the previous url from which the window was navigated.
WindowOrWorkerGlobalScope.btoa() - Web APIs
h; i++) { codeunits[i] = string.charcodeat(i); } return string.fromcharcode(...new uint8array(codeunits.buffer)); } // a string that contains characters occupying > 1 byte const mystring = "☸☹☺☻☼☾☿"; const converted = tobinary(mystring); const encoded = btoa(converted); console.log(encoded); // ocy5jjomoyy8jj4mpyy= if you do this, of course you'll have to reverse the conversion on the decoded string: function frombinary(binary) { const bytes = new uint8array(binary.length); for (let i = 0; i < bytes.length; i++) { bytes[i] = binary.charcodeat(i); } return string.fromcharcode(...new uint16array(bytes.buffer)); } const decoded = atob(encoded); const original = frombinary(decoded); console.log(original); // ☸☹☺☻☼☾...
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
the clearinterval() method of the windoworworkerglobalscope mixin cancels a timed, repeating action which was previously established by a call to setinterval().
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
the cleartimeout() method of the windoworworkerglobalscope mixin cancels a timeout previously established by calling settimeout().
Worker - Web APIs
WebAPIWorker
event handlers abstractworker.onerror an eventlistener called whenever an errorevent of type error bubbles through to the worker.
WritableStream - Web APIs
calling close() too early can prevent data from being written.
WritableStreamDefaultWriter.close() - Web APIs
the underlying sink will finish processing any previously-written chunks, before invoking the close behavior.
XDomainRequest.send() - Web APIs
sends an xdomainrequest which has previously been opened calling xdomainrequest.open().
XDomainRequest - Web APIs
"http://example.com/api/method"); xdr.onprogress = function () { //progress }; xdr.ontimeout = function () { //timeout }; xdr.onerror = function () { //error occurred }; xdr.onload = function() { //success(xdr.responsetext); } settimeout(function () { xdr.send(); }, 0); } note: the xdr.send() call is wrapped in a timeout (see window.settimeout() to prevent an issue with the interface where some requests are lost if multiple xdomainrequests are being sent at the same time.
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
let nsserr = math.abs(nsinsserrorsservice.nss_sec_error_base) - (status & 0xffff); switch (nsserr) { case 11: // sec_error_expired_certificate, sec(11) errname = 'securityexpiredcertificateerror'; break; case 12: // sec_error_revoked_certificate, sec(12) errname = 'securityrevokedcertificateerror'; break; // per bsmith, we will be unable to tell these errors apart very soon, // so it makes sense to just folder them all together already.
Synchronous and asynchronous requests - Web APIs
example: using a timeout you can use a timeout to prevent your code from hanging while waiting for a read to finish.
XMLHttpRequest() - Web APIs
this only works in privileged (reviewed) apps (bug 692677); it does not work on arbitrary webpages loaded in firefox ...
XMLHttpRequest.getResponseHeader() - Web APIs
if there are multiple response headers with the same name, then their values are returned as a single concatenated string, where each value is separated from the previous one by a pair of comma and space.
XMLHttpRequest.mozBackgroundRequest - Web APIs
if true, no load group is associated with the request, with security dialogs prevented from being shown to the user.
XMLHttpRequestEventTarget - Web APIs
xmlhttprequesteventtarget.ontimeout contains the function that is called if the event times out and the timeout event is received by this object; this only happens if a timeout has been previously established by setting the value of the xmlhttprequest object's timeout attribute.
XMLSerializer.serializeToString() - Web APIs
this may mean that a previously-specified prefix or default namespace may be dropped or altered.
XRBoundedReferenceSpace - Web APIs
the specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the webxr site or application prevent the user from colliding with the walls or other obstacles in the real world.
XRReferenceSpace - Web APIs
{x: 0, y: 1, z: 0, w: 1}); xrreferencespace = xrreferencespace.getoffsetreferencespace(offsettransform); this replaces the xrreferencespace with a new one whose origin and orientation are adjusted to place the new origin at (2, 0, 1) relative to the current origin and rotated given a unit quaternion that orients the space to put the viewer facing straight up relative to the previous world orientation.
XRRigidTransform() - Web APIs
after creating an xrrigidtransform from the viewer's initial position and orientation, we pass the new transform into getoffsetreferencespace() to create another reference space, now offset so that its origin is located at the same place in space as the coordinates given by viewerposition, with the orientation also revised in the same fashion.
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.
XRRigidTransform - Web APIs
that is, if applied to an object that had been previously transformed by the original transform, it will undo the transform and return the original object.
XRSession.inputSources - Web APIs
you can then either get the value of inputsources to examine the list, or you can refer to a reference to the list that you've previously saved.
XRSession - Web APIs
WebAPIXRSession
cancelanimationframe() removes a callback from the animation frame painting callback from xrsession's set of animation frame rendering callbacks, given the identifying handle returned by a previous call to requestanimationframe().
XRSystem: isSessionSupported() - Web APIs
en((issupported) => { if (issupported) { userbutton.addeventlistener('click', onbuttonclicked); userbutton.innerhtml = 'enter xr'; userbutton.disabled = false; } }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then((session) => { xrsession = session; // onsessionstarted() not shown for reasons of brevity and clarity.
XRSystem: requestSession() - Web APIs
= 'enter xr'; immersivebutton.disabled = false; } else { console.log("webxr doesn't support immersive-vr mode!"); } }); } else { console.log("webxr is not available!"); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then((session) => { xrsession = session; // onsessionstarted() not shown for reasons of brevity and clarity.
XRViewport.y - Web APIs
WebAPIXRViewporty
note: although other web apis typically consider the y axis to begin at the top and grow larger progressing downward, webgl reverses this, with y growing larger as it goes upward on the screen.
XSLTProcessor - Web APIs
[throws] void xsltprocessor.removeparameter(string namespaceuri, string localname) removes the parameter if it was previously set.
msGetRegionContent - Web APIs
syntax var retval = element.msgetregioncontent(); parameters retval [out, reval] type: msrangecollection the name of the property to enable.
ARIA live regions - Accessibility
on subsequent calls, only the parts of the content that changed compared to the previous content will be announced.
Using the aria-invalid attribute - Accessibility
authors may prevent a form from being submitted.
Using the slider role - Accessibility
arrow keys should operate as follows (localization for right-to-left languages should reverse the direction of the arrows): key(s) action right and up arrows increase the selected value left and down arrows decrease the selected value page up and page down optionally increase and decrease the value by a set amount (e.g.
Using the status role - Accessibility
examples: notes aria attributes used status related aria techniques alert role live region roles live region attributes compatibility the paciello group published some data on compatibility via their 2014 blog post: screen reader support for aria live regions tbd: add updated support information for common ua and at product combinations additional resources previous recommendations from wai-aria 1.0 (2014) for the status role ...
ARIA: timer role - Accessibility
on subsequent calls, only the parts of the content that changed compared to the previous content will be announced.
ARIA: Comment role - Accessibility
the comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.
ARIA: switch role - Accessibility
this prevents elements that are used to construct the switch from being interacted with individually by assistive technologies.
ARIA: button role - Accessibility
id transparent; } button:active, button:focus, [role="button"][aria-pressed="true"] { border: 2px solid #000; } javascript function handlebtnclick(event) { togglebutton(event.target); } function handlebtnkeydown(event) { // check to see if space or enter were pressed if (event.key === " " || event.key === "enter" || event.key === "spacebar") { // "spacebar" for ie11 support // prevent the default action to stop scrolling when space is pressed event.preventdefault(); togglebutton(event.target); } } function togglebutton(element) { var audio = document.getelementbyid('audio'); // check to see if the button is pressed var pressed = (element.getattribute("aria-pressed") === "true"); // change aria-pressed to the opposite state element.setattribute("aria-pre...
ARIA: dialog role - Accessibility
<p> <label for="interests">interests</label> <textarea id="interests"></textarea> </p> <p> <input type="checkbox" id="autologin"/> <label for="autologin">auto-login?</label> </p> <p> <input type="submit" value="save information"/> </p> </form> </div> working examples: jquery-ui dialog notes note: while it is possible to prevent keyboard users from moving focus to elements outside of the dialog, screen reader users may still be able to navigate to that content using their screen reader's virtual cursor.
ARIA: textbox role - Accessibility
the placeholder should be visible when the control's value is the empty string such as when the control first receives focus and when users remove a previously-entered value.
WAI-ARIA Roles - Accessibility
elements containing role="checkbox" must also include the aria-checked attribute to expose the checkbox's state to assistive technology.aria: comment rolethe comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.aria: complementary rolethe complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated.
Web applications and ARIA FAQ - Accessibility
document.getelementbyid("update-button").addeventlistener("click", function (e) { updateprogress(75); e.preventdefault(); }, false); } initdemo(); how do assistive technologies work?
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 purposes, in addition to form controls.
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
“days” could easily be “months” or “years”, and in many ordinary dialogs, there is no way to find this out other than navigating around with screen reviewing commands.
Accessibility Information for Web Authors - Accessibility
rather than providing a complex technical report, wave 4.0 shows the original web page with embedded icons and indicators that reveal the accessibility information within your page.
Perceivable - Accessibility
"swipe from the right hand side of the screen to reveal the menu" some users might not be able to swipe the screen, either due to disability or because their device does not support touch.
-moz-user-focus - CSS: Cascading Style Sheets
you can stop the textbox from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of mousedown events.
:-moz-ui-invalid - CSS: Cascading Style Sheets
however, if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid.
:-moz-ui-valid - CSS: Cascading Style Sheets
however, if the user is trying to correct a previously-flagged value, the control shows immediately when the value becomes valid.
::-moz-page-sequence - CSS: Cascading Style Sheets
the ::-moz-page-sequence css pseudo-element is a mozilla extension that represents the background of a print preview.
::-moz-page - CSS: Cascading Style Sheets
the ::-moz-page css pseudo-element is a mozilla extension that represents an individual page when printed or in a print preview.
::-moz-scrolled-page-sequence - CSS: Cascading Style Sheets
the ::-moz-scrolled-page-sequence css pseudo-element is a mozilla extension that represents the background of a print preview.
::-webkit-search-results-button - CSS: Cascading Style Sheets
the ::-webkit-search-results-button css pseudo-element represents a button (the "search results button") at the left edge of an <input> of type="search" which when clicked displays a menu which allows the user to choose from previous recent search queries.
::first-letter (:first-letter) - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of '::first-letter' in that specification.
::first-line (:first-line) - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of '::first-line' in that specification.
:active - CSS: Cascading Style Sheets
WebCSS:active
css level 2 (revision 1)the definition of ':active' in that specification.
:first-child - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of ':first-child' in that specification.
:first - CSS: Cascading Style Sheets
WebCSS:first
css level 2 (revision 1)the definition of ':first' in that specification.
:focus - CSS: Cascading Style Sheets
WebCSS:focus
css level 2 (revision 1)the definition of ':focus' in that specification.
:has() - CSS: Cascading Style Sheets
WebCSS:has
in earlier revisions of the css selectors level 4 specification, :has had a limitation that it couldn't be used within stylesheets.
:hover - CSS: Cascading Style Sheets
WebCSS:hover
css level 2 (revision 1)the definition of ':hover' in that specification.
:lang() - CSS: Cascading Style Sheets
WebCSS:lang
css level 2 (revision 1)the definition of ':lang()' in that specification.
:left - CSS: Cascading Style Sheets
WebCSS:left
css level 2 (revision 1)the definition of ':left' in that specification.
:link - CSS: Cascading Style Sheets
WebCSS:link
css level 2 (revision 1)the definition of ':link' in that specification.
:not() - CSS: Cascading Style Sheets
WebCSS:not
since it prevents specific items from being selected, it is known as the negation pseudo-class.
:right - CSS: Cascading Style Sheets
WebCSS:right
css level 2 (revision 1)the definition of ':right' in that specification.
:visited - CSS: Cascading Style Sheets
WebCSS:visited
css level 2 (revision 1)the definition of ':visited' in that specification.
@charset - CSS: Cascading Style Sheets
WebCSS@charset
e utf-8 */ @charset 'iso-8859-15'; /* invalid, wrong quoting style used */ @charset "utf-8"; /* invalid, more than one space */ @charset "utf-8"; /* invalid, there is a character (a space) before the at-rule */ @charset utf-8; /* invalid, without ' or ", the charset is not a css <string> */ specifications specification status comment css level 2 (revision 1)the definition of '@charset' in that specification.
font-weight - CSS: Cascading Style Sheets
to prevent this, use font-synthesis property.
@import - CSS: Cascading Style Sheets
WebCSS@import
css level 2 (revision 1)the definition of '@import' in that specification.
aural - CSS: Cascading Style Sheets
WebCSS@mediaaural
examples basic example @media aural { body { voice-family: paul } } specifications specification status comment css level 2 (revision 2)the definition of 'aural' in that specification.
marks - CSS: Cascading Style Sheets
WebCSS@pagemarks
working draft initial definition this css property was initially proposed in css level 2, but was dropped from css level 2 (revision 1).
user-zoom - CSS: Cascading Style Sheets
accessibility concerns disabling zooming capabilities prevents people experiencing low vision conditions from being able to read and understand page content.
Adjacent sibling combinator - CSS: Cascading Style Sheets
recommendation css level 2 (revision 1)the definition of 'adjacent sibling selectors' in that specification.
Attribute selectors - CSS: Cascading Style Sheets
recommendation css level 2 (revision 1)the definition of 'attribute selectors' in that specification.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
some css that's not important (the style of the "run" button itself) isn't shown here, for brevity.
Using CSS animations - CSS: Cascading Style Sheets
adding another keyframe let’s add another keyframe to the previous example’s animation.
Using multiple backgrounds - CSS: Cascading Style Sheets
d-repeat: no-repeat, no-repeat, no-repeat; background-position: bottom right, left, right; } result (if image does not appear in codepen, click the 'tidy' button in the css section) as you can see here, the firefox logo (listed first within background-image) is on top, directly above the bubbles graphic, followed by the gradient (listed last) sitting underneath all previous 'images'.
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
specifications specification status comment css backgrounds and borders module level 3 candidate recommendation css level 2 (revision 1) recommendation css level 1 recommendation ...
CSS Basic User Interface - CSS: Cascading Style Sheets
specifications specification status comment css basic user interface module level 4 working draft css basic user interface module level 3 recommendation css level 2 (revision 1) recommendation initial definition.
Mastering margin collapsing - CSS: Cascading Style Sheets
it and the text above.</p> <p>my bottom margin collapses with my parent, yielding a bottom margin of <code>2rem</code>.</p> </div> <p>i am <code>2rem</code> below the element above.</p> css div { margin: 2rem 0; background: lavender; } p { margin: .4rem 0 1.2rem 0; background: yellow; } result specifications specification status comment css level 2 (revision 1)the definition of 'margin collapsing' in that specification.
CSS Basic Box Model - CSS: Cascading Style Sheets
specifications specification status comment css basic box model working draft added margin-trim css level 2 (revision 1) recommendation css level 1 recommendation initial definition.
CSS Charsets - CSS: Cascading Style Sheets
reference at-rules @charset specifications specification status comment css level 2 (revision 1)the definition of '@charset' in that specification.
CSS Color - CSS: Cascading Style Sheets
WebCSSCSS Color
specifications specification status comment css color module level 4 working draft css color module level 3 recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
Handling content breaks in multicol - CSS: Cascading Style Sheets
this property takes values of: auto avoid avoid-page avoid-column avoid-region in the example below, we have applied break-inside to the figure element to prevent the caption from becoming separated from the image.
Spanning and Balancing Columns - CSS: Cascading Style Sheets
note the spanning and balancing functionality covered in this guide is not as well supported across browsers as the functionality covered in the previous two sections in this guide.
CSS Containment - CSS: Cascading Style Sheets
the main use case is to prevent situations where a css counter could be changed in an element, which could then affect the rest of the tree.
CSS Display - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'display' in that specification.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
a small item won’t shrink to zero before a larger item has been noticeably reduced.” the second reason is that flexbox prevents small items from shrinking to zero size during this removal of negative free space.
Block and inline layout in normal flow - CSS: Cascading Style Sheets
the flex items in the previous example become flex level boxes, so their outer display type is dictated by way of them being part of the flex formatting context.
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
css fonts module level 3 candidate recommendation adds font-feature-settings (and related higher-level properties) css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
CSS Generated Content - CSS: Cascading Style Sheets
reference properties content quotes specifications specification status comment css generated content module level 3 working draft css level 2 (revision 1) recommendation initial definition ...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
having done this, grid will now backfill the gaps, as it moves through the grid it leaves gaps as before, but then if it finds an item that will fit in a previous gap it will pick it up and take it out of dom order to place it in the gap.
Basic Concepts of grid layout - CSS: Cascading Style Sheets
grid is a powerful specification that, when combined with other parts of css such as flexbox, can help you create layouts that were previously impossible to build in css.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
one of the very nice things about grid layout is this ability to have white space in our designs without having to push things around using margins to prevent floats from rising up into the space we have left.
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
there are some key differences with how a grid layout works over the grid systems you may have used previously.
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
a grid container as parent if the absolutely positioned child has a grid container as a parent but that container does not create a new positioning context, then it is taken out of flow as in the previous example.
Subgrid - CSS: Cascading Style Sheets
no implicit grid in a subgridded dimension if you need to autoplace items, and do not know how many items you will have, take care when creating a subgrid, as it will prevent additional rows being created to hold those items.
Using CSS gradients - CSS: Cascading Style Sheets
<div class="radial-ellipse-side"></div> div { width: 240px; height: 100px; } .radial-ellipse-side { background: radial-gradient(ellipse closest-side, red, yellow 10%, #1e90ff 50%, beige); } example: farthest-corner for ellipses this example is similar to the previous one, except that its size is specified as farthest-corner, which sets the size of the gradient by the distance from the starting point to the farthest corner of the enclosing box from the starting point.
CSS Images - CSS: Cascading Style Sheets
candidate recommendation css level 2 (revision 1)the definition of '<uri>' in that specification.
Using CSS counters - CSS: Cascading Style Sheets
working draft no change css level 2 (revision 1)the definition of 'css counters' in that specification.
CSS Lists - CSS: Cascading Style Sheets
specifications specification status comment css lists module level 3 working draft css level 2 (revision 1) recommendation initial definition ...
CSS Logical Properties and Values - CSS: Cascading Style Sheets
the module also defines logical properties and values for properties previously defined in css 2.1.
CSS Motion Path - CSS: Cascading Style Sheets
the idea is that when you want to animate an element moving along a path, you previously only had animating translation, position, etc.
CSS Overflow - CSS: Cascading Style Sheets
working draft changed syntax to allow one or two keywords instead of only one css level 2 (revision 1)the definition of 'overflow' in that specification.
CSS Paged Media - CSS: Cascading Style Sheets
WebCSSCSS Pages
reference css properties page-break-after page-break-before page-break-inside at-rules @page pseudo-classes :blank :first :left :right specifications specification status comment css paged media module level 3 working draft css fragmentation module level 3 candidate recommendation css level 2 (revision 1) recommendation ...
Understanding CSS z-index - CSS: Cascading Style Sheets
last updated date: july 9, 2005 author's note: thanks to wladimir palant and rod whiteley for the review.
CSS Positioned Layout - CSS: Cascading Style Sheets
specifications specification status comment css positioned layout module level 3 working draft css level 2 (revision 1) recommendation ...
CSS Scroll Snap - CSS: Cascading Style Sheets
note: the previous version of this module was called scroll snap points and has been deprecated.
CSS selectors - CSS: Cascading Style Sheets
additional attribute selectors css level 2 (revision 1) recommendation added the > child and + adjacent sibling combinators.
Shapes From Images - CSS: Cascading Style Sheets
due to this requirement for cors compatible images, if you are previewing your file locally without using a local web server, your shape will not work.
CSS Table - CSS: Cascading Style Sheets
WebCSSCSS Table
reference properties border-collapse border-spacing caption-side empty-cells table-layout vertical-align specifications specification status comment css level 2 (revision 1) recommendation initial definition ...
CSS Text - CSS: Cascading Style Sheets
WebCSSCSS Text
css text module level 3 working draft css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
CSS Text Decoration - CSS: Cascading Style Sheets
ick">this text has a really thick purple underline in supporting browsers.</p> <p class="blink">this text might blink for you, depending on the browser you use.</p> specifications specification status comment css text decoration module level 4 working draft css text decoration module level 3 candidate recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
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 proposed recommendation css level 2 (revision 1) recommendation css level 1 recommendation initial definition ...
Child combinator - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'child selectors' in that specification.
Class selectors - CSS: Cascading Style Sheets
recommendation css level 2 (revision 1)the definition of 'child selectors' in that specification.
Descendant combinator - CSS: Cascading Style Sheets
recommendation css level 2 (revision 1)the definition of 'descendant selectors' in that specification.
ID selectors - CSS: Cascading Style Sheets
recommendation css level 2 (revision 1)the definition of 'id selectors' in that specification.
Card - CSS: Cascading Style Sheets
when setting up the single column grid i use the following: .card { display: grid; grid-template-rows: max-content 200px 1fr; } the heading track is set to max-content, which prevents it from stretching.
Sticky footers - CSS: Cascading Style Sheets
then we set our main content to flex-grow: 1 and the other two elements to flex-shrink: 0 — this prevents them from shrinking smaller when content fills the main area.
Testing media queries programmatically - CSS: Cascading Style Sheets
ending query notifications to stop receiving notifications about changes to the value of your media query, call removelistener() on the mediaquerylist, passing it the name of the previously-defined callback function: mediaquerylist.removelistener(handleorientationchange); ...
Media queries - CSS: Cascading Style Sheets
specifications specification status comment media queries level 5 editor's draft css conditional rules module level 3 candidate recommendation media queries level 4 candidate recommendation media queries recommendation css level 2 (revision 1) recommendation initial definition ...
Microsoft CSS extensions - CSS: Cascading Style Sheets
scroll-limit-y-max -ms-scroll-limit-y-min -ms-scroll-rails -ms-scroll-snap-points-x -ms-scroll-snap-points-y -ms-scroll-snap-x -ms-scroll-snap-y -ms-scroll-translation -ms-text-autospace -ms-touch-select -ms-wrap-flow -ms-wrap-margin -ms-wrap-through zoom pseudo-elements ::-ms-browse ::-ms-check ::-ms-clear ::-ms-expand ::-ms-fill ::-ms-fill-lower ::-ms-fill-upper ::-ms-reveal ::-ms-thumb ::-ms-ticks-after ::-ms-ticks-before ::-ms-tooltip ::-ms-track ::-ms-value media features -ms-high-contrast css-related dom apis mscontentzoomfactor msgetpropertyenabled msgetregioncontent msrangecollection msregionoverflow ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
d] -moz-transition-delay [prefixed version still accepted] -moz-transition-duration [prefixed version still accepted] -moz-transition-property [prefixed version still accepted] -moz-transition-timing-function [prefixed version still accepted] -moz-user-select values global values -moz-initial -moz-appearance button button-arrow-down button-arrow-next button-arrow-previous button-arrow-up button-bevel checkbox checkbox-container checkbox-label checkmenuitem dialog groupbox listbox menuarrow menucheckbox menuimage menuitem menuitemtext menulist menulist-button menulist-text menulist-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar -moz-win-borderless-glass -moz-win-browsertabbar-toolbox -moz-win-communications-toolbox...
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
reak-beforepage-break-insidepaint()paint-orderpath()pc<percentage>perspectiveperspective()perspective-originplace-contentplace-itemsplace-self::placeholderpointer-eventspolygon()<position>positionprefix (@counter-style)ptpxqqquotesrradradial-gradient()range (@counter-style)<ratio>:read-only:read-writerect()remrepeat()repeating-linear-gradient()repeating-radial-gradient():requiredresize<resolution>revertrgb()rgba():rightright@right-bottom:rootrotaterotate()rotate3d()rotatex()rotatey()rotatez()row-gapsssaturate()scalescale()scale3d()scalex()scaley()scalez():scopescroll-behaviorscroll-marginscroll-margin-blockscroll-margin-block-endscroll-margin-block-startscroll-margin-bottomscroll-margin-inlinescroll-margin-inline-endscroll-margin-inline-startscroll-margin-leftscroll-margin-rightscroll-margin-...
Specificity - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'calculating a selector's specificity' in that specification.
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
the last declaration of a block doesn't need to be terminated by a semi-colon, though it is often considered good style to do it as it prevents forgetting to add it when extending the block with another declaration.
Type selectors - CSS: Cascading Style Sheets
recommendation no changes css level 2 (revision 1)the definition of 'type selectors' in that specification.
Universal selectors - CSS: Cascading Style Sheets
recommendation defines behavior regarding namespaces and adds hint that omitting the selector is allowed within pseudo-elements css level 2 (revision 1)the definition of 'universal selector' in that specification.
Value definition syntax - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'value definition syntax' in that specification.
Viewport concepts - CSS: Cascading Style Sheets
when the user pinch-zooms the page, pops open a dynamic keyboard, or when a previously hidden address bar becomes visible, the visual viewport shrinks but the layout viewport is unchanged.
WebKit CSS extensions - CSS: Cascading Style Sheets
ge-set()) -webkit-mask-attachment -webkit-match-nearest-mail-blockquote-color -webkit-overflow-scrolling -webkit-region-break-after -webkit-region-break-before -webkit-region-break-inside -webkit-region-fragment -webkit-shape-inside -webkit-touch-callout (see touch-action) background-origin-x (unprefixed!) background-origin-y (unprefixed!) * still supported in the safari technology preview, but not in a generally released browser.
Actual value - CSS: Cascading Style Sheets
specifications specification status comment css level 2 (revision 1)the definition of 'actual value' in that specification.
animation-iteration-count - CSS: Cascading Style Sheets
values infinite the animation will repeat forever.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
value browser description button-arrow-down firefox removed in firefox 64 button-arrow-next firefox removed in firefox 64 button-arrow-previous firefox removed in firefox 64 button-arrow-up firefox removed in firefox 64 button-focus firefox removed in firefox 64 dualbutton firefox removed in firefox 64 groupbox firefox removed in firefox 64 menuarrow firefox removed in firefox 64 menubar firefox removed in firef...
attr() - CSS: Cascading Style Sheets
WebCSSattr
css level 2 (revision 1)the definition of 'attr()' in that specification.
background-attachment - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'background-attachment' in that specification.
background-color - CSS: Cascading Style Sheets
though technically removing the transparent keyword, this doesn't change anything as it has been incorporated as a true <color> backgrounds level 3 github issues css level 2 (revision 1)the definition of 'background-color' in that specification.
background-position - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'background-position' in that specification.
background-repeat - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'background-repeat' in that specification.
background - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'background' in that specification.
border-bottom-color - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-bottom-color' in that specification.
border-bottom-style - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-bottom-style' in that specification.
border-bottom-width - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-bottom-width' in that specification.
border-bottom - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-bottom' in that specification.
border-collapse - CSS: Cascading Style Sheets
der-color: orange blue; } .gk { border-color: black red; } .ed { border-color: blue gold; } .tr { border-color: aqua; } .sa { border-color: silver blue; } .wk { border-color: gold blue; } .ch { border-color: red yellow green blue; } .bk { border-color: navy blue teal aqua; } .op { border-color: red; } result specifications specification status comment css level 2 (revision 1)the definition of 'border-collapse' in that specification.
border-color - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-color' in that specification.
border-left-color - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-left-color' in that specification.
border-left-style - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-left-style' in that specification.
border-left-width - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-left-width' in that specification.
border-left - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-left' in that specification.
border-right-color - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-right-color' in that specification.
border-right-style - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-right-style' in that specification.
border-right-width - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-right-width' in that specification.
border-right - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-right' in that specification.
border-spacing - CSS: Cascading Style Sheets
</td><td>5</td><td>6</td> </tr> <tr> <td>7</td><td>8</td><td>9</td> </tr> </table> css table { border-spacing: 1em .5em; padding: 0 2em 1em 0; border: 1px solid orange; } td { width: 1.5em; height: 1.5em; background: #d2d2d2; text-align: center; vertical-align: middle; } result specifications specification status comment css level 2 (revision 1)the definition of 'border-spacing' in that specification.
border-style - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-style' in that specification.
border-top-color - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-top-color' in that specification.
border-top-style - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-top-style' in that specification.
border-top-width - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-top-width' in that specification.
border-top - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'border-top' in that specification.
border - CSS: Cascading Style Sheets
WebCSSborder
css level 2 (revision 1)the definition of 'border' in that specification.
bottom - CSS: Cascading Style Sheets
WebCSSbottom
css level 2 (revision 1)the definition of 'bottom' in that specification.
box-flex-group - CSS: Cascading Style Sheets
if the space of all flexible children within the group has been increased to the maximum, the process repeats for the children within the next flex group, using any space left over from the previous flex group.
box-ordinal-group - CSS: Cascading Style Sheets
in the reverse direction, the ordinal groups are examined in the same order, except the elements appear reversed.
box-pack - CSS: Cascading Style Sheets
WebCSSbox-pack
notes the edge of the box designated the start for packing purposes depends on the box's orientation and direction: normal reverse horizontal left right vertical top bottom the edge opposite to the start is designated the end.
break-after - CSS: Cascading Style Sheets
after: recto; break-after: verso; /* column break values */ break-after: avoid-column; break-after: column; /* region break values */ break-after: avoid-region; break-after: region; /* global values */ break-after: inherit; break-after: initial; break-after: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
break-before - CSS: Cascading Style Sheets
ecto; break-before: verso; /* column break values */ break-before: avoid-column; break-before: column; /* region break values */ break-before: avoid-region; break-before: region; /* global values */ break-before: inherit; break-before: initial; break-before: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
caption-side - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'caption-side' in that specification.
clear - CSS: Cascading Style Sheets
WebCSSclear
editor's draft adds the values inline-start and inline-end css level 2 (revision 1)the definition of 'clear' in that specification.
clip - CSS: Cascading Style Sheets
WebCSSclip
css level 2 (revision 1)the definition of 'clip' in that specification.
color - CSS: Cascading Style Sheets
WebCSScolor
css level 2 (revision 1)the definition of 'color' in that specification.
column-rule - CSS: Cascading Style Sheets
note: as with all shorthand properties, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties).
conic-gradient() - CSS: Cascading Style Sheets
subsequent color stops of lower value will override the value of the previous color stop creating a hard transition.
contain - CSS: Cascading Style Sheets
WebCSScontain
this property is useful on pages that contain a lot of widgets that are all independent, as it can be used to prevent each widget's internals from having side effects outside of the widget's bounding-box.
content - CSS: Cascading Style Sheets
WebCSScontent
working draft adds support for alt-text css level 2 (revision 1)the definition of 'content' in that specification.
counter-increment - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'counter-increment' in that specification.
counter-reset - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'counter-reset' in that specification.
counter() - CSS: Cascading Style Sheets
WebCSScounter
working draft no change css level 2 (revision 1)the definition of 'css counters' in that specification.
counters() - CSS: Cascading Style Sheets
WebCSScounters
working draft no change css level 2 (revision 1)the definition of 'css counters' in that specification.
cursor - CSS: Cascading Style Sheets
WebCSScursor
css level 2 (revision 1)the definition of 'cursor' in that specification.
direction - CSS: Cascading Style Sheets
WebCSSdirection
css level 2 (revision 1)the definition of 'direction' in that specification.
display - CSS: Cascading Style Sheets
WebCSSdisplay
css level 2 (revision 1)the definition of 'display' in that specification.
empty-cells - CSS: Cascading Style Sheets
> <td></td> </tr> </table> <br> <table class="table_2"> <tr> <td>moe</td> <td>larry</td> </tr> <tr> <td>curly</td> <td></td> </tr> </table> css .table_1 { empty-cells: show; } .table_2 { empty-cells: hide; } td, th { border: 1px solid gray; padding: 0.5rem; } result specifications specification status comment css level 2 (revision 1)the definition of 'empty-cells' in that specification.
flex-basis - CSS: Cascading Style Sheets
then, that change was reverted in bug 1093316, so auto once again means "look at my width or height property"; and a new content keyword is being introduced to trigger automatic sizing.
float - CSS: Cascading Style Sheets
WebCSSfloat
css level 2 (revision 1)the definition of 'float' in that specification.
font-family - CSS: Cascading Style Sheets
candidate recommendation no significant change css level 2 (revision 1)the definition of 'font-family' in that specification.
font-style - CSS: Cascading Style Sheets
candidate recommendation no change css level 2 (revision 1)the definition of 'font-style' in that specification.
font-variant-ligatures - CSS: Cascading Style Sheets
no-contextual prevents their use.
font-weight - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'font-weight' in that specification.
<gradient> - CSS: Cascading Style Sheets
WebCSSgradient
this prevents unexpected shades of gray from appearing when both the color and the opacity are changing.
grid-area - CSS: Cascading Style Sheets
WebCSSgrid-area
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
grid-column-end - CSS: Cascading Style Sheets
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
grid-column-start - CSS: Cascading Style Sheets
if a negative integer is given, it counts in reverse, starting from the end edge of the explicit grid.
grid-column - CSS: Cascading Style Sheets
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
grid-row-end - CSS: Cascading Style Sheets
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
grid-row-start - CSS: Cascading Style Sheets
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
grid-row - CSS: Cascading Style Sheets
WebCSSgrid-row
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
grid-template - CSS: Cascading Style Sheets
use grid (as opposed to grid-template) to prevent these values from cascading in seperately.
height - CSS: Cascading Style Sheets
WebCSSheight
css level 2 (revision 1)the definition of 'height' in that specification.
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
it can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate.
image() - CSS: Cascading Style Sheets
because we used image() along with the background-size property (and prevented the image from repeating with the background-repeat property, the color swatch will only cover a quarter of the container.
Initial value - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'initial value' in that specification.
<integer> - CSS: Cascading Style Sheets
WebCSSinteger
css level 2 (revision 1)the definition of '<integer>' in that specification.
<length> - CSS: Cascading Style Sheets
WebCSSlength
css level 2 (revision 1)the definition of '<length>' in that specification.
letter-spacing - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'letter-spacing' in that specification.
line-height - CSS: Cascading Style Sheets
ont-size (15px × 1.1) = 16.5px, probably not what you want --> css .green { line-height: 1.1; border: solid limegreen; } .red { line-height: 1.1em; border: solid red; } h1 { font-size: 30px; } .box { width: 18em; display: inline-block; vertical-align: top; font-size: 15px; } result specifications specification status comment css level 2 (revision 1)the definition of 'line-height' in that specification.
linear-gradient() - CSS: Cascading Style Sheets
subsequent color stops of lower value will override the value of the previous color stop creating a hard transition.
list-style-image - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'list-style-image' in that specification.
list-style-position - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'list-style-position' in that specification.
list-style-type - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'list-style-type' in that specification.
list-style - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'list-style' in that specification.
margin-bottom - CSS: Cascading Style Sheets
working draft no significant change css level 2 (revision 1)the definition of 'margin-bottom' in that specification.
margin-left - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'margin-left' in that specification.
margin-right - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'margin-right' in that specification.
margin-top - CSS: Cascading Style Sheets
working draft no significant change css level 2 (revision 1)the definition of 'margin-top' in that specification.
margin - CSS: Cascading Style Sheets
WebCSSmargin
css level 2 (revision 1)the definition of 'margin' in that specification.
<number> - CSS: Cascading Style Sheets
WebCSSnumber
css level 2 (revision 1)the definition of '<number>' in that specification.
orphans - CSS: Cascading Style Sheets
WebCSSorphans
css level 2 (revision 1)the definition of 'orphans' in that specification.
outline-color - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'outline-color' in that specification.
outline-style - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'outline-style' in that specification.
outline-width - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'outline-width' in that specification.
outline - CSS: Cascading Style Sheets
WebCSSoutline
css level 2 (revision 1)the definition of 'outline' in that specification.
overflow-anchor - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none examples prevent scroll anchoring to prevent scroll anchoring in a document, use the overflow-anchor property.
overflow-block - CSS: Cascading Style Sheets
(this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content.
overflow-inline - CSS: Cascading Style Sheets
(this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content.
overflow-x - CSS: Cascading Style Sheets
(this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content.
overflow-y - CSS: Cascading Style Sheets
(this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content.
padding-bottom - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'padding-bottom' in that specification.
padding-left - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'padding-left' in that specification.
padding-right - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'padding-right' in that specification.
padding-top - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'padding-top' in that specification.
padding - CSS: Cascading Style Sheets
WebCSSpadding
css level 2 (revision 1)the definition of 'padding' in that specification.
page-break-after - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'page-break-after' in that specification.
page-break-before - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'page-break-before' in that specification.
page-break-inside - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'page-break-inside' in that specification.
paint-order - CSS: Cascading Style Sheets
formal definition initial valuenormalapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ fill | stroke | markers ] examples reversing the paint order of stroke and fill svg <svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"> <text x="10" y="75">stroke in front</text> <text x="10" y="150" class="stroke-behind">stroke behind</text> </svg> css text { font-family: sans-serif; font-size: 50px; font-weight: bold; fill: black; stroke: red; stroke-width: 4px; } .stroke-behind { paint-order: st...
pointer-events - CSS: Cascading Style Sheets
note that preventing an element from being the target of pointer events by using pointer-events does not necessarily mean that pointer event listeners on that element cannot or will not be triggered.
position - CSS: Cascading Style Sheets
WebCSSposition
px/21px helvetica, arial, sans-serif; margin: 0; padding: 2px 0 0 12px; position: -webkit-sticky; position: sticky; top: -1px; } dd { font: bold 20px/45px helvetica, arial, sans-serif; margin: 0; padding: 0 0 0 12px; white-space: nowrap; } dd + dd { border-top: 1px solid #ccc; } result specifications specification status comment css level 2 (revision 1)the definition of 'position' in that specification.
<position> - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of '<position>' in that specification.
quotes - CSS: Cascading Style Sheets
WebCSSquotes
working draft css level 2 (revision 1)the definition of 'quotes' in that specification.
<shape> - CSS: Cascading Style Sheets
WebCSSshape
example img.clip04 { clip: rect(10px, 20px, 20px, 10px); } specifications specification status comment css level 2 (revision 1)the definition of '<shape>' in that specification.
tab-size - CSS: Cascading Style Sheets
WebCSStab-size
note that white-space is set to pre to prevent the tabs from collapsing.
table-layout - CSS: Cascading Style Sheets
d>schweitzer</td></tr> <tr><td>jane</td><td>fonda</td></tr> <tr><td>william</td><td>shakespeare</td></tr> </table> css table { table-layout: fixed; width: 120px; border: 1px solid red; } td { border: 1px solid blue; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } result specifications specification status comment css level 2 (revision 1)the definition of 'table-layout' in that specification.
text-align - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'text-align' in that specification.
text-decoration - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'text-decoration' in that specification.
text-indent - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'text-indent' in that specification.
text-overflow - CSS: Cascading Style Sheets
working draft initial definition a previous version of this interface reached the candidate recommendation status.
text-size-adjust - CSS: Cascading Style Sheets
this value is used to cancel a none value previously set with css.
<time> - CSS: Cascading Style Sheets
WebCSStime
css level 2 (revision 1)the definition of '<time>' in that specification.
top - CSS: Cascading Style Sheets
WebCSStop
css level 2 (revision 1)the definition of 'top' in that specification.
<transform-function> - CSS: Cascading Style Sheets
choose one, and the transform is applied to the cube; after 2 seconds, the cube reverts back to its starting state.
transition-timing-function - CSS: Cascading Style Sheets
animations can help reduce cognitive load, prevent change blindness, and establish better recall in spatial relationships.
unicode-bidi - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'unicode-bidi' in that specification.
vertical-align - CSS: Cascading Style Sheets
nt.</div> <div>an <img class="middle" src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a middle alignment.</div> css img.top { vertical-align: text-top; } img.bottom { vertical-align: text-bottom; } img.middle { vertical-align: middle; } result specifications specification status comment css level 2 (revision 1)the definition of 'vertical-align' in that specification.
visibility - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'visibility' in that specification.
white-space - CSS: Cascading Style Sheets
css level 2 (revision 1)the definition of 'white-space' in that specification.
widows - CSS: Cascading Style Sheets
WebCSSwidows
css level 2 (revision 1)the definition of 'widows' in that specification.
width - CSS: Cascading Style Sheets
WebCSSwidth
css level 2 (revision 1)the definition of 'width' in that specification.
will-change - CSS: Cascading Style Sheets
the normal behavior for optimizations that the browser make is to remove the optimizations as soon as it can and revert back to normal.
z-index - CSS: Cascading Style Sheets
WebCSSz-index
* put .gold-box above .green-box and .dashed-box */ background: gold; width: 80%; left: 60px; top: 3em; } .green-box { position: absolute; z-index: 2; /* put .green-box above .dashed-box */ background: lightgreen; width: 20%; left: 65%; top: -25px; height: 7em; opacity: 0.9; } result specifications specification status comment css level 2 (revision 1)the definition of 'z-index' in that specification.
Demos of open web technologies
ragable and sizable videos 3d graphics webgl web audio fireworks ioquake3 (source code) escher puzzle (source code) kai 'opua (source code) virtual reality the polar sea (source code) sechelt fly-through (source code) css css zen garden css floating logo "mozilla" paperfold css blockout rubik's cube pure css slides planetarium (source code) loader with blend modes text reveal with clip-path ambient shadow with custom properties luminiscent vial css-based single page application (source code) transformations impress.js (source code) games ioquake3 (source code) kai 'opua (source code) web apis notifications api html5 notifications (source code) web audio api web audio fireworks oscope.js - javascript oscilloscope html5 web audio show...
regexp:replace() - EXSLT
WebEXSLTregexpreplace
returns the revised version of the string.
Community - Developer guides
WebGuideAJAXCommunity
ajax resources ajax workshops and courses skillsmatter.com: courses and events on javascript, ajax, and reverse ajax technologies telerik.com: an active community forum for ajax community.tableau.com: community support forum and courses available for ajax codementor.io: social platform with ajax forums and tutorials lynda.com: tutorials available for learning the fundamentals of ajax ajax interview questions and answer and answerinterwiki links ...
Getting Started - Developer guides
try...catch: function alertcontents() { try { if (httprequest.readystate === xmlhttprequest.done) { if (httprequest.status === 200) { alert(httprequest.responsetext); } else { alert('there was a problem with the request.'); } } } catch( e ) { alert('caught exception: ' + e.description); } } step 4 – working with the xml response in the previous example, after receiving the response to the http request we used the request object's responsetext property , which contained the contents of the test.html file.
Web Audio playbackRate explained - Developer guides
negative values will not cause the media to play in reverse.
Audio and video manipulation - Developer guides
having native audio and video in the browser means we can use these data streams with technologies such as <canvas>, webgl or web audio api to modify audio and video directly, for example adding reverb/compression effects to audio, or grayscale/sepia filters to video.
Block formatting context - Developer guides
css level 2 (revision 1)the definition of 'block formatting context' in that specification.
Mouse gesture events - Developer guides
if you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventdefault() method.
Mutation events - Developer guides
moreover, removing the listeners does not reverse the damage.
Using device orientation with 3D transforms - Developer guides
this is achieved by inverting the previous order of rotations and negating the alpha value: var elem = document.getelementbyid("view3d"); window.addeventlistener("deviceorientation", function(e) { // again, use vendor-prefixed transform property elem.style.transform = "rotatey(" + ( -e.gamma ) + "deg)" + "rotatex(" + e.beta + "deg) " + "rotatez(" + - ( e.alpha - 180 ) + "deg) "; }); rotate3d to orientation should ...
Constraint validation - Developer guides
note: setting a custom validity message on fieldset elements will not prevent form submission in most browsers.
HTML5 - Developer guides
WebGuideHTMLHTML5
performance and integration web workers allows delegation of javascript evaluation to background threads, allowing these activities to prevent slowing down interactive events.
Index - Developer guides
WebGuideIndex
this article explains how, looking at two of the most common formats: mpeg-dash and hls (http live streaming.) 13 video player styling basics apps, guide, media, styling, video in the previous cross browser video player article we described how to build a cross-browser html5 video player using the media and fullscreen apis.
Parsing and serializing XML - Developer guides
use the following approaches to serialize the contents of the xml document you created in the previous section.
The Unicode Bidirectional Text Algorithm - Developer guides
dded text interact with the surrounding content, risking spillover effects left-to-right override (lro) u+202d &#x202d; <bdo dir="ltr"> overrides the bidi algorithm, displaying the characters in memory order, from left to right right-to-left override (rlo) u+202e &#x202e; <bdo dir="rtl"> overrides the bidi algorithm and displays the embedded characters in reverse memory order, from right to left closing unicode bidi algorithm control characters character code point html entity markup equivalent description pop directional formatting (pdf) u+202c &#x202c; closing whatever opening tag used the dir attribute used for rle or lre </bdo> used for rlo or lro pop directional isolate (p...
User input and controls - Developer guides
locking the screen orientation is made possible by invoking the screen.lockorientation method, while the screen.unlockorientation method removes all the previous screen locks that have been set.
Writing forward-compatible websites - Developer guides
missing those can lead to unexpected situations due to a following tag name being treated as an attribute on a previous tag.
Developer guides
having native audio and video in the browser means we can use these data streams with technologies such as <canvas>, webgl or web audio api to modify audio and video directly, for example adding reverb/compression effects to audio, or grayscale/sepia filters to video.
HTML attribute: capture - HTML: Hypertext Markup Language
environment the outward-facing camera and/or microphone should be used note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input.
disabled - HTML: Hypertext Markup Language
this boolean attribute prevents the user from interacting with the button.
HTML attribute: max - HTML: Hypertext Markup Language
WebHTMLAttributesmax
if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent form submission.
HTML attribute: maxlength - HTML: Hypertext Markup Language
constraint validation while the browser will generally prevent user from entering more text than the maxlength attribute allows, should the length be longer than the maxlength allows, the read-only toolong property of a validitystate object will be true.
<acronym> - HTML: Hypertext Markup Language
WebHTMLElementacronym
summary the html acronym element (<acronym>) allows authors to clearly indicate a sequence of characters that compose an acronym or abbreviation for a word.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
WebHTMLElementb
usage notes use the <b> for cases like keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced (but not including any special importance).
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
but if you don't know the directionality - for example, because embedded-text is being read from a database or entered by the user - you should use <bdi> to prevent the directionality of embedded-text from affecting its surroundings.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
disabled this boolean attribute prevents the user from interacting with the button: it cannot be pressed or focused.
<cite>: The Citation element - HTML: Hypertext Markup Language
WebHTMLElementcite
the reference may be in an abbreviated form according to context-appropriate conventions related to citation metadata.
<dd>: The Description Details element - HTML: Hypertext Markup Language
WebHTMLElementdd
previous sibling <dt> or another <dd> element.
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
<p> in html 5, what was previously called <em>block-level</em> content is now called <em>flow</em> content.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
(in previous versions of html, character encodings could also be delimited by commas.) autocapitalize a nonstandard attribute used by ios safari that controls how textual form elements should be automatically capitalized.
<frame> - HTML: Hypertext Markup Language
WebHTMLElementframe
noresize this attribute prevents resizing of frames by users.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
in other words, the <hgroup> element prevents any of its secondary <h1>–<h6> children from creating separate sections of their own in the outline—as those <h1>–<h6> elements otherwise normally would if they were not children of any <hgroup>.
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
var overall = document.queryselector('input[id="enchtbl"]'); var ingredients = document.queryselectorall('ul input'); overall.addeventlistener('click', function(e) { e.preventdefault(); }); for(var i = 0; i < ingredients.length; i++) { ingredients[i].addeventlistener('click', updatedisplay); } function updatedisplay() { var checkedcount = 0; for(var i = 0; i < ingredients.length; i++) { if(ingredients[i].checked) { checkedcount++; } } if(checkedcount === 0) { overall.checked = false; overall.indeterminat...
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
/external/62/62ac2ecddbec0e0b540098c28451e57203e5cab46dfed7ab0115d5a659fcfb7b.png" alt="login" width="100"> </div> </form> css and now some simple css to make the basic elements sit more neatly: div { margin-bottom: 10px; } label { display: inline-block; width: 70px; text-align: right; padding-right: 10px; } adjusting the image position and scaling in this example, we adapt the previous example to set aside more space for the image and then adjust the actual image's size and positioning using object-fit and object-position.
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
validation we have already mentioned a number of validation features of number inputs, but let's review them now: <input type="number"> elements automatically invalidate any entry that isn't a number (or empty, unless required is specified).
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
here's the previous example with the s access key added: <form> <div> <label for="example">let's submit some text</label> <input id="example" type="text" name="text"> </div> <div> <input type="submit" value="send" accesskey="s"> </div> </form> for example, in firefox for mac, pressing control-option-s triggers the send button, while chrome on windows uses alt+s.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
<p>if a syntax error occurs, the tool will output the initial command you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> representing onscreen input options nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen.
<nobr>: The Non-Breaking Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnobr
the non-standard, obsolete html <nobr> element prevents the text it contains from automatically wrapping across multiple lines, potentially resulting in the user having to scroll horizontally to see the entire width of the text.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
screen-readers and other assistive technology provide shortcuts to let their users skip to the next or previous paragraph, letting them skim content like how white space lets visual users skip around.
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
escape any <, > and & characters, to prevent browsers inadvertently parsing content the element content as html.
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
scripts with the defer attribute will prevent the domcontentloaded event from firing until the script has loaded and finished evaluating.
<shadow>: The obsolete Shadow Root element - HTML: Hypertext Markup Language
WebHTMLElementshadow
// the previous markup will not be displayed unless // <shadow> is used below.
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
<!doctype html> <html> <head> <style> p { color: white; background-color: blue; padding: 5px; border: 1px solid black; } </style> <style> p { color: blue; background-color: yellow; } </style> </head> <body> <p>this is my paragraph.</p> </body> </html> including a media query in this example we build on the previous one, including a media attribute on the second <style> element so it is only applied when the viewport is less than 500px in width.
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
abbr this attribute contains a short abbreviated description of the cell's content.
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
html the html is similar to the previous example's, except for the addition of the new column in each data row, and the changes to the header.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
css var { font: bold 15px "courier", "courier new", monospace; } html <p>the variables <var>minspeed</var> and <var>maxspeed</var> control the minimum and maximum speed of the apparatus in revolutions per minute (rpm).</p> this html uses <var> to enclose the names of two variables.
is - HTML: Hypertext Markup Language
// create a class for the element class wordcount extends htmlparagraphelement { constructor() { // always call super first in constructor super(); // constructor contents ommitted for brevity ...
tabindex - HTML: Hypertext Markup Language
this prevents assistive technology from being able to navigate to and manipulate those components.
Using the application cache - HTML: Hypertext Markup Language
you can make any change you want to the manifest file, but revising a version number is the recommended best practice.
HTML: Hypertext Markup Language
WebHTML
get started beginner's tutorials our html learning area features multiple modules that teach html from the ground up — no previous knowledge required.
Choosing between www and non-www URLs - HTTP
in the previous example, http://www.example.org/whaddup would serve the same content as http://example.org/whaddup, but with an additional <link> element in the head: <link href="http://example.org/whaddup" rel="canonical"> unlike the previous case, browser history will consider non-www and www urls as independent entries.
Common MIME types - HTTP
browsers pay a particular care when manipulating these files, attempting to safeguard the user to prevent dangerous behaviors.
Basics of HTTP - HTTP
connection management in http/2 http/2 completely revisited how connections are created and maintained.
Reason: expected ‘true’ in CORS header ‘Access-Control-Allow-Credentials’ - HTTP
to fix this problem on the client side, revise the code to not request the use of credentials.
Reason: CORS header 'Access-Control-Allow-Origin' missing - HTTP
in addition, the wildcard only works for requests made with the crossorigin attribute set to anonymous, and it prevents sending credentials like cookies in requests.
Reason: CORS preflight channel did not succeed - HTTP
there are a couple of reasons why preflighting might fail: a cross-site request has previously been performed that already did a preflight, and doing the preflight again is not permitted.
Access-Control-Expose-Headers - HTTP
examples to expose a non-cors-safelisted request header, you can specify: access-control-expose-headers: content-length to additionally expose a custom header, like x-kuma-revision, you can specify multiple headers separated by a comma: access-control-expose-headers: content-length, x-kuma-revision in requests without credentials, you can also use a wildcard value: access-control-expose-headers: * however, this won't wildcard the authorization header, so if you need to expose that, you will need to list it explicitly: access-control-expose-headers: *, authorizatio...
Authorization - HTTP
this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding).
CSP: block-all-mixed-content - HTTP
the http content-security-policy (csp) block-all-mixed-content directive prevents loading any assets over http when the page uses https.
CSP: sandbox - HTTP
it applies restrictions to a page's actions including preventing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy.
CSP: style-src - HTTP
g csstext: document.queryselector('div').setattribute('style', 'display:none;'); document.queryselector('div').style.csstext = 'display:none;'; however, styles properties that are set directly on the element's style property will not be blocked, allowing users to safely manipulate styles via javascript: document.queryselector('div').style.display = 'none'; these types of manipulations can be prevented by disallowing javascript via the script-src csp directive.
CSP: trusted-types - HTTP
this allows authors to define rules guarding writing values to the dom and thus reducing the dom xss attack surface to small, isolated parts of the web application codebase, facilitating their monitoring and code review.
Content-Security-Policy-Report-Only - HTTP
this is done to prevent leaking sensitive information about cross-origin resources.
Content-Security-Policy - HTTP
other directives block-all-mixed-content prevents loading any assets using http when the page is loaded using https.
Content-Type - HTTP
browsers will do mime sniffing in some cases and will not necessarily follow the value of this header; to prevent this behavior, the header x-content-type-options can be set to nosniff.
Cookie - HTTP
WebHTTPHeadersCookie
the cookie http request header contains stored http cookies previously sent by the server with the set-cookie header.
Cross-Origin-Embedder-Policy - HTTP
the http cross-origin-embedder-policy (coep) response header prevents a document from loading any cross-origin resources that don't explicitly grant the document permission (using corp or cors).
Cross-Origin-Opener-Policy - HTTP
coop will process-isolate your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks.
Expect-CT - HTTP
the expect-ct header lets sites opt in to reporting and/or enforcement of certificate transparency requirements, to prevent the use of misissued certificates for that site from going unnoticed.
Feature-Policy: fullscreen - HTTP
this directive allows or prevents cross-origin frames from using fullscreen mode.
Feature-Policy: geolocation - HTTP
this directive allows or prevents cross-origin frames from accessing geolocation.
Forwarded - HTTP
the forwarded header contains information from the reverse proxy servers that is altered or lost when a proxy is involved in the path of the request.
If-Modified-Since - HTTP
if the request has not been modified since, the response will be a 304 without any body; the last-modified response header of a previous request will contain the date of last modification.
If-None-Match - HTTP
for other methods, and in particular for put, if-none-match used with the * value can be used to save a file not known to exist, guaranteeing that another upload didn't happen before, losing the data of the previous put; this problem is a variation of the lost update problem.
Large-Allocation - HTTP
some legacy addons can prevent firefox from using this new, faster, multiprocess architecture.
Proxy-Authorization - HTTP
this method is equally secure as sending the credentials in clear text (base64 is a reversible encoding).
Server-Timing - HTTP
the specification advices that names and descriptions should be kept as short as possible (use abbreviations and omit optional values where possible) to minimize the http overhead.
Server - HTTP
WebHTTPHeadersServer
avoid overly-detailed server values, as they can reveal information that might make it (slightly) easier for attackers to exploit known security holes.
SourceMap - HTTP
examples sourcemap: /path/to/file.js.map specifications specification title draft document source map revision 3 proposal ...
Via - HTTP
WebHTTPHeadersVia
the via general header is added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers.
X-DNS-Prefetch-Control - HTTP
examples turning on and off prefetching you can either send the x-dns-prefetch-control header server-side, or from individual documents, using the http-equiv attribute on the <meta> element, like this: <meta http-equiv="x-dns-prefetch-control" content="off"> you can reverse this setting by setting content to "on".
X-Forwarded-Host - HTTP
host names and ports of reverse proxies (load balancers, cdns) may differ from the origin server handling the request, in that case the x-forwarded-host header is useful to determine which host was originally used.
X-XSS-Protection - HTTP
rather than sanitizing the page, the browser will prevent rendering of the page if an attack is detected.
Link prefetching FAQ - HTTP
however, it is possible to instruct mozilla to validate a prefetched document when the user follows a href to the prefetched document by specifying the cache-control: must-revalidate http response header.
An overview of HTTP - HTTP
WebHTTPOverview
relaxing the origin constraint to prevent snooping and other privacy invasions, web browsers enforce strict separation between web sites.
Protocol upgrade mechanism - HTTP
instead, it helps to prevent non-websocket clients from inadvertently, or through misuse, requesting a websocket connection.
Proxy Auto-Configuration (PAC) file - HTTP
the browser will automatically retry a previously unresponsive proxy after 30 minutes.
A typical HTTP session - HTTP
WebHTTPSession
(contains a site-customized page helping the user to find the missing resource) notification that the requested resource doesn't exist: http/1.1 404 not found content-type: text/html; charset=utf-8 content-length: 38217 connection: keep-alive cache-control: no-cache, no-store, must-revalidate, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:35:13 gmt expires: thu, 06 dec 2018 17:35:13 gmt server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary: accept-encoding,cookie x-cache: error from cloudfront <!doctype html...
408 Request Timeout - HTTP
WebHTTPStatus408
it is sent on an idle connection by some servers, even without any previous request by the client.
CSS Houdini
houdini's css typed om is a css object model with types and methods, exposing values as javascript objects making for more intuitive css manipulation than previous string based htmlelement.style manipulations.
Equality comparisons and sameness - JavaScript
even if your requirements involve having comparisons between two nan values evaluate to true, generally it is easier to special-case the nan checks (using the isnan method available from previous versions of ecmascript) than it is to work out how surrounding computations might affect the sign of any zeros you encounter in your comparison.
Assertions - JavaScript
this is a position where the previous and next character are of the same type: either both must be words, or both must be non-words, for example between two letters or between two spaces.
Regular expression syntax cheatsheet - JavaScript
this is a position where the previous and next character are of the same type: either both must be words, or both must be non-words, for example between two letters or between two spaces.
JavaScript Guide - JavaScript
objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iterators and generators iterators iterables generators meta programming proxy handlers and traps revocable proxy reflect javascript modules exporting importing default exports renaming features aggregating modules dynamic module loading next » ...
Memory Management - JavaScript
this algorithm is an improvement over the previous one since an object having zero references is effectively unreachable.
TypeError: can't assign to property "x" on "y": not an object - JavaScript
foo.bar = {}; // typeerror: can't assign to property "bar" on "my string": not an object fixing the issue either fix the code to prevent the primitive from being used in such places, or fix the issue is to create the object equivalent object.
SyntaxError: missing variable name - JavaScript
check to ensure the previous lines / declaration does not end with a comma instead of a semi-colon.
Array.prototype[@@unscopables] - JavaScript
this is where now the built-in @@unscopables array.prototype[@@unscopables] symbol property comes into play and prevents that some of the array methods are being scoped into the with statement.
Array.prototype.reduce() - JavaScript
it is the accumulated value previously returned in the last invocation of the callback—or initialvalue, if it was supplied (see below).
Array - JavaScript
array.prototype.reverse() reverses the order of the elements of an array in place.
Date.prototype.getTime() - JavaScript
see also date.now() to prevent instantiating unnecessary date objects.
Date.prototype.setMonth() - JavaScript
so, 0 represents january, 11 represents december, -1 represents december of the previous year, and 12 represents january of the following year.
Date.prototype.toString() - JavaScript
"(" an implementation dependent string representation of the timezone, which might be an abbreviation or full name (there is no standard for names or abbreviations of timezones), e.g.
Function.prototype.bind() - JavaScript
this means that additional apply() calls can be eliminated: // same as "slice" in the previous example const unboundslice = array.prototype.slice; const slice = function.prototype.apply.bind(unboundslice); // ...
Intl.Locale.prototype.collation - JavaScript
valid collation types collation type description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected.
Intl.Locale.prototype.minimize() - JavaScript
description this method carries out the reverse of maximize(), removing any language, script, or region subtags from the locale language identifier (essentially the contents of basename).
Number.prototype.toExponential() - JavaScript
if you use the toexponential() method for a numeric literal and the numeric literal has no exponent and no decimal point, leave whitespace(s) before the dot that precedes the method call to prevent the dot from being interpreted as a decimal point.
Object.prototype.constructor - JavaScript
to prevent this, just define the role of constructor in each specific case.
Promise - JavaScript
'odd' : 'even'; resolve(parityinfo); } return; } return new promise(tetheredgetword); } (new promise(tetheredgetnumber)) .then(determineparity,troublewithgetnumber) .then(promisegetword) .then((info) => { console.log("got: ",info.thenumber," , ", info.wordevenodd); return info; }) .catch((reason) => { if(reason === -999) { console.error("had previously handled error"); } else { console.error(`trouble with promisegetword(): ${reason}`); } }) .finally((info) => console.log("all done")); advanced example <button id="btn">make a promise!</button> <div id="log"></div> this small example shows the mechanism of a promise.
handler.getOwnPropertyDescriptor() - JavaScript
const obj = { a: 10 }; object.preventextensions(obj); const p = new proxy(obj, { getownpropertydescriptor: function(target, prop) { return undefined; } }); object.getownpropertydescriptor(p, 'a'); // typeerror is thrown specifications specification ecmascript (ecma-262)the definition of '[[getownproperty]]' in that specification.
handler.getPrototypeOf() - JavaScript
p.__proto__ === array.prototype, // true array.prototype.isprototypeof(p), // true p instanceof array // true ); two kinds of exceptions const obj = {}; const p = new proxy(obj, { getprototypeof(target) { return 'foo'; } }); object.getprototypeof(p); // typeerror: "foo" is not an object or null const obj = object.preventextensions({}); const p = new proxy(obj, { getprototypeof(target) { return {}; } }); object.getprototypeof(p); // typeerror: expected same prototype value specifications specification ecmascript (ecma-262)the definition of '[[getprototypeof]]' in that specification.
handler.has() - JavaScript
const obj = { a: 10 }; object.preventextensions(obj); const p = new proxy(obj, { has: function(target, prop) { return false; } }); 'a' in p; // typeerror is thrown specifications specification ecmascript (ecma-262)the definition of '[[hasproperty]]' in that specification.
Proxy() constructor - JavaScript
handler.preventextensions() a trap for object.preventextensions.
Proxy - JavaScript
static methods proxy.revocable() creates a revocable proxy object.
Reflect.isExtensible() - JavaScript
reflect.preventextensions(empty) reflect.isextensible(empty) // === false // sealed objects are by definition non-extensible.
Reflect - JavaScript
reflect.preventextensions(target) similar to object.preventextensions().
RegExp.prototype.exec() - JavaScript
they store a lastindex from the previous match.
RegExp.prototype.test() - JavaScript
(this is similar to the string.prototype.match() method.) as with exec() (or in combination with it), test() called multiple times on the same global regular expression instance will advance past the previous match.
Set - JavaScript
set.prototype.delete(value) removes the element associated to the value and returns the value that set.prototype.has(value) would have previously returned.
String.prototype.charCodeAt() - JavaScript
if (isnan(low)) { throw 'high surrogate not followed by ' + 'low surrogate in fixedcharcodeat()'; } return ( (hi - 0xd800) * 0x400) + (low - 0xdc00) + 0x10000; } if (0xdc00 <= code && code <= 0xdfff) { // low surrogate // we return false to allow loops to skip // this iteration since should have already handled // high surrogate above in the previous iteration return false; // hi = str.charcodeat(idx - 1); // low = code; // return ((hi - 0xd800) * 0x400) + // (low - 0xdc00) + 0x10000; } return code; } fixing charcodeat() to handle non-basic-multilingual-plane characters if their presence earlier in the string is known function knowncharcodeat(str, idx) { str += ''; var code, end = str.length; var ...
String length - JavaScript
previously, no maximum length was specified.
Symbol() constructor - JavaScript
it creates a new symbol each time: symbol('foo') === symbol('foo') // false new symbol(...) the following syntax with the new operator will throw a typeerror: let sym = new symbol() // typeerror this prevents authors from creating an explicit symbol wrapper object instead of a new symbol value and might be surprising as creating explicit wrapper objects around primitive data types is generally possible (for example, new boolean, new string and new number).
Symbol.split - JavaScript
property attributes of symbol.split writable no enumerable no configurable no examples custom reverse split class reversesplit { [symbol.split](string) { const array = string.split(' '); return array.reverse(); } } console.log('another one bites the dust'.split(new reversesplit())); // expected output: [ "dust", "the", "bites", "one", "another" ] specifications specification ecmascript (ecma-262)the definition of 'symbol.split' in that specification.
Symbol.unscopables - JavaScript
a built-in unscopables setting is implemented as array.prototype[@@unscopables] to prevent that some of the array methods are being scoped into the with statement.
WebAssembly.Table.prototype.grow() - JavaScript
return value the previous length of the table.
decodeURI() - JavaScript
the decodeuri() function decodes a uniform resource identifier (uri) previously created by encodeuri() or by a similar routine.
decodeURIComponent() - JavaScript
the decodeuricomponent() function decodes a uniform resource identifier (uri) component previously created by encodeuricomponent or by a similar routine.
globalThis - JavaScript
you can also use function('return this')(), but environments that disable eval(), like csp in browsers, prevent use of function in this way.
Destructuring assignment - JavaScript
) expression needs to be preceded by a semicolon or it may be used to execute a function on the previous line.
Inequality (!=) - JavaScript
like the equality operator, the inequality operator will attempt to convert and compare operands of different types: 3 != "3"; // false to prevent this, and require that different types are considered to be different, use the strict inequality operator instead: 3 !== "3"; // true examples comparison with no type conversion 1 != 2; // true "hello" != "hola"; // true 1 != 1; // false "hello" != "hello"; // false comparison with type conversion "1" != 1; // false 1 != "1"; // false...
Optional chaining (?.) - JavaScript
this prevents the error that would occur if you simply accessed obj.first.second directly without testing obj.first.
Property accessors - JavaScript
const variable = object[property_name] object[property_name] = value; this does the exact same thing as the previous example.
delete operator - JavaScript
however, in the case of internet explorer, when one uses delete on a property, some confusing behavior results, preventing other browsers from using simple objects like object literals as ordered associative arrays.
void operator - JavaScript
this can cause unintended side effects by returning the result of a function call that previously returned nothing.
for...of - JavaScript
functions generating an iterable object: function* fibonacci() { // a generator function let [prev, curr] = [0, 1]; while (true) { [prev, curr] = [curr, prev + curr]; yield curr; } } for (const n of fibonacci()) { console.log(n); // truncate the sequence at 1000 if (n >= 1000) { break; } } do not reuse generators generators should not be re-used, even if the for...of loop is terminated early, for example via the break keyword.
import - JavaScript
const main = document.queryselector("main"); for (const link of document.queryselectorall("nav > a")) { link.addeventlistener("click", e => { e.preventdefault(); import('/modules/my-module.js') .then(module => { module.loadpageinto(main); }) .catch(err => { main.textcontent = err.message; }); }); } specifications specification ecmascript (ecma-262)the definition of 'imports' in that specification.
label - JavaScript
0; i < 3; i++) { //the first for statement is labeled "loop1" loop2: for (j = 0; j < 3; j++) { //the second for statement is labeled "loop2" if (i === 1 && j === 1) { break loop1; } console.log('i = ' + i + ', j = ' + j); } } // output is: // "i = 0, j = 0" // "i = 0, j = 1" // "i = 0, j = 2" // "i = 1, j = 0" // notice the difference with the previous continue example using a labeled break statement given an array of items and an array of tests, this example determines whether all items pass all tests.
return - JavaScript
to avoid this problem (to prevent asi), you could use parentheses: return ( a + b ); examples interrupt a function a function immediately stops at the point where return is called.
var - JavaScript
description var declarations, wherever they occur, are processed before any code is executed.
Trailing commas - JavaScript
if you want to add a new property, you can simply add a new line without modifying the previously last line if that line already uses a trailing comma.
scope - Web app manifests
if the user navigates outside the scope, it reverts to a normal web page inside a browser tab or window.
MathML: Deriving the Quadratic Formula - MathML
( x + b 2 a ) ( x + b 2 a ) = b 2 - 4 a c 4 a 2 discriminant revealed.
Digital video concepts - Web media technologies
this weighting is performed because of the previously-mentioned ratio of green, red, and blue cones in the eye.
The "codecs" parameter in common media types - Web media technologies
you can use the javascript encodeuri() function to encode the parameter list; similarly, you can use decodeuri() to decode a previously encoded parameter list.
Using audio and video in HTML - Web media technologies
in this guide, we'll review the media elements and how to use them in html content.
Animation performance and frame rate - Web Performance
while performance is sensitive to the particular system and its load, performance tools can help you understand the work the browser's doing to render your site, and help you prevent and diagnose problems when they occur.
Critical rendering path - Web Performance
the incremental processing features don't apply to css like they do with html, because subsequent rules may override previous ones.
Optimizing startup performance - Web Performance
this will prevent the app, browser, and/or device from appearing to have locked up.
Web Performance
that means not running all your startup code in a single event handler on the app's main thread.performance budgetsa performance budget is a limit to prevent regressions.
Installing and uninstalling web apps - Progressive web apps (PWAs)
by reducing the user experience differential between the web app and native apps on the user's device, you reduce both the loss of any muscle memory they have revolving around the native interface of the device and the sensation of "something isn't quite right" that users can experience when switching between native and web-based apps.
Graphic design for responsive sites - Progressive web apps (PWAs)
coping with different resolutions in this section we'll review different strategies for dealing with getting images to work across devices with different resolutions.
Media - Progressive web apps (PWAs)
print (or print preview) the document.
gradientTransform - SVG: Scalable Vector Graphics
this additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space.
mask - SVG: Scalable Vector Graphics
WebSVGAttributemask
html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <mask id="mymask" maskcontentunits="objectboundingbox"> <rect fill="white" x="0" y="0" width="100%" height="100%" /> <polygon fill="black" points="0.5,0.2 0.68,0.74 0.21,0.41 0.79,0.41 0.32,0.74" /> </mask> <!-- punch a hole in a shape of a star inside the red circle, revealing the yellow circle underneath --> <circle cx="50" cy="50" r="20" fill="yellow" /> <circle cx="50" cy="50" r="45" fill="red" mask="url(#mymask)"/> </svg> since svg2, the mask attribute is defined as a css property and is a shorthand for many other properties: mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-size, and mask-composite.
overflow - SVG: Scalable Vector Graphics
specifications specification status comment css level 2 (revision 1)the definition of 'overflow' in that specification.
side - SVG: Scalable Vector Graphics
WebSVGAttributeside
this effectively reverses the path direction.
spreadMethod - SVG: Scalable Vector Graphics
reflect this value indicates that the gradient repeats in reverse beyond its edges.
stroke-dashoffset - SVG: Scalable Vector Graphics
="black" stroke-dasharray="3 1" stroke-dashoffset="3" /> <!-- the start of the dash array computation is pushed by 3 user units --> <line x1="0" y1="7" x2="30" y2="7" stroke="black" stroke-dasharray="3 1" stroke-dashoffset="-3" /> <!-- the start of the dash array computation is pulled by 1 user units which ends up in the same rendering as the previous example --> <line x1="0" y1="9" x2="30" y2="9" stroke="black" stroke-dasharray="3 1" stroke-dashoffset="1" /> <!-- the following red lines highlight the offset of the dash array for each line --> <path d="m0,5 h-3 m0,7 h3 m0,9 h-1" stroke="rgba(255,0,0,.5)" /> </svg> usage notes value <percentage> | <length> default value 0 ...
visibility - SVG: Scalable Vector Graphics
ne-height: 1em; } .invisible { visibility: hidden; } javascript document.queryselector("button").addeventlistener("click", function (evt) { this.queryselector("svg > path:nth-of-type(1)").classlist.toggle("invisible"); this.queryselector("svg > path:nth-of-type(2)").classlist.toggle("invisible"); }); specifications specification status comment css level 2 (revision 1)the definition of 'visibility' in that specification.
x - SVG: Scalable Vector Graphics
WebSVGAttributex
value <number> default value 0 for the first glyphref, and the end x coordinate of the previous <glyphref> for all subsequent sibling <glyphref>.
Compatibility sources - SVG: Scalable Vector Graphics
the following sources are used for the compatibility tables on svg elements and attributes: https://developer.mozilla.org/en/svg_in_firefox together with its revision history for firefox http://www.webkit.org/projects/svg/status.xml together with its recorded archive for webkit, safari and chrome http://www.opera.com/docs/specs/opera9/svg/ and accompanying pages for opera >= 9, http://www.opera.com/docs/specs/opera8/ for opera 8 http://blogs.msdn.com/b/ie/archive/2010/03/18/svg-in-ie9-roadmap.aspx for hints on ie9 support status the svg support charts at codedread.com for basic checks against the w3c test suite wikipedia for basic hints, not normative ...
<animateMotion> - SVG: Scalable Vector Graphics
value type: <number>|auto|auto-reverse; default value: 0; animatable: no note: for <animatemotion> the default value for the calcmode attribute is paced animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumula...
<discard> - SVG: Scalable Vector Graphics
WebSVGElementdiscard
the <discard> element may occur wherever the <animate> element may.
SVG animation with SMIL - SVG: Scalable Vector Graphics
by setting the value of the repeatcount attribute to indefinite, we indicate that the animation should loop forever, as long as the svg image exists.
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
symptoms previously you were able to open and display svg content with mozilla, but for no apparent reason its behaviour changes and now it always pops up the "open or save file" dialog when you try to open local svg files, and displays the "additional plugins are required to display all the media on this page" bar when you try to view html with embedded svg.
Features restricted to secure contexts - Web security
push api 42 17 not supported 44 reporting api supported not supported not supported behind flag since fx 65 service workers 40 17 11.1 44 storage api 55 not supported not supported 51 web authentication api 65 in preview (17) in development 60 web bluetooth 56 not supported not supported not supported web midi (see midiaccess, for example) 43 not supported not supported not supported web crypto api 60 79 not supported 75 secure context restrictions that vary by browser some browsers may decide to disable certain apis in non-secure co...
Secure contexts - Web security
the primary goal of secure contexts is to prevent mitm attackers from accessing powerful apis that could further compromise the victim of an attack.
How to turn off form autocompletion - Web security
preventing autofilling with autocomplete="new-password" if you are defining a user management page where a user can specify a new password for another person, and therefore you want to prevent autofilling of password fields, you can use autocomplete="new-password".
Securing your site - Web security
you can use this to prevent your site from being used improperly; in addition, you can use it to establish resources that other sites are expressly permitted to use.
Web security
the primary goal of secure contexts is to prevent man-in-the-middle attackers from accessing powerful apis that could further compromise the victim of an attack.
Using custom elements - Web Components
attribute('img') : 'img/default.png'; const info = wrapper.appendchild(document.createelement('span')); info.setattribute('class','info'); // take attribute content and put it inside the info span info.textcontent = this.getattribute('data-text'); // create some css to apply to the shadow dom const style = document.createelement('style'); style.textcontent = '.wrapper {' + // css truncated for brevity // attach the created elements to the shadow dom this.shadowroot.append(style,wrapper); finally, we register our custom element on the customelementregistry using the define() method we mentioned earlier — in the parameters we specify the element name, and then the class name that defines its functionality: customelements.define('popup-info', popupinfo); it is now available to use on o...
attribute - XPath
WebXPathAxesattribute
this axis can be abbreviated with the at sign (@).
parent - XPath
WebXPathAxesparent
it can be abbreviated as two periods (..).
self - XPath
WebXPathAxesself
it can be abbreviated as a single period (.).
Introduction to using XPath in JavaScript - XPath
'xhtml' : 'http://www.w3.org/1999/xhtml', 'mathml': 'http://www.w3.org/1998/math/mathml' }; return ns[prefix] || null; } our call to document.evaluate would then looks like: document.evaluate( '//xhtml:td/mathml:math', document, nsresolver, xpathresult.any_type, null ); implementing a default namespace for xml documents as noted in the implementing a default namespace resolver previously, the default resolver does not handle the default namespace for xml documents.
XPath snippets - XPath
example: defining a getxpathforelement​​() utility function function getxpathforelement(el, xml) { var xpath = ''; var pos, tempitem2; while(el !== xml.documentelement) { pos = 0; tempitem2 = el; while(tempitem2) { if (tempitem2.nodetype === 1 && tempitem2.nodename === el.nodename) { // if it is element_node of the same name pos += 1; } tempitem2 = tempitem2.previoussibling; } xpath = "*[name()='"+el.nodename+"' and namespace-uri()='"+(el.namespaceuri===null?'':el.namespaceuri)+"']["+pos+']'+'/'+xpath; el = el.parentnode; } xpath = '/*'+"[name()='"+xml.documentelement.nodename+"' and namespace-uri()='"+(el.namespaceuri===null?'':el.namespaceuri)+"']"+'/'+xpath; xpath = xpath.replace(/\/$/, ''); return xpath; } resources xpath forum disc...
<xsl:namespace-alias> - XSLT: Extensible Stylesheet Language Transformations
to prevent a normally xsl:-prefixed literal result element (which should simply be copied as-is to the result tree) from being misunderstood by the processor, it is assigned a temporary namespace which is appropriately re-converted back to the xslt namespace in the output tree.
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
the processor starts at the current node and proceeds in reverse document order, stopping if it reaches a match to any from attribute.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
to prevent a normally xsl:-prefixed literal result element (which should simply be copied as-is to the result tree) from being misunderstood by the processor, it is assigned a temporary namespace which is appropriately re-converted back to the xslt namespace in the output tree.
Resources - XSLT: Extensible Stylesheet Language Transformations
xsl results firefox extension (presently awaiting review) - allows one to experiment with xsl, by applying xsl stylesheets (which are manually entered, found via a url or on the file-system) to an xml document (the currently-loaded document or a manually entered/pasted one).
Compiling a New C/C++ Module to WebAssembly - WebAssembly
copy it into a sub-directory called html_template inside your previous new directory.
Caching compiled WebAssembly modules - WebAssembly
additionally, it handles creating a database to cache the compiled wasm modules in, attempts to store new modules in the database, and retrieves previously cached modules from the database, saving you from having to download them again.
WebAssembly Concepts - WebAssembly
this has huge implications for the web platform — it provides a way to run code written in multiple languages on the web at near-native speed, with client apps running on the web that previously couldn’t have done so.
Exported WebAssembly functions - WebAssembly
they are real functions in the previous example, the return value of each table.prototype.get() call is an exported webassembly function — exactly what we have been talking about.
Compiling from Rust to WebAssembly - WebAssembly
navigate to wherever you keep your personal projects, and type this: $ cargo new --lib hello-wasm created library `hello-wasm` project this creates a new library in a subdirectory named hello-wasm with everything you need to get going: +-- cargo.toml +-- src +-- lib.rs first, we have cargo.toml; this is the file that we use to configure our build.
WebAssembly
in a nutshell webassembly has huge implications for the web platform — it provides a way to run code written in multiple languages on the web at near native speed, with client apps running on the web that previously couldn’t have done so.
onunload - XUL
this code is used by some programmers to annoyingly pop up alert boxes preventing the users from leaving the page.
UDN Web Docs
in order to preverve documentation on xul, this backup retains a snapshot of developer.mozilla.org from august, 2020.