Search completed in 1.16 seconds.
70 results for "nsicontent":
Your results are loading. Please wait...
nsIContentPrefService2
dom/interfaces/base/nsIContentPrefService2.idlScriptable Asynchronous API for Content Preferences 1.0 66 Introduced Gecko 20.0 Inherits from: nsISupports Last changed in Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) Description Content preferences allow the application to associate arbitrary data, or "preferences", with specific domains, or web "content". Specifically, a content preference is a structure with three values: a domain with which the preference is associated, a name that identifies the preference within its domain, and a value. ...
... Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) Description Content preferences allow the application to associate arbitrary data, or "preferences", with specific domains, or web "content". Specifically, a content preference is a structure with three values: a domain with which the preference is associated, a name that identifies the preference within its domain, and a value. (See nsIContentPref below.) For example, if you want to remember the user's preference for a certain zoom level on www.mozilla.org pages, you might store a preference whose domain is "www.mozilla.org", whose name is "zoomLevel", and whose value is the numeric zoom level. A preference need not have a domain, and in that case the preference is called a "global" preference. This interface doesn't impart any special...
...ntext to use storage appropriate to the context's usePrivateBrowsing attribute: if usePrivateBrowsing is true, temporary private-browsing storage is used, and otherwise permanent storage is used. A context can be obtained from the window or channel whose content pertains to the preferences being modified or retrieved. Callbacks The methods of callback objects are always called asynchronously. ...
...And 27 more matches
nsIContentPrefService
Use the asynchronous interface nsIContentPrefService2 instead. Provides a way for extensions and browser code to save preferences for specific websites. Preferences are saved as key/value pairs on a per-website basis. dom/interfaces/base/nsIContentPrefService.idlScriptable Please add a summary to this article. Last changed in Gecko 2 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Inherits from: nsISupports Implemented by: @mozilla.org/content-pref/service;1. ...
...IContentPrefService.idlScriptable Please add a summary to this article. Last changed in Gecko 2 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Inherits from: nsISupports Implemented by: @mozilla.org/content-pref/service;1. ...
...ged in Gecko 2 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Inherits from: nsISupports Implemented by: @mozilla.org/content-pref/service;1. ...
...And 9 more matches
nsIContentPolicy - Archive of obsolete content
This interface can be very useful if you are developing a content-aware plugin (blocking ads or altering the look of content, for example), or if you want to stop or allow user-browsed URLs. ...
...This interface can be very useful if you are developing a content-aware plugin (blocking ads or altering the look of content, for example), or if you want to stop or allow user-browsed URLs. ...
...mechanism. Implementations of this interface can be used to control the loading of various types of out-of-line content, or the processing of certain types of inline content. 63 Introduced Gecko 1.0 Inherits from: nsIContentPolicyBase Last changed in Gecko 42 (Firefox 42 / Thunderbird 42 / SeaMonkey 2.39) You can observe content that is being loaded into your browser by implementing nsIContentPolicy. This interface can be very useful if you are developing a content-aware plugin (blocking ads or altering the look of content, for example), or if you want to stop or allow user-browsed URLs. Warning: Do not block the caller in your implementations of shouldLoad() or shouldProcess() (for example, by launching a dialog to prompt the user for something).") Note: In reality, much of this ...
...And 5 more matches
nsIContentPrefCallback2
This will be called exactly once for each method invocation, and afterward no other callback methods will be called. ...
...This will be called exactly once for each method invocation, and afterward no other callback methods will be called. ...
... completed. handleError() Called when an error occurs. This may be called multiple times before handleCompletion is called. ...
...es before handleCompletion is called. ...
nsIContentViewManager
content/base/public/nsIFrameLoader.idlScriptable Manages the content views contained in a browser 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) To obtain a reference to the view manager for a document, you can QueryInterface() the nsIFrameLoader object to nsIContentViewManager. See Getting access to content views for details. Once you have the view manager, you can call getContentViewsIn() to get a list of the content views for a given portion of the browser display, then use those nsIContentView objects to manipulate the content views. Method overview void getContentViewsIn(in float aXPx, in float aYPx, in float aTopSize, in float aRightSize, in float aBottomSize, in float ...
...ntViewsIn() to get a list of the content views for a given portion of the browser display, then use those nsIContentView objects to manipulate the content views. Method overview void getContentViewsIn(in float aXPx, in float aYPx, in float aTopSize, in float aRightSize, in float aBottomSize, in float aLeftSize, [optional] out unsigned long aLength, [retval, array, size_is(aLength)] out nsIContentView aResult); Attributes Attribute Type Description rootContentView nsIContentView The root content view. Read only. Methods getContentViewsIn() Returns an array of nsIContentView objects representing all of the content views that intersect with the specified rectangle in the browser. Note: The rectangle is specified using an anchor point, then four...
...user clicked (or touched) the screen, and expand outward to create a rectangle from that point. Pixels are in chrome device pixels and are relative to the browser element. void getContentViewsIn( in float aXPx, in float aYPx, in float aTopSize, in float aRightSize, in float aBottomSize, in float aLeftSize, out unsigned long aLength, Optional [retval, array, size_is(aLength)] out nsIContentView aResult ); Parameters aXPx The X coordinate of the anchor point of the rectangle, in CSS pixels. aYPx The Y coordinate of the anchor point of the rectangle, in CSS pixels. aTopSize The distance upward from the Y anchor to expand the rectangle. aRightSize The distance to the right from the X anchor to expand the rectangle. aBottomSize The distance downward from the Y anchor to ex...
...s. aTopSize The distance upward from the Y anchor to expand the rectangle. aRightSize The distance to the right from the X anchor to expand the rectangle. aBottomSize The distance downward from the Y anchor to expand the rectangle. aLeftSize The distance to the left from the X anchor to expand the rectangle. aLength Optional If specified, on return this parameter indicates the number of nsIContentView objects returned in the aResult array. aResult On return, an array of nsIContentView objects representing the content views in the specified rectangle. ...
nsIContentFrameMessageManager
is interface provides the environment for scripts that are loaded into content frames using the nsIFrameScriptLoader interface. It enables these scripts to receive messages from the chrome process and send messages back to the chrome process. Frame scripts can send either synchronous or asynchronous messages to the chrome process: for details on these messaging APIs see the documentation for the nsIContentFrameMessageManager's parent classes nsISyncMessageSender and nsIMessageSender. Methods void dump(in DOMString aStr); DOMString atob(in DOMString aAsciiString); DOMString btoa(in DOMString aBase64Data); dump() Prints the specified string to standard output. Parameters Name Type Description aStr String The message to log. ...
...ll nsIDocShell: the top level docShell or null. Read only. Examples Once you obtain the conten frame messge manager, you can send messages to listeners who registered with Services.mm.addMessageListener Get content message manager from browser This could would run in a nsIDOMWindow scope. var aCFMM = gBrowser.selectedBrowser._docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIContentFrameMessageManager); Get content message manager from content window window here is a HTML window or any window inside a tab, this code would run from a framescript. var aCFMM = window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDocShell) .QueryInterface(Ci.nsIInterfaceRequestor) .getInte...
...ageManager); Get content message manager from content window window here is a HTML window or any window inside a tab, this code would run from a framescript. var aCFMM = window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDocShell) .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIContentFrameMessageManager); ...
nsIContentViewer
docshell/base/nsIContentViewer.idlScriptable Handles displaying content. Inherits from: nsISupports Last changed in Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7) Implemented by: ?????????????????????????????????????. ...
.../base/nsIContentViewer.idlScriptable Handles displaying content. Inherits from: nsISupports Last changed in Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7) Implemented by: ?????????????????????????????????????. ...
...ly. Native code only! Note: Prior to Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7), this attribute was part of nsIDocumentViewer. presShell nsIPresShellPtr Read only. Native code only! Note: Prior to Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7), this attribute was part of nsIDocumentViewer. previousViewer nsIContentViewer The previous content viewer, which has been closed but not destroyed. Native code only! sticky boolean Methods clearHistoryEntry() Clears the current history entry. This is used to clear out the saved presentation state. void clearHistoryEntry(); Parameters None. close() All users of a content viewer are responsible for calling both close() and destroy(), in that ...
nsIContentPref
nsIContentPref dom/interfaces/base/nsIContentPrefService2.idlScriptable A content preference 1.0 66 Introduced Gecko 20.0 Inherits from: nsISupports Last changed in Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) Attributes Attribute Type Description domain AString Read only. name AString Read only. value nsIVariant Read only. ...
... 1.0 66 Introduced Gecko 20.0 Inherits from: nsISupports Last changed in Gecko 20.0 (Firefox 20.0 / Thunderbird 20.0 / SeaMonkey 2.17) Attributes Attribute Type Description domain AString Read only. name AString Read only. value nsIVariant Read only. See also nsIContentPrefService2 nsIContentPrefCallback2 ...
nsIContentPrefObserver
1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Method overview void onContentPrefRemoved(in AString aGroup, in AString aName); void onContentPrefSet(in AString aGroup, in AString aName, in nsIVariant aValue); Methods onContentPrefRemoved() Called when a content preference is removed. void onContentPrefRemoved( in AString aGroup, in AString aName ); Parameters aGroup The group to which the removed preference belonged; this may be the URI of a web site. ...
...ing the preference). ...
nsIContentSecurityPolicy
content/base/public/nsIContentSecurityPolicy.idlScriptable Describes an XPCOM component used to model and enforce Content Security Policies. 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview boolean permitsAncestry(in nsIDocShell docShell); void refinePolicy(in AString policyString, in nsIURI selfURI); void scanRequestData(in nsIHttpChannel aChannel); void sendReports(in AString blockedURI, in AString violatedDirective); short shouldLoad(in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsISupports aExtra); short shouldProcess(in unsigned long aContentType, in nsIURI aCont...
nsIContentSniffer
Components implementing this interface can determine a MIME type from a chunk of bytes. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) To implement this interface use net-content-sniffers category. See netwerk/build/nsNetCID.h about NS_CONTENT_SNIFFER_CATEGORY. Method overview ACString getMIMETypeFromContent(in nsIRequest aRequest, [const,array,size_is(aLength)] in octet aData, in unsigned long aLength); Methods getMIMETypeFromContent() Given a chunk of data, determines a MIME type. Information from the given request may be used in order to make a better decision. Note: Implementations should consider the request read-only. ...
Index
Mozilla › Tech › XPCOM › Index
ence The console service is the back-end for the Error Console, bundled with every Mozilla application, and for Firefox's Web Console and Browser Console. 432 nsIContainerBoxObject Interfaces, Interfaces:Scriptable, NeedsContent, XPCOM, XPCOM Interface Reference The boxObject belonging to a XUL browser, editor or iframe element implements this interface. ...
...erface. 433 nsIContentFrameMessageManager Interface Reference, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference This interface provides the environment for scripts that are loaded into content frames using the nsIFrameScriptLoader interface. It enables these scripts to receive messages from the chrome process and send messages back to the chrome process. 434 nsIContentPref Preferences, XPCOM No summary! ...
...rence, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference This interface provides the environment for scripts that are loaded into content frames using the nsIFrameScriptLoader interface. It enables these scripts to receive messages from the chrome process and send messages back to the chrome process. ...
...And 7 more matches
Finishing the Component
to use unfrozen interfaces, you should contact the developers who are responsible for the code you're trying to use (i.e., module owners) and ask them how best to do what you are trying to do. Be as precise you possibly can. They may be able to suggest a supported alternative, or they may be able to notify you about pending changes. The interface that we need for this project is something called nsIContentPolicy. At the time this book was written, this interface was under review. An interface reaches this state when a group of module owners and peers are actively engaged in discussion about how best to expose it. Usually there are only minor changes to interfaces marked with such a tag. Even with interfaces marked "under review," however, it's still a good idea to contact the module owners responsi...
...ou are interested in using. Copying Interfaces into Your Build Environment To get and implement interfaces that are not part of Gecko in your component, simply create a new directory in the Gecko SDK named unfrozen. Copy the headers and IDL files that you need from the content/base/public source directory of the Gecko build into this new directory. (For WebLock, all you need are the headers for nsIContentPolicy and the nsIContentPolicy.idl.) Then, using the same steps you used to create the Weblock.h, create a header from this IDL file using the xpidl compiler. Once you have these interface and header files, you can modify the WebLock class to implement the nsIContentPolicy interface. The Weblock class will then support four interfaces: nsISupports, nsIObserver, nsIContentPolicy, and iWeblock. ...
...interface. The Weblock class will then support four interfaces: nsISupports, nsIObserver, nsIContentPolicy, and iWeblock. WebLock Interfaces Interface Name Defined by Status Summary nsISupports XPCOM Frozen Provides interface discovery, and object reference counting nsIObserver XPCOM Frozen Allows messaging passing between objects nsIContentPolicy Content Not Frozen Interface for policy control mechanism iWeblock Web Lock Not Frozen Enables and disables Weblock. Also, provides access to the URL that are whitelisted. ...
...And 6 more matches
The life of an HTML HTTP request - Archive of obsolete content
Warning: The content of this article may be out of date. It was last updated in 1999. (1) The loading of the url is started in nsWebShell::DoLoadURL (called from some LoadURL or LoadURI variant in the webshell). The webshell then tells its DocumentLoader to load (command "view") the specified url. [note: Passes nsWebShell.mObserver as nsIStreamObserver and the webshell as nsIContentViewerContainer to the DocLoader.] (2) The Document Loader calls NS_OpenURI with the url to begin transfering the requested file. Necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsIProtocolHandler (in this case nsHTTPHandler) and asks it for a nsIChannel (nsHTTPChannel). The channel represents the connection to the server, and is t...
...ion to the server, and is the source of the html data stream. (3) When data is starting to come from the webserver the nsIChannel calls the OnStartRequest in the DocumenLoader. Now the channel knows the content type of the incoming data, so the DocumentLoader can find an nsIDocumentLoaderFactory for the "text/html" content type (in this case an nsLayoutDLF). This factory is then told to create a nsIContentViewer. The factory creates a ContentViewer. In most cases (including this) it also creates a nsIDocument (nsHTMLDocument) and binds it to the ContentViewer. The ContentViewer is then Embed():ed into the ContentViewerContainer (the WebShell). (4) The document then creates a nsIParser for parsing the input stream. For HTML document this is an nsParser, which also implements nsIStreamListener. This...
...ntViewer. The ContentViewer is then Embed():ed into the ContentViewerContainer (the WebShell). (4) The document then creates a nsIParser for parsing the input stream. For HTML document this is an nsParser, which also implements nsIStreamListener. This StreamListener is returned to the DocumentLoader and connected to the nsIChannel of the request. (5) The Document (nsHTMLDocument) also creates a nsIContentSink (nsHTMLContentSink) and connects it to the parser and the document. The parser then parses the stream it gets via its StreamListener interface and converts it to nsIParserNodes which it places in the ContentSink. The parser typically gets data from the stream in 8kb blocks and parses these blocks, block by block. After every parsed block it passes the parsed data as nsIParserNodes to the Con...
...And 2 more matches
nsIInProcessContentFrameMessageManager
content/base/public/nsIFrameMessageManager.idlNot scriptable ??? Add brief description of Interface here! ...
... content/base/public/nsIFrameMessageManager.idlNot scriptable ??? Add brief description of Interface here! ...
...dlNot scriptable ??? Add brief description of Interface here! ...
...And 2 more matches
The Implementation of the Application Object Model - Archive of obsolete content
ed to represent a single node in a content tree for an XML language. In the absence of any modifications to XUL, etc., this is what would be used by default to hold the tree for a remote XUL file. This nsXMLElement implements a whole slew of interfaces, since Raptor has multiple APIs for referring to these objects. Examples of these interfaces include nsIDOMElement, nsIDOMNode, nsIXMLContent, and nsIContent. What is RDF? RDF (pronounced R-D-F) has never been a ravening demon intent upon taking over the Earth, although that does depend on who you ask. RDF stands for resource description framework, a rather intimidating name that doesn't do much to help the layman understand exactly what it does. RDF provides a very general mechanism for representing relationships between different disparate types ...
...Timing. It's now or never. If this approach isn't taken now, then we'll fall back into our old pattern. This is the pivotal point, because the apps are all being re-written from scratch. For this particular codebase, if we don't do this from start, we won't do it at all. Why use RDF at all? Ok, ok. So you've convinced me that XUL is the way and the light. But why do you need to use RDF at all? nsIContent, nsIDOMElement, and all of those interfaces mentioned at the beginning of this document are just that: interfaces! Couldn't you just make mail content and bookmarks content etc. and have them implement those interfaces? The approach that I took in the past when faced with this question was to say, "RDF exists now. Much of it is written. To implement some sort of pluggable system that could do loc...
...mselves as the appropriate content to be instantiated for a given URI. We could do this using a registry that can map strings to CIDs, so we have a story for instantiating our different content nodes. But now let's consider one of these nodes, e.g., nsMailElement. Let's look at the set of interfaces that nsMailElement needs to implement in order to exist in a XUL tree as fully scriptable content. nsIContent, nsIDOMNode, nsIDOMElement, and nsIXMLElement must be implemented at a minimum. Four interfaces with over 100 methods combined, a significant portion of which are redundant. Every new kind of content node would have to implement all of these interfaces. Several of the implemented functions would even have identical implementations, i.e. duplicate code that would be doing the same thing in the fun...
...nted at a minimum. Four interfaces with over 100 methods combined, a significant portion of which are redundant. Every new kind of content node would have to implement all of these interfaces. Several of the implemented functions would even have identical implementations, i.e. duplicate code that would be doing the same thing in the function bodies. Here's another problem. The various interfaces, nsIContent et.al., are not yet solidified. They are likely to change following the first release of NGLayout, and when they do, anyone that implemented one of those interfaces will have to change as well in order to upgrade to the new world. Statement #1 The two points raised in the previous two paragraphs, namely (1) redundancy of methods in the interfaces as well as a likely code redundancy in the impl...
HTML parser threading
ponding normal main-thread dynamically-allocated atom has to be obtained for the same string and used instead of the nsHtml5Atom. nsHtml5Atom objects are guaranteed to be immutable and to stay alive for the lifetime of the parser instance, so it's safe for the main thread to call their methods (as is necessary to find the corresponding normal atom). ...
...For any given content handle, the node creation tree op is always the first tree op in queue that uses that handle, so subsequent non-creation tree ops can safely dereference the handle to obtain a real node. ...
...le points to memory allocated by the tree builder and guaranteed to stick around for the life time of the parser. The tree builder never dereferences a content handle. In fact, a content handle won't have an actual node behind it initially. Only when the tree op executor executes a node creation tree op, the nsIContent* that points to the node gets written to the memory location pointed to by the nsIContent**. ...
...(This indeed means that removing parser-created nodes from the DOM during parsing doesn't release memory until the parser stops parsing, which is, in theory, a problem for long polling using HTML in an iframe e.g. ...
nsIFocusManager
nsIDOMElement getFocusedElementForWindow(in nsIDOMWindow aWindow, in PRBool aDeep, out nsIDOMWindow aFocusedWindow); PRUint32 getLastFocusMethod(in nsIDOMWindow window); vo...
...@mozilla.org/focus-manager;1"] .getService(Components.interfaces.nsIFocusManager); Method overview void clearFocus(in nsIDOMWindow aWindow); void contentRemoved(in nsIDocument aDocument, in nsIContent aElement); Native code only! Obsolete since Gecko 2.0 void fireDelayedEvents(in nsIDocument aDocument); Native code only! void focusPlugin(in nsIContent aPlugin); Native code only! nsIDOMElement getFocusedElementForWindow(in nsIDOMWindow aWindow, in PRBool aDeep, out nsIDOMWindow aFocusedWindow); PRUint32 getLastFocusMethod(in nsIDOMWindow window); void moveCaretToFocus(in nsIDOMWindow aWindow); void elementIsFocusable(in nsIDOMElement aElement, in unsigned long aFlags); nsIDOMElement moveFocus(in nsI...
... NS_ERROR_INVALID_ARG If aWindow is null. Native code only!contentRemoved Obsolete since Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)This 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. Called when content has been removed. void contentRemoved( in nsIDocument aDocument, in nsIContent aElement ); Parameters aDocument aElement Native code only!fireDelayedEvents Fire any events that have been delayed due to synchronized actions. void fireDelayedEvents( in nsIDocument aDocument ); Parameters aDocument Native code only!focusPlugin Indicate that a plugin wishes to take the focus. This is similar to a normal focus except that the widget focus i...
...ny events that have been delayed due to synchronized actions. void fireDelayedEvents( in nsIDocument aDocument ); Parameters aDocument Native code only!focusPlugin Indicate that a plugin wishes to take the focus. This is similar to a normal focus except that the widget focus is not changed. Updating the widget focus state is the responsibility of the caller. void focusPlugin( in nsIContent aPlugin ); Parameters aPlugin getFocusedElementForWindow() nsIDOMElement getFocusedElementForWindow( in nsIDOMWindow aWindow, in PRBool aDeep, out nsIDOMWindow aFocusedWindow ); Parameters aWindow If equal to the current value of focusedWindow, then the returned element will be the application-wide focused element (the value of focusedElement). The return value will b...
nsIHTMLEditor
editor/idl/nsIHTMLEditor.idlScriptable Please add a summary to this article. ...
... long aSelectionType); void rebuildDocumentFromSource(in AString aSourceString); void removeAllDefaultProperties(); void removeAllInlineProperties(); void removeDefaultProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); void removeInlineProperty(in nsIAtom aProperty, in AString aAttribute); void removeInsertionListener(in nsIContentFilter inFilter); void removeList(in AString aListType); void replaceHeadContentsWithHTML(in AString aSourceToInsert); void selectElement(in nsIDOMElement aElement); void setBackgroundColor(in AString aColor); void setBodyAttribute(in AString aAttr, in AString aValue); void setCaretAfterElement(in nsIDOMElement aElement); void setCSSIn...
...Parameters aProperty The property to set by default. aAttribute The attribute of the property, if applicable. May be null. Example: aProperty="font", aAttribute="color" aValue If aAttribute is not null, the value of the attribute. Example: aProperty="font", aAttribute="color", aValue="0x00FFFF" addInsertionListener() Add listener for insertion override. void addInsertionListener( in nsIContentFilter inFilter ); Parameters inFilter Function which callers want called during insertion. align() Document me! void align( in AString aAlign ); Parameters aAlign breakIsVisible() Checks whether a BR node is visible to the user. boolean breakIsVisible( in nsIDOMNode aNode ); Parameters aNode Return value canDrag() Decides if a drag should be started (for ex...
...sIEditorProperty.href(). aAttribute The attribute of the property, if applicable. May be null. Example: aProperty=nsIEditorProptery.font(), aAttribute="color" nsIEditProperty.allAttributes() is special. It indicates that all content-based text properties are to be removed from the selection. removeInsertionListener() Remove listener for insertion override. void removeInsertionListener( in nsIContentFilter inFilter ); Parameters inFilter Function which callers do not want called during insertion. removeList() Document me! void removeList( in AString aListType ); Parameters aListType replaceHeadContentsWithHTML() Replace all children of <HEAD> with string of HTML source. void replaceHeadContentsWithHTML( in AString aSourceToInsert ); Parameters aSourceToInsert ...
XPCOM Interface Reference by grouping
nsIInProcessContentFrameMessageManager nsIScriptableIO nsIXPCScriptable Future nsIXMLHttpRequestUpload Obsolete nsIXmlRpcClient nsIXmlRpcFault Security Auth nsIAuthModule nsIAuthPrompt nsIAuthPromptProvider nsIAuthPromptWrapper nsIAsyncVerifyRedirectCallback Content nsIContentPolicy Credentials nsILoginInfo nsILoginManager Using nsILoginManager nsILoginManagerStorage nsILoginMetaInfo History nsIGlobalHistory nsIGlobalHistory2 nsIGlobalHistory3 SSL nsIBadCertListener2 System Action nsICancelable...
... Environment nsIEnvironment Event nsIEventListenerInfo nsIEventListenerService nsIEventTarget Exception nsIException Extention nsIExtensionManager nsIInstallLocation External nsIExternalProtocolService Frame nsIContentFrameMessageManager History nsISHEntry nsISHistory Idle nsIIdleService Internal Command nsICommandLine nsICommandLineHandler nsICommandLineRunner Component nsIComponentManager Preferenc...
... History nsISHEntry nsISHistory Idle nsIIdleService Internal Command nsICommandLine nsICommandLineHandler nsICommandLineRunner Component nsIComponentManager Preferences nsIContentPrefObserver nsIContentPrefService nsIComponentRegistrar Internationalization nsIBidiKeyboard nsILocale IO FileSystem nsIDirectoryEnumerator nsIDirectoryIterator nsIDirectoryService nsIDirectoryServiceProvider nsID...
...iceProvider nsIDirectoryServiceProvider2 nsIDirIndex nsIDirIndexListener nsIDirIndexParser nsIFile nsILocalFile Stream nsIAsyncInputStream nsIAsyncOutputStream nsIAsyncStreamCopier nsIBinaryInputStream nsIBinaryOutputStream nsIContentSniffer nsIConverterInputStream nsIFileInputStream nsIFileOutputStream nsIInputStream nsIInputStreamCallback nsIOutputStream nsIOutputStreamCallback nsIScriptableInputStream nsIStreamListener URL nsIIOService nsIStandardURL ...
Using content preferences - Archive of obsolete content
s permits code running within chrome (in other words: extensions and the browser itself, not web sites) to locally save preferences on a per-site basis. This makes it possible to write an extension that lets the user customize the appearance of specific web sites (setting the font size larger on sites that use obnoxiously small fonts, for instance). The content preferences service, implemented by nsIContentPrefService, offers functions for setting and retrieving preferences for specific sites or in the global preference space; global preferences are used whenever a site-specific preference isn't available. Site-specific content preferences are stored in the profile folder, in the database file "content-prefs.sqlite". Example: Setting and retrieving preferences This example demonstrates how to save a...
...ent-prefs.sqlite". Example: Setting and retrieving preferences This example demonstrates how to save a preference and then retrieve its value. var ioSvc = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); var prefService = Components.classes["@mozilla.org/content-pref/service;1"] .getService(Components.interfaces.nsIContentPrefService); // Create a URI object referencing the site to save a preference for var uri = ioSvc.newURI("http://developer.mozilla.org/", null, null); // Set the value of the "devmo.somesetting" preference to "foo". prefService.setPref(uri, "devmo.somesetting", "foo"); ... // Retrieve the value of the "devmo.somesetting" preference. var value = prefService.getPref(uri, "devmo.somesetting");...
...wsing mode, use of the content preference service needed to be avoided while in private browsing mode; instead, information needed to be stored in memory or preferences had to be avoided. Starting in Gecko 9.0, when in private browsing mode, the content preference service stores preferences in memory instead of on disk, and automatically forgets them when leaving private browsing mode. See also nsIContentPrefService nsIContentPrefObserver toSource() (potentially useful for serializing objects for later use with eval()) ...
Limitations of chrome scripts
the browser will throw an exception and you'll see an "unsafe CPOW usage forbidden" error in the Browser Console. Add-on code is still allowed to use CPOWs "unsafely". However, if an add-on passes a CPOW into a platform API, and that platform API then attempts an unsafe operation on it, this will throw an exception. So as a general rule, add-ons should avoid passing CPOWs into non-addon code. ...
...en" error in the Browser Console. Add-on code is still allowed to use CPOWs "unsafely". However, if an add-on passes a CPOW into a platform API, and that platform API then attempts an unsafe operation on it, this will throw an exception. So as a general rule, add-ons should avoid passing CPOWs into non-addon code. nsIContentPolicy Without the shim In multiprocess Firefox, if you register the nsIContentPolicy in the chrome process then it will never see any attempts to load web content, because they happen in the content process. With the shim The shim enables you to add content policies in the chrome process. It transparently registers an nsIContentPolicy in the content process, whose shouldLoad just forwards to the chrome process. The content to check is forwarded as a CPOW. The chrome proce...
...If you need to ensure that the policy is only registered once, use a process script to register the policy. nsIWebProgressListener This API will work in the chrome process. There is a shim that gives you access to the DOMWindow property of the nsIWebProgress object passed into onStateChange. ...
Process scripts
es in the content process, in multiple scopes that are insulated from each other. For example, if you call the global frame message manager's loadFrameScript() function, then the script will be loaded separately into all open tabs. This can then cause a problem the frame scripts are interacting with a global service in the content process. For example, in multiprocess Firefox, if you need to use nsIContentPolicy to register a content policy, you must do this in the content process. But if you register it in a frame script, and the frame script is loaded more than once, you'll register the content policy more than once, which probably isn't what you intend. Similarly, some observer notifications must be registered in the content process, but if you do this in a frame script, and the frame script is...
...Chrome-privileged pages or things running in the parent process may require special treatment. If the above doesn't work try this: function contentMMFromContentWindow_Method2(aContentWindow) { return aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(C...
...things running in the parent process may require special treatment. If the above doesn't work try this: function contentMMFromContentWindow_Method2(aContentWindow) { return aContentWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDocShell) .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIContentFrameMessageManager); } ...
Introduction to XPCOM for the DOM
know, the "this" member of an object is a pointer to that object. You can thus simply cast "this" statically to the desired interface. You should however be absolutely sure of what you are doing before coding such a cast. It can lead to troubles with refcounting. ...
...d however be absolutely sure of what you are doing before coding such a cast. It can lead to troubles with refcounting. Here is a simple problem I encountered recently: In a member function of the nsHTMLAnchorElement class, I had to get a pointer to the nsIContent interface implemented by the nsHTMLAnchorElement object. However there is no such getter. I had to use the second solution: nsCOMPtr<nsIContent> content = getter_AddRefs(NS_STATIC_CAST(nsIContent*, this)); // Or, if you want to do the refcounting yourself, nsIContent *content = NS_STATIC_CAST(nsIContent*, this); The second form should be used with care, and is recommended only for advanced XPCOM'ers. The use of XPCOM and nsCOMPtr's described until now covers about 80% of what you need to know to read the code, and even write some. I c...
...ent Looking at the class definitions, we can see that nsGenericHTMLElement and nsGenericHTMLContainerElement don't implement any interface directly. However nsGenericElement does: class nsGenericElement : public nsIHTMLContent This of course means that nsGenericElement implements the nsIHTMLContent interface. The interface inheritance chain for nsIHTMLContent looks like this: nsISupports -> nsIContent -> nsIStyledContent -> nsIXMLContent -> nsIHTMLContent nsGenericElement has to implement all of the above interfaces, and all the real classes inheriting from nsGenericElement will automatically implement all those interfaces. This is consistent with the rules we have defined earlier in this paragraph. See also The XPIDL reference Mapping DOM Objects to their C class Modularization Techni...
nsIDocShell
er document container element. Note that out-of-process browsers do not have an nsIDocShell; instead you can access the nsIDocShell object from a frame script. ...
.... chromeEventHandler nsIDOMEventTarget Events generated in the frame bubble up to its chromeEventHandler. In the case of a content frame or subframe this is the containing chrome frame. In the case of a chrome frame this is the same as the frame element. This attribute allows chrome to tie in to handle DOM events that may be of interest to chrome. contentViewer nsIContentViewer Content Viewer that is currently loaded for this DocShell. This may change as the underlying content changes. Read only. currentDocumentChannel nsIChannel Gets the channel for the currently loaded document, if any. For a new document load, this will be the channel of the previous document until after OnLocationChange fires. Read only. documentCharsetInfo nsIDo...
...tance, if the user tries to reload the page, then this is the URL that will be reloaded. aReplace Whether to modify the current history entry instead of creating a new one. beginRestore() Begin firing WebProgressListener notifications for restoring a page presentation. This method will post an event to complete the simulated load after returning to the event loop. void beginRestore( in nsIContentViewer viewer, in boolean top ); Parameters viewer The content viewer whose document we are starting to load. If null, it defaults to the docshell's current content viewer, creating one if necessary. top Should be true for the toplevel docshell that is being restored; it will be set to false when this method is called for child docshells. createAboutBlankContentViewer() Create...
nsIIOService
bresource. In that case the principal of the stylesheet which contains the import command is the triggeringPrincipal, and the principal of the document whose rendering is affected is the loadingPrincipal. aSecurityFlags The securityFlags of the channel. Any of the securityflags defined in nsILoadInfo. aContentPolicyType The contentPolicyType of the channel. Any of the content types defined in nsIContentPolicyBase.idl. Return value Returns an nsIChannel based on aSpec and aBaseURI. newChannelFromURI() Obsolete since Gecko 48 Creates a channel for a given URI. nsIChannel newChannelFromURI( in nsIURI aURI ); Parameters aURI An nsIURI from which to make a channel. Return value An nsIChannel for the uri. newChannelFromURI2() Creates a channel for a given URI. nsIChannel newChanne...
...l, and the principal of the document whose rendering is affected is the loadingPrincipal. aSecurityFlags The securityFlags of the channel. Any of the securityflags defined in nsILoadInfo.idl aContentPolicyType The contentPolicyType of the channel. Any of the content types defined in nsIContentPolicy.idl Return value An nsIChannel for the uri. newChannelFromURIWithLoadInfo() Creates a channel for a given URI. Equivalent to newChannelFromURI2(aURI, aLoadingNode, ...) nsIChannel newChannelFromURIWithLoadInfo( in nsIURI aURI, in nsILoadInfo aLoadInfo ); Parameters aURI An nsIURI from which to make a channel. aLoadInfo A load info object. Return value An ns...
...bresource. In that case the principal of the stylesheet which contains the import command is the triggeringPrincipal, and the principal of the document whose rendering is affected is the loadingPrincipal. aSecurityFlags The securityFlags of the channel. Any of the securityflags defined in nsILoadInfo. aContentPolicyType The contentPolicyType of the channel. Any of the content types defined in nsIContentPolicy. Return value An nsIChannel for the uri. newFileURI() This method constructs a new URI from a nsIFile. nsIURI newFileURI( in nsIFile aFile ); Parameters aFile The nsIFile whose URI is desired. Return value An nsIURI corresponding to the file. newURI() This method constructs a new URI by determining the scheme of the URI spec, and then delegating the construction of the UR...
nsISHEntry
ldShells(); nsISHEntry clone(); void create(in nsIURI URI, in AString title, in nsIInputStream inputStream, in nsILayoutHistoryState layoutHistoryState, in nsISupports cacheKey, in ACString contentType, in nsISupports owner, in unsigned long long docshellID, in boolean dynamicCreation); Native code only! nsDocShellEditorDataPtr forgetEditorData(); Violates the XPCOM interface guidelines nsIContentViewer getAnyContentViewer(out nsISHEntry ownerEntry); void getScrollPosition(out long x, out long y); void getViewerBounds(in nsIntRect bounds); Native code only! boolean hasDetachedEditor(); Violates the XPCOM interface guidelines boolean hasDynamicallyAddedChild(); boolean isDynamicallyAdded(); void setEditorData(in nsDocShellEditorDataPtr aData); Violates the XPCOM interface g...
...tle); void setUniqueDocIdentifier(); void setURI(in nsIURI aURI); void setViewerBounds(in nsIntRect bounds); Native code only! void syncPresentationState(); Attributes Attribute Type Description cacheKey nsISupports Set and get the cache key for the entry. contentType ACString Indicates the content-type of the document that this is a session history entry for. contentViewer nsIContentViewer Content viewer, for fast restoration of presentation. docIdentifier unsigned long long An integer that should be the same for two entries attached to the same docshell if and only if the two entries are entries for the same document. In practice, two entries A and B will have the same docIdentifier if we arrived at B by clicking an anchor link in A or if B was created by A's calling hist...
... to the editor data assosicated with this shistory entry. This forgets its pointer, so free it when you're done. nsDocShellEditorDataPtr forgetEditorData(); Parameters None. Return value getAnyContentViewer() Return any content viewer present in or below this node in the nsSHEntry tree. This will differ from contentViewer in the case where a child nsSHEntry has the content viewer for this tree. nsIContentViewer getAnyContentViewer( out nsISHEntry ownerEntry ); Parameters ownerEntry Return value getScrollPosition() void getScrollPosition( out long x, out long y ); Parameters x y Native code only!getViewerBounds Saved position and dimensions of the content viewer; we must adjust the root view's widget accordingly if this has changed when the presentation is restored. void getViewerB...
nsIXULTemplateBuilder
datasource nsISupports The opaque datasource objec...
... datasource nsISupports The opaque datasource object that is used for the template. This object is created by...
...ter( in nsIDOMNode aRule, in nsIXULTemplateRuleFilter aFilter ); Parameters aRule The rule to apply the filter to. aFilter The filter to add. Native code only!init Called to initialize a XUL content builder on a particular root element. This element presumably has a datasources attribute, which the builder will parse to set up the template builder's data sources. [noscript] void init( in nsIContent aElement ); Parameters aElement The root element from which to derive the data. Native code only!createContents Invoked lazily by a XUL element that needs its child content built. [noscript] void createContents( in nsIContent aElement, in boolean aForceCreation ); Parameters aElement The element whose contents need to be built. aForceCreation If true, the contents of the element are gener...
Intercepting Page Loads - Archive of obsolete content
owser windows. If you are building a web filtering extension, you should keep in mind that XUL windows such as the DOM Inspector window and the Add-ons Manager window allow (limited) web navigation. Other extensions might add XUL windows that allow navigation as well, so in those cases it's best to use a global solution like this one. Content Policy Finally, there is the option of implementing nsIContentPolicy. You can create an XPCOM component that extends nsIContentPolicy and register it to the "content-policy" category using the nsICategoryManager. The nsIContentPolicy.shouldLoad() method is the only one in this interface that is really useful. It actually allows for cleaner-looking code than most of the previously seen solutions, because you get the content URI directly as an argument, and y...
..., you need to be efficient, and a good way to do this is to filter out unneeded cases right from the start. shouldLoad is called for every load operation Firefox tries to do, including images, scripts and XUL documents. A good filter would look like this: shouldLoad : function(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aExtra) { let result = Components.interfaces.nsIContentPolicy.ACCEPT; // we should check for TYPE_SUBDOCUMENT as well if we want frames. if ((Components.interfaces.nsIContentPolicy.TYPE_DOCUMENT == aContentType) && SOME_REGULAR_EXPRESSION.test(aContentLocation.spec)) { // do stuff here, possibly changing result. } return result; } The content policy is applied very early in the process, even before the request is made, allowing a...
Updating addons broken by private browsing changes - Archive of obsolete content
estions or clarifications, or file a bug if your extension has stopped working due to a change described here and you are having trouble updating it. ...
...ervice. See the imgICache article for more information. mozIAsyncFavicons/nsIFaviconService: setAndFetchFaviconForPage/setAndLoadFaviconForPage now take a required privacy status argument, either nsIFaviconService.FAVICON_LOAD_PRIVATE or nsIFaviconService.FAVICON_LOAD_NON_PRIVATE. nsIWebBrowserPersist: saveURI gained a new argument; see the nsIWebBrowserPersist docs for more information. nsIContentPrefService: getPref, setPref, hasPref, hasCachedPref, removePref, removeGroupedPrefs, removePrefsByName, getPrefs, and getPrefsByName all take a required nsILoadContext argument to indicate the privacy status of the pref in question. Use PrivateBrowsingUtils.getPrivacyContextFromWindow(win) to obtain it from the relevant window. nsIDownloadManager/nsIDownload: Integer download IDs (and spec...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
ntry for the desired content type under the NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY key. If it does, we instantiate that component using its contractid (via CreateInstance) and call TryContentListener on it. If we find no content listener willing to handle the data, we look for a content handler (using CreateInstance on NS_CONTENT_HANDLER_CONTRACTID_PREFIX + aContentType and expecting back an nsIContentHandler). If a handler is found, we call HandleContent on it to give it a chance to take over the load. If it does so, we abort the entire dispatch process right here and cancel the necko request; we will not be getting a stream listener to stream data into, since the content handler has taken over completely. If at this point we do not have an nsIURIContentListener, we have failed to find a way...
...ener of the converter. This way, once we know what type we've managed to get we can attempt to redispatch it. If a converter is found, we hook that up as our stream listener and are done -- we just need to pump data into it and let the downstream nsDocumentOpenInfo handle the final dispatch. If we still do not have a stream listener, that means that we failed to find an nsIURIContentListener or nsIContentHandler for this type. Give the load to the helper app service; this will return an nsIStreamListener that we can use. Original Document Information Author(s): Boris Zbarsky Last Updated Date: October 24, 2003 Copyright Information: Portions of this content are (C) 1998-2007 by individual mozilla.org contributors; content available under a Creative Commons license | Details. ...
contentViewerEdit - Archive of obsolete content
...
... ...
contentViewerFile - Archive of obsolete content
...
... ...
Installing headers using EXPORTS
IDL_MODULE to determine which typelib file is produced from the IDL files. ...
...The distinction between XPIDL_MODULE and MODULE is that each directory with IDL files must have a unique typelib file, but several directories may export headers to the same location. ...
Message manager overview
Process message managers Process message managers correspond to process boundaries, and enable code running in different processes to communicate. Multiprocess Firefox has the concept of: a "parent process" "child processes" which are processes spawned by the paren...
... ...
Performance
or some addons. It does not provide the same memory footprint reductions but it improves application startup. Beam down information in advance to avoid synchronous calls to the parent BAD: // processscript.js function ContentPolicy() { // ... ...
...pe, { classDescription: ..., classID: ..., contractID: ..., QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPolicy]), shouldLoad: function(type, location, origin, context) { let resultList = Services.cpmm.sendSyncMessage("my-addon:check-load", {destination: location, source: origin}) // <=== SYNC MESSAGE! if(resultList.every((r) => r == true)) return Ci.nsIContentPolicy.ACCEPT; return Ci.nsIContentPolicy.REJECT_REQUEST; } }); // more boilerplate code here This example is a (somewhat condensed) content policy which gets triggered for every network request in a child process to either allow or deny the request. Since the code calls to the parent process to check whether a specific request can be allowed it would slow down all page loads, as we...
Introduction to Layout in Mozilla
ener Invokes nsIDLF::CreateInstance, passes MIME type to DLF nsContentDLF Creates a nsHTMLDocument object, invokes StartDocumentLoad. ...
...ates a content sink, which is linked to the parser and the document Creates a DocumentViewerImpl object, which is returned as nsIContentViewer back to the docshell DocumentViewerImpl creates pres context and pres shell Content Model Construction Content arrives from network via nsIStreamListener::OnDataAvailable Parser tokenizes & processes content; invokes methods on nsIContentSink with parser node objects Some buffering and fixup occurs here OpenContainer, CloseContainer, AddLeaf Content sink creates and attaches content nodes using nsIContent interface Content sink maintains stack of "live" elements More buffering and fixup occurs here InsertChildAt, AppendChildTo, RemoveChildAt Frame Construction Content sink u...
nsIAccessibilityService
The container content node for the change is passed in, rather than the chang...
... in nsIAccessible aRootAccessible ); invalidateSubtreeFor() Invalidate the accessibility cache associated with aPresShell, for accessibles that were generated for aContainerContent and it's subtree. The container content node for the change is passed in, rather than the changed presentation for the content node itself. void invalidateSubtreeFor( in nsIPresShell aPresShell, in nsIContent aChangedContent, in PRUint32 aEvent ); Parameters <tt>aPresShell</tt> The presShell where changes occured. <tt>aChangedContent</tt> The affected DOM content. <tt>aEvent</tt> The event from nsIAccessibleEvent that caused the change. Must be one of: EVENT_REORDER (change) EVENT_SHOW (make visible or create) or EVENT_HIDE (destroy or hide) ...
nsIDocumentLoader
documentChannel nsIChannel Read only. loadGroup nsILoadGroup...
... aRequest aStatus aMessage Native code only!getContentViewerContainer Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)This 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. void getContentViewerContainer( in nsISupports aDocumentID, out nsIContentViewerContainer aResult ); Parameters aDocumentID aResult getLoadGroup() Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) nsILoadGroup getLoadGroup(); Parameters None. Return value isBusy() Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) boolean isBusy(); Parameters None. ...
nsIEditor
<< XPCOM API Reference editor/nsIEditor.idlScriptable Provides methods and attributes used when editing page content. ...
...this editor. In the case of a design mode document, this is the same as the window's selection. selectionController nsISelectionController Read only. The selection controller for the current presentation. Methods Native code only!init Initializes the editor's services. [noscript] void init( in nsIDOMDocument doc, in nsIPresShellPtr shell, Obsolete since Gecko 5 in nsIContent aRoot, in nsISelectionController aSelCon, in unsigned long aFlags ); Parameters doc The document to observe. shell Obsolete since Gecko 5.0 The nsIPresShellPtr representing the presentation shell displaying the document. This parameter was removed in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2). aRoot The root of the editable section of this document; if it's null, the e...
nsISelectionPrivate
t32 endOffset, in PRBool allowAdjacent, in RangeArray results); Native code only! Obsolete since Gecko 12.0 long getTableSelectionType(in nsIDOMRange range); void removeSelectionListener(in nsISelectionListener listenerToRemove); void scrollIntoView(in short aRegion, in boolean aIsSynchronous, in short aVPercent, in short aHPercent); void setAncestorLimiter(in nsIContent aContent); Native code only! void setPresShell(in nsIPresShell aPresShell); Native code only! void setTextRangeStyle(in nsIDOMRange range, in constTextRangeStyleRef textRangeStyle); Native code only! void startBatchChanges(); wstring toStringWithFormat(in string formatType, in unsigned long flags, in PRInt32 wrapColumn); Attributes Attribute ...
...ge of the visible area. For values in between, the point "aHPercent" across the frame is placed at the point "aHPercent" across the visible area. A value of 50 centers the frame horizontally . A value of -1 means move the frame the minimum amount necessary in order for the entire frame to be visible horizontally (if possible). Native code only!setAncestorLimiter void setAncestorLimiter( in nsIContent aContent ); Parameters aContent Native code only!setPresShell Internal utility method to set the pres shell on a newly created selection. void setPresShell( in nsIPresShell aPresShell ); Parameters aPresShell Native code only!setTextRangeStyle Set the painting style for the range. The range must be a range in the selection. The textRangeStyle will be used by text frame ...
nsIXULSortService
content/xul/templates/public/nsIXULSortService.idlScriptable A service used to sort the contents of a XUL widget. Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void insertContainerNode(in nsIRDFCompositeDataSource db, in nsRDFSortState sortStatePtr, in nsIContent root, in nsIContent trueParent, in nsIContent container, in nsIContent node, in boolean aNotify); Native code only! Obsolete since Gecko 1.9 void sort(in nsIDOMNode aNode, in AString aSortKey, in AString aSortHints); Constants Constant Value Description SORT_COMPARECASE 0x0001 SORT_INTEGER 0x0100 Methods Native code only!insertContainerNode Obsolete since Gecko 1.9 (Firefox 3)This feature is obsolete. Although it may still work in some ...
...RT_INTEGER 0x0100 Methods Native code only!insertContainerNode Obsolete since Gecko 1.9 (Firefox 3)This 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. Used internally for insertion sorting. void insertContainerNode( in nsIRDFCompositeDataSource db, in nsRDFSortState sortStatePtr, in nsIContent root, in nsIContent trueParent, in nsIContent container, in nsIContent node, in boolean aNotify ); Parameters db sortStatePtr root trueParent container node aNotify sort() Sort the contents of the widget containing aNode using aSortKey as the comparison key, and aSortHints as how to sort. void sort( in nsIDOMNode aNode, in AString aSortKey, in AString aSortHints ); Parame...
Miscellaneous - Archive of obsolete content
tionEnd); } insertText(document.getElementById("example"), "the text to be inserted"); Disabling JavaScript programmatically // Disable JS in the currently active tab from the context of browser.xul gBrowser.docShell.allowJavascript = false; If this isn't your browser, you should save the value and restore it when finished. If you wish to block selected scripts based on their URI, implement nsIContentPolicy. Using string bundles from JavaScript Assuming the extension has myext.properties with name/value pairs such as: invalid.url=The speficied URL, %S, is invalid. That was attempt number %S. These properties can be accessed from JavaScript in the following manner: var common = { _bundle: Components.classes["@mozilla.org/intl/stringbundle;1"] .getService(Components.interfa...
XPCOM Objects - Archive of obsolete content
And, finally, the factory object. var CounterFactory = { /* Single instance of the component. */ _singletonObj: null, createInstance: function(aOuter, aIID) { if (aOuter != null) { throw Cr.NS_ERROR_NO_AGGREGATION; } // in this case we need a unique instance of the service. if (!this._singletonObj) { this._singletonObj = MessageCounter; } ret...
Index - Archive of obsolete content
darViewController allows for these actions to be performed in a manner consistent with the rest of the application in which the calICalendarView is included. 1996 calIFileType Interfaces The calIFileType interface provides information about a specific file type. 1997 mozilla.dev.platform FAQ FAQ for questions asked on mozilla.dev.platform 1998 nsIContentPolicy Interfaces, Interfaces:Scriptable, NeedsMarkupWork, Reference, XPCOM, XPCOM Interface Reference You can observe content that is being loaded into your browser by implementing nsIContentPolicy. This interface can be very useful if you are developing a content-aware plugin (blocking ads or altering the look of content, for example), or if you want to stop or allow user-browsed URLs.
Using the Editor from XUL - Archive of obsolete content
ll::PrepareDocumentForEditing()). As well as making the editor (which happens via nsEditorShell::DoEditorMode()) we also hook up various listeners and observers for UI updating and user interaction, and store a file specifier for the document we opened. The editor is now set up, and ready to go. One thing to note about editor initialization is that we pass into the editor's Init() method an nsIContent* that corresponds to the root of the content tree that the editor is allowed to work with. When initializing the editor from the nsEditorShell, we pass NULL here (which tells the editor that it can edit everything under the <body> of the document). This parameter is more important when the editor is in a text widget, where it points to the the subtree of the parent document that corresponds to wi...
browser - Archive of obsolete content
roperty contains the document object in the element. contentPrincipal Type: nsIPrincipal This read-only property contains the principal for the content loaded in the browser, which provides security context information. contentTitle Type: string This read-only property contains the title of the document object in the browser. contentViewerEdit Type: nsIContentViewerEdit This read-only property contains the nsIContentViewerEdit which handles clipboard operations on the document. contentViewerFile Type: nsIContentViewerFile Reference to the nsIContentViewerFile interface for the document. contentWindow Type: TODO Use the contentWindow.wrappedJSObject to obtain a DOM(html) window object currentURI Type: n...
tabbrowser - Archive of obsolete content
true if there is a page to go forward to in the session history and the Forward button should be enabled. contentDocument Type: document This read-only property contains the document object in the element. contentTitle Type: string This read-only property contains the title of the document object in the browser. contentViewerEdit Type: nsIContentViewerEdit This read-only property contains the nsIContentViewerEdit which handles clipboard operations on the document. contentViewerFile Type: nsIContentViewerFile Reference to the nsIContentViewerFile interface for the document. contentWindow Type: TODO Use the contentWindow.wrappedJSObject to obtain a DOM(html) window object currentURI Type: nsIU...
2006-11-10 - Archive of obsolete content
s week. Discussions How to know the full height and width of a webpage Discussion on how to determine the full height and width of a web page when embedding a browser into an application. Using window.innerHeight and window.scrollMaxY should resolve this issue. Block Images Discussion on how where to change source code so that images could be blocked in Mozilla. This can be defined within the nsIContentPolicy. Applying site- and page-specific settings during layout Discussion on the best possible solution for integrating Firefox 3 with the ability to apply site- and page-specific user settings during layout. The idea of using a single sheet and the per-site selectors that dbaron implemented would allow for a quick proof of concept. The pro's and con's of using a single sheet was discussed. M...
2006-12-01 - Archive of obsolete content
debugging firefox extesnion? A tip on how to debug Firefox extensions using a debugger. ...
Message manager
ariants. ...
IME handling guide
scrolling a page may be consumed and prevented by IME. Additionally, password editors need to request special behavior with IME. For solving this issue, Gecko sets the proper IME state at DOM focus change. First, when a DOM node gets focus, nsFocusManager notifies IMEStateManager of the new focused node (calls IMEStateManager::OnChangeFocus()). IMEStateManager asks desired IME state by calling nsIContent::GetDesiredIMEState() of the node. If the node owns nsEditor instance, it asks for the desired IME state from the editor and returns the result. Next, IMEStateManager initializes InputContext (defined in IMEData.h) with the desired IME state and node information. Then, it calls nsIWidget::SetInputContext() with the InputContext. Finally, widget stores the InputContext and enables or disables IM...
Services.jsm
tion service appShell nsIAppShellService Application shell service blocklist nsIBlocklistService Blocklist service cache nsICacheService Cache service cache2 nsICacheStorageService Cache storage service clipboard nsIClipboard Clipboard console nsIConsoleService Error console service contentPrefs nsIContentPrefService Content Preferences service cookies nsICookieManager2 Cookie Manager 2 service cpmm nsIMessageSender Child process message manager4 crashmanager CrashManager.jsm dirsvc nsIDirectoryService nsIProperties Directory service domStorageManager nsIDOMStorageManager DOM Storage Manager DOMRequest n...
WebRequest.jsm
The WebRequest module is new in Firefox 41. The WebRequest module provides an API to add event listeners for the various stages of making an HTTP request. The event listener receives detailed information about the request, and can modify or cancel the request. You can use this API to implement a content policy in an add-on (for example, an ad or script blocker), as you could using nsIContentPolicy. More generally, you can also use this API instead of HTTP request observers. You can use WebRequest.jsm in either the chrome or content processes. The WebRequest API is modeled on Chrome's webRequest extension API, which makes it easier to write cross-browser add-on code. There are some differences between this API and Chrome's, though: see Chrome incompatibilities for the details. Usage To...
DMD
ingAutoRefCnt::incr(void*, nsCycleCollectionParticipant*) (/home/njn/moz/mi5/go64dmd/dom/xul/../../dist/include/nsISupportsImpl.h:250) #05: nsXULElement::Create(nsXULPrototypeElement*, nsIDocument*, bool, bool,mozilla::dom::Element**) (/home/njn/moz/mi5/dom/xul/nsXULElement.cpp:287) #06: nsXBLContentSink::CreateElement(char16_t const**, unsigned int, mozilla::dom::NodeInfo*, unsigned int, nsIContent**, bool*, mozilla::dom::FromParser) (/home/njn/moz/mi5/dom/xbl/nsXBLContentSink.cpp:874) #07: nsCOMPtr<nsIContent>::StartAssignment() (/home/njn/moz/mi5/go64dmd/dom/xml/../../dist/include/nsCOMPtr.h:753) #08: nsXMLContentSink::HandleStartElement(char16_t const*, char16_t const**, unsigned int, unsigned int, bool) (/home/njn/moz/mi5/dom/xml/nsXMLContentSink.cpp:1007) } } It tells you th...
XPCOM array guide
Mozilla › Tech › XPCOM › Guide › Arrays
n array of strings. Will your array store non-refcounted objects and be a fixed size? If so, just use a native C++ array unless you need the enumeration options on nsTArray<T>. Example: an array of error message static const char* pointers. Are all the things you are storing interface pointers to instances of the same interface? If so, use nsCOMArray. Example: a content node's list of nsIContent children. Otherwise use nsIArray and make liberal use of QueryElementAt(). The point of nsCOMArray is that it's a template, and all the pointers in it must be pointers to the same type; it's nice to be able to use it because you get type-safety and don't have to spend time and code QIing (like you have to with nsIArray). Array Guidelines Here are a few simple rules which will keep your code ...
Preface
cs associated with the step are discussed. Create the generic module code for the component. Use C++ macros, special string classes and smart pointers to optimize your code. Define the functionality for the component; create an XPIDL interface for that functionality; create the implementation code specific to the custom WebLock component interface. Finish implementing the WebLock component: nsIContentPolicy, file I/O, locking, etc. Creating the user interface for the WebLock component. Packaging WebLock for distribution and installation. Following Along with the Examples There are a couple of different ways to get XPCOM onto your machine so you can begin to create components. If you already have a Mozilla build or the source from Mozilla 1.2 or later, then you can use the XPCOM framework ...
Creating XPCOM components
ory Service Modifying Paths with nsIFile Manipulating Files with nsIFile Using nsILocalFile for Reading Data Processing the White List Data iWebLock Method By Method Lock and Unlock AddSite RemoveSite SetSites GetNext GetSites HasMoreElements Finishing the Component Using Frozen Interfaces Copying Interfaces Into Your Build Environment Implementing the nsIContentPolicy Interface Receiving Notifications Implementing the nsIContentPolicy Uniform Resource Locators Checking the White List Creating nsIURI Objects Building the WebLock UI User Interface Package List Client Code Overview XUL The XUL Document The Locking UI Site Adding UI weblock.xul Overlaying New User Interface Into Mozilla webLockOverlay.xul Oth...
Observer Notifications
's not firing at the proper times. Sent by the telemetry service when it's time to start gathering telemetry data, since the telemetry ping is coming soon. Plugins Topic Data Description plugin-crashed - Sent when a plugin has crashed. Message manager Topic Subject Data Description message-manager-disconnect nsIContentFrameMessageManager null This notification is sent when a message manager disconnects. The subject of the notification is the message manager that disconnected. If you're using a message manager to communicate with a script that may be running in a different process, you might need to know when the message manager has disconnected from the other end of the conversation, ...
nsIChannel
initial document URI load (for example link click). LOAD_TARGETED 20 Set (For example by the URILoader) to indicate whether or not the end consumer for this load has been determined. LOAD_CALL_CONTENT_SNIFFERS 21 If this flag is set, the channel should call the content sniffers as described in netwerk/build/nsNetCID.h about NS_CONTENT_SNIFFER_CATEGORY. See nsIContentSniffer [en-US] Note: Channels may ignore this flag; however, new channel implementations should only do so with good reason. LOAD_CLASSIFY_URI 22 This flag tells the channel to use URI classifier service to check the URI when opening the channel. Methods asyncOpen() Asynchronously open this channel. Data is fed to the specified stream listener as it becomes available.
nsIChannelPolicy
.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) This interface exists to allow the content policy mechanism to function properly during channel redirects. Channels can be created with this interface placed in the property bag and upon redirect, the interface can be transferred from the old channel to the new channel. Attributes Attribute Type Description contentSecurityPolicy nsISupports A nsIContentSecurityPolicy object to determine if the load should be allowed. loadType unsigned long Indicates what type of content is being loaded, for example nsIContentPolicy::TYPE_IMAGE. ...
nsIChromeFrameMessageManager
omes available; otherwise, the script will only be loaded if the frame is already available. ...
nsIClassInfo
a nsIServiceManager. THREADSAFE 1 << 1 The class may be accessed by any thread. MAIN_THREAD_ONLY 1 << 2 The class may only be accessed by the main application thread. DOM_OBJECT 1 << 3 The class is a DOM object. PLUGIN_OBJECT 1 << 4 The class is a plugin object. CONTENT_NODE 1 << 6 Specifies that this class implements nsIContent. Note: This flag is private and is for use by the Mozilla codebase only. RESERVED 1 << 31 The high order bit is RESERVED for consumers of these flags. No implementor of this interface should ever return flags with this bit set. EAGER_CLASSINFO 1 << 5 This flag is designed for use with nsGenericFactory and can be set in nsModuleComponentInfo::mFlags. It has no mea...
nsIDOMWindowUtils
ithout UniversalXPConnect privileges. void disableNonTestMouseEvents( in boolean aDisable ); Parameters aDisable If true, disable all non synthetic test mouse events on all windows. Otherwise, enable them. dispatchDOMEventViaPresShell() Dispatches aEvent via the nsIPresShell object of the window's document. The event is dispatched to aTarget, which should be an object which implements nsIContent interface (#element, #text, etc). Cannot be accessed from unprivileged context (not content-accessible) Will throw a DOM security error if called without UniversalXPConnect privileges. Note: Event handlers won't get aEvent as parameter, but a similar event. Also, aEvent should not be reused. boolean dispatchDOMEventViaPresShell( in nsIDOMNode aTarget, in nsIDOMEvent aEvent, in boolean aT...
nsIFrameLoader
content/base/public/nsIFrameLoader.idlScriptable Handles loading a frame. 1.0 66 Introduced Gecko 1.8 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Note: This interface works in tandem with the nsIContentView interface to manage frames across processes if Electrolysis is in use to support per-frame processes. Method overview void activateFrameEvent(in AString aType, in boolean capture); void activateRemoteFrame(); void destroy(); void loadFrame(); void loadURI(in nsIURI aURI); void sendCrossProcessKeyEvent(in AString aType, in long aKeyCode, in long aCharCode, in long aModifiers, [optional] in boolean aPreventDefault); void sendCrossProces...
nsIMessageListener
e three message-sending functions in the message manager framework: broadcastAsyncMessage sendAsyncMessage sendSyncMessage. The received message is an object with the following properties: target The target of the message. Either an element owning the message manager, or the message manager itself if no element owns it. If the message was sent from a frame script using a nsIContentFrameMessageManager, then this property is the XUL <browser> element for the frame from which the message was sent. name The message name. This is the first argument passed into the message-sending function. sync True if the message was sent using sendSyncMessage, false otherwise. data A structured clone of the message payload: the second argument passed int...
nsIPrincipal
string The fingerprint ID of this principal's certificate. Throws if there is no certificate associated with this principal. Read only. Obsolete since Gecko 1.8 commonName string The common name for the certificate. This pertains to the certificate authority organization. Throws if there is no certificate associated with this principal. Obsolete since Gecko 1.8 csp nsIContentSecurityPolicy A Content Security Policy associated with this principal. Native code only! domain nsIURI The domain URI to which this principal pertains. This is congruent with HTMLDocument.domain, and may be null. Setting this has no effect on the URI. Native code only! fingerprint AUTF8String The fingerprint ID of this principal's certificate. Throws if there is ...
XPCOM Interface Reference
FrameMessageManagernsIChromeRegistrynsIClassInfonsIClipboardnsIClipboardCommandsnsIClipboardDragDropHookListnsIClipboardDragDropHooksnsIClipboardHelpernsIClipboardOwnernsICollectionnsICommandControllernsICommandLinensICommandLineHandlernsICommandLineRunnernsIComponentManagernsIComponentRegistrarnsICompositionStringSynthesizernsIConsoleListenernsIConsoleMessagensIConsoleServicensIContainerBoxObjectnsIContentFrameMessageManagernsIContentPrefnsIContentPrefCallback2nsIContentPrefObservernsIContentPrefServicensIContentPrefService2nsIContentSecurityPolicynsIContentSniffernsIContentViewnsIContentViewManagernsIContentViewernsIControllernsIControllersnsIConverterInputStreamnsIConverterOutputStreamnsICookiensICookie2nsICookieAcceptDialognsICookieConsentnsICookieManagernsICookieManager2nsICookiePermissionnsICo...
XPCOM category image-sniffing-services
w image types. However, such decoders relied on servers sending correct MIME types; images sent with incorrect MIME types would not be correctly displayed. In Firefox 3, a new XPCOM category was added in bug 391667 to allow "third-party" XPCOM components to identify images based on their content. If Mozilla's built-in image code cannot identify an image, then any XPCOM components implementing the nsIContentSniffer interface may register under the "image-sniffing-services" category, and will be queried to determine the MIME type of the image being downloaded. Note: This category was removed. See Bug 813787 - Remove support for image-sniffing-services. ...