Search completed in 1.25 seconds.
511 results for "constants":
Your results are loading. Please wait...
WebGL constants - Web APIs
The WebGL API provides several constants that are passed into or returned by functions. All constants are of type GLenum. 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 provided by WebGL extensions. A list is provided below. var debugInfo = gl.getExtension('WEBGL_debug_renderer_info'); var vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL); The WebGL tutorial has more information, examples, and resources on how to get started with WebGL. ...
... Clearing buffers Constants passed to WebGLRenderingContext.clear() to clear buffer masks. ...
... Clearing buffers Constants passed to WebGLRenderingContext.clear() to clear buffer masks. Constant name Value Description DEPTH_BUFFER_BIT 0x00000100 Passed to clear to clear the current depth buffer. ...
...And 23 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
You may have times when you want to have multiple audio parameters be linked so they share the same value even while being changed in some way. For example, perhaps you have a set of oscillators, and two of them need to share the same, configurable volume, or you have a filter that's been applied to certain inputs but not to all of them. ...
...ave to write; and second, that loop uses valuable CPU time on your thread (likely the main thread), and there's a way to offload all that work to the audio rendering thread, which is optimized for this kind of work and may run at a more appropriate priority level than your code. ...
...rendering thread, which is optimized for this kind of work and may run at a more appropriate priority level than your code. The solution is simple, and it involves using an audio node type which, at first glance, doesn't look all that useful: ConstantSourceNode. The technique This is actually a really easy way to do something that sounds like it might be hard to do. You simply need to create a ConstantSourceNode and connect it to all of the AudioParams whose values should be linked to always match each other. ...
...And 8 more matches
ConstantSourceNode - Web APIs
The ConstantSourceNode interface--part of the Web Audio API--represents an audio source (based upon AudioScheduledSourceNode) whose output is single unchanging value. This makes it useful for cases in which you need a constant value coming in from an audio source. In addition, it can be used like a constructible AudioParam by automating the value of its offset or by connecting another node to it; see Controlling multiple parameters with ConstantSourceNode. A ConstantSourceNode has no inputs and exactly one monaural (one-channel) output. The output's value is always the same as the value of the offset parameter. ...
...uctible AudioParam by automating the value of its offset or by connecting another node to it; see Controlling multiple parameters with ConstantSourceNode. A ConstantSourceNode has no inputs and exactly one monaural (one-channel) output. The output's value is always the same as the value of the offset parameter. Number of inputs 0 Number of outputs 1 Constructor ConstantSourceNode() Creates and returns a new ConstantSourceNode instance, optionally specifying an object which establishes initial values for the object's properties. You can also create a ConstantSourceNode whose properties are initialized to their default values by calling AudioContext.createConstantSource(). Properties Inherits properties from its parent interface, AudioScheduledSourceNode, and a...
...edSourceNode, and adds the following properties: offset An AudioParam which specifies the value that this source continuously outputs. The default value is 1.0. Event handlers Inherits event handlers from its parent interface, AudioScheduledSourceNode. Some browsers' implementations of this event handler are part of the AudioScheduledSourceNode interface. onended Fired whenever the ConstantSourceNode data has stopped playing. Methods Inherits methods from its parent interface, AudioScheduledSourceNode. Some browsers' implementations of these methods are part of the AudioScheduledSourceNode interface. start() Schedules a sound to playback at an exact time. stop() Schedules a sound to stop playback at an exact time. Example In the article Controlling multiple parameters ...
...And 7 more matches
ConstantSourceNode.offset - Web APIs
The default value is 1.0. ...
...The default value is 1.0. ...
...The default value is 1.0. ...
...And 5 more matches
BaseAudioContext.createConstantSource() - Web APIs
Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...And 2 more matches
JavaScript OS.Constants
JavaScript module OS.Constants contains Operating System-specific constants. This module is largely a companion to js-ctypes. 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/osfileconstantsservice;1"]. getService(Components.interfaces.nsIOSFileConstantsService). init(); From a chrome worker No initialization is required. Module OS.Constants is always available for chrome workers. OS.Constants.Sys Constants related to system configuration. Name The name of the operating system (e.g. "Darwin"). DEBUG Set to true on debug build configurations, non-existent otherwise. ...
... libxul The path to the file containing libxul. Useful, for instance, to access the platform code from JavaScript in conjunction with js-ctypes. profileDir The path to the current profile. homeDir The path to the user's home directory. ...
...path to the user's roaming application data directory. winLocalAppDataDir The path to the user's local application data directory. winStartMenuProgsDir The path to the programs subdirectory in the user's start menu. macUserLibDir The path to the user's Library directory. macLocalApplicationsDir The path to the local Applications directory. OS.Constants.libc Constants for interacting with libc. Useful mostly for using js-ctypes to interact with the following platforms: MacOS X; Android; Linux; other variants of Unix. OS.Constants.libc is available on all platforms, although some constants are not defined everywhere. Before using a constant, you should check that it is defined. Error values EACCES Permission denied ...
... O_RDONLY Open the file for read only. O_RDWR Open the file for read and write. O_RSYNC O_SHLOCK Atomically obtain a shared lock. O_SYMLINK Allow opening of symbolic links. O_SYNC (Linux only) Open for purely synchronous access. O_TRUNC Truncate the file. O_WRONLY Open the file for write only. OS.Constants.Win Constants for interacting with the Windows API. OS.Constants.Win is undefined on non-Windows platforms. Useful mostly in conjunction with js-ctypes. (tbd) ...
ConstantSourceNode() - Web APIs
The ConstantSourceNode() constructor creates a new ConstantSourceNode object instance, representing an audio source which constantly outputs samples whose values are always the same. Syntax var constantSourceNode = new ConstantSourceNode(context, options); Parameters context An AudioContext representing the audio context you want the node to be associated with. options A ConstantSourceOptions dictionary object defining the properties you want the ConstantSourceNode to have: offset: A read-only AudioParam specifying the constant value generated by the source. The default is 1.0. The normal range is -1.0 to 1.0, but the value can be anywhere in the range from -Infinity to +Infinity. ...
... options A ConstantSourceOptions dictionary object defining the properties you want the ConstantSourceNode to have: offset: A read-only AudioParam specifying the constant value generated by the source. The default is 1.0. The normal range is -1.0 to 1.0, but the value can be anywhere in the range from -Infinity to +Infinity. Example In this example, an audio context is created, then a ConstantSourceNode is established with its offset initialized to 0.5. let audioContext = new AudioContext(); let myConstantSource = new ConstantSourceNode(audioContext, { offset: 0.5 }); Note: The new ConstantSourceNode created by the constructor has a channelCount of 2. ...
...t is created, then a ConstantSourceNode is established with its offset initialized to 0.5. let audioContext = new AudioContext(); let myConstantSource = new ConstantSourceNode(audioContext, { offset: 0.5 }); Note: The new ConstantSourceNode created by the constructor has a channelCount of 2. Specifications Specification Status Comment Web Audio APIThe definition of 'ConstantSourceNode: ConstantSourceNode' in that specification. Working Draft ...
Constants - Plugins
pleted normally; all data was sent to the instance. NPRES_NETWORK_ERR 1 Stream failed due to problems with network, disk I/O, lack of memory, or other problems. NPRES_USER_BREAK 2 User canceled stream directly by clicking the Stop button or indirectly by some action such as deleting the instance or initiating higher-priority network operations. ...
... NPVERS_HAS_NOTIFICATION 9 Notification of completion. NPVERS_HAS_LIVECONNECT 9 LiveConnect. ...
Index - Web APIs
Web › API › Index
art of the Web Audio API--is a parent interface for several types of audio source node interfaces which share the ability to be started and stopped, optionally at specified times. Specifically, this interface defines the start() and stop() methods, as well as the onended event handler. ...
...fferSourceNode, AudioScheduledSourceNode, ConstantSourceNode, Event Handler, Media, OscillatorNode, Property, Web Audio API, onended The onended event handler for the AudioScheduledSourceNode interface specifies an EventHandler to be executed when the ended event occurs on the node. This event is sent to the node when the concrete interface (such as AudioBufferSourceNode, OscillatorNode, or ConstantSourceNode) determines that it has stopped playing. 183 AudioScheduledSourceNode.start() API, Audio, AudioScheduledSourceNode, Media, Method, NeedsExample, Node, Reference, Web Audio API, play, sound, start undefined 184 AudioScheduledSourceNode.stop() API, Audio, AudioScheduledSourceNode, Media, Method, Reference, Web Audio API, sound, stop The stop() meth...
... 232 BaseAudioContext.createChannelMerger() API, Audio, AudioContext, BaseAudioContext, Method, Reference, Web Audio API, createChannelMerger A ChannelMergerNode. 233 BaseAudioContext.createChannelSplitter() API, AudioContext, BaseAudioContext, Method, Reference, Web Audio API, createChannelSplitter A ChannelSplitterNode. 234 BaseAudioContext.createConstantSource() API, Audio, AudioContext, BaseAudioContext, ConstantSourceNode, Media, Method, createConstantSource The createConstantSource() property of the BaseAudioContext interface creates a ConstantSourceNode object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value. 235 BaseAudioContext.createConvolver...
...And 17 more matches
source-editor.jsm
tions (such as find() followed by findNext()). This can be -1 if the string was never found. ignoreCase Boolean true if the search was case sensitive; otherwise false. readOnly Boolean Set this value to true to make the editor read only, thereby preventing the user from making changes. Set it to false to allow editing. Constants Preference name constants These constants define the names of preferences used by the source editor. Constant Value Description SourceEditor.PREFS.COMPONENT "devtools.editor.component" A string indicating the name of the source editor engine to use; this is "orion" by default. The source editor code module loads a module by the name "source-editor-<component>.jsm"...
...r-<component>.jsm" and exposes its API as part of the SourceEditor object. SourceEditor.PREFS.EXPAND_TAB "devtools.editor.expandtab" A Boolean value that indicates whether or not to automatically expand tabs out to a series of spaces. SourceEditor.PREFS.TAB_SIZE "devtools.editor.tabsize" An integer value that specifies the number of spaces per tab. Editor mode constants These constants are used to set the syntax highlighting mode for the editor by calling its setMode() method, or in the configuration object when first initializing the editor using its init() method. Constant Value Description SourceEditor.MODES.CSS "css" Cascading Style Sheet. SourceEditor.MODES.HTML "html" HTML document. SourceEditor.MODES...
...s init() method. Constant Value Description SourceEditor.MODES.CSS "css" Cascading Style Sheet. SourceEditor.MODES.HTML "html" HTML document. SourceEditor.MODES.JAVASCRIPT "js" JavaScript source code. SourceEditor.MODES.TEXT "text" UTF-8 text document. SourceEditor.MODES.XML "xml" XML document. ...
...And 11 more matches
Index
Mozilla › Tech › XPCOM › Index
Parent Returns parent node in accessible tree. 282 PreviousSibling Returns previous node in accessible tree. 283 RelationsCount Returns the number of accessible relations for this object. 284 Role Enumerated accessible role for the associated element. The values depend on platform because of variations. See the ROLE_* constants in roles documentation. 285 SetSelected This method adds or remove this accessible to the current selection. 286 TakeFocus This method focuses this accessible node. 287 TakeSelection This method selects this accessible node only. 288 Value Accessible value -- a number or a secondary text equivalent for this no...
...quivalent for this node. Widgets that use role attribute can force a value using the valuenow attribute. 289 nsIAccessibleCaretMoveEvent Interfaces, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference No summary! 290 nsIAccessibleCoordinateType Accessibility, Interfaces, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference Prior to Gecko 1.9, these constants were implemented in nsIAccessibleText. 291 nsIAccessibleDocument Accessibility, Interfaces, Interfaces:Scriptable, XPCOM, XPCOM API Reference, XPCOM Interface Reference You can QueryInterface to nsIAccessibleDocument from the nsIAccessible or nsIAccessNode for the root node of a document. You can also get one from nsIAccessNode.GetAccessibleDocument() or nsIAccessibleEvent.Ge...
...le child of the object to the object's selection. If the specified object is already selected, then it does nothing. 313 nsIAccessibleStateChangeEvent Interfaces, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference None. 314 nsIAccessibleStates Accessibility, Interfaces, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference Prior to Gecko 1.9, these constants were implemented in nsIAccessible. 315 nsIAccessibleTable Accessibility, Interfaces, Interfaces:Scriptable, NeedsContent, XPCOM, XPCOM API Reference Return the accessible object at the specified row and column in the table. If both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the c...
...And 9 more matches
Python binding for NSS
style in the NSS/NSPR C header files. Classes are camel-case. Class names always begin with a upper case letter and are then followed by a mix of lower and upper case letters, a upper case letter is used to separate words. Acronyms always appear as a contiguous string of upper case letters. Method, function and property names are always lower case with words seperated by underscores. Constants are all upper case with words seperated by underscores, they match the NSS/NSPR C API. Every module, class, function, and method has associated documentation and is exposed via the standard Python methodology. This documentation is available via the numerous Python documentation extraction tools. Also see the generated HTML documentation provided with each release. NSS/NSPR structs are exp...
...ecify all parameters yet allowing them to be overriden when necessary. Error codes are never returned from methods/functions. python-nss follows the existing Python exception mechanism. Any error reported by NSS/NSPR is converted into a Python exception and raised. The exact error code, error description, and often contextual error information will be present in the exception object. Enumerated constants used in the NSS/NSPR API's are available in the Python module under the exact same name as they appear in the C header files of NSS/NSPR. Convenience functions are provided to translate between the numeric value of an enumerated constant and it's string representation and visa versa. python-nss internally supports UTF-8. Strings may be Python str objects or Python unicode objects. If a Python u...
...M Tag PYNSS_RELEASE_1_0_1 Source Download https://ftp.mozilla.org/pub/mozilla.org/security/python-nss/releases/PYNSS_RELEASE_1_0_1/src/ Change Log Add TLS 1.3 cipher suites ssl_cipher_info.py now attempts to enable TLS 1.3 Fix build issue in setup.py. python-nss can now be build as Python wheel, e.g. ...
...And 8 more matches
OS.File for the main thread
, this operation is handled directly by the operating system itself, which makes it as fast as possible. let promise = OS.File.copy("oldname.txt", "newname.txt"); This example requires Firefox 16 or a more recent version. Example: Path manipulation The following snippet obtains the path to file "sessionstore.js", contained in the user's profile directory. let sessionstore = OS.Path.join(OS.Constants.Path.profileDir, "sessionstore.js"); // Under Linux, this is generally "$HOME/.firefox/Profiles/$PROFILENAME/sessionstore.js" // Under MacOS, this is generally "$HOME/Library/Application Support/Firefox/$PROFILENAME/sessionstore.js" // Under Windows, this is generally "%APPDATA%\Local\temp\%PROFILENAME%"\sessionstore.js // etc. Example: Determine if a file is a directory The follo...
...ght = img.naturalHeight; var ctx = canvas.getContext('2d'); ctx.drawImage(img, 0, 0); (canvas.toBlobHD || canvas.toBlob).call(canvas, function(b) { var r = Cc['@mozilla.org/files/filereader;1'].createInstance(Ci.nsIDOMFileReader); //new FileReader(); r.onloadend = function() { // r.result contains the ArrayBuffer. ...
...t the time of this writing, write does not support encoding option so the text to be written has to be encoded with TextEncoder. This example also shows the resolve value of open (an instance of OS.File, this is a file, so you can do any of the methods on it found here), write (a number indicating bytes written), and close (undefined, meaning there is no resolve value). ...
...And 6 more matches
nsIDOMWindowUtils
image animation mode of the window. The attribute's value must be one of the animationMode values from imgIContainer. IMEIsOpen boolean Returns the IME open state. True if it's open, otherwise false. This attribute only works when IMEStatus is IME_STATUS_ENABLED. Read only. IMEStatus unsigned long Returns the current IME status. Values correspond to the IME_STATUS_* constants defined below. Read only. isMozAfterPaintPending boolean Returns true if a MozAfterPaint event has been queued but not yet fired. Read only. layerManagerType AString What type of layer manager the widget associated with this window is using. "Basic" is unaccelerated; other types are accelerated. Throws an error if there is no widget associated with this window. Rea...
... float Returns the number of screen pixels per CSS pixel. Read only. audioMuted boolean With this it's possible to mute all the MediaElements in this window. We have audioMuted and audioVolume to preserve the volume across mute/umute. audioVolume float Range: greater or equal to 0. The real volume level is affected by the volume of all ancestor windows. Constants Constant Value Description MODIFIER_ALT 0x0001 getModifierState("Alt") of the send event will return true if this is specified for aModifiers of send*Event() except sendNative*Event(). MODIFIER_CONTROL 0x0002 getModifierState("Control") of the send event will return true if this is specified for aModifiers of send*Event() except sendNative*Event(). ...
...ode, in long aModifiers, in unsigned long aAdditionalFlags Optional ); Deprecated since Gecko 38.0 boolean sendKeyEvent( in AString aType, in long aKeyCode, in long aCharCode, in long aModifiers, in boolean aPreventDefault Optional ); Obsolete since Gecko 15.0 Parameters aType Event type. aKeyCode Key code. aCharCode Character code. aModifiers Modifiers pressed. Using constants defined in nsIDOMNSEvent. Obsolete since Gecko 15.0 Using constants defined as MODIFIER_*. aPreventDefault Optional Obsolete since Gecko 15.0 If true, preventDefault() the event before dispatch. aAdditionalFlags Optional 0 or KEY_FLAG_PREVENT_DEFAULT and/or one of KEY_FLAG_LOCATION_*. If KEY_FLAG_PREVENT_DEFAULT is specified, the dispatching key event's default is prevented. If KEY_FLAG...
...And 6 more matches
nsITextInputProcessor
DOMString aString); void shareModifierStateOf(in nsITextInputProcessor aOther); boolean startComposition([optional] in nsIDOMKeyEvent aDOMKeyEvent, [optional] in unsigned long aKeyFlags); Attributes Attribute Type Description hasComposition boolean Whether the instance has composition or not. true if it has composition. Read only. Constants Constant Value Description ATTR_RAW_CLAUSE 0x02 A clause attribute. This means that the clause is not converted, i.e., raw text of user input. ATTR_RAW_SELECTED_CLAUSE 0x03 A clause attribute but this is typically not used. This means that the clause is not converted but selected to convert or modify. ATTR_CONVERTED_CLAUSE 0x04 A cl...
...tring which is set by setPendingCompositionString(). Sum of aLength must be same as the length of aString of setPendingCompositionString(). void appendClauseToPendingComposition(in unsigned long aLength, in unsigned long aAttribute); Parameters aLength The length of appending clause. aAttribute The attribute of appending clause. Must be one of ATTR_* constants. beginInputTransaction() This must be called before starting composition every time. This tries to get the rights to create composition on the window. If no other instance is composing on the window, this associates the instance with the window and registers the callback to the instance. boolean beginInputTransaction(in nsIDOMWindow aWindow, in nsITextInputProces...
...vent Optional, in unsigned long aKeyFlags Optional); Parameters aDOMKeyEvent Optional When the canceling composition is caused by a key operation, this should be specified. If this is specified, keyboard events may be dispatched when Gecko thinks that they should be. See also How to create KeyboardEvent instance for nsITextInputProcessor. aKeyFlags Optional See KEY_* constants. If this is not specified, the value is assumed as 0. commitComposition() Commits the composition with the last composition string. If you call this when there is no composition, this throws an exception. void commitComposition(in nsIDOMKeyEvent aDOMKeyEvent Optional, in unsigned long aKeyFlags Optional); Parameters aDOMKeyEvent Optional When the committing composi...
...And 6 more matches
nsIAccessibleStates
More than 1 allowed. Constant Value Description STATE_UNAVAILABLE 0x00000001 The object is unavailable, that is disabled. ...
...More than 1 allowed. Constant Value Description STATE_UNAVAILABLE 0x00000001 The object is unavailable, that is disabled. ...
...More than 1 allowed. Constant Value Description STATE_UNAVAILABLE 0x00000001 The object is unavailable, that is disabled. ...
...And 4 more matches
nsIAccessibleText
ionNum, in long startOffset, in long endOffset); Attributes Attribute Type Description caretOffset long The current current caret offset. If set < 0 then caret will be placed at the end of the text. characterCount long Read only. defaultTextAttributes nsIPersistentProperties Return the text attributes that apply to the entire accessible. Read only. selectionCount long Read only. Constants Text Offset Constants Constant Value Description TEXT_OFFSET_END_OF_TEXT -1 Will be treated as the equal to the end of the text. TEXT_OFFSET_CARET -2 Will be treated as the caret position. Text Boundary Constants Constant Value Description BOUNDARY_CHAR 0 BOUNDARY_WORD_START 1 BOUNDARY_WORD_END 2 BOUNDARY_SENTENCE_START 3 Do not use in new code. BOUNDARY_SENTENCE_E...
...Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. ...
...turn its bounding box. The valid range is 0..length. x X coordinate of the bounding box of the referenced character. y Y coordinate of the bounding box of the referenced character. width Width of the bounding box of the referenced character. height Height of the bounding box of the referenced character. coordType Specifies if the coordinates are relative to the screen or to the parent window (see constants declared in nsIAccessibleCoordinateType.Constants). getOffsetAtPoint() Get the text offset at the given point, or return -1 if no character exists at that point. long getOffsetAtPoint( in long x, in long y, in unsigned long coordType ); Parameters x The position's x value for which to look up the index of the character that is rendered on to the display at that point. y The position's y ...
...And 4 more matches
confirm - Archive of obsolete content
ogTitle The string to be used as the dialog title. Defaults to "Confirm" (or the localized equivalent). aButtonFlags A set of flags defining the buttons that should appear in the dialog. ...
...as the dialog title. Defaults to "Confirm" (or the localized equivalent). aButtonFlags A set of flags defining the buttons that should appear in the dialog. The value is calculated by multiplying the corresponding button position constant with a button title constant for each button, then adding the results and any additional options (see Other constants). ...
...e is calculated by multiplying the corresponding button position constant with a button title constant for each button, then adding the results and any additional options (see Other constants). ...
...And 3 more matches
nsIDocShell
boolean Attribute stating if it should allow subframes (framesets/iframes) or not. allowWindowControl boolean Specifies whether or not content is allowed to control the window (that is, to resize or move the window). Default is true, which lets content control the window. appType unsigned long The type of application that created this window. Types are defined in Constants. busyFlags unsigned long Current busy state for DocShell. Valid states are defined in Constants. Read only. canExecuteScripts boolean Whether this docshell can execute scripts based on its hierarchy. The rule of thumb here is that we disable js if this docshell or any of its parents disallow scripting, unless the only reason for js being disabled in this docshell is ...
...nd should be treated accordingly. layoutHistoryState nsILayoutHistoryState loadedTransIndex long Keeps track of the previous SHTransaction index and the current SHTransaction index at the time that the doc shell begins to load. Used for ContentViewer eviction. Read only. loadType unsigned long Load type for the document. Valid states are defined in Constants. Note that nsIDocShell may use other states internally so you should check for the specific state bit. marginHeight long The value of the marginheight attribute on the frame element, or negative if it was not set. marginWidth long The value of the marginwidth attribute on the frame element, or negative if it was not set. parentCharset nsIAtom Indi...
...t. parentCharset nsIAtom Indicates the DocShell's parent document's character set. Note: Prior to Gecko 12.0, this attribute was part of a separate nsIDocCharsetInfo interface. parentCharsetSource PRInt32 Indicates the source from which the character set being used was obtained. Higher numbers override lower ones. See Character set source constants for defined values. Note: Prior to Gecko 12.0, this attribute was part of a separate nsIDocCharsetInfo interface. parentURIContentListener nsIURIContentListener URI content listener parent. This is not refcounted and is assumed to be nulled out by the parent when the parent is going away. Obsolete since Gecko 1.8 presContext nsPresContext Presenta...
...And 3 more matches
nsINavBookmarkObserver
It is called before the actual removal takes place. void onBeforeItemRemoved( in long long aItemId, in unsigned short aItemType, in long long aParentId, in ACString aGUID, in ACString aParentGUID ); Parameters aItemId The id of the bookmark that will be removed. aItemType The type of the item that is about to be removed; this is one of the nsINavBookmarksService.Type constants. aParentId The id of the folder containing the item. aGUID The unique ID associated with the item. aParentGUID The unique ID associated with the item's parent. onBeginUpdateBatch() This method notifies this observer that a batch transaction has started. Other notifications will be sent during the batch change, but the observer is guaranteed that onEndUpdateBatch() will...
...sIURI aURI, in AUTF8String aTitle, in PRTime aDateAdded, in ACString aGUID, in ACString aParentGUID ); Parameters aItemId The id of the item that was added. aParentId The id of the folder to which the item was added. aIndex The item's index in the folder. aItemType The type of the item that was added. This should be one of the nsINavBookmarksService.Type constants. aURI The URI of the item that was added when aItemType is TYPE_BOOKMARK, null otherwise. aTitle The title of the added item. aDateAdded The stored date added value, in microseconds from the epoch. aGUID The unique ID associated with the item. aParentGUID The unique ID associated with the item's parent. onItemChanged() This method notifies this observ...
...f an item annotation. If this is true, aNewValue is always an empty string. aNewValue The items new value, if required by the property specified by aProperty. aLastModified The value to set the items last modified time to, or 0 if the value should remain unchanged. aItemType The type of the item that has been changed. This should be one of the nsINavBookmarksService.Type constants. aParentId The id of the folder containing the item. aGUID The unique ID associated with the item. aParentGUID The unique ID associated with the item's parent. Notes This table indicates what aNewValue should be depending on property specified by aProperty: Property string Value "cleartime" Empty string; this property means the history was delet...
...And 3 more matches
nsINavHistoryQueryOptions
r using locale-sensetive sorting (as opposed to letting the database do it for us). Instead, we get the result ordered by date, pick the maxResult most recent ones, and then sort by title. queryType short The type of search to use when querying the DB; This attribute is only honored by query nodes. It is silently ignored for simple folder queries. See Query type constants for possible values. redirectsMode unsigned short Specifies how to handle redirects; see Redirects mode constants for details. The default value is REDIRECTS_MODE_ALL. Note: This option is only used on QUERY_TYPE_HISTORY. resolveNullBookmarkTitles boolean If a bookmark title is NULL (note, not empty), atte...
...onstants for details. The default value is REDIRECTS_MODE_ALL. Note: This option is only used on QUERY_TYPE_HISTORY. resolveNullBookmarkTitles boolean If a bookmark title is NULL (note, not empty), attempt to use the history title. It is set to false by default. resultType short Sets the result type. See Result type constants for possible values. showSessions boolean Separate/group history items based on session information. Only matters when sorting by date. sortingAnnotation AUTF8String The annotation to use in SORT_BY_ANNOTATION_* sorting modes. sortingMode short The sorting annotation to use; see Sorting methods for possible values...
...le values. showSessions boolean Separate/group history items based on session information. Only matters when sorting by date. sortingAnnotation AUTF8String The annotation to use in SORT_BY_ANNOTATION_* sorting modes. sortingMode short The sorting annotation to use; see Sorting methods for possible values. Constants Sorting methods You can ask for the results to be pre-sorted. Since the DB has indices of many items, it can produce sorted results almost for free. Note: re-sorting is slower, as is sorting by title or when you have a host name. Constant Value Description SORT_BY_NONE 0 For bookmark items, this constant means sort by the natural bookmark ord...
...And 3 more matches
RTCPeerConnection - Web APIs
w, you should instead wait for a the promise returned by peerIdentity to resolve with an identity. removestream Sent to the RTCPeerConnection when a MediaStream is removed from the connection. Instead of watching for this obsolete event, you should watch each stream for removetrack events on each stream within the RTCPeerConnection. Also available as the onaddstream event handler property. Constants RTCBundlePolicy enum The RTCBundlePolicy enum defines string constants which are used to request a specific policy for gathering ICE candidates if the remote peer isn't "BUNDLE-aware" (compatible with the SDP BUNDLE standard for bundling multiple media streams on a single transport link). All browser implementations are BUNDLE-aware. If the remote endpoint is BUNDLE-aware, all media tracks and...
...DLE-aware, everything is negotiated on these separate DTLS transports. "max-bundle" The ICE agent initially creates only a single RTCDtlsTransport to carry all of the RTCPeerConnection's data. If the remote endpoint is not BUNDLE-aware, then only a single track will be negotiated and the rest ignored. RTCIceConnectionState enum The RTCIceConnectionState enum defines the string constants used to describe the current state of the ICE agent and its connection to the ICE server (that is, the STUN or TURN server). Constant Description "new" The ICE agent is gathering addresses or is waiting to be given remote candidates through calls to RTCPeerConnection.addIceCandidate() (or both). "checking" The ICE agent has been given one or more remote ca...
..." and may trigger intermittently and resolve just as spontaneously on less reliable networks, or during temporary disconnections. When the problem resolves, the connection may return to the "connected" state. "closed" The ICE agent for this RTCPeerConnection has shut down and is no longer handling requests. RTCIceGatheringState enum The RTCIceGatheringState enum defines string constants which reflect the current status of ICE gathering, as returned using the RTCPeerConnection.iceGatheringState property. You can detect when this value changes by watching for an event of type icegatheringstatechange. Constant Description "new" The peer connection was just created and hasn't done any networking yet. "gathering" The ICE agent is in the proces...
...And 3 more matches
A first splash into JavaScript - Learn web development
Variables are basically containers for values (such as numbers, or strings of text). You create a variable with the keyword let (or var) followed by a name for your variable (you'll read more about the difference between the keywords in a future article). Constants are used to store values that are immutable or can't be changed and are created with ...
... guessCount = 1; let resetButton; This section of the code sets up the variables and constants we need to store the data our program will use. Variables are basically containers for values (such as numbers, or strings of text). You create a variable with the keyword let (or var) followed by a name for your variable (you'll read more about the difference between the keywords in a future article). Constants are used to store values that are immutable or can't be changed and are created with the keyword const. In this case, we are using constants to store references to parts of our user interface; the text inside some of them might change, but the HTML elements referenced stay the same. You can assign a value to your variable or constant with an equals sign (=) followed by the value you want to give...
... of our user interface; the text inside some of them might change, but the HTML elements referenced stay the same. You can assign a value to your variable or constant with an equals sign (=) followed by the value you want to give it. In our example: The first variable -- randomNumber -- is assigned a random number between 1 and 100, calculated using a mathematical algorithm. ...
...And 2 more matches
Accessing the Windows Registry Using XPCOM
ar id = wrk.readStringValue("ProductId"); wrk.close(); This example, while simple, shows several important things about using the interface. First, you must use createInstance() to get an object implementing this interface, not getService(). Second, you must call open() on the key before attempting to read a value. Notice in the open() call that the root key to use is specified using the named constants available on the nsIWindowsRegKey interface, in this case ROOT_KEY_LOCAL_MACHINE, which corresponds to HKEY_LOCAL_MACHINE in the Windows registry. Also notice that the path to the key has backslashes escaped, a necessity in JavaScript and C++ string constants. The desired access rights are specified using a named constant from the interface, in this example ACCESS_READ. This can be very importan...
.... The example above demonstates this using the open() method. If you want to create a new key, you can use the create() method, which takes the same parameters as open(). Note that it is not an error to call create() on an existing key, and doing so has the same result as calling open(). Both of these methods take a root key as the first parameter. From JavaScript, you will want to use the named constants on the interface for this parameter. They are: ROOT_KEY_CLASSES_ROOT -- Corresponds to HKEY_CLASSES_ROOT ROOT_KEY_CURRENT_USER -- Corresponds to HKEY_CURRENT_USER ROOT_KEY_LOCAL_MACHINE -- Corresponds to HKEY_LOCAL_MACHINE The second parameter for open() and create() is the path to the key. As noted in the example above, you will need to escape backslashes within the string. The third par...
...ading values. The simple example above shows how to read an existing string value. However, Windows registry values can have several data types, so you need to ensure that you read the correct type. You can check the type of a value using the method getValueType(). This method returns an integer indicating the data type of the value. ...
...And 2 more matches
nsIApplicationCache
ich stores resources for offline use. 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 nsICacheService.openSession() method, to access the cache's entries. Each entry in the cache can be marked with a set of types, specified in the Constants section. All application caches with the same group ID belong to a cache group. Each group has one "active" cache that will service future loads. Inactive caches are removed from the cache when no longer referenced. Method overview void activate(); void addNamespaces(in nsIArray namespaces); void discard(); void gatherEntries(in PRUint32 typeBits, out unsigned long count, [array, size_is...
...tring The client ID for this application cache. Clients can open a session with nsICacheService.createSession() using this client ID and a storage policy of STORE_OFFLINE to access this cache. Read only. groupID ACString The group ID for this cache group. This is the URI of the cache manifest file. Read only. usage unsigned long The disk usage of the application cache, in bytes. Read only. Constants Constant Value Description ITEM_MANIFEST 1 This item is the application manifest. ITEM_EXPLICIT 2 This item was explicitly listed in the application manifest. ITEM_IMPLICIT 4 This item was navigated to in a top level browsing context, and named this cache's group as its manifest. ITEM_DYNAMIC 8 This item was added to the cache using the dynamic scripting API. ITEM_FOREIGN 16 This ite...
...e application cache for the group, the group is removed. void discard(); Parameters None. gatherEntries() Returns a list of entries in the cache whose type matches one or more of the specified types. void gatherEntries( in PRUint32 typeBits, out unsigned long count, [array, size_is(count)] out string keys ); Parameters typeBits A bit field indicating the types against which to match. See Constants for a list of types. count On return, indicates how many matching entries were found. keys An array of the keys matching one or more of the types indicated by typeBits. getMatchingNamespace() Returns the most specific namespace matching a given key. nsIApplicationCacheNamespace getMatchingNamespace( in ACString key ); Parameters key The key for the cache entry whose most specific namespace i...
...And 2 more matches
nsIWindowsRegKey
exposed via this interface. It is possible to initialize this object by setting an HKEY on it. In that case, it is the responsibility of the consumer setting the HKEY to ensure that it is a valid HKEY. WARNING: Setting the key does not close() the old key. Native code only! valueCount unsigned long This attribute returns the number of values under this key. Read only. Constants Root key constants The values for these keys correspond to the values from WinReg.h in the MS Platform SDK. The ROOT_KEY_ prefix corresponds to the HKEY_ prefix in the MS Platform SDK. This interface is not restricted to using only these root keys. Constant Value Description ROOT_KEY_CLASSES_ROOT 0x80000000 ROOT_KEY_CURRENT_USER 0x80000001 ...
... to the values from WinReg.h in the MS Platform SDK. The ROOT_KEY_ prefix corresponds to the HKEY_ prefix in the MS Platform SDK. This interface is not restricted to using only these root keys. Constant Value Description ROOT_KEY_CLASSES_ROOT 0x80000000 ROOT_KEY_CURRENT_USER 0x80000001 ROOT_KEY_LOCAL_MACHINE 0x80000002 Access constants Values for the mode parameter passed to the open() and create() methods. The values defined here correspond to the REGSAM values defined in WinNT.h in the MS Platform SDK, where ACCESS_ is replaced with KEY_. This interface is not restricted to using only these access types. Constant Value Description ACCESS_BASIC 0x00020000 ACCESS_QUERY_VALUE 0x0000000...
...The Microsoft documentation should be consulted for the exact meaning of these value types. This interface is somewhat restricted to using only these value types. There is no method that is directly equivalent to RegQueryValueEx or RegSetValueEx. In particular, th...
...And 2 more matches
nsIZipWriter
the comment associated with the currently open Zip file. Exceptions thrown NS_ERROR_NOT_INITIALIZED If no zip file has been opened. file nsIFile The Zip file being written to. Read only. inQueue boolean true if operations are being performed in the background queue, or false if background operations are not in progress. Read only. Constants Constant Value Description COMPRESSION_NONE 0 Do not compress the file. COMPRESSION_FASTEST 1 Use the fastest compression method when adding the file to the archive. COMPRESSION_DEFAULT 6 Use the default compression method when adding the file to the archive. COMPRESSION_BEST 9 Use the best compression method when adding ...
...ntry, in PRTime aModTime, in PRInt32 aCompression, in nsIChannel aChannel, in boolean aQueue ); Parameters aZipEntry The path of the file entry to add to the Zip file. This is the path it will be located at within the Zip file. Note: You must use forward slashes ('/') in the path. aModTime The modification time of the entry in microseconds. aCompression One of the compression constants, indicating the compression method to use. aChannel The channel from which to get the data. aQueue If true, the operation is queued for later execution. If false, the operation is performed immediately. Will be performed when processQueue() is called. Exceptions thrown NS_ERROR_NOT_INITIALIZED No Zip file is open. NS_ERROR_FILE_ALREADY_EXISTS The specified path already exists in the Z...
...File.lastModifiedTime, aQueue); void addEntryFile( in AUTF8String aZipEntry, in PRInt32 aCompression, in nsIFile aFile, in boolean aQueue ); Parameters aZipEntry The path of the file entry to add to the Zip file. This is the path it will be located at within the Zip file. Note: You must use forward slashes in the path. (A forward slash is '/') aCompression One of the compression constants, indicating the compression method to use. aFile The file from which to get the data and modification time. aQueue If true, the operation is queued for later execution. If false, the operation is performed immediately. Will be performed when processQueue() is called. Exceptions thrown NS_ERROR_NOT_INITIALIZED No Zip file is open. NS_ERROR_FILE_ALREADY_EXISTS The specified path already...
...And 2 more matches
XPIDL
ate again) XPIDL syntax (Out of date) XPIDL Author's Guide (Not as out of date) Explanation of IDL semantics A full guide to the syntax can be found at XPIDL:Syntax, which is written in an ABNF form. An xpidl file is essentially just a series of declarations. At the top level, we can define typedefs, native types, or interfaces. Interfaces may furthermore contain typedefs, natives, methods, constants, or attributes. Most declarations can have properties applied to them. Types There are three ways to make types: a typedef, a native, or an interface. In addition, there are a few built-in native types. The built-in native types are those listed under the type_spec production above. The following is the correspondence table: Table 1: Standard IDL types IDL C++ in parameter C++ ...
...ypes. To declare a WebIDL interface in XPIDL, write webidl InterfaceName;. WebIDL types will be passed as mozilla::dom::InterfaceName* when used as in-parameters, as mozilla::dom::InterfaceName** when used as out or inout-parameters, and as RefPtr<mozilla::dom::InterfaceName> when used as an array element. Other WebIDL types (e.g. dictionaries, enums, and unions), are not currently supported. ...
...clare a WebIDL interface in XPIDL, write webidl InterfaceName;. WebIDL types will be passed as mozilla::dom::InterfaceName* when used as in-parameters, as mozilla::dom::InterfaceName** when used as out or inout-parameters, and as RefPtr<mozilla::dom::InterfaceName> when used as an array element. Other WebIDL types (e.g. dictionaries, enums, and unions), are not currently supported. ...
...And 2 more matches
Bootstrapped extensions - Archive of obsolete content
the extension is enabled after being disabled or after it has been shut down in order to install an update. As such, this can be called many times during the lifetime of the application. This is when your add-on should inject its UI, start up any tasks it may need running and so forth. void startup( data, reason ); Parameters data A bootstrap data structure. reason One of the reason constants, indicating why the extension is being started up. This will be one of APP_STARTUP, ADDON_disable, ADDON_INSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE. shutdown Called when the extensidisableon needs to shut itself down, such as when the application is quitting or when the extension is about to be upgraded or disabled. Any user interface that has been injected must be removed, tasks shut down, an...
...ON_DOWNGRADE. shutdown Called when the extensidisableon needs to shut itself down, such as when the application is quitting or when the extension is about to be upgraded or disabled. Any user interface that has been injected must be removed, tasks shut down, and objects disposed of. void shutdown( data, reason ); Parameters data A bootstrap data structure. reason One of the reason constants, indicating why the extension is being shut down. This will be one of APP_SHUTDOWN, ADDON_DISABLE, ADDON_UNINSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE. install Your bootstrap script must include an install() function, which the application calls before the first call to startup() after the extension is installed, upgraded, or downgraded. void install( data, reason ); Parameters data ...
... will be one of APP_SHUTDOWN, ADDON_DISABLE, ADDON_UNINSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE. install Your bootstrap script must include an install() function, which the application calls before the first call to startup() after the extension is installed, upgraded, or downgraded. void install( data, reason ); Parameters data A bootstrap data structure. reason One of the reason constants, indicating why the extension is being installed. This will be one of ADDON_INSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE. uninstall This function is called after the last call to shutdown() before a particular version of an extension is uninstalled. Note: If you open the add-on manager and then click "Remove" on an add-on, it will not call uninstall function right away. This is a soft uninstall...
...o you should make sure it is an uninstall by doing this: function uninstall(aData, aReason) { if (aReason == ADDON_UNINSTALL) { console.log('really uninstalling'); } else { console.log('not a permanent uninstall, likely an upgrade or downgrade'); } } void uninstall( data, reason ); Parameters data A bootstrap data structure. reason One of the reason constants, indicating why the extension is being uninstalled. This will be one of ADDON_UNINSTALL, ADDON_UPGRADE, or ADDON_DOWNGRADE. Reason constants The bootstrap functions accept a reason parameter, which explains to the extension why it's being called. The reason constants are: Constant Value Description APP_STARTUP 1 The application is starting up. APP_SHUTDO...
Gecko info for Windows accessibility vendors
ble See below for the complete list of roles and notes about what we support Intentional Differences with Internet Explorer For the most part, where we support an MSAA feature, we have tried to duplicate Internet Explorer's use of it. Please let us know if you find any differences not listed here: Accessible Relations are Supported The accNavigate() method can be used with new constants defined for Gecko. The results are always returned via VT_DISPATCH. enum { NAVRELATION_LABEL_FOR = 0x1002 }; enum { NAVRELATION_DESCRIPTION_FOR = 0x100f }; These two relations can be used on object to determine what form control is being labelled or desribed. enum { NAVRELATION_LABELLED_BY = 0x1003 }; enum { NAVRELATION_DESCRIBED_BY = 0x100e }; These two relations are they inver...
...Indicates that the absence of STATE_CHECKED should be spoken as // "unchecked", and that EVENT_STATE_CHANGE will be fired in the event that the // checkbox is toggled. const unsigned long STATE_REQUIRED = STATE_ALERT_LOW; // Used on form controls // to indic...
...l and ISimpleDOMDocument.idl file. You must make a header files for them, by running these commands: MIDL ISimpleDOMNode.idl MIDL ISimpleDOMText.idl MIDL ISimpleDOMDocument.idl That will generate ISimpleDOMNode.h and ISimpleDOMDocument.h, which define the interfaces. It will also create ISimpleDOMNode_i.c and ISimpleDOMDocument_i.c, which contain the necessary IID constants. ISimpleDOMNode To get to the ISimpleDOMNode interface for an object, you start with an IAccessible*, and then you QueryService to the ISimpleDOMNode*: IServiceProvider *pServProv = NULL; pAccessible->QueryInterface(IID_IServiceProvider, (void**)&pServProv); ISimpleDOMNode *pSimpleDOMNode; if (pServProv) { const GUID refguid = {0x0c539790, 0x12e4, 0x11cf, 0xb6, 0x61, 0x00, 0...
... HRESULT get_innerHTML([out, retval] BSTR *innerHTML); Finally we provide a method for getting the current ISO 639 language code, such as "en" for English or even possible "en-cockney" for the British Cockney dialect. HRESULT get_language([out, retval] BSTR *language); Please look at the ISimpleDOMNode.idl file for parameter types and the definitions of the node type constants. ISimpleDOMText DOM nodes that are text nodes support ISimpleDOMText. This extension is useful if you need to work on a character by character basis, whereas IAccessible provides only node by node support. Text nodes must be leaf nodes, so there is no need to check for this interface if the current node has any MSAA or DOM children. Text nodes always support ISimpleDOMNode as well as ISimp...
FileUtils.jsm
); nsIFileOutputStream openFileOutputStream(nsIFile file, int modeFlags); nsIFileOutputStream openAtomicFileOutputStream(nsIFile file, int modeFlags); nsIFileOutputStream openSafeFileOutputStream(nsIFile file, int modeFlags); void closeAtomicFileOutputStream(nsIFileOutputStream stream); void closeSafeFileOutputStream(nsIFileOutputStream stream); Constants Constant Value Description MODE_RDONLY 0x01 Corresponds to the PR_RDONLY parameter to PR_OPEN MODE_WRONLY 0x02 Corresponds to the PR_WRONLY parameter to PR_OPEN MODE_CREATE 0x08 Corresponds to the PR_CREATE_FILE parameter to PR_OPEN MODE_APPEND 0x10 Corresponds to the PR_APPEND parameter to PR_OPEN MODE_TRUNCATE ...
...ts } openFileOutputStream() Opens a file output stream for writing. The stream is opened with the DEFER_OPEN nsIFileOutputStream.Behavior flag constant this means the file is not actually opened until the first time it's accessed. nsIFileOutputStream openFileOutputStream( nsIFile file, int modeFlags ); Parameters file The file to write to. modeFlags Optional File open flags (see constants above) Return value Returns nsIFileOutputStream (the non-safe variant) to write to. openAtomicFileOutputStream() Opens an atomic file output stream for writing. Note: 'safe' and 'atomic' file output streams will never append; they will always overwrite an existing file. Starting in Gecko 38.0, passing MODE_APPEND without MODE_TRUNCATE will throw an exception. nsIFileOutputStream openAto...
...tput stream for writing. Note: 'safe' and 'atomic' file output streams will never append; they will always overwrite an existing file. Starting in Gecko 38.0, passing MODE_APPEND without MODE_TRUNCATE will throw an exception. nsIFileOutputStream openAtomicFileOutputStream( nsIFile file, int modeFlags ); Parameters file The file to write to. modeFlags Optional File open flags (see constants above) Return value Returns nsIFileOutputStream (the safe variant) to write to. Note: openAtomicFileOutputStream() is generally better than openSafeFileOutputStream() because flushing is not needed in most of the issues. closeAtomicFileOutputStream() Closes an atomic file output stream. void closeAtomicFileOutputStream( nsIFileOutputStream stream ); Parameters stream The stream to ...
...output stream for writing. Note: 'safe' and 'atomic' file output streams will never append; they will always overwrite an existing file. Starting in Gecko 38.0, passing MODE_APPEND without MODE_TRUNCATE will throw an exception. nsIFileOutputStream openSafeFileOutputStream( nsIFile file, int modeFlags ); Parameters file The file to write to. modeFlags Optional File open flags (see constants above) Return value Returns nsIFileOutputStream (the safe variant) to write to. Remarks Note: Starting in Gecko 6 the stream is opened with the DEFER_OPEN nsIFileOutputStream Behavior flag constant; this means the file is not actually opened until the first time it's accessed. closeSafeFileOutputStream() Closes a safe file output stream. void closeSafeFileOutputStream( nsIFileOutputSt...
NSPR API Reference
ode NSPR Types Calling Convention Types Algebraic Types 8-, 16-, and 32-bit Integer Types Signed Integers Unsigned Integers 64-bit Integer Types Floating-Point Integer Type Native OS Integer Types Miscellaneous Types Size Type Pointer Difference Types Boolean Types Status Type for Return Values Threads Threading Types and Constants Threading Functions Creating, Joining, and Identifying Threads Controlling Thread Priorities Controlling Per-Thread Private Data Interrupting and Yielding Setting Global Thread Concurrency Getting a Thread's Scope Process Initialization Identity and Versioning Name and Version Constants Initialization and Cleanup Module Initialization Locks Lock ...
... Offset Interpretation for Seek Functions I/O Functions Functions that Operate on Pathnames Functions that Act on File Descriptors Directory I/O Functions Socket Manipulation Functions Converting Between Host and Network Addresses Memory-Mapped I/O Functions Anonymous Pipe Function Polling Functions Pollable Events Manipulating Layers Network Addresses Network Address Types and Constants Network Address Functions Atomic Operations PR_AtomicIncrement PR_AtomicDecrement PR_AtomicSet Interval Timing Interval Time Type and Constants Interval Functions Date and Time Types and Constants Time Parameter Callback Functions Functions Memory Management Operations Memory Allocation Functions Memory Allocation Macros String Operations PL_strlen PL_strcpy PL_s...
...PR_GetLibraryPath PR_GetLibraryName PR_FreeLibraryName PR_LoadLibrary PR_UnloadLibrary PR_FindSymbol PR_FindSymbolAndLibrary Finding Symbols Defined in the Main Executable Program Platform Notes Dynamic Library Search Path Exporting Symbols from the Main Executable Program Process Management and Interprocess Communication Process Management Types and Constants PRProcess PRProcessAttr Process Management Functions Setting the Attributes of a New Process Creating and Managing Processes Multiwait Receive System Information and Environment Variables Logging Conditional Compilation and Execution Log Types and Variables PRLogModuleInfo PRLogModuleLevel NSPR_LOG_MODULES NSPR_LOG_FILE Logging Functions ...
...e Instrumentation Counters Named Shared Memory Shared Memory Protocol Named Shared Memory Functions Anonymous Shared Memory Anonymous Memory Protocol Anonymous Shared Memory Functions IPC Semaphores IPC Semaphore Functions Thread Pools Thread Pool Types Thread Pool Functions Random Number Generator Random Number Generator Function Hash Tables Hash Tables and Type Constants Hash Table Functions NSPR Error Handling Error Type Error Functions Error Codes ...
Index
integer. It implements the ToInt32 operator described in ECMA 262-3 ?9.6. 80 JS::ToUint64 JSAPI Reference, Reference, Reference(2), SpiderMonkey JS::ToInt64 converts a JavaScript value to an unsigned 64bit integer. 81 JS::TrueHandleValue JSAPI Reference, Reference, Reference(2), SpiderMonkey JS::TrueHandleValue and JS::FalseHandleValue are JS::HandleValue constants that represent the JavaScript values true and false. 82 JS::TrueValue JSAPI Reference, Reference, Reference(2), SpiderMonkey JS::TrueValue creates a JS::Value that represents the JavaScript value true. 83 JS::UndefinedHandleValue JSAPI Reference, Reference, Reference(2), SpiderMonkey JS::UndefinedHandleValue is a JS::HandleValue constant that represents t...
...onkey Note that when a custom object is called, a this argument is calculated for it just as if it were a function. That is, the obj argument received by the JSNative is the this argument, not the custom object that was called! 92 JSClass.flags JSAPI Reference, SpiderMonkey The flags field is of type uint32_t. Its value is the logical OR of zero or more of the following constants: 93 JSConstDoubleSpec JSAPI Reference, SpiderMonkey JSConstDoubleSpecs is used to define a set of double values that are assigned as properties to an object using JS_DefineConstDoubles. 94 JSConvertOp JSAPI Reference, Reference, Reference(2), SpiderMonkey JSConvertOp callback specifies conversion behavior for objects having this class, implementing the EC...
...is undefined. 176 JSVAL_TO_STRING JSAPI Reference, Obsolete, SpiderMonkey JSVAL_TO_STRING casts the argument, v, to type JSString *. As a precondition, JSVAL_IS_STRING(v) must be true. This function is not type-safe: if v is not a string, the behavior is undefined. 177 JSVAL_TRUE JSAPI Reference, Obsolete, SpiderMonkey JSVAL_TRUE and JSVAL_FALSE are jsval constants that represent the JavaScript boolean values, true and false. They are equivalent to BOOLEAN_TO_JSVAL(true) and BOOLEAN_TO_JSVAL(false), respectively. 178 JSVAL_UNLOCK JSAPI Reference, Obsolete, SpiderMonkey JSVAL_UNLOCK is a deprecated feature that is supported only for backward compatibility with existing applications. To unlock a value, use local roots with JS_RemoveRoot. ...
...e, SpiderMonkey JS_GetTypeName returns a pointer to a string literal description of a specified JS data type, type. The following table lists JSTypes and the string literals reported by JS_GetTypeName: 347 JS_GetVersion JSAPI Reference, SpiderMonkey JS_GetVersion returns the JavaScript version currently used by the given JSContext, cx. The result is one of the JSVersion constants. 348 JS_HasArrayLength JSAPI Reference, Obsolete, SpiderMonkey JS_HasArrayLength determines if an object, obj, has a length property. If the property exists, JS_HasArrayLength stores the current value of the property in *lengthp. 349 JS_HasElement JSAPI Reference, Reference, Reference(2), SpiderMonkey JS_HasElement examines a specified JS object, obj, and...
nsIAuthPrompt
SAVE_PASSWORD_FOR_SESSION 1 Saves the password for the session. SAVE_PASSWORD_PERMANENTLY 2 Saves the password permanently. Methods prompt() This method puts up a text input dialog with OK and Cancel buttons. boolean prompt( in wstring dialogTitle, ...
...pt( in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, in wstring defaultText, out wstring result ); Parameters dialogTitle The title of the dialog. text The text of the prompt message dialog box. passwordRealm The password realm. For example, ldap://localhost/dc=test. savePassword Saving password option. One of the SAVE_PASSWORD_* constants defaultText The default text for the text input dialog box. result The result of the dialog box, OK or Cancel buttons. Return value true for OK, false for Cancel. promptPassword() This method puts up a password dialog with OK and Cancel buttons. Note: If a username is specified, the username should be escaped. boolean promptPassword( in wstring dialogTitle, in wstring text, in ws...
...the dialog. text The text of the prompt message dialog box. passwordRealm The password realm. For example, ldap://localhost/dc=test. If a username is specified (http://user@site.com) it will be used when matching existing logins or saving new ones. If no username is specified, only password-only logins will be matched or saved. savePassword Saving password option. One of the SAVE_PASSWORD_* constants pwd The password entered by the user if OK was selected. Return value true for OK, false for Cancel. promptUsernameAndPassword() This method puts up a username/password dialog with OK and Cancel buttons. boolean promptUsernameAndPassword( in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, inout wstring user, inout wstring pwd ); Para...
... pwd The password entered by the user if OK was selected. Return value true for OK, false for Cancel. ...
nsIFilePicker
An enumerator of the currently selected files. Read only. Note: Only works with modeOpenMultiple mode. fileURL nsIURI The URI of the currently selected file or directory. Read only. filterIndex long The (0-based) index of the filter which is currently selected in the file picker dialog. Set this to choose a particular filter to be selected by default. Constants Mode constants These constants are used to specify the type of file picker to create when calling init(). Constant Value Description modeOpen 0 Load a file. modeSave 1 Save a file. modeGetFolder 2 Select a folder/directory. modeOpenMultiple 3 Load multiple files. Return value constants These values are returned ...
...icating the result of the file picker activity. Constant Value Description returnOK 0 The file picker dialog was closed by the user hitting 'Ok' returnCancel 1 The file picker dialog was closed by the user hitting 'Cancel' returnReplace 2 The user chose an existing file and acknowledged that they want to overwrite the file Filter constants These constants are used to create filters for commonly-used file types. For the most up to date list see filepicker.properties. Constant Value Description filterAll 0x001 Corresponds to the *.* filter for file extensions. All files will pass through the filter. filterHTML 0x002 Corresponds to the *.html, *.htm, *.shtml and *.xhtml filters for file e...
...nitialize the file picker widget. The file picker is not valid until this method is called. void init( in nsIDOMWindow parent, in AString title, in short mode ); Parameters parent The nsIDOMWindow parent. This dialog will be dependent on this parent. Must be non-null. title The file picker dialog title. If this is null, the dialog will have the default title. mode One of the mode constants, indicating the type of picker to create. open() Opens the file dialog asynchrounously. The passed in object's done method will be called upon completion. void open( in nsIFilePickerShownCallback aFilePickerShownCallback ); Parameters aFilePickerShownCallback The nsIFilePickerShownCallback to be called on completion. show() Obsolete since Gecko 57.0 (Firefox 57.0 / ...
...FilePickerShownCallback aFilePickerShownCallback ); Parameters aFilePickerShownCallback The nsIFilePickerShownCallback to be called on completion. show() Obsolete since Gecko 57.0 (Firefox 57.0 / Thunderbird 57.0 / SeaMonkey 2.54) Displays the file picker dialog. The dialog is displayed modally. short show(); Parameters None. Return value One of the return constants. Example Here's an example: const nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"] .createInstance(nsIFilePicker); fp.init(window, "Dialog Title", nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterAll | nsIFilePicker.filterText); fp.open(function (rv) { if (rv == nsIFilePicker.returnOK || rv == nsIFilePicke...
nsIScriptError
mber where the error occurred. This is used to draw the arrow pointing to the problem character. Read only. errorMessage AString The error message in a string format without any context/line number information. Note: nsIConsoleMessage.message will return the error formatted with file/line information. Read only. flags PRUint32 Flags; see Flag constants for a list. Read only. innerWindowID unsigned long long The inner window ID with which the error is associated. This is zero if the error was initialized by calling nsIScriptError.init() instead of initWithWindowID(). Read only. lineNumber PRUint32 The number of the line where the error occurred. Read only. outerWindowID unsigned long long The window ...
...Console. Read only. sourceName AString The URL of the file in which the error occurred. This will be a hyperlink in the JavaScript Console, so you should use a real URL. You may pass null if it's not applicable. Read only. timeStamp long long Elapsed time, in milliseconds, from a platform-specific zero time to the time the message was created. Read only. Flag constants Constant Value Description errorFlag 0x0 Error messages. A pseudo-flag for the default, error case. warningFlag 0x1 Warning messages. exceptionFlag 0x2 An exception was thrown for this case - exception-aware hosts can ignore this. strictFlag 0x4 One of the flags declared in nsIScriptError. infoFlag 0x8 Just...
...ile on which the error occurred. You are responsible for providing that line. You may pass null if you are lazy; that will prevent showing the source line in JavaScript Console. lineNumber The number of the line where the error occurred. columnNumber The column number where the error occurred. This is used to draw an arrow pointing to the problem character. flags One of flags listed in Flag constants. category A string indicating what kind of code caused the message. There are quite a few category strings and they don't seem to be listed in a single place. See Categories for a partial list. initWithWindowID() Initializes the nsIScriptError object with the given inner window's ID. Note: Prior to Gecko 12.0, this method was provided by the nsIScriptError2 interface, which has now been me...
...le on which the error occurred. You are responsible for providing that line. You may pass null if you are lazy; that will prevent showing the source line in JavaScript Console. lineNumber The number of the line where the error occurred. columnNumber The column number where the error occurred. This is used to draw an arrow pointing to the problem character. flags One of the script error Flag constants category A string indicating what kind of code caused the message. There are quite a few category strings and they aren't listed in a single place, so you may need to search the Firefox code to find the one you want. See Categories for a partial list. innerWindowID The ID of the inner window associated with the error. toString() Outputs a string representing the error message described by ...
nsISelectionController
forward); Native code only! void wordMove(in boolean forward, in boolean extend); Attributes Attribute Type Description caretVisible boolean This is true if the caret is enabled, visible, and currently blinking. This is still true when the caret is enabled, visible, but in its "off" blink cycle. Read only. ...
...de only! void wordMove(in boolean forward, in boolean extend); Attributes Attribute Type Description caretVisible boolean This is true if the caret is enabled, visible, and currently blinking. This is still true when the caret is enabled, visible, but in its "off" blink cycle. Read only. ...
... SELECTION_WHOLE_SELECTION 2 NUM_SELECTION_REGIONS 2 3 SELECTION_OFF 0 SELECTION_HIDDEN 1 Hidden displays selection. SELECTION_ON 2 SELECTION_DISABLED 3 SELECTION_ATTENTION 4 Scroll constants Constant Value Description SCROLL_SYNCHRONOUS 1<<1 If set scrolls the selection into view before returning. If not set, posts a request which is processed at some point after the method returns. SCROLL_FIRST_ANCESTOR_ONLY 1<<2 If set, only the first ancestor will be scrolled into view. SCROLL_CENT...
...sh the pending reflow. This is dangerous for some objects. See bug 418470, comment 12 for details. void scrollSelectionIntoView( in short type, in short region, in short flags ); Parameters type The selection to scroll into view. (SelectionType) region The region inside the selection to scroll into view. (SelectionRegion) flags One of the SCROLL_* constants. Exceptions thrown Missing Exception Missing Description selectAll() Will select the whole page. void selectAll(); Parameters None. setCaretEnabled() Set the caret as enabled or disabled. An enabled caret will draw or blink when made visible. A disabled caret will never show up. Can be called any time. void setCaretEnabled( in boolean enabled ); Parameters enabled ...
nsISmsRequestManager
Constant Value Description SUCCESS_NO_ERROR 0 NO_SIGNAL_ERROR 1 NOT_FOUND_ERROR 2 UNKNOWN_ERROR 3 INTERNAL_ERROR 4 Methods addRequest() Track an already existing request object. long addRequest( in nsIDOMMozSmsRequest aRequest ); Parameters aRequest An SmsRequest. Return value The request ID. createReque...
...d, in long aListId, in nsIDOMMozSmsMessage aMessage ); Parameters aRequestId A number representing the id of the request. aListId A number representing the id of the list. aMessage An SmsMessage. notifyGetSmsFailed() void notifyGetSmsFailed( in long aRequestId, in long aError ); Parameters aRequestId A number representing the id of the request. aError A number with an error code. See constants. notifyGotNextMessage() void notifyGotNextMessage( in long aRequestId, in nsIDOMMozSmsMessage aMessage ); Parameters aRequestId A number representing the id of the request. aMessage An SmsMessage. notifyGotSms() void notifyGotSms( in long aRequestId, in nsIDOMMozSmsMessage aMessage ); Parameters aRequestId A number representing the id of the request. aMessage An SmsMessage. no...
...mber representing the id of the request. aRead A Boolean indicating whether a message is read or unread. notifyMarkMessageReadFailed() Requires Gecko 15.0(Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12) void notifyMarkMessageReadFailed( in long aRequestId in long aError ); Parameters aRequestId A number representing the id of the request. aError A number with an error code. See constants. notifyNoMessageInList() void notifyNoMessageInList( in long aRequestId ); Parameters aRequestId A number representing the id of the request. notifyReadMessageListFailed() void notifyReadMessageListFailed( in long aRequestId, in long aError ); Parameters aRequestId A number representing the id of the request. aError A number with an error code. See constants. notifySmsDeleted() void ...
... void notifySmsDeleted( in long aRequestId, in bool aDeleted ); Parameters aRequestId A number representing the id of the request. aDeleted A Boolean indictating whether the SMS is deleted. notifySmsDeleteFailed() void notifySmsDeleteFailed( in long aRequestId, in long aError ); Parameters aRequestId A number representing the id of the request. aError A number with an error code. See constants. notifySmsSendFailed() void notifySmsSendFailed( in long aRequestId, in long aError ); Parameters aRequestId A number representing the id of the request. aError A number with an error code. See constants. notifySmsSent() void notifySmsSent( in long aRequestId, in nsIDOMMozSmsMessage aMessage ); Parameters aRequestId A number representing the id of the request. aMessage An SmsMessage...
nsISocketTransport
gned 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 behavior of the socket connection. See Connection Flag Constants for more details. host AUTF8String Get the host for the underlying socket connection. Read only. port long Get the port for the underlying socket connection. Read only. securityCallbacks nsIInterfaceRequestor Security notification callbacks passed to the secure socket provider via nsISSLSocketControl at ...
...faces. Note: This attribute cannot be changed once a stream has been opened. securityInfo nsISupports Security info object returned from the secure socket provider. This object supports nsISSLSocketControl, nsITransportSecurityInfo, and possibly other interfaces. This attribute is only available once the socket is connected. Read only. Constants Timeout type This constants are used by getTransport() and setTransport() to specify socket timeouts Constant Value Description TIMEOUT_CONNECT 0 Connecting timeout. TIMEOUT_READ_WRITE 1 Read and write timeouts. nsITransportEventSink status codes Note: Although these constants look like XPCOM error co...
...initiating end. This attribute is defined only once a connection has been established. PRNetAddr getSelfAddr(); Parameters None. Return value An PRNetAddr containing the resolved IP address. getTimeout() Retrieves a Socket timeout. unsigned long getTimeout( in unsigned long aType ); Parameters aType The timeout type, who's associated value should be retrieved. Can be one of the constants TIMEOUT_CONNECT or TIMEOUT_READ_WRITE. Return value Returns the timeout in seconds for the given Type. A value of PR_UINT32_MAX is equivalent to no timeout. isAlive() Test if this socket transport is (still) connected. boolean isAlive(); Parameters None. Return value Returns true if the socket is connected. Otherwise false. setTimeout() Sets a Socket timeout. void setTimeout( in unsigned lon...
...valent to no timeout. isAlive() Test if this socket transport is (still) connected. boolean isAlive(); Parameters None. Return value Returns true if the socket is connected. Otherwise false. setTimeout() Sets a Socket timeout. void setTimeout( in unsigned long aType, in unsigned long aValue ); Parameters aType The timeout type which should be set to aValue. Can be one of the constants TIMEOUT_CONNECT or TIMEOUT_READ_WRITE. aValue Defines the timeout in seconds, pass PR_UINT32_MAX to specify no timeout. The implementation may truncate timeout values to a smaller range of values (for example, 0 to 0xFFFF). Remarks This is a free-threaded interface, meaning that the methods on this interface may be called from any thread. See also nsITransport nsISocketTranspo...
nsITimer
t has already fired doesn't restart the timer. Call one of the init() methods to restart a one-shot timer. target nsIEventTarget The nsIEventTarget to which the callback is dispatched. This target must be set before calling any of the initialization methods. type unsigned long Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under Constants on this page. Constants Constant Value Description TYPE_ONE_SHOT 0 Type of a timer that fires once only. TYPE_REPEATING_SLACK 1 After firing, the timer is stopped and not restarted until its callback completes. The timer period will ideally be at least the time between when processing for last firing the callback co...
...ck Object, that is capable listening to timer events. If the timer fires, the observer will be notified via the nsIObserver Interface. The subject is set to the nsITimer Object which fired, the topic is equal to "timer-callback" and data is always set to null. aDelay Timeout delay in milliseconds. aType Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under Constants on this page. initWithCallback() Initialize a timer to fire after the given millisecond interval. This version takes a function to call. void initWithCallback( in nsITimerCallback aCallback, in unsigned long aDelay, in unsigned long aType ); Parameters aCallback An nsITimerCallback interface to call when timer expires. aDelay Timeout delay in milliseconds...
...en millisecond interval. This version takes a function to call. void initWithCallback( in nsITimerCallback aCallback, in unsigned long aDelay, in unsigned long aType ); Parameters aCallback An nsITimerCallback interface to call when timer expires. aDelay Timeout delay in milliseconds. aType Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under Constants on this page. Native code only!initWithFuncCallback Initialize a timer to fire after the given millisecond interval. This version takes a function to call and a closure to pass to that function. void initWithFuncCallback( in nsTimerCallbackFunc aCallback, in voidPtr aClosure, in unsigned long aDelay, in unsigned long aType ); Parameters aCallback A nsTime...
...allbackFunc aCallback, in voidPtr aClosure, in unsigned long aDelay, in unsigned long aType ); Parameters aCallback A nsTimerCallbackFunc interface compatible function to call when timer fires. aClosure An opaque pointer to pass to that function. aDelay Timeout delay in milliseconds. aType Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under Constants on this page. Remarks TYPE_REPEATING_SLACK timer is the preferable repeating timer type for most situations Example Using initWithCallback: // we need an nsITimerCallback compatible... // ... interface for the callbacks. var event = { notify: function(timer) { alert("Fire!"); } } // Now it is time to create the timer... var timer = Components.classes["@mozil...
nsITreeView
e(in long row, in nsITreeColumn col, in AString value); void setTree(in nsITreeBoxObject tree); void toggleOpenState(in long index); Attributes Attribute Type Description rowCount long The total number of rows in the tree (including the offscreen rows). Read only. selection nsITreeSelection The selection for this view. ...
... on items, such as the mailNews folder pane, always return false when the orientation is not DROP_ON. Note: DROP_ON will only be passed to canDrop() if the item is a container; see isContainer(). boolean canDrop( in long index, in long orientation, in nsIDOMDataTransfer dataTransfer ); Parameters index The index of the row. orientation The position around the given row. Defined in constants. dataTransfer This parameter, added in Gecko 1.9.2, provides the data being dragged, so that it can be examined to determine if a drop is possible. Return value true if a drop is allowed at the current location; otherwise false. canDropBeforeAfter() Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Method used by the drag feedback code to d...
...cleHeader( in nsITreeColumn col ); Parameters col The column to cycle. drop() Called when the user drops something on this view. The orientation paramater specifies before/on/after the given row. void drop( in long row, in long orientation, in nsIDOMDataTransfer dataTransfer ); Parameters row The index of the row. orientation The position around the given row. Defined in constants. dataTransfer This parameter, added in Gecko 1.9.2, provides the data that has been dropped. getCellProperties() An atomized list of properties for a given cell. Each property, x, that the view gives back will cause the CSS ::moz-tree-cell-*(x) pseudoelement to be matched on the treechildren element. See getRowProperties() for an example. AString getCellProperties( in long row, in nsI...
...ndex is used to obtain the index of a parent row. If there is no parent row, getParentIndex returns -1. long getParentIndex( in long rowIndex ); Parameters rowIndex The index of the row whose parent should be found. Return value The row index of the parent row. getProgressMode() The progress mode for a given cell. This method is only called for columns of type progressmeter. See the constants section for possible modes. long getProgressMode( in long row, in nsITreeColumn col ); Parameters row The index of the row. col The index of the column. Return value The progress mode for the cell. getRowProperties() An atomized list of properties for a given row. Each property, x, that the view gives back will cause the CSS ::moz-tree-row(x) pseudoelement to be matched on the t...
XPCOM reference
s attributes on the interface, allowing it to be more flexible.nsICookie2 MOZILLA 1 8 BRANCHnsIMsgSearchValueDefined in comm-central/ mailnews/ base/ search/ public/ nsIMsgSearchValue.idl nsMsgMessageFlagsThe nsMsgMessageFlags interface describes possible flags for messages. Equivalent flags are also defined in nsMsgMessageFlags.h. nsMsgNavigationTypeThe nsMsgNavigationType interface contains constants used for message navigation in Thunderbird. For example to move forward a message, you would call:nsMsgSearchOpValueDefined in comm-central/ mailnews/ base/ search/ public/ nsMsgSearchCore.idl nsMsgViewCommandCheckStateThe nsMsgViewCommandCheckState interface contains constants used for command status in Thunderbird. It is (as far as I can tell) not currently used anywhere in Thunderbird.nsMsgVie...
... to move forward a message, you would call:nsMsgSearchOpValueDefined in comm-central/ mailnews/ base/ search/ public/ nsMsgSearchCore.idl nsMsgViewCommandCheckStateThe nsMsgViewCommandCheckState interface contains constants used for command status in Thunderbird. It is (as far as I can tell) not currently used anywhere in Thunderbird.nsMsgViewCommandTypeThe nsMsgViewCommandType interface contains constants used for commands in Thunderbird. ...
...heckStateThe nsMsgViewCommandCheckState interface contains constants used for command status in Thunderbird. It is (as far as I can tell) not currently used anywhere in Thunderbird.nsMsgViewCommandTypeThe nsMsgViewCommandType interface contains constants used for commands in Thunderbird. For example to mark a message read, you would call:nsMsgViewFlagsTypeThe nsMsgViewFlagsType interface contains constants used for view flags in Thunderbird. This interface isn't ever implemented. It is only used to store constants. For example, the 'unread only' view would use the flag:nsMsgViewSortOrderThe nsMsgViewSortOrder interface contains constants used for sort direction in Thunderbird. This interface isn't ever implemented. It is only used to store constants. For example to sort by date you would pass a fun...
.... It is only used to store constants. For example, the 'unread only' view would use the flag:nsMsgViewSortOrderThe nsMsgViewSortOrder interface contains constants used for sort direction in Thunderbird. This interface isn't ever implemented. It is only used to store constants. For example to sort by date you would pass a function the value:nsMsgViewSortTypeThe nsMsgViewSortType interface contains constants used for sorting the Thunderbird threadpane. This interface isn't ever implemented. It is only used to store constants. For example to sort by date you would pass a function the value:nsMsgViewTypeThe nsMsgViewType interface contains constants used for views in Thunderbird. This interface isn't ever implemented. It is only used to store constants. For example, to request the 'show all threads' vi...
Working with ArrayBuffers
that the following example does not cast the pixelBuffer. Passing an ArrayBuffer object to pointer type will pass the pointer to buffer (Based on //github.com/RealityRipple/UXP/blob/master/js/src/ctypes/CTypes.cpp#3080). Further, it returns dataPointer, and there is no extra allocation (Based on //github.com/RealityRipple/UXP/blob/master/js/src/vm/ArrayBufferObject.cpp#1301). ...
...ctypes.winapi_abi : ctypes.default_abi, ctypes.void_t, // return ctypes.void_t.ptr, // *dest ctypes.void_t.ptr, // *src ctypes.size_t // count ); } catch (ex) { throw new Error('I dont know where to me...
... lib = ctypes.open('libc.so.0.1'); break; default: //assume unix try { lib = ctypes.open(ctypes.libraryName('c')); } catch (ex) { throw new Error('I dont know where to memcpy is defined on your operating system, "' + OS.Constants.Sys.Name + '"'); lib.close(); } } try { var memcpy = lib.declare('memcpy', OS.Constants.Sys.Name.toLowerCase().indexOf('win') == 0 ? ...
... } } try { var memcpy = lib.declare('memcpy', OS.Constants.Sys.Name.toLowerCase().indexOf('win') == 0 ? ...
CSSRule - Web APIs
Web › API › CSSRule
The CSSRule interface specifies the properties common to all rules, while properties unique to specific rule types are specified in the more specialized interfaces for those rules' respective types. References to a CSSRule may be obtained by looking at a CSSStyleSheet's cssRules list. Properties common to all CSSRule instances CSSRule.cssText Represents the textual representation of the rule, e.g. "h1,h2 { font-size: 16pt }" or "@import 'url'". To access or modify parts of the rule (e.g. ...
...he properties on the specialized interface for the rule's type. CSSRule.parentRule Read only Returns the containing rule, otherwise null. E.g. if this rule is a style rule inside an @media block, the parent rule would be that CSSMediaRule. ...
...r the rule's type. CSSRule.parentRule Read only Returns the containing rule, otherwise null. E.g. if this rule is a style rule inside an @media block, the parent rule would be that CSSMediaRule. CSSRule.parentStyleSheet Read only Returns the CSSStyleSheet object for the style sheet that contains this rule CSSRule.type Read only One of the Type constants indicating the type of CSS rule. Constants Type constants The CSSRule interface specifies integer constants that can be used in conjunction with a CSSRule's type property to discern the rule type (and therefore, which specialized interface it implements). The relationships between these constants and the interfaces are: Type Value Rule-specific interface Comments and examples CSSRule.STYLE_RULE 1 CSSSty...
... Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'CSSRule' in that specification. Working Draft Obsoleted values CHARSET_RULE and UNKNOWN_RULE. Added value NAMESPACE_RULE. CSS AnimationsThe definition of 'CSSRule' in that specification. Working Draft Added values KEYFRAMES_RULE ...
SVGLength - Web APIs
Web › API › SVGLength
ace overview 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_LENGTHTYPE_EXS = 4 SVG_LENGTHTYPE_PX = 5 SVG_LENGTHTYPE_CM = 6 SVG_LENGTHTYPE_MM = 7 SVG_LENGTHTYPE_IN = 8 SVG_LENGTHTYPE_PT = 9 SVG_LENGTHTYPE_PC = 10 Normative document SVG 1.1 (2nd Edition) Exam...
...It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_LENGTHTYPE_NUMBER 1 No unit type was provided (i.e., a unitless value was specified), which indicates a value in user units. ...
...s specified using the in units defined in CSS2. SVG_LENGTHTYPE_PT 9 A value was specified using the pt units defined in CSS2. SVG_LENGTHTYPE_PC 10 A value was specified using the pc units defined in CSS2. Properties Name Type Description unitType unsigned short The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface. value float The value as a floating point value, in user units. Setting this attribute will cause valueInSpecifiedUnits and valueAsString to be updated automatically to reflect this setting. Exceptions on setting: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute or when the objec...
...iedUnits(in unsigned short unitType, in float valueInSpecifiedUnits) void Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object. Exceptions: a DOMException with code NOT_SUPPORTED_ERR is raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_LENGTHTYPE_* constants defined on this interface). a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute or when the object itself is read only. convertToSpecifiedUnits(in unsigned short unitType) void Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes unitType...
Movement, orientation, and motion: A WebXR example - Web APIs
the WebXR API's specification. By importing this polyfill, we allow the example to work on many browsers that don't yet have WebXR implementations in place, and we smooth out any transient deviations from the specification that occur during these still somewhat experimental days of the WebXR specification. Options This example has a number of options you can configure by adjusting the values of constants before you load it in the browser. The code looks like this: const xRotationDegreesPerSecond = 25; const yRotationDegreesPerSecond = 15; const zRotationDegreesPerSecond = 35; const enableRotation = true; const allowMouseRotation = true; const allowKeyboardMotion = true; const enableForcePolyfill = false; //const SESSION_TYPE = "immersive-vr"; const SESSION_TYPE = "inline"; const MOUSE_SPEED = 0.
... move in response to any of the keys used to move the viewer through the scene. Note: This example always displays what it renders on the screen, even if using immersive-vr mode. This lets you compare any differences in rendering between the two modes, and lets you see output from immersive mode even if you don't have a headset. ...
... const viewerStartPosition = vec3.fromValues(0, 0, -10); const viewerStartOrientation = vec3.fromValues(0, 0, 1.0); const cubeOrientation = vec3.create(); const cubeMatrix = mat4.create(); const mouseMatrix = mat4.create(); const inverseOrientation = quat.create(); const RADIANS_PER_DEGREE = Math.PI / 180.0; The fi...
...the amount of time that has elapsed since the previous frame was rendered. These values let us adjust the rotation of our animating cube the right amount to ensure that its movement speed stays consistent regardless of variations in the frame rate that may occur due to system load. These values are calculated as the number of radians of rotation to apply given the elapsed time and stored into the constants xRotationForTime, yRotationForTime, and zRotationForTime. After enabling and configuring depth testing, we check the value of the enableRotation constant to see if rotation of the cube is enabled; if it is, we use glMatrix to rotate the cubeMatrix (representing the cube's current orientation relative to the world space) around the three axes. With the cube's global orientation established, we th...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
down, left or right from this IAccessible. [important, but no need to implement up/down/left/right] accHitTest: Find out what IAccessible exists and a specific coordinate. accDoDefaultAction: Perform the action described by get_accDefaultAction. put_accName: Change the name. put_accValue: Change the value. MSAA Events Cheat Sheet For information on what each event does, see the MSDN Event Constants page. Check with your assistive technology partners to find out what events you need to support. There's a very good chance they won't ask for more than the events marked [important]: EVENT_SYSTEM_SOUND EVENT_SYSTEM_ALERT [can be important, to have auto-speaking for newly created ROLE_ALERTs] EVENT_SYSTEM_FOREGROUND EVENT_SYSTEM_MENUSTART [important] EVENT_SYSTEM_MENUEN...
... Check with your assistive technology partners to find out what states you need to support. There's a very good chance they won't ask for more than the states marked [important]: STATE_UNAVAILABLE [important] STATE_SELECTED [important] STATE_FOCUSED [important] STATE_PRESSED STATE_CHECKED [important] STATE_MIXED STATE_READONLY [important] STATE_HOTTRACK...
... Check with your assistive technology partners to find out what roles you need to support. There's a very good chance they won't ask for more than the roles marked [important]: There is no need to support the objects marked [inserted by system]. Windows will add those objects to your hierarchy for you. ROLE_TITLEBAR [inserted by system] ROLE_MENUBAR [important if you don't us...
... Check with our assistive technology partners to find out what object identifiers you need to support. There's a very good chance they won't ask for more than the object itentifiers marked [important]: OBJID_ALERT OBJID_CARET OBJID_CLIENT [important] OBJID_CURSOR OBJID_HSCROLL OBJID_NATIVEOM [important? might be useful for supporting custom interfaces, need to research] OBJID_MENU ...
JavaScript Object Management - Archive of obsolete content
he chrome namespace objects are repeated for each window, while the module namespace objects are unique for all windows. Setting window-specific data on code modules will lead to nothing but problems, so be careful when deciding what should be chrome and what shouldn't be. We needn't test for the pre-existence of our namespace object here, as modules are given their own namespace. ...
...ared constants above are used to reduce code size. We frequently need to use XPCOM components in our code, so instead of doing this: this.obsService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService); It's better to do this: this.obsService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService); These 2 constants don't need to be defined in the overlay because they are already defined globally in the browser.js file in Firefox. We only need to define them when we're making windows of our own, or when we're working with code outside of the chrome (or porting your code to SeaMonkey, which doesn't have those constants declared in the main window). ...
...Do this even if you don't need them now. It's better to just make a habit out of it. This is a point that is worth highlighting: modules work outside of the window scope. ...
Client-side storage - Learn web development
tml file in a new directory on your computer. Next, note how our HTML references a JavaScript file called index.js (see line 40). We need to create this and write our JavaScript code into it. Create an index.js file in the same directory as your HTML file. ...
...te this and write our JavaScript code into it. Create an index.js file in the same directory as your HTML file. We'll start off by creating references to all the HTML features we need to manipulate in this example -- we'll create them all as constants, as these references do not need to change in the lifecycle of the app. ...
...s files into a new directory on your local machine. Have a look at the files. You'll see that the HTML is pretty simple: a web site with a header and footer, as well as a main content area that contains a place to display notes, and a form for entering new notes into the database. The CSS provides some simple styling to make it clearer what is going on. The JavaScript file contains five declared constants containing references to the <ul> element the notes will be displayed in, the title and body <input> elements, the <form> itself, and the <button>. Rename your JavaScript file to index.js. You are now ready to start adding code to it. Database initial set up Now let's look at what we have to do in the first place, to actually set up a database. Below the constant declarations, add the f...
Commenting IDL for better documentation
l not be used to generate * documentation. * * To make it easier to document I have included that you can create an instance * of this interface by implementing: @mozilla.org/cookie-monster;1 */ // I can also just use a comment like this here as well and it will not be used. [scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsICookieMonster : nsICookieFan { // Cookie flavor constants /** * Simple sugar cookie. */ const integer COOKIE_FLAVOR_SUGAR = 1; /** * Chocolate chip cookie. */ const integer COOKIE_FLAVOR_CHOCOLATE_CHIP = 2; /** * Peanut butter cookie. */ const integer COOKIE_FLAVOR_PEANUT_BUTTER = 3; /** * Chocolate cookie with chocolate chips. */ const integer COOKIE_FLAVOR_DOUBLE_CHOCOLATE = 4; /** * An unknown type of cookie. */ const integer COOKIE_FL...
... */ const integer COOKIE_FLAVOR_SUGAR = 1; /** * Chocolate chip cookie. */ const integer COOKIE_FLAVOR_CHOCOLATE_CHIP = 2; /** * Peanut butter cookie. */ const integer COOKIE_FLAVOR_PEANUT_BUTTER = 3; /** * Chocolate cookie with chocolate chips. */ const integer COOKIE_FLAVOR_DOUBLE_CHOCOLATE = 4; /** * An unknown type of cookie. */ const integer COOKIE_FLAVOR_OTHER = 0; // Yumminess constants /** * The cookie is disgusting. */ const integer COOKIE_NOT_YUMMY = 1; /** * The cookie is good but not awesome. */ const integer COOKIE_SORT_OF_YUMMY = 2; /** * The cookie is really, really yummy. */ const integer COOKIE_EXTREMELY_YUMMY = 3; /** * OMG THIS IS THE BEST COOKIE EVAR!1!!1. */ const integer COOKIE_OMG_YUMMY = 4; /** * The cookie monster's name. */ readonly attribute AS...
...t not awesome. */ const integer COOKIE_SORT_OF_YUMMY = 2; /** * The cookie is really, really yummy. */ const integer COOKIE_EXTREMELY_YUMMY = 3; /** * OMG THIS IS THE BEST COOKIE EVAR!1!!1. */ const integer COOKIE_OMG_YUMMY = 4; /** * The cookie monster's name. */ readonly attribute AString name; /** * The cookie monster's favorite kind of cookie. Must be one of the * COOKIE_FLAVOR_* constants. */ attribute integer favoriteCookie; /** * A value from 0-100 indicating how hungry the cookie monster is. * 0 means "stuffed to the brim with cookies" and 100 means "I'm so empty of * cookies! Feed me now!" */ attribute integer hungerLevel; /** * Feeds a cookie to the cookie monster. * @param cookieToEat The nsICookie to eat. */ void eatCookie(in nsICookie cookieToEat); /** * Sings ...
Performance
The following examples omit some boilerplate code for the sake of brevity The "better" examples also omit some best practices and only demonstrate how to fix the problem described in their respective subtopics. Performance best practices Declaring stateless functions once per process BAD: // addon.js Services.mm.loadFrameScript("framescript.js", true) // framescript.js const precomputedConstants = // ... function helper(window, action) { // ... do some work on the window } function doSomething(message) { result = helper(content, message.data) sendAsyncMessage("my-addon:response-from-child", {something: result}) } addMessageListener("my-addon:request-from-parent", doSomething) Why is this bad? Because declared functions are also objects. And since frame scripts get evaluated...
...on the window } function doSomething(message) { result = helper(content, message.data) sendAsyncMessage("my-addon:response-from-child", {something: result}) } addMessageListener("my-addon:request-from-parent", doSomething) Why is this bad? Because declared functions are also objects. And since frame scripts get evaluated for each tab this means new function objects get instantiated, new constants get computed, block scopes must be set up etc. While it may seem fairly innocencous in this toy example, real scripts often have a lot more functions and initialize some fairly heavyweight objects. BETTER: addon.js as above // framescript.js Components.utils.import("resource://my-addon/processModule.jsm", {}).addFrame(this) // processModule.jsm const EXPORTED_SYMBOLS = ['addFrame']; const...
...d, block scopes must be set up etc. While it may seem fairly innocencous in this toy example, real scripts often have a lot more functions and initialize some fairly heavyweight objects. BETTER: addon.js as above // framescript.js Components.utils.import("resource://my-addon/processModule.jsm", {}).addFrame(this) // processModule.jsm const EXPORTED_SYMBOLS = ['addFrame']; const precomputedConstants = // ... function helper(window, action) { // ... do some work on the window } function doSomething(message) { frameGlobal = message.target result = helper(frameGlobal.content, message.data) frameGlobal.sendAsyncMessage("my-addon:response-from-child", {something: result}) } function addFrame(frameGlobal) { frameGlobal.addMessageListener("my-addon:request-from-parent", doSomething) } ...
Downloads.jsm
PRIVATE Work on downloads that were started from a private browsing window. ALL Work on both Downloads.PRIVATE and Downloads.PUBLIC downloads. Properties Attribute Type Description Error Read only Constructor Co...
...his example downloads an HTML file without showing progress, handling errors programmatically. Components.utils.import("resource://gre/modules/Downloads.jsm"); Components.utils.import("resource://gre/modules/osfile.jsm") Components.utils.import("resource://gre/modules/Task.jsm"); Task.spawn(function () { yield Downloads.fetch("http://www.mozilla.org/", OS.Path.join(OS.Constants.Path.tmpDir, "example-download.html")); console.log("example-download.html has been downloaded."); }).then(null, Components.utils.reportError); Observing downloads This example logs a message every time a change occurs in one of the global download lists. To demonstrate the logging, a new download is started while a message box is being shown. The down...
...Close the message to stop."); } finally { yield list.remove(download); yield download.finalize(true); } } finally { yield list.removeView(view); } }).then(null, Components.utils.reportError); Conversion from nsIDownloadM...
Examples
How to throw reject If you have a function that is a promise, and want to end it and throw a reject, you can throw an Error. Components.utils.import("resource://gre/modules/osfile.jsm") let path = OS.Path.join(OS.Constants.Path.tmpDir, "file.txt"); let promise = OS.File.exists(path); let newPromise = promise.then(function onFulfill(aExists) { if (aExists) { console.log("You have file.txt in your temporary directory."); } else { throw new Error("You don't have file.txt in your temporary directory."); } }); // Unexpected errors should always be reported at the end of a promise chain. let lastPromise = newPromise.then(function onFulfill(){ }) .catch(function onReject(aRejectReason) { console.warn('newPromise failed with reason: ', aRejectReason); }); Using a promise ...
...omise chain. let lastPromise = newPromise.then(function onFulfill(){ }) .catch(function onReject(aRejectReason) { console.warn('newPromise failed with reason: ', aRejectReason); }); Using a promise returned by a function (verbose) This example uses a verbose syntax, showing all the involved promises. Components.utils.import("resource://gre/modules/osfile.jsm") let path = OS.Path.join(OS.Constants.Path.tmpDir, "file.txt"); let promise = OS.File.exists(path); let newPromise = promise.then(function onFulfill(aExists) { if (aExists) { console.log("You have file.txt in your temporary directory."); } else { console.log("You don't have file.txt in your temporary directory."); } }); // Unexpected errors should always be reported at the end of a promise chain. let lastPromise = ne...
...ejected with an OS.File.Error instance. This state will propagate to newPomise, and Components.utils.reportError will report all the details of the exception to the console. Using a promise returned by a function (compact) The same code as the previous example is usually written with a more compact syntax: Components.utils.import("resource://gre/modules/osfile.jsm") let path = OS.Path.join(OS.Constants.Path.tmpDir, "file.txt"); OS.File.exists(path).then(exists => { console.log(exists ? "You have file.txt in your temporary directory." : "You don't have file.txt in your temporary directory."); }).then(null, Components.utils.reportError); Chaining promises The promise returned by then eventually assumes the state of the promise returned by the callback. This can be used f...
Date and Time
Absolute time representation treats time instants as points along the time line. A time instant is represented by its position on the time line relative to the origin, called the epoch. NSPR defines the epoch to be midnight (00:00:00) 1 January 1970 UTC (Coordinated Universal Time). In this form, time is just a point on the time line. There is no notion of time zone. ...
...PR data type for clock/calendar time, called an exploded time, has the time zone information in it, so that its corresponding point in absolute time is uniquely specified. Note that absolute and clock times are not normally used in timing operations. For functions that deal with the measurement of elapsed time and with timeouts, see Interval Timing. ...
... with the measurement of elapsed time and with timeouts, see Interval Timing. Macros for Time Unit Conversion Types and Constants Time Parameter Callback Functions Functions Macros for Time Unit Conversion Macros for converting between seconds, milliseconds, microseconds, and nanoseconds. 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 Saving Time (DST) and the rule for determining the dates on which DST starts and ends have changed a few times. Therefore, a callback function is used to determine time zone information. You can define your own t...
NSS Tools modutil
ir: the key is the path of the file in the JAR archive, and the value list contains attributes of the file. At least RelativePath or AbsolutePath must be specified for each file. DefaultMechanismFlags Specifies mechanisms for which this module will be a default provider. This key-value pair is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR of the following constants. If the DefaultMechanismFlags entry is omitted, the value defaults to 0x0. RSA: 0x00000001 DSA: 0x00000002 RC2: 0x00000004 RC4: 0x00000008 DES: 0x00000010 DH: 0x00000020 FORTEZZA: 0x00000040 RC5: 0x00000080 SHA1: 0x0000010...
...0400 RANDOM: 0x08000000 FRIENDLY: 0x10000000 OWN_PW_DEFAULTS: 0x20000000 DISABLE: 0x40000000 CipherEnableFlags Specifies ciphers that this module provides but Netscape Communicator does not, so that Communicator can enable them. This key is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR of the following constants. If the CipherEnableFlags entry is omitted, the value defaults to 0x0. FORTEZZA: 0x0000 0001 EquivalentPlatform Specifies that the attributes of the named platform should also be used for the current platform. Saves typing when there is more than one platform using the same settings. Per-File Keys These keys have meaning only within the value list of an entry in a File...
...his string would be used for a setup program provided by a module vendor, such as a self-extracting setup.exe. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file. FilePermissions Interpreted as a string of octal digits, according to the standard Unix format. This string is a bitwise OR of the following constants: user read: 0400 user write: 0200 user execute: 0100 group read: 0040 group write: 0020 group execute: 0010 other read: 0004 other write: 0002 other execute: 0001 Some platforms may not understand these permissions. They are applied only insofar as they make sense fo...
imgIContainer
image. Read only. Obsolete since Gecko 2.0 preferredAlphaChannelFormat gfx_format Read only. Obsolete since Gecko 1.9.2 type unsigned short The type of this image (one of the TYPE_* values above). Read only. width PRInt32 The width of the container rectangle. In the case of any error, zero is returned, and an exception will be thrown. Read only. Constants Constant Value Description TYPE_RASTER 0 Enumerated values for the 'type' attribute (below). TYPE_VECTOR 1 FLAG_NONE 0x0 Flags for imgIContainer operations. Meanings: FLAG_NONE: Lack of flags. FLAG_SYNC_DECODE: Forces synchronous/non-progressive decode of all available data before the call returns. It is an error to pa...
... not convert to any particular destination space. FLAG_CLAMP: Extend the image to the fill area by clamping image sample coordinates instead of by tiling. This only affects 'draw()'. ...
... kDontAnimMode 1 kLoopOnceAnimMode 2 kDisposeClearAll -1 "Disposal" method indicates how the image should be handled before the subsequent image is displayed. ...
imgIEncoder
ut 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 saving alpha channels): Constant Value Description INPUT_FORMAT_RGB 0 Input is RGB each pixel is represented by three bytes: R, G, and B (in that order, regardless of host endianness) INPUT_FORMAT_RGBA 1 Input is RGB each pixel is represented by four bytes: R, G, and B (in that order, regardless of host endianness)...
..., in AString outputOptions ); Parameters data List of bytes in the format specified by inputFormat. length Missing Description width Width in pixels. height Height in pixels. stride The number of bytes per row in the image. Normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. inputFormat One of INPUT_FORMAT_* constants specifying the format of data. outputOptions Semicolon-delimited list of name=value pairs that can give options to the output encoder. Options are encoder-specific. Just give an empty string for default behavior. startImageEncode() void startImageEncode( in PRUint32 width, in PRUint32 height, in PRUint32 inputFormat, in AString outputOptions ); Parameters width Width in pixels. height ...
...lon-delimited list of name=value pairs that can give options to the output encoder. Options are encoder-specific. Just give an empty string for default behavior. startImageEncode() void startImageEncode( in PRUint32 width, in PRUint32 height, in PRUint32 inputFormat, in AString outputOptions ); Parameters width Width in pixels. height Height in pixels. inputFormat One of INPUT_FORMAT_* constants specifying the format of data. outputOptions Semicolon-delimited list of name=value pairs that can give options to the output encoder. Options are encoder-specific. Just give an empty string for default behavior. Remarks For encoding images which may contain multiple frames, the 1-shot initFromData() interface is too simplistic. The alternative is to use startImageEncode(), call addImageFrame() ...
nsIAccessibleCoordinateType
Constants Constant Value Description COORDTYPE_SCREEN_RELATIVE 0x00 The coordinates are relative to the screen. COORDTYPE_WINDOW_RELATIVE 0x01 The coordinates are relative to the window. ...
...Constants Constant Value Description COORDTYPE_SCREEN_RELATIVE 0x00 The coordinates are relative to the screen. COORDTYPE_WINDOW_RELATIVE 0x01 The coordinates are relative to the window. ...
... accessible/public/nsIAccessibleTypes.idlScriptable These constants define which coordinate system a point is located in. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Prior to Gecko 1.9, these constants were implemented in nsIAccessibleText. Constants Constant Value Description COORDTYPE_SCREEN_RELATIVE 0x00 The coordinates are relative to the screen. COORDTYPE_WINDOW_RELATIVE 0x01 The coordinates are relative to the window. COORDTYPE_PARENT_RELATIVE 0x02 The coordinates are relative to the upper left corner of the bounding box of the immediate parent. ...
nsIAccessibleProvider
public/nsIAccessibleProvider.idlScriptable Used to link element and accessible object. For that XBL binding, element should implement the interface. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Attributes Attribute Type Description accessible nsIAccessible Read only. Obsolete since Gecko 1.9 accessibleType long Value representing the type of accessible object. See constants for details. Read only. Constants Common use Constants Constant Value Description NoAccessible 0 Do not create an accessible for this object This is useful if an ancestor binding already implements nsIAccessibleProvider, but no accessible is desired for the inheriting binding. OuterDoc 0x00000001 For elements that spawn a new document. For example now it is used by <xul:iframe>, <xul:...
...mon use Constants Constant Value Description NoAccessible 0 Do not create an accessible for this object This is useful if an ancestor binding already implements nsIAccessibleProvider, but no accessible is desired for the inheriting binding. OuterDoc 0x00000001 For elements that spawn a new document. For example now it is used by <xul:iframe>, <xul:browser> and <xul:editor>. ...
.... XULTabs 0x00001019 The collection of tab objects, usable in the TabBox and independent of as well. 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 provide accessible object for itself as well for anonymous content. This property is used for upload, input[type="xsd:gDay"] and input[type="xsd:gMonth"] XFormsLabel 0x00002001 Used for label element. XFormsOuput 0x00002002 Used for output element. XFormsTrigger 0x00002003 Used for trigger and submit el...
nsIAnnotationService
Removed at application exit. EXPIRE_WEEKS 2 For general page settings, things the user is interested in seeing if they come back to this page some time in the near future. Removed at 30 days. EXPIRE_MONTHS 3 Something that the user ...
...his method retrieves the type of an existing annotation. Use getAnnotationInfo() method, if you need this along with the mime-type etc. It throwns an exception if the annotation is not set. PRUint16 getPageAnnotationType( in nsIURI aURI, in AUTF8String aName ); Parameters aURI The URI on which the annotation is set. aName The annotation name. Return value Returns one of the TYPE_* constants defined above. getItemAnnotationType() This method retrieves the type of an existing annotation. Use getAnnotationInfo() method, if you need this along with the mime-type etc. It throwns an exception if the annotation is not set. PRUint16 getPageAnnotationType( in long long aItemId, in AUTF8String aName ); Parameters aURI The item on which the annotation is set. aName The annotatio...
...hod retrieves the type of an existing annotation. Use getAnnotationInfo() method, if you need this along with the mime-type etc. It throwns an exception if the annotation is not set. PRUint16 getPageAnnotationType( in long long aItemId, in AUTF8String aName ); Parameters aURI The item on which the annotation is set. aName The annotation name. Return value Returns one of the TYPE_* constants defined above. getPagesWithAnnotation() This method returns a list of all URIs having a given annotation. void getPagesWithAnnotation( in AUTF8String name, [optional] out unsigned long resultCount, [retval, array, size_is(resultCount)] out nsIURI results ); Parameters name The annotation name. resultCount Optional Count of URIs. results Returns the list of all URIs. getItemsW...
nsIAuthPrompt2
No security provided. LEVEL_PW_ENCRYPTED 1 Password will be sent encrypted, but the connection is otherwise insecure. LEVEL_SECURE 2 The connection, both for password and data, is secure. Methods asyncPromptAuth() Asynchronously prompt the user for a...
...he user because consumer may fall back to synchronous prompt on synchronous failure of this method. nsICancelable asyncPromptAuth( in nsIChannel aChannel, in nsIAuthPromptCallback aCallback, in nsISupports aContext, in PRUint32 level, in nsIAuthInformation authInfo ); Parameters aChannel The channel that requires authentication. aCallback aContext level One of the level constants. authInfo Authentication information object. The implementation should fill in this object with the information entered by the user before returning. Return value promptAuth() Requests a username and a password. Implementations will commonly show a dialog with a username and password field, depending on flags also a domain field. Note: Exceptions thrown from this function will be treated...
...ntations will commonly show a dialog with a username and password field, depending on flags also a domain field. Note: Exceptions thrown from this function will be treated like a return value of false. boolean promptAuth( in nsIChannel aChannel, in PRUint32 level, in nsIAuthInformation authInfo ); Parameters aChannel The channel that requires authentication. level One of the level constants. authInfo Authentication information object. The implementation should fill in this object with the information entered by the user before returning. Return value false, authentication should be cancelled, usually because the user did not provide username/password. true, authentication can proceed using the values in the authInfo object. See also nsIAuthPrompt ...
nsIBlocklistService
unsigned long getAddonBlocklistState( in jsval addon, in AString appVersion, Optional in AString toolkitVersion Optional ); Parame...
...rmined. appVersion Optional The version of the application we are checking in the blocklist. If this parameter is null, the version of the running application is used. toolkitVersion Optional The version of the toolkit we are checking in the blocklist. If this parameter is null, the version of the running toolkit is used. Return value The blocklist state of the add-on, one of the Constants. getPluginBlocklistState() Determine the blocklist state of a plugin. unsigned long getPluginBlocklistState( in nsIPluginTag plugin, in AString appVersion, Optional in AString toolkitVersion Optional ); Parameters plugin The plugin to get the state for. appVersion Optional The version of the application we are checking in the blocklist. If this parameter is null, the versi...
...te for. appVersion Optional The version of the application we are checking in the blocklist. If this parameter is null, the version of the running application is used. toolkitVersion Optional The version of the toolkit we are checking in the blocklist. If this parameter is null, the version of the running toolkit is used. Return value The blocklist state of the plugin, one of the Constants. isAddonBlocklisted() Determine if an item is blocklisted. boolean isAddonBlocklisted( in jsval addon, in AString appVersion, Optional from Gecko 1.9.1 in AString toolkitVersion Optional from Gecko 1.9.1 ); Parameters addon The addon object to be checked. appVersion Optional from Gecko 1.9.1 The version of the application we are checking in the blocklist. If this parameter...
nsICryptoHash
The values map directly onto the values defined in mozilla/security/nss/lib/cryptohi/hasht.h. Constant Value Description MD2 1 Message Digest Algorithm 2 MD5 2 Message-Digest algorithm 5 SHA1 3 Secure Hash Algorithm 1 SHA2...
...The values map directly onto the values defined in mozilla/security/nss/lib/cryptohi/hasht.h. Constant Value Description MD2 1 Message Digest Algorithm 2 MD5 2 Message-Digest algorithm 5 SHA1 3 Secure Hash Algorithm 1 SHA256 4 Secure Hash Algorithm 2...
...rom(hash, (c, i) => toHexString(hash.charCodeAt(i))).join(""); // s now contains your hash in hex This gives 5eb63bbbe01eeed093cb22bb8f5acdc3 for the hash value. This example, while simple, shows most of the functionality of the interface. The first thing to note is that when you call the init() method you must specify the hash algorithm to use. All of the available algorithms are specified as constants on the interface. Also note that when you call the updateFromStream() method, the second parameter is the number of bytes to read. Passing PR_UINT32_MAX here indicates that you want the entire file read. Finally, note that calling the finish() method produces the hash value. The single parameter to this method is false in this example to return binary data. Passing true returns the hash as a ba...
nsIDNSService
ring aHostName, in unsigned long aFlags, in nsIDNSListener aListener, in nsIEventTarget aListenerTarget); void init(); Obsolete since Gecko 1.8 nsIDNSRecord resolve(in AUTF8String aHostName, in unsigned long aFlags); void shutdown(); Obsolete since Gecko 1.8 Attributes Attribute Type Description myHostName AUTF8String Read only. Constants Resolve flag constants Various flags that may be ORed together to form the aFlags parameter passed to asyncResolve() and resolve(). Constant Value Description RESOLVE_BYPASS_CACHE (1 << 0) This flag suppresses the internal DNS lookup cache. RESOLVE_CANONICAL_NAME (1 << 1) The canonical name of the specified host will be queried. RESOLVE_PRIORI...
...Begins off an asynchronous host lookup. A specified nsIDNSListener is invoked when the resolution process is completed. nsICancelable asyncResolve( in AUTF8String aHostName, in unsigned long aFlags, in nsIDNSListener aListener, in nsIEventTarget aListenerTarget ); Parameters aHostName The host name or IP-address-literal to resolve. aFlags A bitwise OR of the Resolve flag constants. aListener The listener to be notified when the result is available. aListenerTarget Optional parameter (may be null). If not null, this parameter specifies the nsIEventTarget of the thread on which the listener's onLookupComplete should be called. If this parameter is null, then onLookupComplete will be called on an unspecified thread (possibly recursively). Return value An obje...
...sly resolve a host name. Warning this method may block the calling thread for a long period of time. It is extremely unwise to call this function on the User Interface thread of an application. nsIDNSRecord resolve( in AUTF8String aHostName, in unsigned long aFlags ); Parameters aHostName The host name or IP-address-literal to resolve. aFlags A bitwise OR of the Resolve flag constants. Return value DNS record corresponding to the given host name. Exceptions thrown NS_ERROR_UNKNOWN_HOST If host could not be resolved. shutdown() Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Called to shutdown the DNS service. Any pending asynchronous requests will be canceled, and the local cache of DNS records will be cleared. Note...
nsIDOMSimpleGestureEvent
em API are not documented at this time; typical values appear to be in the range 0.0 to 100.0, but currently you can only rely on the value being either positive or negative. On Windows, the units indicate the difference between the previous and current width between the two touch points, in pixels. direction unsigned long The direction in which the gesture moved. ...
...ed at this time; typical values appear to be in the range 0.0 to 100.0, but currently you can only rely on the value being either positive or negative. On Windows, the units indicate the difference between the previous and current width between the two touch points, in pixels. direction unsigned long The direction in which the gesture moved. See Direction constants and Rotation constants on this page. ...
...be in the range 0.0 to 100.0, but currently you can only rely on the value being either positive or negative. On Windows, the units indicate the difference between the previous and current width between the two touch points, in pixels. direction unsigned long The direction in which the gesture moved. See Direction constants and Rotation constants on this page. Read only. Constants Direction constants Constant Value Description DIRECTION_UP 1 Upward swipe. DIRECTION_DOWN 2 Downward swipe. DIRECTION_LEFT 4 Leftward swipe. DIRECTION_RIGHT 8 Rightward swipe. Rotation constants Constant Value Description ROTATION_COUNTERCLOCKWISE 1 Counter-clockwise rotation. ...
nsIDownloadProgressListener
es Attribute Type Description document nsIDOMDocument document The document of the download manager frontend. Methods onDownloadStateChange() Called when the status of a particular download changes. void onDownloadStateChange( in short aState, in nsIDownload aDownload ); Parameters aState The previous state of the download. See nsIDownloadManager.Constants for a list of possible values. aDownload The nsIDownload object representing the file whose download status has changed. You can get the new state of the download from this object. onLocationChange() Obsolete since Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) void onLocationChange( in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIUR...
...sition. void onSecurityChange( in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState, in nsIDownload aDownload ); Parameters aWebProgress The nsIWebProgress instance used by the Download Manager to monitor downloads. aRequest The nsIChannel that changed state. This parameter will not be null. aState The new state of the download. See nsIDownloadManager.Constants for a list of possible values. aDownload The download whose security level is changing. onStateChange() Called when the state of a particular download changes. void onStateChange( in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus, in nsIDownload aDownload ); Parameters aWebProgress The nsIWebProgress instance used by th...
...onitor downloads. aRequest The nsIChannel that changed state. This parameter will not be null. aStateFlags Flags indicating the download's new state. This value is a combination of one of the nsIWebProgressListener.State_Transition_Flags. aStatus The new state information for the download. See nsIWebProgressListener.onStateChange() for details. This can also be one of the nsIDownloadManager.Constants. aDownload The download whose state changed. onStatusChange() Obsolete since Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Called when the status of a download request has changed. The received status message is intended to be displayed visibly to the user. Note: If source and destination are identical, which is possible in case of file URLs or chrom...
nsIHapticFeedback
LongPress 1 Specify as the action type to perform a long vibration. Methods performSimpleAction() Perform haptic feedback. void performSimpleAction( in long isLongPress ); Parameters isLongPress The press length; t...
... LongPress 1 Specify as the action type to perform a long vibration. Methods performSimpleAction() Perform haptic feedback. void performSimpleAction( in long isLongPress ); Parameters isLongPress The press length; this will determine how l...
... ...
nsIHttpChannel
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 nsIHttpHeaderVisitor aVisitor); void visitRequestHeaders(in nsIHttpHeaderVisitor aVisitor); void visitResponseHeaders(in nsIHttpHeaderVisitor aVisitor); Constants Constant Description REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE Default; indicates not to pass on the referrer when downgrading from https to http REFERRER_POLICY_NO_REFERRER Indicates no referrer will be sent REFERRER_POLICY_ORIGIN Only send the origin of the referring URI REFERRER_POLICY_ORIGIN_WHEN_XORIGIN Same as the default; Only s...
...rom the server. There are no assumptions made about the charset of the returned text. You have been warned! Read only. Exceptions thrown NS_ERROR_NOT_AVAILABLE If called before the response has been received (before onStartRequest()). referrerPolicy Read only unsigned long The referrer policy in use for this channel, indicated by one of the constants listed above Methods getOriginalResponseHeader() Get the value of a particular original response header, that is, in the same form as it came from the network. I.e. empty headers will have an empty string as value and multiple headers will not be merged as opposed to getResponseHeader(). void getOriginalResponseHeader( in ACString aHeader, in nsIHttpHeaderVisitor aVisitor ); Parame...
...eader ); Parameters aHeader The case-insensitive name of the request header to set (For example "Cookie"). Exceptions thrown NS_ERROR_IN_PROGRESS If called after the channel has been opened. NS_ERROR_FAILURE If called during visitRequestHeaders(). setReferrerWithPolicy() Call this method to set the channel's referrer using the referrer policy indicated with one of the predefined constants. void setReferrerWithPolicy( in nsIURI aReferrer, in unsigned long aReferrerPolicy ); Parameters aReferrer The URI to base the referrer on. aReferrerPolicy The referrer policy to use when determining the referrer to use. Exceptions thrown NS_ERROR_FAILURE If called during visitRequestHeaders(). setRequestHeader() This method is called to set the value of a particular request...
nsIMemoryReporter
ied in the units indicated by the units attribute. Read only. Note: This attribute was called memoryUsed prior to Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4), and its type was long long. description AUTF8String A human-readable description of this memory usage report. Read only. kind PRInt32 The memory kind, one of the Memory reporter kind constants below. Read only. path AUTF8String The path that this memory usage should be reported under. Paths are delimited with '/' characters to allow a hierarchy of memory to be displayed in about:memory. As of Gecko 6.0, the path should start with "explicit/" if the memory report accounts for all memory reported under sub-paths. Read only. process ACString The name of the ...
...orter. Each reporter starts with an empty string for this value, indicating that it applies to the current process; this is true even for reporters in a child process. When a reporter from a child process is copied into the main process, the copy's process field is set appropriately. Read only. units PRInt32 The units used by the amount attribute; this will be one of the Unit type constants. Read only. Constants Memory reporter kind constants These allocation kind constants describe the types of memory allocation described by memory use reporters. Constant Value Description KIND_MAPPED 0 This is deprecated synonym for KIND_NONHEAP. Deprecated since Gecko 8.0 KIND_NONHEAP 0 Allocated directly by OS calls e.g. mmap, VirtualAlloc, vm...
... KIND_MAPPED 0 This is deprecated synonym for KIND_NONHEAP. Deprecated since Gecko 8.0 KIND_NONHEAP 0 Allocated directly by OS calls e.g. mmap, VirtualAlloc, vm_allocate etc. KIND_HEAP 1 Allocated by the heap allocator, e.g. malloc, new etc. KIND_OTHER 2 An allocation that does not fit into another KIND category. Unit type constants Requires Gecko 7.0(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4) The amount reported by a memory reporter may use one of the following units. Constant Value Description UNITS_BYTES 0 The amount is specified as a number of bytes. UNITS_COUNT 1 The amount is an instantaneous count of things currently in existence. For example, the number of tabs cu...
nsINavHistoryQuery
e never been visited. This allows place queries to be returned (which might include bookmark folders -- use the bookmark service's GetFolderURI) as well as anything else that may have been tagged with an annotation. This will only work for RESULTS_AS_URI since there will be no visits for these items. beginTime PRTime Begin time range for results (INCLUSIVE). beginTimeReference long One of the constants TIME_RELATIVE_* which indicates how to interpret the corresponding begin time value. domain AUTF8String This is the host or domain name (controlled by domainIsHost). When domainIsHost, domain only does exact matching on host names. Otherwise, it will return anything whose host name ends in domain. This one is a little different than most. Setting it to an empty string is a real query and will m...
...tring is a real query and will match any URI that has no host name (local files and such). Set this to NULL (in C++ use SetIsVoid) if you don't want domain matching. domainIsHost boolean This controls the meaning of domain, and whether it is an exact match domainIsHost = true, or hierarchical (= false). endTime PRTime End time range for results (INCLUSIVE). endTimeReference long One of the constants TIME_RELATIVE_* which indicates how to interpret the corresponding end time value. folderCount long Read only: Count of folders. hasAnnotation boolean Read only: Whether or not, annotation exists. hasBeginTime boolean Read only: Whether or not, the corresponding begin time is considered. hasDomain boolean Read only: Whether or not, domain exists. hasEndTime boolean Read only: Whether or...
...nd out every time you visited a given URI. Use uriIsPrefix to control whether this is an exact match. uriIsPrefix boolean Controls the interpretation of uri. When unset (default), the URI will request an exact match of the specified URI. When set, any history entry beginning in uri will match. For example http://bar.com/foo will match http://bar.com/foo as well as http://bar.com/foo/baz.gif. Constants Constant Value Description TIME_RELATIVE_EPOCH 0 Default value. The time is relative to Jan 1 1970 GMT, (this is a normal PRTime). As a special case, a 0 time relative to TIME_RELATIVE_EPOCH indicates that the time is not part of the query. This is the default, so an empty query will match any time. TIME_RELATIVE_TODAY 1 The time is relative to this morning at midnight. Normally used for q...
nsIPermissionManager
n nsIPrincipal principal, in string type); PRUint32 testPermission(in nsIURI uri, in string type); PRUint32 testPermissionFromPrincipal(in nsIPrincipal principal, in string type); Attributes Attribute Type Description enumerator nsISimpleEnumerator Enumerates all stored permissions. Allows access to nsIPermission objects. Read only. Constants Permission type constants Constant Value Description UNKNOWN_ACTION 0 Default permission when no entry is found for a host. It should not be used by consumers. ALLOW_ACTION 1 Permission is allowed. DENY_ACTION 2 Permission is denied. PROMPT_ACTION 3 Prompt user if the permission is allowed. Permission expiration c...
...n PRUint32 permission, [optional] in PRUint32 expireType, [optional] in PRInt64 expireTime ); Parameters uri The URI to add the permission for. type A unique, case-sensitive ASCII string identifying the consumer. Consumers should choose this string to be unique, with respect to other consumers. permission An integer specifying the permission. See nsIPermissionManager.Permission_type_constants. expireType Expiration type of the permission. See nsIPermissionManager.Permission_expiration_constants. expireTime Time (in milliseconds since Jan 1 1970 0:00:00) representing expiration of this permission. addFromPrincipal() Add permission information and permission type for a given principal. If the permission already exists for a given type, it will be modified. It is internally callin...
...ermission, [optional] in PRUint32 expireType, [optional] in PRInt64 expireTime ); Parameters principal The principal to add the permission for. type A unique, case-sensitive ASCII string identifying the consumer. Consumers should choose this string to be unique, with respect to other consumers. permission An integer specifying the permission. See nsIPermissionManager.Permission_type_constants. expireType Expiration type of the permission. See nsIPermissionManager.Permission_expiration_constants. expireTime Time (in milliseconds since Jan 1 1970 0:00:00) representing expiration of this permission. remove() Remove permission information for a given host string and permission type. void remove( in nsIURI uri, in string type ); Parameters nsIURI The uri whose permission ...
nsIPromptService
All flags are defined as unsigned long constants and can be accessed as Components.interfaces.nsIPromptService.flagname from JavaScript and as nsIPromptService::flagname from C++. Button position flags On Linux and Mac, button 2 is on the left of the prompt, while buttons 1 and 0 are on the right. On Windows ...
... wstring aPassword, in wstring aCheckMsg, inout boolean aCheckState); boolean select(in nsIDOMWindow aParent, in wstring aDialogTitle, in wstring aText, in PRUint32 aCount, [array, size_is(aCount)] in wstring aSelectList, out long aOutSelection); Constants The following flags are combined to form the aButtonFlags parameter passed to confirmEx. All flags are defined as unsigned long constants and can be accessed as Components.interfaces.nsIPromptService.flagname from JavaScript and as nsIPromptService::flagname from C++. Button position flags On Linux and Mac, button 2 is on the left of the prompt, while buttons 1 and 0 are on the right. On Windows and OS/2, the buttons are centred in the order 0, 2, 1. Constant Value Description BUTTON_POS_0 1 This is us...
...ndard labels from the user's current locale. BUTTON_TITLE_CANCEL 2 BUTTON_TITLE_YES 3 BUTTON_TITLE_NO 4 BUTTON_TITLE_SAVE 5 BUTTON_TITLE_DONT_SAVE 6 BUTTON_TITLE_REVERT 7 BUTTON_TITLE_IS_STRING 127 This flag indicates that the label is passed as a separate string. Use this for labels that don't match one of the constants above. Button default flags These flags are used to select which button is the default. Constant Value Description BUTTON_POS_0_DEFAULT 0 BUTTON_POS_1_DEFAULT 16777216 BUTTON_POS_2_DEFAULT 33554432 BUTTON_DELAY_ENABLE BUTTON_DELAY_ENABLE causes the buttons to be initially disabled. They are enabled after a timeout expir...
nsIScreen
Type Description colorDepth long The screen's color depth; this is the number of bits used to represent a color. Read only. pixelDepth long The screen's pixel depth; this is the number of bits used to represent a pixel. Read only. rotation unsigned long The screen's current rotation; you may set this to any of the values listed in Screen rotation constants. ...
...; you may set this to any of the values listed in Screen rotation constants. This will only have an effect on platforms that support screen rotation. Gecko 1.9.2 note Starting in Gecko 1.9.2, Gecko running on Microsoft Windows reports 24 bits per pixel instead of 32 bits per pixel on 8-bits per color component displays, since this is typically what the caller is actually looking for. Constants Screen brightness constants Constant Value Description BRIGHTNESS_DIM 0 The screen is fully dimmed (that is, off). BRIGHTNESS_FULL 1 The screen is at full brightness. BRIGHTNESS_LEVELS 2 The number of different brightness levels. Screen rotation constants Requires Gecko 13.0(Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10...
...t from becoming any dimmer than that brightness level. Each call to this method must eventually be followed by a corresponding call to unlockMinimumBrightness() with the same value for the brightness parameter. void lockMinimumBrightness( in unsigned long brightness ); Parameters brightness The new minimum brightness level; this must be one of the values specified in Screen brightness constants. unlockMinimumBrightness() Releases a lock on the minimum brightness of the screen, which was previously established through a corresponding call to lockMinimumBrightness(). void unlockMinimumBrightness( in unsigned long brightness ); Parameters brightness The brightness level to release; this must be one of the values specified in Screen brightness constants. Example var screenMan ...
nsISearchEngine
A nsIURI corresponding to the engine's icon, stored locally. May be null. Read only. name AString The display name of the search engine. This is a unique identifier. Read only. searchForm AString A URL string pointing to the engine's search form. Read only. type long The search engine type. Read only. ...
... the engine's icon, stored locally. May be null. Read only. name AString The display name of the search engine. This is a unique identifier. Read only. searchForm AString A URL string pointing to the engine's search form. Read only. type long The search engine type. Read only. ...
...g pointing to the engine's search form. Read only. type long The search engine type. Read only. Constants Search engine type constants Constant Value Description TYPE_MOZSEARCH 1 TYPE_SHERLOCK 2 TYPE_OPENSEARCH 3 Search engine data type constants Constant Value Description DATA_XML 1 Data type is XML DATA_TEXT 2 Data type is Text. Methods addParam() Adds a parameter to the search engine's submission data. This should only be called on engines created via nsIBrowserSearchService.addEngineWithDetails(). void addParam( in AString name, in AString ...
nsISelectionPrivate
nsEditor::EndPlaceHolderTransaction. EndPlaceHolderTransaction will give rise to reflow/refreshing view/scroll, and call times of nsTextFrame::GetPointFromOffset whose return value is to be cached. See bug 35296 and bug 199412 Native code only! interlinePosition boolean type short Returns the type of the selection (see nsISelectionController for available constants). Read only. Constants Constant Value Description ENDOFPRECEDINGLINE 0 STARTOFNEXTLINE 1 TABLESELECTION_NONE 0 TABLESELECTION_CELL 1 TABLESELECTION_ROW 2 TABLESELECTION_COLUMN 3 TABLESELECTION_TABLE 4 TABLESELECTION_ALLCELLS 5 Metho...
... allowAdjacent Specifies whether the returned ranges are allowed to touch the input range rather than merely overlapping it. results Returns the ranges that overlap (or touch) the input range. getTableSelectionType() Test if supplied range points to a single table element. long getTableSelectionType( in nsIDOMRange range ); Parameters range Return value One of TABLESELECTION_* constants. "None" means a table element is not selected. removeSelectionListener() void removeSelectionListener( in nsISelectionListener listenerToRemove ); Parameters listenerToRemove scrollIntoView() Scrolls a region of the selection, so that it is visible in the scrolled view. void scrollIntoView( in short aRegion, in boolean aIsSynchronous, in short aVPercent, in short aHPerce...
...r( in nsISelectionListener listenerToRemove ); Parameters listenerToRemove scrollIntoView() Scrolls a region of the selection, so that it is visible in the scrolled view. void scrollIntoView( in short aRegion, in boolean aIsSynchronous, in short aVPercent, in short aHPercent ); Parameters aRegion The region inside the selection to scroll into view (see selection region constants defined in nsISelectionController). aIsSynchronous When true, scrolls the selection into view before returning. If false, posts a request which is processed at some point after the method returns. aVPercent How to align the frame vertically. A value of 0 means the frame's upper edge is aligned with the top edge of the visible area. A value of 100 means the frame's bottom edge is aligned with ...
nsISocketProvider
When set, the hostname parameter passed in this interface will be used instead of the address structure passed for a later request. ANONYMOUS_CONNECT 1 << 1 When setting this flag, the socket will not apply any c...
...Supports aSecurityInfo ); Parameters aFamily The address family for this socket (PR_AF_INET or PR_AF_INET6). aHost The hostname for this connection. aPort The port for this connection. aProxyHost If non-null, the proxy hostname for this connection. aProxyPort The proxy port for this connection. aFlags Control flags that govern this connection (see Constants). aFileDesc The existing PRFileDesc. aSecurityInfo Any security info that should be associated with aFileDesc. This object typically implements nsITransportSecurityInfo. Native code only!newSocket Creates a new socket. void newSocket( in long aFamily, in string aHost, in long aPort, in string aProxyHost, in long aProxyPort, in unsigned long aFlags, out PRFileDescSta...
...Supports aSecurityInfo ); Parameters aFamily The address family for this socket (PR_AF_INET or PR_AF_INET6). aHost The hostname for this connection. aPort The port for this connection. aProxyHost If non-null, the proxy hostname for this connection. aProxyPort The proxy port for this connection. aFlags Control flags that govern this connection (see Constants) aFileDesc The resulting PRFileDesc. aSecurityInfo Any security info that should be associated with aFileDesc. This object typically implements nsITransportSecurityInfo. See also nsITransportSecurityInfo ...
nsISound
EVENT_ALERT_DIALOG_OPEN 1 An alert dialog is opened. EVENT_CONFIRM_DIALOG_OPEN 2 A confirm dialog is opened. EVENT_PROMPT_DIALOG_OPEN 3 A prompt dialog (on...
... EVENT_ALERT_DIALOG_OPEN 1 An alert dialog is opened. EVENT_CONFIRM_DIALOG_OPEN 2 A confirm dialog is opened. EVENT_PROMPT_DIALOG_OPEN 3 A prompt dialog (one that allows the user...
... playEventSound() Plays the system sound for the specified event. If the user's system is configured to not play system sound effects for the event, this will do nothing. Warning: This method should not be used in modern code. Please use the HTML 5 <audio> tag instead. void playEventSound( in unsigned long aEventId ); Parameters aEventId An event ID which is defined in the constants. playSystemSound() Plays the system sound whose name is specified. If the user's system is configured to not play system sound effects, this will do nothing. Note: This function is not supported on the Macintosh. void playSystemSound( in AString soundAlias ); Parameters soundAlias Two different types of names are supported: You can specify the name of a system sound prov...
nsIStyleSheetService
A user sheet loaded via this API will come before userContent.css and ...
...an rules in ua.css). The relative ordering of two user or two agent sheets loaded via this API is undefined. Sheets added via this API take effect on all documents, including already-loaded ones, immediately. void loadAndRegisterSheet( in nsIURI sheetURI, in unsigned long type ); Parameters sheetURI URI of the stylesheet to load and register. type One of the type constants. sheetRegistered() Check if a stylesheet has been registered boolean sheetRegistered( in nsIURI sheetURI, in unsigned long type ); Parameters sheetURI URI of the stylesheet to check. type One of the type constants. Return value Returns true if a style sheet at sheetURI has previously been added to the list of style sheets specified by type. unregisterSheet() Re...
...o the list of style sheets specified by type. unregisterSheet() Remove the style sheet at sheetURI from the list of style sheets specified by type. The removal takes effect immediately, even for already-loaded documents. void unregisterSheet( in nsIURI sheetURI, in unsigned long type ); Parameters sheetURI URI of the stylesheet to unregister. type One of the type constants. See also See Using the Stylesheet Service for examples. ...
nsIWebNavigationInfo
Note: This is guaranteed not to change, so that boolean tests can be done on the return value if isTypeSupported to detect whether a type is supported at all. IMAGE 1 Returned by isTypeSupported() to indicate th...
... Note: This is guaranteed not to change, so that boolean tests can be done on the return value if isTypeSupported to detect whether a type is supported at all. IMAGE 1 Returned by isTypeSupported() to indicate that a type is supported ...
...ype to check. aWebNav The nsIWebNavigation object on which to check for compatibility. You may specify null to check for compatibility with nsIWebNavigation objects that are in their default state; otherwise, the result is determined based on the configuration of the specified object (that is, how it is configured by using nsIWebBrowserSetup). Return value Returns one of the Support type constants, indicating whether or not the specified MIME type is supported, and in what form that support exists. Example let webnavigationinfo_service = Components.classes["@mozilla.org/webnavigation-info;1"] .getService(Components.interfaces.nsIWebNavigationInfo); let support_code = webnavigationinfo_service.isTypeSupported(contentType, null); if (support_code == webnaviga...
nsIWindowMediator
zLevelBottom 2 Send window to bottom. zLevelBelow 3 Place window below some window. Methods addListener() Register a listener for window status changes. void addListener( in nsIWindowMediatorListener aListener ); Parameters aListener The listener to register. ...
...nsIWidgets), and its implementation must be very understanding of what may be completely invalid pointers in those parameters. boolean calculateZPosition( in nsIXULWindow inWindow, in unsigned long inPosition, in nsIWidget inBelow, out unsigned long outPosition, out nsIWidget outBelow ); Parameters inWindow The window in question. inPosition Requested position one of the zLevel constants. zLevelTop send the window to the top window, zLevelBottom to the bottom. If set to zLevelBelow the window will be placed below ioBelow. The value of inBelow will be ignored for zLevelTop and zLevelBottom.) inBelow If inPosition is set to zLevelBelow, the window below which inWindow wants to be placed. Otherwise this variable is ignored. outPosition Constrained position, values like inPositio...
...el ); Parameters aWindow The window in question. aZLevel The window's new Z level. Native code only!setZPosition A window has been positioned behind another. Inform WindowMediator. void setZPosition( in nsIXULWindow inWindow, in unsigned long inPosition, in nsIXULWindow inBelow ); Parameters inWindow The window in question. inPosition Requested position one of the zLevel constants. zLevelTop send the window to the top window, zLevelBottom to the bottom. If set to zLevelBelow the window will be placed below ioBelow. The value of inBelow will be ignored for zLevelTop and zLevelBottom.) inBelow The window inWindow is behind, if zLevelBelow. Native code only!unregisterWindow Remove the window from the list of known windows. Listeners (see addListener()) will be be notifie...
RTCConfiguration - Web APIs
the RTCPeerConnection. If this value is set (it defaults to null), the RTCPeerConnection will not connect to a remote peer unless it can successfully authenticate with the given name. rtcpMuxPolicy Optional The RTCP mux policy to use when gathering ICE candidates, in order to support non-multiplexed RTCP. The value must be one of those from the RTCRtcpMuxPolicy enum. The default is "require". Constants RTCBundlePolicy enum The RTCBundlePolicy enum defines string constants which are used to request a specific policy for gathering ICE candidates if the remote peer isn't "BUNDLE-aware" (compatible with the SDP BUNDLE standard for bundling multiple media streams on a single transport link). All browser implementations are BUNDLE-aware. If the remote endpoint is BUNDLE-aware, all media tracks and...
... BUNDLE-aware, everything is negotiated on these separate DTLS transports. "max-bundle" The ICE agent initially creates only a single RTCDtlsTransport to carry all of the RTCPeerConnection's data. If the remote endpoint is not BUNDLE-aware, then only a single track will be negotiated and the rest ignored. RTCIceTransportPolicy enum The RTCIceTransportPolicy enum defines string constants which can be used to limit the transport policies of the ICE candidates to be considered during the connection process. Constant Description "all" All ICE candidates will be considered. "public" Only ICE candidates with public IP addresses will be considered. Removed from the specification's May 13, 2016 working draft. "relay" Only ICE candid...
... candidates will be considered. "public" Only ICE candidates with public IP addresses will be considered. Removed from the specification's May 13, 2016 working draft. "relay" Only ICE candidates whose IP addresses are being relayed, such as those being passed through a TURN server, will be considered. RTCRtcpMuxPolicy enum The RTCRtcpMuxPolicy enum defines string constants which specify what ICE candidates are gathered to support non-multiplexed RTCP. <<<add a link to info about multiplexed RTCP. Constant Description "negotiate" Instructs the ICE agent to gather both RTP and RTCP candidates. If the remote peer can multiplex RTCP, then RTCP candidates are multiplexed atop the corresponding RTP candidates. Otherwise, both the RTP and RTCP...
SVGPathSeg - Web APIs
to a single command within a path data specification. ...
...It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. PATHSEG_CLOSEPATH 1 ...
...TO_QUADRATIC_SMOOTH_REL 19 Corresponds to a "relative smooth quadratic curveto" (t) path data command. Properties Name Type Description pathSegType unsigned short The type of the path segment as specified by one of the constants defined on this interface. pathSegTypeAsLetter DOMString The type of the path segment as specified by the corresponding one character command name. Methods The SVGPathSeg interface does not provide any specific methods. Browser compatibility ...
SVGPreserveAspectRatio - Web APIs
tio attribute, which is available for some of SVG's elements. An SVGPreserveAspectRatio object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_PRESERVEASPECTRATIO_NONE 1 Corresponds to value none for attribute preserveAspectRatio. SVG_PRE...
...alue to this type. SVG_MEETORSLICE_MEET 1 Corresponds to value meet for attribute preserveAspectRatio. SVG_MEETORSLICE_SLICE 2 Corresponds to value slice for attribute preserveAspectRatio. Properties Name Type Description align unsigned short The type of the alignment value as specified by one of the SVG_PRESERVEASPECTRATIO_* constants defined on this interface. meetOrSlice unsigned short The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_* constants defined on this interface. Exceptions on setting: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised on an attempt to change the value of an attribute on a read only object. Methods The SVGPreserveAspectRatio interface...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
stination blending factor. The default value is gl.ZERO. For possible values, see below. Return value None. Exceptions If srcRGB, dstRGB, srcAlpha, or dstAlpha is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. If a constant color and a constant alpha value are used together as source (srcRGB) and destination (dstRGB) factors, a gl.INVALID_ENUM error is thrown. ...
.... The default value is gl.ZERO. For possible values, see below. Return value None. Exceptions If srcRGB, dstRGB, srcAlpha, or dstAlpha is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. If a constant color and a constant alpha value are used together as source (srcRGB) and destination (dstRGB) factors, a gl.INVALID_ENUM error is thrown. ...
...ion alpha color. The alpha value is multiplied by 1. Examples To use the blend function, you first have to activate blending with WebGLRenderingContext.enable() with the argument gl.BLEND. gl.enable(gl.BLEND); gl.blendFuncSeparate(gl.SRC_COLOR, gl.DST_COLOR, gl.ONE, gl.ZERO); To get the current blend function, query the BLEND_SRC_RGB, BLEND_SRC_ALPHA, BLEND_DST_RGB, and BLEND_DST_ALPHA constants which return one of the blend function constants. gl.enable(gl.BLEND); gl.blendFuncSeparate(gl.SRC_COLOR, gl.DST_COLOR, gl.ONE, gl.ZERO); gl.getParameter(gl.BLEND_SRC_RGB) == gl.SRC_COLOR; // true Specifications Specification Status Comment WebGL 1.0The definition of 'blendFunc' in that specification. Recommendation Initial definition. In WebGL, constant colo...
WebGLRenderingContext.stencilOp() - Web APIs
fail A GLenum specifying the function to use when the stencil test fails. The default value is gl.KEEP. zfail A GLenum specifying the function to use when the stencil test passes, but the depth test fails. The default value is gl.KEEP. ...
...ult value is gl.KEEP. zfail A GLenum specifying the function to use when the stencil test passes, but the depth test fails. The default value is gl.KEEP. zpass A GLenum specifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. The default value is gl.KEEP. Return value None. Constants gl.KEEP Keeps the current value. gl.ZERO Sets the stencil buffer value to 0. gl.REPLACE Sets the stencil buffer value to the reference value as specified by WebGLRenderingContext.stencilFunc(). gl.INCR Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. gl.INCR_WRAP Increments the current stencil buffer value. Wraps stencil buffer value to ...
... of 0. gl.INVERT Inverts the current stencil buffer value bitwise. Examples The stencil testing is disabled by default. To enable or disable stencil testing, use the enable() and disable() methods with the argument gl.STENCIL_TEST. gl.enable(gl.STENCIL_TEST); gl.stencilOp(gl.INCR, gl.DECR, gl.INVERT); To get the current information about stencil and depth pass or fail, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FAIL); gl.getParameter(gl.STENCIL_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BACK_FAIL); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment WebGL 1.0...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
face A GLenum specifying whether the front and/or back stencil state is updated. The possible values are: gl.FRONT gl.BACK gl.FRONT_AND_BACK fail A GLenum specifying the function to use when the stencil test fails. The default value is gl.KEEP. ...
...ult value is gl.KEEP. zfail A GLenum specifying the function to use when the stencil test passes, but the depth test fails. The default value is gl.KEEP. zpass A GLenum specifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. The default value is gl.KEEP. Return value None. Constants gl.KEEP Keeps the current value. gl.ZERO Sets the stencil buffer value to 0. gl.REPLACE Sets the stencil buffer value to the reference value as specified by WebGLRenderingContext.stencilFunc(). gl.INCR Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. gl.INCR_WRAP Increments the current stencil buffer value. Wraps stencil buffer value to ...
... Inverts the current stencil buffer value bitwise. Examples The stencil testing is disabled by default. To enable or disable stencil testing, use the enable() and disable() methods with the argument gl.STENCIL_TEST. gl.enable(gl.STENCIL_TEST); gl.stencilOpSeparate(gl.FRONT, gl.INCR, gl.DECR, gl.INVERT); To get the current information about stencil and depth pass or fail, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FAIL); gl.getParameter(gl.STENCIL_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BACK_FAIL); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_PASS); gl.getParameter(gl.STENCIL_BACK_PASS_DEPTH_FAIL); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment WebGL 1.0...
Web Audio API - Web APIs
The keyboard allows you to switch...
...The keyboard allows you to switch among the standard waveforms as well as one custom wavef...
...ome of the audio theory behind how the features of the Web Audio API work, to help you make informed decisions while designing how audio is routed through your app.Controlling multiple parameters with ConstantSourceNodeThis article demonstrates how to use a ConstantSourceNode to link multiple parameters together so they share the same value, which can be changed by simply setting the value of the ConstantSourceNode.offset parameter.Example and tutorial: Simple synth keyboardThis article presents the code and working demo of a video keyboard you can play using the mouse. The keyboard allows you to switch among the standard waveforms as well as one custom waveform, and you can control the master gain using a volume slider beneath the keyboard. This example makes use of the following Web API interface...
XPathResult.resultType - Web APIs
Constants Result Type Defined Constant Value Description ANY_TYPE 0 A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. ...
... Constants Result Type Defined Constant Value Description ANY_TYPE 0 A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. ...
... The read-only resultType property of the XPathResult interface represents the type of the result, as defined by the type constants. Note: This feature is available in Web Workers. Syntax var resultType = result.resultType; Return value An integer value representing the type of the result, as defined by the type constants. Constants Result Type Defined Constant Value Description ANY_TYPE 0 A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. NUMBER_TYPE 1 A result containing a single number. This is useful for example, in an XPath expression using the count() function. STRING_TYPE 2 A resul...
Grammar and types - JavaScript
s, the global object is window, so you can set and access global variables using the window.variable syntax. Consequently, you can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if a variable called phoneNumber is declared in a document, you can refer to this variable from an iframe as parent.phoneNumber. Constants You can create a read-only, named constant with the const keyword. The syntax of a constant identifier is the same as any variable identifier: it must start with a letter, underscore, or dollar sign ($), and can contain alphabetic, numeric, or underscore characters. const PI = 3.14; A constant cannot change value through assignment or be re-declared while the script is running. It must be in...
...t with the const keyword. The syntax of a constant identifier is the same as any variable identifier: it must start with a letter, underscore, or dollar sign ($), and can contain alphabetic, numeric, or underscore characters. const PI = 3.14; A constant cannot change value through assignment or be re-declared while the script is running. It must be initialized to a value. The scope rules for constants are the same as those for let block-scope variables. If the const keyword is omitted, the identifier is assumed to represent a variable. You cannot declare a constant with the same name as a function or variable in the same scope. For example: // THIS WILL CAUSE AN ERROR function f() {}; const f = 5; // THIS WILL CAUSE AN ERROR TOO function f() { const g = 5; var g; //statements } How...
...ariables. If the const keyword is omitted, the identifier is assumed to represent a variable. You cannot declare a constant with the same name as a function or variable in the same scope. For example: // THIS WILL CAUSE AN ERROR function f() {}; const f = 5; // THIS WILL CAUSE AN ERROR TOO function f() { const g = 5; var g; //statements } However, the properties of objects assigned to constants are not protected, so the following statement is executed without problems. const MY_OBJECT = {'key': 'value'}; MY_OBJECT.key = 'otherValue'; Also, the contents of an array are not protected, so the following statement is executed without problems. const MY_ARRAY = ['HTML','CSS']; MY_ARRAY.push('JAVASCRIPT'); console.log(MY_ARRAY); //logs ['HTML','CSS','JAVASCRIPT']; Data structures and type...
const - JavaScript
The value of a constant can't be changed through reassignment, and it can't be redeclared. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]]; nameN The constant's name, which can be any legal identifier. valueN The constant's value. This can be any legal expression, including a function expression. Description This declaration creates a constant whose scope can be either global or local to the block in which it is declared. ...
...d us a pull request. Syntax const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]]; nameN The constant's name, which can be any legal identifier. valueN The constant's value. This can be any legal expression, including a function expression. Description This declaration creates a constant whose scope can be either global or local to the block in which it is declared. Global constants do not become properties of the window object, unlike var variables. An initializer for a constant is required. You must specify its value in the same statement in which it's declared. (This makes sense, given that it can't be changed later.) The const declaration creates a read-only reference to a value. It does not mean the value it holds is immutable--just that the variable identifier cannot...
...ds is immutable--just that the variable identifier cannot be reassigned. For instance, in the case where the content is an object, this means the object's contents (e.g., its properties) can be altered. All the considerations about the "temporal dead zone" apply to both let and const. A constant cannot share its name with a function or a variable in the same scope. Examples Basic const usage Constants can be declared with uppercase or lowercase, but a common convention is to use all-uppercase letters. // define MY_FAV as a constant and give it the value 7 const MY_FAV = 7; // this will throw an error - Uncaught TypeError: Assignment to constant variable. MY_FAV = 20; // MY_FAV is 7 console.log('my favorite number is: ' + MY_FAV); // trying to redeclare a constant throws an error // Uncaugh...
Introduction to using XPath in JavaScript - XPath
User Defined Namespace Resolver section in the appendix for details. resultType: A constant that specifies the desired result type to be returned as a result of the evaluation. The most commonly passed constant is XPathResult.ANY_TYPE which will return the results of the XPath expression as the most natural type. There is a section in the appendix which contains a full list of the available constants. They are explained below in the section "Specifying the Return Type." result: If an existing XPathResult object is specified, it will be reused to return the results. Specifying null will create a new XPathResult object. Return Value Returns xpathResult, which is an XPathResult object of the type specified in the resultType parameter. The XPathResult Interface is defined here. Implementing ...
...Similarly, an XPathEvaluator can be created using: Components.classes["@mozilla.org/dom/xpath-evaluator;1"].createInstance(Components.interfaces.nsIDOMXPathEvaluator) Appendix Implementing a User Defined Namespace Resolver This is an example for illustration only. This function w...
...Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. NUMBER_TYPE 1 A result containing a single number. This is useful for example, in an XPath exp...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
u will need to get the IDL files from the source (via CVS, from a tarball, or using LXR). The following functions, however, are implemented in the glue library and can be used from frozen-linkage code: NS_NewArrayEnumerator (excluding deprecated nsISupportsArray version) NS_NewEmptyEnumerator NS_NewUnionEnumerator nsCRT Functions in nsCRT.h are not available to frozen-linkage code. Some of the constants are still useful though. - #include "nsCRT.h" + #include <string.h> const char *str = "Foo"; - PRUint32 len = nsCRT::strlen(str); + PRUint32 len = strlen(str); - #include "nsCRT.h" + #include "nsCRTGlue.h" const PRUnichar str[] = {'F','o','o','\0'}; - PRUint32 len = nsCRT::strlen(str); + PRUint32 len = NS_strlen(str); - #include "nsCRT.h" + #include "nsMemory.h" + #include "nsCRTGlue.h" ...
...eCompare #define nsCaseInsensitiveStringComparator() CaseInsensitiveCompare These allow you to use the comparators to those APIs that normally accept CaseInsensitiveCompare under the external API. #define kNotFound -1 This convenience constant is not defined under the external API. #define AppendASCII(str) AppendLiteral(str) The internal API distinguishes between literals (which must be character constants) and ASCII strings. The external API confusingly provides an AppendLiteral method that does not require a character constant. #define AppendUTF16toUTF8(a16, a8) (a8).Append(NS_ConvertUTF16toUTF8(a16)) And similarly for the other conversions. #define Compare(str1, str2, comp) (str1).Compare(str2, comp) #define Last() EndReading()[-1] #define SetCharAt(c, i) Replace(i, 1, ch) #define NS_NewISuppor...
XPCOM Objects - Archive of obsolete content
face. You must generate a new one for each interface, and you should change it every time the interface changes. In this case you're forced to use UUID, the email address format used for extension ids won't work. We included a constant, an attribute and a method to display examples of the 3, but this is clearly an overly elaborate way to keep a simple counter. You can define numeric and boolean constants in IDL files, but not string constants. This is a known limitation of XPIDL, and a simple workaround is to define a readonly attribute instead. This means you have to define a getter in the implementation file, though. You can access constants through a reference of the component, or directly from the interface: // these are equivalent. max = Ci.xsIHelloCounter.MAX_COUNT; max = counterReferenc...
...st Cr = Components.results; const Ce = Components.Exception; You should be familiar with this already, although there are a couple of additions, Components.results and Components.Exception. They'll be used further ahead. const CLASS_ID = Components.ID("{37ED5D2A-E223-4386-9854-B64FD38932BF}"); const CLASS_NAME = "Hello World Counter"; const CONTRACT_ID = "@xulschool.com/counter;1"; These constants are used at the bottom, in the component registration code. They specify the details of the component, such as a unique UUID (you have to generate it too and it must be different from the IDL UUID), a descriptive name (this isn't used anywhere that we know of), and the contract ID, which is the string you use to get a reference to the component. The ";1" at the end of the string is supposed to in...
Drag and Drop - Archive of obsolete content
erty event.target during the event handler. transferableArray An array of nsITransferable objects, one for each item being dragged. An array is used because you might want to drag several objects at once, such as a set of files. region A region used for feedback indication. This should usually be set to null. actions The actions that the drag uses. This should be set to one of the following constants, or several added together. The action can be changed during the drag depending on what is being dragged over. nsIDragService.DRAGDROP_ACTION_NONE Used to indicate that no drag is valid. nsIDragService.DRAGDROP_ACTION_COPY The item being dragged should be copied to its dropped location. nsIDragService.DRAGDROP_ACTION_MOVE The item being dragged should be moved to its dropped ...
... available: canDrop Set this property to true if the element the mouse is currently over can accept the object currently being dragged to be dropped on it. Set the value to false if it doesn't make sense to drop the object on it. This should be changed in the ondragover and ondragenter event handlers. dragAction Set to the current action to be performed, which should be one or more of the constants described earlier. This can be used to provide extra feedback to the user. numDropItems The number of items being dragged. For example, this will be set to 5 if five bookmarks are being dragged. getData(transfer,index) Get the data being dragged. The first argument should be an nsITransferable object to hold the data. The second argument, index, should be the index of the item to return. s...
Open and Save Dialogs - Archive of obsolete content
n); First, a new file picker object is created and stored in the variable 'fp'. The 'init' function is used to initialize the file picker. This function takes three arguments, the window that is opening the dialog, the title of the dialog and the mode. The mode here is modeOpen which is used for an Open dialog. You can also use modeGetFolder and modeSave for the other two modes. These modes are constants of the nsIFilePicker interface. Default directory and filters There are two features you can set of the dialog before it is displayed. The first is the default directory that is displayed when the dialog is opened. The second is a filter that indicates the list of file types that are displayed in the dialog. This would be used, for example, to hide all but .html files. You can set the def...
...ters. The order you add them determines their priority. Typically, the first one added is selected by default. Getting the selected file Finally, you can show the dialog by calling the show() function. It takes no arguments but returns a status code that indicates what the user selected. Note that the function does not return until the user has selected a file. The function returns one of three constants: returnOK - the user selected a file and pressed OK. The file the user selected will be stored in the file picker's file property. returnCancel - the user pressed Cancel. returnReplace - in the save mode, this return value identifies that the user selected a file to be replaced. (returnOK will be returned when the user entered the name of a new file.) You should check the return value and ...
browser - Archive of obsolete content
sIWebBrowserFind This read-only property contains an nsIWebBrowserFind object which can be used to search for text in the document. webNavigation Type: nsIWebNavigation This read-only property contains the nsIWebNavigation object for the document. Most of its methods are callable directly on the element itself, such as goBack and goForward. It also contains the load constants used by reloadWithFlags and loadURIWithFlags. webProgress Type: nsIWebProgress This read-only property contains an nsIWebProgress object which is used to monitor the progress of a document loading. Methods Inherited Methods addEventListener(), appendChild(), blur, click, cloneNode(), compareDocumentPosition, dispatchEvent(), doCommand, focus, getAttribute(), getAttr...
...ed for a redirect. (See nsIWebNavigation.loadURI() for details on the referrer and postData parameters.) reload() Return type: no return value Reloads the document in the browser element on which you call this method. reloadWithFlags( flags ) Return type: no return value Reloads the document in the browser with the given load flags. The flags listed below may be used, which are all constants of the webNavigation property (or the nsIWebNavigation interface). You may combine flags using a or symbol ( | ). LOAD_FLAGS_NONE: No special flags. The document is loaded normally. LOAD_FLAGS_BYPASS_CACHE: Reload the page, ignoring if it is already in the cache. This is the flag used when the reload button is pressed while the Shift key is held down. LOAD_FLAGS_BYPASS_PROXY: Reload the p...
tabbrowser - Archive of obsolete content
nsIWebBrowserFind This read-only property contains an nsIWebBrowserFind object which can be used to search for text in the document. webNavigation Type: nsIWebNavigation This read-only property contains the nsIWebNavigation object for the document. Most of its methods are callable directly on the element itself, such as goBack and goForward. It also contains the load constants used by reloadWithFlags and loadURIWithFlags. webProgress Type: nsIWebProgress This read-only property contains an nsIWebProgress object which is used to monitor the progress of a document loading. Methods Inherited Methods addEventListener(), appendChild(), blur, click, cloneNode(), compareDocumentPosition, dispatchEvent(), doCommand, focus, getAttribute(), getAttri...
... the browser element on which you call this method. reloadAllTabs() Return type: no return value Reloads the contents of all the tabs. reloadTab( tab ) Return type: no return value Reloads the contents of a specific tab. reloadWithFlags( flags ) Return type: no return value Reloads the document in the browser with the given load flags. The flags listed below may be used, which are all constants of the webNavigation property (or the nsIWebNavigation interface). You may combine flags using a or symbol ( | ). LOAD_FLAGS_NONE: No special flags. The document is loaded normally. LOAD_FLAGS_BYPASS_CACHE: Reload the page, ignoring if it is already in the cache. This is the flag used when the reload button is pressed while the Shift key is held down. LOAD_FLAGS_BYPASS_PROXY: Reload the p...
nsIContentPolicy - Archive of obsolete content
In general, you should try not to use this type unless none of the others is a fit. TYPE_SCRIPT 2 Indicates an executable script (such as JavaScript). TYPE_IMAGE 3 Indicates an image (for exam...
...te on shouldLoad() to see what this means for implementors of this method. short shouldProcess( in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeType, in nsISupports aExtra, in nsIPrincipal aRequestPrincipal ); Parameters aContentType The type of content being tested. This will be one of the TYPE_* constants. aContentLocation OPTIONAL. The location of the resource being requested: MAY be, e.g., a post-redirection URI for the resource. aRequestOrigin OPTIONAL. The location of the resource that initiated this load request; can be null if inapplicable. aContext OPTIONAL. The nsIDOMNode or nsIDOMWindow that initiated the request, or something that can Query Interface to one of those; can be null if...
NPN_Version - Archive of obsolete content
umber of 3. This function gets the values from the plug-in rather than from the browser. A plug-in can use this function to check that the version of the plug-in API it is using is compatible with the version in use by the browser. This could be part of the initialization process. For more information and an example, see Getting the Current Version. You can use NPN_Version() to inquire on version constants (NPVERS constants), which represent particular browser features. Once the plug-in obtains a version number, it can inquire on a version constant to find out if the feature it represents exists in this version. For example, the plug-in could inquire on the constant NPVERS_HAS_WINDOWLESS to see if it is running in a browser that supports windowless functionality. For more information and an example...
.... Once the plug-in obtains a version number, it can inquire on a version constant to find out if the feature it represents exists in this version. For example, the plug-in could inquire on the constant NPVERS_HAS_WINDOWLESS to see if it is running in a browser that supports windowless functionality. For more information and an example, see Finding Out if a Feature Exists. For a listing of version constants defined in the plug-in API, see Version Feature Constants. Note: Platform-specific code in the plug-in API files npwin.cpp, npmac.cpp, or npunix.c checks version numbers automatically. A plug-in whose major version is less than the major version of the browser is not loaded. See also NPN_UserAgent() NP_Initialize() ...
Storing the information you need — Variables - Learn web development
ing the four lines above into your console one by one, and see what the results are. You'll notice that we are using a special operator called typeof -- this returns the data type of the variable you type after it. The first time it is called, it should return string, as at that point the myNumber variable contains a string, '500'. Have a look and see what it returns the second time you call it. Constants in JavaScript Many programming languages have the concept of a constant -- a value that once declared can't be changed. There are many reasons why you'd want to do this, from security (if a third party script changed such values it could cause problems) to debugging and code comprehension (it is harder to accidentally change values that shouldn't be changed and mess things up). In the early day...
...any programming languages have the concept of a constant -- a value that once declared can't be changed. There are many reasons why you'd want to do this, from security (if a third party script changed such values it could cause problems) to debugging and code comprehension (it is harder to accidentally change values that shouldn't be changed and mess things up). In the early days of JavaScript, constants didn't exist. In modern JavaScript, we have the keyword const, which lets us store values that can never be changed: const daysInWeek = 7; const hoursInDay = 24; const works in exactly the same way as let, except that you can't give a const a new value. In the following example, the second line would throw an error: const daysInWeek = 7; daysInWeek = 8; Test your skills! You've reached the e...
React interactivity: Editing, filtering, conditional rendering - Learn web development
">{props.name}</span> </button> <button type="button" className="btn btn__danger" onClick={() => props.deleteTask(props.id)} > Delete <span className="visually-hidden">{props.name}</span> </button> </div> </div> ); We've now got the two different template structures -- "edit" and "view" -- defined inside two separate constants. This means that the return statement of <Todo /> is now repetitious -- it also contains a definition of the "view" template. We can clean this up by using conditional rendering to determine which template the component returns, and is therefore rendered in the UI. Conditional rendering In JSX, we can use a condition to change what is rendered by the browser. To write a condition in JSX, we can...
...e All filter shows all tasks, so we return true for all tasks. The Active filter shows tasks whose completed prop is false. The Completed filter shows tasks whose completed prop is true. Beneath our previous addition, add the following -- here we are using the Object.keys() method to collect an array of FILTER_NAMES: const FILTER_NAMES = Object.keys(FILTER_MAP); Note: We are defining these constants outside our App() function because if they were defined inside it, they would be recalculated every time the <App /> component re-renders, and we don't want that. This information will never change no matter what our application does. Rendering the filters Now that we have the FILTER_NAMES array, we can use it to render all three of our filters. Inside the App() function we can create a consta...
AddonManager
d AddonCallback( in Addon addon ) Parameters addon The Addon passed back from the asynchronous request. If an error occurred (such as an add-on not being found), null is passed back instead. AddonListCallback() A callback that is passed an array of Addons void AddonListCallback( in Addon addons[] ) Parameters addons The array of Addons passed back from the asynchronous request Constants AddonInstall states Constant Description STATE_AVAILABLE An install that is waiting to be started. STATE_DOWNLOADING An install that is in the process of being downloaded. STATE_CHECKING An install that is checking for updated information. STATE_DOWNLOADED An install that has finished downloading and is ready to install. STATE...
...alling add-ons from the specified scopes. AddonType viewTypes Constant Description VIEW_TYPE_LIST The type should be displayed in a regular list view in the UI. AddonType flags Constant Description TYPE_UI_HIDE_EMPTY The type should be hidden from the UI if no add-ons of that type are currently installed. Startup change types These constants represent the lists of types of changes that can occur to add-ons during startup; they're used with the getStartupChanges(), addStartupChange(), and removeStartupChange() methods. Constant Description STARTUP_CHANGE_INSTALLED A list of add-ons that were detected as newly-installed during application startup. This doesn't include add-ons that were awaiting installation the...
CustomizableUI.jsm
e getter is NOT cheap, because it does smart things with non-removable non-default items, non-existent items, and so forth. Please don't call unless necessary. canUndoReset bool Whether the "Restore Defaults" operation can be reverted. This is only true after "Restore Defaults" has been performed and no other UI changes happen after the "Restore Defaults" operation. Area constants Attribute Type Description AREA_NAVBAR String "nav-bar", a constant reference to the ID of the navigation toolbar. AREA_TABSTRIP String "TabsToolbar", a constant reference to the ID of the tabstrip toolbar. AREA_MENUBAR String "toolbar-menubar", a constant reference to the ID of the menubar's toolbar. AREA_BOOKMARKS String ...
...f the add-on toolbar shim. Do not use, this will be removed as soon as reasonably possible. AREA_PANEL String "PanelUI-contents", a constant reference to the ID of the menu panel. TYPE_TOOLBAR String "toolbar", a constant indicating the area is a toolbar. TYPE_MENU_PANEL String "menu-panel", a constant indicating the area is a menu panel. Widget constants PROVIDER_XUL String "xul", a constant indicating an XUL-type provider. PROVIDER_API String "api", a constant indicating an API-type provider. PROVIDER_SPECIAL String "special", a constant indicating dynamic (special) widgets: spring, spacer, and separator. SOURCE_BUILTIN String "builtin", a constant indicating the widget is built-in. ...
PerfMeasurement.jsm
one CPU core to another. Event types measured constant The eventsMeasured constant provides a mask indicating which event types were recorded. Variable Type Description eventsMeasured EventMask A bit mask of the event types recorded; this can differ from the events requested if the platform doesn't support all of the event types you specified when creating the PerfMeasurement object. Constants Event mask constants These constants are used to construct the mask indicating which events you want to monitor. Constant Value Description CPU_CYCLES 0x00000001 Measure CPU cycles elapsed. INSTRUCTIONS 0x00000002 Measure the number of instructions executed. CACHE_REFERENCES 0x00000004 Measure the number of cache references. CACHE_MISSES 0x00000008 Measure the number of cache misses. ...
...tant tells you how many types of events can be measured. Constant Value Description NUM_MEASURABLE_EVENTS 11 The number of types of events that can be measured. Constructor Creates a new PerfMeasurement object, configured to record the specified event types. PerfMeasurement( EventMask toMeasure ); Parameters toMeasure A mask of all of the event types you want to record; see Event mask constants for a list of values. OR together all the event types you want to record, and pass that value here. Pass PerfMeasurement.ALL to record all event types. Return value A new PerfMeasurement object configured to record the specified event types. Methods canMeasureSomething() Indicates whether or not the platform on which your code is running supports this code module. static bool canMeasureSomething...
Hash Tables
This chapter describes the hash table functions in the plds (portable library -- data structures) library of NSPR. The hash table library functions are declared in the header file plhash.h. Warning: The NSPR hash table library functions are not thread safe. A hash table lookup may change the internal organization of the hash table (to speed up future lookups). ...
...s in the plds (portable library -- data structures) library of NSPR. The hash table library functions are declared in the header file plhash.h. Warning: The NSPR hash table library functions are not thread safe. A hash table lookup may change the internal organization of the hash table (to speed up future lookups). ...
Interval Timing
The type of such arguments is PRIntervalTime. ...
...The type of such arguments is PRIntervalTime. ...
Network Addresses
This chapter describes the NSPR types and functions used to manipulate network addresses. Network Address Types and Constants Network Address Functions The API described in this chapter recognizes the emergence of Internet Protocol Version 6 (IPv6). To facilitate the transition to IPv6, it is recommended that clients treat all structures containing network addresses as transparent objects and use the functions documented here to manipulate the information. If used consistently, this API also eliminates the need to deal with the byte ordering of network addresses. ...
...at all structures containing network addresses as transparent objects and use the functions documented here to manipulate the information. If used consistently, this API also eliminates the need to deal with the byte ordering of network addresses. Typically, the only numeric declarations required are the well-known port numbers that are part of the PRNetAddr structure. Network Address Types and Constants PRHostEnt PRProtoEnt PR_NETDB_BUF_SIZE Network address functions Initializing a network address PR_InitializeNetAddr facilitates the use of PRNetAddr, the basic network address structure, in a polymorphic manner. By using these functions with other network address functions, clients can support either version 4 or version 6 of the Internet Protocol transparently. All NSPR functions that...
Threads
These resources include a stack and the CPU registers (including PC). To an NSPR client, a thread is represented by a pointer to an opaque structure of type PRThread. ...
...finitive 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 overview of the NSPR threading model and sample code that illustrates its use, see Introduction to NSPR. For API reference information related to thread synchronization, see Locks and Condition Variables. Threading Types and Constants PRThread PRThreadType PRThreadScope PRThreadState PRThreadPriority PRThreadPrivateDTOR Threading Functions Most of the functions described here accept a pointer to the thread as an argument. NSPR does not check for the validity of the thread. It is the caller's responsibility to ensure that the thread is valid. The effects of these functions on invalid threads are undefined. Creatin...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. ...
... #include <prthread.h> #include <plgetopt.h> #include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* NSS headers */ #include <keyhi.h> #include <pk11priv.h> /* our samples utilities */ #include "util.h" /* Constants */ #define BLOCKSIZE 32 #define MODBLOCKSIZE 128 #define DEFAULT_KEY_BITS 1024 /* Header file Constants */ #define ENCKEY_HEADER "-----BEGIN WRAPPED ENCKEY-----" #define ENCKEY_TRAILER "-----END WRAPPED ENCKEY-----" #define MACKEY_HEADER "-----BEGIN WRAPPED MACKEY-----" #define MACKEY_TRAILER "-----END WRAPPED MACKEY-----" #define IV_HEADER "-----BEGIN IV-----" #define IV_TRAILER "-----END IV-----" #define MAC_HEADER "-----BEGIN...
64-bit Compatibility
etof(Object, data))); LIR_ld is 32-bit. On 64-bit machines you must use LIR_ldq. Luckily there is an alias that will choose the right opcode for you - LIR_ldp: struct Object { void *data; }; lir->insLoad(LIR_ldp, objIns, ins->insImm(offsetof(Object, data))); When you use LirWriter::insStore, the correct size is chosen for you automatically, based on the size of the input operands. To insert constants, use LirWriter::insImmPtr() for pointer types or LirWriter::insImmWord() for integral types. Note that LirWriter::insImm() is always 32-bit. Quad versus Float Internally, "quads" are 64-bit opaque values in Nanojit. They can be either floating point values or integral values. To help form well-typed LIR, there is a special opcode called LIR_float which specifies that the associated constant value...
...egral types. Note that LirWriter::insImm() is always 32-bit. Quad versus Float Internally, "quads" are 64-bit opaque values in Nanojit. They can be either floating point values or integral values. To help form well-typed LIR, there is a special opcode called LIR_float which specifies that the associated constant value is definitely floating-point. TraceMonkey uses this to decide whether arbitrary constants in LIR are pointers or doubles. You should never use LirWriter::insImmq() to inject a floating point value. Use LirWriter::insImmf() instead. Mucking with Native Integers in LIR The following opcodes can be used to safely load, modify, and compare native integers. For such opcodes there are two forms, an "undecorated" form which is 32-bit, and a form decorated with a "q" or "qi" that is 64-bit. T...
Bytecode Descriptions
Null Stack: => null Push null. False, True Stack: => true/false Push a boolean constant. Int32 Operands: (int32_t val) Stack: => val Push the int32_t immediate operand as an Int32Value. JSOp::Zero, JSOp::One, JSOp::Int8, JSOp::Uint16, and JSOp::Uint24 are all compact encodings for JSOp::Int32. Zero Stack: => 0 Push the number 0. One Stack: => 1 Push the number 1. Int8 Operands: (int8_t val) Stack: => val Push the int8_t immediate operand as an Int32Value. ...
...stack value. This appears after all cases for a non-optimized switch statement. If there's a default: label, it jumps to that point in the body; otherwise it jumps to the next statement. Format: JOF_JUMP TableSwitch Operands: (int32_t defaultOffset, int32_t low, int32_t high, uint24_t firstResumeIndex) Stack: i => Optimized switch-statement dispatch, used when all case labels are small integer constants. If low <= i <= high, jump to the instruction at the offset given by script->resumeOffsets()[firstResumeIndex + i - low], in bytes from the start of the current script's bytecode. Otherwise, jump to the instruction at defaultOffset from the current instruction. All of these offsets must be in range for the current script and must point to JSOp::JumpTarget instructions. The following inequalities ...
SpiderMonkey Internals
JS object system. All of the following happen here: creating objects by class and prototype, and finalizing objects; defining, looking up, getting, setting, and deleting properties; creating and destroying properties and binding names to them. The details of a native object's map (scope) are mostly hidden in jsscope.[ch]. jsatom.cpp, jsatom.h The atom manager. Contains well-known string constants, their atoms, the global atom hash table and related state, the js_Atomize() function that turns a counted string of bytes into an atom, and literal pool (JSAtomMap) methods. jsarena.cpp, jsarena.h Last-In-First-Out allocation macros that amortize malloc costs and allow for en-masse freeing. See the paper mentioned in jsarena.h's major comment. jsgc.cpp, jsgc.h The garbage collector and traci...
... would be too expensive to test unconditionally at run-time. Certain assertions are followed by run-time tests that cope with assertion failure, but only where I'm too smart or paranoid to believe the assertion will never fail... jsclist.h Doubly-linked circular list struct and macros. jscpucfg.cpp This standalone program generates jscpucfg.h, a header file containing bytes per word and other constants that depend on CPU architecture and C compiler type model. It tries to discover most of these constants by running its own experiments on the build host, so if you are cross-compiling, beware. jsdtoa.cpp, jsdtoa.h, dtoa.c dtoa.c contains David Gay's portable double-precision floating point to string conversion code, with Permission To Use notice included. jsdtoa.cpp #includes this file. jshash...
JS::Value
lue was historically known in the JSAPI as jsval. SpiderMonkey 1.8.5 made jsval into a C struct and exposed it in C++ through the full-fledged JS::Value class. As of SpiderMonkey 17, jsval is a typedef of JS::Value, and SpiderMonkey is gradually transitioning to a new C++ JSAPI, at whose heart lies JS::Value. jsval is deprecated; new code should use JS::Value. ...
...y is gradually transitioning to a new C++ JSAPI, at whose heart lies JS::Value. jsval is deprecated; new code should use JS::Value. The old JSVAL_IS_* methods, JSVAL_* constants and *_TO_JSVAL methods, and JSVAL_TO_* methods are also deprecated; uses of each should be replaced with use of the corresponding val.is*(), *Value(), and val.to*() methods. ...
JSAPI reference
y 24 JS::FalseValue Added in SpiderMonkey 24 JS::NumberValue Added in SpiderMonkey 24 JS::Int32Value Added in SpiderMonkey 24 JS::DoubleValue Added in SpiderMonkey 24 JS::Float32Value Added in SpiderMonkey 24 JS::StringValue Added in SpiderMonkey 24 JS::ObjectValue Added in SpiderMonkey 24 JS::ObjectOrNullValue Added in SpiderMonkey 24 JS::SymbolValue Added in SpiderMonkey 38 JS::Value constants: JS::NullHandleValue Added in SpiderMonkey 24 JS::UndefinedHandleValue Added in SpiderMonkey 24 JS::TrueHandleValue Added in SpiderMonkey 38 JS::FalseHandleValue Added in SpiderMonkey 38 jsval constants: JSVAL_NULL Obsolete since JSAPI 42 JSVAL_VOID Obsolete since JSAPI 42 JSVAL_TRUE Obsolete since JSAPI 42 JSVAL_FALSE Obsolete since JSAPI 42 JSVAL_ZERO Obsolete since JSAPI 42 JSV...
...SpiderMonkey 38 JS_IndexToId Added in SpiderMonkey 17 JS_CharsToId Added in SpiderMonkey 24 JS::ProtoKeyToId Added in SpiderMonkey 38 JS_IsIdentifier Added in SpiderMonkey 17 struct JSIdArray class JS::AutoIdArray Added in SpiderMonkey 17 JS_IdArrayLength Added in SpiderMonkey 17 JS_IdArrayGet Added in SpiderMonkey 17 JS_DestroyIdArray JS_GetObjectId Obsolete since JSAPI 31 jsid constants: JSID_VOID JSID_VOIDHANDLE Added in SpiderMonkey 31 JSID_EMPTY JSID_EMPTYHANDLE Added in SpiderMonkey 31 Function for checking and converting the type of a jsid: JSID_IS_ZERO JSID_IS_VOID JSID_IS_EMPTY JSID_IS_STRING JSID_TO_STRING INTERNED_STRING_TO_JSID Added in SpiderMonkey 38 JSID_TO_FLAT_STRING Added in SpiderMonkey 17 JSID_IS_INT JSID_TO_INT INT_FITS_IN_JSID INT_TO_JSID...
Places utilities for JavaScript
d by a lot of the bookmarking, tagging, and annotation services that are built into Firefox. By default its only included in browser.xul. Its not an interface, and as such it will never be frozen, but it provides some easy to use functions that can save you from reinventing the wheel and cluttering up your own classes/functions when you need it. Global Objects There are a few global objects and constants defined in utils.js. These are: QI_node QI_node(aNode, aIID) Runs a query interface on a bookmark node to expose the interface available to that type. If the interface isn't available to that node, null is returned. aNode - The bookmark aIID - The return interface wanted. There are several predefined versions of this for common calls. These just take in the node, as the interface is alrea...
...For instance, normally in order to get access to the bookmar...
Creating the Component Code
e three interface implementations - for the component functionality, nsIModule interface, and for the nsIFactory interface - are the basic pieces of code you need to write to create an XPCOM component. Basic Structure of the WebLock Component Source weblock1.cpp that defines these classes and the code you need to create a basic component has the following structure: * required includes and constants * WebLock: public iWebLock * WebLockFactory: public nsIFactory * WebLockModule: public nsIModule In XPCOM, all of these classes also derive from the nsISupports base interface. Digging In: Required Includes and Constants Let's take a look at the first several lines of code in the component and discuss what they mean in XPCOM. The includes and definitions at the top of an XPCOM sourc...
...ble that shields you from certain private, non-XPCOM headers. For example, including nsIComponentManager.idl without MOZILLA_STRICT_API defined will include the following headers, which are not supported across versions (unfrozen): nsComponentManagerUtils.h nsComponentManagerObsolete.h These variables are picked up by files that do not specify themselves as MOZILLA_STRICT_API. Includes and Constants in weblock1.cpp #include <stdio.h> // may be defined at the project level // in the makefile #define MOZILLA_STRICT_API #include "nsIModule.h" #include "nsIFactory.h" #include "nsIComponentManager.h" #include "nsIComponentRegistrar.h" // use classes to handle IIDs // classes provide methods for comparison: Equals, etc. static const nsIID kIModuleIID = NS_IMODULE_IID; static const nsIID kIF...
inIDOMUtils
Value State 1 :active 2 :focus 4 :hover 8 :-moz-drag-over 16 :target 1<<29 :-moz-focusring Methods getBindi...
... one of the 6 supported content state flags specified in Content state flags. getCSSPropertyNames() Get a list of all our supported property names void getCSSPropertyNames( in unsigned long aFlags, Optional out unsigned long aCount, Optional [retval, array, size_is(aCount)] out wstring aProps ); Parameters aFlags Optional Shorthands can be excluded or property aliases included. See constants. aCount Optional Count aProps Properties getCSSStyleRules() Returns an array of the CSS style rules on the specified element. nsISupportsArray getCSSStyleRules( in nsIDOMElement aElement, in DOMString aPseudo Optional ); Parameters aElement A DOM element to retrieve the style rules of. aPseudo Optional A pseudo element, such as before. Return value An nsISupportsArray cont...
mozIPlacesAutoComplete
1.0 66 Introduced Gecko 1.9.2 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void registerOpenPage(in nsIURI aURI); void unregisterOpenPage(in nsIURI aURI); Constants Constant Value Description MATCH_ANYWHERE 0 Match anywhere in each searchable term. ...
...ides some constants used by the Places AutoComplete search provider as well as methods to track opened pages for AutoComplete purposes. 1.0 66 Introduced Gecko 1.9.2 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void registerOpenPage(in nsIURI aURI); void unregisterOpenPage(in nsIURI aURI); Constants Constant Value Description MATCH_ANYWHERE 0 Match anywhere in each searchable term. MATCH_BOUNDARY_ANYWHERE 1 Match first on word boundaries, and if we do not get enough results, then match anywhere in each searchable term. MATCH_BOUNDARY 2 Match on word boundaries in each searchable term. MATCH_BEGINNING 3 Match only the beginning of each search term. BEHAVIOR_HISTORY 1 << 0 Search ...
mozIStorageConnection
tements or if you are using the connection on multiple threads. schemaVersion long The schema version of the database. This should not be used until the database is ready. The version will be reported as 0 if it is not set. transactionInProgress boolean Returns true if there is a transaction in progress on the database. Otherwise returns false. Read only. Constants Transaction execution time constants. Constant Value Description TRANSACTION_DEFERRED 0 No database lock is obtained until the first statement is run. TRANSACTION_IMMEDIATE 1 A reserved lock is obtained on the database. TRANSACTION_EXCLUSIVE 2 An exclusive lock is obtained on the database. SQLite database page size constant ...
...g mozIStorageConnection.executeAsync(). This method will manage the transactions for you, so you don't have to worry about them. Note: The database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception. void beginTransactionAs( in PRInt32 transactionType ); Parameters transactionType One of the transaction constants (mozIStorageConnection.TRANSACTION_DEFERRED, mozIStorageConnection.TRANSACTION_IMMEDIATE, mozIStorageConnection.TRANSACTION_EXCLUSIVE) clone() Clones a database connection, optionally making the new connection read only. Note: If your connection is already read-only, you will get a read-only clone. Note: Due to a bug in SQLite, if you use the shared cache (by calling mozIStorageService.openD...
mozIStorageStatementCallback
public/mozIStorageStatementCallback.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Inherits from: nsISupports Method overview void handleCompletion(in unsigned short aReason); void handleError(in mozIStorageError aError); void handleResult(in mozIStorageResultSet aResultSet); Constants Constant Value Description REASON_FINISHED 0 The statement has finished executing normally. REASON_CANCELED 1 The statement stopped executing because it was canceled. REASON_ERROR 2 The statement stopped executing because an error occurred. Methods handleCompletion() Called when a statement finishes executing. void handleCompletio...
... 1 The statement stopped executing because it was canceled. REASON_ERROR 2 The statement stopped executing because an error occurred. Methods handleCompletion() Called when a statement finishes executing. void handleCompletion( in unsigned short aReason ); Parameters aReason The reason the statement stopped executing; see the list of possible values in the Constants section. handleError() Called when an error occurs while executing a statement. This function may be called more than once with a different storageIError each time for any given asynchronous statement, and handleCompletion will be called once the statement is complete. void handleError( in mozIStorageError aError ); Parameters aError A mozIStorageError object describing the error ...
mozIStorageValueArray
ng(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 unsigned long The number of entries in the array. Constants Constant Value Description VALUE_TYPE_NULL 0 Null data type. VALUE_TYPE_INTEGER 1 INTEGER data type. VALUE_TYPE_FLOAT 2 FLOAT data type. VALUE_TYPE_TEXT 3 TEXT data type. VALUE_TYPE_BLOB 4 BLOB data type. Methods getTypeOfIndex() Returns the type of the value at the given column index. long getTy...
...PE_FLOAT 2 FLOAT data type. VALUE_TYPE_TEXT 3 TEXT data type. VALUE_TYPE_BLOB 4 BLOB data type. Methods getTypeOfIndex() Returns the type of the value at the given column index. long getTypeOfIndex( in unsigned long aIndex ); Parameters aIndex The zero-based numerical index for the column to get the data from. Return value One of the constants mozIStorageValueArray.VALUE_TYPE_NULL, mozIStorageValueArray.VALUE_TYPE_INTEGER, mozIStorageValueArray.VALUE_TYPE_FLOAT, mozIStorageValueArray.VALUE_TYPE_TEXT, or mozIStorageValueArray.VALUE_TYPE_BLOB describing the type aIndex is. getInt32() Obtains a Int32 from the specified index. long getInt32( in unsigned long aIndex ); Parameters aIndex The zero-based numerical index for the c...
nsIAccessNode
ame, for example "border-bottom". Return value The computed style value. Exceptions thrown NS_ERROR_FAILURE Indicates that the access node is unattached from the accessible tree. scrollTo() Makes an object visible on screen. void scrollTo( in unsigned long aScrollType ); Parameters aScrollType Defines where the object should be placed on the screen (see nsIAccessibleScrollType.Constants for available constants). Exceptions thrown NS_ERROR_FAILURE Indicates that the access node is unattached from the accessible tree. scrollToPoint() Moves the top left of an object to a specified location. void scrollToPoint( in unsigned long aCoordinateType, in long aX, in long aY ); Parameters aCoordinateType Specifies whether the coordinates are relative to the screen or t...
...eptions thrown NS_ERROR_FAILURE Indicates that the access node is unattached from the accessible tree. scrollToPoint() Moves the top left of an object to a specified location. void scrollToPoint( in unsigned long aCoordinateType, in long aX, in long aY ); Parameters aCoordinateType Specifies whether the coordinates are relative to the screen or the parent object (for available constants refer to nsIAccessibleCoordinateType.Constants. aX Defines the x coordinate. aY Defines the y coordinate. Exceptions thrown NS_ERROR_FAILURE Indicates that the access node is unattached from the accessible tree. Remarks The main application of access node tree is it's used by ISimpleDOM* interfaces on Windows. ...
GetState
Exceptions thrown NS_ERROR_FAILURE Indicates that the accessible is unattached from the accessible tree. ...
...Exceptions thrown NS_ERROR_FAILURE Indicates that the accessible is unattached from the accessible tree. ...
nsIAppShellService
application hidden window, automatically created and maintained by this AppShellService. Read only. hiddenWindow nsIXULWindow Return the (singleton) application hidden window, automatically created and maintained by this AppShellService. Read only. nativeAppSupport nsINativeAppSupport Getter for "native application support." Read only. Obsolete since Gecko 1.8 Constants Constant Value Description SIZE_TO_CONTENT -1 Create a window, which will be initially invisible. eConsiderQuit 1 Attempt to quit if all windows are closed. Obsolete since Gecko 1.8 eAttemptQuit 2 Try to close all windows, then quit if successful. Obsolete since Gecko 1.8 eForceQuit 3 Force all windows to close, then quit...
...portOrSplashScreen Is an object that can be QueryInterface'd to either an nsINativeAppSupport or nsISplashScreen; this object will be used to implement HideSplashScreen. quit() Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Exit the event loop, shut down the app. void quit( in PRUint32 aFerocity ); Parameters aFerocity One of the e* constants. createWindowlessBrowser() This method creates a browser that does not have a window. If the browser is exited, this windowless browser will not prevent Firefox from exiting. E10s notes: The browser is created in process. To get an out of process element you want to communicate with via message manager, then append a browser element with remote attribute set to true. Follow this bug - Bugzil...
nsIAppStartup
interrupted boolean true if the startup process was interrupted by an interactive prompt. This can be used, for example, when doing performance testing of the startup process to discount numbers for tests that were interrupted by a user prompt. nativeAppSupport nsINativeAppSupport Getter for "native application support." Read only. Obsolete since Gecko 1.9.1 Constants The following flags may be passed as the aMode parameter to the quit() method. One and only one of the "Quit" flags must be specified. The eRestart flag may be bit-wise combined with one of the "Quit" flags to cause the application to restart after it quits. Constant Value Description eConsiderQuit 0x01 Attempt to quit if all windows are closed. eAttemptQu...
...n ); Parameters nativeAppSupportOrSplashScreen Is an object that can be QI'd to either an nsINativeAppSupport or nsISplashScreen; this object will be used to implement HideSplashScreen. quit() Exit the event loop, and shut down the application. void quit( in PRUint32 aMode ); Parameters aMode This parameter modifies how the application is shutdown, and it is constructed from the constants defined above. restartInSafeMode() Restart the application in safe mode. void quit( in PRUint32 aQuitMode ); Parameters aQuitMode This parameter modifies how the app is shutdown. run() Runs an application event loop: normally the main event pump which defines the lifetime of the application. If there are no windows open and no outstanding calls to enterLastWindowClosingSurvivalArea...
nsIAuthInformation
uch as "basic" or "digest". This string will always be in lowercase. Read only. domain AString The initial value should be used to prefill the dialog or be shown in some other way to the user. On return, this parameter should contain the domain entered by the user. This attribute is only used if flags include #NEED_DOMAIN. flags unsigned long Flags describing this dialog. A bitwise OR of the constants. It is possible that neither #AUTH_HOST nor #AUTH_PROXY are set. Auth prompts should ignore flags they do not understand; especially, they should not throw an exception because of an unsupported flag. Read only. password AString The initial value should be used to prefill the dialog or be shown in some other way to the user. The password should not be shown in clear. On return, this parameter s...
...e the empty string if the protocol does not support realms. Otherwise, this is a human-readable string like "Secret files". Read only. username AString The initial value should be used to prefill the dialog or be shown in some other way to the user. On return, this parameter should contain the username entered by the user. This field can only be changed if the #ONLY_PASSWORD flag is not set. Constants Constant Value Description AUTH_HOST 1 This dialog belongs to a network host. AUTH_PROXY 2 This dialog belongs to a proxy. NEED_DOMAIN 4 This dialog needs domain information. The user interface should show a domain field, prefilled with the domain attributes value. ONLY_PASSWORD 8 This dialog only asks for password information. Authentication prompts SHOULD NOT show a username field. ...
nsIAuthModule
REQ_MUTUAL_AUTH (1 << 0) Client and server will be authenticated. REQ_DELEGATE (1 << 1) The server is allowed to impersonate the client. The REQ_MUTUAL_AUTH flag may also need to be specified in order for this flag to take effect. Methods getNextToken() This method is called to get the next token in a sequence of authenticatio...
...e an auth module. The other methods cannot be called unless this method succeeds. void init( in string aServiceName, in unsigned long aServiceFlags, in wstring aDomain, in wstring aUsername, in wstring aPassword ); Parameters aServiceName The service name, which may be null if not applicable (For example, for NTLM, this parameter should be null). aServiceFlags A bitwise-or of the REQ_ constants (pass REQ_DEFAULT for default behavior). aDomain The authentication domain, which may be null if not applicable. aUsername The user's login name. aPassword The user's password. unwrap() This method is used to unpack, decrypt, and verify the checksums on data returned by a server when security layers are in use. void unwrap( [const] in voidPtr aInToken, in unsigned long aInTokenLength, out ...
nsICommandLine
e command line. The application name is not part of the command line. Read only. preventDefault boolean There may be a command-line handler which performs a default action if there was no explicit action on the command line (open a default browser window, for example). This flag allows the default action to be prevented. state unsigned long The type of command line being processed. See State constants. Read only. windowContext nsIDOMWindow A window to be targeted by this command line. In most cases, this will be null (xremote will sometimes set this attribute). Read only. workingDirectory nsIFile The working directory for this command line. Use this property instead of the working directory for the current process, since a redirected command line may have had a different working directory...
...windowContext nsIDOMWindow A window to be targeted by this command line. In most cases, this will be null (xremote will sometimes set this attribute). Read only. workingDirectory nsIFile The working directory for this command line. Use this property instead of the working directory for the current process, since a redirected command line may have had a different working directory. Read only. Constants State constants Constant Value Description STATE_INITIAL_LAUNCH 0 The first launch of the application instance. STATE_REMOTE_AUTO 1 A remote command line automatically redirected to this instance. STATE_REMOTE_EXPLICIT 2 A remote command line explicitly redirected to this instance using xremote/windde/appleevents. Methods findFlag() Finds a command-line flag, returning its position on...
nsICompositionStringSynthesizer
This means that the clause is not converted. I.e., raw text of user input. ATTR_SELECTEDRAWTEXT 0x03 A clause attribute but this is typically not used. This means that the clause is not converted but selected to convert or modify. ATTR_CONVERTEDTEXT 0x04 A clause att...
...nvert. Methods appendClause() Appends a clause to the composition string which is set by setString(). Sum of aLength must be same as the length of aString of setString(). void appendClause(in unsigned long aLength, in unsigned long aAttribute); Parameters aLength The length of appending clause. aAttribute The attribute of appending clause. Must be one of ATTR_* constants. dispatchEvent() Dispatches DOM events for setting the composition string which are specified by setString(), appendClause() and setCaret() to the focused editor. If appendClause() hasn't been called, this dispatches events to set composition string without clause information. In other words, commits composition string. If appendClause() and/or setCaret() are not called properly, e.g., sum o...
nsIDOMUserDataHandler
dom/interfaces/core/nsIDOMUserDataHandler.idlScriptable The callback function for the setUserData method. 1.0 66 Introduced Gecko 1.5 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Method overview 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. NODE_IMPORTED 2 The node was cloned into a new document. NODE_DELETED 3 Unimplemented NODE_RENAMED 4 Unimplemented NODE_ADOPTED 5 The node was adopted into a new document. Methods handle() This method is a callback which will be called if a node with user data is being cloned, imported or adopted. void handle( in unsigned short operation...
...RENAMED 4 Unimplemented NODE_ADOPTED 5 The node was adopted into a new document. Methods handle() This method is a callback which will be called if a node with user data is being cloned, imported or adopted. void handle( in unsigned short operation, in DOMString key, in nsIVariant data, in nsIDOMNode src, in nsIDOMNode dst ); Parameters operation One of the NODE_* operation type constants from the above table. key The key that was used to set the user data. data The data that was set on the original node. src The original node. dst The new node, for clone and import operations. ...
nsIDOMXPathResult
BOOLEAN_TYPE, the boolean value. Read only. invalidIteratorState boolean true if the iterator state has become invalid. For example, modifying a node invalidates the iterator. Read only. numberValue double If resultType is NUMBER_TYPE, the numeric value of the XPath value. Read only. resultType unsigned short The type of result; can be any of the Type constants except ANY_TYPE. Read only. singleNodeValue nsIDOMNode If resultType is ANY_UNORDERED_NODE_TYPE or FIRST_ORDERED_NODE_TYPE, a single DOM Node. Read only. snapshotLength unsigned long If resultType is UNORDERED_NODE_SNAPSHOT_TYPE or ORDERED_NODE_SNAPSHOT_TYPE, the length of the snapshort array. Read only. stringValue DOMString If resultType is STRING_TY...
...ngleNodeValue nsIDOMNode If resultType is ANY_UNORDERED_NODE_TYPE or FIRST_ORDERED_NODE_TYPE, a single DOM Node. Read only. snapshotLength unsigned long If resultType is UNORDERED_NODE_SNAPSHOT_TYPE or ORDERED_NODE_SNAPSHOT_TYPE, the length of the snapshort array. Read only. stringValue DOMString If resultType is STRING_TYPE, the boolean value. Read only. Constants Type constants Constant Value Description ANY_TYPE 0 Used when evaluating an XPath expression; the evaluator will return the most appropriate type. NUMBER_TYPE 1 Type is a single number. STRING_TYPE 2 Type is a single string. BOOLEAN_TYPE 3 Type is a single boolean value. UNORDERED_NODE_ITERATOR_TYPE 4 Type ...
nsIDeviceMotionData
1.0 66 Introduced Gecko 1.9.2 Inherits from: nsISupports Last changed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3) Note: This interface was named nsIDeviceMotionData prior to Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3). ...
...this object; see Motion type constants for possible values. Read only. x double The amount of tilt along the X axis. Read only. y double The amount of tilt along the Y axis. Read only. z double The amount of tilt along the Z axis. Read only. The values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. See Accelerometer values explained for details. Constants Motion type constants Constant Value Description TYPE_ACCELERATION 0 The motion data describes device acceleration. TYPE_ORIENTATION 1 The motion data describes a device orientation chang. See also MozOrientation nsIDOMOrientationEvent nsIDeviceMotionListener nsIDeviceMotion ...
nsIDownloadManagerUI
upports Last changed in Gecko 1.9 (Firefox 3) Method overview void getAttention(); void show([optional] in nsIInterfaceRequestor aWindowContext, [optional] in unsigned long aID, [optional] in short aReason); Attributes Attribute Type Description visible boolean true if the Download Manager UI is visible; otherwise false. Read only. Constants Constant Value Description REASON_USER_INTERACTED 0 When opening the Download Manager user interface, this value indicates that it's being done at the user's request. REASON_NEW_DOWNLOAD 1 When opening the Download Manager user interface, this value indicates that the user interface is being displayed because a new download is being started. Me...
... See also The Download Manager schema ...
nsIFileOutputStream
netwerk/base/public/nsIFileStreams.idlScriptable This interface is an output stream that lets you stream to a file. Inherits from: nsIOutputStream Last changed in Gecko 1.7 Method overview void init(in nsIFile file, in long ioFlags, in long perm, in long behaviorFlags); Constants Behavior flag constants Constant Value Description DEFER_OPEN 1<<0 See the same constant in nsIFileInputStream. The deferred open will be performed when one of the following is called: Seek() Tell() Write() Flush() DEFER_OPEN is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. ...
... See also nsIFileInputStream ...
nsIFileView
cription reverseSort boolean If true results will be sorted in ascending order. Read only. selectedFiles nsIArray An nsIArray of selected files, which contains nsIArray instances. Read only. showHiddenFiles boolean If true hidden files will be shown. showOnlyDirectories boolean If true only directory entries will be returned. sortType short The current sort type in effect. Read only. Constants Constant Value Description sortName 0 Sort by file name. sortSize 1 Sort by file size. sortDate 2 Sort by the date of the last modification. Methods setDirectory() Set the directory to be browsed. void setDirectory( in nsIFile directory ); Parameters directory The directory to be browsed. setFilter() Set the filter to be applied to the file list, for example "*.jpg" would only re...
...rectory The directory to be browsed. setFilter() Set the filter to be applied to the file list, for example "*.jpg" would only return jpg files. void setFilter( in AString filterString ); Parameters filterString The filter to be applied to the file list. sort() Set the method used for sorting. void sort( in short sortType, in boolean reverseSort ); Parameters sortType One of the sort* constants. reverseSort true, results will be sorted in ascending order. Example <?xml version="1.0" ?> <?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> <window id="test" title="Test" width="640" height="480" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree flex="1" id="ftree"> <treecols> <-- The default Column type is size unless...
nsIHttpActivityObserver
btype, in PRTime aTimestamp, in PRUint64 aExtraSizeData, in ACString aExtraStringData); Attributes Attribute Type Description isActive boolean true when the interface is active and should observe HTTP activity, otherwise false. If this is false, the observeActivity() method should not be called. Read only. Note: This attribute is present only for compatibility and should not be used. Constants Activity type constants Constant Value Description ACTIVITY_TYPE_SOCKET_TRANSPORT 0x0001 Socket transport activity has occurred. ACTIVITY_TYPE_HTTP_TRANSACTION 0x0002 HTTP transport activity has occurred. Activity subtype constants Constant Value Description ACTIVITY_SUBTYPE_REQUEST_HEADER 0x5001 The HTTP request is about to be queued for sending. Observers can look at request hea...
...vity occurs. void observeActivity( in nsISupports aHttpChannel, in PRUint32 aActivityType, in PRUint32 aActivitySubtype, in PRTime aTimestamp, in PRUint64 aExtraSizeData, in ACString aExtraStringData ); Parameters aHttpChannel The nsIHttpChannel on which the activity occurred. aActivityType The type of activity that occurred; this will be one of the values specified in Activity type constants. aActivitySubtype The subtype that further narrows the type of activity that occurred. If the activity type is ACTIVITY_TYPE_SOCKET_TRANSPORT, this value will be one of the STATUS_* constants defined by nsISocketTransport. If the activity type is ACTIVITY_TYPE_HTTP_TRANSACTION, this will be one of the constants specified in Activity subtype constants above. aTimestamp The time at which the activi...
nsIINIParserWriter
e INI file is generated, so you can add properties to the file in any order, regardless of section. When you're done and ready to write the INI file to disk, call the writeFile() method. Method overview 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 behavior. Constant Value Description WRITE_UTF16 0x1 Windows and the NSIS installer code sometimes expect INI files to be in UTF-16 encoding. On Windows only, this flag to writeFile() can be used to change the encoding from its default UTF-8. Methods setS...
...lue to assign to the property. writeFile() Write to the INI file. void writeFile( in nsIFile aINIFile, Optional in unsigned long aFlags Optional ); Parameters aINIFile Optional If specified, this nsIFile based object is used as the output file instead of the one specified at initialization time (if any). aFlags Optional Flags controlling the file write operation. See File writing constants for details on the permitted values. See also INI file nsIINIParser nsIINIParserFactory ...
nsIMessenger
scription transactionManager nsITransactionManager Readonly: The transaction manager for this nsIMessenger instance. sendingUnsentMsgs boolean Indicates if sending messages is in progress. lastDisplayedMessageUri ACString Readonly: The URL of the last displayed message. navigatePos long The current index in the navigation history. Constants Name Value Description eUnknown 0 Unknown transaction type. eDeleteMsg 1 Delete transaction type. eMoveMsg 2 Move transaction type. eCopyMsg 3 Copy transaction type. Methods setDisplayCharset() Sets the character set for the displayed message. void setDisplayCharset(in ACString aCharset); Parameters aChars...
... Boolean representing whether undo is available. canRedo() Queries if there are any redo items in the transaction manager. boolean canRedo(); Return value Boolean representing whether redo is available. getUndoTransactionType() Gets the type of the next undo transaction. unsigned long getUndoTransactionType(); Return value A long representing the type of the transaction. See #Constants for available types. getRedoTransactionType() Gets the type of the next redo transaction. Available types are defined as constants in nsIMessenger. unsigned long getRedoTransactionType(); Return value A long representing the type of the transaction. See #Constants for available types. undo() Performs the next undo transaction. void undo(in nsIMsgWindow msgWindow); Parameters m...
nsINavBookmarksService
tagsFolder long long The item ID of the top-level folder that contains the tag "folders". Read only. Note: Renamed from tagRoot in Gecko 1.9 toolbarFolder long long The item ID of the personal toolbar folder. Read only. Note: Renamed from toolbarRoot in Gecko 1.9 unfiledBookmarksFolder long long The item ID of the Unfiled Bookmarks folder. Read only. Constants Constant Value Description DEFAULT_INDEX -1 This is the default index; this value should be used for APIs that allow passing in an index where the index is not known or is not required to be specified, such as when appending an item to a folder. TYPE_BOOKMARK 1 This is an index for type "Bookmark". TYPE_FOLDER 2 This is an index for t...
...emTitle( in nsIURI uri, Obsolete since Gecko 1.9 in long long aItemId ); Parameters uri Obsolete since Gecko 1.9 The URI of the item whose title should be retrieved. aItemId The ID of the item whose title should be retrieved. Return value Returns the title of the item. getItemType() This method retrieves an item's type (bookmark, separator, folder). The type is one of the TYPE_* constants defined above. unsigned short getItemType( in long long aItemId ); Parameters aItemId The ID of the item whose type is to be retrieved. Return value Returns one of the above defined TYPE_* for the given item. getKeywordForBookmark() Obsolete since Gecko 40.0 (Firefox 40.0 / Thunderbird 40.0 / SeaMonkey 2.37)This feature is obsolete. Although it may still work in some browsers, its...
nsINavHistoryObserver
Methods onBeforeDeleteURI() Obsolete since Gecko 21.0 (Firefox 21.0 / Thunderbird 21.0 / SeaMonkey 2.18) Note: This method was removed in Gecko 21.0 as part of Bug 826409. The specified page and all its visits are about to be deleted. Note: The page does no...
...arameters aURI The URI of the page being visited. aVisitID ID of the visit that was just created. aTime Time of the visit. aSessionID The ID of one connected sequence of visits. aReferringID The ID of the visit the user came from. 0 if empty. aTransitionType The type of the item that is about to be removed; this is one of the nsINavBookmarksService.Constants defined in the nsINavBookmarksService interface. aGUID The unique ID associated with the page. aAdded Incremented by query nodes when the visited uri belongs to them. If no such query exists, the history result creates a new query node dynamically. It is used in places views only and can be ignored. Using onBeforeDeleteURI() in Gecko 1.9.1 If you wish to support onBeforeDeleteUR...
nsIParentalControlsService
ions include the blocking of all file downloads. Read only. loggingEnabled boolean true if the current user account has parental controls logging enabled. If this is true, applications should log relevant events using log() method. Read only. parentalControlsEnabled boolean true if the current user account has parental controls restrictions enabled. Read only. Constants Constant Value Description ePCLog_URIVisit 1 This log entry type represents an access to web content. ePCLog_FileDownload 2 This log entry type represents a file download. Methods log() Logs an application specific parental controls event. void log( in short aEntryType, in boolean aFlag, in nsIURI aSource, in nsIFile aTarget Optional...
...it 1 This log entry type represents an access to web content. ePCLog_FileDownload 2 This log entry type represents a file download. Methods log() Logs an application specific parental controls event. void log( in short aEntryType, in boolean aFlag, in nsIURI aSource, in nsIFile aTarget Optional ); Parameters aEntryType The type of event to log. See the constants for allowed values. aFlag Pass true if the event was blocked or false if it was allowed. aSource The URI source of the subject content. aTarget Optional The location to which the content was saved if it was not blocked. requestURIOverride() Requests that a blocked URI be allowed through parental control filters. This method may block while the operating system presents user interface to...
nsIPermission
lic/nsIPermission.idlScriptable Please add a summary to this article. Last changed in Gecko 2 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Inherits from: nsISupports Attributes Attribute Type Description capability PRUint32 The permission to set: allow, deny, or unknown (which is the default). ...
...own (which is the default). See nsIPermissionManager.Permission_type_constants for allowed values. Read only. expireTime PRInt64 The expiration time of the permission measured in milliseconds since 1970 Jan 1 0:00:00. Read only. expireType PRUint32 The expiration type of the permission: on session termination, on a specified time, or never. Constants are defined in nsIPermissionManager.Permission_expiration_constants. Read only. host AUTF8String The host, that is URI, on which the permission is applied. Read only. type ACString The type of permission: cookie, image, and so on. This is a case-sensitive string. This string is specified by the consumer when adding a permission via nsIPermi...
nsIProfile
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. profileCount long The number of profiles. Read only. Constants Profile shutdown types Constant Value Description SHUTDOWN_PERSIST 0x00000001 When shutting down the profile, save all changes. SHUTDOWN_CLEANSE 0x00000002 When shutting down the profile, discard changes. Unimplemented Methods cloneProfile() Clones the current profile, creating a copy of it with a new name. void cloneProfile( in wstring profile...
...newName The new name to assign to the profile. Exceptions thrown NS_ERROR_FAILURE A profile already exists with the name newName. shutDownCurrentProfile() Shuts down the current profile; this essentially "logs out" the current profile. void shutDownCurrentProfile( in unsigned long shutDownType ); Parameters shutDownType The type of shutdown to perform; see Shutdown type constants. See also nsIToolkitProfileService ...
nsIPrompt
Example usage is also documented: Using the button Flags See Also nsIPromptService ...
...Example usage is also documented: Using the button Flags See Also nsIPromptService ...
nsIRadioInterfaceLayer
in DOMString pdptype); void startTone(in DOMString dtmfChar); void stopTone(); void unregisterCallback(in nsIRILTelephonyCallback callback); void unregisterDataCallCallback(in nsIRILDataCallback callback); Attributes Attribute Type Description currentState jsval Read only. Obsolete since Gecko 13.0 microphoneMuted bool radioState jsval Read only. ...
...); void startTone(in DOMString dtmfChar); void stopTone(); void unregisterCallback(in nsIRILTelephonyCallback callback); void unregisterDataCallCallback(in nsIRILDataCallback callback); Attributes Attribute Type Description currentState jsval Read only. Obsolete since Gecko 13.0 microphoneMuted bool radioState jsval Read only. ...
nsISeekableStream
xpcom/io/nsISeekableStream.idlScriptable Provides seeking support in data streams. Inherits from: nsISupports Last changed in Gecko 1.7 Method overview 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. NS_SEEK_CUR 1 Specifies that the offset is relative to the current position in the stream. NS_SEEK_END 2 Specifies that the offset is relative to the end of the stream. Methods seek() This method moves the stream offset of the stream implementing this interface. void seek( in long whence, in long long offset ); Parameters whence ...
... 2 Specifies that the offset is relative to the end of the stream. Methods seek() This method moves the stream offset of the stream implementing this interface. void seek( in long whence, in long long offset ); Parameters whence Specifies how to interpret the 'offset' parameter in setting the stream offset associated with the implementing stream, according to the table of constants above. offset Specifies a value, in bytes, that is used in conjunction with the 'whence' parameter to set the stream offset of the implementing stream. A negative value causes seeking in the reverse direction. Exceptions thrown NS_BASE_STREAM_CLOSED If called on a closed stream. setEOF() This method truncates the stream at the current offset. void setEOF(); Parameters None. Ex...
nsISelection2
Read only. Methods GetRangesForInterval() Return array of ranges intersecting with the given DOM interval. 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 ); Parameters beginNode ...
...verlapping it. results Returns the ranges that overlap (or touch) the input range. scrollIntoView() Scrolls a region of the selection, so that it is visible in the scrolled view. void scrollIntoView( in short aRegion, in boolean aIsSynchronous, in short aVPercent, in short aHPercent ); Parameters aRegion The region inside the selection to scroll into view (see selection region constants defined in nsISelectionController). aIsSynchronous When true, scrolls the selection into view before returning. If false, posts a request which is processed at some point after the method returns. aVPercent How to align the frame vertically. A value of 0 means the frame's upper edge is aligned with the top edge of the visible area. A value of 100 means the frame's bottom edge is aligned with ...
nsISessionStartup
a.org/browser/sessionstartup;1. To use this service, use: var sessionStartup = Components.classes["@mozilla.org/browser/sessionstartup;1"] .getService(Components.interfaces.nsISessionStartup); Method overview boolean doRestore(); Attributes Attribute Type Description sessionType unsigned long The type of session being restored; this will be one of the Session type constants. ...
...onType unsigned long The type of session being restored; this will be one of the Session type constants. Read only. state jsval The session state, as a JavaScript object. Read only. Note: Prior to Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5), this was a string. It was changed in order to improve performance, which was suffering due to the need to parse and stringify the data. Constants Session type constants Constant Value Description NO_SESSION 0 There's no data available from the previous session. RECOVER_SESSION 1 The last session crashed. It will either be restored or about:sessionrestore will be displayed. RESUME_SESSION 2 The previous session should be restored at startup. DEFER_SESSION 3 The previous session is viable but shouldn't be restored without expli...
nsIStandardURL
; Method overview void init(in unsigned long aUrlType, in long aDefaultPort, in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); Attributes Attribute Type Description mutable boolean Control whether or not this URL can be modified. Protocol handlers can set this flag before handing out an URL to ensure that it is not inadvertently modified. Obsolete since Gecko 1.9 Constants These constants describe how to normalize an URL. Constant Value Description URLTYPE_STANDARD 1 blah:foo/bar => blah://foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar URLTYPE_AUTHORITY 2 blah:foo/bar => blah://foo/bar blah:/foo/bar => blah://foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah://foo/b...
... URLTYPE_NO_AUTHORITY 3 blah:foo/bar => blah:///foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar Methods init() Normalizes a given URL to an Standard URL. void init( in unsigned long aUrlType, in long aDefaultPort, in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI ); Parameters aUrlType One of the constants listed above. aDefaultPort If the port parsed from the URL string matches this port, then the port will be removed from the canonical form of the URL. aSpec URL string. aOriginCharset The charset from which this URI string originated. this corresponds to the charset that should be used when communicating this URI to an origin server, for example. if null, then provide aBaseURI implements this int...
nsITaskbarProgress
ation in the taskbar. This class wraps around the native functionality to do this. 1.0 66 Introduced Gecko 1.9.2 Inherits from: nsISupports Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0) Method overview void setProgressState(in nsTaskbarProgressState state, in unsigned long long currentValue Optional, in unsigned long long maxValue Optional); Constants Constant Value Description STATE_NO_PROGRESS 0 Stop displaying progress on the taskbar button. This should be used when the operation is complete or canceled. STATE_INDETERMINATE 1 Display a cycling, indeterminate progress bar. STATE_NORMAL 2 Display a determinate, normal progress bar. STATE_ERROR 3 Display a determinate, error progress bar. STATE_PAUSED 4 Display a determinate progr...
...ogressState() Sets the taskbar progress state and value for this window. The currentValue and maxValue parameters are optional and should be supplied when state is one of STATE_NORMAL, STATE_ERROR or STATE_PAUSED. void setProgressState( in nsTaskbarProgressState state, in unsigned long long currentValue, Optional in unsigned long long maxValue Optional ); Parameters state One of the state constants. currentValue The current progress value. maxValue The maximum progress value. Exceptions thrown NS_ERROR_ILLEGAL_VALUE If currentValue is greater than maxValue. NS_ERROR_INVALID_ARG If state is STATE_NO_PROGRESS or STATE_INDETERMINATE, and either currentValue or maxValue is not 0. See also nsIWinTaskbar Windows 7 Taskbar APIs ...
nsIUpdateChecker
ice.idlScriptable This interface describes an object that knows how to check for software updates. 1.0 66 Introduced Gecko 1.8 Inherits from: nsISupports Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Method overview void checkForUpdates(in nsIUpdateCheckListener listener, in boolean force); void stopChecking(in unsigned short duration); Constants Constant Value Description CURRENT_CHECK 1 Constant for the stopChecking() method indicating that only the current update check should be stopped. CURRENT_SESSION 2 Constant for the stopChecking() method indicating that all update checks during the current session should be stopped. ANY_CHECKS 3 Constant for the stopChecking() method indicating that all update checking should be stopped.
...rdless of the current value of the user's update settings. This is used by any user interface that offers the user the opportunity to check for updates immediately. The force option doesn't work if the system administrator has locked the app.update.enabled preference. stopChecking() Ends any pending update check. void stopChecking( in unsigned short duration ); Parameters duration One of the constants indicating the set of updates to stop. See also nsIUpdatePatch nsIUpdate nsIUpdateCheckListener nsIApplicationUpdateService nsIUpdateManager nsIUpdatePrompt nsIUpdateTimerManager ...
nsIUpdateItem
version AString The Version of the item, in FVF format. Read only. xpiHash AString The string Hash for the XPI file. Can be null and if supplied must be in the format of "type:hash" (see the types in nsICryptoHash and nsIXPInstallManager.initManagerWithHashes(). Read only. xpiURL AString The URL of the XPI where this item can be downloaded. Read only. Constants Item type constants Constants representing types of update checks. Constants that callers can use to indicate the reason for an add-on update check. Internal code uses other constants in nsExtensionManager.js.in. Constant Gecko version Description 1.8 1.8.1 1.9 1.9.1 1.9.2 TYPE_APP 0x01 TYPE_EXTENSION 0x02 TYPE_THEM...
...ication version with which the item is compatible. name The item's name downloadURL The URL from which the item is to be downloaded. xpiHash The string hash for the XPI file. iconURL The URL of the icon that can be shown for the item. updateURL The URL of the update RDF for the item. updateKey The public key to use to verify updates for the item. type The type of item; see Item type constants. targetAppID The application ID of the target application. ...
nsIWebPageDescriptor
g displayed in one window to be loaded into another window without refetching it from the network. Inherits from: nsISupports Last changed in Gecko 1.7 Method overview void loadPage(in nsISupports aPageDescriptor, in unsigned long aDisplayType); Attributes Attribute Type Description currentDescriptor nsISupports Retrieves the page descriptor for the current document. Read only. Constants Display type constants Constant Value Description DISPLAY_AS_SOURCE 0x0001 Generates an optionally syntax-highlighted (for XML/HTML documents) source of the original page. DISPLAY_NORMAL 0x0002 Just refetches the existing page. Note that if the descriptor is that of the source of another page, this keeps the source view, but uses the current syntax highlighting preference. Methods loadP...
... ...
nsIWindowsShellService
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. A rgb value, where (r << 24 | g << 16 | b) Obsolete since Gecko 1.8 unreadMailCount unsigned long The number of unread mail messages for the current user. Read only. Constants Valid starting keys for the Windows Registry. Constant Value Description HKCR 0 HKEY_CLASSES_ROOT. Obsolete since Gecko 1.8 HKCC 1 HKEY_CURRENT_CONFIG. Obsolete since Gecko 1.8 HKCU 2 HKEY_CURRENT_USER. Obsolete since Gecko 1.8 HKLM 3 HKEY_LOCAL_MACHINE. Obsolete since Gecko 1.8 HKU 4 HKEY_USERS. Obsolete since Gecko 1.8 Methods getRegistryEntry() Obsolete since G...
...E. Obsolete since Gecko 1.8 HKU 4 HKEY_USERS. Obsolete since Gecko 1.8 Methods getRegistryEntry() Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Retrieves a Windows Registry entry value. string getRegistryEntry( in long aHKeyConstant, in string aSubKeyName, in string aValueName ); Parameters aHKeyConstant The starting key, using the constants defined above. aSubKeyName The sub key to locate. aValueName The value to locate in the sub key. The empty string returns the default value of the sub key. Return value The value of the specified sub key/value, truncated to 4096 bytes. restoreFileSettings() Obsolete since Gecko 1.9 (Firefox 3) Restores system settings to what they were before Firefox modified them. void...
nsIXMLHttpRequest
ic to Mozilla application and add-on developers. The interface definition: //github.com/RealityRipple/UXP/blob/master/dom/xhr/nsIXMLHttpRequest.idl Elevated Privileges As mentioned in the "Non-Standard Properties" the property of channel was read-only. When using the XPCOM interface, as seen below in Example 2, we can get access to this. The most obvious benefit is that we can set nsiRequest - Constants in the xhr.channel.loadFlags. For instance, as done in Example 2, the flag of LOAD_ANONYMOUS is added, this strips all user data (cookies, tokens, etc). Using event handlers from native code (Not sure if it's up-to-date) From native code, the way to set up onload and onerror handlers is a bit different. Here is a comment from Johnny Stenback <jst@netscape.com>: The mozilla implementation of n...
...eturns string, you dont want arraybuffer. ...
nsIXULRuntime
t this flag to true. OS AUTF8String A string tag identifying the current operating system. This is taken from the OS_TARGET configure variable. It will always be available. Read only. processID unsigned long The system process ID of the caller's process. Read only. processType unsigned long The type of the caller's process. Returns one of process type constants. Read only. widgetToolkit AUTF8String A string tag identifying the target widget toolkit in use. This is taken from the MOZ_WIDGET_TOOLKIT configure variable. Read only. XPCOMABI AUTF8String A string tag identifying the binary ABI of the current processor and compiler vtable. This is taken from the TARGET_XPCOM_ABI configure variable. It may not be available o...
...or and compiler vtable. This is taken from the TARGET_XPCOM_ABI configure variable. It may not be available on all platforms, especially unusual processor or compiler combinations. The result takes the form <processor>-<compilerABI>, for example: x86-msvc ppc-gcc3. This value should almost always be used in combination with OS. May throw NS_ERROR_NOT_AVAILABLE. Read only. Constants Process type constants Constant Value Description PROCESS_TYPE_DEFAULT 0 The default (chrome) process. PROCESS_TYPE_PLUGIN 1 A plugin subprocess. PROCESS_TYPE_CONTENT 2 A content subprocess. PROCESS_TYPE_IPDLUNITTEST 3 IPDL unit testing subprocess. Methods invalidateCachesOnRestart() Signal the apprunner to inva...
nsIXmlRpcClient
ult returned from this server. null if the last call didn't return a valid result. responseStatus readonly unsigned long The most recent HTTP status code returned from this server. null if the server was unreachable or not yet contacted. responseString readonly unsigned long The most recent HTTP status code returned from this server. null if the server was unreachable or not yet contacted. Constants Constant Type Description INT unsigned long nsISupportsPRInt32 BOOLEAN unsigned long nsISupportsPRBool STRING unsigned long nsISupportsCString DOUBLE unsigned long nsISupportsDouble DATETIME unsigned long nsISupportsPRTime ARRAY readonly unsigned long nsISupportsArray STRUCT readonly unsigned long nsISupportsDictionary Methods init() Set server URL. Call this before using this...
...onvenience: return the correct nsISupportsPrimitive for a given XML-RPC type, or nsISupportsArray or nsIDictionary. 'base64' isn't supported. No QueryInterface call is needed, the object has been QueryInterfaced to the correct interface. void createType ( in unsigned long type, out nsIIDRef uuid, [iid_is(uuid),retval] out nsQIResult result ) ; Parameters type One of the listed constants. uuid The uuid of the returned object. No QI call needed. result The appropriate XPCOM object. ...
nsMsgNavigationType
For example to move forward a message, you would call: // assuming gDBView is a global nsIMsgDBView var resultId = new Object(); var resultIndex = new Object(); var threadIndex = new Object(); gDBView.viewNavigate(Components.interfaces.nsMsgNavigationType.nextMessage, resultId, resultIndex, threadIndex, true); The nsMsgNavigationType interface is defined as a global variable in Thunderbird: var nsMsgViewCommandType = Components.interfaces.nsMsgViewCommandType; mailnews/base/public/nsIMsgDBView.idlScriptable Please add a summary to this article. ...
...ate(Components.interfaces.nsMsgNavigationType.nextMessage, resultId, resultIndex, threadIndex, true); The nsMsgNavigationType interface is defined as a global variable in Thunderbird: var nsMsgViewCommandType = Components.interfaces.nsMsgViewCommandType; mailnews/base/public/nsIMsgDBView.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. nextMessage 2 Go to the next message in the view. Will wrap around if the wrap flag is set to true. previousMessage 3 Go to the previous message in the view. Will wrap around if the wrap flag is set to true. lastMessage 4 Go to the last message in the view. toggleThreadKilled 5 Must match nsMsgViewCommandT...
nsMsgViewCommandCheckState
It is (as far as I can tell) not currently used anywhere in Thunderbird. mailnews/base/public/nsIMsgDBView.idlScriptable Please add a summary to this article. ...
... The nsMsgViewCommandCheckState interface contains constants used for command status in Thunderbird. ...
nsMsgViewSortOrder
For example to sort by date you would pass a function the value: Components.interfaces.nsMsgViewSortOrder.ascending mailnews/base/public/nsIMsgDBView.idlScriptable Please add a summary to this article. ...
...r interface contains constants used for sort direction in Thunderbird. This interface isn't ever implemented. ...
nsMsgViewSortType
For example to sort by date you would pass a function the value: Components.interfaces.nsMsgViewSortType.byDate mailnews/base/public/nsIMsgDBView.idlScriptable Please add a summary to this article. ...
... interface contains constants used for sorting the Thunderbird threadpane. This interface isn't ever implemented. It is only used to store constants. For example to sort by date you would pass a function the value: Components.interfaces.nsMsgViewSortType.byDate mailnews/base/public/nsIMsgDBView.idlScriptable Please add a summary to this article. ...
Add to iPhoto
n on AMO. Once installed, when you right-click on an image, you'll see among the options in the contextual menu an option to "Add Image to iPhoto". Choose it, and iPhoto will start up (if it's not already running) and import the image. Declaring the APIs The first thing we have to do is declare the Mac OS X APIs we'll be using. This extension uses a number of methods and data types, as well as constants, from three system frameworks. Since a lot of this stuff is repetitive, we'll only look at selected parts of the code to get an idea how things work. You can download the extension and poke through the code inside it if you'd like to see all of it. For the sake of organization, I chose to implement each system framework (and, mind you, I only declare the APIs I actually use, not all of them) as...
... {'environment': ctypes.voidptr_t}, // CFDictionaryRef {'argv': ctypes.voidptr_t}, // CFArrayRef of args {'initialEvent': ctypes.voidptr_t}]); // AppleEvent * Most of these fields, we won't be using. We'll get a look at how we use this shortly. There are also a few constants used for the flags field in the LSApplicationParameters structure: this.kLSRolesNone = 1; this.kLSRolesViewer = 2; this.kLSRolesEditor = 4; this.kLSRolesAll = 0xffffffff; Implementing the extension Now that the Mac OS X APIs we'll be using have been declared, we can write the core of the extension itself. This is done in the iPhoto object in the extension's code. Hooking up to the context me...
FunctionType
FunctionType represents C function. Syntax Returns a new CType object describing a C function. CType FunctionType( abi, returnType[, argType1, ...] ); Parameters abi The ABI type for the function; this is one of the ABI constants. returnType A CType indicating the type of the value returned by the function. argType1... argTypeN Zero or more CType objects indicating the types of each of the parameters passed into the C function. Return value A CType describing the function type. The equivalent C function type declaration would be: returnType (*) ([argType1, ..., argTypeN]); Exceptions thrown TypeError ABI is not a valid ABI constants, or returnType or any of the argument types are not valid CType objects. Properties Property Type Description ...
...Read only. argTypes CType[] A sealed array of the argument types. Read only. ...
IDBCursor - Web APIs
Web › API › IDBCursor
interface with an additional value property. IDBCursor.source Read only Returns the IDBObjectStore or IDBIndex that the cursor is iterating. This function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active. IDBCursor.direction Read only Returns the direction of traversal of the cursor. See Constants for possible values. IDBCursor.key Read only Returns the key for the record at the cursor's position. If the cursor is outside its range, this is set to undefined. The cursor's key can be any data type. IDBCursor.primaryKey Read only Returns the cursor's current effective primary key. If the cursor is currently being iterated or has iterated outside its range, this is set to undefined. The ...
....delete() Returns an IDBRequest object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. This can be used to delete specific records. IDBCursor.update() Returns an IDBRequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. This can be used to update specific records. Constants These constants are no longer available -- they were removed in Gecko 25. You should use the string constants directly instead. (bug 891944) NEXT : "next" : The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves upwards (monotonically increasing in the order of keys). NEXTUNIQUE : "nextunique" : The cursor shows all records, excluding...
IDBCursorSync - Web APIs
cursor's range. Method overview bool continue (in optional any key); void remove () raises (IDBDatabaseException); Attributes Attribute Type Description count readonly unsigned long long The total number of objects that share the current key. direction readonly unsigned short The direction of traversal of the cursor. See Constants for possible values. key readonly any The key for the record at the cursor's position. value any The value for the record at the cursor's position. Setting this attribute can raise an IDBDatabaseException with the following codes: DATA_ERR If the underlying object store uses in-line keys and the property at the key path does not match the key in ...
...ursor's position. NOT_ALLOWED_ERR If the underlying index or object store does not support updating the record because it is open in the READ_ONLY or SNAPSHOT_READ mode, or if an index record cannot be changed because the underlying index is auto-populated. SERIAL_ERR If the data being stored could not be serialized by the internal structured cloning algorithm. Constants Constant Value Description NEXT 0 This cursor includes duplicates, and its direction is monotonically increasing in the order of keys. NEXT_NO_DUPLICATE 1 This cursor does not include duplicates, and its direction is monotonically increasing in the order of keys. PREV 2 This cursor includes duplicates, and its direction is monotonic...
IDBTransaction - Web APIs
to the oneventname property of this interface. abort Fired when an IndexedDB transaction is aborted. Also available via the onabort property. complete Fired when a transaction successfully completes. Also available via the oncomplete property. error Fired when a request returns an error and the event bubbles up to the transaction object. Also available via the onerror property. Mode constants These constants are no longer available -- they were removed in Gecko 25. You should use the string constants directly instead. (bug 888598) Transactions can have one of three modes: Constant Value Description READ_ONLY "readonly" (0 in Chrome) Allows data to be read but not changed. READ_WRITE "readwrite" (1...
... Allows any operation to be performed, including ones that delete and create object stores and indexes. This mode is for updating the version number of transactions that were started using the setVersion() method of IDBDatabase objects. Transactions of this mode cannot run concurrently with other transactions. Transactions in this mode are known as "upgrade transactions." Even if these constants are now deprecated, you can still use them to provide backward compatibility if required (in Chrome the change was made in version 21). You should code defensively in case the object is not available anymore: var myIDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || { READ_WRITE: "readwrite" }; Examples In the following code snippet, we open a read/write transaction on our...
Using IndexedDB - Web APIs
ozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; // DON'T use "var indexedDB = ..." if you're not in a function. // Moreover, you may need references to some window.IDB* objects: window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.msIDBTransaction || {READ_WRITE: "readwrite"}; // This line should only be needed if it is needed to support the object's constants for older browsers window.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange || window.msIDBKeyRange; // (Mozilla has never prefixed these objects, so we don't need window.mozIDB*) Beware that implementations that use a prefix may be buggy, or incomplete, or following an old version of the specification. Therefore, it is not recommended to use it in production code. It may be preferabl...
...an pass nextunique (or prevunique if you're going backwards) as the direction parameter. When nextunique or prevunique is used, the entry with the lowest key is always the one returned. index.openKeyCursor(null, "nextunique").onsuccess = function(event) { var cursor = event.target.result; if (cursor) { // Do something with the entries. cursor.continue(); } }; Please see "IDBCursor Constants" for the valid direction arguments. Version changes while a web app is open in another tab When your web app changes in such a way that a version change is required for your database, you need to consider what happens if the user has the old version of your app open in one tab and then loads the new version of your app in another. When you call open() with a greater version than the actual vers...
compareVersion - Web APIs
aller (earlier) build number than version. 0 The version numbers are the same; both objects represent the same version. 1 registryName has a larger (newer) build number than version. 2 registryName has a larger (newer) release number than version. 3 registryName has a larger (newer) minor number than version. 4 registryName has a larger (newer) major number than version. ...
...yName has a larger (newer) release number than version. 3 registryName has a larger (newer) minor number than version. 4 registryName has a larger (newer) major number than version. The following constants can be used to check the value returned by compareVersion: int MAJOR_DIFF = 4; int MINOR_DIFF = 3; int REL_DIFF = 2; int BLD_DIFF = 1; int EQUAL = 0; In Communicator 4.5, the following constants are defined and available for checking the value returned by compareVersion: <code>InstallTrigger.MAJOR_DIFF InstallTrigger.MINOR_DIFF InstallTrigger.REL_DIFF InstallTrigger.BLD_DIFF InstallTrigger.EQUAL </code> Description The compareVersion method compares the version of an installed file or package with a specified version. It is often used as a check against which to initiate the installa...
KeyboardEvent - Web APIs
idth="130" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="296" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">KeyboardEvent</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Constructor KeyboardEvent() Creates a new KeyboardEvent object. Constants The KeyboardEvent interface defines the following constants. Keyboard locations The following constants identify which part of the keyboard the key event originates from. They are accessed as KeyboardEvent.DOM_KEY_LOCATION_STANDARD and so forth. Keyboard location identifiers Constant Value Description DOM_KEY_LOCATION_STANDARD 0x00 The key described by ...
...nfigured for. This may be the empty string if the browser or device doesn't know the keyboard's locale. Note: This does not describe the locale of the data being entered. A user may be using one keyboard layout while typing text in a different language. KeyboardEvent.location Read only Returns a Number representing the location of the key on the keyboard or other input device. A list of the constants identifying the locations is shown above in Keyboard locations. KeyboardEvent.metaKey Read only Returns a Boolean that is true if the Meta key (on Mac keyboards, the ? Command key; on Windows keyboards, the Windows key (?)) was active when the key event was generated. KeyboardEvent.repeat Read only Returns a Boolean that is true if the key is being held down such that it is automatically re...
MouseEvent - Web APIs
ount of pressure applied to a touch or tablet device when generating the event; this value ranges between 0.0 (minimum pressure) and 1.0 (maximum pressure). Instead of using this deprecated (and non-standard) property, you should instead use PointerEvent and look at its pressure property. MouseEvent.mozInputSource Read only The type of device that generated the event (one of the MOZ_SOURCE_* constants listed below). This lets you, for example, determine whether a mouse event was generated by an actual mouse or by a touch event (which might affect the degree of accuracy with which you interpret the coordinates associated with the event). MouseEvent.webkitForce Read only The amount of pressure applied when clicking MouseEvent.x Read only Alias for MouseEvent.clientX. MouseEvent.y Read...
...ple, determine whether a mouse event was generated by an actual mouse or by a touch event (which might affect the degree of accuracy with which you interpret the coordinates associated with the event). MouseEvent.webkitForce Read only The amount of pressure applied when clicking MouseEvent.x Read only Alias for MouseEvent.clientX. MouseEvent.y Read only Alias for MouseEvent.clientY Constants MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN Read only Minimum force necessary for a normal click MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN Read only Minimum force necessary for a force click Methods This interface also inherits methods of its parents, UIEvent and Event. MouseEvent.getModifierState() Returns the current state of the specified modifier key. See the KeyboardEvent.getMod...
Node.nodeType - Web APIs
Web › API › Node › nodeType
The read-only Node.nodeType property is an integer that identifies what the node is. It distinguishes different kind of nodes from each other, such as elements, text and comments. Syntax var type = node.nodeType; Returns an integer which specifies the type of the node. Possible values are listed in Node type constants. Constants Node type constants Constant Value Description Node.ELEMENT_NODE 1 An Element node like <p> or <div>. Node.TEXT_NODE 3 The actual Text inside an Element or Attr. Node.CDATA_SECTION_NODE 4 A CDATASection, such as <!CDATA[[ ... ]]>. Node.PROCESSING_INSTRUCTION_NODE 7 A ProcessingInstruction of an XML document, such as <?xml-stylesheet ... ?>. Node.COMMENT_NODE 8 A Comment nod...
...E 7 A ProcessingInstruction of an XML document, such as <?xml-stylesheet ... ?>. Node.COMMENT_NODE 8 A Comment node, such as <!-- ... -->. Node.DOCUMENT_NODE 9 A Document node. Node.DOCUMENT_TYPE_NODE 10 A DocumentType node, such as <!DOCTYPE html>. Node.DOCUMENT_FRAGMENT_NODE 11 A DocumentFragment node. Deprecated node type constants The following constants have been deprecated and should not be used anymore. Constant Value Description Node.ATTRIBUTE_NODE 2 An Attribute of an Element. Attributes no longer implement the Node interface as of DOM4. Node.ENTITY_REFERENCE_NODE 5 An XML Entity Reference node, such as &foo;. Removed in DOM4. Node.ENTITY_NODE 6 An XML ...
SVGAngle - Web APIs
Web › API › SVGAngle
the object reflects an attribute. Unless otherwise described, an SVGAngle object is not associated with any element. Every SVGAngle object operates in one of two modes: Reflect the base value of a reflected animatable attribute (being exposed through the baseVal member of an SVGAnimatedAngle), Be detached, which is the case for SVGAngle objects created with SVGSVGElement.createSVGAngle(). Constants SVG_ANGLETYPE_UNKNOWN Some unknown type of value. SVG_ANGLETYPE_UNSPECIFIED A unitless <number> interpreted as a value in degrees. SVG_ANGLETYPE_DEG An <angle> with a deg unit. SVG_ANGLETYPE_RAD An <angle> with a rad unit. SVG_ANGLETYPE_GRAD An <angle> with a grad unit. Properties unitType The type of the value as specified by one of the SVG_ANGLETYPE_* constants defined on this...
...ad-only attribute, or when the object itself is read-only. Methods newValueSpecifiedUnits Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object. Exceptions: A DOMException with code NOT_SUPPORTED_ERR is raised if unitType is SVG_ANGLETYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_ANGLETYPE_* constants defined on this interface). A DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the length corresponds to a read only attribute or when the object itself is read only. convertToSpecifiedUnits Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes unitType, valueInSpecifiedUnits, and valueAsString might be modifie...
SVGComponentTransferFunctionElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY 1 Corresponds to the value identity. SVG_FECOMPONENTTRANSFER_TYPE_TABLE 2 Corresp...
...ponds to the value linear. SVG_FECOMPONENTTRANSFER_TYPE_GAMMA 5 Corresponds to the value gamma. Properties This interface also inherits properties from its parent interface, SVGElement. SVGComponentTransferFunctionElement.type Read only An SVGAnimatedEnumeration corresponding to the type attribute of the given element. It takes one of the SVG_FECOMPONENTTRANSFER_TYPE_* constants defined on this interface. SVGComponentTransferFunctionElement.tableValues Read only An SVGAnimatedNumberList corresponding to the tableValues attribute of the given element. SVGComponentTransferFunctionElement.slope Read only An SVGAnimatedNumber corresponding to the slope attribute of the given element. SVGComponentTransferFunctionElement.intercept Read only An SVGAnimatedNumber corres...
SVGFEBlendElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_FEBLEND_MODE_NORMAL 1 Corresponds to the value normal. SVG_FEBLEND_MODE_MULTIPLY 2 Corresponds to the value multiply. ...
...rdAttributes. SVGFEBlendElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEBlendElement.in2 Read only An SVGAnimatedString corresponding to the in2 attribute of the given element. SVGFEBlendElement.mode Read only An SVGAnimatedEnumeration corresponding to the mode attribute of the given element. It takes one of the SVG_FEBLEND_MODE_* constants defined on this interface. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEBlendElement' in that specification. Working Draft No change ...
SVGFEColorMatrixElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_FECOLORMATRIX_TYPE_MATRIX 1 Corresponds to the matrix value. SVG_FECOLORMATRIX_TYPE_SATURATE 2 Corresponds to the saturat...
...m its parent interface, SVGElement , and also implements properties of SVGFilterPrimitiveStandardAttributes. SVGFEColorMatrixElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEColorMatrixElement.type Read only An SVGAnimatedEnumeration corresponding to the type attribute of the given element. It takes one of the SVG_FECOLORMATRIX_TYPE_* constants defined on this interface. SVGFEColorMatrixElement.values Read only An SVGAnimatedNumberList corresponding to the values attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement , and also implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment...
SVGFECompositeElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_FECOMPOSITE_OPERATOR_OVER 1 Corresponds to the over value. SVG_FECOMPOSITE_OPERATOR_IN 2 Corresponds to the in value. ...
...from its parent interface, SVGElement, and also implements properties of SVGFilterPrimitiveStandardAttributes. SVGFECompositeElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFECompositeElement.type Read only An SVGAnimatedEnumeration corresponding to the type attribute of the given element. It takes one of the SVG_FECOMPOSITE_OPERATOR_* constants defined on this interface. SVGFECompositeElement.values Read only An SVGAnimatedNumberList corresponding to the values attribute of the given element. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttributes. Specifications Specification Status Comment ...
SVGFEConvolveMatrixElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_EDGEMODE_DUPLICATE 1 Corresponds to the duplicate value. SVG_EDGEMODE_WRAP 2 Corresponds to the wrap value. SVG_EDGEMODE_N...
...getX Read only An SVGAnimatedInteger corresponding to the targetX attribute of the given element. SVGFEConvolveMatrixElement.targetY Read only An SVGAnimatedInteger corresponding to the targetY attribute of the given element. SVGFEConvolveMatrixElement.edgeMode Read only An SVGAnimatedEnumeration corresponding to the edgeMode attribute of the given element. Takes one of the SVG_EDGEMODE_* constants defined on this interface. SVGFEConvolveMatrixElement.kernelUnitLengthX Read only An SVGAnimatedNumber corresponding to the kernelUnitLength attribute of the given element. SVGFEConvolveMatrixElement.kernelUnitLengthY Read only An SVGAnimatedNumber corresponding to the kernelUnitLength attribute of the given element. SVGFEConvolveMatrixElement.preserveAlpha Read only An SVGAnimatedBoolea...
SVGFEDisplacementMapElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_CHANNEL_R 1 Corresponds to the R value. SVG_CHANNEL_G 2 Corresponds to the G value. SVG_CHANNEL_B 3 Corresponds to th...
...d only An SVGAnimatedString corresponding to the in2 attribute of the given element. SVGFEDisplacementMapElement.scale Read only An SVGAnimatedNumber corresponding to the scale attribute of the given element. SVGFEDisplacementMapElement.xChannelSelector Read only An SVGAnimatedEnumeration corresponding to the xChannelSelect attribute of the given element. It takes one of the SVG_CHANNEL_* constants defined on this interface. SVGFEDisplacementMapElement.yChannelSelector Read only An SVGAnimatedEnumeration corresponding to the yChannelSelect attribute of the given element. It takes one of the SVG_CHANNEL_* constants defined on this interface. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFi...
SVGFEGaussianBlurElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_EDGEMODE_DUPLICATE 1 Corresponds to the duplicate value. SVG_EDGEMODE_WRAP 2 Corresponds to the wrap value. SVG_EDGEMODE_N...
...eviation attribute of the given element. SVGFEGaussianBlurElement.stdDeviationY Read only An SVGAnimatedNumber corresponding to the (possibly automatically computed) Y component of the stdDeviation attribute of the given element. SVGFEGaussianBlurElement.edgeMode Read only An SVGAnimatedEnumeration corresponding to the edgeMode attribute of the given element. Takes one of the SVG_EDGEMODE_* constants defined on this interface. Methods This interface also inherits methods of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStandardAttributes. SVGFEGaussianBlurElement.setStdDeviation() Sets the values for the stdDeviation attribute. Specifications Specification Status Comment Filter Effects Module Level 1The definition of 'SVGFEGaussianB...
SVGFEMorphologyElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_MORPHOLOGY_OPERATOR_ERODE 1 Corresponds to the erode value. SVG_MORPHOLOGY_OPERATOR_DILATE 2 Corresponds to dilate value...
...parent interface, SVGElement, and also implements properties of SVGFilterPrimitiveStandardAttributes. SVGFEMorphologyElement.in1 Read only An SVGAnimatedString corresponding to the in attribute of the given element. SVGFEMorphologyElement.operator Read only An SVGAnimatedEnumeration corresponding to the operator attribute of the given element. It takes one of the SVG_MORPHOLOGY_OPERATOR_* constants defined on this interface. SVGFEMorphologyElement.radiusX Read only An SVGAnimatedNumber corresponding to the X component of the radius attribute of the given element. SVGFEMorphologyElement.radiusY Read only An SVGAnimatedNumber corresponding to the Y component of the radius attribute of the given element. Methods This interface does not provide any specific methods, but implements thos...
SVGFETurbulenceElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_TURBULENCE_TYPE_FRACTALNOISE 1 Corresponds to the fractalNoise value. SVG_TURBULENCE_TYPE_TURBULENCE 2 Cor...
...taves Read only An SVGAnimatedInteger corresponding to the numOctaves attribute of the given element. SVGFETurbulenceElement.seed Read only An SVGAnimatedNumber corresponding to the seed attribute of the given element. SVGFETurbulenceElement.stitchTiles Read only An SVGAnimatedEnumeration corresponding to the stitchTiles attribute of the given element. It takes one of the SVG_STITCHTYPE_* constants defined on this interface. SVGFETurbulenceElement.type Read only An SVGAnimatedEnumeration corresponding to the type attribute of the given element. It takes one of the SVG_TURBULENCE_TYPE_* constants defined on this interface. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and also implements methods of SVGFilterPrimitiveStanda...
SVGGradientElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_SPREADMETHOD_PAD 1 Corresponds to value pad. SVG_SPREADMETHOD_REFLECT 2 Corresponds to value reflect. SVG_SPREADMETHOD...
...2 Corresponds to value reflect. SVG_SPREADMETHOD_REPEAT 3 Corresponds to value repeat. Properties This interface also inherits properties from its parent, SVGElement, and implements those of SVGURIReference. SVGGradientElement.gradientUnits Read only Returns an SVGAnimatedEnumeration corresponding to the gradientUnits attribute on the given element. Takes one of the constants defined in SVGUnitTypes. SVGGradientElement.gradientTransform Read only Returns an SVGAnimatedTransformList corresponding to attribute gradientTransform on the given element. SVGGradientElement.spreadMethod Read only Returns an SVGAnimatedEnumeration corresponding to attribute spreadMethod on the given element. One of the spread method types defined on this interface. Methods This interf...
SVGMarkerElement - Web APIs
Properties SVGAnimatedLength refX SVGAnimatedLength refY SVGAnimatedEnumeration markerUnits SVGAnimatedLength markerWidth SVGAnimatedLength markerHeight SVGAnimatedEnumeration orientType SVGAnimatedAngle orientAngle Constants SVG_MARKER_ORIENT_UNKNOWN = 0 SVG_MARKER_ORIENT_AUTO = 1 SVG_MARKER_ORIENT_ANGLE = 2 SVG_MARKERUNITS_UNKNOWN = 0 SVG_MARKERUNITS_USERSPACEONUSE = 1 SVG_MARKERUNITS_STROKEWIDTH = 2 Normative document SVG 1.1 (2nd Editi...
...It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SV...
SVGTextPathElement - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. TEXTPATH_METHODTYPE_ALIGN 1 Corresponds to the value align. TEXTPATH_METHODTYPE_STRETCH 2 Corresponds to the value...
...erface, SVGTextContentElement, and also implements properties of SVGURIReference. SVGTextPathElement.startOffset Read only An SVGAnimatedLength corresponding to the X component of the startOffset attribute of the given element. SVGTextPathElement.method Read only An SVGAnimatedEnumeration corresponding to the method attribute of the given element. It takes one of the TEXTPATH_METHODTYPE_* constants defined on this interface. SVGTextPathElement.spacing Read only An SVGAnimatedEnumeration corresponding to the spacing attribute of the given element. It takes one of the TEXTPATH_SPACINGTYPE_* constants defined on this interface. Methods This interface does not provide any specific methods, but implements those of its parent, SVGTextContentElement, and also implements methods of SVGURIRefe...
SVGTransform - Web APIs
atrix(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 readonly float angle readonly SVGMatrix matrix Constants SVG_TRANSFORM_UNKNOWN = 0 SVG_TRANSFORM_MATRIX = 1 SVG_TRANSFORM_TRANSLATE = 2 SVG_TRANSFORM_SCALE = 3 SVG_TRANSFORM_ROTATE = 4 SVG_TRANSFORM_SKEWX = 5 SVG_TRANSFORM_SKEWY = 6 Normative document SVG 1.1 (2nd Edition) Constants Name Value Description SVG_TRANSFORM_UNKNOWN 0 The unit type is not o...
... angle float A convenience attribute for SVG_TRANSFORM_ROTATE, SVG_TRANSFORM_SKEWX and SVG_TRANSFORM_SKEWY. It holds the angle that was specified. For SVG_TRANSFORM_MATRIX, SVG_TRANSFORM_TRANSLATE and SVG_TRANSFORM_SCALE, angle will be zero. matrix SVGMatrix The matrix that represents this transformation. The matrix object is l...
SVGUnitTypes - Web APIs
The SVGUnitTypes interface defines a commonly used set of constants used for reflecting gradientUnits, patternContentUnits and other similar 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/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> a:...
...It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_UNIT_TYPE_USERSPACEONUSE 1 Corresponds to the value userSpaceOnUse. SVG_UNIT_TYPE_OBJECTBOUNDINGBOX 2 Corresponds to the value obj...
WEBGL_compressed_texture_astc - Web APIs
tensions in the WebGL tutorial. Availability: ASTC compression is typically available on Mali ARM GPUs, Intel GPUs, and Nividia Tegra chips. This extension is available to both, WebGL1 and WebGL2 contexts. Methods This extension exposes one new methods. ext.getSupportedProfiles() Returns an array of strings containing the names of the ASTC profiles supported by the implementation. ...
...sion is typically available on Mali ARM GPUs, Intel GPUs, and Nividia Tegra chips. This extension is available to both, WebGL1 and WebGL2 contexts. Methods This extension exposes one new methods. ext.getSupportedProfiles() Returns an array of strings containing the names of the ASTC profiles supported by the implementation. Constants The compressed texture formats are exposed by 28 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). Constants Blocks Bits per pixel ArrayBuffer byteLength bytes if height and width are 512 ext.COMPRESSED_RGBA_ASTC_4x4_KHR ext.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 4x4 8.00 floor((width + 3) / 4) * floor((height + 3) / 4) * 16 262144 ext.COMPRESSED_RGBA_AS...
WEBGL_debug_renderer_info - Web APIs
Depending on the privacy settings of the browser, this extension might only be available to privileged contexts. Generally, the graphics driver information should only be used in edge cases to optimize your WebGL content or to debug GPU problems. The WebGLRenderingContext.getParameter() method can help you to detect which features are supported and the failIfMajorPerformanceCaveat context attribute lets you control if a context should be returned at all, if the performance would be dramatically slow. ...
....getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: Depending on the privacy settings of the browser, this extension might only be available to privileged contexts or not work at all. In Firefox, if privacy.resistFingerprinting is set to true, this extensions is disabled. This extension is available to both, WebGL1 and WebGL2 contexts. Constants ext.UNMASKED_VENDOR_WEBGL Vendor string of the graphics driver. ext.UNMASKED_RENDERER_WEBGL Renderer string of the graphics driver. Examples With the help of this extension, privileged 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.getExten...
WebGLRenderingContext.blendFunc() - Web APIs
m specifying a multiplier for the destination blending factors. The default value is gl.ZERO. For possible values, see below. Return value None. Exceptions If sfactor or dfactor is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. If a constant color and a constant alpha value are used together as source and destination factors, a gl.INVALID_ENUM error is thrown. Constants The following constants can be used for sfactor and dfactor. The formula for the blending color can be described like this: color(RGBA) = (sourceColor * sfactor) + (destinationColor * dfactor). The RBGA values are between 0 and 1. Constant Factor Description gl.ZERO 0,0,0,0 Multiplies all colors by 0. gl.ONE 1,1,1,1 Multiplies all colors by 1. ...
...e of 1 minus the destination alpha value. The alpha value is multiplied by 1. Examples To use the blend function, you first have to activate blending with WebGLRenderingContext.enable() with the argument gl.BLEND. gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_COLOR, gl.DST_COLOR); To get the current blend function, query the BLEND_SRC_RGB, BLEND_SRC_ALPHA, BLEND_DST_RGB, and BLEND_DST_ALPHA constants which return one of the blend function constants. gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_COLOR, gl.DST_COLOR); gl.getParameter(gl.BLEND_SRC_RGB) == gl.SRC_COLOR; // true Specifications Specification Status Comment WebGL 1.0The definition of 'blendFunc' in that specification. Recommendation Initial definition. In WebGL, constant color and constant alpha cann...
WebGL: 2D and 3D graphics for the web - Web APIs
Web › API › WebGL API
It is based on OpenGL ES 3.0 and new features include: 3D textures, Sampler objects, Uniform Buffer objects, Sync objects, Query objects, Transform Feedback objects, Promoted extensions that are now core to WebGL 2: Vertex Array objects, ...
...It is based on OpenGL ES 3.0 and new features include: 3D textures, Sampler objects, Uniform Buffer objects, Sync objects, Query objects, Transform Feedback objects, Promoted extensions that are now core to WebGL 2: Vertex Array objects, instancing, multiple render t...
Web audio spatialization basics - Web APIs
RTF'; The coneInnerAngle and coneOuterAngle properties specify where the volume emanates from. By default, both are 360 degrees. Our boombox speakers will have smaller cones, which we can define. The inner cone is where gain (volume) is always emulated at a maximum and the outer cone is where the gain starts to drop away. The gain is reduced by the value of the coneOuterGain value. Let's create constants that store the values we'll use for these parameters later on: const innerCone = 60; const outerCone = 90; const outerGain = 0.3; The next parameter is distanceModel -- this can only be set to linear, inverse, or exponential. These are different algorithms, which are used to reduce the volume of the audio source as it moves away from the listener. We'll use linear, as it is simple: const dist...
...ate the y and z coordinates for that object), but we also need to do some more maths for this. The rotation is a circle and we need Math.sin and Math.cos to help us draw that circle. ...
XPathResult - Web APIs
ator has become invalid. It is true if resultType is UNORDERED_NODE_ITERATOR_TYPE or ORDERED_NODE_ITERATOR_TYPE and the document has been modified since this result was returned. XPathResult.numberValueRead only A number representing the value of the result if resultType is NUMBER_TYPE. XPathResult.resultTypeRead only A number code representing the type of the result, as defined by the type constants. XPathResult.singleNodeValueRead only A Node representing the value of the single node result, which may be null. XPathResult.snapshotLengthRead only The number of nodes in the result snapshot. XPathResult.stringValueRead only A string representing the value of the result if resultType is STRING_TYPE. Methods XPathResult.iterateNext() If the result is a node set, this method iterat...
...ext() If the result is a node set, this method iterates over it and returns the next node from it or null if there are no more nodes. XPathResult.snapshotItem() Returns an item of the snapshot collection or null in case the index is not within the range of nodes. Unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated. Constants Result Type Defined Constant Value Description ANY_TYPE 0 A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type. NUMBER_TYPE 1 A result containing a single number. This is useful for example, in an XPath express...
Numbers and dates - JavaScript
he digits after 0x are outside the range (0123456789ABCDEF), the following SyntaxError is thrown: "Identifier starts immediately after numeric literal". 0xFFFFFFFFFFFFFFFFF // 295147905179352830000 0x123456789ABCDEF // 81985529216486900 0XA // 10 Exponentiation 1E3 // 1000 2e6 // 2000000 0.1e2 // 10 Number object The built-in Number object has properties for numerical constants, such as maximum value, not-a-number, and infinity. You cannot change the values of these properties and you use them as follows: var biggestNum = Number.MAX_VALUE; var smallestNum = Number.MIN_VALUE; var infiniteNum = Number.POSITIVE_INFINITY; var negInfiniteNum = Number.NEGATIVE_INFINITY; var notANum = Number.NaN; You always refer to a property of the predefined Number object as shown above,...
...ription toExponential() Returns a string representing the number in exponential notation. toFixed() Returns a string representing the number in fixed-point notation. toPrecision() Returns a string representing the number to a specified precision in fixed-point notation. Math object The built-in Math object has properties and methods for mathematical constants and functions. For example, the Math object's PI property has the value of pi (3.141...), which you would use in an application as Math.PI Similarly, standard mathematical functions are methods of Math. These include trigonometric, logarithmic, exponential, and other functions. For example, if you want to use the trigonometric function sine, you would write Math.sin(1.56) Note that all trig...
MathML documentation index - MathML
Web › MathML › Index
6 MathML attribute reference MathML, MathML Reference This is an alphabetical list of MathML attributes. More details for each attribute are available on particular element pages. 7 Values Guide, MathML, MathML Reference Several MathML presentation elements have attributes that accept length values used for size or spacing. MathML accepts different units and constants for specifying lengths. 8 MathML documentation index Index, MathML Found 40 pages: 9 MathML element reference MathML, MathML Reference This is an alphabetical list of MathML presentation elements. 10 <maction> MathML, MathML Reference, MathML:Element, MathML:Enlivening Expressions The following example uses the "toggle" actiontype: ...
...:Element The MathML <mglyph> element is used to display non-standard symbols where existing Unicode characters are not available. It may be used within token elements. 17 <mi> MathML, MathML Reference, MathML:Element, MathML:Token Elements The MathML <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. You can also have arbitrary text in it to mark up terms. 18 <mlabeledtr> MathML, MathML Reference, MathML:Element, MathML:Tabular Math The MathML <mlabeledtr> element is used to represent a label in a row either on the left or on the right side (determined using the side attribute on the <mtable> element). Child elements of <mlabeledtr> must be <mtd> elements. The first chil...
system/runtime - Archive of obsolete content
are read-only. For more information, see nsIXULRuntime. Globals Properties inSafeMode This value is true if Firefox was started in safe mode, otherwise false. OS A string identifying the current operating system. For example, . "WINNT", "Darwin", or "Linux". See OS_TARGET for a more complete list of possible values. processType The type of the caller's process, which will be one of these constants: Constant Value Description PROCESS_TYPE_DEFAULT 0 The default (chrome) process. PROCESS_TYPE_PLUGIN 1 A plugin subprocess. PROCESS_TYPE_CONTENT 2 A content subprocess. PROCESS_TYPE_IPDLUNITTEST 3 An IPDL unit testing subprocess. widgetToolkit A string identifying the target widget toolkit in use. XPCOMABI A str...
Finding window handles - Archive of obsolete content
.treeOwner .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIBaseWindow); var NSWindowString = baseWindow.nativeHandle; Components.utils.import('resource://gre/modules/ctypes.jsm'); var objc = ctypes.open(ctypes.libraryName('objc')); // types let id = ctypes.voidptr_t; let SEL = ctypes.voidptr_t; // constants let nil = ctypes.voidptr_t(0); //common functions let sel_registerName = objc.declare('sel_registerName', ctypes.default_abi, SEL, ctypes.char.ptr); let objc_msgSend = objc.declare('objc_msgSend', ctypes.default_abi, id, id, SEL, '...'); /* https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/index.html#//apple_ref/occ/instp/NSApplicat...
Forms related code snippets - Archive of obsolete content
Note: The current implementation of const (constant statement) is not part of ECMAScript 5. It is supported in Firefox & Chrome (V8) and partially supported in Opera 9+ and Safari. It is not supported in Internet Explorer 6-9, or in the preview of Internet Explorer 10. const is going to be defined by ECMAScript 6, but with different semantics. Similar to variables declared with the let statement, constants declared with const will be block-scoped. We used it only for didactic purpose. If you want a full browser compatibility of this library, please replace all the const statements with the var statements. This date-picker code snippet will automatically create an HTML code like the following: <table id="zdp-cal-1" class="zdp-calendar" style="z-index: 1026; position: absolute; left: 294px; top: 4...
JS XPCOM - Archive of obsolete content
Every XPCOM object must implement the nsISupports interface. ...
Intercepting Page Loads - Archive of obsolete content
rack of the rest of the listeners for all the tabs. We're being careful about removing all listeners, as not doing it has the potential of causing memory leaks. There are a couple of things left to do: implementing the progress listener methods, and figuring out what NOTIFY_ALL is about. For that, we recommend that you first read the documentation on nsIWebProgressListener and the nsIWebProgress.Constants (WebProgress NOTIFY constants). In a nutshell, there are a lot of state and status changes going on when a page loads, and the NOTIFY constants allow you to filter out the events you don't need to listen to. Picking the right filter not only simplifies your code, but also reduces the performance impact your extension will have in regular navigation. Here are a couple of common use cases and the ...
Extensions support in SeaMonkey 2 - Archive of obsolete content
splay gMessageDisplay API SeaMonkey 2.0 only supports a reduced set of methods: displayedMessage visible JavaScript Tweaks Firefox supports some shorthand in various places. These are so commonly available that developers often forget that they are not built-ins. SeaMonkey on the other hand defaults to not support them so they either need to be expanded to their proper forms or matching constants/variables need to be defined in custom code. Shorthand Expansion Cc Components.classes Ci Components.interfaces Cr Components.results Cu Components.utils Multi-browser compatibility To make an extension compatible with SeaMonkey as well as Firefox/Thunderbird, you may need to do different things depending on which application is...
Index - Archive of obsolete content
erties No summary! 729 InstallVersion Object You use InstallVersion objects to contain version information for software. 730 Methods No summary! 731 Properties No summary! 732 Return Codes The methods described in this chapter can return any of the following return codes. In Mozilla/SeaMonkey, these constants are defined as part of the xpinstall object (formerly the SoftwareUpdate object in Netscape Communicator 4.5). 733 WinProfile Object (Windows only) Windows developers use this object to manipulate the content of a Windows .ini file. 734 Methods No summary! 735 WinReg Object (Windows only) 736 Methods The WinRe...
JXON - Archive of obsolete content
Note: The current implementation of const (constant statement) is not part of ECMAScript 5. It is supported in Firefox & Chrome (V8) and partially supported in Opera 9+ and Safari. It is not supported in Internet Explorer 6-9, or in the preview of Internet Explorer 10. const is going to be defined by ECMAScript 6, but with different semantics. Similar to variables declared with the let statement, constants declared with const will be block-scoped. We used it only for didactic purpose. If you want a full browser compatibility of this library, please replace all the const statements with the var statements. Usage The obtained non-native JXON global object will have two methods: Method Description JXON.build(document[, verbosity[, freeze[, nesteAttributes]]]) Returns a JavaS...
Dehydra Object Reference - Archive of obsolete content
ype object the function return type. .parameters array of type objects the parameter types for the function. .isExplicit boolean flag true for constructors declared using the C++ explicit keyword Template Objects Property Type Description .name string the name of the template, for example "nsCOMPtr". .arguments array an array where arguments are either strings representing C++ constants or type objects. Location Objects Location objects are passed to builtin functions such as warning() and error() to specify the location of the message. They convert to a string of the form "file:line:column". They have the following properties: Property Type .file string .line integer .column integer (optional) ...
The Download Manager schema - Archive of obsolete content
e. source TEXT The source URI for the download. target TEXT The destination URI for the download. tempPath TEXT The path of the temporary file being used for the download. startTime INTEGER The download's start time. endTime INTEGER The download's end time. state INTEGER The download's current state. See the constants list in the nsIDownloadManager documentation. referrer TEXT The referrer for the download. entityID TEXT The entity ID from the nsIResumableChannel used to implement the download channel. This information is used to resume the download after it's been paused. currBytes INTEGER The current number of bytes that have been downloaded. Defaults to 0, may no...
compareTo - Archive of obsolete content
; both objects represent the same version. 1 This version object has a larger (newer) build number than version. 2 This version object has a larger (newer) release number than version. 3 This version object has a larger (newer) minor number than version. 4 This version object has a larger (newer) major number than version. ...
Return Codes - Archive of obsolete content
Name Code Explanation SUCCESS 0 Success. REBOOT_NEEDED 999 The files were installed, but one or more components were in use. Restart the computer and the application to complete the installation process. On Windows NT, you may only need to restart the application as long as you did not replace operating system files. ...
checkState - Archive of obsolete content
sing the button will switch to state 0. This means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state. If you wish to have different behavior for how the states are adjusted, set the autoCheck attribute to false and adjust the state with a script. The type attribute must be set to checkbox for buttons with a check state. Constants for the possible values for this attribute are in the nsIDOMXULButtonElement interface. ...
priority - Archive of obsolete content
...
reloadWithFlags - Archive of obsolete content
You may combine flags using a or symbol ( | ). LOAD_FLAGS_NONE: No special flags. The document is loaded normally. LOAD_FLAGS_BYPASS_CACHE: Reload the page, ignoring if it is already in the cache. This is the flag used when the reload button is pressed while the Shift key is held down. ...
Node - Archive of obsolete content
Archive › Mozilla › XUL › Node
It represents a single node in the document tree. ...
webNavigation - Archive of obsolete content
...
Tree Widget Changes - Archive of obsolete content
yCell(row) method has been removed, instead use nsITreeBoxObject.invalidateCell() like this invalidateCell(row, tree.columns.getPrimaryColumn()). This may be used to redraw a cell after it or its data has been changed. The nsITreeView.cycleHeader() method has been changed, cycleHeader(colID, element) is now just cycleHeader(column), since the code can get the element from the column object. ...
Keyboard Shortcuts - Archive of obsolete content
sed, the key event will instead be targeted at the XUL document itself. In this case, you can add an event listener to the window tag. Normally though, if you want to respond to keys globally, you will use a keyboard shortcut as described earlier. The key event object has two properties which hold the key that was pressed. The keyCode property holds the key code and may be compared to one of the constants from the key table earlier in this section. The charCode is used for printable characters and will hold the numeric Unicode character code value for the key that was pressed. Our Find files example so far : Source View Next, we'll find out how to handle focus and the selection. << PreviousNext >> ...
button - Archive of obsolete content
sing the button will switch to state 0. This means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state. If you wish to have different behavior for how the states are adjusted, set the autoCheck attribute to false and adjust the state with a script. The type attribute must be set to checkbox for buttons with a check state. Constants for the possible values for this attribute are in the nsIDOMXULButtonElement interface. checked Type: boolean Indicates whether the element is checked or not. Use hasAttribute() to determine whether this attribute is set instead of getAttribute(). For buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. command Type: id Set to the...
editor - Archive of obsolete content
nsIWebBrowserFind This read-only property contains an nsIWebBrowserFind object which can be used to search for text in the document. webNavigation Type: nsIWebNavigation This read-only property contains the nsIWebNavigation object for the document. Most of its methods are callable directly on the element itself, such as goBack and goForward. It also contains the load constants used by reloadWithFlags and loadURIWithFlags. Methods getEditor( window ) Return type: nsIEditor Returns the editing interface for the editor which contains numerous methods for manipulating the document. Pass the editor's contentWindow as the argument. getHTMLEditor( window ) Return type: nsIHTMLEditor Returns the HTML editing interface for the editor which contains methods for manipu...
iframe - Archive of obsolete content
) window object docShell Type: nsIDocShell This read-only property contains the nsIDocShell object for the document. webNavigation Type: nsIWebNavigation This read-only property contains the nsIWebNavigation object for the document. Most of its methods are callable directly on the element itself, such as goBack and goForward. It also contains the load constants used by reloadWithFlags and loadURIWithFlags. Methods Inherited Methods addEventListener(), appendChild(), blur, click, cloneNode(), compareDocumentPosition, dispatchEvent(), doCommand, focus, getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getBoundingClientRect(), getClientRects(), getElementsByAttribute, getElementsByAttributeNS, getElementsByClassName(), getE...
notification - Archive of obsolete content
. persistence Type: integer The persistence may be set to a non-zero value so that the notificationbox's removeTransientNotifications method does not remove them. This may be used to close a set of notifications as a group without affecting other notifications. priority Type: integer Numeric value that specifies the order in which the notifications appear. Should be one of the constants described in the notificationbox's appendNotification method. type Type: one of the values below Indicates the type of notification, determined from the priority. info a notification that is of lesser importance. warning a normal warning notification. critical a critical notification. value Type: string The string attribute allows you to associate a data valu...
toolbarbutton - Archive of obsolete content
sing the button will switch to state 0. This means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state. If you wish to have different behavior for how the states are adjusted, set the autoCheck attribute to false and adjust the state with a script. The type attribute must be set to checkbox for buttons with a check state. Constants for the possible values for this attribute are in the nsIDOMXULButtonElement interface. checked Type: boolean Indicates whether the element is checked or not. Use hasAttribute() to determine whether this attribute is set instead of getAttribute(). For buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. command Type: id Set to the i...
Debug.msUpdateAsyncCallbackRelation - Archive of obsolete content
asynchronous operation is aborted, when a join operation is used, or in other scenarios. The possible values for relationType include: Debug.MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE Debug.MS_ASYNC_CALLBACK_STATUS_JOIN Debug.MS_ASYNC_CALLBACK_STATUS_CHOOSEANY Debug.MS_ASYNC_CALLBACK_STATUS_CANCEL Debug.MS_ASYNC_CALLBACK_STATUS_ERROR For more information, see Debug Constants. Note: Some debugging tools do not display the information sent to the debugger by this function. Requirements Supported in the Internet Explorer 11 standards document mode. Also supported in Store apps (Windows 8.1 and Windows Phone 8.1). Not supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, In...
Debug - Archive of obsolete content
apps, the write and writeln functions of the Debug object display strings in the Visual Studio Output window at run time. To debug Internet Explorer scripts, you must have a script debugger installed and the script must run in debug mode. Internet Explorer 8 and later versions include the JavaScript debugger. If the script is not being debugged, the Debug methods and properties have no effect. Constants Async Callback Status Codes Contant Description Value Debug.MS_ASYNC_CALLBACK_STATUS_ASSIGN_DELEGATE The synchronous work item assigned a callback or continuation to be run by an asynchronous operation. 0 Debug.MS_ASYNC_CALLBACK_STATUS_JOIN The synchronous work item satisfied part of a join asynchronous operation. 1 Debug.MS_ASYNC_CALLBACK_S...
Constant - MDN Web Docs Glossary: Definitions of Web-related terms
A constant is a value that the programmer cannot change, for example numbers (1, 2, 42). With variables, on the other hand, the programmer can assign a new value to a variable name already in use. Like variables, some constants are bound to identifiers. For example, the identifier pi could be bound to the value 3.14... . Learn more General knowledge Constant on Wikipedia ...
Symbol - MDN Web Docs Glossary: Definitions of Web-related terms
damentally different, and should not occasionally convert one into another. If you really want to show a symbol, we need to call .toString() on it. let Sym = Symbol("Sym") alert(Sym.toString()) // Symbol(Sym), now it works Or you can use the symbol.description property to get its description: let _Sym = Symbol("Sym"); alert(_Sym.description); // Sym Well-known symbols The Symbol class has constants for so-called well-known symbols. These symbols let you configure how JS treats an object, by using them as property keys. Examples of well-known symbols are: Symbol.iterator for array-like objects, or Symbol.search for string objects. They are listed in the specification in the Well-known symbols table: Symbol.hasInstance Symbol.isConcatSpreadable Symbol.iterator Symbol.toPrimitive ...a...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
starter file for the app. This contains the finished HTML structure and CSS styling, giving us a game board that shows the two players' information (as seen above), but with the spinner and results paragraph displayed on top of one another. You just have to write the JavaScript code. Inside the empty <script> element on your page, start by adding the following lines of code that define some constants and variables you'll need in the rest of the code: const spinner = document.querySelector('.spinner p'); const spinnerContainer = document.querySelector('.spinner'); let rotateCount = 0; let startTime = null; let rAF; const btn = document.querySelector('button'); const result = document.querySelector('.result'); In order, these are: A reference to the spinner, so you can animate it. ...
Fetching data from the server - Learn web development
jax-start.html and the four text files -- verse1.txt, verse2.txt, verse3.txt, and verse4.txt -- in a new directory on your computer. In this example, we will load a different verse of the poem (which you may well recognize) via XHR when it's selected in the drop-down menu. Just inside the <script> element, add the following code. This stores a reference to the <select> and <pre> elements in constants and defines an onchange event handler function so that when the select's value is changed, its value is passed to an invoked function updateDisplay() as a parameter. const verseChoose = document.querySelector('select'); const poemDisplay = document.querySelector('pre'); verseChoose.onchange = function() { const verse = verseChoose.value; updateDisplay(verse); }; Let's define our upd...
Introduction to web APIs - Learn web development
o play and stop the music, and an <input> element of type range, which we'll use to adjust the volume of the track while it's playing. Next, let's look at the JavaScript for this example. ...
Video and Audio APIs - Learn web development
We have three groups: The <video> element, and the controls bar. The play/pause, stop, rewind, and fast forward buttons. The outer timer wrapper <div>, the digital timer readout <span>, and the inner <div> that gets wider as the time elapses. Next, insert the following at the bottom of your code: media.removeAtt...
Object building practice - Learn web development
const width = canvas.width = window.innerWidth; const height = canvas.height = window.innerHeight; This script gets a reference to the <canvas> element, then calls the getContext() method on it to give us a context on which we can start to draw. The resulting constant (ctx) is the object that directly represents the drawing area of the canvas and allows us to draw 2D shapes on it. Next, we set constants called width and height, and the width and height of the canvas element (represented by the canvas.width and canvas.height properties) to equal the width and height of the browser viewport (the area that the webpage appears on -- this can be gotten from the Window.innerWidth and Window.innerHeight properties). Note that we are chaining multiple assignments together, to get the variables all set ...
Accessibility in React - Learn web development
nt to focus on and how to find it. React's useRef hook creates an object with a single property: current. This property can be a reference to anything we want and look that reference up later. It's particularly useful for referring to DOM elements. Change the import statement at the top of Todo.js so that it includes useRef: import React, { useRef, useState } from "react"; Then, create two new constants beneath the hooks in your Todo() function. Each should be a ref - one for the "Edit" button in the view template and one for the edit field in the editing template. const editFieldRef = useRef(null); const editButtonRef = useRef(null); These refs have a default value of null because they will not have value until we attach them to their respective elements. To do that, we'll add an attribute of...
Accessibility API cross-reference
y Sun Microsystems. It will be reused for KDE accessibility via AT-SPI . We find that it uses very similar naming conventions as Java accessibility, and for those purposes the two to be nearly the same. However, only about one third of the states and roles in Sun's accessibility API's are the same as in MSAA. To do Fill out Mac API column.(Mac OS X - Carbon Accessibility API and Accessibility Constants) Finish ARIA column - add explanation of the term 'Abstract role' Fill out HTML column Create AOM column Fill out XUL column. Fill out Tagged PDF column (Relevant documents from PDF association) Add missing ARIA properties Fill out events cross reference table Use this info to expand Mozilla's accessibility API coverage to include Mac, so that we can start to freeze them Talk about the f...
Mozilla accessibility architecture
ormation to an accessibility client (the assistive technology). Each platform's accessibility API has made different assumptions, although there are a number of common characteristics. For example, they all expose an accessible name, or text representation, of each object, and they all use an enumerated integer value from a finite list, to expose the role of an object. Examples of accessible role constants are ROLE_BUTTON, ROLE_CHECKBOX and ROLE_LIST, although they can have slightly different names and values in each API. In general, the accessibility APIs use similar concepts, but use different method, constant and interfaces names. Given that there is a fair amount of commonality between accessibility API toolkits, it made sense to write of the code in a cross platform manner, and then deal with ...
Error codes returned by Mozilla APIs
For example, by using Components.results.NS_ERROR_NOT_INITIALIZED General Errors The following errors are general and can occur when using any component. ...
AddonUpdateChecker
ERROR_DOWNLOAD_ERROR There was an error while downloading the update information. ERROR_PARSE_ERROR The update information was malformed in some way. ERROR_UNKNOWN_FORMAT The update information was not in any known format. ERROR_SECURITY_ERROR The update informat...
JNI.jsm
jenv variable in the window scope, so if you need to run JNI from the global scope, use a different variable name then jenv. JNI.jsm contains all the js-ctypes needed to communicate with the JNI libraries. The js-ctypes is abstracted away while all the underlying data is all ctype data. Functions are declared similar to js-ctypes but in a very different syntax. Unlike C from js-ctypes, defining constants is not a manual magic number method in JNI, it is declared the same way we define functions, except in JNI they are called fields. Method overview CData GetForThread(); CData LoadClass(CData aJenv, String aClassFullyQualifiedName, [optional] Object aDeclares); CData NewString(CData aJenv, String aStr); String ReadString(CData aJenv, CData aJavaString); ...
JavaScript OS
The JavaScript OS module contains tools that allow chrome content (i.e. platform and add-ons) to interact with the host operating system. At the time of this writing, some of the features of this module are available only to chrome workers. OS.Constants OS-related constants, including errors, file opening modes, system configuration, etc. OS.File Access to the native file system. OS.Shared Utilities for defining functions that interact with the operating system. ...
OS.File.Error
useNoSuchFile true if the operation failed because a file or directory does not exist, false otherwise. becauseClosed true if the operation failed because a file or directory is closed, false otherwise. Platform-specific attributes unixErrno (defined under Unix only) The system error number (errno) for the error. For more details, you may compare it with the error constants of OS.Constants.libc.E*. winLastError (defined under Windows only) The system error number (GetLastError) for the error. For more details, you may compare it with the error constants of OS.Constants.Win.ERROR_*. ...
OSFile.jsm
use the code that requires file I/O is already executed on a worker thread. For this reason, API clients can also spawn their own worker threads and make use of OS.File directly from these threads. ...
Sqlite.jsm
s one functional unit. If the transaction succeeds, all the statements contained within it are committed as one unit. If the transaction fails, the database is rolled back to its state before the transaction started. This function receives the following arguments: func The function defining the transaction body. type The type of transaction to perform. This must be one of the TRANSACTION_* constants on the opened connection instance. Valid values are TRANSACTION_DEFERRED, TRANSACTION_IMMEDIATE, TRANSACTION_EXCLUSIVE. See the SQLite documentation for their meaning. The default is TRANSACTION_DEFERRED. The passed function is a Task.jsm compatible generator function. When called, the function receives as its argument the current connection instance. This generator function is expected to yiel...
Using JavaScript code modules
pt or JavaScript XPCOM script, using Components.utils.import() or Components.utils["import"](). Creating a JavaScript code module A very simple JavaScript module looks like this: var EXPORTED_SYMBOLS = ["foo", "bar"]; function foo() { return "foo"; } var bar = { name : "bar", size : 3 }; var dummy = "dummy"; Notice that the module uses normal JavaScript to create functions, objects, constants, and any other JavaScript type. The module also defines a special Array named EXPORTED_SYMBOLS. Any JavaScript item named in EXPORTED_SYMBOLS will be exported from the module and injected into the importing scope. For example: Components.utils.import("resource://app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "6" alert(dummy); // displays "...
Mozilla DOM Hacking Guide
have to implement it as well. How to override the default behavior of XPConnect on DOM objects XPConnect implements default behaviors for XPCOM objects in general, and for DOM objects in particular. DOMClassInfo allows the implementor to override this default behavior using the nsIXPCScriptable interface. Before we begin, please take a look at the nsIXPCScriptable.idl file. It defines a set of constants, called the "scriptable flags", and a set of functions, like NewResolve(), SetProperty(), ... Each flag corresponds to one function. For example, nsIXPCScriptable::WANT_NEWRESOLVE means that we want to implement the NewResolve() function. The important thing to grasp is that each function corresponds to an event in the life of the DOM object. For example, the SetProperty() function is called auto...
NSPR Types
re. PRIntn PRUintn Miscellaneous Types Size Type Pointer Difference Types Boolean Types Status Type for Return Values Size Type PRSize Pointer Difference Types Types for pointer difference. Variables of these types are suitable for storing a pointer or pointer subtraction. These are the same as the corresponding types in libc. PRPtrdiff PRUptrdiff Boolean Types Type and constants for Boolean values. PRBool PRPackedBool Status Type for Return Values PRStatus ...
PRIntervalTime
platform-dependent. They are chosen to be appropriate for the host OS, yet provide sufficient resolution and period to be useful to clients. The increasing interval value represented by PRIntervalTime wraps. It should therefore never be used for intervals greater than approximately 6 hours. Interval times are accurate regardless of host processing requirements and are very cheap to acquire. The constants PR_INTERVAL_MIN and PR_INTERVAL_MAX define a range in ticks per second. These constants bound both the period and the resolution of a PRIntervalTime object. The reserved constants PR_INTERVAL_NO_WAIT and PR_INTERVAL_NO_TIMEOUT have special meaning for NSPR. They indicate that the process should wait no time (return immediately) or wait forever (never time out), respectively. Important Note The...
PR_Open
name The pathname of the file to be opened. flags The file status flags define how the file is accessed. It is a bitwise OR of the following bit flags. In most cases, only one of the first three flags may be used. If the flags parameter does not include any of the first three flags (PR_RDONLY, PR_WRONLY, or PR_RDWR), the open file can't be read or written, which is not useful. NOTE: The constants PR_RDWR and friends are not in any interface (bug 433295). Thus they cannot be used in JavaScript, you have to use the octal constants (see File I/O Snippets). Name Value Description PR_RDONLY 0x01 Open for reading only. PR_WRONLY 0x02 Open for writing only. PR_RDWR 0x04 Open for reading and writing. ...
Process Initialization
Implicit initialization should suffice unless a program has specific sequencing requirements or needs to characterize the primordial thread. ...
Process Management and Interprocess Communication
of the Unix fork(). The newly-created process executes its program from the beginning. A new process can inherit specified file descriptors from its parent, and the parent can redirect the standard I/O streams of the child process to specified file descriptors. Note that the functions described in this chapter are not available for MacOS or Win16 operating systems. ...
NSS API Guidelines
em, adds its own error number to the stack. At the bottom of the stack is the fundamental error, for example: file not found, and on top is an error precisely relating to what you are doing. Note: Error stacks are vertical, and never horizontal. If multiple things go wrong simultaneously, and you want to report them all, use another mechanism. Errors, though not integers, are done as external constants, instead of preprocessor definitions. This is so any additional error doesn't trigger the entire tree to rebuild. Likewise, the external references to errors are made in the prototypes files, with the functions which can return them. Error stacks are thread-private. The usual semantic is that public routines clear the stack first, private routines don't. Usually, every public routine has a priv...
sample2
topt.h> #include <prerror.h> #include <prinit.h> #include <prlog.h> #include <prtypes.h> #include <plstr.h> /* NSS headers */ #include <cryptohi.h> #include <keyhi.h> #include <pk11priv.h> #include <cert.h> #include <base64.h> #include <secerr.h> #include <secport.h> #include <secoid.h> #include <secmodt.h> #include <secoidt.h> #include <sechash.h> /* our samples utilities */ #include "util.h" /* Constants */ #define BLOCKSIZE 32 #define MODBLOCKSIZE 128 #define DEFAULT_KEY_BITS 1024 /* Header file Constants */ #define ENCKEY_HEADER "-----BEGIN WRAPPED ENCKEY-----" #define ENCKEY_TRAILER "-----END WRAPPED ENCKEY-----" #define MACKEY_HEADER "-----BEGIN WRAPPED MACKEY-----" #define MACKEY_TRAILER "-----END WRAPPED MACKEY-----" #define IV_HEADER "-----BEGIN IV-----" #define IV_TRAILER "-----END IV----...
JIT Optimization Strategies
e of them per program. This includes global objects, object literals defined at the top-level of a script, and top-level function objects. This optimization makes the assumption that a property that has not changed after it was first assigned, is likely a constant property. It then directly inlines the value of the property into hot code that accesses it. For example, in the following code: var Constants = {}; Constants.N = 100; function testArray(array) { for (var i = 0; i < array.length; i++) { if (array[i] > Constants.N) return true; } return false; } Will have the loop compiled into the following when testArray gets hot. for (var i = 0; i < array.length; i++) { if (array[i] > 100) return true; } When this optimization is successful, property access is eliminated en...
JS::TrueHandleValue
This article covers features introduced in SpiderMonkey 38 The JS::Value that represents the JavaScript value true. Syntax const JS::HandleValue JS::TrueHandleValue; const JS::HandleValue JS::FalseHandleValue; Description JS::TrueHandleValue and JS::FalseHandleValue are JS::HandleValue constants that represent the JavaScript values true and false. See Also MXR ID Search for JS::TrueHandleValue MXR ID Search for JS::FalseHandleValue JS::NullHandleValue JS::UndefinedHandleValue bug 959787 ...
JSClass.flags
If this flag is set, each instance of the class has a field for private data. The field can be accessed using JS_GetPrivate and JS_SetPrivate. MXR ID Search for JSCLASS_HAS_PRIVATE JSCLASS_PRIVATE_IS_NSISUPPORTS Mozilla extension. ...
JSClass
trace; /* Added in SpiderMonkey 17 */ JSClassInternal reserved1; /* Obsolete since SpiderMonkey 13 */ void *reserved[N]; /* sizeof 'reserved' depends on version */ }; Name Type Description name const char * Class name flags uint32_t Class flags. This field is the bitwise OR of one or more of the JSCLASS_* constants described in JSClass.flags. addProperty JSPropertyOp A hook called just after adding a new property. May modify the new property value. Use NULL or JS_PropertyStub (SpiderMonkey 31 or older) for default behavior. delProperty JSDeletePropertyOp A hook called when deleting a property. May veto. Use NULL or JS_DeletePropertyStub (SpiderMonkey 31 ...
JSErrorFormatString
e. Syntax typedef struct JSErrorFormatString { const char *format; uint16_t argCount; int16_t exnType; } JSErrorFormatString; Name Type Description format const char * The error format string in ASCII. argCount uint16_t The number of arguments to expand in the formatted error message. exnType int16_t One of the JSExnType constants. Description JSErrorFormatString is a struct to represent error message and type, returned by JS_ReportErrorNumber function. See Also MXR ID Search for JSErrorFormatString JSExnType JS_ReportErrorNumber bug 684526 ...
JSErrorReport
using this flag. The constant JSREPORT_ERROR is 0 and can be used to indicate an error report without any of the above flags. errorNumber unsigned The error number. ucmessage const char16_t * The default unicode error message. messageArgs const char16_t ** Arguments for the error message. exnType int16_t One of the JSExnType constants. Description JSErrorReport describes a single error that occurs in the execution of script. In the event of an error, filename will either contain the name of the external source file or URL containing the script (SCRIPT SRC=) or NULL, indicating that a script embedded in the current HTML page caused the error. lineno indicates the line number of the script containing the error. In the case...
JSVAL_TO_BOOLEAN
e to a C integer, either 0 or 1, without any type checking or error handling. Syntax JSBool JSVAL_TO_BOOLEAN(jsval v); Description JSVAL_TO_BOOLEAN casts the value v to a C integer, either 0 or 1. As a precondition, JSVAL_IS_BOOLEAN(v) must be true. That is, v must be either JSVAL_TRUE or JSVAL_FALSE. Otherwise the behavior is undefined. The result is JS_TRUE or JS_FALSE respectively. These are constants of type JSBool, which is an integer type, the SpiderMonkey version of bool. JS_FALSE is 0; JS_TRUE is 1. To convert any value to a boolean, use JS_ValueToBoolean instead. That function has well-defined behavior even when the argument is an object, number, or something else. To convert a JSBool to jsval, use BOOLEAN_TO_JSVAL. See Also bug 952650 ...
JSVAL_TRUE
Obsolete since JSAPI 42This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. jsval constants that represent the JavaScript values true and false. Syntax JSVAL_TRUE JSVAL_FALSE Description JSVAL_TRUE and JSVAL_FALSE are jsval constants that represent the JavaScript boolean values, true and false. They are equivalent to BOOLEAN_TO_JSVAL(true) and BOOLEAN_TO_JSVAL(false), respectively. Take care not to confuse the jsval constants JSVAL_TRUE and JSVAL_FALSE with the bool constants true and false. jsval values must not be used as C true/false values; there is no guarantee that the C bit-pattern of any particular jsval is zero or nonzero. See Also MXR ID Search for JSVAL_TRUE MXR ID Sea...
JS_AddFinalizeCallback
izeStatus { JSFINALIZE_GROUP_START, JSFINALIZE_GROUP_END, JSFINALIZE_COLLECTION_END } JSFinalizeStatus; typedef void (* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartment, void *data); Name Type Description fop JSFreeOp * A pointer to an instance of JSFreeOp. status JSFinalizeStatus One of the JSFinalizeStatus constants, described below, indicating the stage of finalize. isCompartment bool false if all compartments are being collected, true if a compartment is being collected. data void * data parameter specified in JS_AddFinalizeCallback. Added in SpiderMonkey 38 Name Description JSFINALIZE_GROUP_START Called when preparing to sweep a group of compart...
JS_GetVersion
Retrieves the JavaScript version number used within a specified executable script context. Syntax JSVersion JS_GetVersion(JSContext *cx); Name Type Description cx JSContext * The context to query. Description JS_GetVersion returns the JavaScript version currently used by the given JSContext, cx. The result is one of the JSVersion constants. When a context is created, its version is initially JSVERSION_DEFAULT. Scripts are compiled using the latest version of the JavaScript language. To configure a context to run scripts using a specific version of JavaScript, use JS_SetVersion. See Also MXR ID Search for JS_GetVersion JS_VersionToString JS_StringToVersion JS_SetVersionForCompartment ...
JS_InitStandardClasses
t, parseInt, parseFloat, RangeError, ReferenceError, RegExp, String, SyntaxError, TypeError, undefined, and URIError as well as a few SpiderMonkey-specific globals, depending on compile-time options: escape, unescape, uneval, InternalError, Script, XML, Namespace, QName, File, Generator, Iterator, and StopIteration, as of SpiderMonkey 1.7. These global objects, functions, constructors, and constants are created as properties of obj. As a side effect, JS_InitStandardClasses establishes obj as the global object for cx, if one is not already established. This means that scripts executed in cx will see the properties of obj as global variables. See JS_SetGlobalObject for details. obj must be of a JSClass that has the JSCLASS_GLOBAL_FLAGS flag. JS_InitStandardClasses returns JS_TRUE on success,...
JS_MapGCRoots
GCRoots to map the GC's roots table using map(rp, name, data). The root is pointed at by rp; if the root is unnamed, name is null; data is supplied from the third parameter to JS_MapGCRoots. The map function should return JS_MAP_GCROOT_REMOVE to cause the currently enumerated root to be removed. To stop enumeration, return JS_MAP_GCROOT_STOP. To continue mapping, return JS_MAP_GCROOT_NEXT. These constants are flags; you can OR them together. This function acquires and releases rt's GC lock around the mapping of the roots table, so the map function should run to completion in as few cycles as possible. The map function cannot call JS_GC, JS_MaybeGC, JS_BeginRequest, or any JS API entry point that acquires locks, without double-tripping or deadlocking on the GC lock. JS_MapGCRoots returns the coun...
JS_SetGCCallback
{ JSGC_BEGIN, JSGC_END, JSGC_MARK_END, // Obsolete since JSAPI 13 JSGC_FINALIZE_END // Obsolete since JSAPI 13 } JSGCStatus; typedef void (* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data); Name Type Description cx JSContext * The context in which garbage collection is happening. status JSGCStatus One of the JSGCStatus constants, described below, indicating the stage of GC. Description JS_SetGCCallback sets a callback function which the garbage collector calls at several points during garbage collection. rt is the runtime in which you specify the callback. cb is a pointer to the new callback function to use. Callback related to finalization is separated to JS_SetFinalizeCallback in JSAPI 13. Obsolete since JSAPI ...
JS_SetOptions
ining the previous values of the flags. To turn individual 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. MXR ID Search for JSOPTION_EXTRA_WARNINGS JSOPTION_WERROR Convert warnings to errors. MXR ID Search for JSOPTION_WERROR JSOPTION_VAROBJFIX Make JS_EvaluateScript() use the last object on its obj par...
JS_TracerInit
Callback A callback, described below, which the tracing APIs will call each time a pointer is found from one GC thing to another. Callback syntax typedef void (*JSTraceCallback)(JSTracer *trc, void *thing, uint32 kind); Name Type Description trc JSTracer * The tracer visiting obj. thing void * A GC thing. kind uint32 One of the constants JSTRACE_OBJECT, JSTRACE_DOUBLE, JSTRACE_STRING; or a tag denoting an internal implementation-specific traversal kind. In the latter case, the only operations the callback may perform on thing are to call JS_TraceChildren or the DEBUG-only JS_PrintTraceThingInfo function. Description JS_TraceChildren and other tracing APIs call the tracer callback for each traceable thing directly referenced...
SpiderMonkey 31
Many of the garbage collector changes require type signature changes to JSAPI methods: specifically introducing JS::Rooted, JS::Handle, and JS::MutableHandle types. These types, with the appropriate parametrizations, can roughly be substituted for plain types of GC things (values, string/object pointers, etc.). The JSBool type has been removed, along with the corresponding JS_TRUE and JS_FALSE constants. They have been replaced by bool, true, and false respectively. Many JSClass and js::Class instances are now explicitly const, and several APIs have been updated to use const JSClass * and const js::Class * pointers. All references to shortid/tinyid have been removed. That includes the APIs JS_DefinePropertyWithTinyId and JS_DefineUCPropertyWithTinyId as well as the JSPropertyDescriptor struct...
TPS History Lists
history. The history list used for operations other than delete has the following properties: uri: required. title: optional. The page title for this uri. 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/nsINavHistoryService#Constants. date: required. An integer representing when the visit took place, expressed in hours from the present. For example, 0 is now, -24 is 24 hours in the past. For example: var history_initial = [ { uri: "http://www.google.com/", title: "Google", visits: [ { type: 1, date: 0 }, { type: 2, date: -1 } ] }, { uri: "http://www.cnn.com/", title: "CNN", visits: [ ...
Gecko events
EVENT_DOM_CREATE An object has been created. Is Supported: yes EVENT_DOM_DESTROY An object has been destroyed. Is Supported: yes EVENT_DOM_SIGNIFICANT_CHANGE An object's properties or content have changed significantly so that the type of object has really changed, and therefore the accessible should be destroyed or recreated. ...
Gecko Roles
ROLE_NOTHING Used when the accessible item doesn't have a strongly defined role. ROLE_TITLEBAR Represents a title or caption bar for a window. Used by MSAA only, this is supported automatically by Microsoft Windows. ROLE_MENUBAR Represents the menu bar (positioned beneath the title bar of a window on most platforms or at the top of the screen on Mac OS X) from which menus are selected by the user. ROLE_SCROLLBAR Represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. ...
Gecko states
States List STATE_UNAVAILABLE The object is unavailable, i.e. disabled. Applied to: all roles. STATE_SELECTED The object is selected, i.e. indicates this object is the child of an object that allows its children to be selected and that this child is one of those children that has been selected. ...
XForms Accessibility
element doesn't have labelledby attribute. description It is formed from value of child XForms hint element if the element doesn't have describedby attribute. state It is formed as well from model item properties (MIPs) of instance node that XForms element is bound to as from valid/invalid or in-range/out-of-range states of instance node. Instance node states are mapped to accessibility state constants declared in nsIAccessibleStates interface like it shown below: relevant - STATE_UNAVAILABLE readonly - STATE_READONLY required - STATE_REQUIRED invalid - STATE_INVALID out of range - STATE_INVALID attributes Redefines datatype ARIA attribute. Its value is XML Schema builit-in datatype of instance node that XForms element is bound to. children Mozilla XForms implementation allows form ...
Using the Places annotation service
ItemAnnotationBinary methods which return the mimetype as well). ...
STEEL
It is a FUEL-like set of interfaces to facilitate Thunderbird extension development. Currently, STEEL has an steelIApplication interface that implements all the functions of extIApplication. The library has also been implemented in Firefox ("FUEL") and in SeaMonkey ("SMILE"). ...
An Overview of XPCOM
rom nsISupports. XPIDL and Type Libraries An easy and powerful way to define an interface - indeed, a requirement for defining interfaces in a cross-platform, language neutral development environment - is to use an interface definition language (IDL). XPCOM uses its own variant of the CORBA OMG Interface Definition Language (IDL) called XPIDL, which allows you to specify methods, attributes and constants of a given interface, and also to define interface inheritance. There are some drawbacks to defining your interface using XPIDL. There is no support for multiple inheritance, for one thing. If you define a new interface, it cannot derive from more than one interface. Another limitation of interfaces in XPIDL is that method names must be unique. You can not have two methods with the same name tha...
Creating XPCOM components
fests Registration Methods in XPCOM Autoregistration The Shutdown Process Three Parts of a XPCOM Component Library XPCOM Glue The Glue Library XPCOM String Classes Creating the Component Code What We'll Be Working On Component Registration The regxpcom Program Registration Alternatives Overview of the WebLock Module Source Digging In: Required Includes and Constants Identifiers in XPCOM Coding for the Registration Process The Registration Methods Creating an Instance of Your Component webLock1.cpp Using XPCOM Utilities to Make Things Easier XPCOM Macros Generic XPCOM Module Macros Common Implementation Macros Declaration Macros webLock2.cpp String Classes in XPCOM Using Strings nsEmbedString and nsEmbedCString Sm...
Components.interfaces
. The properties of the Components.interfaces object can be enumerated using a for...in loop. Usage Accessing an interface object Properties of the Components.interfaces object are indexed by interface name. You can retrieve an interface object using: var iface = Components.interfaces.nsISupportsArray; This will return you the interface object for the nsISupportsArray interface. Accessing constants defined in an interface Interface descriptions (cf. XPIDL) may not only contain method declarations, but also constants. For example, assume we have the following interface declaration: interface nsIFoo : nsISupports { const PRUint32 MYFLAG = 5; }; The constant MYFLAG can then be accessed using var myFlag = Components.interfaces.nsIFoo.MYFLAG; ...
Monitoring HTTP activity
These include the ability to monitor outgoing HTTP request headers and bodies as well as incoming HTTP headers and complete HTTP transactions. ...
amIInstallTrigger
Constant Value Description SKIN 1 LOCALE 2 CONTENT 4 PACKAGE 7 Methods enabled() Tests if installation is enabled. boolean enabled(); Parameters None. Return value install() Starts a new installation of a set of add-ons. boolean install( in nsIVariant aAr...
imgILoader
imgIRequest loadImage( in nsIURI aURI, in nsIURI aInitialDocumentURL, in nsIURI aReferrerURI, in nsIPrincipal aLoadingPrincipal, in nsILoadGroup aLoadGroup, in imgIDecoderObserver aObserver, in nsISupports aCX, in nsLoadFla...
imgIRequest
ly. imagePrincipal nsIPrincipal The principal gotten from the channel the image was loaded from. Read only. imageStatus unsigned long Status flags of the STATUS_* variety. Read only. mimeType string Read only. URI nsIURI The URI the image load was started with. Note that this might not be the actual URI for the image (for example if HTTP redirects happened during the load). Read only. Constants Constant Value Description STATUS_NONE 0x0 Nothing to report. STATUS_SIZE_AVAILABLE 0x1 We received enough image data from the network or filesystem that we know the width and height of the image, and have thus called SetSize() on the container. STATUS_LOAD_PARTIAL 0x2 Used internally by imgRequest to flag that a request is being cancelled as a result of a failure of a proxy holder and...
mozIAsyncHistory
and add visit). Exceptions thrown NS_ERROR_INVALID_ARG Passing in NULL for aPlaceInfo. Not providing at least one valid GUID or URI for all mozIPlaceInfo object[s]. Not providing an array or nothing for the visits property of mozIPlaceInfo. Not providing a visitDate and transitionType for each mozIVisitInfo. Providing an invalid transitionType (see nsINavBookmarksService.Constants) for a mozIVisitInfo. See also mozIPlaceInfo mozIVisitInfo mozIVisitInfoCallback ...
mozIStorageError
t changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Inherits from: nsISupports Attributes Attribute Type Description message AUTF8String A human readable error string with details; this may be null if no details are available. Read only. result long One of the error code values listed under Constants on this page. Constants Constant Value Description ERROR 1 General SQL error, or missing database IOERR 10 A disk I/O error occurred. CORRUPT 11 The database on disk is malformed. FULL 13 An insertion failed because the database is full. ...
mozIStorageStatement
. row mozIStorageStatementRow The current row, with access to all data members by name. Available only to JavaScript code. Read only. state long The current state defined by mozIStorageStatement.MOZ_STORAGE_STATEMENT_INVALID, mozIStorageStatement.MOZ_STORAGE_STATEMENT_READY, or mozIStorageStatement.MOZ_STORAGE_STATEMENT_EXECUTING. Read only. Statement status constants Constant Value Description MOZ_STORAGE_STATEMENT_INVALID 0 The SQL statement is Invalid. MOZ_STORAGE_STATEMENT_READY 1 The SQL statement is ready to be executed. MOZ_STORAGE_STATEMENT_EXECUTING 2 The SQL statement is executing at the moment. Methods initialize() Obsolete since Gecko 1.9.1 (Firefox 3.5 / Thunderb...
mozITXTToHTMLConv
Constant Type Description kEntities unsigned long Enables conversion of basic special characters to HTML entities. This applies to "<", "&", and ">" (which are converted to &lt;, &amp;, and &gt;, respectively). kGlyphSubstitution unsigned long Enables con...
mozIVisitInfo
ko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Attributes Attribute Type Description referrerURI nsIURI Read only: The referring URI of this visit. This may be null. sessionId long Read only: The sessionId of this visit. transitionType long Read only: The transition type used to get to this visit. One of the nsINavBookmarksService.Constants on nsINavHistory. visitDate PRTime Read only: The time the visit occurred. visitId long Read only: The machine-local (internal) id of the visit. See also mozIAsyncHistory ...
nsIAboutModule
/nsIAboutModule.idlScriptable This interface is implemented to add an 'about:' page. The contract id ends with a parameter that corresponds to the name of the about page. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview unsigned long getURIFlags(in nsIURI aURI); nsIChannel newChannel(in nsIURI aURI); Constants Constant Value Description URI_SAFE_FOR_UNTRUSTED_CONTENT (1 << 0) A flag that indicates whether a URI is safe for untrusted content. If it is, web pages and so forth will be allowed to link to this about: URI. Otherwise, only chrome will be able to link to it. ALLOW_SCRIPT (1 << 1) A flag that indicates whether script should be enabled for the given ...
GetAccessibleRelated
Return value Returns an accessible which is related to the one provided by the given relation type. ...
Role
<< nsIAccessible Page Summary Enumerated accessible role for the associated element. The values depend on platform because of variations. See the ROLE_* constants in roles documentation. attribute unsigned long role; ...
nsIAccessibleEvent
sIDOMNode The nsIDOMNode associated with the event. May return null if accessible for event has been shut down. Read only. eventType unsigned long The type of event, based on the enumerated event values defined in this interface. Read only. isFromUserInput boolean Returns true if the event was caused by explicit user input, as opposed to purely originating from a timer or mouse movement. Constants Constant Gecko version Description 1.7 - 1.8.1 1.9 - 1.9.2 2.0 EVENT_SHOW 0x8002 0x0001 An object has been created. EVENT_HIDE 0x8003 0x0002 An object has been destroyed. EVENT_REORDER 0x8004 0x005C 0x0003 An object's children have changed. EVENT_ACTIVE_DECENDENT_CHANGED 0x0007 0x0004 The active descendant of a component has changed. The active descendant is used in objects wit...
nsIAccessibleImage
out long x, out long y); void getImageSize(out long width, out long height); Methods getImagePosition() Returns the coordinates of the image accessible. This method is the same as nsIAccessible.getBounds() excepting coordinate origin parameter. void getImagePosition( in unsigned long coordType, out long x, out long y ); Parameters coordType Specifies coordinates origin (for available constants refer to nsIAccessibleCoordinateType). x The x coordinate of the image accessible position. y The y coordinate of the image accessible position. Exceptions thrown NS_ERROR_FAILURE Indicates that the accessible is unattached from the accessible tree. getImageSize() Returns the size of the image accessible. This method is the same as nsIAccessible.getBounds(). void getImageSize( out long width...
nsIAccessibleRelation
accessible/public/nsIAccessibleRelation.idlScriptable This interface gives access to an accessibles set of relations. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Note: Be carefull, do not change constants until ATK has a structure to map gecko constants into ATK constants. Method overview nsIAccessible getTarget(in unsigned long index); nsIArray getTargets(); Attributes Attribute Type Description relationType unsigned long Returns the type of the relation. Read only. targetsCount unsigned long Returns the number of targets for this relation. Read only. Constants Constan...
nsIAccessibleRetrieval
accessible relation as a string. AString getStringRelationType( in unsigned long aRelationType ); Parameters aRelationType The accessible relation type constant. Return value Accessible relation type presented as human readable string. getStringRole() Returns accessible role as a string. AString getStringRole( in unsigned long aRole ); Parameters aRole The accessible role constants. Return value Accessible role as a string. getStringStates() Returns a list which contains accessible states as strings. nsIDOMDOMStringList getStringStates( in unsigned long aStates, in unsigned long aExtraStates ); Parameters aStates Accessible states. aExtraStates Accessible extra states. Return value A list which contains accessible states as strings. See also Mozil...
nsIAccessibleRole
ROLE_TITLEBAR 1 Represents a title or caption bar for a window. It is used by MSAA only, supported automatically by MS Windows. ...
nsIAccessibleScrollType
1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Constants Constant Value Description SCROLL_TYPE_TOP_LEFT 0x00 Scroll the top left of the object or substring to the top left of the window (or as close as possible). SCROLL_TYPE_BOTTOM_RIGHT 0x01 Scroll the bottom right of the object or substring to the bottom right of the window (or as close as possible). SCROLL_TYPE_TOP_EDGE 0x02 Scroll the top edge of the object or substring to the top edge of the window (or as close as possible). ...
nsIAccessibleSelectable
oid addChildToSelection(in long index); void clearSelection(); nsIArray GetSelectedChildren(); boolean isChildSelected(in long index); nsIAccessible refSelection(in long index); void removeChildFromSelection(in long index); boolean selectAllSelection(); Attributes Attribute Type Description selectionCount long The number of accessible children currently selected. Read only. Constants Constant Value Description eSelection_Add 0 eSelection_Remove 1 eSelection_GetState 2 Methods addChildToSelection() Adds the specified accessible child of the object to the object's selection. If the specified object is already selected, then it does nothing. void addChildToSelection( in long index ); Parameters index The zero-based accessible child index. Exceptions throw...
nsIAccessibleStateChangeEvent
accessible/public/nsIAccessibleEvent.idlScriptable Please add a summary to this article. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Method overview boolean isEnabled(); boolean isExtraState(); Attributes Attribute Type Description state unsigned long Returns the state of accessible (see constants declared in nsIAccessibleStates). Read only. Methods isEnabled() boolean isEnabled(); Parameters None. Return value Returns true if the state is turned on. isExtraState() boolean isExtraState(); Parameters None. Return value Returns true if the state is extra state. ...
nsIApplicationCacheNamespace
tributes Attribute Type Description data ACString Data associated with the namespace, such as a fallback. How this attribute is used varies depending on the namespace type. If the data is a URI, this attribute should be the URI's asciiSpec. Read only. itemType unsigned long A bit field indicating one or more namespace types. Must be one or more of the constants defined under Constants on this page. Read only. namespaceSpec ACString The prefix of this namespace. This should be the asciiSpec of the URI prefix. Read only. Constants Constant Value Description NAMESPACE_BYPASS 1 Items matching this namespace can be fetched from the network when loading from this cache. The data attribute is not used. ...
nsIAsyncInputStream
king streams, it is not necessary that nsIInputStream.isNonBlocking() return true. Nor is it necessary that a non-blocking nsIInputStream implementation also implement nsIAsyncInputStream. Method overview void asyncWait(in nsIInputStreamCallback aCallback, in unsigned long aFlags, in unsigned long aRequestedCount, in nsIEventTarget aEventTarget); void closeWithStatus(in nsresult aStatus); Constants Constant Value Description WAIT_CLOSURE_ONLY (1<<0) If passed to asyncWait(), this flag overrides the default behavior, causing the OnInputStreamReady notification to be suppressed until the stream becomes closed (either as a result of closeWithStatus()/close being called on the stream or possibly due to some error in the underlying stream). Methods asyncWait() Asynchronously wait for the...
nsIAsyncOutputStream
g streams, it is not necessary that nsIOutputStream.isNonBlocking() return true. Nor is it necessary that a non-blocking nsIOutputStream implementation also implement nsIAsyncOutputStream. Method overview void asyncWait(in nsIOutputStreamCallback aCallback, in unsigned long aFlags, in unsigned long aRequestedCount, in nsIEventTarget aEventTarget); void closeWithStatus(in nsresult reason); Constants Constant Value Description WAIT_CLOSURE_ONLY (1<<0) If passed to asyncWait(), this flag overrides the default behavior, causing the OnOutputStreamReady notification to be suppressed until the stream becomes closed (either as a result of closeWithStatus()/close being called on the stream or possibly due to some error in the underlying stream). Methods asyncWait() Asynchronously wait for th...
nsIAuthPromptProvider
netwerk/base/public/nsIAuthPromptProvider.idlScriptable This interface requests a prompt interface for the given prompt reason. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Method overview 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. PROMPT_PROXY 1 Proxy authentication request. Methods getAuthPrompt() This method requests a prompt interface for the given prompt reason. void getAuthPrompt( in PRUint32 aPromptReason, in nsIIDRef iid, [iid_is(iid),retval] out nsQIResult result ); Parameters aPromptReason The reason for the authentication prompt, one of the PROMPT_* constants. iid The desired int...
nsIAutoCompleteListener
by the autocomplete session when the search is done or over. As of Gecko 1.9.1, can also be called with partial results, in a similar manner to the toolkit autocomplete interface. void onAutoComplete( in nsIAutoCompleteResults result, in nsIAutoCompleteStatus status ); Parameters result An nsIAutoCompleteResults object containing the (partial) results of the autocomplete. status One of the constants defined in the nsIAutoCompleteStatus interface. onStatus() Called by the autocomplete session during the search. This method does not seem to have ever been implemented. void onStatus( in wstring statusText ); Parameters statusText ...
nsICRLManager
void deleteCrl( in unsigned long crlIndex ); Parameters ...
nsICache
It does not represent an actual object. netwerk/cache/public/nsICache.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9 (Firefox 3) Inherits from: nsISupports Constants Constant Value Description ACCESS_NONE 0 ACCESS GRANTED - No descriptor is provided. ACCESS_READ 1 ACCESS REQUESTED - I only want to READ, if there isn't an entry just fail. ACCESS GRANTED - You can READ from this descriptor. ACCESS_WRITE 2 ACCESS REQUESTED - I have something new I want to WRITE into the cache, make me a new entry and doom the old one, if any. ACCESS GRANTED - You must WRITE to this descriptor because the cache entry was just created for you. ...
nsICachingChannel
about the cache entry is needed. For example, expiration time. offlineCacheClientID ACString The session into which to cache offline data. If not specified, data will be placed in "HTTP-offline". offlineCacheToken nsISupports The same as cacheToken but accessing the offline app cache token if there is any. Exceptions thrown NS_ERROR_NOT_AVAILABLE When there is not offline cache token. Constants Constant Value Description LOAD_NO_NETWORK_IO 1 << 26 This load flag inhibits fetching from the net. An error of NS_ERROR_DOCUMENT_NOT_CACHED will be sent to the listener's onStopRequest if network IO is necessary to complete the request. This flag can be used to find out whether fetching this URL would cause validation of the cache entry via the network. Combining this flag with LOAD_BYPAS...
nsIChannel
must be taken to explicitly drop its reference to the channel. securityInfo nsISupports Transport-level security information (if any, else null) corresponding to the channel, normally presented through the interfaces nsITransportSecurityInfo and nsISSLStatusProvider Read only. URI nsIURI The URI corresponding to the channel. Its value is immutable. Read only. Constants Channel specific load flags: Bits 23-31 are reserved for future use by this interface or one of its derivatives (For an example see nsICachingChannel). Constant Value Description LOAD_DOCUMENT_URI 16 Set (for example by the docshell) to indicate whether or not the channel corresponds to a document URI. LOAD_RETARGETED_DOCUMENT_URI 17 If the end cons...
nsIChannelEventSink
direct() method is called; this uses a callback to handle redirects asynchronously. Method overview 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 This is a temporary redirect. New requests for this resource should continue to use the URI of the old channel. The new URI may be identical to the old one. REDIRECT_PERMANENT 1 << 1 This is a permanent redirect. New requests for this resource should use the URI of the new channel (This...
nsIChromeRegistry
Converts a chrome URL into a canonical representation by ensuring that the filename portion o...
nsIClassInfo
can be created, or null. If the flags attribute has the SINGLETON bit set, then the value of this attribute specifies a ContractID through which this class may be accessed as a service using nsIServiceManager.getServiceByContractID(). Read only. flags PRUint32 Specifies various binary properties of this class. Possible values for this attribute include a bit-wise combination of the constants Read only. implementationLanguage Obsolete since Gecko 40 PRUint32 The language type in which this class is implemented. See nsIProgrammingLanguage.Constants for a list of possible values. Read only. Constants Bitflags for 'flags' attribute. Constant Value Description SINGLETON 1 << 0 The class is a singleton that must be accessed via nsIServi...
nsIClipboard
The kSelectionClipboard is peculiar to the X Windows System, where it refers to the PRIMARY selection, which is the one that simple mouse selection and middle-click paste operations are using. Constant Value Description kSelectionC...
nsIContentPrefCallback2
This will be called exactly once for each method invocation, and afterward no other callback methods will be called. void handleCompletion( in unsigned short reason ); Parameters reason One of the COMPLETE_* values...
nsIConverterInputStream
emented by: @mozilla.org/intl/converter-input-stream;1. To create an instance, use: var converterInputStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"] .createInstance(Components.interfaces.nsIConverterInputStream); Method overview 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. Methods init() Initialize this stream. void init( in nsIInputStream aStream, in string aCharset, in long aBufferSize, in PRUnichar aReplacementChar ); Parameters aStream The source stream which is read and converted. aCharset The character encoding to use for converting the bytes...
nsICookie
y. isSecure boolean true if the cookie was transmitted over ssl, false otherwise. Read only. name ACString The name of the cookie. Read only. path AUTF8String The path pertaining to the cookie. Read only. policy nsCookiePolicy Holds the sites compact policy value. Read only. status nsCookieStatus Holds the P3P status of cookie. Read only. value ACString The cookie value. Read only. Constants Constant Value Description STATUS_UNKNOWN 0 The cookie collected in a previous session, and its information no longer exists. available STATUS_ACCEPTED 1 The cookie was accepted. STATUS_DOWNGRADED 2 The cookie was accepted but downgraded to a session cookie. STATUS_FLAGGED 3 The cookie was not accepted. STATUS_REJECTED 4 The cookie was rejected. POLICY_UNKNOWN 0 The cookie collecte...
nsICookieAcceptDialog
Inherits from: nsISupports Last changed in Gecko 1.7 Constants Constant Value Description ACCEPT_COOKIE 0 Value for accepting a cookie object. REMEMBER_DECISION 1 Value for remembering a decision. HOSTNAME 2 Value for holding the hostname object. COOKIESFROMHOST 3 Value for holding the cookie from the host. ...
nsICookiePermission
These may be relocated somewhere else if ...
nsICookiePromptService
to ask to permission to accept the cookie. extensions/cookie/nsICookiePromptService.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9 (Firefox 3) Inherits from: nsISupports Method overview long cookieDialog(in nsIDOMWindow parent, in nsICookie cookie, in ACString hostname, in long cookiesFromHost, in boolean changingCookie, out boolean rememberDecision); Constants Constant Value Description DENY_COOKIE 0 Holds the value for a denying the cookie. ACCEPT_COOKIE 1 Holds the value for accepting the cookie. ACCEPT_SESSION_COOKIE 2 Holds the value for accepting the session cookie. Methods cookieDialog() Opens a dialog that asks for permission to accept a cookie. long cookieDialog( in nsIDOMWindow parent, in nsICookie cookie, in ACString hos...
nsICryptoHMAC
These values are to be used by the init() method to indicate which hashing function to use. These values map onto the values defined in mozilla/security/nss/lib/softoken/pkcs11t.h and are switched to CKM_*_HMAC constant. Constant Value Description MD2 1 Message Digest Algorithm 2 MD5 2 Message-Digest algorithm 5 SHA1 3 ...
nsIDOMChromeWindow
dow nsIBrowserDOMWindow The related nsIBrowserDOMWindow instance which provides access to yet another layer of utility functions by chrome script. It will be null for DOMWindows not corresponding to browsers. messageManager nsIChromeFrameMessageManager Read only. title DOMString Obsolete since Gecko 1.9.1 windowState unsigned short Returns current window state, the value is one of STATE_* constants. Read only. Constants Constant Value Description STATE_MAXIMIZED 1 The window is maximized. STATE_MINIMIZED 2 The window is minimized. STATE_NORMAL 3 The window is normal. STATE_FULLSCREEN 4 The window is in full screen mode. Methods beginWindowMove() On some operating systems, we must allow the window manager to handle window dragging. This method tells the window manager to st...
nsIDOMEvent
ed. Due to the fact that some systems may not provide this information the value of timeStamp may be not available for all events. When not available, a value of 0 will be returned. Examples of epoch time are the time of the system start or 0:0:0 UTC 1st January 1970. Read only. type DOMString The name of the event (case-insensitive). The name must be an XML name. Read only. Constants Constant Value Description NONE 0 The event is not being dispatched. CAPTURING_PHASE 1 The current event phase is the capturing phase. AT_TARGET 2 The event is currently being evaluated at the target EventTarget. BUBBLING_PHASE 3 The current event phase is the bubbling phase. MOUSEDOWN 0x00000001 ...
nsIDOMFileException
entation of this interface presently differs from the working draft of the File API specification. content/base/public/nsIDOMFileException.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9 (Firefox 3) Attributes Attribute Type Description code unsigned short The error code describing the error condition that took place; see the constants list for details. Constants Constant Value Description NOT_FOUND_ERR 0 The specified file wasn't found. NOT_READABLE_ERR 1 The specified file wasn't readable. See also nsIDOMFile nsIDOMFileList nsIDOMFileReader ...
nsIDOMGeoPositionError
ce represents an error that occurred while performing geolocation operations. dom/interfaces/geolocation/nsIDOMGeoPositionError.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0) Inherits from: nsISupports Attributes Attribute Type Description code short Numerical error code; see Error constants for a complete list. Read only. message DOMString Human readable error message. Read only. Gecko 1.9.2 note The message attribute was removed in Gecko 1.9.2 (Firefox 3.6). Error constants Constant Value Description PERMISSION_DENIED 1 The user denied permission to retrieve location data. POSITION_UNAVAILABLE 2 Unable to acc...
nsIDOMMouseScrollEvent
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 long Indicates which mouse wheel axis changed; this will be either HORIZONTAL_AXIS or VERTICAL_AXIS. Read only. Constants Constant Value Description HORIZONTAL_AXIS 1 The horizontal (X) axis. VERTICAL_AXIS 2 The vertical (Y) axis. Methods initMouseScrollEvent() Initializes the progress event object. void initMouseScrollEvent( in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIDOMAbstractVie...
nsIDOMMozNetworkStatsManager
nsIDOMDOMRequest getAvailableServiceTypes(); Attributes Attribute Type Description sampleRate long Minimum time in milliseconds between samples stored in the database. Read only. maxStorageAge long long Time in milliseconds recorded by the API until present time. All samples older than maxStorageAge from now are deleted. Read only. Constants Constant Type Description WIFI long Constant for WIFI, set to 0 MOBILE long Constant for MOBILE, set to 1 Methods getSamples() Asynchronously queries network interface statistics. The query may be filtered by connection type and date. nsIDOMDOMRequest getSamples(in nsISupports network, in jsval start, ...
nsIDOMNode
hild nsIDOMNode Read only. lastChild nsIDOMNode Read only. localName DOMString Read only. namespaceURI DOMString Read only. nextSibling nsIDOMNode Read only. nodeName DOMString Read only. nodeType unsigned short Read only. nodeValue DOMString ownerDocument nsIDOMDocument Read only. parentNode nsIDOMNode Read only. prefix DOMString previousSibling nsIDOMNode Read only. ...
nsIDOMOfflineResourceList
t the download process. onupdateready nsIDOMEventListener An event listener to be called when a resource update is ready; this event is not currently used since versioned application caches aren't supported yet. oncached nsIDOMEventListener An event listener to be called when caching is complete. status unsigned short One of the Application cache state constants indicating the status of the application cache. Constants Application cache state constants Constant Value Description UNCACHED 0 The object isn't associated with an application cache. IDLE 1 The application cache is not in the process of being updated. CHECKING 2 The application cache manifest is being fetched and checked for u...
nsIDOMXPathEvaluator
de A DOM Node to evaluate the XPath expression against. To evaluate against a whole document, use the document.documentElement. resolver A name space resolver created by createNSResolver(), or a user defined name space resolver. Read more on Implementing a User Defined Namespace Resolver if you wish to take the latter approach. type A number that corresponds to one of the type constants of nsIXPathResult. result An existing nsIXPathResult to use for the result. Using null will create a new nsIXPathResult. Return value An XPath result. See also Introduction to using XPath in JavaScript document.evaluate DOM Level 3 XPath Specification XML Path Language (XPath)REC nsIDOMXPathResult nsIDOMXPathException ...
nsIDOMXPathException
dom/interfaces/xpath/nsIDOMXPathException.idlScriptable Describes an exception resulting from XPath operations. Inherits from: nsISupports Last changed in Gecko 1.7 Attributes Attribute Type Description code unsigned short The error code; see Error codes for details. Constants Error codes Constant Value Description INVALID_EXPRESSION_ERR 51 An invalid XPath expression was used. TYPE_ERR 52 An attempt was made to reference an unavailable type. See also Introduction to using XPath in JavaScript Document Object Model (DOM) Level 3 XPath Specification nsIDOMXPathEvaluator document.evaluate nsIDOMXPathResult ...
nsIDOMXPathExpression
ate() Evaluate the XPath expression. nsISupports evaluate( in nsIDOMNode contextNode, in unsigned short type, in nsISupports result ); Parameters contextNode A DOM node to evaluate the XPath expression against. To evaluate against a whole document, use the document.documentElement method to get the node to evaluate against. type A number that corresponds to one of the type constants of nsIDOMXPathResult. result An existing nsIDOMXPathResult to use for the result. Using null will create a new nsIDOMXPathResult. Return value An XPath result. See also Introduction to using XPath in JavaScript nsIDOMXPathEvaluator document.evaluate Document Object Model (DOM) Level 3 XPath Specification nsIDOMXPathResult ...
nsIDialogCreator
ialogCreator.idlScriptable Please add a summary to this article. ...
nsIDirIndex
ed PRTime Last-modified time in seconds-since-epoch. If the last modified time is unknown, this value is -1. location string The fully qualified filename, expressed as a URI. This is encoded with the encoding specified in the nsIDirIndexParser, and is also escaped. size long long File size; if the size is unknown, this value is -1. type unsigned long The type of the entry; one of the TYPE_* constants. Constants Constant Value Description TYPE_UNKNOWN 0 The type is unknown. TYPE_DIRECTORY 1 The directory entry represents a directory. TYPE_FILE 2 The directory entry represents a file. TYPE_SYMLINK 3 The directory entry represents a symlink. See also nsIDirIndexListener nsIDirIndexParser ...
nsIDownload
in bytes, or LL_MAXUINT if the file's size is unknown. Read only. source nsIURI The source URI of the download. Read only. speed double The downloads transfer speed in bytes per second. Read only. startTime long long The time at which the transfer was started. Read only. state short The downloads current state. See nsIDownloadManager.Constants. Read only. target nsIURI The target of the transfer. Read only. targetFile nsILocalFile Indicates the location at which the downloaded file will be (or is, if the download is complete) stored. Read only. See also nsIDownloadManager nsIDownloadProgressListener nsIXPInstallManagerUI ...
nsIDownloadManager
lderList defines the default download location for files: 0: Files are downloaded to the desktop by default. 1: Files are downloaded to the system's downloads folder by default. 2: Files are downloaded to the local path specified by the browser.download.dir preference. If this preference is invalid, the download directory falls back to the default. Read only. Constants Constant Value Description DOWNLOAD_NOTSTARTED -1 The download has not been started yet. DOWNLOAD_DOWNLOADING 0 The download is in the process of being downloaded. DOWNLOAD_FINISHED 1 Download completed including any processing of the target file. DOWNLOAD_FAILED 2 The download failed due to error. DOWNLOAD_CANCE...
nsIDragService
DRAGDROP_ACTION_COPY 1 The drag and drop operation should copy the object. DRAGDROP_ACTION_MOVE 2 The drag and drop operation should move the object. DRAGDROP_ACTION_LINK 4 The drag and drop operation should link the object. DRAGDROP_ACTION_UNINITIALIZE...
nsIEditor
void addDocumentStateListener(in nsIDocumentStateListener listener); void removeDocumentStateListener(in nsIDocumentStateListener listener); Debug Methods void dumpContentTree(); void debugDumpContent() ; void debugUnitTests(out long outNumTests, out long outNumTestsFailed); [notxpcom] boolean isModifiableNode(in nsIDOMNode aNode); Constants Load Flags Constant Value Description eNone 0 eNext 1 ePrevious 2 eNextWord 3 ePreviousWord 4 eToBeginningOfLine 5 eToEndOfLine 6 Attributes Attribute Type Description contentsMIMEType string The MIME type of the doc...
nsIEventTarget
eiving events from other threads. 1.0 66 Introduced Gecko 1.6 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Method overview void dispatch(in nsIRunnable event, in unsigned long flags); boolean isOnCurrentThread(); void postEvent(in PLEventPtr aEvent); Native code only! Obsolete since Gecko 1.9 Constants Dispatch flags Constant Value Description DISPATCH_NORMAL 0 This flag specifies the default mode of event dispatch, whereby the event is simply queued for later processing. When this flag is specified, dispatch() returns immediately after the event is queued. DISPATCH_SYNC 1 This flag specifies the synch...
nsIFeed
textInput nsIWritablePropertyBag2 Information about a text box that can be displayed along with the feed by aggregators that support it, to allow the reader to send a response back to the source of the feed. Note: This field is almost never used, and is incompatible with many aggregators. type unsigned long Indicates the type of content presented by a feed. See Constants. Note: You should consider this a bit mask of values; at some point, the type may include more than one of these values ORed together. Read only. Constants Constant Value Description TYPE_FEED 0 A standard text-based feed. TYPE_AUDIO 1 An audio feed, such as a podcast. TYPE_IMAGE 2 An image feed, such as a photocast. TYP...
nsIFile
file because two volumes can have the same name (For example Mac). This is solved by holding "private", native data in the nsIFile implementation. This native data is lost when you convert to a string. DO NOT PASS TO USE WITH NSPR OR STDLIB! Read only. Exceptions thrown NS_ERROR_FILE_INVALID_PATH Indicates that this nsIFile does not reference a symbolic link. Constants Constant Value Description NORMAL_FILE_TYPE 0 A normal file. DIRECTORY_TYPE 1 A directory/folder. DELETE_ON_CLOSE 0x80000000 Optional parameter used by openNSPRFileDesc Methods append() This function is used for constructing a descendant of the current nsIFile. Note: This method does not return a new nsIFile; it modifies the ...
nsIFileInputStream
netwerk/base/nsIFileStreams.idlScriptable An input stream that allows you to read from a file. Inherits from: nsIInputStream Last changed in Gecko 1.7 Method overview void init(in nsIFile file, in long ioFlags, in long perm, in long behaviorFlags); 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. It may be removed before the stream is closed if it is possible to delete it and still read from it. If OPEN_ON_READ is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. CLOSE_ON_EOF 1<<2 If this is set, the file will close automatically when the end of the file is reached. ...
nsIFileStreams
The nsIFileStreams interface is an input stream that allows you to read from a file. netwerk/base/public/nsIFileStreams.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9 (Firefox 3) Inherits from: nsISupports Method overview void init(in nsIFile file, in long ioFlags, in long perm, in long behaviorFlags); Constants Constants Value Description DELETE_ON_CLOSE 1<<1 If this is set, the file will be deleted by the time the stream is closed. It may be removed before the stream is closed if it is possible to delete it and still read from it. If OPEN_ON_READ is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. CLOSE_ON_EOF 1<<2 If this is set, the file will close automatically when the end ...
nsIFocusManager
ull if no child window is focused. Setting the focusedWindow changes the focused window and raises the toplevel window it is in. If the current focus within the new focusedWindow is a frame element, then the focusedWindow will actually be set to the child window and the current element within that set as the focused element. This process repeats downwards until a non-frame element is found. Constants Constant Value Description FLAG_RAISE 1 FLAG_NOSCROLL 2 Do not scroll the element to focus into view. FLAG_NOSWITCHFRAME 4 If attempting to change focus in a window that is not focused, do not switch focus to that window. Instead, just update the focus within that window and leave the application focus as is. This flag will have no eff...
nsIHTMLEditor
utes Attribute Type Description isCSSEnabled boolean A boolean which is true is the HTMLEditor has been instantiated with CSS knowledge and if the CSS pref is currently checked. returnInParagraphCreatesNewParagraph boolean A boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at the caret. Constants Constant Value Description eLeft 0 eCenter 1 eRight 2 eJustify 3 Methods addDefaultProperty() Registers a default style property with the editor. void addDefaultProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue ); Parameters aProperty The property to set by default. aA...
nsIInstallLocation
tring The string identifier of this Install Location. Read only. priority long The priority level of this Install Location in loading. Read only. 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 privileges. Read only. Constants Constants representing priority of some default Install Locations. You should not use the exact values here, you should offset from these values each time you create a new Install Location. Offsetting can be brittle but you should know what Install Locations are being defined for your own application. Constant Value Description PRIORITY_APP_PROFILE 0 PRIORITY_APP_SYSTEM_USER 10 PRIOR...
nsIJumpListBuilder
ures are supported by the current host. Read only. isListCommitted boolean JumpList management. Indicates if a commit has already occurred in this session. Read only. Exceptions thrown NS_ERROR_NOT_AVAILABLE On all calls if taskbar functionality is not supported by the operating system. maxListItems short The maximum number of jump list items the current desktop can support. Read only. Constants Constant Value Description JUMPLIST_CATEGORY_TASKS 0 Tasks are common actions performed by users within the application. A task can be represented by an application shortcut and associated command line parameters or a URI. Task lists should generally be static lists that do not change often, if at all - similar to an application menu. Tasks are given the highest priority of all lists when s...
nsIJumpListItem
r other types of jump list items (an audio file, an email message, etc.). To add types, create the specific interface here, add an implementation class to WinJumpListItem, and add support to addListBuild and removed items processing. Method overview boolean equals(in nsIJumpListItem item); Attributes Attribute Type Description type short Retrieves the jump list item type. Read only. Constants Constant Value Description JUMPLIST_ITEM_EMPTY 0 Empty list item. JUMPLIST_ITEM_SEPARATOR 1 Separator. JUMPLIST_ITEM_LINK 2 Web link item. JUMPLIST_ITEM_SHORTCUT 3 Application shortcut. Methods equals() Compare this item to another. Compares the type and other properties specific to this item's type: separator - type link - type, uri, title shortcut - type, handler application boo...
nsILocalFile
some platforms, the value of nsIFile.path may be insufficient to uniquely identify the file on the local file system. The persistent descriptor is intended to be used whenever a nsILocalFile needs to be serialized to disk and later recovered. This string is not intended for display to users. Note: The value of the followLinks attribute is not encoded in the persistent descriptor. Constants Constant Value Description DELETE_ON_CLOSE 0x80000000 Optional parameter used by openNSPRFileDesc(). Methods Native code only! appendRelativeNativePath Appends a relative, native character encoding, path to the current path of the nsILocalFile object. void appendRelativeNativePath( in ACString relativeFilePath ); Parameters relativeFilePath A...
nsILocalFileMac
ead only. bundleIdentifier AUTF8String Returns the identifier of the bundle. Read only. fileCreator OSType Native code only! fileSizeWithResFork PRInt64 Returns the combined size of both the data fork and the resource fork (if present) rather than just the size of the data fork as returned by GetFileSize() Read only. fileType OSType File type and creator attributes. Native code only! Constants Constant Value Description CURRENT_PROCESS_CREATOR 0x8000000 Use with SetFileType() to specify the signature of current process. Obsolete since Gecko 2.0 Methods Native code only!getCFURL Note: Observes the state of the followLinks attribute. If the file object is an alias and followLinks is true, returns the target of the alias. If followLinks is false, returns the unresolved alias file.
nsIMsgDBView
ndex(in nsMsgViewIndex aIndex, in boolean aAugment); void addColumnHandler(in AString aColumn, in nsIMsgCustomColumnHandler aHandler); void removeColumnHandler(in AString aColumn); nsIMsgCustomColumnHandler getColumnHandler(in AString aColumn); Attributes Attribute Type Description viewType nsMsgViewTypeValue Readonly: Type of view. Constants are defined in nsMsgViewType. viewFlags nsMsgViewFlagsTypeValue Constants are defined in nsMsgViewFlagsType. sortType nsMsgViewSortTypeValue The type of sort being used (i.e. author, date, status, etc). Sort types are defined in nsMsgViewSortType. sortOrder nsMsgViewSortOrderValue Readonly: Constants are defined in nsMsgViewSortOrder. keyForFi...
nsIMsgFolder
low subfolders. For example, newsgroups cannot have subfolders, and the INBOX on some IMAP servers cannot have subfolders. canRename boolean Readonly: Can you change the name of this folder. For example, newsgroups and some special folders can't be renamed. canCompact boolean readonly: rootFolder nsIMsgFolder Readonly: The phantom server folder. Constants Constant Value Description nsMsgBiffState_NewMail 0 User has new mail waiting. nsMsgBiffState_NoMail 1 No new mail is waiting. nsMsgBiffState_Unknown 2 We dunno whether there is new mail. nsMsgDispositionState_None -1 nsMsgDispositionState_Replied 0 nsMsgDispositionState_Forwarded 1 ...
nsIMsgIncomingServer
y. serverURI ACString Read only. socketType long spamFilterPlugin nsIMsgFilterPlugin Read only. spamSettings nsISpamSettings spam settings. Read only. supportsDiskSpace boolean Read only. type ACString protocol type, that is "pop3", "imap", "nntp", "none", and so on. used to construct URLs. username ACString userid to log into the server. useSecAuth boolean valid boolean Constants Constant Value Description defaultSocket 0 tryTLS 1 alwaysUseTLS 2 useSSL 3 keepDups 0 deleteDups 1 moveDupsToTrash 2 markDupsRead 3 Methods clearAllValues() this is really dangerous. this destroys all pref values do not call this unless you know what you're doing! void clearAllValues(); Parameters None. Exceptions thrown Missing Exception Missing Description clea...
nsIMsgSearchSession
e Type Description searchTerms nsISupportsArray Readonly: numSearchTerms unsigned long Readonly: runningAdapter nsIMsgSearchAdapter Readonly: searchParam voidPtr Not scriptable and readonly: searchType nsMsgSearchType Readonly: numResults long Readonly: window nsIMsgWindow Constants Name Value Description BooleanOR 0 BooleanAND 1 Methods addSearchTerm() void addSearchTerm(in nsMsgSearchAttribValue attrib, in nsMsgSearchOpValue op, in nsIMsgSearchValue value, in boolean BooleanAND, in string arbitraryHeader); Parameters attrib Attri...
nsINavHistoryContainerResultNode
re is no such API, this value is an empty string. Read only. The container may be a RESULT_TYPE_REMOTE_CONTAINER node that has been dynamically generated by the remote container API, or a bookmark folder (RESULT_TYPE_FOLDER) for which some service (such as livemarks) has registered to provide certain operations. state unsigned short The current state of the container. This is one of the state constants. Constants State constants Constant Value Description STATE_CLOSED 0 The container is closed. STATE_LOADING 1 The container has been opened asynchronously, but is still loading and is not all the way opened yet. STATE_OPENED 2 The container is open. Methods findNodeByDetails() Returns a node matching specified details. nsINavHistoryResultNode findNodeByDetails( in AUTF8Stri...
nsINavHistoryFullVisitResultNode
nto a separate query type for efficiency. Attributes Attribute Type Description referringVisitId long long The referring visit ID; the referrer should have the same session ID as the visit described by this record. Read only. transitionType long Indicates the type of transition for the visit. This will be one of the nsINavHistoryService.Transition type constants. Read only. visitId long long The visit ID of the visit. Read only. See also nsINavHistoryVisitResultNode nsINavHistoryResultNode nsINavHistoryService ...
nsINavHistoryResultNode
1. The result implementation treats nodes with this property set to -1 as invisible! View-implementations may use this value to track the node index in the view, for example the tree view uses this value to indicate the row in the tree that this node is at. Other views may choose not to use this, but should inititalize this value to anything but -1 for visible nodes. Obsolete since Gecko 1.9.2 Constants Constant Value Description RESULT_TYPE_URI 0 nsINavHistoryResultNode. RESULT_TYPE_VISIT 1 nsINavHistoryVisitResultNode. RESULT_TYPE_FULL_VISIT 2 nsINavHistoryFullVisitResultNode. RESULT_TYPE_DYNAMIC_CONTAINER 4 nsINavHistoryContainerResultNode. RESULT_TYPE_QUERY 5 nsINavHistoryQueryResultNode. RESULT_TYPE_FOLDER 6 nsINavHistoryQueryResultNode. RESULT_TYPE_SEPARATOR 7 nsINavHistor...
nsINavHistoryResultObserver
ch was opened. containerStateChanged() Called when a container node's state changes. void containerStateChanged( in nsINavHistoryContainerResultNode aContainerNode, in unsigned long aOldState, in unsigned long aNewState ); Parameters aContainerNode The container node whose state changed. aOldState The prior state of the node; this will be one of the nsINavHistoryContainerResultNode.State constants. aNewState The new state of the node; this is one of the nsINavHistoryContainerResultNode.State constants. invalidateContainer() Called when something has happened that requires that the contents of a container be rebuilt. void invalidateContainer( in nsINavHistoryContainerResultNode aContainerNode ); Parameters aContainerNode The container that should be rebuilt. nodeAnnotationChanged() Ca...
nsINavHistoryResultTreeViewer
rce a tree refresh. Obsolete since Gecko 1.9 flatItemCount PRUint32 This tells you how many items are in the flattened list of results, that is how many rows are in this tree right now. The tree adaptor will also QI to nsITreeView, and this will be the same as nsITreeView.rowCount. This is only valid when a tree is attached, the result will be 0 otherwise. Read only. Obsolete since Gecko 1.9 Constants Constant Value Description INDEX_INVISIBLE 0xffffffff Returned by treeIndexForNode() when the requested node isn't visible (such as when its parent is collapsed). Also returned if there is no tree attached. Methods nodeForTreeIndex() Returns the node for a given row index. This is only valid when a tree is attached. nsINavHistoryResultNode nodeForTreeIndex( in unsigned long aIndex ); P...
nsINavHistoryResultViewObserver
DROP_ON 0 The drag operation wishes to drop the dragged item onto the indicated row. DROP_AFTER 1 The drag operation wishes to insert the dragged item after the indicated row. Methods canDrop() Implement this met...
nsINavHistoryResultViewer
em previously at the specified index (if any) as well as everything below it, is shifted down by one. sortingChanged() Called when the sorting order is changed to a particular mode. For trees, this would update the column headers to reflect the altered sorting. void sortingChanged( in unsigned short sortingMode ); Parameters sortingMode One of the nsINavHistoryQueryOptions.SORT_BY_* constants, indicating the softing mode. Remarks This method is only called to update the sorting user interface. invalidateAll() is called as well if the sorting changes, in order to cause the contents to update properly. See also nsINavHistoryResult, nsITreeView, Displaying Places information using views ...
nsINavHistoryService
used in UI to determine whether the "clear history" button should be enabled or not. This is much better than using BrowserHistory.count since that can be very slow if there is a lot of history (it must enumerate each item). This is pretty fast. historyDisabled boolean True if history is disabled. currently, history is disabled if the browser.history_expire_days pref is "0". Constants Transition type constants Constant Value Description TRANSITION_LINK 1 This transition type means the user followed a link and got a new toplevel window. TRANSITION_TYPED 2 This transition type is set when the user typed the URL to get to the page. TRANSITION_BOOKMARK 3 This transition type is set when the user followed a bookmark to g...
nsINetworkLinkService
ink is down during DHCP configuration (unless there is another usable interface already configured). If the link status is not currently known, we generally assume that it is up. Read only. linkStatusKnown boolean This is set to true when we believe that isLinkUp is accurate. Read only. linkType unsigned long The type of network connection, one of the LINK_TYPE_* constants. Read only. Note: As of Gecko 8.0, all Operating Systems currently return LINK_TYPE_UNKNOWN. Android support was backed out due to perceived security concerns, see bug 691054. As of Gecko 28.0 Android support is available again, see bug 939680. Constants Constant Value Description LINK_TYPE_UNKNOWN 0 We were unable to determine the netw...
nsIParserUtils
SanitizerAllowStyle (1 << 1) Flag for sanitizer: Allow <style> elements and style attributes (with contents sanitized in case of -moz-binding). Note: If -moz-binding is absent, properties that might be XSS risks in other Web engines are preserv...
Component; nsIPrefBranch
aValue); void setComplexValue(in string aPrefName, in nsIIDRef aType, in nsISupports aValue); void setIntPref(in string aPrefName, in long aValue); void unlockPref(in string aPrefName); Attributes Attribute Type Description root string Called to get the root on which this branch is based, such as "browser.startup." Read only. Constants Constant Value Description PREF_INVALID 0 long PREF_STRING 32 long data type. PREF_INT 64 long data type. PREF_BOOL 128 long data type. Methods addObserver() Adds a preference change observer. On preference changes, the following arguments will be passed to nsIObserver.observe(): aSubject - The nsIPrefBranch obj...
nsIPrincipal
e a number of different names all concatenated together with some information on what they mean in between). Throws if there is no certificate associated with this principal. Read only. URI nsIURI The codebase URI to which this principal pertains. This is generally the document URI. Read only. Note: This wasn't accessible by scripts prior to Gecko 2.0. Constants Principal capability constants These values indicate the capabilities of a principal. The order is significant; if an operation is performed on a set of capabilities, the minimum is computed. Constant Value Description ENABLE_DENIED 1 ENABLE_UNKNOWN 2 ENABLE_WITH_USER_PERMISSION 3 ENABLE_GRANTED 4 Methods Nat...
nsIProfileUnlocker
profile/public/nsIProfileUnlocker.idlScriptable Returned by the nsIToolkitProfile.lock method; you can use this to attempt to force a profile to be unlocked. 1.0 66 Introduced Gecko 1.8 Inherits from: nsISupports Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Method overview void unlock(in unsigned long aSeverity); Constants Constant Value Description ATTEMPT_QUIT 0 Politely ask the process currently holding the profile's lock to quit. FORCE_QUIT 1 Forcibly terminate the process holding the profile lock. Methods unlock() Tries to unlock the profile by attempting or forcing the process that currently holds the lock to quit. void unlock( in unsigned long aSeverity ); Param...
nsIProgrammingLanguage
xpcom/base/nsIProgrammingLanguage.idlScriptable This interface provides an enumeration of programming language identifiers. Inherits from: nsISupports Last changed in Gecko 0.9.5 Constants Identifiers for programming languages. Constant Value Description UNKNOWN 0 CPLUSPLUS 1 C++ JAVASCRIPT 2 JavaScript PYTHON 3 Python PERL 4 Perl JAVA 5 Java ZX81_BASIC 6 ZX81 Basic JAVASCRIPT2 7 JavaScript 2 RUBY 8 Ruby PHP 9 PHP TCL 10 TCL MAX 10 This will be kept at the largest index. ...
nsIProtocolHandler
Firefox 3, one of URI_LOADABLE_BY_ANYONE, URI_DANGEROUS_TO_LOAD, URI_IS_UI_RESOURCE, or URI_IS_LOCAL_FILE must be set on every protocol handler. Current versions of Firefox assume that the URI has URI_LOADABLE_BY_ANYONE set, but this will not work starting with the Mozilla 2 platform. scheme ACString The scheme for this protocol ("file", "http", and so forth). Read only. Constants Constant Value Description URI_STD 0 A standard full URI with authority component and understanding relative URIs; this includes http and ftp, for example. URI_NORELATIVE 1<<0 The protocol doesn't support relative URIs (for example, about and javascript). URI_NOAUTH 1<<1 The protocol doesn't have an authority component (for example, fil...
nsIProtocolProxyService
Proxy Auto Config (PAC) may perform a synchronous DNS query, which may not return immediately. So, calling resolve without this flag may result in locking up the calling thread for a lengthy period of ti...
nsIProxyInfo
p" - HTTP proxy (or SSL CONNECT for HTTPS) "socks" - SOCKS v5 proxy "socks4" - SOCKS v4 proxy "direct" - no proxy "unknown" - unknown proxy (see nsIProtocolProxyService.resolve()) A future version of this interface may define additional types. Read only. Note: Prior to Gecko 1.8 type was available by the type method. Constants The following "Proxy Flags" may be bit-wise combined to construct the flags attribute defined on this interface. All unspecified bits are reserved for future use. Constant Value Description TRANSPARENT_PROXY_RESOLVES_HOST 1 << 0 This flag is set if the proxy is to perform name resolution itself. If this is the case, the hostname is used in so...
nsIRequest
oup. loadGroup nsILoadGroup The load group of this request. While pending, the request is a member of the load group. It is the responsibility of the request to implement this policy. name AUTF8String The name of the request. Often this is the URI of the request. Read only. status nsresult The error status associated with the request. Read only. Constants Various load flags which may be or'd together. Constant Value Description LOAD_NORMAL 0 No special load flags. LOAD_BACKGROUND 1 << 0 Do not deliver status notifications to the nsIProgressEventSink, or keep this load from completing the nsILoadGroup it may belong to. The following flags control the flow of data into the cache. Consta...
nsISHistoryListener
r false to cancel it. OnHistoryReload() Called when the current document is reloaded, for example due to an nsIWebNavigation.reload() call. boolean OnHistoryReload( in nsIURI aReloadURI, in unsigned long aReloadFlags ); Parameters aReloadURI The URI of the document to be reloaded. aReloadFlags Flags that indicate how the document is to be refreshed. See the nsIWebNavigation interface's load constants. Return value true to allow the reload operation to proceed or false to cancel it. ...
nsIScriptError2
le on which the error occurred. You are responsible for providing that line. You may pass null if you are lazy; that will prevent showing the source line in JavaScript Console. lineNumber The number of the line where the error occurred. columnNumber The column number where the error occurred. This is used to draw an arrow pointing to the problem character. flags One of the script error flag constants. category A string indicating what kind of code caused the message. There are quite a few category strings and they don't seem to be listed in a single place. See Categories for a partial list. innerWindowID The ID of the inner window associated with the error. Prior to Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6), this was the outer window ID. ...
nsIScrollable
Constant Value Description ScrollOrientation_X 1 Horizontal scrolling. When passing this in to a method you are requesting or setting data for the horizontal scrollbar. ScrollOrientation_Y 2 Vertical scrolling. When passing this in to a method you are requesting or setting data for the vert...
nsIStackFrame
Filename location. This is the location that caused the error, which may or may not be a source file location. For example, standard language errors would generally have the same location as their top stack entry. File parsers may put the location of the file they were parsing, and so forth. null indicates "no data" Read only. language PRUint32 See nsIProgrammingLanguage for a list of language constants. Read only. languageName string See nsIProgrammingLanguage for a list of language constants. Read only. lineNumber PRInt32 Valid line numbers begin at '1'. '0' indicates unknown. Read only. name string The name of the function at this point in the stack. Read only. sourceLine string The location of this function in filename Read only. Example To output the stack at a particular locatio...
type
information is now located at: nsISupportsPrimitive.Constants ...
nsISupportsPrimitive
xpcom/ds/nsISupportsPrimitives.idlScriptable This interface serves as a base interface for all of the nsISupports* family of interfaces. Inherits from: nsISupports Last changed in Gecko 1.7 Attributes Attribute Type Description type unsigned short This attribute provides access to the type represented by the nsISupportsPrimitive instance. Constants Constant Value Description TYPE_ID 1 Corresponding to nsISupportsID. TYPE_CSTRING 2 Corresponding to nsISupportsCString. TYPE_STRING 3 Corresponding to nsISupportsString. TYPE_PRBOOL 4 Corresponding to nsISupportsPRBool. TYPE_PRUINT8 5 Corresponding to nsISupportsPRUint8. TYPE_PRUINT16 6 Corresponding to nsISupportsPRUint16. TYPE_PRUINT32 7 Corresponding to nsISupportsPRUint32. TYPE_PRUINT64 8 Corresponding to n...
nsISupportsPriority
e object's priority. It can be modified to change the priority of the object. Typical priority values are defined in the idl file as PRIORITY_HIGHEST ... PRIORITY_LOWEST. The implementation is free to truncate a given priority value to whatever limits are appropriate. Typically this attribute is initialized to PRIORITY_NORMAL, but implementations may choose to assign a different initial value. Constants Constant Value Description PRIORITY_HIGHEST -20 The highest priority. PRIORITY_HIGH -10 Higher than normal priority. PRIORITY_NORMAL 0 The default priority. PRIORITY_LOW 10 Lower than normal priority. PRIORITY_LOWEST 20 The lowest priority. Methods adjustPriority() This method adjusts the priority attribute by a given amount (delta). void adjustPriority( in long delta ); Parame...
nsITaskbarWindowPreview
in unsigned long index); Attributes Attribute Type Description enableCustomDrawing boolean If true, the nsITaskbarPreviewController object's nsITaskbarPreviewController.drawPreview() and nsITaskbarPreviewController.drawThumbnail() methods will be called to draw the preview. If false, the operating system draws these for you. Constants Constant Value Description NUM_TOOLBAR_BUTTONS 7 The maximum number of toolbar buttons supported by the Windows Taskbar API. Methods getButton() Returns the specified button from the preview's toolbar. Note: By default, all buttons are hidden. You must fetch and configure each button that you want to make visible. nsITaskbarPreviewBu...
nsITelemetry
ize max - Maximum bucket size histogram_type - HISTOGRAM_EXPONENTIAL or HISTOGRAM_LINEAR counts - An array representing the values of buckets in the histogram. ranges - An array with corresponding bucket sizes. sum - Sum of the counts array. static - true for histograms defined in Histograms.json, false for ones defined with newHistogram(). Read only. Constants Histogram Types Constant Value Description HISTOGRAM_EXPONENTIAL 0 Buckets increase exponentially. HISTOGRAM_LINEAR 1 Buckets increase linearly. HISTOGRAM_BOOLEAN 2 For storing 0/1 values. HISTOGRAM_FLAG 3 For storing a single value; its count is always == 1. HISTOGRAM_COUNT 4 For storing counter values ...
nsIToolkitProfileService
ager was able to access the toolkit profile service. To access the built-in profile manager in versions of Firefox up to 4.0 and Thunderbird up to 3.3 you can launch with the -profilemanager command line flag. Future versions will require the separate Profile Manager application. Warning: This service is synchronous so it is recommended that you use OS.File to find the profile directory via OS.Constants.Path.profileDir. OS.File is available from Gecko 18 (Firefox 18.0 / Thunderbird 18.0 / SeaMonkey 2.15). Method overview nsIToolkitProfile createProfile(in nsILocalFile aRootDir, in AUTF8String aName); void flush(); nsIToolkitProfile getProfileByName(in AUTF8String aName); nsIProfileLock lockProfilePath(in nsILocalFile aDirectory, in nsILocalFile aTempDirec...
nsITransferable
doing so may cause it not to actually reflect the status of the context in which the transferable was created. Native code only! requestingNode nsIDOMNode The source DOM Node this transferable was created from. Native code only! Note: Currently, this can only be used on Windows (in order to support network principal information in drag operations). Constants kFlavorHasDataProvider (that title needs to be better) Constant Value Description kFlavorHasDataProvider 0 A description is needed here. Common MIME types Some of these need better descriptions, especially the Mozilla-specific ones. Constant Value Description kTextMime text/plain Plain text. kUnicodeMime text/...
nsITransport
rt specifics. Method overview 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. Constant Value Description OPEN_BLOCKING 1<<0 Open flags. OPEN_UNBUFFERED 1<<1 Generic nsITransportEventSink status codes. nsITransport implementations may override these status codes with their own more specific status codes (for example, see nsISocketTransport). Constant Value Description STATUS_READING 0x804b0008 STATUS_WRITING 0x804b0009 Methods close() C...
nsITreeColumn
nsITreeColumn in displayed order. Read only. primary boolean If true the nsITreeColumn is the primary column. If the primary attribute is not set, the column is not the primary column. Read only. selectable boolean If true the nsITreeColumn is able to be selected. If the selectable attribute is not set, the column cells are not selectable. Read only. type short The type of the column, see constants. Read only. width long The width of nsITreeColumn. Read only. x long The X position in the tree of the left edge of the nsITreeColumn. Read only. Constants Constant Value Description TYPE_TEXT 1 Text column type. TYPE_CHECKBOX 2 Checkbox column type. TYPE_PROGRESSMETER 3 Progress meter column type. Methods Native code only!getIdConst void getIdConst( [shared] out wstring idCo...
nsIURIFixup
FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP 1 Allow the fixup to use a keyword lookup service to complete the URI. The fixup object implementer should honour this flag and only perform any lengthy keyword (or search) operation if it is set. FIXUP_FLAGS_MAKE_ALTERNATE_URI 2 Tell the fixup ...
nsIWebBrowserChrome
webBrowser nsIWebBrowser The currently loaded WebBrowser. The browser chrome may be told to set the WebBrowser object to a new object by setting this attribute. In this case the implementer is responsible for taking the new WebBrowser object and doing any necessary initialization or setup as if it had created the WebBrowser itself. This includes positioning setting up listeners etc. Constants Constant Value Description STATUS_SCRIPT 1 Flag for SetStatus() STATUS_SCRIPT_DEFAULT 2 Flag for SetStatus() STATUS_LINK 3 Flag for SetStatus() CHROME_DEFAULT 1 Value for the chromeFlags attribute. CHROME_WINDOW_BORDERS 2 Value for the chromeFlags attribute. CHROME_WINDOW_CLOSE 4 Value for the...
nsIWebBrowserPersist
progressListener nsIWebProgressListener Callback listener for progress notifications. The object that the embbedder supplies may also implement nsIInterfaceRequestor and be prepared to return nsIAuthPrompt or other interfaces that may be required to download data. result unsigned long Value indicating the success or failure of the persist operation. Read only. Constants Constant Value Description PERSIST_FLAGS_NONE 0 No special persistence behavior. PERSIST_FLAGS_FROM_CACHE 1 Only use cached data (could result in failure if data is not cached). PERSIST_FLAGS_BYPASS_CACHE 2 Bypass the cached data. PERSIST_FLAGS_IGNORE_REDIRECTED_DATA 4 Ignore any redirected data (usually adverts). ...
nsIWebNavigation
need to use @mozilla.org/docshell;1 instead. Method overview 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 Description LOAD_FLAGS_MASK 65535 This flag defines the range of bits that may be specified. LOAD_FLAGS_NONE 0 This is the default value for the load flags parameter. LOAD_FLAGS_IS_REFRESH 16 This flag specifies that the load should have the semantics of an HTML Meta-refresh tag (That is, that the cache should...
nsIWebProgress
istener aListener); Attributes Attribute Type Description DOMWindow nsIDOMWindow The DOM window associated with this nsIWebProgress instance. Read only. Exceptions thrown NS_ERROR_FAILURE Indicates that there is no associated DOM window. isLoadingDocument PRBool Indicates whether or not a document is currently being loaded in the context of this nsIWebProgress instance. Read only. Constants The following flags may be combined to form the aNotifyMask parameter for the addProgressListener() method. They limit the set of events that are delivered to an nsIWebProgressListener instance. These flags indicate the state transistions to observe, corresponding to nsIWebProgressListener.onStateChange(). Constant Value Description NOTIFY_STATE_REQUEST 0x00000001 Only receive the nsIWebProg...
nsIWebProgressListener
These flags are mutually exclusive. For any given request, onStateChange() is called once with the STATE_START flag, zero or more times with the STATE_TRANSFERRING flag or once with the STATE_REDIRECTING flag, and then finally once with the STATE_STOP flag. Note: For d...
nsIXPCScriptable
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 behavior of this object. Constants Constant Value Description WANT_PRECREATE 1 << 0 WANT_CREATE 1 << 1 WANT_POSTCREATE 1 << 2 WANT_ADDPROPERTY 1 << 3 WANT_DELPROPERTY 1 << 4 WANT_GETPROPERTY 1 << 5 WANT_SETPROPERTY 1 << 6 WANT_ENUMERATE 1 << 7 WANT_NEWENUMERATE 1 << 8 Indicates that the object wants to have its newEnumerate method called. WANT_NEWRESOLVE 1 << 9 Indicates that the object wan...
nsIXPConnect
tes Attribute Type Description collectGarbageOnMainThreadOnly PRBool Obsolete since Gecko 1.9 CurrentJSStack nsIStackFrame Read only. CurrentNativeCallContext nsAXPCNativeCallContextPtr Read only. deferReleasesUntilAfterGarbageCollection PRBool Obsolete since Gecko 1.9 PendingException nsIException Constants Constant Value Description INIT_JS_STANDARD_CLASSES 1 << 0 FLAG_SYSTEM_GLOBAL_OBJECT 1 << 1 OMIT_COMPONENTS_OBJECT 1 << 2 XPC_XOW_CLEARSCOPE 1 Tells updateXOWs() to clear the scope of all of the XOWs it finds. Obsolete since Gecko 2.0 Methods Native code only!addJSHolder Root JS objects held by aHolder. vo...
nsIXULSortService
Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. Used internally for insertion sorting. void insertContainerNode( in nsIRDFC...
nsIXULWindow
, or a browser object. Or down the road any other object that supports being a DocShellTreeItem Query accordingly to determine the capabilities. Read only. XULBrowserWindow nsIXULBrowserWindow Provides access to the XULBrowserWindow object offering a way for the browser to update the user interface of the enclosing XUL window. zLevel unsigned long One of the Z level constants below. On some platforms, windows with a higher zLevel will be kept above windows with a lower zLevel. Constants Constant Value Description lowestZ 0 loweredZ 4 The Z level of an independent window opened with the "alwaysLowered" chrome flag. normalZ 5 The default Z level of an independent window. raisedZ 6 The Z...
nsIZipReader
his code in scratchpad to run it. ...
nsMsgMessageFlags
Replied 0x00000002 Indicates whether or not the message has been replied to. ...
nsMsgViewCommandType
For example to mark a message read, you would call: // assuming gDBView is a global nsIMsgDBView gDBView.doCommand(Components.interfaces.nsMsgViewCommandType.markMessagesRead); mailnews/base/public/nsIMsgDBView.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9 (Firefox 3) Constants Name Value Description markMessagesRead 0 Marks the selected messages as read. markMessagesUnread 1 Mark the selected messages as unread toggleMessageRead 2 Toggle the read flag of the selected messages flagMessages 3 Flag the selected messages. unflagMessages 4 Unflag the selected messages. ...
nsMsgViewFlagsType
The nsMsgViewFlagsType interface contains constants used for view flags in Thunderbird. This interface isn't ever implemented. It is only used to store constants. For example, the 'unread only' view would use the flag: Components.interfaces.nsMsgViewFlagsType.kUnreadOnly Constants Name Value Description kNone 0x0 kThreadedDisplay 0x1 kShowIgnored 0x8 kUnreadOnly 0x10 kExpandAll 0x20 kGroupBySort 0x40 ...
nsMsgViewType
The nsMsgViewType interface contains constants used for views in Thunderbird. This interface isn't ever implemented. It is only used to store constants. For example, to request the 'show all threads' view use the constant: Components.interfaces.nsMsgViewType.eShowAllThreads Constants Name Value Description eShowAllThreads 0 eShowThreadsWithUnread 2 eShowWatchedThreadsWithUnread 3 eShowQuickSearchResults 4 eShowVirtualFolderResults 5 eShowSearch 6 ...
Storage
c(). This method will manage the transactions for you, so you don't have to worry about them. Note: The database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception. Transactions can be started with mozIStorageConnection.beginTransaction() or mozIStorageConnection.beginTransactionAs(). The latter takes one of three constants to describe the type of transaction: mozIStorageConnection.TRANSACTION_DEFERRED mozIStorageConnection.TRANSACTION_IMMEDIATE mozIStorageConnection.TRANSACTION_EXCLUSIVE mozIStorageConnection.beginTransaction() is equivalent to calling mozIStorageConnection.beginTransactionAs() and passing mozIStorageConnection.TRANSACTION_DEFERRED. In general, this is the method you want to use. Once you s...
nsIMsgCloudFileProvider
-1. remainingFileSpace long long Readonly: The remaining storage space available for this account in bytes. If this value is not known, returns -1. fileSpaceUsed long long Readonly: The total amount of space used by this account. If this value is not known, returns -1. lastError ACString Readonly: The last error message received from the server. Constants The following constants are used for the status codes passed to the onStopRequest functions of the nsIRequestObserver's used by the asynchronous methods of nsIMsgCloudFileProvider. Constant Value Description offlineErr 0x80550014 Returned when it appears that there is no active network connection. authErr 0x8055001e Returned when authorizing has fail...
Activity Manager examples
an activity with a custom context type This sample shows how to provide a custom context type for junk processing. As a result, all junk processing activities (assuming that we process accounts in parallel) dealing with messages coming from the same sender will be grouped together. ...
Using COM from js-ctypes
romArr = IIDFromArr = function(jsArr_pieces) { let guid = GUID(); // CLSID and IID are same they are GUID guid.Data1 = parseInt(jsArr_pieces[0], 16); guid.Data2 = parseInt(jsArr_pieces[1], 16); guid.Data3 = parseInt(jsArr_pieces[2], 16); let j = 2; for (let i=0; i<8; i++) { j++; guid.Data4[i] = parseInt(jsArr_pieces[j], 16); }; return guid; } // CONSTANTS let COINIT_MULTITHREADED = 0; let COINIT_APARTMENTTHREADED = 2; let CLSCTX_ALL = 0x17; let CLSID_SpVoice = CLSIDFromArr(['0x96749377', '0x3391', '0x11D2', '0x9E', '0xE3', '0x00', '0xC0', '0x4F', '0x79', '0x73', '0x96']); let IID_ISpVoice = IIDFromArr(['0x6C44DF74', '0x72B9', '0x4992', '0xA1', '0xEC'...
Examples
I from js-ctypes An example how to use Java from js-ctypes, by converting Java code into C code. js-macosx An extension that demonstrates JavaScript-Cocoa Bridge for Mac OS X. Lightweight bridge for calling Cocoa frameworks from JavaScript, js-macosx transparently handles definition of Cocoa API, both C and Objective-C, and provides automatic declarations for framework functions, structures, constants and enumerations, as well as allows creating and subclassing Cocoa classes. The js-macosx bridge has dependency on BridgeSupport metadata: whenever a Cocoa class, function, struct or const is encountered in the JavaScript code, js-macosx will replace it with the corresponding js-ctypes declaration based on the BridgeSupport file from the framework that object belongs to. ...
Using js-ctypes
; var SInt32 = ctypes.long; var VOID = ctypes.void_t; var __CFString = new ctypes.StructType("__CFString"); var CFStringRef = __CFString.ptr; var __CFURL = new ctypes.StructType("__CFURL"); var CFURLRef = __CFURL.ptr; var __CFAllocator = new ctypes.StructType("__CFAllocator"); var CFAllocatorRef = __CFAllocator.ptr; var UniChar = ctypes.jschar; // uint16 with automatic conversion // DEFINE CONSTANTS var kCFUserNotificationStopAlertLevel = 0; var kCFUserNotificationNoteAlertLevel = 1; var kCFUserNotificationCautionAlertLevel = 2; var kCFUserNotificationPlainAlertLevel = 3; // DECLARE FUNCTIONS /* https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFUserNotificationRef/index.html#//apple_ref/c/func/CFUserNotificationDisplayNotice * SInt32 CFUserNotificationDisplay...
Library
nd for functions. CData declare( name[, abi, returnType argType1, ...] ); Parameters name The name of the symbol exported by the native library that is to be declared as usable from JavaScript abi The ABI used by the exported function; this will be ctypes.default_abi for most libraries, except for Windows libraries, which will be ctypes.winapi_abi or ctypes.stdcall_abi. See ABI constants. You don't need to provide this for exported data; it's only needed for function declarations. returnType The CType type returned by the defined API, if it's a function. This parameter should not be provided if the API is an exported data symbol. argType1...argTypeN Zero or more parameter CType may be specified for the parameters of the function being declared. These should not be provided if...
ctypes
ds]); CData UInt64(n); Properties Property Type Description errno Number The value of the latest system error. Similar to errno in libc, available on all platforms. Cannot be set. winLastError Number|undefined The value of the latest Windows error. Similar to GetLastError under Windows, available only for Windows. Cannot be set. Constants ABI constants These constants are used to specify the ABI used to call a native function in the library. Constant Description default_abi Corresponds to cdecl; standard libraries use this ABI. You also use this for all system calls on Mac OS X and Linux. stdcall_abi Used for calling functions declared with stdcall on Windows. These functions' names are autom...
Mozilla
ssumes you are familiar with. Error codes returned by Mozilla APIs The following tables list errors that can occur when calling various Mozilla APIs. Each error is listed by its name and an error code in parentheses. An error will typically be displayed on the error console, but can be captured using a try-catch block in JavaScript. These constants can be accessed through Components.results. For example, by using Components.results.NS_ERROR_NOT_INITIALIZED Firefox Here you can learn about how to contribute to the Firefox project and you will also find links to information about the construction of Firefox add-ons, using the developer tools in Firefox, and other topics. Fi...
Version, UI, and Status Information - Plugins
I. int plugin_major, plugin_minor, netscape_major, netscape_minor; // declare variables to hold version numbers void NPN_Version( &plugin_major, &plugin_minor, &netscape_major, &netscape_minor ); // find version numbers Finding Out if a Feature Exists A plug-in can figure out whether it is running in a version of the browser that supports a particular feature by using version or NPVERS constants (see Version Feature Constants). Each NPVERS constant represents a feature. The plug-in can compare the NPVERS constant to the version number. If the version supports the feature, the plug-in can operate according to plan. If not, the plug-in cannot use some functionality. If an essential feature is unavailable, the developer must arrange for alternative behavior, shut down the plug-in, or give t...
Gecko Plugin API Reference - Plugins
NPN_InvokeDefault NPN_Evaluate NPN_GetProperty NPN_SetProperty NPN_RemoveProperty NPN_HasProperty NPN_HasMethod NPN_SetException NPClass Structures NPAnyCallbackStruct NPByteRange NPEmbedPrint NPEvent NPFullPrint NPP NP_Port NPPrint NPPrintCallbackStruct NPRect NPRegion NPSavedData NPSetWindowCallbackStruct NPStream NPWindow Constants Error Codes Result Codes Plug-in Version Constants Version Feature Constants External resources External projects and articles for plugin creation Original document information Copyright Information: Netscape Communication ...
DevTools API - Firefox Developer Tools
l with the given ID is about to be destroyed. The panel is the object returned by the ToolDefinition.build() method. Toolbox A Toolbox is a frame for the ToolPanels that is debugging a specific target. Properties target Target. The Target this toolbox is debugging. hostType Toolbox.HostType. The type of the host this Toolbox is docked to. The value is one of the Toolbox.HostType constants. zoomValue The current zoom level of the Toolbox. Constants The Toolbox constructor contains following constant properties. Toolbox.HostType.BOTTOM Host type for the default toolbox host at the bottom of the browser window. Toolbox.HostType.SIDE Host type for the host at the side of the browser window. Toolbox.HostType.WINDOW Host type for the separate Toolbox window.
ANGLE_instanced_arrays - Web APIs
le times, if they share the same vertex data, primitive count and type. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default and the constants and methods are available without the "ANGLE" suffix. Despite the name "ANGLE", this extension works on any device if the hardware supports it and not just on Windows when using the ANGLE library. "ANGLE" just indicates that this extension has been written by the ANGLE library authors. Constants This extension exposes one new constant, which can be used in the gl.getVertexAttrib() method: ...
AudioContextOptions - Web APIs
may or may not choose to meet this request; check the value of AudioContext.baseLatency to determine the true latency after creating the context. sampleRate Optional The sampleRate to be used by the AudioContext, specified in samples per second. The value may be any value supported by AudioBuffer. If not specified, the preferred sample rate for the context's output device is used by default. ...
AudioScheduledSourceNode.onended - Web APIs
The ended event is only sent to a node configured to loop automatically when the node is stopped using its stop() method. This is the case, for example, when using an AudioBufferSourceNode with its loop property set to true. ...
AudioScheduledSourceNode - Web APIs
for several types of audio source node interfaces which share the ability to be started and stopped, optionally at specified times. Specifically, this interface defines the start() and stop() methods, as well as the onended event handler. You can't create an AudioScheduledSourceNode object directly. Instead, use the interface which extends it, such as AudioBufferSourceNode, OscillatorNode, and ConstantSourceNode. Unless stated otherwise, nodes based upon AudioScheduledSourceNode output silence when not playing (that is, before start() is called and after stop() is called). Silence is represented, as always, by a stream of samples with the value zero (0). Properties Inherits properties from its parent interface, AudioNode. Methods Inherits methods from its parent interface, AudioNode, and a...
BaseAudioContext - Web APIs
n be populated by data and played via an AudioBufferSourceNode. BaseAudioContext.createBufferSource() Creates an AudioBufferSourceNode, which can be used to play and manipulate audio data contained within an AudioBuffer object. AudioBuffers are created using AudioContext.createBuffer or returned by AudioContext.decodeAudioData when it successfully decodes an audio track. BaseAudioContext.createConstantSource() Creates a ConstantSourceNode object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value. BaseAudioContext.createChannelMerger() Creates a ChannelMergerNode, which is used to combine channels from multiple audio streams into a single audio stream. BaseAudioContext.createChannelSplitter() Creates a ChannelSplitt...
DOMException.code - Web APIs
Web › API › DOMException › code
This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the DOMException.name attribute. Syntax var domExceptionCode = domExceptionInstance.code; Value A short number. Specifications Specification Status Comment Web IDLThe definition of 'code' in that specification. Candidate Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. ...
DOMException - Web APIs
perty of a web API. This is basically how error conditions are described in web APIs. Each exception has a name, which is a short "CamelCase" style string identifying the error or abnormal condition. Constructor DOMException() Returns a DOMException object with a specified message and name. Properties DOMException.code Read only Returns a short that contains one of the error code constants, or 0 if none match. This field is used for historical reasons. New DOM exceptions don't use this anymore: they put this info in the DOMException.name attribute. DOMException.message Read only Returns a DOMString representing a message or description associated with the given error name. DOMException.name Read only Returns a DOMString that contains one of the strings associated with an erro...
Document.evaluate() - Web APIs
Web › API › Document › evaluate
from the root node (html) which would be more wasteful.) See Introduction to using XPath in JavaScript for more information. Notes XPath expressions can be evaluated on HTML and XML documents. While using document.evaluate() works in FF2, in FF3 one must use someXMLDoc.evaluate() if evaluating against something other than the current document. Result types (Merge with Template:XPathResultConstants? These are supported values for the resultType parameter of the evaluate method: Result Type Value Description ANY_TYPE 0 Whatever type naturally results from the given expression. NUMBER_TYPE 1 A result set containing a single number. Useful, for example, in an XPath expression using the count() function. STRING_TYPE 2 A result set co...
EXT_blend_minmax - Web APIs
minimum or maximum color components of the source and destination colors. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. The constants in WebGL2 are gl.MIN and gl.MAX. Constants This extension adds two new constants, which can be used in WebGLRenderingContext.blendEquation() and WebGLRenderingContext.blendEquationSeparate(): ext.MIN_EXT Produces the minimum color components of the source and destination colors. ext.MAX_EXT Produces the maximum color components of the source and destination colors. Examples var ext = ...
EXT_color_buffer_half_float - Web APIs
r to 16-bit floating-point color buffers. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is available to WebGL 1 contexts only. For WebGL 2, use the EXT_color_buffer_float extension. The OES_texture_half_float extension implicitly enables this extension. Constants ext.RGBA16F_EXT RGBA 16-bit floating-point color-renderable format. ext.RGB16F_EXT RGB 16-bit floating-point color-renderable format. ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT ? ext.UNSIGNED_NORMALIZED_EXT ? Extended methods This extension extends WebGLRenderingContext.renderbufferStorage(): The internalformat parameter now accepts ext.RGBA16F_EXT and ext.RGBA16F_EXT. Exampl...
EXT_disjoint_timer_query - Web APIs
s extension should be available in WebGL1 contexts only. EXT_disjoint_timer_query_webgl2 is available in WebGL 2 contexts . In WebGL 2, the getQueryObject was renamed to getQueryParameter. In WebGL 2, other queries (such as occlusion queries and primitive queries) are possible using WebGLQuery objects. Types This extension exposes a new type: GLuint64EXT Unsigned 64-bit integer number. Constants This extension exposes seven new constants. ext.QUERY_COUNTER_BITS_EXT A GLint indicating the number of bits used to hold the query result for the given target. ext.CURRENT_QUERY_EXT A WebGLQuery object, which is the currently active query for the given target. ext.QUERY_RESULT_EXT A GLuint64EXT containing the query result. ext.QUERY_RESULT_AVAILABLE_EXT A GLboolean indicating whether ...
EXT_sRGB - Web APIs
Web › API › EXT sRGB
f the WebGL API and adds sRGB support to textures and framebuffer objects. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. The constants in WebGL2 are: gl.SRGB, gl.SRGB8, gl.SRGB8_ALPHA8 and gl.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING. Constants This extension exposes the following constants, which can be used in the texImage2D(), texSubImage2D(), renderbufferStorage() and getFramebufferAttachmentParameter() methods. ext.SRGB_EXT Unsized sRGB format that leaves the precision up to the driver. ext.SRGB_ALPHA_EXT Unsized sRGB ...
EXT_texture_compression_bptc - Web APIs
ese compression formats are called BC7 and BC6H in Microsoft's DirectX API. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: Support depends on the system's graphics driver. There is no support on Windows. This extension is available to both, WebGL1 and WebGL2 contexts. Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_RGBA_BPTC_UNORM_EXT Compresses 8-bit fixed-point data. Each 4x4 block of texels consists of 128 bits of RGBA or image data. See also BC7 format. ext.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT Compresses 8-bit fixed-point data. Each 4x4 b...
EXT_texture_compression_rgtc - Web APIs
igned and signed red and red-green textures (Red-Green Texture Compression). WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: Support depends on the system's graphics driver. There is no support on Windows. This extension is available to both, WebGL1 and WebGL2 contexts. Constants The compressed texture formats are exposed by 4 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_RED_RGTC1_EXT Each 4x4 block of texels consists of 64 bits of unsigned red image data. See also BC4 unsigned. ext.COMPRESSED_SIGNED_RED_RGTC1_EXT Each 4x4 block of texels consists of 64 bits of signed red image data. See also BC4 s...
EXT_texture_filter_anisotropic - Web APIs
AF improves the quality of mipmapped texture access when viewing a textured primitive at an oblique angle. Using just mipmapping, these lookups have a tendency to average to grey. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is available to both, WebGL1 and WebGL2 contexts. Constants ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT This is the pname argument to the gl.getParameter() call, and it returns the maximum available anisotropy. ...
Element: mousedown event - Web APIs
y pressed. Bubbles Yes Cancelable Yes Interface MouseEvent Event handler property onmousedown Examples The following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an HTML5 canvas. Its functionality is simple: the thickness of the line is set to 1, and the color is always black. When the page loads, constants myPics and context are created to store a reference to the canvas and the 2d context we will use to draw. Drawing begins when the mousedown event fires. First we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isDrawing to true. As the mouse moves over the page, the mousemove event fires. If isDrawing is true, the event handler calls the drawLine functi...
Element: mousemove event - Web APIs
inside it. Bubbles Yes Cancelable Yes Interface MouseEvent Event handler property onmousemove Examples The following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an HTML5 canvas. Its functionality is simple: the thickness of the line is set to 1, and the color is always black. When the page loads, constants myPics and context are created to store a reference to the canvas and the 2d context we will use to draw. Drawing begins when the mousedown event fires. First we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isDrawing to true. As the mouse moves over the page, the mousemove event fires. If isDrawing is true, the event handler calls the drawLine functi...
Element: mouseup event - Web APIs
edown events. Bubbles Yes Cancelable Yes Interface MouseEvent Event handler property onmouseup Examples The following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an HTML5 canvas. Its functionality is simple: the thickness of the line is set to 1, and the color is always black. When the page loads, constants myPics and context are created to store a reference to the canvas and the 2d context we will use to draw. Drawing begins when the mousedown event fires. First we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isDrawing to true. As the mouse moves over the page, the mousemove event fires. If isDrawing is true, the event handler calls the drawLine functi...
Event.eventPhase - Web APIs
Web › API › Event › eventPhase
The eventPhase read-only property of the Event interface indicates which phase of the event flow is currently being evaluated. Syntax let phase = event.eventPhase; Value Returns an integer value which specifies the current evaluation phase of the event flow. Possible values are listed in Event phase constants. Constants Event phase constants These values describe which phase the event flow is currently being evaluated. Constant Value Description Event.NONE 0 No event is being processed at this time. Event.CAPTURING_PHASE 1 The event is being propagated through the target's ancestor objects. This process starts with the Window, then Document, then the HTMLHtmlElement, and so on through the elements until the target's parent is reached. Event...
EventTarget.addEventListener() - Web APIs
ElementById("outside"); el.addEventListener("click", () => { modifyText("four"); }, false); Result Please note that while anonymous and arrow functions are similar, they have different this bindings. While anonymous (and all traditional JavaScript functions) create their own this bindings, arrow functions inherit the this binding of the containing function. That means that the variables and constants available to the containing function are also available to the event handler when using an arrow function. Example of options usage HTML <div class="outer"> outer, once & none-once <div class="middle" target="_blank"> middle, capture & none-capture <a class="inner1" href="https://www.mozilla.org" target="_blank"> inner1, passive & preventDefault(which is not allowed) </a>...
FileError - Web APIs
Web › API › FileError
can bypass the security restriction on Chrome. Just start Chrome with the --allow-file-access-from-files flag. Use the flag only for testing purposes. Attribute Attribute Type Description code unsigned short The most appropriate error code for the condition. See Error codes for possible values. Error codes Note: Do not rely on the numeric values of the constants, which might change as the specifications continue to change. Use the constant names instead. Constant Value Description ENCODING_ERR 5 The URL is malformed. Make sure that the URL is complete and valid. INVALID_MODIFICATION_ERR 9 The modification requested is not allowed. For example, the app might be trying to move a directory into its own child or ...
FileException - Web APIs
ostMEssage('ERROR:' + e.toString()); } try { //Error is thrown if "log.txt" already exists. var fileEntry = fs.root.getFile('log.txt', {create: true, exclusive:true}0; } catch (e) { onErrror(e); } The sample code was borrowed from HTML5Rocks Attribute Attribute Type Description code unsigned short The most appropriate error code for the condition. Constants Note: Do not rely on the numeric values of the constants, which might change as the specifications continue to change. Use the constant names instead. Constant Value Description ENCODING_ERR 5 The URL is malformed. Make sure that the URL is complete and valid. INVALID_MODIFICATION_ERR 9 The modification requested is not allowed. Examples of invalid m...
FileReader.readyState - Web APIs
as called and the read was cancelled. Example var reader = new FileReader(); console.log('EMPTY', reader.readyState); // readyState will be 0 reader.readAsText(blob); console.log('LOADING', reader.readyState); // readyState will be 1 reader.onloadend = function () { console.log('DONE', reader.readyState); // readyState will be 2 }; Value A number which is one of the three possible state constants define for the FileReader API. Specifications Specification Status Comment File APIThe definition of 'readyState' in that specification. Working Draft Initial definition ...
Force Touch events - Web APIs
r the mousedown event and stops firing before the mouseup event. Event properties The following property is known to be available on the webkitmouseforcewillbegin, mousedown, webkitmouseforcechanged, webkitmouseforcedown, webkitmouseforceup, mousemove, and mouseup event objects: MouseEvent.webkitForce Read only The amount of pressure currently being applied to the trackpad/touchscreen Constants These constants are useful for determining the relative intensity of the pressure indicated by MouseEvent.webkitForce: MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN Read only Minimum force necessary for a normal click MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN Read only Minimum force necessary for a force click Specifications Not part of any specification. Apple has a description at the Ma...
HTMLCanvasElement.toBlob() - Web APIs
s.getContext('2d'); ctx.beginPath(); ctx.moveTo(d / 2, 0); ctx.lineTo(d, d); ctx.lineTo(0, d); ctx.closePath(); ctx.fillStyle = 'yellow'; ctx.fill(); function blobCallback(iconName) { return function(b) { var r = new FileReader(); r.onloadend = function () { // r.result contains the ArrayBuffer. ...
Ajax navigation example - Web APIs
requestPage(this.href); return false; } return true; } function init () { oPageInfo.title = document.title; history.replaceState(oPageInfo, oPageInfo.title, oPageInfo.url); for (var oLink, nIdx = 0, nLen = document.links.length; nIdx < nLen; document.links[nIdx++].onclick = processLink); } const /* customizable constants */ sTargetId = "ajax-content", sViewKey = "view_as", sAjaxClass = "ajax-nav", /* not customizable constants */ rSearch = /\?.*$/, rHost = /^[^\?]*\?*&*/, rView = new RegExp("&" + sViewKey + "\\=[^&]*|&*$", "i"), rEndQstMark = /\?$/, oLoadingBox = document.createElement("div"), oCover = document.createElement("div"), oLoadingImg = new Image(), oPageInfo = {...
IDBDatabaseException - Web APIs
e of DOMException. In the IndexedDB API, an IDBDatabaseException object represents exception conditions that can be encountered while performing database operations. Attributes Attribute Type Description code unsigned short The most appropriate error code for the condition. message DOMString Error message describing the exception raised. Constants Note: Do not rely on the numeric values of the constants, which might change as the specifications continue to change. Use the constant names instead. Constant Value Description ABORT_ERR 8 A request was aborted, for example, through a call to IDBTransaction.abort. CONSTRAINT_ERR 4 A mutation operation in the transaction failed because a constra...
IDBIndex.openCursor() - Web APIs
n Web Workers. Syntax var request = myIndex.openCursor(); var request = myIndex.openCursor(range); var request = myIndex.openCursor(range, direction); Parameters range Optional A key or IDBKeyRange to use as the cursor's range. If nothing is passed, this will default to a key range that selects all the records in this object store. direction Optional The cursor's direction. See IDBCursor Constants for possible values. Return value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following types: Exception Description TransactionInactiveError This IDBIndex's transaction is inactive. TypeError The value for the direction parameter is invalid. ...
IDBIndex.openKeyCursor() - Web APIs
kers. Syntax var request = myIndex.openKeyCursor(); var request = myIndex.openKeyCursor(range); var request = myIndex.openKeyCursor(range, direction); Parameters range Optional A key or IDBKeyRange to use as the cursor's range. If nothing is passed, this will default to a key range that selects all the records in this object store. direction Optional The cursor's direction. See IDBCursor Constants for possible values. Return value An IDBRequest object on which subsequent events related to this operation are fired. Exceptions This method may raise a DOMException of one of the following types: Exception Description TransactionInactiveError This IDBIndex's transaction is inactive. TypeError The value for the direction parameter is invalid. ...
IDBObjectStoreSync - Web APIs
readonly DOMStringList A list of the names of the indexes on this object store. keyPath readonly DOMString The key path of this object store. If this attribute is set to null, then the application must provide a key for each modification operation. mode readonly unsigned short The mode for isolating access to the data in this object store. For possible values, see Constants. name readonly DOMString The name of this object store. Constants Mode constants Constant Value Description READ_ONLY 1 Modification operations are not allowed on this object store. READ_WRITE 0 Modification operations are allowed on this object store. SNAPSHOT_READ 2 Any read operations must access a snapsho...
Intersection Observer API - Web APIs
gs happen. Setting up First, we need to prepare some variables and install the observer. const numSteps = 20.0; let boxElement; let prevRatio = 0.0; let increasingColor = "rgba(40, 40, 190, ratio)"; let decreasingColor = "rgba(190, 40, 40, ratio)"; // Set things up window.addEventListener("load", (event) => { boxElement = document.querySelector("#box"); createObserver(); }, false); The constants and variables we set up here are: numSteps A constant which indicates how many thresholds we want to have between a visibility ratio of 0.0 and 1.0. prevRatio This variable will be used to record what the visibility ratio was the last time a threshold was crossed; this will let us figure out whether the target element is becoming more or less visible. increasingColor A string defining a c...
LocalFileSystem - Web APIs
PERSISTENT 1 Storage that stays in the browser unless the user or the app expunges it. The user must grant permission before the app can use this type of storage. Methods requestFileSystem() Requests a file system whe...
LocalFileSystemSync - Web APIs
cess and other errors. var fs = requestFileSystemSync(TEMPORARY, 1024*1024 /*1MB*/); Because you are using a synchronous API, you don't need success and error callbacks. Method overview FileSystemSync requestFileSystemSync (in unsigned short type, in long long size) raises FileException; EntrySync resolveLocalFileSystemSyncURL (in DOMString url) raises FileException; Constants Constant Value Description TEMPORARY 0 Transient storage that can be be removed by the browser at its discretion. PERSISTENT 1 Storage that stays in the browser unless the user or the app expunges it. Methods requestFileSystemSync() Requests a file system where data should be stored. You access a sandboxed file system by requesti...
MediaError.code - Web APIs
Web › API › MediaError › code
The read-only property MediaError.code returns a numeric value which represents the kind of error that occurred on a media element. To get a text string with specific diagnostic information, see MediaError.message. Syntax var myError = mediaError.code; Value A numeric value indicating the general type of error which occurred. The possible values are described below, in Media error code constants. Media error code constants Name Value Description MEDIA_ERR_ABORTED 1 The fetching of the associated resource was aborted by the user's request. MEDIA_ERR_NETWORK 2 Some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available. MEDIA_ERR_DECODE 3 Despite having pr...
MouseScrollEvent - Web APIs
VERTICAL_AXIS 0x02 The event is caused by vertical wheel operation. Methods initMouseScrollEvent() See nsIDOMMouseScrollEvent::initMouseScrollEvent(). ...
NodeIterator - Web APIs
the Document.createNodeIterator() method, as follows: const nodeIterator = document.createNodeIterator(root, whatToShow, filter); Properties This interface doesn't inherit any property. NodeIterator.root Read only Returns a Node representing the root node as specified when the NodeIterator was created. NodeIterator.whatToShow Read only Returns an unsigned long being a bitmask made of constants describing the types of Node that must to be presented. Non-matching nodes are skipped, but their children may be included, if relevant. The possible values are: Constant Numerical value Description NodeFilter.SHOW_ALL -1 (that is the max value of unsigned long) Shows all nodes. NodeFilter.SHOW_ATTRIBUTE 2 Shows attribute Att...
OES_standard_derivatives - Web APIs
the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. In WebGL 2, the constant is available as gl.FRAGMENT_SHADER_DERIVATIVE_HINT and it requires GLSL #version 300 es. Constants This extension exposes one new constant, which can be used in the hint() and getParameter() methods. ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES A Glenum indicating the accuracy of the derivative calculation for the GLSL built-in functions: dFdx, dFdy, and fwidth. GLSL built-in functions The following new functions can be used in GLSL shader code, if this extension is enabled: genType dFdx(g...
OES_texture_half_float - Web APIs
d 32-bit floating-point components. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. The constant in WebGL2 is gl.HALF_FLOAT. Constants ext.HALF_FLOAT_OES Half floating-point type (16-bit). Extended methods This extension extends WebGLRenderingContext.texImage2D() and WebGLRenderingContext.texSubImage2D(): The type parameter now accepts ext.HALF_FLOAT_OES. Limitation: Linear filtering Linear filtering on half floating-point textures is not allowed with this extension. If you set the magnification or minification filt...
OES_vertex_array_object - Web APIs
ers to vertex data and provide names for different sets of vertex data. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default and the constants and methods are available without the "OES" suffix. Constants This extension exposes one new constant, which can be used in the gl.getParameter() method: ext.VERTEX_ARRAY_BINDING_OES Returns a WebGLVertexArrayObject object when used in the gl.getParameter() method as the pname parameter. Methods This extension exposes four new methods. ext.createVertexArrayOES() Creates a new WebG...
OVR_multiview2 - Web APIs
ws+GL, Mac, Linux are not supported). This extension is only available to WebGL 2 contexts as it needs GLSL 3.00 and texture arrays. Currently, there is no way to use multiview to render to a multisampled backbuffer, so you should create contexts with antialias: false. However, the Oculus browser (6+) also supports multisampling using the OCULUS_multiview extension. See also this WebGL issue. Constants This extension exposes 4 constants that can be used in getParameter() or getFramebufferAttachmentParameter(). FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR Number of views of the framebuffer object attachment. FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR Base view index of the framebuffer object attachment. MAX_VIEWS_OVR The maximum number of views. Most VR headsets have two views, ...
ParentNode.replaceChildren() - Web APIs
the "no" button is pressed. To do this, we give each of the buttons a click event handler, which collects together the selected options you want to transfer in one constant, and the existing options in the list you are transferring to in another constant. It then calls replaceChildren() on the list to transfer the options to, using the spread operator to pass in all the options contained in both constants. const noSelect = document.getElementById('no'); const yesSelect = document.getElementById('yes'); const noBtn = document.getElementById('to-no'); const yesBtn = document.getElementById('to-yes'); yesBtn.addEventListener('click', () => { const selectedTransferOptions = document.querySelectorAll('#no option:checked'); const existingYesOptions = document.querySelectorAll('#yes option'); yes...
RTCDataChannel.readyState - Web APIs
property readyState returns an enum of type RTCDataChannelState which indicates the state of the data channel's underlying data connection. Syntax var state = aDataChannel.readyState; Values A string which is one of the values in the RTCDataChannelState enum, indicating the current state of the underlying data transport. RTCDataChannelState enum The RTCDataChannelState enum defines string constants which reflect the current status of the RTCDataChannel's underlying data connection. Constant Description "connecting" The user agent (browser) is in the process of creating the underlying data transport; that is, whatever network level connection is used to link the two peers together is in the process of being set up. This is the state of a new RTCDataChannel after ...
RTCPeerConnection.connectionState - Web APIs
values specified by the enum RTCPeerConnectionState. When this property's value changes, a connectionstatechange event is sent to the RTCPeerConnection instance. Syntax var connectionState = RTCPeerConnection.connectionState; Value The current state of the connection, as a value from the enum RTCPeerConnectionState. RTCPeerConnectionState enum The RTCPeerConnectionState enum defines string constants which describe states in which the RTCPeerConnection may be. These values are returned by the connectionState property. This state essentially represents the aggregate state of all ICE transports (which are of type RTCIceTransport or RTCDtlsTransport) being used by the connection. Constant Description "new" At least one of the connection's ICE transports (RTCIceTransp...
RTCPeerConnection.iceConnectionState - Web APIs
ciated with the RTCPeerConnection. You can detect when this value has changed by watching for the iceconnectionstatechange event. Syntax var state = RTCPeerConnection.iceConnectionState; Value The current state of the ICE agent and its connection. The value is one of the strings in the RTCIceConnectionState enum. RTCIceConnectionState enum The RTCIceConnectionState enum defines the string constants used to describe the current state of the ICE agent and its connection to the ICE server (that is, the STUN or TURN server). Constant Description "new" The ICE agent is gathering addresses or is waiting to be given remote candidates through calls to RTCPeerConnection.addIceCandidate() (or both). "checking" The ICE agent has been given one or more remote ca...
RTCPeerConnection.iceGatheringState - Web APIs
s you detect, for example, when collection of ICE candidates has finished. You can detect when the value of this property changes by watching for an event of type icegatheringstatechange. Syntax var state = RTCPeerConnection.iceGatheringState; Value The possible values are those of an enum of type RTCIceGatheringState. RTCIceGatheringState enum The RTCIceGatheringState enum defines string constants which reflect the current status of ICE gathering, as returned using the RTCPeerConnection.iceGatheringState property. You can detect when this value changes by watching for an event of type icegatheringstatechange. Constant Description "new" The peer connection was just created and hasn't done any networking yet. "gathering" The ICE agent is in the proces...
RTCSessionDescription - Web APIs
iption supports. Once the two peers agree upon a configuration for the connection, negotiation is complete. Properties The RTCSessionDescription interface doesn't inherit any properties. RTCSessionDescription.type Read only An enum of type RTCSdpType describing the session description's type. RTCSessionDescription.sdp Read only A DOMString containing the SDP describing the session. Constants RTCSdpType This enum defines strings that describe the current state of the session description, as used in the type property. The session description's type will be specified using one of these values. Value Description answer The SDP contained in the sdp property is the definitive choice in the exchange. In other words, this session description describes the agree...
SVGClipPathElement - Web APIs
t-anchor="middle" alignment-baseline="middle">SVGClipPathElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties This interface also inherits properties from its parent, SVGElement. SVGClipPathElement.clipPathUnits Read only An SVGAnimatedEnumeration corresponding to the clipPathUnits attribute of the given <clipPath> element. Takes one of the constants defined in SVGUnitTypes. Methods This interface doesn't implement any specific methods, but inherits methods from its parent, SVGElement. Specifications Specification Status Comment CSS Masking Module Level 1The definition of 'SVGClipPathElement' in that specification. Candidate Recommendation Removed the inheritance from SVGTests, SVGLangSpace, SVGExternalResou...
SVGColorProfileElement - Web APIs
file> element. Properties SVGColorProfileElement.local A DOMString corresponding to the local attribute of the given element. SVGColorProfileElement.name A DOMString corresponding to the name attribute of the given element. SVGColorProfileElement.renderingIntent An unsigned short corresponding to the rendering-intent attribute of the given element. It takes one of the RENDERING_INTENT_* constants defined on the SVGRenderingIntent interface that corresponds to the value of the rendering-intent attribute. Methods This interface does not provide any specific methods, but implements those of its parent, SVGElement, and implements methods of SVGURIReference and SVGRenderingIntent. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Secon...
SVGFilterElement - Web APIs
"12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGFilterElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties SVGFilterElement.filterUnits Read only An SVGAnimatedEnumeration that corresponds to the filterUnits attribute of the given <filter> element. Takes one of the constants defined in SVGUnitTypes. SVGFilterElement.primitiveUnits Read only An SVGAnimatedEnumeration that corresponds to the primitiveUnits attribute of the given <filter> element. Takes one of the constants defined in SVGUnitTypes. SVGFilterElement.x Read only An SVGAnimatedLength that corresponds to the x attribute on the given <filter> element. SVGFilterElement.y Read only An SVGAnimatedLengt...
SVGMaskElement - Web APIs
" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGMaskElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties This interface also inherits properties from its parent, SVGElement. SVGMaskElement.maskUnits Read only An SVGAnimatedEnumeration corresponding to the maskUnits attribute of the given <mask> element. Takes one of the constants defined in SVGUnitTypes. SVGMaskElement.maskContentUnits Read only An SVGAnimatedEnumeration corresponding to the maskContentUnits attribute of the given <mask> element. Takes one of the constants defined in SVGUnitTypes. SVGMaskElement.x Read only An SVGAnimatedLength corresponding to the x attribute of the given <mask> element. SVGMaskElement.y Read only An SVGAnimatedLength correspond...
SVGPatternElement - Web APIs
ent</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 SVGFitToViewBox and SVGURIReference. SVGPatternElement.patternUnits Read only An SVGAnimatedEnumeration corresponding to the patternUnits attribute of the given <pattern> element. Takes one of the constants defined in SVGUnitTypes. SVGPatternElement.patternContentUnits Read only An SVGAnimatedEnumeration corresponding to the patternContentUnits attribute of the given <pattern> element. Takes one of the constants defined in SVGUnitTypes. SVGPatternElement.patternTransform Read only An SVGAnimatedTransformList corresponding to the patternTransform attribute of the given <pattern> element. SVGPa...
SVGRenderingIntent - Web APIs
dth="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:hover text { fill: #0095DD; pointer-events: all;} Warning: This interface was removed in the SVG 2 specification. Constants Name Value Description RENDERING_INTENT_UNKNOWN 0 The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. RENDERING_INTENT_AUTO 1 Corresponds to the value auto. RENDERING_INTENT_PERCEPTUAL 2 Corresponds to the value perceptual. ...
SVGTextContentElement - Web APIs
LENGTHADJUST_SPACING 1 The spacing keyword. LENGTHADJUST_SPACINGANDGLYPHS 2 The spacingAndGlyphs keyword. Properties This interface also inherits properties from its parent, SVGGraphicsElement. SVGTextContentElement.textLength Read only An SVGAnimatedLength...
SVGZoomAndPan - Web APIs
It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. SVG_ZOOMANDPAN_DISABLE 1 Corresponds to the value disable. SVG_ZOOMANDPAN_MAGNIFY 2 Corresponds to the value magnify. Properti...
Using the Screen Capture API - Web APIs
ent to share. Examples Simple screen capture In this example, the contents of the captured screen area are simply streamed into a <video> element on the same page. JavaScript There isn't all that much code needed in order to make this work, and if you're familiar with using getUserMedia() to capture video from a camera, you'll find getDisplayMedia() to be very familiar. Setup First, some constants are set up to reference the elements on the page to which we'll need access: the <video> into which the captured screen contents will be streamed, a box into which logged output will be drawn, and the start and stop buttons that will turn on and off capture of screen imagery. The object displayMediaOptions contains the MediaStreamConstraints to pass into getDisplayMedia(); here, the cursor prope...
TextTrack.mode - Web APIs
Web › API › TextTrack › mode
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. Syntax var mode = textTrack.mode; textTrack.mode = "disabled" | "hidden" | "showing"; Value A DOMString which indicates the track's current mode. The text track mode is one of the values listed below, under Text track mode constants. Text track mode constants The text track mode--sometimes identified using the IDL enum TextTrackMode--must be one of the following values: disabled The text track is currently disabled. While the track's presence is exposed in the DOM, the user agent is otherwise ignoring it. No cues are active, no events are being fired, and the user agent won't attempt to obtain the track's cues. This is...
TextTrack - Web APIs
Web › API › TextTrack
ecified in the Tags for Identifying Languages (BCP 47) document from the IETF, just like the HTML lang attribute. For example, this can be "en-US" for United States English or "pt-BR" for Brazilian Portuguese. TextTrack.mode A DOMString specifying the track's current mode. Changing this property's value changes the track's current mode to match. Permitted values are listed under Text track mode constants. The default is disabled, unless the <track> element's default Boolean attribute is specified, in which case the default mode is started. Events cuechange Fired when cues are entered and exited. A given text cue appears when the cue is entered and disappears when the cue is exited. Also available via the oncuechange property. Methods This interface also inherits methods from EventTarget...
TreeWalker.whatToShow - Web APIs
Non-matching nodes are skipped, but their children may be included, if relevant. The possible values are: Constant Numerical value Description NodeFilter.SHOW_ALL -1 (that is the max value of unsigned long) Shows all nodes. NodeFilter.SHOW_ATTRIBUTE 2 Shows attribute Attr nodes. This is meaningful only when creating a TreeWalker with an Attr node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. ...
TreeWalker - Web APIs
nts the nodes of a document subtree and a position within them. A TreeWalker can be created using the Document.createTreeWalker() method. Properties This interface doesn't inherit any property. TreeWalker.root Read only Returns a Node representing the root node as specified when the TreeWalker was created. TreeWalker.whatToShow Read only Returns an unsigned long being a bitmask made of constants describing the types of Node that must be presented. Non-matching nodes are skipped, but their children may be included, if relevant. The possible values are: Constant Numerical value Description NodeFilter.SHOW_ALL -1 (that is the max value of unsigned long) Shows all nodes. NodeFilter.SHOW_ATTRIBUTE 2 Shows attribute Attr node...
TypeInfo - Web APIs
Web › API › TypeInfo
lete TypeInfo interface was intended to be used to describe a DOM data type by keying its name to a namespace within the document's schema. Properties TypeInfo.typeName Read only Returns a DOMString indicating the type's name. TypeInfo.typeNamespace Read only Returns a DOMString indicating the type's namespace within the schema. Methods TypeInfo.isDerivedFrom() Returns a Boolean. Constants Constant Value DERIVATION_RESTRICTION 1 DERIVATION_EXTENSION 2 DERIVATION_UNION 4 DERIVATION_LIST 8 Specifications Specification Status Comment Document Object Model (DOM) Level 3 Core SpecificationThe definition of 'TypeInfo' in that specification. Obsolete Initial definition ...
UserDataHandler - Web APIs
return value) This method is a callback which will be called if a node is being cloned, imported, renamed and as well, if deleted or adopted. operation (unsigned short) is an operation type integer (see below). key (DOMString) is the user key. data (DOMUserData) is the user data. src (Node) is the source node (null if being deleted). dst (Node) is the destination node (if any, or null). ...
WEBGL_color_buffer_float - Web APIs
render to 32-bit floating-point color buffers. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is available to WebGL 1 contexts only. For WebGL 2, use the EXT_color_buffer_float extension. The OES_texture_float extension implicitly enables this extension. Constants ext.RGBA32F_EXT RGBA 32-bit floating-point color-renderable format. ext.RGB32F_EXT ( ) RGB 32-bit floating-point color-renderable format. ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT ? ext.UNSIGNED_NORMALIZED_EXT ? Extended methods This extension extends WebGLRenderingContext.renderbufferStorage(): The internalformat parameter now accepts ext.RGBA32F_EXT and ext.RGB32F_EXT ( ). ...
WEBGL_compressed_texture_atc - Web APIs
solution textures. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: ATC compression is typically available on mobile devices with Adreno GPUs, that are currently only built into Qualcomm Snapdragon devices. This extension is available to both, WebGL1 and WebGL2 contexts. Constants The compressed texture formats are exposed by 3 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_RGB_ATC_WEBGL Compresses RGB textures with no alpha channel. ext.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL Compresses RGBA textures using explicit alpha encoding (useful when alpha transitions are sharp). ext.COMPRESSED_RGBA_ATC_IN...
WEBGL_compressed_texture_etc - Web APIs
ed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is available to both, WebGL1 and WebGL2 contexts. Constants The compressed texture formats are exposed by 10 constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_R11_EAC One-channel (red) unsigned format compression. ext.COMPRESSED_SIGNED_R11_EAC One-channel (red) signed format compression. ext.COMPRESSED_RG11_EAC Two-channel (red and green) unsigned format compression. ext.COMPRESSED_S...
WEBGL_compressed_texture_etc1 - Web APIs
ed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is available to both, WebGL1 and WebGL2 contexts. Constants The compressed texture format is exposed by a constant and can be used with the compressedTexImage2D() method (note that ETC1 is not supported with the compressedTexSubImage2D() method). ext.COMPRESSED_RGB_ETC1_WEBGL Compresses 24-bit RGB data with no alpha channel. Examples var ext = gl.getExtension('WEBGL_compressed_texture_etc1'); var texture = gl.createTexture(); gl.bindTexture(gl.TE...
WEBGL_compressed_texture_pvrtc - Web APIs
s in the WebGL tutorial. Availability: PVRTC is typically only available on mobile devices with PowerVR chipsets. It is used in all generations of the iPhone, iPod Touch and iPad and supported on certain Android devices that use a PowerVR GPU. This extension is available to both, WebGL1 and WebGL2 contexts. Note: On iOS devices, this extension is named WEBKIT_WEBGL_compressed_texture_pvrtc. Constants The compressed texture formats are exposed by four constants and can be used in two functions: compressedTexImage2D() (where the height and width parameters must be powers of 2) and compressedTexSubImage2D() (where the the height and width parameters must equal the current values of the existing texture and the xoffset and yoffset parameters must be 0). ext.COMPRESSED_RGB_PVRTC_4BPPV1_IMG RG...
WEBGL_compressed_texture_s3tc - Web APIs
ed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is available to both, WebGL1 and WebGL2 contexts. Constants The compressed texture formats are exposed by four constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_RGB_S3TC_DXT1_EXT A DXT1-compressed image in an RGB image format. ext.COMPRESSED_RGBA_S3TC_DXT1_EXT A DXT1-compressed image in an RGB image format with a simple on/off alpha value. ext.COMPRESSED_RGBA_S3TC_DXT3_EXT A DXT3-comp...
WEBGL_compressed_texture_s3tc_srgb - Web APIs
sed textures reduce the amount of memory needed to store a texture on the GPU, allowing for higher resolution textures or more of the same resolution textures. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is available to both WebGL1 and WebGL2 contexts. Constants The compressed texture formats are exposed by four constants and can be used in two functions: compressedTexImage2D() and compressedTexSubImage2D(). ext.COMPRESSED_SRGB_S3TC_DXT1_EXT A DXT1-compressed image in an sRGB image format. ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT A DXT1-compressed image in an sRGB image format with a simple on/off alpha value. ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_E...
WEBGL_depth_texture - Web APIs
and depth-stencil textures. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. The constant in WebGL2 is gl.UNSIGNED_INT_24_8. Constants This extension adds a new constant: ext.UNSIGNED_INT_24_8_WEBGL Unsigned integer type for 24-bit depth texture data. Extended methods This extension extends WebGLRenderingContext.texImage2D(): The format and internalformat parameters now accept gl.DEPTH_COMPONENT and gl.DEPTH_STENCIL. The type parameter now accepts gl.UNSIGNED_SHORT, gl.UNSIGNED_INT, and ext.UNSIGNED_INT_24_8_WEBGL. ...
WEBGL_draw_buffers.drawBuffersWEBGL() - Web APIs
The WEBGL_draw_buffers.drawBuffersWEBGL() method is part of the WebGL API and allows you to define the draw buffers to which all fragment colors are written. This method is part of the WEBGL_draw_buffers extension. Note: When using WebGL2, this method is available as gl.drawBuffers() by default and the constants are named gl.COLOR_ATTACHMENT1 etc. without the "WEBGL" suffix. Syntax void gl.getExtension('WEBGL_draw_buffers').drawBuffersWEBGL(buffers); Parameters buffers An Array of GLenum constants defining drawing buffers. Possible values: gl.NONE: The fragment shader is not written to any color buffer. gl.BACK: The fragment shader is written to the back color buffer. ext.COLOR_ATTACHMENT0_WEBGL The fragment shader is written the the nth color attachment of the framebuffer. ...
WEBGL_draw_buffers - Web APIs
l textures, which is useful for deferred shading, for example. WebGL extensions are available using the WebGLRenderingContext.getExtension() method. For more information, see also Using Extensions in the WebGL tutorial. Availability: This extension is only available to WebGL1 contexts. In WebGL2, the functionality of this extension is available on the WebGL2 context by default. In WebGL 2, the constants are available without the "WEBGL" suffix and the new GLSL built-ins require GLSL #version 300 es. Constants This extension exposes new constants, which can be used in the gl.framebufferRenderbuffer(), gl.framebufferTexture2D(), gl.getFramebufferAttachmentParameter() ext.drawBuffersWEBGL(), and gl.getParameter() methods. ext.COLOR_ATTACHMENT0_WEBGL ext.COLOR_ATTACHMENT1_WEBGL ext.COLOR_AT...
WebGL2RenderingContext - Web APIs
WebGL 2 is an extension to WebGL 1. The WebGL2RenderingContext interface implements all members of the WebGLRenderingContext interface. Some methods of the WebGL 1 context can accept additional values when used in a WebGL 2 context. You will find this info noted on the WebGL 1 reference pages. The WebGL tutorial has more information, examples, and resources on how to get started with WebGL. Constants See the WebGL constants page. State information WebGL2RenderingContext.getIndexedParameter() Returns the indexed value for the given target. Buffers WebGL2RenderingContext.bufferData() Initializes and creates the buffer object's data store. WebGL2RenderingContext.bufferSubData() Updates a subset of a buffer object's data store. WebGL2RenderingContext.copyBufferSubData() Copies par...
WebGLRenderingContext.bindBuffer() - Web APIs
NVALID_OPERATION error, and the current binding will remain untouched. Examples Binding a buffer to a target var canvas = document.getElementById('canvas'); var gl = canvas.getContext('webgl'); var buffer = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buffer); Getting current bindings To check the current buffer bindings, query the ARRAY_BUFFER_BINDING and ELEMENT_ARRAY_BUFFER_BINDING constants. gl.getParameter(gl.ARRAY_BUFFER_BINDING); gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING); Specifications Specification Status Comment WebGL 1.0The definition of 'bindBuffer' in that specification. Recommendation Initial definition for WebGL. OpenGL ES 2.0The definition of 'glBindBuffer' in that specification. Standard Man page of the (similar) O...
WebGLRenderingContext.bindTexture() - Web APIs
s not gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP, gl.TEXTURE_3D, or gl.TEXTURE_2D_ARRAY. Examples Binding a texture var canvas = document.getElementById('canvas'); var gl = canvas.getContext('webgl'); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); Getting current bindings To check the current texture binding, query the gl.TEXTURE_BINDING_2D or gl.TEXTURE_BINDING_CUBE_MAP constants. gl.getParameter(gl.TEXTURE_BINDING_2D); Specifications Specification Status Comment WebGL 1.0The definition of 'bindTexture' in that specification. Recommendation Initial definition for WebGL. OpenGL ES 2.0The definition of 'glBindTexture' in that specification. Standard Man page of the (similar) OpenGL ES 2.0 API. WebGL 2.0The definition...
WebGLRenderingContext.blendEquation() - Web APIs
fault value: gl.FUNC_ADD Exception If mode is not one of the three possible values, a gl.INVALID_ENUM error is thrown. Return value None. Examples To set the blend equation, use: gl.blendEquation(gl.FUNC_ADD); gl.blendEquation(gl.FUNC_SUBTRACT); gl.blendEquation(gl.FUNC_REVERSE_SUBTRACT); To get the blend equations, query the BLEND_EQUATION, BLEND_EQUATION_RGB and BLEND_EQUATION_ALPHA constants which return gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, or if the EXT_blend_minmax is enabled: ext.MIN_EXT or ext.MAX_EXT. gl.getParameter(gl.BLEND_EQUATION_RGB) === gl.FUNC_ADD; // true gl.getParameter(gl.BLEND_EQUATION_ALPHA) === gl.FUNC_ADD; // true Specifications Specification Status Comment WebGL 1.0The definition of 'blendEquation' in that specific...
WebGLRenderingContext.blendEquationSeparate() - Web APIs
destination, gl.MAX: Maximum of source and destination. Return value None. Exceptions If mode is not one of the three possible values, a gl.INVALID_ENUM error is thrown. Examples To set the blend equations, use: gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_SUBTRACT); To get the current blend equations, query the BLEND_EQUATION, BLEND_EQUATION_RGB and BLEND_EQUATION_ALPHA constants which return gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT, or if the EXT_blend_minmax is enabled: ext.MIN_EXT or ext.MAX_EXT. gl.getParameter(gl.BLEND_EQUATION_RGB) === gl.FUNC_ADD; // true gl.getParameter(gl.BLEND_EQUATION_ALPHA) === gl.FUNC_ADD; // true Specifications Specification Status Comment WebGL 1.0The definition of 'blendEquationSeparate' in that ...
WebGLRenderingContext.clear() - Web APIs
_BIT gl.STENCIL_BUFFER_BIT Return value None. Exceptions If mask is not one of the listed possible values, a gl.INVALID_ENUM error is thrown. Examples The clear() method accepts multiple values. gl.clear(gl.DEPTH_BUFFER_BIT); gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT); To get the current clear values, query the COLOR_CLEAR_VALUE, DEPTH_CLEAR_VALUE, and STENCIL_CLEAR_VALUE constants. gl.getParameter(gl.COLOR_CLEAR_VALUE); gl.getParameter(gl.DEPTH_CLEAR_VALUE); gl.getParameter(gl.STENCIL_CLEAR_VALUE); Specifications Specification Status Comment WebGL 1.0The definition of 'clear' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glClear' in that specification. Standard Man page of the Open...
WebGLRenderingContext.getExtension() - Web APIs
method enables a WebGL extension. Syntax gl.getExtension(name); Parameters name A String for the name of the WebGL extension to enable. Return value A WebGL extension object, or null if name does not match (case-insensitive) to one of the strings in WebGLRenderingContext.getSupportedExtensions. Examples Once a WebGL extension is enabled, you are able to use the methods, properties or constants that this extension object provides. var canvas = document.getElementById('canvas'); gl = canvas.getContext('webgl'); gl.getExtension('WEBGL_lose_context').loseContext(); WebGL extensions Extensions for the WebGL API are registered in the WebGL Extension Registry. The current extensions are: ANGLE_instanced_arrays EXT_blend_minmax EXT_color_buffer_float EXT_color_buffer_half_float EX...
WebGLRenderingContext.polygonOffset() - Web APIs
The default value is 0. Return value None. Examples The polygon offset fill is disabled by default. To enable or disable polygon offset fill, use the enable() and disable() methods with the argument gl.POLYGON_OFFSET_FILL. gl.enable(gl.POLYGON_OFFSET_FILL); gl.polygonOffset(2, 3); To check the current polygon offset factor or units, query the POLYGON_OFFSET_FACTOR and POLYGON_OFFSET_UNITS constants. gl.getParameter(gl.POLYGON_OFFSET_FACTOR); // 2 gl.getParameter(gl.POLYGON_OFFSET_UNITS); // 3 Specifications Specification Status Comment WebGL 1.0The definition of 'polygonOffset' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glPolygonOffset' in that specification. Standard Man page of the OpenGL API.
WebGLRenderingContext.sampleCoverage() - Web APIs
ault value is false. Return value None. Examples Multi-sampling is disabled by default. To enable or disable multi-sampling, use the enable() and disable() methods with the argument gl.SAMPLE_COVERAGE and gl.SAMPLE_ALPHA_TO_COVERAGE. gl.enable(gl.SAMPLE_COVERAGE); gl.sampleCoverage(0.5, false); To check the sample coverage values, query the SAMPLE_COVERAGE_VALUE and SAMPLE_COVERAGE_INVERT constants. gl.getParameter(gl.SAMPLE_COVERAGE_VALUE); // 0.5 gl.getParameter(gl.SAMPLE_COVERAGE_INVERT); // false Specifications Specification Status Comment WebGL 1.0The definition of 'sampleCoverage' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glSampleCoverage' in that specification. Standard Man page of the O...
WebGLRenderingContext.stencilFunc() - Web APIs
is done. The default value is all 1. Return value None. Examples The stencil testing is disabled by default. To enable or disable stencil testing, use the enable() and disable() methods with the argument gl.STENCIL_TEST. gl.enable(gl.STENCIL_TEST); gl.stencilFunc(gl.LESS, 0, 0b1110011); To get the current stencil function, reference value, or other stencil information, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FUNC); gl.getParameter(gl.STENCIL_VALUE_MASK); gl.getParameter(gl.STENCIL_REF); gl.getParameter(gl.STENCIL_BACK_FUNC); gl.getParameter(gl.STENCIL_BACK_VALUE_MASK); gl.getParameter(gl.STENCIL_BACK_REF); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment WebGL 1.0The definition of 'stencilFunc' in...
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
lt value is all 1. Return value None. Examples The stencil testing is disabled by default. To enable or disable stencil testing, use the enable() and disable() methods with the argument gl.STENCIL_TEST. gl.enable(gl.STENCIL_TEST); gl.stencilFuncSeparate(gl.FRONT, gl.LESS, 0.2, 1110011); To get the current stencil function, reference value, or other stencil information, query the following constants with getParameter(). gl.getParameter(gl.STENCIL_FUNC); gl.getParameter(gl.STENCIL_VALUE_MASK); gl.getParameter(gl.STENCIL_REF); gl.getParameter(gl.STENCIL_BACK_FUNC); gl.getParameter(gl.STENCIL_BACK_VALUE_MASK); gl.getParameter(gl.STENCIL_BACK_REF); gl.getParameter(gl.STENCIL_BITS); Specifications Specification Status Comment WebGL 1.0The definition of 'stencilFuncSepa...
WebGLRenderingContext.stencilMask() - Web APIs
d back stencil writemasks to different values. Syntax void gl.stencilMask(mask); Parameters mask A GLuint specifying a bit mask to enable or disable writing of individual bits in the stencil planes. By default, the mask is all 1. Return value None. Examples gl.stencilMask(110101); To get the current stencil masks, query the STENCIL_WRITEMASK, STENCIL_BACK_WRITEMASK, or STENCIL_BITS constants. gl.getParameter(gl.STENCIL_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BACK_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BITS); // 0 Specifications Specification Status Comment WebGL 1.0The definition of 'stencilMask' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilMask' in that specification. ...
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
pdated. 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 individual bits in the stencil planes. By default, the mask is all 1. Return value None. Examples gl.stencilMaskSeparate(gl.FRONT, 110101); To get the current stencil masks, query the STENCIL_WRITEMASK, STENCIL_BACK_WRITEMASK, or STENCIL_BITS constants. gl.getParameter(gl.STENCIL_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BACK_WRITEMASK); // 110101 gl.getParameter(gl.STENCIL_BITS); // 0 Specifications Specification Status Comment WebGL 1.0The definition of 'stencilMaskSeparate' in that specification. Recommendation Initial definition. OpenGL ES 2.0The definition of 'glStencilMaskSeparate' in that...
WebGLRenderingContext - Web APIs
nvas = document.getElementById('myCanvas'); var gl = canvas.getContext('webgl'); Once you have the WebGL rendering context for a canvas, you can render within it. The WebGL tutorial has more information, examples, and resources on how to get started with WebGL. If you require a WebGL 2.0 context, see WebGL2RenderingContext; this supplies access to an implementation of OpenGL ES 3.0 graphics. Constants See the WebGL constants page. The WebGL context The following properties and methods provide general information and functionality to deal with the WebGL context: WebGLRenderingContext.canvas A read-only back-reference to the HTMLCanvasElement. Might be null if it is not associated with a <canvas> element. WebGLRenderingContext.commit() Pushes frames back to the original HTMLCanvasEl...
Compressed texture formats - Web APIs
ardware support, therefore no specific formats are required by WebGL; instead, a context can make different formats available, depending on hardware support. This site shows which formats are supported in the used browser. Usage of compressed formats first requires activating the respective extension with WebGLRenderingContext.getExtension(). If supported, it will return an extension object with constants for the added formats and the formats will also be returned by calls to gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS). (E.g. ext.COMPRESSED_RGBA_S3TC_DXT1_EXT for the WEBGL_compressed_texture_s3tc extension.) These can then be used with compressedTexImage[23]D or compressedTexSubImage[23]D instead of texImage2D calls. Note that WebGL makes no functionality available to compress or decompress te...
WebGL types - Web APIs
Web › API › WebGL API › Types
GLboolean boolean A Boolean. GLbitfield unsigned long A bit field that stores multiple, logical bits. Used for example in WebGLRenderingContext.clear(). GLbyte byte 8-bit twos complement signed integer. GLshort short 16-bit twos complement signed integer. ...
WebSocket - Web APIs
Web › API › WebSocket
The WebSocket object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection. To construct a WebSocket, use the WebSocket() constructor. Constructor WebSocket(url[, protocols]) Returns a newly created WebSocket object. Constants Constant Value WebSocket.CONNECTING 0 WebSocket.OPEN 1 WebSocket.CLOSING 2 WebSocket.CLOSED 3 Properties WebSocket.binaryType The binary data type used by the connection. WebSocket.bufferedAmount Read only The number of bytes of queued data. WebSocket.extensions Read only The extensions selected by the server. WebSocket.onclose An event listener to be called when the connection is closed. WebSocket.onerr...
WebXR performance guide - Web APIs
n of the loop is completed, the memory is released. A simple change can optimize this significantly: const vertexList = ... const normalMatrix = mat4.create(); const modelViewMatrix = mat4.create(); function drawScene(gl, view, programInfo, buffers, texture, deltaTime) { ... for (object in scene) { ... } } Now, instead of allocating variables every loop iteration, we're using global constants(or class member constants). This has multiple benefits: The memory allocated for each value or structure will not need to be reallocated every frame. This reduces the potential for triggering garbage collection, and optimizes memory use. You can't accidentally delete the objects that contain your vectors and matrices, since they're constants. You can, however, still replace the contents of e...
Visualizations with Web Audio API - Web APIs
Read those pages to get more information on how to use them. To capture data, you need to use the methods AnalyserNode.getFloatFrequencyData() and AnalyserNode.getByteFrequencyData() to capture frequency data, and AnalyserNode.getByteTimeDomainData() and AnalyserNode.getFloatTimeDomainData() to capture waveform data. These methods copy data into a spec...
XPathEvaluator.evaluate() - Web APIs
ression to be parsed and evaluated. contextNode A Node representing the context to use for evaluating the expression. resolver Optional Permits translation of all prefixes, including the xml namespace prefix, within the XPath expression into appropriate namespace URIs. type Optional Specifies the type of result to be returned by evaluating the expression. This must be one of the XPathResult.Constants. result Optional Allows to specify a result object which may be reused and returned by this method. If this is specified as null or the implementation does not reuse the specified result, a new result object will be returned. Return value An XPathResult object representing the result of evaluating the XPath expression. Exceptions INVALID_EXPRESSION_ERR If the expression is not legal accor...
XPathException.code - Web APIs
Syntax var exceptionCode = exception.code; Value A short number representing the error code. ...
XPathException - Web APIs
In the DOM XPath API the XPathException interface represents exception conditions that can be encountered while performing XPath operations. Properties XPathException.code Read only Returns a short that contains one of the error code constants. Constants Constant Value Description INVALID_EXPRESSION_ERR 51 If the expression has a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator or contains specialized extension functions or variables not supported by this implementation. TYPE_ERR 52 If the expression cannot be converted to return the specified type. Specifications Specification Status Comment Document Object Model (DOM) Level 3 XPath SpecificationThe de...
XPathExpression.evaluate() - Web APIs
PathExpression interface executes an XPath expression on the given node or document and returns an XPathResult. Syntax XPathResult node.evaluate(contextNode, type, result); Parameters contextNode A Node representing the context to use for evaluating the expression. type Optional Specifies the type of result to be returned by evaluating the expression. This must be one of the XPathResult.Constants. result Optional Allows to specify a result object which may be reused and returned by this method. If this is specified as null or the implementation does not reuse the specified result, a new result object will be returned. Return value An XPathResult object representing the result of evaluating the XPath expression. Exceptions INVALID_EXPRESSION_ERR If the expression is not legal accor...
Web APIs
Web › API
ortsRule CSSUnitValue CSSUnparsedValue CSSValue CSSValueList CSSVariableReferenceValue Cache CacheStorage CanvasCaptureMediaStreamTrack CanvasGradient CanvasImageSource CanvasPattern CanvasRenderingContext2D CaretPosition ChannelMergerNode ChannelSplitterNode CharacterData ChildNode Client Clients Clipboard ClipboardEvent ClipboardItem CloseEvent Comment CompositionEvent ConstantSourceNode ConstrainBoolean ConstrainDOMString ConstrainDouble ConstrainULong ContentIndex ContentIndexEvent ConvolverNode CountQueuingStrategy CrashReportBody Credential CredentialsContainer Crypto CryptoKey CryptoKeyPair CustomElementRegistry CustomEvent D DOMConfiguration DOMError DOMException DOMHighResTimeStamp DOMImplementation DOMImplementationList DOMLocator DOMMatrix D...
Mouse gesture events - Developer guides
ation about the gesture. These are: direction The direction in which the swipe moved. delta The amount by which the gesture moved; for rotation, this value is in degrees. Positive values are clockwise and negative values are counterclockwise. For magnification, this value is implementation-specific, but the value is positive for zooming in and negative for zooming out. Direction constants The direction field in the gesture events can take one of the following values: SimpleGestureEvent.DIRECTION_LEFT Leftward swipe. SimpleGestureEvent.DIRECTION_RIGHT Rightward swipe. SimpleGestureEvent.DIRECTION_UP Upward swipe. SimpleGestureEvent.DIRECTION_DOWN Downward swipe. SimpleGestureEvent.ROTATION_COUNTERCLOCKWISE Counter-clockwise rotation. Sim...
A re-introduction to JavaScript (JS tutorial) - JavaScript
they are asked to perform an instruction that's valid on a Number but not on a 32-bit integer. This can be important for bit-wise operations. The standard arithmetic operators are supported, including addition, subtraction, modulus (or remainder) arithmetic, and so forth. There's also a built-in object that we did not mention earlier called Math that provides advanced mathematical functions and constants: Math.sin(3.5); var circumference = 2 * Math.PI * r; You can convert a string to an integer using the built-in parseInt() function. This takes the base for the conversion as an optional second argument, which you should always provide: parseInt('123', 10); // 123 parseInt('010', 10); // 10 In older browsers, strings beginning with a "0" are assumed to be in octal (radix 8), but this hasn't ...
JavaScript data types and data structures - JavaScript
es: Number and BigInt (see below). The Number type is a double-precision 64-bit binary format IEEE 754 value (numbers between -(253 - 1) and 253 - 1). In addition to representing floating-point numbers, the number type has three symbolic values: +Infinity, -Infinity, and NaN ("Not a Number"). To check for the largest available value or smallest available value within +-Infinity, you can use the constants Number.MAX_VALUE or Number.MIN_VALUE. Starting with ECMAScript 2015, you are also able to check if a number is in the double-precision floating-point number range using Number.isSafeInteger() as well as Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER. Beyond this range, integers in JavaScript are not safe anymore and will be a double-precision floating point approximation of the value. T...
TypeError: invalid assignment to const "x" - JavaScript
TypeError: invalid assignment to const "x" (Firefox) TypeError: Assignment to constant variable. (Chrome) TypeError: Assignment to const (Edge) TypeError: Redeclaration of const 'x' (IE) Error type TypeError What went wrong? A constant is a value that cannot be altered by the program during normal execution. It cannot change through re-assignment, and it can't be redeclared. In JavaScript, constants are declared using the const keyword. Examples Invalid redeclaration Assigning a value to the same constant name in the same block-scope will throw. const COLUMNS = 80; // ... COLUMNS = 120; // TypeError: invalid assignment to const `COLUMNS' Fixing the error There are multiple options to fix this error. Check what was intended to be achieved with the constant in question. Rename If you...
SyntaxError: missing = in const declaration - JavaScript
LAG = '#ff0'). Message SyntaxError: Const must be initalized (Edge) SyntaxError: missing = in const declaration (Firefox) SyntaxError: Missing initializer in const declaration (Chrome) Error type SyntaxError What went wrong? A constant is a value that cannot be altered by the program during normal execution. It cannot change through re-assignment, and it can't be redeclared. In JavaScript, constants are declared using the const keyword. An initializer for a constant is required; that is, you must specify its value in the same statement in which it's declared (which makes sense, given that it can't be changed later). Examples Missing const initializer Unlike var or let, you must specify a value for a const declaration. This throws: const COLUMNS; // SyntaxError: missing = in const declara...
Math.log() - JavaScript
number. If the number is negative, NaN is returned. Description If the value of x is 0, the return value is always -Infinity. If the value of x is negative, the return value is always NaN. Because log() is a static method of Math, you always use it as Math.log(), rather than as a method of a Math object you created (Math is not a constructor). If you need the natural log of 2 or 10, use the constants Math.LN2 or Math.LN10 . If you need a logarithm to base 2 or 10, use Math.log2() or Math.log10() . If you need a logarithm to other bases, use Math.log(x) / Math.log(otherBase) as in the example below; you might want to precalculate 1 / Math.log(otherBase) . Examples Using Math.log() Math.log(-1); // NaN, out of range Math.log(0); // -Infinity Math.log(1); // 0 Math.log(10); // 2.302585092...
Math - JavaScript
It's not a function object. Math works with the Number type. It doesn't work with BigInt. Description Unlike many other global objects, Math is not a constructor. All properties and methods of Math are static. You refer to the constant pi as Math.PI and you call the sine function as Math.sin(x), where x is the method's argument. Constants are defined with the full precision of real numbers in JavaScript. Note: Many Math functions have a precision that's implementation-dependent. This means that different browsers can give a different result. ...
Number - JavaScript
Values of other types can be converted to numbers using the Number() function. The JavaScript Number type is a double-precision 64-bit binary format IEEE 754 value, like double in Java or C#. This means it can represent fractional values, but there are some limits to what it can store. A Number only keeps about 17 decimal places of precision; arithmetic is subject to rounding. The largest value a Number can hold is about 1.8x10308. ...
WebAssembly - JavaScript
The WebAssembly JavaScript object acts as the namespace for all WebAssembly-related functionality. Unlike most other global objects, WebAssembly is not a constructor (it is not a function object). You can compare it to Math, which is also a namespace object for mathematical constants and functions, or to Intl which is the namespace object for internationalization constructors and other language-sensitive functions. Description The primary uses for the WebAssembly object are: Loading WebAssembly code, using the WebAssembly.instantiate() function. Creating new memory and table instances via the WebAssembly.Memory()/WebAssembly.Table() constructors. Providing facilities to handle errors that occur in WebAssembly via the WebAssembly.CompileError()/WebAssembly.LinkError()/WebAssembly.RuntimeErr...
Values - MathML
Lengths Several MathML presentation elements have attributes that accept length values used for size or spacing. MathML accepts different units and constants for specifying lengths. Units Unit Description em font-relative unit ex font-relative unit. (The "x"-height of the element, 1ex ? 0.5em in many fonts) px Pixels in Inches (1 inch = 2.54 centimeters) cm Centimeters mm Millimeters pt Points (1 point = 1/72 inch) pc Picas (1 pica = 12 points) % Percentage of the default value. Constants A replacement for the deprecated constants below is: veryverythinmathspace => 0.05555555555555555em verythinmathspace => 0.1111111111111111em thinmathspace => 0...
<mi> - MathML
Web › MathML › Element › mi
You can also have arbitrary text in it to mark up terms. Attributes class, id, style Provided for use with stylesheets. dir The text direction. Possible values are either ltr (left to right) or rtl (right to left). href Used to set a hyperlink to a specified URI. mathbackground The background color. You can use #rgb, #rrggbb and HTML color names. mathcolor The text color. You can use #rgb, #rrggbb and HTML color names. mathsize The size of the content. See length for possible values. ...
Caching compiled WebAssembly modules - WebAssembly
e: The entire site's wasm cache (not just the given URL) is versioned by the specified dbVersion passed into the function. If the wasm module code is updated, or its URL changes, you will need to update dbVersion. Any subsequent call to instantiateCachedURL() will then clear out the entire cache, allowing you to avoid using out-of-date modules. ...
Understanding WebAssembly text format - WebAssembly
ported table. This function creates a constant containing the value 0, and then uses the i32.load command to load the value contained in the provided memory index. The index provided is 0 -- again, it implicitly pops the previous value off the stack. So shared0func loads and returns the value stored at memory index 0. In shared1.wat, we export a function called doIt -- this function creates two constants containing the values 0 and 42, then calls i32.store to store a provided value at a provided index of the imported memory. Again, it implicitly pops these values off the stack, so the result is that it stores the value 42 in memory index 0, In the last part of the function, we create a constant with value 0, then call the function at this index 0 of the table, which is shared0func, stored there ...