Search completed in 0.97 seconds.
nsIXPConnect
js/src/x
pconnect/idl/nsix
pconnect.idlnot scriptable provides the x
pconnect service. ...
... js/src/x
pconnect/idl/nsix
pconnect.idlnot scriptable provides the x
pconnect service. ...
... js/src/x
pconnect/idl/nsix
pconnect.idlnot scriptable provides the x
pconnect service. ...
...And 63 more matches
An Overview of XPCOM
« previousnext » this is a book about x
pcom. the book is presented as a tutorial about creating x
pcom components, but it covers all major aspects, concepts, and terminology of the x
pcom component model along the way. this chapter provides a quick tour of x
pcom - an introduction to the basic concepts and technologies in x
pcom and component development. the brief sections in this chapter introduce the concepts at a very high level, so that we can discuss and use them with more familiarity in the tutorial itself, which describes the creation of a mozilla component called weblock. the x
pcom solution the cross platform component object module (x
pcom) is a framework which allows developers to break up monolithic software projects into smaller modularized pieces. these pieces, ...
...e them with more familiarity in the tutorial itself, which describes the creation of a mozilla component called weblock. the x
pcom solution the cross platform component object module (x
pcom) is a framework which allows developers to break up monolithic software projects into smaller modularized pieces. these pieces, known as components, are then assembled back together at runtime. the goal of x
pcom is to allow different pieces of software to be developed and built independently of one another. ...
...dule (x
pcom) is a framework which allows developers to break up monolithic software projects into smaller modularized pieces. these pieces, known as components, are then assembled back together at runtime. the goal of x
pcom is to allow different pieces of software to be developed and built independently of one another. in order to allow interoperability between components within an application, x
pcom separates the implementation of a component from the interface, which we discuss in interfaces. ...
...And 36 more matches
XPCOM
x
pcom is a cross platform component object model, similar to microsoft com. it has multiple language bindings, allowing x
pcom components to be used and implemented in javascript, java, and python in addition to c++. interfaces in x
pcom are defined in a dialect of idl called xpidl. x
pcom itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. the majority of x
pcom components are not part of this core set and are provided by other parts of the platform (e.g. gecko or necko) or by an application or even by an extension. ...
...idl called xpidl. x
pcom itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. the majority of x
pcom components are not part of this core set and are provided by other parts of the platform (e.g. gecko or necko) or by an application or even by an extension. accessing the windows registry using x
pcomwhen implementing windows-specific functionality, it is often useful to access the windows registry for information about the environment or other installed programs. to this end, there exist x
pcom interfaces to read and write registry data. this article will show you how to use the available interfaces in several mozilla products.aggregating the in-memory datasourcealready_addrefedalready_addre...
...nscomptr allows you to assign in a pointer without addrefing it.binary compatibilityif mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail. it is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. effectively, it is a different platform.bundling multiple binary componentsbinary x
pcom components are sometimes required to implement low-level features for extensions. since binary components are linked against a single gecko sdk, a dependency to a particular version of gecko is created. if the component uses only "frozen" x
pcom interfaces, there is a good chance the same binary component will work with different versions of gecko (version 1.8 and 1.9, for example). the more lik...
...And 31 more matches
platform/xpcom - Archive of obsolete content
implement x
pcom objects, factories, and services. usage the x
pcom module makes it simpler to perform three main tasks: implement x
pcom object interfaces implement and register x
pcom factories implement and register x
pcom services if all you need to do is use x
pcom objects that someone else has implemented, then you don't need to use this module. you can just use require("chrome") to get direct access to the components object, and access x
pcom objects from there. implementing x
pcom interfaces this module exports a class called unknown which implements the fundamental x
pcom interface nsisupports. by subclassing unknown, either using standard javascript inheritance or using the sdk's heritage module, you can provide your own implementations of x
pcom interfaces. "unknown" is named...
...r using standard javascript inheritance or using the sdk's heritage module, you can provide your own implementations of x
pcom interfaces. "unknown" is named after the "iunknown" interface in com. for example, the add-on below implements the nsiobserver interface to listen for and log all topic notifications: var { class } = require('sdk/core/heritage'); var { unknown } = require('sdk/platform/x
pcom'); var { cc, ci } = require('chrome') var observerservice = cc['@mozilla.org/observer-service;1']. getservice(ci.nsiobserverservice); var starobserver = class({ extends: unknown, interfaces: [ 'nsiobserver' ], topic: '*', register: function register() { observerservice.addobserver(this, this.topic, false); }, unregister: function() { observerservice...
... for example, this add-on defines a subclass of unknown called helloworld that implements a function called hello. by creating a factory and passing it the contract id for the helloworld component and the hellow...
...And 28 more matches
Using XPCOM Components
« previousnext » one of the best ways to begin working with x
pcom - especially when you are designing the interface to a component that will be used by others, as we do in starting weblock - is to look at how clients are already using x
pcom components. applications like the mozilla browser are sophisticated, modularized clients of x
pcom components. in fact, virtually all of the functionality that you associate with a browser - navigation, window management, managing cookies, bookmarks, security, searching, rendering, and other features - is defined in x
pcom components and accessed by means of those component interfaces. mozilla is made of x
pcom components. ...
...for now, what's important to see is how components like the ones in this section are obtained and used by the mozilla browser. ...
...- is defined in x
pcom components and accessed by means of those component interfaces. mozilla is made of x
pcom components. this chapter demonstrates how mozilla uses some of these x
pcom objects, such as the cookiemanager, and shows how access to the weblock component will be defined. component examples you can find out more about how you can use the particular components described here in the x
pcom api reference. for now, what's important to see is how components like the ones in this section are obtained and used by the mozilla browser. cookie manager cookie management is one of the many sets of functionality that is made available to the browser in the form of an x
pcom component and that can be reused by developers who want similar functionality in their applications. whenever a user ...
...And 26 more matches
How to build an XPCOM component in JavaScript
if you are looking for add-on sdk solution for x
pcom javascript components then check out platform/x
pcom module first. this is a "hello world" tutorial for creating an x
pcom component in javascript. this tutorial does not describe how and why x
pcom works the way it does, or what every bit of the example code does. that's been detailed elsewhere. this tutorial will show you what you need to do to get a component working in as few and as simple steps as possible. implementation this example component will expose a single method, which returns the string "hello world!". defining the interface if you want to use your component in other x
pcom components, you must define the interfaces that you want exposed. if you want to use your component only from javascript, you can skip to the n...
... returns the string "hello world!". defining the interface if you want to use your component in other x
pcom components, you must define the interfaces that you want exposed. if you want to use your component only from javascript, you can skip to the next section. there are many interfaces already defined in mozilla applications, so you may not need to define a new one. you can browse existing x
pcom interfaces at various locations in the mozilla source code, or using x
pcomviewer, a gui for browsing registered interfaces and components. you can download an old version of x
pcomviewer that works with firefox 1.5 from mozdev mirrors. if an interface exists that meets your needs, then you do not need to write an idl, or compile a typelib, and may skip to the next section. if you don't find a ...
... using x
pcomviewer, a gui for browsing registered interfaces and components. you can download an old version of x
pcomviewer that works with firefox 1.5 from mozdev mirrors. if an interface exists that meets your needs, then you do not need to write an idl, or compile a typelib, and may skip to the next section. if you don't find a suitable pre-existing interface, then you must define your own. x
pcom uses a dialect of idl to define interfaces, called xpidl. here's the xpidl definition for our helloworld component: helloworld.idl #include "nsisupports.idl" [scriptable, uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)] interface nsihelloworld : nsisupports { string hello(); }; note that you must generate a new uuid for each x
pcom component that you create. see generating guids for more infor...
...And 25 more matches
XPCOM glue
the x
pcom glue is a static library which component developers and embedders can link against. it allows developers to link only against the frozen x
pcom method symbols and maintain compatibility with multiple versions of x
pcom. compiling or linking against x
pcom headers there are three ways to compile/link against x
pcom headers/libraries: frozen linkage: dependent glue (dependent on x
pcom.dll) x
pcom modules, i.e. extension or xulrunner application components, should use the dependent glue. code which wishes to use only frozen symbols but can tolerate a load-time dependency on x
pcom.dll should link against x
pcomglue_s.lib and x
pcom.lib. it should not link against x
pcom_core.lib. ...
... frozen linkage: standalone glue (no dll dependencies) note: support for locating a standalone glue was removed in gecko 6.0. use this when you have a custom application where you want to embed gecko to show webpages in your own window. i.e. ...
...om.dll) x
pcom modules, i.e. extension or xulrunner application components, should use the dependent glue. code which wishes to use only frozen symbols but can tolerate a load-time dependency on x
pcom.dll should link against x
pcomglue_s.lib and x
pcom.lib. it should not link against x
pcom_core.lib. this is the case for x
pcom components, because they are loaded into mozilla which already has full x
pcom loaded and initialized. frozen linkage: standalone glue (no dll dependencies) note: support for locating a standalone glue was removed in gecko 6.0. use this when you have a custom application where you want to embed gecko to show webpages in your own window. i.e. this linkage strategy is used when an embedder needs to bootstrap x
pcom by finding a compatible gre on disk and loading it. in...
...And 19 more matches
nsIXPCScriptable
note: this is not really an x
pcom interface. for example, callers must guarantee that they set the *_retval of the various methods that return a boolean to pr_true before making the call. implementations may skip writing to *_retval unless they want to return pr_false. js/src/x
pconnect/idl/nsix
pcscriptable.idlnot scriptable please add a summary to this article. ...
...l unless they want to return pr_false. js/src/x
pconnect/idl/nsix
pcscriptable.idlnot scriptable please add a summary to this article. ...
... please add a summary to this article. ...
...And 18 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
should include a link to the mdc list of snippets fixme: we need to add a part about 'why and how to create your own component' c++/js this document was authored by hiroshi shimoda of clear code inc. and was originally published in japanese for the firefox developers conference summer 2007. mr. shimoda is a co-author of firefox 3 hacks (o'reilly japan, 2008). this chapter explains how to use x
pcom to implement advanced processes using only javascript. introduction javascript lacks functions for opening files and character-code conversion, among other things. a different mechanism is needed to perform these functions. internet explorer handles this using activex; in firefox, we use the cross-platform component object model, or x
pcom. due to deprecation of enableprivilege this functiona...
...d character-code conversion, among other things. a different mechanism is needed to perform these functions. internet explorer handles this using activex; in firefox, we use the cross-platform component object model, or x
pcom. due to deprecation of enableprivilege this functionality can not be used in web pages. enableprivilege is disabled in firefox 15 and will be removed in firefox 17. about x
pcom x
pcom is a framework for developing platform-independent components. ...
...g activex; in firefox, we use the cross-platform component object model, or x
pcom. due to deprecation of enableprivilege this functionality can not be used in web pages. enableprivilege is disabled in firefox 15 and will be removed in firefox 17. about x
pcom x
pcom is a framework for developing platform-independent components. components developed in line with that framework are referred to as x
pcom components, and sometimes the components are simply referred to as x
pcoms. firefox itself includes a great number of x
pcom components, and they can be used in extensions as well. sometimes an extension will be packaged with a special x
pcom component developed specifically for it. note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every pl...
...And 17 more matches
XPCOM Objects - Archive of obsolete content
firefox can be seen as composed of two layers. the largest of the two is a compiled platform, mostly written in c++. on top of it lies the chrome, mostly written in xml, javascript and css. in fact, you can separate the two. we often mention other "mozilla based applications". well, those are applications that, simply put, take the underlying platform with perhaps a few changes and additions, and then write their own chrome layer. this lower layer is called xulrunner, and it is a very powerful platform, providing a very robust development base for web-enabled, cross-platform applications. ...
...s that, simply put, take the underlying platform with perhaps a few changes and additions, and then write their own chrome layer. this lower layer is called xulrunner, and it is a very powerful platform, providing a very robust development base for web-enabled, cross-platform applications. the fact that it allows to easily create os-independent applications is a big selling point for xulrunner. ...
...g a very robust development base for web-enabled, cross-platform applications. the fact that it allows to easily create os-independent applications is a big selling point for xulrunner. x
pcom is the way in which the two layers (xulrunner and chrome) communicate. most of the objects and functions in the lower layers are hidden from the chrome; those that need to be publicized are exposed through x
pcom components and interfaces. you can think of x
pcom as a reference to all the capabilities available on the lower layers of firefox. using x
pcom components is relatively simple, as you've seen in previous examples. this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); the cc object (components.classes) is an index to static objects and class definitions...
...And 16 more matches
XPCOMUtils.jsm
declare the class (or multiple classes) implementing the component(s). create an array of component constructors. define the nsgetfactory() or nsgetmodule() entry point. pseudocode this section provides some pseudocode that demonstrates how to put together a javascript class based on the steps listed above. ...
... declare the class (or multiple classes) implementing the component(s). ...
...e pseudocode that demonstrates how to put together a javascript class based on the steps listed above. constructor the constructor is a simple method that handles any required initialization tasks. function mycomponent() { // initialize the component here } class declaration declare the class prototype, using a form similar to this. ...
...And 15 more matches
XPCOM changes in Gecko 2.0
several changes that affect x
pcom component compatibility are taking place in gecko 2. this article details those changes, and provides suggestions for how to update your code. no more frozen interfaces there are no longer any frozen interfaces; from now on, all interfaces are subject to change. documentation will be updated as time allows to remove references to interfaces being "frozen" or "unfrozen." component registration the way x
pcom components are registered changed in gecko 2. prior to gecko 2, during component registration, all binary and javascript component files were loaded and called, asking them to register themselves. if you used x
pcomutils.jsm, some of this was hidden from you, but it was still there. starting in gecko 2, however, components are registered using manifest fil...
...however, it's very easy to do, and you can actually support both types of registration for backward compatibility. component manifests all component registration is now handled through manifest files. ...
...me chrome.manifest currently used to register chrome. xpt files the path of any xpt files must be listed explicitly in a manifest using an interfaces directive: interfaces components/mycomponent.xpt javascript components the registration information for javascript components is no longer located in the component itself; instead, it's located in the manifest. the component is loaded only when the x
pcom component manager needs to create a component. chrome.manifest: # the {classid} here must match the classid in mycomponent.js component {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} components/mycomponent.js contract @foobar/mycomponent;1 {e6b866e3-41b2-4f05-a4d2-3d4bde0f7ef8} category profile-after-change mycomponent @foobar/mycomponent;1 the javascript code no longer exports a nsgetmodule() functio...
...And 14 more matches
Avoiding leaks in JavaScript XPCOM components
ce this article was written. e. g. in firefox 3, a cycle collector was introduced and refined in later versions, and mozilla is currently working on a generational garbage collector for js. this article needs to be updated to reflect the changes and the cases where they help. take every information on this site with a grain of salt, although most concepts and best practices still apply. using x
pcom in javascript (also known as x
pconnect) is an environment where memory management issues are not obvious. there are no calls to malloc and free and no reference counting. despite this, it's easy to write javascript code that leaks. it's easy to write leaky code in any garbage-collected language. but it's even easier in this environment because some of the objects you're dealing with are referen...
...s to malloc and free and no reference counting. despite this, it's easy to write javascript code that leaks. it's easy to write leaky code in any garbage-collected language. but it's even easier in this environment because some of the objects you're dealing with are reference-counted behind the scenes. programmers writing and reviewing javascript code in mozilla should understand how code using x
pcom in javascript can leak so that they can avoid leaks. this document attempts to help them do so, first by explaining the underlying concepts, and second by describing a number of common javascript patterns that cause leaks. basics of memory management creating objects that are not a fixed size for the lifetime of the program (global variables) or a fixed size for the lifetime of a function (st...
... given object and it's uncertain which one will need to last the longest. reference counting reference counting is a simple solution to the problem of allowing multiple owners to influence the lifetime of an object. in this strategy, the object has a member that is the number of other objects that "own" it. when this count goes to zero, the object destroys itself. this is the strategy used by x
pcom, partly because it can be used through a very simple api, addref and release. in c++, we use nscomptr to help manage ownership, and we use macros to implement addref and release. the major problem with reference counting is that it can cause leaks through ownership cycles. if object a owns object b, and object b owns object a, then neither one will ever be destroyed. this tends to be solved in ...
...And 11 more matches
Using XPCOM Utilities to Make Things Easier
« previousnext » this chapter goes back over the code you've already created in the first part of the tutorial (see weblock1.cpp in the previous chapter) and uses x
pcom tools that make coding a lot easier and more efficient. it also introduces a basic string type that is used with many of the apis in both x
pcom and gecko. to begin with, the first section describesc++ macros that can replace a lot of the code in weblock1.cpp. much of the code created to get the software recognized and registered as a component can be reduced to a small data structure and a single macro. x
pcom macros the x
pcom framework includes a number of macros for making c++ development easier. though they overlap somewhat (e.g., high-level macros expand to other macros), they fall into the following g...
...but there are only a few places in that code that are unique to the weblock component, and it was a lot of typing. ...
...ng up the generic component code. but there are only a few places in that code that are unique to the weblock component, and it was a lot of typing. to write a different component library, you could copy the listing at the end of the chapter, change very little, and paste it into a new project. to avoid these kinds of redundancies, to regulate the way generic code is written, and to save typing, x
pcom providesgeneric module macros that expand into the module code you've already seen. since these macros expand into "generic" implementations, they may not offer as much flexibility as you have when you are writing your own implementation. but they have the advantage of allowing much more rapid development. to get an idea about how much can be handled with the macros described in this section, ...
...And 10 more matches
Creating XPCOM components
next » this guide is about gecko, and about creating x
pcom components for gecko-based applications. though the emphasis is on the practical steps you take to make your c++ code into a component that can be used in gecko, we hope that these steps will also give us an occasion to discuss all of the tools, techniques, and technologies that make up x
pcom. accordingly, the book is arranged so that you can follow along and create your own components or learn about different x
pcom topics individually, as in a reference work. ...
...add-ons should try to use the new add-on sdk as much as possible; however, there may be cases when it's unavoidable. ...
...as in a reference work. for example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of x
pcom interfaces, and of the registration process in general. note: in general, you should try to avoid having to create x
pcom components. ...
...And 10 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
obsolete since gecko 4.0this 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. warning: this technology is obsolete. no active maintainer has stepped forward, and the code broke in firefox 4. the code has been removed from the mozilla source tree. xulrunner ships with the javax
pcom component, which allows java code to interact with x
pcom objects. as you will see in this article, working with x
pcom objects in java is not that much different than doing so in c++. prerequisites java 1.4.2 or newer xulrunner 1.8.0.1 or newer embedding in order to embed mozilla in your java application, you will need to add the library mozillainterfaces.jar (located in xulrunner/sdk/lib folder)...
... to start embedding, we use the methods provided by the mozilla singleton class. ...
... if your code cannot find the gre and keeps throwing filenotfoundexceptions during the getgrepathwithproperties(...) call, check whether you already re...
...And 9 more matches
XPCOM reference
this reference describes the interfaces and functions provided by the x
pcom library. in addition, it details the various helper classes and functions, as well as the components, provided by the x
pcom glue library. the contents herein are oriented primarily toward extension developers and people embedding x
pcom in other projects. if you're working on a module in the mozilla codebase that's compiled with the mozilla_internal_api flag set, some of these apis -- the string functions and classes in particular -- are not the ones you should be using. see the x
pcom internal string guide for documentation of the internal string api used within the mozilla codebase. ...
...there are currently three folder classes - nslocalmailfolder, nsimapmailfolder, and nsnewsfolder. ...
...there are currently three folder classes - nslocalmailfolder, nsimapmailfolder, and nsnewsfolder. ...
...And 9 more matches
Standalone XPCOM - Archive of obsolete content
warning: the content of this article may be out of date. these instructions were last updated in 2000. standalone x
pcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of x
pcom. the contents of this standalone x
pcom in general are: nspr : mozilla/nsprpub x
pcom : mozilla/x
pcom note 1: x
pcom apis are not frozen yet. by x
pcom 1.0 release they will be. note 2: x
pcom standalone differs from the x
pcom built with mozilla. hence cannot be used with the mozilla browser. ...
...al set of libraries (shared mostly) that can be used to get all features of x
pcom. the contents of this standalone x
pcom in general are: nspr : mozilla/nsprpub x
pcom : mozilla/x
pcom note 1: x
pcom apis are not frozen yet. by x
pcom 1.0 release they will be. note 2: x
pcom standalone differs from the x
pcom built with mozilla. hence cannot be used with the mozilla browser. ...
...ll features of x
pcom. the contents of this standalone x
pcom in general are: nspr : mozilla/nsprpub x
pcom : mozilla/x
pcom note 1: x
pcom apis are not frozen yet. by x
pcom 1.0 release they will be. note 2: x
pcom standalone differs from the x
pcom built with mozilla. hence cannot be used with the mozilla browser. building standalone x
pcom here are the instructions for building the standalone x
pcom on unix or windows: step 1 : pull the sources cvs -z 3 co mozilla/client.mk cd mozilla gmake -f client.mk pull_all build_modules=x
pcom step 2 : build x
pcom standalone ./configure --enable-standalone-modules=x
pcom --enable-application=standalone gmake testing standalone x
pcom x
pcom/sample contains a sample application and a component. this should get built by default. nstestsam...
...And 7 more matches
XPCOM guide
these articles provide tutorials and usage documentation for x
pcom, including how to use it in your own projects and how to build x
pcom components for your firefox add-ons and the like. avoiding leaks in javascript x
pcom componentsprogrammers writing and reviewing javascript code in mozilla should understand how code using x
pcom in javascript can leak so that they can avoid leaks. ...
...ns and the like. avoiding leaks in javascript x
pcom componentsprogrammers writing and reviewing javascript code in mozilla should understand how code using x
pcom in javascript can leak so that they can avoid leaks. ...
...onentsprogrammers writing and reviewing javascript code in mozilla should understand how code using x
pcom in javascript can leak so that they can avoid leaks. ...
...And 7 more matches
How to build a binary XPCOM component using Visual Studio
on windows, the sdk is built using a microsoft compiler, so you need to use one too. this tutorial uses microsoft’s free visual c++ express and the sample project in the next paragraph. ...
...on windows, the sdk is built using a microsoft compiler, so you need to use one too. this tutorial uses microsoft’s free visual c++ express and the sample project in the next paragraph. ...
...on windows, the sdk is built using a microsoft compiler, so you need to use one too. this tutorial uses microsoft’s free visual c++ express and the sample project in the next paragraph. ...
...And 7 more matches
NS_InitXPCOM2
abindirectory [in] the directory containing the component registry and runtime libraries. ...
... abindirectory [in] the directory containing the component registry and runtime libraries. ...
... abindirectory [in] the directory containing the component registry and runtime libraries. ...
...And 7 more matches
nsIXmlRpcClient
warning: this interface was removed from firefox 3 and is no longer available. extensions/xml-r
pc/idl/nsixmlr
pcclient.idlscriptable please add a summary to this article. ...
...null if the last call d...
... string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlr
pcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly nsiurl the url of the xml-r
pc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlr
pcfault the most recent xml-r
pc fault from returned from this server. null if the last call didn't return an xml-r
pc fault. result readonly nsisupports the most recent xml-r
pc call result returned from this server. null if the last call didn't return a valid result. responsestatus readonly unsign...
...And 7 more matches
XPCOM ABI
x
pcom abi is the binary interface of x
pcom components. while x
pcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) require recompilation when moving to a different platform. often, compiled x
pcom components are called 'binary' or 'native'. a binary x
pcom component consists of an .xpt file which fits all platforms and a dll (.dll on windows, .so on unix) which is platform-specific and has a certain abi. only applications which use this abi could use this x
pcom component. to put it simply, an x
pcom component built for a specific abi would only be compatible with firefox, thunderbird or other xulrunner application built for the same abi. abi n...
...its all platforms and a dll (.dll on windows, .so on unix) which is platform-specific and has a certain abi. only applications which use this abi could use this x
pcom component. to put it simply, an x
pcom component built for a specific abi would only be compatible with firefox, thunderbird or other xulrunner application built for the same abi. ...
...lt for a specific abi would only be compatible with firefox, thunderbird or other xulrunner application built for the same abi. ...
...And 7 more matches
XPCOM array guide
mozilla has many array classes because each array is optimized for a particular usage pattern. this guide describes the available arrays as well as the enumerator classes that can be used to get to them. in this document the term array refers to a container for multiple objects with a numeric, zero-based index. the standard array classes are: nsiarray - a scriptable container for scriptable x
pcom objects. this array is read-only, and the interface does not provide any methods that will allow adding and removing members. nsimutablearray - a scriptable container for scriptable x
pcom objects, which allows addition and removal of member objects. this interface actually derives from nsiarray. nstarray<t> - a c++ class which provides a typesafe container for objects or primitive types (poin...
...e on nstarray for arrays instantiated with pointer types. some other arrays: fallibletarray, autofallibletarray, infallibletarray, autoinfallibletarray, nstobserverarray, nsautotobserverarray. ...
...llibletarray, infallibletarray, autoinfallibletarray, nstobserverarray, nsautotobserverarray. this handy chart may make it easier to understand the different arrays: class data type scriptable? typesafe? can be modified? built in buffer? ownership nsiarray x
pcom object yes no no no reference counted, weak/strong nsimutablearray x
pcom object yes no yes no reference counted, weak/strong nscomarray<t> x
pcom object no yes yes* no reference counted, strong nstarray<t> any that has a default constructor and copy constructor no yes yes* no can hold objects directly, in which case it owns them. when holding pointers, doesn't own the pointer. nsautotarray<...
...And 6 more matches
Introduction to XPCOM for the DOM
warning: this document has not yet been reviewed by the dom gurus, it might contain some errors. this document is an introduction to the use of x
pcom in the context of the dom code. the use of x
pcom and nscomptr's described in this document covers about 80% of what you need to know to read the dom code, and even write some. for more advanced topics, please see the x
pcom page. the tracking bug for this document is bug 99592. target audience: people who would like a quick introduction to the use of c++ and x
pcom in the dom code. the understanding of the content of this document is a requirement to read the rest of the dom hacking guide. important note: this document assumes some knowledge of c++, specially the object-oriented part of it. i learned c++ by reading "c++ primer" from ...
...is a requirement to read the rest of the dom hacking guide. important note: this document assumes some knowledge of c++, specially the object-oriented part of it. i learned c++ by reading "c++ primer" from stanley lippman and josee lajoie, then experimenting on the dom code. i recommend that book to all the beginners out there. ...
...ant note: this document assumes some knowledge of c++, specially the object-oriented part of it. i learned c++ by reading "c++ primer" from stanley lippman and josee lajoie, then experimenting on the dom code. i recommend that book to all the beginners out there. introduction to the introduction the dom makes extensive use of x
pcom. in fact, to do anything with the dom implementation you need x
pcom. you do not, however, need to know all the hairy details, if you just intend to read the code or to work with the existing framework. the numerous macros and facilities brought by the dom, as well as nscomptr's, make our life much easier. in this chapter i will attempt to cover the most widespread use of x
pcom in the dom, avoiding the details as much as possible. i will introduce nscomptr's, in...
...And 6 more matches
NS_ShutdownXPCOM
once this function has been called, the nsicomponentmanager and nsiservicemanager will refuse to return object instances. ...
...once this function has been called, the nsicomponentmanager and nsiservicemanager will refuse to return object instances. ...
...once this function has been called, the nsicomponentmanager and nsiservicemanager will refuse to return object instances. ...
...And 6 more matches
Creating a Python XPCOM component
creating applications with mozilla already provides a tutorial for making a simple javascript or c++ component (implementing the nsisimple interface). here is how to make the same component in python using pyx
pcom. (note that some details may be missing.) preparation if a binary of pyx
pcom is not available, you will need to build it - see building pyx
pcom. tip: you can achieve a copy of binary of pyx
pcom from pythonext; simply unpack xpi and take everything you need. if you wish to use pyx
pcom from a normal python executable, you will need to tell python where it can find the pyx
pcom library. this is probably best done by setting a pythonpath variable pointing at the 'bin/python' directory in the application. this is not necessary when your components are loaded by mozilla as the...
...take everything you need. if you wish to use pyx
pcom from a normal python executable, you will need to tell python where it can find the pyx
pcom library. this is probably best done by setting a pythonpath variable pointing at the 'bin/python' directory in the application. this is not necessary when your components are loaded by mozilla as the python loader modifies sys.path. then you can import x
pcom in any python module (mostly, in your component). defining the interface make a file named "nsipysimple.idl" to define the interface: #include "nsisupports.idl" [scriptable, uuid(2b324e9d-a322-44a7-bd6e-0d8c83d94883)] interface nsipysimple : nsisupports { attribute string yourname; void write( ); void change(in string avalue); }; this is the same as the nsisimple interface used he...
...ring and wstring for unicode transfer. see here for info on describing interfaces, and on which types can be used. registering the interface in the "components" directory, execute : ../xpidl -m typelib -w -v -i /usr/share/idl/mozilla/ nsipysimple.idl on windows you must point to the idl directory as part of your mozilla build. ...
...And 5 more matches
XPConnect wrappers
this document is a high-level overview of x
pconnect wrapper objects (for the more technical description see x
pconnect security membranes). for practical advice on dealing with wrappers, see safely accessing content dom from chrome. developers in the know understand that wrappers play a large role in x
pconnect, and that we have a lot of them. less informed developers understand that wrappers exist and are somehow important, but they don't know when they should use what wrappers, or if they should be seeing a wrapper. note: wrappers can appear in the console log; for example "[object xraywrapper [object blah]]". because these are wrapped, you won't be able to peek down inside them from the console. ...
... that we have a lot of them. less informed developers understand that wrappers exist and are somehow important, but they don't know when they should use what wrappers, or if they should be seeing a wrapper. note: wrappers can appear in the console log; for example "[object xraywrapper [object blah]]". because these are wrapped, you won't be able to peek down inside them from the console. basic x
pconnect objects x
pcwrappednative these objects are created when any natively implemented x
pcom object (that is, any object implemented in c++) needs to be reflected into javascript. this includes all dom objects (including window) and chrome elements that are reflected into javascript. this wrapper is responsible for mapping calls from javascript into c++. this means that when you say window.foc...
...ative these objects are created when any natively implemented x
pcom object (that is, any object implemented in c++) needs to be reflected into javascript. this includes all dom objects (including window) and chrome elements that are reflected into javascript. this wrapper is responsible for mapping calls from javascript into c++. this means that when you say window.focus(), you're calling into x
pcwrappednative code. if you call 'tostring()' and get "[x
pconnect wrapped nsifoo]" then the reference is to a x
pcwrappednative object with interface nsifoo. they are implicitly created by x
pconnect and you should not have to worry about how that happens. there are several types of wrapped natives, but i won't cover those here. ...
...And 5 more matches
Core XPCOM functions
x
pcom provides a number of global functions which are used to initialize and shut down the x
pcom library, as well as to allocate memory, get access to services, and to instantiate interfaces. ...
... x
pcom provides a number of global functions which are used to initialize and shut down the x
pcom library, as well as to allocate memory, get access to services, and to instantiate interfaces. ...
... x
pcom provides a number of global functions which are used to initialize and shut down the x
pcom library, as well as to allocate memory, get access to services, and to instantiate interfaces. ...
...And 5 more matches
JS XPCOM - Archive of obsolete content
here are a few useful snippets of code for dealing with x
pcom components in javascript. contract ids a contract id is a unique name for an x
pcom object. they are used to create or access well-known objects in x
pcom. interfaces every x
pcom object implements one or more interfaces. an interface is simply a list of constants and methods that can be called on the object, an example is nsifile. every x
pcom object must implement the nsisupports interface. accessing x
pcom components from javascript x
pcom objects are either created as new instances (each creation gives you a completely new com object) or as services (each access gives you the same com object, often called a singleton). whether you must create a new instance or access as a service depends on the contract. in order to get an xp...
... a completely new com object) or as services (each access gives you the same com object, often called a singleton). whether you must create a new instance or access as a service depends on the contract. in order to get an x
pcom object you need to know the contract id of the object and the interface that you wish to use on it. creating an instance of a component the preferred method of creating x
pcom instances is via the components.constructor helper. for example, var nsfile = components.constructor("@mozilla.org/file/local;1", "nsifile", "initwithpath"); var file = new nsfile(filepath); they can also be created and initialized manually: var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsifile); file.initwithpath(file...
...= new nsfile(filepath); they can also be created and initialized manually: var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsifile); file.initwithpath(filepath); this creates a new instance of the object with contract id @mozilla.org/file/local;1 and allows you to call methods from the nsifile interface on it. getting an x
pcom service var preferences = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); you can then call any methods in the nsiprefservice interface on the preferences object. getting a different interface for a component some components implement more than one interface. sometimes javascript is clever enough to kno...
...And 4 more matches
XPCOM Interfaces - Archive of obsolete content
calling native objects by using xul we can build a complex user interface. we can attach scripts which modify the interface and perform tasks. however, there are quite a number of things that cannot be performed directly with javascript. for example, if we wanted to create a mail application, we would need to write scripts which would connect to mail servers to retrieve and send mail. javascript does not have the capability to do such things. the only way to handle this would be to write native code that would get mail. ...
...e wanted to create a mail application, we would need to write scripts which would connect to mail servers to retrieve and send mail. javascript does not have the capability to do such things. the only way to handle this would be to write native code that would get mail. we also need to have a way for our scripts to call the native code easily. mozilla provides such a method which involves using x
pcom (cross-platform component object model). mozilla provides many x
pcom components and interfaces. so, in most cases, you don't need to write native code for yourself. after learning this section, you can search suitable interfaces using xulplanet x
pcom reference about x
pcom mozilla is constructed from a collection of components, each of which performs a certain task. for example, there is a co...
...e a component by accessing it using the functions we know from the interface. in mozilla, interfaces are usually preceded by 'nsi' or 'mozi' so that they are easily recognized as interfaces. for example, the nsiaddressbook is the interface for interacting with an address book, nsisound is used for playing files and nsilocalfile is used for files. for more interfaces in mozilla, see interfaces. x
pcom components are typically implemented natively, which means that they generally do things that javascript cannot do itself. however, there is a way in which you can call them, which we will see shortly. we can call any of the functions provided by the component as described by the interfaces it implements. for example, once we have a component, we can check if it implements nsisound, and, if so,...
...And 4 more matches
Using LDAP XPCOM with XULRunner - Archive of obsolete content
see the build_documentation for more information about how to build xulrunner. when configuring build options, just add: ac_add_options --enable-ldap to your .mozconfig file. ...
...see the build_documentation for more information about how to build xulrunner. when configuring build options, just add: ac_add_options --enable-ldap to your .mozconfig file. ...
...see the build_documentation for more information about how to build xulrunner. when configuring build options, just add: ac_add_options --enable-ldap to your .mozconfig file. ...
...And 4 more matches
NS_InitXPCOM3
« x
pcom api reference summary the ns_initx
pcom3 function initiates use of x
pcom in the calling process with support for statically defined x
pcom modules. #include "nsx
pcom.h" nsresult ns_initx
pcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, nsstaticmoduleinfo const* astaticmodules, pruint32 astaticmodulecount ); parameters aresult [out] the resulting x
pcom service manager. you may pass null if you are not interested in this return value. the service manager may alternatively be accessed by calling ns_getservicemanager. the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownx
pcom when the application is finished with x
pcom. abindir...
...ger. the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownx
pcom when the application is finished with x
pcom. abindirectory [in] the directory containing the component registry and runtime libraries. pass null to specify that the current working directory should be used. aappfilelocationprovider [in] the object to be used by x
pcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.). this parameter may be nsnull. astaticmodules [in] an array of nsstaticmoduleinfo objects. ...
...ed by x
pcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.). this parameter may be nsnull. astaticmodules [in] an array of nsstaticmoduleinfo objects. passing null causes the default (built-in) static modules to be registered, if present. astaticmodulecount [in] the number of elements in astaticmodules. return values the ns_initx
pcom3 function returns ns_ok if successful. otherwise, it returns an error code. some of the possible errors are documented below: ns_error_not_initialized indicates that static globals were not yet initialized, which may happen if this method is called before x
pcom's static initialization code executes. ...
...And 4 more matches
RTCRtpCapabilities - Web APIs
there are some special entries in this array, described below in the section the codecs array. ...
...there are some special entries in this array, described below in the section the codecs array. ...
...there are some special entries in this array, described below in the section the codecs array. ...
...And 4 more matches
Detailed XPCOM hashtable guide
keys can be disjunct (i.e. you can store entries with keys 1, 5, and 3000). ...
...tems. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. any type: almost any datatype can be used as key, including strings, integers, x
pcom interface pointers, iids, and almost anything else. keys can be disjunct (i.e. you can store entries with keys 1, 5, and 3000). lookup time: o(1): lookup time is a simple constant o(1): lookup time is mostly-constant, but the constant time can be larger than an array lookup sorting: sorted: stored sorted; iterated over in a sorted fashion. unsorted: stored unsorted...
...ng> <ns(c)stringhashkey, nsstring> <nsidhashkey, nsstring> <nsisupportshashkey, nsstring> complex (structures, etc.) nsthashtable<...> pldhash the pldhash implementation is a fairly low-level implementation, written in c. it is extremely flexible, but requires some time to understand and use. a basic guide is included here, but you should read most of x
pcom/glue/pldhash.h if you intend to use pldhash. the c++ wrappers for pldhash (see below) are often much easier and safer to use in c++ code, as many potential casting errors are easily avoided. you must declare an entry struct type, deriving from pldhashentryhdr. this entry struct should contain whatever data you wish to store in the hashtable (any pointer or fixed-length data type). note: becaus...
...And 3 more matches
PyXPCOM
pyx
pcom allows for communication between python and x
pcom, such that a python application can access x
pcom objects, and x
pcom can access any python class that implements an x
pcom interface. pyx
pcom is actively used in activestate komodo products, for example. with pyx
pcom, a developer can talk to x
pcom or embed gecko from a python application. pyx
pcom is similar to javax
pcom (java-x
pcom bridge) or x
pconnect (javascript-x
pcom bridge). mozilla defines many external interfaces available to embeddors and component developers. pyx
pcom provides access to these interfaces as python interfaces. pyx
pcom also contains several classes that provide access to functions for initializing and shutting down x
pcom and gecko from python, as well as some x
pcom helper functions. documentati...
...om bridge). mozilla defines many external interfaces available to embeddors and component developers. pyx
pcom provides access to these interfaces as python interfaces. pyx
pcom also contains several classes that provide access to functions for initializing and shutting down x
pcom and gecko from python, as well as some x
pcom helper functions. documentation building pyx
pcom the instructions for building pyx
pcom. creating a python x
pcom component an example of how to create a simple x
pcom component with python. getting to know pyx
pcom pyx
pcom is a bridging technology between x
pcom and python. this article gives you a head start to pyx
pcom. note: the links to part ii and iii of ...
...w to create a simple x
pcom component with python. getting to know pyx
pcom pyx
pcom is a bridging technology between x
pcom and python. this article gives you a head start to pyx
pcom. note: the links to part ii and iii of this series are broken and i cannot find them on the ibm site. please update this page if/when the links can be found. history pyx
pcom was initially developed by activestate tool corporation, and came out of their komodo project. current releases are now integrated with the mozilla build system. ...
...And 3 more matches
xpcshell
x
pcshell is an x
pconnect-enabled javascript shell. it is a console application that lets you run javascript code. unlike the ordinary js shell (js), x
pcshell lets the scripts running in it access x
pcom functionality. prerequisites you need your own build of mozilla to use x
pcshell. running x
pcshell ./run-mozilla.sh ./x
pcshell x
pcshell is almost always in the same directory as run-mozilla.sh. $ locate run-mozilla.sh /usr/lib/firefox-0.10.1/run-mozilla.sh /usr/lib/thunderbird-0.9/run-mozilla.sh /usr/local/mozilla/run-mozilla.sh /opt/mozilla/run-mozilla.sh /root/.trash/mozilla/run-mozilla.sh just pick one, cd over there, and run-mozilla.sh x
pcshell, if it's present. (however, it might not be there if you have a non-debug version of firefox, mozilla, thunderbird, etc.) $ cd /op...
.../usr/lib/firefox-0.10.1/run-mozilla.sh /usr/lib/thunderbird-0.9/run-mozilla.sh /usr/local/mozilla/run-mozilla.sh /opt/mozilla/run-mozilla.sh /root/.trash/mozilla/run-mozilla.sh just pick one, cd over there, and run-mozilla.sh x
pcshell, if it's present. (however, it might not be there if you have a non-debug version of firefox, mozilla, thunderbird, etc.) $ cd /opt/mozilla $ ./run-mozilla.sh ./x
pcshell js> execute x
pcshell from window the built x
pcshell.exe can't be executed under the mozilla build shell(bash). ...
...n-mozilla.sh x
pcshell, if it's present. (however, it might not be there if you have a non-debug version of firefox, mozilla, thunderbird, etc.) $ cd /opt/mozilla $ ./run-mozilla.sh ./x
pcshell js> execute x
pcshell from window the built x
pcshell.exe can't be executed under the mozilla build shell(bash). it should be executed under the window command prompt source_directory/obj-xxxxx/dist/bin> x
pcshell.exe using the latest version of javascript at present, x
pcshell doesn't use the latest version of javascript, so newer language features, such as the let statement introduced in javascript 1.7, are not available. to rectify this, run x
pcshell with the -v 180 command-line option, which tells x
pcshell to use javascript 1.8. example you can input javascript, straight to mozilla. js> 5+7 12...
...And 2 more matches
XPConnect
x
pconnect is a bridge between javascript and x
pcom. with x
pconnect, you can use x
pcom components from javascript code, and interact with javascript objects from within x
pcom components. x
pconnect is part of firefox and is actively used in xul applications. documentation architecture basics x
pconnect, javascript, x
pcom, xul... using components how to talk with x
pcom components. x
pconnect and xpidl faq a faq about using x
pconnect and xpidl. this page needs to migrate to mdn. ...
...m components. x
pconnect is part of firefox and is actively used in xul applications. documentation architecture basics x
pconnect, javascript, x
pcom, xul... using components how to talk with x
pcom components. x
pconnect and xpidl faq a faq about using x
pconnect and xpidl. this page needs to migrate to mdn. ...
...fox and is actively used in xul applications. documentation architecture basics x
pconnect, javascript, x
pcom, xul... using components how to talk with x
pcom components. x
pconnect and xpidl faq a faq about using x
pconnect and xpidl. this page needs to migrate to mdn. ...
...And 2 more matches
XPCOM tasks
warning: the content of this article may be out of date. it was last edited in 2003 and is probably of historical interest only. the role of x
pcom the x
pcom module roughly parallels the c/c++ standard libraries. it overlaps them significantly, but goes beyond them in capabilities. x
pcom sits above the standard libraries. its role is to extend them with facilities tailored to x
pcom development in general, and specifically the needs of mozilla. like the standard libraries, x
pcom must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies. ...
... beyond them in capabilities. x
pcom sits above the standard libraries. its role is to extend them with facilities tailored to x
pcom development in general, and specifically the needs of mozilla. like the standard libraries, x
pcom must be a fairly self-contained library, so as not to encumber clients with any unnecessary external dependencies. changes to the build hierarchy there are things in x
pcom that don't belong there. there is likely to be code outside of x
pcom that should be in it. there is code above x
pcom that should be below it. p3 i/o functionality (except for the filespec facility) probably doesn't belong in x
pcom; perhaps it should be moved to netwerk p3 the `twips' units routines (or perhaps all routines) in "nsunitconversion.h" probably belong in layout. p3 nsstringtoken...
...m that should be below it. p3 i/o functionality (except for the filespec facility) probably doesn't belong in x
pcom; perhaps it should be moved to netwerk p3 the `twips' units routines (or perhaps all routines) in "nsunitconversion.h" probably belong in layout. p3 nsstringtokenizer probably belongs in the parser. 5.1 3rd party code that doesn't use any services from our tree should be below x
pcom; particularly, code x
pcom could exploit, e.g., expat berkeley db changes to apis, functionality, and implementations the following items are listed (very) roughly in their order of importance, i.e., fixing observers is the first thing i want to do. p1 various threading issues, e.g., too many locks. see bug 13009. not enough locks. see bug 5795, bug 12755, and bug 12755. p1 we would ...
...And 2 more matches
Fun With XBL and XPConnect
introduction this article describes an application of xbl in which a simple x
pcom interface is made accessible to a xul widget. the interface definition feature of xbl is used to define an interface through x
pconnect to a c++ object that does auto completion. once the regular xul textfield widget is bound to this interface, it calls the auto complete function of the object using regular javascript. the basic model of interaction is as follows: binding to the x
pcom object the widget holds onto an x
pcom object that is the auto complete engine that will perform our auto complete lookups. <binding name="autocomplete" extends="xul:box"> <content> <xul:textfield class="addressingwidget"/> <xul:menupopup/> </content> <implementation> <property name="autocompletesession"> ...
...omponents.classes['component://netscape/messenger/autocomplete&type=addrbook']. getservice(components.interfaces.nsiautocompletesession); ]]> </property> so we've defined a property on the widget called autocompletesession. the initial value of this property evaluates to an xp-connect object. now accesses to autocompletesession will return the xp-connect object. exposing the x
pcom interfaces one somewhat nasty trick you need to do is to manually expose the interfaces of the x
pcom object that you want your widget to support. all you have to do is specifically defining a method on the xbl widget which forwards the method call to the x
pcom object. <method name="autocomplete"> <argument name="asearchstring"/> <argument name="resultlistener"/> <body> ...
...thod is just getting the auto complete session object and calling the auto complete method on it. implementing a widget interface the next thing i needed to do was to implement an interface on the widget which i could then pass into the auto complete session. i wanted the auto complete session to call back into the widget with search results. ...
...ments my interface. now i can pass the result of autocompletelistener into methods that require an auto complete listener (like my auto complete session object). creating the event handler the last part is the easy part. i wanted a handler that would kick off the auto complete search. the handler calls the auto complete method we've exposed on the widget which in turn forwards the call to the x
pcom object, passing in our implementation of nsiautocompletelistener. <handlers> <handler type="keypress" keycode="vk_return" value="autocomplete(anonymouscontent[0].value, this.autocompletelistener);"/> </handlers> </implementation> </binding> original document information author(s): scott macgregor last updated date: april 13, 2000 copyright information: copyright...
XPCShell Reference
the command line the command-line syntax for x
pcshell is: x
pcshell [-s] [-w] [-w] [-v version] [-f scriptfile] [scriptfile] [scriptarg...] -c this option turns on the "compile-only" mode. (setting this option disables the "interactive" mode) -f this option specifies a script file to execute. x
pcshell terminates upon script completion. you can specify multiple js files to execute by using multiple -f arguments, and the scripts will be executed in the order encountered. furthermore, x
pcshell looks for x
pcshell.js in the current directory. if that file is found, it is executed before any other js files specified. -g this option specifies which gecko runtime environment directory (gredir) to use for x
pcom. -i this option turns on the "interactive" mode -s this option...
...rguments are only passed to “scriptfile” and not the scripts designated by –f options. these arguments appear on the global property arguments. for instance, assume that you have a file called test.js with the following contents: for (prop in arguments) { print(prop + "=" + arguments[prop]); } entering the following at the command line should produce the following output: $ x
pcshell test.js this is a test 0=this 1=is 2=a 3=test x
pcshell extensions once you execute x
pcshell without a script you'll be at the js> command line. the following are some useful functions that can be invoked from the command line: clear(object) clear() removes all properties from an object. for example, if you created anobject with a property named value and then called clear(anobject), t...
...script.js in the current directory. print(obj1, obj2, …) print() is useful to print something to the screen. it dumps whatever is passed to the screen, putting spaces between arguments and appending a newline at the end. an example print(1, 2, 3) will print 1 2 3<newline>. dump(object) dump() is almost like print. it only handles one parameter and it doesn't append a newline. dumpx
pc(depth) this function dumps the x
pconnect object. see the documentation on debugdump() for the nsix
pconnect interface for more information. version(newversion) version() returns the javascript engine version number. if you pass a number to it, it will set the version number (and return the old version number). see the above documentation on the -v command-line argument for more information. ...
...ormation. version(newversion) version() returns the javascript engine version number. if you pass a number to it, it will set the version number (and return the old version number). see the above documentation on the -v command-line argument for more information. quit(exitcode) quit() exits the shell. you can specify arguments that will get translated to an exit code. quit(5) will exit x
pcshell with a result code of 5. original document information author: david bradley <dbradley@netscape.com> last updated date: 17 march 2003 copyright information: portions of this content are © 1998–2008 by individual mozilla.org contributors; content available under a creative commons license. ...
nsIXPCException
js/src/x
pconnect/idl/x
pcexception.idlscriptable these exception objects are the preferred types of exceptions when implementing x
pcom interfaces in javascript. ...
...criptable these exception objects are the preferred types of exceptions when implementing x
pcom interfaces in javascript. ...
...xceptions when implementing x
pcom interfaces in javascript. inherits from: nsiexception last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void initialize(in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); x
pcexjsval stealjsval(); native code only! void stowjsval(in x
pcexjscontextptr cx, in x
pcexjsval val); native code only! methods initialize() void initialize( in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner ); parameters amessage aresult aname alocation adata ainner native code only!stealjsval x
pcexjsval stealjsval(); parameters none. return value nat...
...ode only! methods initialize() void initialize( in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner ); parameters amessage aresult aname alocation adata ainner native code only!stealjsval x
pcexjsval stealjsval(); parameters none. return value native code only!stowjsval void stowjsval( in x
pcexjscontextptr cx, in x
pcexjsval val ); parameters cx val remarks components.exception is a javascript constructor to create nsix
pcexception objects. the call signature of the constructor is: components.exception(message, result, stack, data, inner) all parameters are optional and the appropriate placeholder is 'unknown'. message - a custom message set by the thrower (defaults to 'excepti...
XPCOM Interface Reference
this is a reference to the x
pcom interfaces provided by the mozilla platform. component; nsiprefbranchextensionmanager (toolkit)iaccessible2iaccessibleactioniaccessibleapplicationiaccessiblecomponentiaccessibleeditabletextiaccessiblehyperlinkiaccessiblehypertextiaccessibleimageiaccessiblerelationiaccessibletableiaccessibletable2iaccessibletablecelliaccessibletextiaccessiblevalueidispatchijsdebuggeramiinstallcallbackamiinstalltriggeramiwebinstallinfoamiwebinstalllisteneramiwebinstallpromptamiwebinstallerimgicacheimgicontainerimgicontainerobserverimgidecoderimgidecoderobserverimgiencoderimgiloaderimgirequestinidomutilsjsdistackframemoziasyncfaviconsmoziasynchistorymozicoloranalyzermozijssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentat...
...amiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsierrorservicensieventlistenerinfonsieventlistenerservicensieventsourcensieventtargetnsiexceptionnsiextensionmanagernsiexternalhelperappservicensiexternalprotocolservicensiexternalurlhandlerservicensift
pchannelnsiftpeventsinknsifactorynsifavicondatacallbacknsifaviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifileurlnsifileutilitiesnsifileviewnsifocusmanage...
...ileurlnsifileutilitiesnsifileviewnsifocusmanagernsiformhistory2nsiframeloadernsiframeloaderownernsiframemessagelistenernsiframemessagemanagernsiframescriptloadernsigsettingscollectionnsigsettingsservicensigeolocationprovidernsigeolocationupdatensiglobalhistorynsiglobalhistory2nsiglobalhistory3nsihtmleditornsihttpheaderlistenernsihapticfeedbacknsihttpactivitydistributornsihttpactivityobservernsihtt
pchannelnsihtt
pchannelinternalnsihttpheadervisitornsihttpservernsihttpupgradelistenernsiidnservicensiiframeboxobjectnsiiniparsernsiiniparserfactorynsiiniparserwriternsiioservicensiidleservicensiinprocesscontentframemessagemanagernsiinputstreamnsiinputstreamcallbacknsiinstalllocationnsiinterfacerequestornsijscidnsijsidnsijsiidnsijsonnsijetpacknsijetpackservicensijumplistbuildernsijumplistitemnsilivem...
...iwinapphelpernsiwintaskbarnsiwindowcreatornsiwindowmediatornsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobalscopensiworkermessageeventnsiworkermessageportnsiworkerscopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsixmlhttprequestnsixmlhttprequesteventtargetnsixmlhttprequestuploadnsix
pcexceptionnsix
pcscriptablensix
pconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlr
pcclientnsixmlr
pcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusns...
XPCOM primitive
also, certain apis, such as nsitransferable.settransferdata(), require primitives. ...
...also, certain apis, such as nsitransferable.settransferdata(), require primitives. ...
...also, certain apis, such as nsitransferable.settransferdata(), require primitives. ...
...also, certain apis, such as nsitransferable.settransferdata(), require primitives. ...
RTCRtpContributingSource.audioLevel - Web APIs
this value, which is in the range 0.0 to 1.0, is on a linear scale and its value is defined in dbov, or decibels (overload). ...
... this value, which is in the range 0.0 to 1.0, is on a linear scale and its value is defined in dbov, or decibels (overload). ...
... this value, which is in the range 0.0 to 1.0, is on a linear scale and its value is defined in dbov, or decibels (overload). ...
...linear scale and its value is defined in dbov, or decibels (overload). this is the amplitude relative to the point at which clipping of the audio begins to occur. a value of 1.0 represents 0 dbov (maximum volume), a value of 0.0 represents silence, and a value of 0.5 represents approximately 6 db spl (decibels of sound pressure level) change in the sound pressure level from 0 dbov. for both rtcrt
pcontributingsource and rtcrtpsynchronizationsource, the audio level is converted to this form from the values defined in the specifications corresponding to each type of source. audiolevel may be absent from rtcrt
pcontributingsource objects, which indicates that no volume level was provided by the source; however, it is required and always available on all rtcrtpsynchronizationsource objects. s...
Using XPCOM without chrome - Archive of obsolete content
using sdk x
pcom with the low-level module sdk/platform/x
pcom , it's possible to exclude chrome and x
pcomutils in some cases. below is an example for the x
pcom bookmark observer. examples bookmarks observer normally, a bookmark observer would require chrome components and x
pcomutils as described in the following links: (observing changes to bookmarks and tags) , (creating event targets). however, with the sdk module , we can remove this need. below is an example, where we extend the x
pcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. ...
...ags) , (creating event targets). however, with the sdk module , we can remove this need. below is an example, where we extend the x
pcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. ...
...le, where we extend the x
pcom module's unknown class with an nsinavbookmarkobserverinterface and one of its optional interface methods (onitemchanged). we can then create an object from it and add it as an observer to the bookmarks service. ...
NPClass - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary n
pclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an n
pclass (i.e. an npobject). syntax struct n
pclass { uint32_t structversion; npallocatefunctionptr allocate; npdeallocatefunctionptr deallocate; npinvalidatefunctionptr invalidate; nphasmethodfunctionptr hasmethod; npinvokefunctionptr invoke; npinvokedefaultfunctionptr invokedefault; nphaspropertyfunctionptr hasproperty; npgetpropertyfunctionptr getproperty; npsetpropertyfunctionptr setproperty; npremovepropertyfunctionptr removeproperty; npenumerationfunctionptr enumerate; n
pconstructfunctionptr construct; }; warning: don't call these routines directly. you should instead use the ap...
...operty was successfully removed, otherwise returns false. enumerate called by npn_enumerate. this field is available only if structversion is np_class_struct_version_enum (2) or greater. construct called by npn_construct. this field is available only if structversion is np_class_struct_version_ctor (3) or greater. ...
...pertyfunctionptr)(npobject *npobj, npidentifier name, const npvariant *value); typedef bool (*npremovepropertyfunctionptr)(npobject *npobj, npidentifier name); typedef bool (*npenumerationfunctionptr)(npobject *npobj, npidentifier **value, uint32_t *count); typedef bool (*n
pconstructfunctionptr)(npobject *npobj, const npvariant *args, uint32_t argcount, npvariant *result); see also npobject ...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
mozilla versions 0.9.2 and higher and netscape versions 6.1 and higher. it does not cover netscape 6 and 6.01 introduction plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world. the main reason for this is that there is no guarantee of java compatibility on a binary level due to the jri/jni switch. the new mozilla x
pcom architecture allows x
pcom components be scriptable via a different mechanism called x
pconnect. we leverage some of these ideas to help you make your netscape communicator 4.x plugins exposed to javascript in mozilla based browsers. in order to make it still possible to script plugins, some changes have been made to the mozilla code. the changes allow to make existing 4.x plugins scriptable with...
...ms devstudio midl must not be used. (let's assume 'testplugin' as a plugin name-place holder.) compile nsitestplugin.idl with the idl compiler. this will generate nsitestplugin.h and nsitestplugin.xpt files. put nsitestplugin.xpt to the components folder. build nptestplugin.dll with nsitestplugin.h included for compiling scriptable instance class implement...
...lugin.xpt files. put nsitestplugin.xpt to the components folder. build nptestplugin.dll with nsitestplugin.h included for compiling scriptable instance class implementaion. put nptestplugin.dll to the plugins folder. related sources the full sample plugin code can be found in the mozilla source tree under modules/plugin/samples/4x-scriptable/ ibm developer works has published a good article on x
pcom. examples example 1. sample .idl file #include "nsisupports.idl" [scriptable, uuid(bedb0778-2ee0-11d5-9cf8-0060b0fbd8ac)] interface nsitestplugin : nsisupports { void nativemethod(); }; example 2. scriptable instance class #include "nsitestplugin.h" #include "nsiclassinfo.h" // we must implement nsiclassinfo because it signals the // mozilla security manager to allow calls from javasc...
JavaXPCOM
javax
pcom allows for communication between java and x
pcom, such that a java application can access x
pcom objects, and x
pcom can access any java class that implements an x
pcom interface. javax
pcom is not actively maintained. with javax
pcom, a developer can talk to x
pcom or embed gecko from a java application. javax
pcom is very similar to x
pconnect (javascript-x
pcom bridge), and uses xpidl. note: javax
pcom was included in xulrunner up through version 1.9.2. it has been removed in xulrunner 2, and is not actively maintained. documentation javax
pcom development how to get and build the source, as well as how to view and report bugs. sample code there are several java test applications checked in to the tree that give ex...
...ner up through version 1.9.2. it has been removed in xulrunner 2, and is not actively maintained. documentation javax
pcom development how to get and build the source, as well as how to view and report bugs. sample code there are several java test applications checked in to the tree that give examples on how to embed gecko or init x
pcom from within java. embedding mozilla in a java application using javax
pcom xulrunner ships with the javax
pcom component, which allows java code to interact with x
pcom objects. as you will see in this article, working with x
pcom objects in java is not that much different than doing so in c++. view all... community view mozilla embedding forum...
... xulrunner ships with the javax
pcom component, which allows java code to interact with x
pcom objects. as you will see in this article, working with x
pcom objects in java is not that much different than doing so in c++. view all... community view mozilla embedding forums... ...
Profiling XPCShell
introduction sometimes, you might want to get a performance profile of a certain piece of javascript (like an x
pcom module), to see which part takes the most time. you could use venkman for that. but sometimes, venkman gives too much noise (because it also profiles chrome code). or you might want to have a more reproducible testcase. in those cases, an x
pcshell script can help. you can just call the code you want to test. but then, you can't use the venkman ui. x
pctools there is profiler in the tree that can profile x
pcshell scripts. to use it, you need to enable it in your mozconfig: ac_add_options --enable-x
pctools now you can profile an entire script by setting the environment variable <tt>mozilla_js_profiler_output</tt> to a filename where you want the output file. for example,...
...after running has finished, the output file will contain a profile. a profile will look like this: file:///users/michiel/mozilla/tree1/...js/calutils.js [2,25420] createdatetime() {60-62} 579 {min 0, max 3, avg 0, sum 427, self 427} [2,56810] cp_qi() {860-866} 835 {min 0, max 1, avg 0, sum 950, self 950} the first line tells which file was profiled. ...
...(in milliseconds) the fastest call took; the time of the slowest call; the average time spend; the total time; the time spend in the function itself is given (that is the total time excluding the time spend in functions called from this function). notes you need a trunk build from after 2007-05-28. using an earlier build will cause the profiler to hang the more adventurous can use the nsix
pctoolsprofiler.idl interface directly, but be aware that you must start the profiler before loading the files you want to profile (creating an instance of a component loads the file!) ...
XPCOM glue classes
ns convertasciitoutf16 externalclass declarationns convertutf16toutf8 externalclass declarationns convertutf8toutf16 externalclass declarationns lossyconvertutf16toascii externalclass declarationns_convertasciitoutf16class declarationns_convertutf16toutf8class declarationns_convertutf8toutf16class declarationns_lossyconvertutf16toasciiclass declarationns_overridens_override is a macro which allows c++ code in mozilla to specify that a method is intended to override a base class method. ...
... must be released, typically on destruction of the object.</t>nsautoreftraitsnsautoreftraits<t> is a template class describing traits of resources held by objects of class nsautoref<t> and/or nscountedref<t>.</t>nsautostringclass declarationnsautostring (external)class declarationnscautostringclass declarationnscautostring (external)class declarationnscomptrthis utility class simplifies managing x
pcom interface references from c++ code.nscountedrefnscountedref<t> is a template class implementing an object that takes a strong reference to a reference-counted resource that must be released, typically on destruction of the object.</t>nscstringclass declarationnscstring externalclass declarationnscstringcontainer (external)class declaration nscstringencodingthe nscstringencoding enumeration ...
...orage.nsembedstringthe nsembedstring concrete class provides a way to construct a nsastring object that allocates null-terminated storage.nsfixedcstringclass declarationnsfixedstringclass declarationnsliteralcstring (external)class declarationnsliteralstring (external)class declarationnsmemorythe nsmemory class provides static helper routines to manage memory. these routines allow easy access to x
pcom's global nsimemory implementation without having to go through the service manager to get it.nspromiseflatcstringclass declarationnspromiseflatstringclass declarationnsrefptrrefptr (formerly known as nsrefptr, see bug 1207245) is a general class to implement reference counting pointers for objects. it is similar to nscomptr, but does not require that the type be an x
pcom interface. like with n...
XPCOM Interface Reference by grouping
grouping and category names were made by somewhat arbitrary decision by the author. (i'm fully aware that this will be a great point of discussion and probably will end in tears, but since i'm the first person to apparently take a swing at this, i get first dibs.) the primary sections consist of: browser this section contains elements associated with the view pane or the content of the "browser window" proper. ...
...nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference nsivariant do not use nsienumerator nsiinprocesscontentframemessagemanager nsiscriptableio nsix
pcscriptable future nsixmlhttprequestupload obsolete nsixmlr
pcclient nsixmlr
pcfault security auth nsiauthmodule nsiauthprompt nsiauthpromptprovider nsiauthpromptwrapper nsiasyncverifyredirectcallback content nsicontentpolicy credentials nsilogininfo ...
... nsifilestreams nsifileutilities nsifileview memory nsimemory network channel nsichannel nsichanneleventsink nsirequest nsirequestobserver nsiresumablechannel nsidnsservice nsift
pchannel nsiftpeventsink nsihtt
pchannel nsihtt
pchannelinternal nsihttpheadervisitor nsiidnservice nsiprotocolhandler nsiprotocolproxycallback nsiprotocolproxyfilter nsiprotocolproxyservice nsiproxyinfo preferences nsiiniparser nsiiniparserfactory nsiprefbranch nsiprefbr...
onMSVideoFrameStepCompleted - Web APIs
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. onmsvideoframeste
pcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. ...
...o be large incompatibilities between implementations and the behavior may change in the future. onmsvideoframeste
pcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. this proprietary property is specific to internet explorer and microsoft edge. ...
...ture. onmsvideoframeste
pcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. this proprietary property is specific to internet explorer and microsoft edge. ...
RTCRtpCodecCapability - Web APIs
properties channels optional an unsigned integer value indicating the maximum number of channels supported by the codec; for example, a codec that supports only mono sound would have a value of 1; stereo codecs would have a 2, etc. clockrate an unsigned long integer specifying the codec's clock rate in hertz (hz). the iana maintains a list of codecs and their parameters, including their clock rates. mimetype a domstring indicating the codec's mime media type and subtype. see codecs used by webrtc for details about potential codecs that might be referenced here. ...
...domstring indicating the codec's mime media type and subtype. see codecs used by webrtc for details about potential codecs that might be referenced here. sdpfmtpline optional a domstring giving the format specific parameters field from the a=fmtp line in the sdp which corresponds to the codec, if such a line exists. if there is no parameters field, this property is left out. description rtcrt
pcodeccapabilities describes the basic parameters for a single codec supported by the user's device. an array of objects of this type is returned in the codecs property of the rtcrt
pcapabilities object returned in response to a call to either of the static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities(). examples tbd specifications specification status ...
...ice. an array of objects of this type is returned in the codecs property of the rtcrt
pcapabilities object returned in response to a call to either of the static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities(). examples tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrt
pcodeccapability' in that specification. candidate recommendation ...
popChallengeResponse - Archive of obsolete content
e the compatibility table at the bottom of this page to guide your decision. be aware that this feature may cease to work at any time. warning: the features mentioned in this article are deleted proprietary mozilla extensions, and are not supported in any other browser. they won't work in firefox 34 or later. use <keygen> or the future web crypto api instead. resultstring = crypto.po
pchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message. the current implementation does not conform to that defined in the cmmf draft, and we intend to change this implementation to that defined in the cmc rfc.. see below for the current implementation. the resultstring will either be a base-6...
...engestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message. the current implementation does not conform to that defined in the cmmf draft, and we intend to change this implementation to that defined in the cmc rfc.. see below for the current implementation. the resultstring will either be a base-64 encoded popodeckeyres
pcontent message, or one of the following error strings: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value. "error:internalerror" the software encountered some internal error, such as out of memory challenge-response proof of possession expected input: popodeckeychallcontent ::= sequence of challenge -- one chall...
XPCOM Examples - Archive of obsolete content
window management this example contains rdf datasource that will be seen in the later section. you might skip this example for the time being, except when you have already had that knowledge. creating a window menu the list of currently open mozilla windows can be used as an rdf datasource. this allows you to create a window menu with a list of the currently open windows in the application. the datasource for this is rdf:window-mediator. ...
...n this case, we just use the instanceof operator to accomplish this. finally, an item is added to the menu for the cookie. the host, name and value properties of the cookie are used for this. menus have an appenditem() function which can be used to add an item to the menu, given a label and a value. see also more examples are available below. code snippets http://kb.mozillazine.org/category:x
pcom_example_code next, we'll look at how to create trees. « previousnext » ...
IPC Semaphores
this chapter describes the nspr api for using interprocess communication semaphores. ...
... this chapter describes the nspr api for using interprocess communication semaphores. ...
Accessing the Windows Registry Using XPCOM
support in firefox 1.5 or newer in firefox 1.5, a new api was added, nsiwindowsregkey, which provides extensive registry functionality. ...
... support in firefox 1.5 or newer in firefox 1.5, a new api was added, nsiwindowsregkey, which provides extensive registry functionality. ...
XPCOM Glue without mozalloc
starting with xulrunner 2.0, the frozen linkage dependent glue (x
pcomglue_s.lib on windows, libx
pcomglue_s.a on linux and mac) is dependent on the new infallible memory allocation routines (mozalloc). since these routines didn't exist prior to xulrunner 2.0, x
pcom components that link against the frozen linkage dependent glue will not be compatible with xulrunner applications prior to 2.0. the solution is to link against x
pcomglue_s_nomozalloc instead (x
pcomglue_s_nomozalloc.lib on windows, libx
pcomglue_s_nomozalloc.a on linux and mac). this library is new in xulrunner 2.0, and it's identical to x
pcomglue_s, except that it's compiled without mozalloc. ...
...e frozen linkage dependent glue will not be compatible with xulrunner applications prior to 2.0. the solution is to link against x
pcomglue_s_nomozalloc instead (x
pcomglue_s_nomozalloc.lib on windows, libx
pcomglue_s_nomozalloc.a on linux and mac). this library is new in xulrunner 2.0, and it's identical to x
pcomglue_s, except that it's compiled without mozalloc. simply change all references to "x
pcomglue_s" in your compiler and linker flags to "x
pcomglue_s_nomozalloc". resulting x
pcom components will no longer have a dependency on mozalloc, and will thus be compatible with xulrunner applications prior to 2.0 as well. comment: you might also need to build your component with the moz_no_mozalloc flag (-dmoz_no_mozalloc) ...
How To Pass an XPCOM Object to a New Window
a more useful example is available in the source code: toolkit/components/help/content/contexthelp.js#61 if you want to be able to call functions within an x
pcom object from a xul window's code, you can do so if you pass the x
pcom object as one of the arguments to the window creation method. for example: var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"]. ...
...hod. for example: var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"]. getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/debug.xul", "debug history", "chrome,centerscreen,resizable", myobject); note in this example that myobject is passed to the openwindow() method; you can pass any x
pcom object (or any other value, for that matter) in this way. to access the x
pcom object from the window's code, you can access the window.arguments[] array, as shown in the example below: components.utils.reporterror(string(window.arguments[0])); this will produce output similar to "[x
pconnect wrapped nsimyx
pcomobject]". ...
Interfacing with the XPCOM cycle collector
this is a quick overview of the cycle collector introduced into x
pcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in x
pcom cycle collection. if you have a class that you think is involved in a cyclical-ownership leak, this page is for you. the intended audience is mozilla c++ developers. what the cycle collector does the cycle collector spends most of its time accumulating (and forgetting about) pointers to x
pcom objects that might be involved in garbage cycles. this is the idle stage of the collector's operation, in which special variants of nsautorefcnt register and unregister themselves very rapidly with the collector, as they pass through a "suspicious" refcount event (from n+1 to n, for nonzero n). periodical...
... is important that it only run from near the top-loop of the program. it will not crash if there are extra owning pointers, but it will find itself unable to account for the reference counts it finds in the owned objects, so may fail to collect cycles. how to make your classes participate the interface between the cycle collector and your classes can be accessed directly using the contents of x
pcom/base/nscyclecollector.h, but there are convenience macros for annotating your classes in x
pcom/glue/nscyclecollectionparticipant.h that are much easier to use. in general, assuming you are modifying class nsfoo with two nscomptr edges mbar and mbaz, the process can be distilled to a few simple modifications: include the header nscyclecollectionparticipant.h in both nsfoo.h and nsfoo.cpp. ad...
PlXPCOM
plx
pcom (perl x
pcom) provides language bindings letting you use x
pcom from perl code. the resources here provide information about this language binding and how to use it. ...
... plx
pcom (perl x
pcom) provides language bindings letting you use x
pcom from perl code. the resources here provide information about this language binding and how to use it. ...
RbXPCOM
you can find additional information using the resource links below. ...
...you can find additional information using the resource links below. ...
nsIHttpChannel
netwerk/protocol/http/nsihtt
pchannel.idlscriptable this interface allows for the modification of http request parameters and the inspection of the resulting http response status and headers when they become available. inherits from: nsichannel last changed in gecko 1.3 to create an http channel, use nsiioservice with a http uri, for example: var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var ch = ios.newchannel("https://www.example.com/", null, null); method overview void getoriginalresponseheader(in acstring aheader, in nsihttpheadervisitor avisitor); acstring getrequestheader(in acstring aheader); acstring getresponseheader(in acstring header); b...
...e if set after the channel has been opened. redirectionlimit unsigned long this attribute specifies the number of redirects this channel is allowed to make. if zero, the channel will fail to redirect and will generate a ns_error_redirect_loop failure status. note: an http redirect results in a new channel being created. if the new channel supports nsihtt
pchannel, then it will be assigned a value to its redirectionlimit attribute one less than the value of the redirected channel's redirectionlimit attribute. the initial value for this attribute may be a configurable preference (depending on the implementation). referrer nsiuri get or set the uri of the http referer: header. this is the address (uri) of the resource from ...
nsIHttpChannelInternal
using features exposed by this interface is not recommended, as it will change in unpredictable ways. ...
...ader, but using the channel's other information (uri's, prompters, date headers and so on.). void setcookie( in string acookieheader ); parameters acookieheader the cookie header to be parsed. setupfallbackchannel() sets up this channel as an application cache fallback channel. void setupfallbackchannel( in string afallbackkey ); parameters afallbackkey the fallback key. see also nsihtt
pchannel nsichannel nsihttpupgradelistener ...
Troubleshooting XPCOM components registration
there are several common reasons that registration can fail: a component that is a binary (shared library) fails to load a javascript component has parsing errors the shared library loaded correctly, but registration was not successful did registration succeed? it is important to not misdiagnose the problem. you can be certain that a component has failed to register by going to the error console and evaluating components.classes["contract-id"].name where contract-id is your contract id. if the response is your contract id instead of an error, the component was successfully registered and this is the wrong page. ...
...ll firefox windows! set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may provide valuable clues why the component failed to load. if using firefox 4 / xulrunner 2.0, make sure that your extension is unpacked and you declared the binary component in your chrome.manifest. see x
pcom changes in gecko 2.0 parsing errors in javascript components the most common reason for components written in javascript to fail is that there are parsing errors. these parsing errors should show up in the error console if chrome errors are enabled. to learn more about enabling chrome errors, see "how can i see errors in my code" in the extension faqs. registration failure if the module is ...
RTCRtpContributingSource.rtpTimestamp - Web APIs
this value may be useful for sequencing and synchronization purposes. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtptimestamp' in that specification. ...
...this value may be useful for sequencing and synchronization purposes. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtptimestamp' in that specification. ...
RTCRtpContributingSource.timestamp - Web APIs
specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'timestamp' in that specification. ...
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'timestamp' in that specification. ...
RTCRtpContributingSource - Web APIs
the information provided is based on the last ten seconds of media received. properties audiolevel optional a double-precision floating-point value between 0 and 1 specifying the audio level contained in the last rtp packet played from this source. rtptimestamp optional the rtp timestamp of the media played out at the time indicated by timestamp. this value is a source-generated time value which can be used to help with sequencing and synchronization. ...
... unsigned integer value specifying the csrc identifier of the contributing source. timestamp optional a domhighrestimestamp indicating the most recent time at which a frame originating from this source was delivered to the receiver's mediastreamtrack specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrt
pcontributingsource' in that specification. candidate recommendation initial definition. ...
XPCOM hashtable guide
this is the simplified version of the detailed x
pcom hashtable guide. everything you need to know is probably on this page. also note that mfbt/hashtable.h now exists. it is a lot faster than the x
pcom hashtables due to more inlining and templating, and the api is arguably better. what is a hashtable? a hashtable is a data construct that stores a set of items. each item has a key that identifies the item. items are found, added, and removed from the hashtable by using the key. hashtables may seem like arrays, but there are important differences: array hashtable keys: integer: arrays are always keyed on integers, and must be contiguous. any type: almost any datatype can be used as key, including strings, integers, x
pcom interface pointers, iids, ...
XPCshell Test Manifest Expressions
you can add conditions to tests in order to control when tests get run. the conditions accept a simple boolean expression syntax, described here. operators in order of decreasing precedence: () == != && || literal values booleans: the literal strings true and false. integers: a series of contiguous digits. only decimal integers are supported. strings: any series of characters enclosed in double quotes " or single quotes '. no escape sequences are supported. variables variables are supported as a series of letters, digits or underscores beginning with a letter or an underscore. ...
Standard XPCOM components
there are a number of components provided in the standard implementation of x
pcom; these are as follows. nscategorymanagerthe x
pcom category manager.nsdirectoryservicethe x
pcom directory service. this service returns the locations of "well known" directories in an os-independent manner. for instance, it can give you the path of the system's temporary directory, desktop directory, current working directory, and so on.nslocalfilea component implementing nsilocalfile. nsobserverservicethe x
pcom observer service.nsscriptableinputstreama component implementing nsiscriptableinputstream. ...
nsIFTPChannel
the nsift
pchannel is an extension of nsisupports used to determine if a channel is an ftp channel, and offering additional information about the ftp channel. you can determine if a channel is an ftp channel by checking to see if it implements this interface, by calling nsisupports.queryinterface() on it. netwerk/protocol/ftp/nsift
pchannel.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports attributes attribute type description lastmodifiedtime prtime the time at which the ftp channel was last updated. ...
nsIXmlRpcFault
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. extensions/xml-r
pc/idl/nsixmlr
pcclient.idlscriptable an xml-r
pc exception. xml-r
pc server fault codes are returned wrapped in this; access it using nsix
pconnect.getpendingexception->data. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void init(in print32 faultcode, in string faultsring); string tostring(); attributes attribute type description faultcode print32 read only. faultstring string read only. methods init() void getdata( in print32 ...
XPCOM string functions
ns_cstringappenddatathe ns_cstringappenddata function appends data to the existing value of a nsacstring instance. ...
XPCOM Thread Synchronization
mutex::lock()) has a matching function in nspr (pr_lock()). this is no accident, as mozilla:: primitives are merely bare-minimum wrappers around nspr's. this article covers the api of mozilla synchronization only. for a higher-level introduction to thread synchronization, see introduction_to_nspr. quick reference: difference between nsautolock api and new api old construction note: this is deprecated code that is shown only to compare with approved code. ...
XPCOM category image-sniffing-services
in versions of firefox prior to firefox 3, extensions could add decoders for new 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 x
pcom category was added in bug 391667 to allow "third-party" x
pcom components to identify images based on their content. if mozilla's built-in image code cannot identify an image, then any x
pcom 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. ...
Console.groupCollapsed() - Web APIs
like console.group(), however, the new group is created collapsed. the user will need to use the disclosure button next to it to expand it, revealing the entries created in the group. call console.groupend() to back out to the parent group. see using groups in the console in the console documentation for details and examples. note: this feature is available in web workers. syntax console.grou
pcollapsed([label]); parameters label label for the group. optional. specifications specification status comment console apithe definition of 'console.grou
pcollapsed()' in that specification. living standard initial definition ...
NavigatorID.appCodeName - Web APIs
the value of the navigatorid.ap
pcodename property is always "mozilla", in any browser. this property is kept only for compatibility purposes. note: do not rely on this property to return a real product name. all browsers return "mozilla" as the value of this property. syntax codename = navigator.ap
pcodename value the string "mozilla". specifications specification status comment html living standardthe definition of 'navigatorid.ap
pcodename' in that specification. living standard initial definition ...
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetc
pcandidatetype enumerated type provides a set of domstring values representing the types of tcp candidates. values "active" the transport will try to open an outbound connection but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneously with its peer. usage notes the rtcicetc
pcandidatetype type is used by the tcptype property of rtcicecandidate objects. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetc
pcandidatetype' in that specification. candidate recommendation initial definition. ...
RTCRtpCodecParameters - Web APIs
in addition to being the type of the rtcrtpparameters.codecs property, it's used when calling rtcrtptransceiver.setcodecpreferences() to configure a transceiver's codecs before beginning the offer/answer process to establish a webrtc peer connection. most of the fields in this property take values which are defined and maintained by the internet assigned numbers authority (iana). references to relevant iana documents are provided in the see also section at the end of this article. properties payloadtype optional the rtp payload type used to identify this codec. ...
RTCRtpContributingSource.source - Web APIs
the read-only source property of the rtcrt
pcontributingsource interface returns the source identifier of a particular stream of rtp packets. the value is the contributing source (csrc) or synchronization source (ssrc) identifier, depending on whether the object is an rtcrt
pcontributingsource or rtcrtpsynchronizationsource, which is based on the former. syntax var sourceid = rtcrt
pcontributingsource.source value an unsigned, 32-bit integer value which uniquely identifies the source of rtp packets described by this rtcrt
pcontributingsource (in which case the value is a csrc identifier) or rtcrtpsynchronizationsource (the value is an ssrc identifier). specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of ...
Index
found 1275 pages: # page tags and summary 1 x
pcom add-ons, extensions, landing, mozilla, x
pcom x
pcom is a cross platform component object model, similar to microsoft com. it has multiple language bindings, allowing x
pcom components to be used and implemented in javascript, java, and python in addition to c++. 2 accessing the windows registry using x
pcom add-ons, code snippets, extensions, needsclassification, windows registry when implementing windows-specific functionality, it is often useful to access the windows registry for information about the environment or other installed programs. to this end, there exist x
pcom interfaces to read and write registry data. this article will show you how to use the available interfaces i...
... it is often useful to access the windows registry for information about the environment or other installed programs. to this end, there exist x
pcom interfaces to read and write registry data. this article will show you how to use the available interfaces in several mozilla products. 3 aggregating the in-memory datasource rdf no summary! ...
...ummary! 4 binary compatibility x
pcom if mozilla decides to upgrade to a compiler that does not have the same abi as the current version, any built component may fail. it is a possiblity that is introduced when upgrading to a new compiler without recompiling everything. effectively, it is a different platform. 5 bundling multiple binary components binary x
pcom components are sometimes required to implement low-level features for extensions. since binary components are linked against a single gecko sdk, a dependency to a particular version of gecko is created. if the component uses only "frozen" x
pcom interfaces, there is a good chance the same binary component will work with different versions of gecko (version 1.8 and 1.9, for example). the more lik...
...And 850 more matches
Key Values - Web APIs
kvk_delete (0x33) gdk_key_backspace (0xff08) qt::key_backspace (0x01000003) keycode_del (67) "clear" the clear key. removes the currently selected input. vk_clear (0x0c) vk_oem_clear (0xfe) kvk_ansi_keypadclear (0x47) gdk_key_clear (0xff0b) qt::key_clear (0x0100000b) keycode_clear (28) "copy" the copy key (on certain extended keyboards). ap
pcommand_copy gdk_key_copy (0x1008ff57) qt::key_copy (0x010000cf) "crsel" [3] the cursor select key, crsel. vk_crsel (0xf7) gdk_key_3270_cursorselect (0xfd1c) "cut" the cut key (on certain extended keyboards). ap
pcommand_cut gdk_key_cut (0x1008ff58) qt::key_cut (0x010000d0) "delete" [2] the delete key, del. vk_dele...
... "exsel" [4] the exsel (extend selection) key. vk_exsel (0xf8) gdk_key_3270_exselect (0xfd1b) "insert" the insert key, ins. toggles between inserting and overwriting text. vk_insert (0x2d) gdk_key_insert (0xff63) gdk_key_kp_insert (0xff9e) qt::key_insert (0x01000006) keycode_insert (124) "paste" paste from the clipboard. ...
..."insert" the insert key, ins. toggles between inserting and overwriting text. vk_insert (0x2d) gdk_key_insert (0xff63) gdk_key_kp_insert (0xff9e) qt::key_insert (0x01000006) keycode_insert (124) "paste" paste from the clipboard. ap
pcommand_paste gdk_key_paste (0x1008ff6d) qt::key_paste (0x010000e2) "redo" redo the last action. ap
pcommand_redo gdk_key_redo (0xff66) "undo" undo the last action. ap
pcommand_undo gdk_key_undo (0xff65) [1] on keyboards without a dedicated del key, the mac generates the "delete" value when fn is pressed in tandem with delete (which is backspace on other platforms). [2] internet explorer (tested on release 9 and 11) and firefox 36 and earlier use "del" i...
...And 45 more matches
Index - Archive of obsolete content
them. 94 net/url no summary! 95 net/xhr provides access to xmlhttprequest functionality. 96 places/bookmarks create, modify, and retrieve bookmarks. 97 places/favicon helper functions for working with favicons. 98 places/history access the user's browsing history. 99 platform/x
pcom implement x
pcom objects, factories, and services. 100 preferences/event-target add-on sdk listen to changes to the preferences system in firefox. 101 preferences/service add-on sdk, jetpack, sdk access the preferences system in firefox. 102 remote/child module, reference, sdk enables an sdk module loaded into a child proc...
... add-on sdk no summary! 163 modifying web pages based on url add-on sdk no summary! 164 modifying the page hosted by a tab add-on sdk no summary! 165 open a web page add-on sdk no summary! 166 troubleshooting no summary! 167 unit testing add-on sdk, jpm no summary! 168 using x
pcom without chrome bookmarks, chrome, sdk, x
pcom no summary! 169 using third-party modules (jpm) addon-sdk, jpm first, while in the root of your add-on, install the package that contains the modules you want to use: 170 bootstrapped extensions add-ons, extensions, firefox 4, gecko 2.0, guide, localization no summary! 171 code snippets ...
...the local file name/path. ...
...And 42 more matches
Component Internals
« previousnext » where the previous chapter described components from the perspective of a client of x
pcom components, this chapter discusses components from the perspective of the software developer. read on to see how components are generally implemented in x
pcom, or you can skip to the next chapter, where the weblock component tutorial takes you step by step through the component creation process. xxx mediawiki...xxx sucks creating components in c++ let's start by examining how x
pcom components are written in c++. the most common type of component is one that is written in c++ and compiled into a shared library (a dll on a windows system or a dso on unix). the illustration below shows the basic relationship between the shared library containing the component implementa...
...iki...xxx sucks creating components in c++ let's start by examining how x
pcom components are written in c++. the most common type of component is one that is written in c++ and compiled into a shared library (a dll on a windows system or a dso on unix). the illustration below shows the basic relationship between the shared library containing the component implementation code you write and the x
pcom framework itself. in this diagram, the outer boundary is that of the module, the shared library in which a component is defined. a component in the x
pcom framework when you build a component or module and compile it into a library, it must export a single method named nsgetmodule. this nsgetmodule function is the entry point for accessing the library. it gets called during registration and ...
...uter boundary is that of the module, the shared library in which a component is defined. a component in the x
pcom framework when you build a component or module and compile it into a library, it must export a single method named nsgetmodule. this nsgetmodule function is the entry point for accessing the library. it gets called during registration and unregistration of the component, and when x
pcom wants to discover what interfaces or classes the module/library implements. in this chapter we will outline this entire process. ...
...And 40 more matches
Starting WebLock
siobserver. observersare objects that are notified when various events occur. using them is a good way for objects to pass messages to each other without the objects having explicit knowledge of one another. usually, there is one object notifying a group of observers. ...
...if your object would like to register for this or other events, it first must implement the nsiobserver interface. ...
... nsisupports asubject, in string atopic, in wstring adata); there aren't really any restrictions on what the three parameters (asubject, atopic and adata) may represent. these parameters are defined according to the event being observed. for example, in the case of the x
pcom shutdown observation, asubject and adata are not defined, and atopic is defined as the string "x
pcom-shutdown". if your object would like to register for this or other events, it first must implement the nsiobserver interface. once you do this, the observer service implementing nsiobserverservice can notify your object of registered events by means of this interface, as in the figure below. the observer interfaces the above figure shows the observer service maintaining a list of all regist...
...And 40 more matches
Using DTMF with WebRTC - Web APIs
> <button name="dial" id="dial">dial</button> <div class="log"></div> javascript let's take a look at the javascript code next. keep in mind that the process of establishing the connection is somewhat contrived here; you normally don't build both ends of the connection in the same document. global variables first, we establish global variables. ...
... id="dial">dial</button> <div class="log"></div> javascript let's take a look at the javascript code next. keep in mind that the process of establishing the connection is somewhat contrived here; you normally don't build both ends of the connection in the same document. global variables first, we establish global variables. ...
...these will be initialized when the call starts up, in our connectanddial() function, as shown in starting the connection process below. dtmfsender the rtcdtmfsender object for the connection. ...
...And 35 more matches
Mozilla DOM Hacking Guide
mozilla gives you the opportunity not only to use very powerful and complete dom support, but also to work on a world-class implementation of one of the greatest internet technologies ever created. mozilla's dom is coded almost entirely in c++. seriously hacking on it requires excellent knowledge of c++ and x
pcom, mozilla's own component model. in this document i will try to outline the main aspects of the implementation, beginning with the class info mechanism, which lies at the heart of the dom, then with the description of various interfaces and classes. since i am myself still learning how it works, don't expect this to be a complete reference quite yet. if you can contribute any time or knowledge to this document, it is greatly appreciated! target audience: people interested i...
...anism, which lies at the heart of the dom, then with the description of various interfaces and classes. since i am myself still learning how it works, don't expect this to be a complete reference quite yet. if you can contribute any time or knowledge to this document, it is greatly appreciated! target audience: people interested in learning how the dom is implemented. prior knowledge of c++ and x
pcom is assumed. if you don't know x
pcom yet, and would like to be able to read this document quickly, you can read the introduction to x
pcom for the dom. otherwise, for more detailed x
pcom documentation, please see the x
pcom project page. class info and helper classes introduction to class info class info is what gives the dom classes their correct behavior when used through x
pconnect. it lies a...
...by "correct behavior", i mean "the intended behavior with respect to the specification or de facto standard". we will see that class info is mainly used to implement the dom level 0. the w3c dom is mainly implemented in idl. ...
...And 31 more matches
Creating the Component Code
« previousnext » this chapter goes over the basic code required to handle the relationship between your component and x
pcom. having the component found and registered properly is the goal of this first chapter of the tutorial. in the subsequent chapters, we can begin to work on the example weblock component functionality itself. use the calculator (after learning long division) you have to write a fair amount of code to create a component library that gets loaded into x
pcom. an x
pcom component needs to implement at least three interfaces that x
pcom requires, and often others as well. ...
...k on the example weblock component functionality itself. use the calculator (after learning long division) you have to write a fair amount of code to create a component library that gets loaded into x
pcom. an x
pcom component needs to implement at least three interfaces that x
pcom requires, and often others as well. there is more code in this chapter than you'll eventually need, however. using x
pcom utilities to make things easier shows some simpler and more elegant ways to create an x
pcom component using generic macros, and this chapter is more about learning the basics. as in grade school when you learned long division, better tools like calculators come after you figure out what's actually happening. in this case, the long-hand implementation gives us an opportunity to talk about variou...
... what we'll be working on the component we'll be working on in this book controls a special mode in your browser that prevents users from leaving the current domain or a set of safe domains. once enabled, this "weblock" mode is password protected and persists until it is turned off by the password holder. ...
...And 31 more matches
nsIDOMWindowUtils
nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long get
pccountscriptcount(); astring get
pccountscriptsummary(in long ascript); astring get
pccountscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); astring getvisiteddependentcomputedstyle(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodalsta...
... void removesheet(in nsiuri sheeturi, in unsigned long type); void resumetimeouts(); void sendcompositionevent(in astring atype); obsolete si...
...read only. exceptions t...
...And 28 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
sly not a real one; you'll need to replace stun.myserver.tld with the address of a real stun server. const constraints = { audio: true, video: true }; const config = { iceservers: [{ urls: "stun:stun.mystunserver.tld" }] }; const selfvideo = document.queryselector("video.selfview"); const remotevideo = document.queryselector("video.remoteview"); const signaler = new signalingchannel(); const
pc = new rtcpeerconnection(config); this code also gets the <video> elements using the classes "selfview" and "remoteview"; these will contain, respectively, the local user's self-view and the view of the incoming stream from the remote peer. connecting to a remote peer the start() function shown here can be called by either of the two end-points that want to talk to one another. it doesn't matt...
...ream from the remote peer. connecting to a remote peer the start() function shown here can be called by either of the two end-points that want to talk to one another. it doesn't matter who does it first; the negotiation will just work. async function start() { try { const stream = await navigator.mediadevices.getusermedia(constraints); for (const track of stream.gettracks()) {
pc.addtrack(track, stream); } selfvideo.srcobject = stream; } catch(err) { console.error(err); } } this isn't appreciably different from older webrtc connection establishment code. the user's camera and microphone are obtained by calling getusermedia(). the resulting media tracks are then added to the rtcpeerconnection by passing them into addtrack(). then, finally, the media sourc...
... indicated by the selfvideo constant is set to the camera and microphone stream, allowing the local user to see what the other peer sees. handling incoming tracks we next need to set up a handler for track events to handle inbound video and audio tracks that have been negotiatied to be received by this peer connection. to do this, we implement the the rtcpeerconnection's ontrack event handler.
pc.ontrack = ({track, streams}) => { track.onunmute = () => { if (remotevideo.srcobject) { return; } remotevideo.srcobject = streams[0]; }; }; when the track event occurs, this handler executes. using destructuring, the rtctrackevent's track and streams properties are extracted. the former is either the video track or the audio track being received. the latter is an array of ...
...And 27 more matches
IPDL Tutorial
es are sent between parent and a child end points, called actors. an ipdl protocol declares how actors communicate: it declares the possible messages that may be sent between actors, as well as a state machine describing when messages are allowed to be sent. the parent actor is typically the more permanent side of the conversation: parent/child actors parent child i
pc tabs chrome process content process i
pc plugins content process plugin process each protocol is declared in a separate file. the ipdl compiler generates several c++ headers from each ipdl protocol. this generated code manages the details of the underlying communication layer (sockets and pipes), constructing and sending messages, ensuring that all actors adhere to thei...
...otocol. two messages can be sent from the parent to the child, init() and shutdown(). one message can be sent from the child to the parent, ready(). ipdl protocols start with the letter p. the file in which the protocol is declared must have a matching name, pplugin.ipdl. generated c++ code when pplugin.ipdl is compiled, the headers ppluginparent.h, and ppluginchild.h will be generated in the i
pc/ipdl/_ipdlheaders/ directory of the build tree. the ppluginparent and ppluginchild classes are abstract classes that must be subclassed. each outgoing message is a c++ method which can be called. each incoming message is a pure-virtual c++ method which must be implemented: class ppluginparent { public: bool sendinit(const nscstring& pluginpath) { // generated code to send an init() message...
...see ipdl processes and threads for more details. because protocol messages are represented as c++ methods, it's easy to forget that they are in fact asynchronous messages: by default the c++ method will return immediately, before the message has been delivered. the parameters of the recv* methods (const nscstring& pluginpath in the example...
...And 26 more matches
Reference Manual
this section will help you if you're already familiar with nscomptr but you need details. if you've never use nscomptrs before, you might want to read the getting started guide first. if you're trying to fix a broken build, the faq might lead you to the answer more quickly. the basics design an nscomptr is designed to be a complete replacement for raw x
pcom interface pointers where they are used as owning references. almost any place you could use a raw x
pcom interface pointer, you should be able to use an nscomptr. an nscomptr is the exact same size and shape as a raw x
pcom interface pointer. it can be used as a member variable without introducing bloat. most of the work of being an owning reference can be done in the constructor, destructor, and assignment operators of nscomptr. wh...
...could use a raw x
pcom interface pointer, you should be able to use an nscomptr. an nscomptr is the exact same size and shape as a raw x
pcom interface pointer. it can be used as a member variable without introducing bloat. most of the work of being an owning reference can be done in the constructor, destructor, and assignment operators of nscomptr. whenever you `point' the nscomptr at a different x
pcom object (by assignment or initialization), it must release its old value, if any, and addref the new. at its own destructor time it must release as well. nscomptr only does exactly the work you would have done, if you always remembered to do the right thing. safety features type safeguards it is an invariant of nscomptr that it holds the x
pcom-correct interface pointer for it's underlying type. ...
...tor time it must release as well. nscomptr only does exactly the work you would have done, if you always remembered to do the right thing. safety features type safeguards it is an invariant of nscomptr that it holds the x
pcom-correct interface pointer for it's underlying type. for example, an nscomptr<nsifoo> will always hold the pointer that would be returned by queryinterface, when querying an x
pcom object for its nsifoo interface. in debug builds, if you subvert this invariant with one of the assignment forms that doesn't call queryinterface, nscomptr will assert at runtime in the bad assignment. // given two un-related interfaces |nsifoo| and |nsibar|... nsibar* bar = ...; // ... nscomptr<nsifoo> foo = bar; // ns_assertion: "queryinterface needed" // ...eve...
...And 22 more matches
Extending a Protocol
ing what we need to do along the way. to be sure, ipdl looks like a crazy mix of webidl, c++ header files, and es6. the syntax should hopefully be fairly obvious though. unfortunately, it's not really fully documented anywhere - and the ipdl parser gets easily confused (hence us excluding comments below). creating the protocol pecho.ipdl let's start by saving the following file to ./dom/i
pc/pecho.ipdl. we will explain what all the parts mean below. note that the file's name and the protocol name must match. include protocol pwindowglobal; namespace mozilla { namespace dom { async refcounted protocol pecho { manager pwindowglobal; parent: async echo(nscstring data) returns (nscstring aresult); async __delete__(); }; } // namespace dom } // namespace mozilla now, edit "./d...
...ho.ipdl. we will explain what all the parts mean below. note that the file's name and the protocol name must match. include protocol pwindowglobal; namespace mozilla { namespace dom { async refcounted protocol pecho { manager pwindowglobal; parent: async echo(nscstring data) returns (nscstring aresult); async __delete__(); }; } // namespace dom } // namespace mozilla now, edit "./dom/i
pc/moz.build" file and add 'pecho.ipdl', to the ipdl_sources array. remember that it needs to be in alphabetical order or it won't compile. breaking it down: include protocol pwindowglobal; - we include pwindowglobal, because it's going to manage the protocol for us. async refcounted protocol pecho {....} - this protocol is "async", meaning we are going to use mozpromises. it's also "refcounte...
... when an instance is deleted. it lets you do cleanup if needed. ok, if we now try to compile this (./mach build), it will say: |manager| declaration in protocol `pecho' does not match any |manages| declaration in protocol `pwindowglobal' that's good! it means the syntax is correct, and now we need to pwindowglobal.ipdl to manage our pecho protocol. updating pwindowglobal.ipdl open up ./dom/i
pc/pwindowglobal.ipdl. we need to add the following things: at the top of the file: include protocol pecho; after "manager pbrowser or pinprocess;", add: manages pecho; finally, under parent: add async pecho(); - this is the "constructor" part we talked about before, which will allow us to eventually send messages. so roughly, it looks like this (things in bold is what we added). // ...
...And 19 more matches
Necko walkthrough
nsdocshell as an example client of the nsihtt
pchannel api nsdocshell::loaduri(string) create nsiuri from string nsdocshell::loaduri(nsiuri) creates 2 nsiinputstream for read response from; passes them with uri to ... nsdocshell::internalload nsdocshell::douriload opens the nsichannel for the uri (ns_newchannel) if "http:", it will be an nsihtt
pchannel nsdocshell::dochannelload nsuriloader::openuri passes an nsistreamlistener pointer, 'loader' to nsuriloader::openchannel - it creates an nsdocumentopeninfo object, which implements nsistreamlistener, i.e. has onstartrequest, onstoprequest, ondataavailable, the three functions in which channel responses are received asynchronously. ...
... this is where it hits necko code. ...
...ta from http) this all happens on the main thread, in a non-blocking fashion: make your request on the main thread, then carry on and get the async response later, also on the main thread. there is an option to receive ondataavailable specifically on a non-main thread, but all other calls happen on the main thread. ...
...And 19 more matches
Getting Started Guide
ference manual or the faq. don't worry; the getting started guide is short. introduction what is nscomptr? nscomptr is a tool to help prevent leaks. nscomptr is a "smart pointer". it is a template class that acts, syntactically, just like an ordinary pointer in c or c++, i.e., you can apply * or -> to it to "get to" what it points at. ...
...s a tool to help prevent leaks. nscomptr is a "smart pointer". it is a template class that acts, syntactically, just like an ordinary pointer in c or c++, i.e., you can apply * or -> to it to "get to" what it points at. nscomptr is smart in that, unlike a raw c++ pointer to an x
pcom object, nscomptr manages addref, release, and queryinterface for you. nscomptr is defined in the source files: x
pcom/base/nscomptr.h x
pcom/base/nscomptr.cpp ...though you probably don't want to look in there, just yet. with nscomptr, you can write code that is shorter, cleaner, clearer, and safer, than you can with raw x
pcom interface pointers. x
pcom basics: ownership and reference counting this is a quick refresher on some fundamental issues of x
pcom. you should already know this, and should be able to...
...d place to learn about the basic rules and reasoning behind com is in essential com by don box. don box gets into more of the details, traps, and pitfalls of com in effective com. you should also have a reasonable knowledge of c++. probably the three most helpful books on this topic are the c++ programming language by bjarne stroustrup, effective c++, and more effective c++ by scott meyers. all x
pcom objects are allocated on the heap. clients don't get to know much about the implementation of any such object. they reference it only through a pointer to an `interface', i.e., the static type of the pointer is a pointer to an abstract base class, the actual object pointed to is a class derived from that abstract base class. the x
pcom object is said to `implement that interface'. the client's r...
...And 19 more matches
A bird's-eye view of the Mozilla framework
the contents into a dom tree, and handles the layout and rendering of the document pages. the nglayout engine also parses xul ui controls into a dom tree and handles rendering of the ui. core services modules such as the nglayout engine comprise the core application services available to other core modules, and xul packages core application modules are implemented as a set of one or more x
pcom (cross-platform com) objects. x
pcom object model before getting into the details of the ui example, it's helpful to have a basic understanding of the x
pcom object model. mozilla architectural modules are comprised of groups of related x
pcom objects that provide services to and access services from each other through dynamically queryable interfaces. object model at a glance mozilla dynamica...
...e x
pcom object model. mozilla architectural modules are comprised of groups of related x
pcom objects that provide services to and access services from each other through dynamically queryable interfaces. object model at a glance mozilla dynamically loads and integrates core modules and xul packages into the runtime environment on startup. once loaded, a module or package has full access to the x
pcom objects of all the other modules in the runtime environment. the ability to dynamically integrate modules and packages at startup is a powerful benefit of the object model, which defines a module as a set of one or more x
pcom objects calledcomponents. these objects provide services to client packages and modules and access services provided by other modules through dynamically queryable interfa...
...e, and if available, accesses that service through an interface defined in xpidl (cross-platform idl), derived from the corba idl. the xpidl interface description is independent of the programming language used to implement the object itself. for example, a javascript object or c++ class could both implement the same xpidl interface. scripting languages such as javascript cannot directly access x
pcom components, but access them indirectly using x
pconnect. x
pconnect also provides a required layer for x
pcom components written in a scripting language. let’s consider a resource description framework (rdf) example, where rdf is a framework for describing and interchangingmetadata, that is, information about information. in this example, we’re interested in the rdf sub-graph underlying theco...
...And 16 more matches
Error codes returned by Mozilla APIs
id_value_err (0x805f0001) ns_error_dom_svg_matrix_not_invertable (0x805f0002) a matrix could not be computed. ...
... ns_error_dom_not_object_err (0x805303eb) ns_error_dom_not_x
pc_object_err (0x805303ec) ns_error_dom_not_number_err (0x805303ed) ns_error_dom_not_boolean_err (0x805303ee) ns_error_dom_not_function_err (0x805303ef) ns_error_dom_too_few_parameters_err (0x805303f0) ns_error_dom_bad_document_domain (0x805303f1) ns_error_dom_prop_access_denied (0x805303f2) ns_error_dom_x
pconnect_access_denied (0x805303f3) ns_error_dom_bad_uri (0x805303f4) ns_error_dom_retval_undefined (0x805303f5) ns_error_dom_quota_reached (0x805303f6) an attempt was made to add data into the local or global storage for a given domain that would exceed the amount allowed for that domain. ns_error_dom_file_not_found_err (0x80650000) file was not found. ns_error_dom_file_not_readable...
... trying to open the channel again (reopening is not supported). ns_error_first_header_field_component_empty (0x804b0022) while parsing for the first component of a header field using syntax such as that for content-disposition or content-type, the first component was found to be empty. ...
...And 15 more matches
Setting up the Gecko SDK
up information for the gecko software development kit (sdk) used to build the weblock component in this tutorial. the following four sections tell the developer how to download and organize the gecko sdk and create a new project in which components like weblock can be created. downloading and setting the sdk the gecko sdk provides all of the tools, headers, and libraries that you need to build x
pcom components. the sdk is available for windows, linux, and mac operating systems, and versions for other operating systems are being developed, and can be retrieved from as a single archive from the following platform-specific locations (need correction for last version (now 1.9.2.8). there is now separate archive with gecko-sdk, just xul-runner-sdk.): linux: http://ftp.mozilla.org/pub/mozi...
...member to adjust the settings described here (e.g., in the building a microsoft visual cpp project section below) to point to this new location. when you extract the sdk, it should have the layout seen below: layout of the extracted sdk the directories represent different modules in the sdk. for example, the headers for networking are all located in the necko directory, and the headers that x
pcom requires are in the x
pcom directory. this directory structure makes build scripts slightly more complicated (since there will be many different include paths), but it helps to organize the parts of the sdk meaningfully. the two top level header files are special. the file mozilla-config.h lists all of the defines used in the sdk. including this header file in your project ensures that the comp...
... includes in your component's source code. each module directory is divided into three subdirectories: module subdirectories the bin directory contains static libraries, dynamic libraries, and in some cases tools that may be useful in development. the idl directory contains the public idl files exported by the module. the includes directory contains c++ header files used by your component. ...
...And 14 more matches
Index - Web APIs
the samples to the specified channel of the audiobuffer, from the source array. 107 audiobuffer.duration api, audiobuffer, property, reference, web audio api, duration a double. 108 audiobuffer.getchanneldata() api, audiobuffer, method, reference, web audio api the getchanneldata() method of the audiobuffer interface returns a float32array containing the
pcm data associated with the channel, defined by the channel parameter (with 0 representing the first channel). 109 audiobuffer.length api, audiobuffer, property, reference, web audio api, length the length property of the audiobuffer interface returns an integer representing the length, in sample-frames, of the
pcm data stored in the buffer. 110 audiobuffer.numberofc...
... content. 1962 msstereo3drendermode msstereo3drendermode msstereo3drendermode is a read/write property which gets or sets whether the system display is set to stereo display (if stereo-capable). 1963 onmsvideoformatchanged onmsvideoformatchanged onmsvideoformatchanged is an event which occurs when the video format changes. 1964 onmsvideoframeste
pcompleted onmsvideoframeste
pcompleted onmsvideoframeste
pcompleted is an event which occurs when the video frame has been stepped forward or backward one frame. 1965 onmsvideooptimallayoutchanged onmsvideooptimallayoutchanged onmsvideooptimallayoutchanged is an event which occurs when the msislayoutoptimalforplayback state changes. 1966 hashchangeevent a...
..., geolocation api, no interface, reference navigatorgeolocation contains a creation method allowing objects implementing it to obtain a geolocation instance. 2670 navigatorid api, html dom, html-dom, interface, navigator, navigatorid, reference the navigatorid interface contains methods and properties related to the identity of the browser. 2671 navigatorid.ap
pcodename api, deprecated, navigatorid, property, reference, référence(2), ap
pcodename the value of the navigatorid.ap
pcodename property is always "mozilla", in any browser. this property is kept only for compatibility purposes. 2672 navigatorid.appname api, deprecated, navigatorid, property, reference, référence(2), appname the value of the navigatorid.appname pro...
...And 14 more matches
Language bindings
an x
pcom language binding is a bridge between a particular language and x
pcom to provide access to x
pcom objects from that language, and to let modules written in that language be used as x
pcom objects by all other languages for which there are x
pcom bindings. more specifically, an x
pcom language binding: enables access to x
pcom objects from that language (where access means reading/writing/creating x
pcom objects as well as calling methods on them). exposes modules written in the bound language as x
pcom objects, thereby enabling all other languages for which x
pcom bindings exist to access these modules. since the x
pcom layer itself is written in c/c++, its api can be accessed out-of-the-box using c or c++. ...
...ess means reading/writing/creating x
pcom objects as well as calling methods on them). exposes modules written in the bound language as x
pcom objects, thereby enabling all other languages for which x
pcom bindings exist to access these modules. since the x
pcom layer itself is written in c/c++, its api can be accessed out-of-the-box using c or c++. in order to allow any other language to use the x
pcom api, a bridging layer is required. the following bridging layers are currently available: components objectthe components object is the object through which x
pconnect functionality is reflected into javascript. ...
...in c/c++, its api can be accessed out-of-the-box using c or c++. in order to allow any other language to use the x
pcom api, a bridging layer is required. the following bridging layers are currently available: components objectthe components object is the object through which x
pconnect functionality is reflected into javascript. ...
...And 13 more matches
Setting HTTP request headers
d with http headers for both http requests and responses. you can add your own http headers to any request the application makes, whether the request is initiated by your code explicitly opening an http channel, because of xmlhttprequest activity, an <img> element in content, or even from css. ...
...for both http requests and responses. you can add your own http headers to any request the application makes, whether the request is initiated by your code explicitly opening an http channel, because of xmlhttprequest activity, an <img> element in content, or even from css. http channels when you deal with http requests and responses, typically you are doing this with an nsihtt
pchannel. ...
...(this variable could have been named anything though.) the setrequestheader method takes 3 parameters. ...
...And 13 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
for complex extensions, it may be necessary to create components in c++ that provide additional functionality. reasons why you might want to include c++ components in your extension include: need for high-performance beyond what can be delivered by javascript code. use of third-party libraries written in c or c++. use of mozilla interfaces that are not exposed via x
pcom (e.g. nspr). note: with the modern jit javascript engine in gecko and js-ctypes more extension code can be written only in javascript than ever before. please consider all of your options carefully before deciding to use native code (c++) in your extension. in addition, binary components need to be recompiled for every major firefox release, which can be frustrating. this...
...r every major firefox release, which can be frustrating. this article describes how to set up the development environment for a large, complex firefox extension with any or all of the above-mentioned requirements. i should also stress that you do not have to build mozilla or use the mozilla build system if you want to create c++ components for mozilla. if you are just looking to create an x
pcom component or two, this is probably overkill, and you might want to take a look at this guide instead. on the other hand, if you are an experienced developer or team, and you know that you are going to build a large, complex extension, you would do well to consider the approach described in this article. one final note: i've only tried these techniques inside firefox, but they'll probably...
...all the tools for building are available built-in, and therefore all you have to do is run some commands in the terminal. you can find full instructions for almost any os here. structuring your project mozilla includes a number of complex extensions that are integrated into its build process. it has thus been necessary to solve all of the issues involved in creating and registering x
pcom components, building jar files and manifests, installing the lot into the firefox extensions/ directory and so forth. so it behooves us to piggyback on this infrastructure to build our extension. first of all, think of a catchy name for your extension and create a directory with that name under the /mozilla/extensions/ directory. use only lowercase letters. you should see a bunch of othe...
...And 11 more matches
nsISupportsArray
x
pcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
... x
pcom/ds/nsisupportsarray.idlscriptable please add a summary to this article. ...
...o this article. ...
...And 11 more matches
NSS_3.12_release_notes.html
cert.h) cert_findcrlnumberexten (see cert.h) cert_findnameconstraintsexten (see cert.h) cert_getclassicocspdisabledpolicy (see cert.h) cert_getclassicocspenabledhardfailurepolicy (see cert.h) cert_getclassicocspenabledsoftfailurepolicy (see cert.h) cert_getpkixverifynistrevocationpolicy (see cert.h) cert_getusepkixforvalidation (see cert.h) cert_getvaliddnspatternsfromcert (see cert.h) cert_newtem
pcertificate (see cert.h) cert_setocsptimeout (see certhigh/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11p...
...thmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism (see pk11pub.h) pk11_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepointorderlen (see keyhi.h) seckey_ecparamstokeysize (see keyhi.h) secmod_deletemoduleex (see secmod.h) sec_getregisteredhtt
pclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camellia support (see blapit.h): nss_camellia nss_c...
...can't be built stand-alone. bug 407866: contributed improvement to security/nss/lib/freebl/mpi/mp_comba.c bug 410587: ssl_getchannelinfo returns secsuccess on invalid arguments bug 416508: fix a _msc_ver typo in sha512.c, and use sec_begin_protos/sec_end_protos in secport.h bug 419242: 'all' is not the default makefile target in lib/softoken and lib/softoken/legacydb bug 419523: export cert_newtem
pcertificate. bug 287061: crl number should be a big integer, not ulong bug 301213: combine internal libpkix function tests into a single statically linked program bug 324740: add generation of sia and aia extensions to certutil bug 339737: libpkix ocsp checking calls cert_verifycert bug 358785: merge nss_libpkix_branch back to trunk bug 365966: infinite recursive call in vfy_verifydigestdirect bug ...
...And 10 more matches
SpiderMonkey Internals
public typedefs, and is included automatically when needed. the jsprvtd.h file contains private typedefs and is included by various .h files that need type names, but not type sizes or declarations. jsdbgapi.cpp, jsdbgapi.h the debugging api. provided so far: traps, with which breakpoints, single-stepping, step over, step out, and so on can be implemented. the debugger will have to consult jso
pcode.def on its own to figure out where to plant trap instructions to implement functions like step out, but a future jsdbgapi.h will provide convenience interfaces to do these things. at most one trap per bytecode can be set. when a script (jsscript) is destroyed, all traps set in its bytecode are cleared. watchpoints, for intercepting set operations on properties and running a debugger-supplied ...
...ovide convenience interfaces to do these things. at most one trap per bytecode can be set. when a script (jsscript) is destroyed, all traps set in its bytecode are cleared. watchpoints, for intercepting set operations on properties and running a debugger-supplied function that receives the old value and a pointer to the new one, which it can use to modify the new value being set. line number to
pc and back mapping functions. the line-to-
pc direction "rounds" toward the next bytecode generated from a line greater than or equal to the input line, and may return the
pc of a for-loop update part, if given the line number of the loop body's closing brace. any line after the last one in a script or function maps to a
pc one byte beyond the last bytecode in the script. an example, from perfect.js...
...divisors[j] += " + " + divisor; } // at this point everything up to 'divisor' has its sumofdivisors // expression calculated, so we can determine whether it's perfect // already by evaluating. ...
...And 10 more matches
Web Replay
evtools.recordreplay.logging when enabled, firefox will log web replay's internal actions to the terminal, which is helpful when debugging hangs and crashes. default false architecture there are several main components to the project: the record/replay infrastructure records enough information during recording so that the replayed process can run and produce the same observable behaviors. i
pc integration allows a replaying process to communicate with the chrome process using ipdl and shared memory. the rewind infrastructure allows a replaying process to restore a previous state, while still maintaining communication with the chrome process. debugger integration allows the js debugger to read the information it needs from a replaying process and control the process's execution (resum...
...(and, by extension, release locks and use condvars) then accesses on lock-protected memory will occur in the same order. atomic variables can be handled by treating reads and writes as if they were wrapped by a lock acquire/release during recording. it is not enough, however, to just record all these non-deterministic sources and reproduce those behaviors exactly in the replaying process. the i
pc and debugger integration components may behave differently between recording and replaying, or between different replays. both of these involve inter-thread communication and calls to non-deterministic apis, and the resulting non-determinism must be allowed within the replaying process. allowed non-determinism there is some slop in this design: the replaying process must be non-deterministic e...
...tegration components may behave differently between recording and replaying, or between different replays. both of these involve inter-thread communication and calls to non-deterministic apis, and the resulting non-determinism must be allowed within the replaying process. ...
...And 10 more matches
Working with windows in chrome code
window title, which is specified using xul. the third, and optional, parameter is a list of special window features the window should have. the window.opendialog function works similarly, but lets you specify optional arguments that can be referenced from the javascript code. it also handles window features a little differently, including always assuming the dialog feature is specified. from x
pcom components and modules if the window object is unavailable (for example, when opening a window from x
pcom component code), you might want to use nsiwindowwatcher interface. its parameters are similar to window.open; in fact, window.open's implementation calls nsiwindowwatcher's methods. var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(comp...
...ccessing elements which are descendants of your chrome document (but nevertheless in a different context). accessing content documents assume you have a document loaded in a <tabbrowser>, <browser>, or <iframe> element inside your document. you can use browser.contentdocument to access that document and browser.contentwindow to access the window object of that document. you should be aware of x
pcnativewrappers when working with untrusted content. with x
pcnativewrappers turned on (which is the default in firefox 1.5+), your extension can safely access the dom of the content document, but not the content javascript. bypassing x
pcnativewrapper to work with content javascript directly can lead to security problems. see interaction between privileged and non-privileged pages if you need to in...
... .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); this allows you to cross the chrome-content boundaries, and returns the main window object. finding already opened windows the window mediator x
pcom component (nsiwindowmediator interface) provides information about existing windows. two of its methods are often used to obtain information about currently open windows: getmostrecentwindow and getenumerator. please refer to the nsiwindowmediator page for more information and examples of using nsiwindowmediator. === example: opening a window only if it's not opened already === xxx tbd passing...
...And 10 more matches
Index of archived content - Archive of obsolete content
frame/utils fs/path io/byte-streams io/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/favicon places/history platform/x
pcom preferences/event-target preferences/service remote/child remote/parent stylesheet/style stylesheet/utils system/child_process system/environment system/events system/runtime system/unload system/xul-app tabs/utils ...
...m) getting started (cfx) list open tabs listen for page load listening for load and unload localization logging modifying web pages based on url modifying the page hosted by a tab open a web page troubleshooting unit testing using x
pcom without chrome using third-party modules (jpm) bootstrapped extensions code snippets alerts and notifications autocomplete bookmarks boxes canvas code snippets cookies customizing the download progress bar...
...bar delayed execution dialogs and prompts downloading files drag & drop embedding svg examples and demos from articles file i/o finding window handles forms related code snippets html in xul for rich tooltips html to dom isdefaultnamespace js x
pcom javascript debugger service javascript timers javascript daemons management label and description lookupnamespaceuri lookupprefix miscellaneous modules on page load page loading post data to window ...
...And 9 more matches
Building up a basic demo with the PlayCanvas engine - Game development
reference to the <canvas> element. before reading on, copy this code to a new text file and save it in your working directory as index.html. playcanvas application to begin developing our game we have to create the playcanvas application first (using the given <canvas> element), and then start the update loop. ...
...reading on, copy this code to a new text file and save it in your working directory as index.html. playcanvas application to begin developing our game we have to create the playcanvas application first (using the given <canvas> element), and then start the update loop. ...
...ng code to the bottom of your second <script> element: var app = new
pc.application(canvas); app.start(); the
pc global object contains all the playcanvas functions available in the engine. next, we'll set the canvas to fill the window, and automatically change its resolution to be the same as the canvas size. again, add the following lines at the bottom of your script. app.setcanvasfillmode(
pc.fillmode_fill_window); app.setcanvasresolution(
pc.resolution_auto); camera now when the setup code is in place we need to think about implementing the standard scene components: camera, lights and objects. let's start with the camera — add these lines to your code, below the previous ones. ...
...And 9 more matches
WebIDL bindings
you want here. return; } // for some reason we want to catch and rethrow exceptions from setsomenumber, say. acallback.setsomenumber(2*number, rv, erethrowexceptions); if (rv.failed()) { // the exception is now stored on rv. this code must report // it usefully; otherwise it will assert. } } external interfaces external interfaces are represented in c++ as objects that x
pconnect knows how to unwrap to. this can mean x
pcom interfaces (whether declared in xpidl or not) or it can mean some type that there's a castable native unwrapping function for. the c++ type to be used should be the nativetype listed for the external interface in the bindings.conf file. the exact representation depends on how the type is being used. arguments become nsifoo*. return values can ...
...ument, defaulting to ereportexceptions, and calling it will invoke the callable with undefined as the this value. the second call method allows passing in an explicit this value as the first argument. this second call method is a template on the type of the first argument, so the this value can be passed in in whatever form is most convenient, as long as it's either a type that can be wrapped by x
pconnect or a webidl interface type. if areportexceptions is set to ereportexceptions, the call methods will report js exceptions before returning. if areportexceptions is set to erethrowexceptions, js exceptions will be stashed in the errorresult and will be reported when the stack unwinds to wherever the errorresult was set up. for example, this webidl: callback mycallback = long (myinterface ...
...igincallable] used to flag a method that, when called, will not have the same-origin constraint tested: it can be called from a context with a different origin. [securecontext] we implement the standard extended attribute with a few details specific to gecko: system principals are considered secure. an extension poking at non-secured dom objects will see apis marked with [securecontext]. x
pconnect sandboxes doesn't see [securecontext] apis, but this may change in bug 1273687. [needssubjectprincipal], [getterneedssubjectprincipal], [setterneedssubjectprincipal] used to flag a method or an attribute that needs to know the subject principal. this principal will be passed as argument. if the interface is not exposed on any worker global, the argument will be a nsiprincipal& because a...
...And 9 more matches
throw - JavaScript
raise the exception var monthname = getmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s. zip code. ...
...etmonthname(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s. zip code. if the zip code uses an invalid format, the throw statement throws an exception by creating an object of type zi
pcodeformatexception. /* * creates a zi
pcode object. ...
...e of throwing an object the following example tests an input string for a u.s. zip code. if the zip code uses an invalid format, the throw statement throws an exception by creating an object of type zi
pcodeformatexception. /* * creates a zi
pcode object. * * accepted formats for a zip code are: * 12345 * 12345-6789 * 123456789 * 12345 6789 * * if the argument passed to the zi
pcode constructor does not * conform to one of these patterns, an exception is thrown. ...
...And 9 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
r not supporting a less popular platform simply because you do not have the resources for parallel development! unlike many other application frameworks, you are not limited to the widget set we provide, nor limited to the "look and feel" of the native os. you can create applications using our framework that either have a native look and feel for each os, or one which is identical on macs,
pc's or unix operating systems. you may also further enhance the user interface by allowing 3rd parties to develop "themes" for your application. themes are simply collections of images and css which can augment or replace your current ui elements. xul provides an excellent answer for organizations with heterogeneous computing environments. customized xul applications with significant busines...
...tent and web applications. gecko features full support for open internet standards such as css1, html 4.0, dom1, rdf, xml and javascript. modular, embeddable: gecko's modular architecture enables developers to add or remove modules with little effort, fitting the software to the available hardware and adjusting functionality to match product requirements. gecko is implemented as a collection of x
pcom components that can be easily added or removed. flexible programming interfaces such as the web shell api, the java wrapper api and the gecko activex control make gecko easily embeddable into applications and devices. full browser functionality: gecko allows any desktop application as well as new devices, products and appliances to be web-enabled, with complete browser functionality. supported...
...o, a generic disk and memory cache service, asynchronous caching dns resolution, web proxies, and https. the following architectural diagram depicts necko and its interaction with subsystems: necko is powerful, stable and robust, with current development focused on performance and standards-compliance. it has gone through extensive field testing and revision to maximize web site compatibility. x
pcom, the cross platform component object model the cross platform component object model (x
pcom) is one of the main things that makes the mozilla application environment an actual framework. it is a development environment that provides the following features for the cross-platform software developer: component management file abstraction object message passing memory management this componen...
...And 8 more matches
Limitations of chrome scripts
cesscompatible flag in your add-on's install manifest. however, these shims are not a substitute for migrating extensions: they are only a temporary measure, and will be removed eventually they can have a bad effect on responsiveness there are likely to be edge cases in which they don't work properly you can see all the places where your add-on uses compatibility shims by setting the dom.i
pc.shims.enabledwarnings preference and watching the browser console as you use the add-on. the rest of this page documents patterns that don't work in multiprocess firefox as well as how are shims try to paper over the problem. for each pattern we've noted: whether a shim exists and what kind of behavior it provides how to update your add-on so you don't need the shim gbrowser.contentwindow,...
...serve(), so notifications are not sent to the chrome process. there is a shim that will forward these two topics to the chrome process, sending cpows as the asubject argument. http requests you can't observe http requests in the content process. if you do, you'll get an error. if you do so in the chrome process, it will mostly work. ...
...cs to the chrome process, sending cpows as the asubject argument. http requests you can't observe http requests in the content process. if you do, you'll get an error. if you do so in the chrome process, it will mostly work. the subject for the observer notification will be an nsihtt
pchannel as you would expect. ...
...And 8 more matches
Refcount tracing and balancing
tep that analyzes the resulting log to help a developer figure out where refcounting went wrong. how to build for refcount tracing build with --enable-debug or --enable-logrefcnt. how to run with refcount tracing on there are several environment variables that can be used. first, you select one of three environment variables to choose what kind of logging you want. you almost certainly want x
pcom_mem_refcnt_log. note: due to an issue with the sandbox on windows (bug 1345568), refcount logging currently requires the moz_disable_content_sandbox environment variable to be set. x
pcom_mem_refcnt_log setting this environment variable enables refcount tracing. if you set this environment variable to the name of a file, the log will be output to that file. you can also set it to 1 to lo...
...ble to be set. x
pcom_mem_refcnt_log setting this environment variable enables refcount tracing. if you set this environment variable to the name of a file, the log will be output to that file. you can also set it to 1 to log to stdout or 2 to log to stderr, but these logs are large and expensive to capture, so you probably don't want to do that. warning: you should never use this without x
pcom_mem_log_classes and/or x
pcom_mem_log_objects, because without some filtering the logging will be completely useless due to how slow the browser will run and how large the logs it produces will be. x
pcom_mem_comptr_log this environment variable enables logging of additions and releases of objects into nscomptrs. this requires c++ dynamic casts, so it is not supported on all platforms. h...
... objects into nscomptrs. this requires c++ dynamic casts, so it is not supported on all platforms. however, having an nscomptr log and using it in the creation of the balance tree allows addref and release calls that we know are matched to be eliminated from the tree, so it makes it much easier to debug reference count leaks of objects that have a large amount of reference counting traffic. ...
...And 8 more matches
Mozilla internal string guide
a c++ class hierarchy to pass string data, rather than using raw pointers. this guide documents the string classes which are visible to code within the mozilla codebase (code which is linked into libxul). introduction the string classes are a library of c++ classes which are used to manage buffers of wide (16-bit) and narrow (8-bit) character strings. the headers and implementation are in the x
pcom/string directory. all strings are stored as a single contiguous buffer of characters. the 8-bit and 16-bit string classes have completely separate base classes, but share the same apis. as a result, you cannot assign a 8-bit string to a 16-bit string without some kind of conversion helper class or routine. for the purpose of this document, we will refer to the 16-bit string classes in class do...
...ish(). it takes two arguments: the new logical length of the string (which must not exceed the capacity retuned by the length() method of the handle) and a boolean indicating whether it's ok to attempt to reallocate a smaller buffer in case a smaller mozjemalloc bucket could accommodate the new logical length. helper classes and functions converting cocoa strings use mozilla::copycocoastringtox
pcomstring() in mozilla/macstringhelpers.h to convert cocoa strings to x
pcom strings. searching strings - looking for substrings, characters, etc. findinreadable() is the replacement for the old string.find(..). the syntax is: prbool findinreadable(const nsastring& pattern, nsastring::const_iterator start, nsastring::const_iterator end, nsstringcomparat...
...ut is known to be strictly ascii. often a conversion to utf-8 is more appropriate. see tonewutf8string below. char* tonewutf8string(nsastring&) - allocates a new char* buffer containing the utf-8 encoded version of the given nsastring. see unicode conversion for more details and for better ways that don't require you to manage the memory yourself. these methods return a buffer allocated using x
pcom's allocator instead of the traditional allocator (malloc, etc.). outside of libxul you should use ns_free to deallocate the result when you no longer need it, inside libxul free() is preferred.. substrings (string fragments) it is very simple to refer to a substring of an existing string without actually allocating new space and copying the characters into that substring. substring() is the p...
...And 8 more matches
wrappedJSObject
wrappedjsobject is a property sometimes available on x
pconnect wrappers. when available, it lets you access the javascript object hidden by the wrapper. there are two kinds of x
pconnect wrappers that support the wrappedjsobject property: x
pcnativewrappers which are used to protect the chrome code working with content objects. see x
pcnativewrapper for detailed documentation. regular x
pconnect wrappers which you can encounter, for example, when using x
pcom components implemented in js. this article focuses on the latter kind of wrappers, which hide any properties or methods on the component that are not part of the supported interfaces as declared in xpidl. the rest of this article demonstrates what x
pconnect wrappers do and how wrappedjsobject can be used to bypass them. exam...
...mplemented in js. this article focuses on the latter kind of wrappers, which hide any properties or methods on the component that are not part of the supported interfaces as declared in xpidl. the rest of this article demonstrates what x
pconnect wrappers do and how wrappedjsobject can be used to bypass them. example component to see how the wrappedjsobject property works, we need an example x
pcom component implemented in js. see how to build an x
pcom component in javascript for details on creating one. for simplicity we omit the component registration code. suppose we register the component below with the @myself.com/my-component;1 contract. // constructor function helloworld() { }; helloworld.prototype = { hello: function() { return "hello world!"; }, queryinterface: func...
...he @myself.com/my-component;1 contract. ...
...And 8 more matches
Tabbed browser - Archive of obsolete content
ll work equally well for other xul elements. this will only work in an overlay of browser.xul. xul: <menuitem oncommand="myextension.foo(event)" onclick="checkformiddleclick(this, event)" label="click me"/> js: var myextension = { foo: function(event) { openuilink("http://www.example.com", event, false, true); } } opening a url in an on demand tab cu.import("resource://gre/modules/x
pcomutils.jsm"); x
pcomutils.definelazyservicegetter(this, "gsessionstore", "@mozilla.org/browser/sessionstore;1", "nsisessionstore"); // create new tab, but don't load the content. var url = "https://developer.mozilla.org"; var tab = gbrowser.addtab(null, {relatedtocurrent: true}); gsessionstore.settabstate(tab, json.stringify({...
...r.xml for corresponding xbl bindings (or just look at the current reference pages on browser and tabbrowser. getting the browser that fires the http-on-modify-request notification see the observer notifications page for information on http-on-* notifications. ...
...ests, xhr requests from x
pcom components, etc. in those cases, the following code returns null. warning: this code should be updated to use nsiloadcontext instead of getinterface(components.interfaces.nsidomwindow). updated example is in section below this observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { subject.queryinterface(components.interfaces.nsihtt
pchannel); var url = subject.uri.spec; /* url being requested. you might want this for something else */ var browser = this.getbrowserfromchannel(subject); if (browser != null) { /* do something */ } } }, getbrowserfromchannel: function (achannel) { try { var notificationcallbacks = achannel.notificationcallbacks ? achannel.notificationcallbacks : achannel.loadgr...
...And 7 more matches
RefPtr
refptr (formerly known as nsrefptr, see bug 1207245) is a general class to implement reference counting pointers for objects. it is similar to nscomptr, but does not require that the type be an x
pcom interface. like with nscomptr, it is the responsibility of the object itself to implement reference counting. this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class. ...
...nscomptr, it is the responsibility of the object itself to implement reference counting. this is done using the functions addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class. ...
...ns addref() and release(), which respectively modify a variable of type nsautorefcnt, which basically is a wrapper around a count of the number of references refering to the class. when should i use nscomptr versus refptr? the rules are simple: use nscomptr to hold pointers to x
pcom interfaces, and use refptr to hold pointers to concrete class, even if the concrete class implements one or more x
pcom interfaces. ...
...And 7 more matches
nsIDOMEvent
ta type for all events in the document object model. inherits from: nsisupports last changed in gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13) note: as of gecko 16.0, the nsiprivatedomevent interface was merged into this interface. everything marked as gecko 16.0 was previously available in that interface. see bug 761613. ...
... inherits from: nsisupports last changed in gecko 16.0 (firefox 16.0 / thunderbird 16.0 / seamonkey 2.13) note: as of gecko 16.0, the nsiprivatedomevent interface was merged into this interface. everything marked as gecko 16.0 was previously available in that interface. see bug 761613. ...
...iprivatedomevent interface was merged into this interface. everything marked as gecko 16.0 was previously available in that interface. see bug 761613. ...
...And 7 more matches
Writing WebSocket servers - Web APIs
ection 5 of the specification describes this in detail. ...
...so your server must expect this to be 1. (in fact, section 5.1 of the spec says that your server must disconnect from a client if that client sends an unmasked message.) when sending a frame back to the client, do not mask it and do not set the mask bit. we'll explain masking later. note: you must mask messages even when using a secure socket. rsv1-3 can be ignored, they are for extensions. the o
pcode field defines how to interpret the payload data: 0x0 for continuation, 0x1 for text (which is always encoded in utf-8), 0x2 for binary, and other so-called "control codes" that will be discussed later. in this version of websockets, 0x3 to 0x7 and 0xb to 0xf have no meaning. the fin bit tells whether this is the last message in a series. if it's 0, then the server keeps listening for more par...
... through the octets (bytes a.k.a. characters for text data) of encoded and xor the octet with the (i modulo 4)th octet of mask. in pseudo-code (that happens to be valid javascript): var decoded = ""; for (var i = 0; i < encoded.length; i++) { decoded[i] = encoded[i] ^ mask[i % 4]; } now you can figure out what decoded means depending on your application. message fragmentation the fin and o
pcode fields work together to send a message split up into separate frames. this is called message fragmentation. fragmentation is only available on o
pcodes 0x0 to 0x2. recall that the o
pcode tells what a frame is meant to do. if it's 0x1, the payload is text. if it's 0x2, the payload is binary data. however, if it's 0x0, the frame is a continuation frame; this means the server should concatenate ...
...And 7 more matches
Using the application cache - HTML: Hypertext Markup Language
applications that are cached load and work correctly offline, even if users press the refresh button. ...
...applications that are cached load and work correctly offline, even if users press the refresh button. ...
...vigate a site even when they are offline. speed cached resources are local, and therefore load faster. reduced server load the browser only downloads resources that have changed from the server. how the application cache works enabling the application cache to enable the application cache for an application, include the manifest attribute in the <html> element: <html manifest="/example.ap
pcache"> … </html> the manifest attribute references a url for a cache manifest file: a text file that lists urls that browsers should cache for your application. you should include the manifest attribute on each page of your site that you want cached. the browser does not cache pages without the manifest attribute, unless such pages are listed in the manifest file. you do not need to list al...
...And 7 more matches
Creating Event Targets - Archive of obsolete content
ing users of the module to listen for these events using the sdk's standard event api. using the places api first, let's write some code using places api that logs the uris of bookmarks the user adds. create a new directory called "bookmarks", navigate to it, and run jpm init, accepting all the defaults. ...
...nts using the sdk's standard event api. using the places api first, let's write some code using places api that logs the uris of bookmarks the user adds. create a new directory called "bookmarks", navigate to it, and run jpm init, accepting all the defaults. ...
... modules as event targets we can adapt this code into a separate module th...
...And 6 more matches
List of Mozilla-Based Applications - Archive of obsolete content
blog post mentions a reference to mozilla being used but i couldn't find more information about it. ...
...s a reference to mozilla being used but i couldn't find more information about it. ...
...wser based on chromium uses mozilla nss and npapi libraries emusic download manager music downloader for emusic emusic remote music manager enlis genome personal genome browser esxx javascript application server uses mozilla rhino etna xml wysiwyg editor eudora mail and news application the u
pcoming version 8 will be based on thunderbird evergreen library automation system evolution email client uses nss exe elearning xhtml editor seems to be using xul for some of their webui facebook open platform facebook open platform the fbml parser used in the platform is based on mozilla code fennec browser for mobiles as ...
...And 6 more matches
How to implement a custom XUL query processor component - Archive of obsolete content
xul supports templating to create a block of content from a datasource query. the xul template guide has lots of detailed information on using xul templates. xul provides template query processors for rdf, xml and sql (mozstorage). the templating system also supports building custom query processors. custom query processors are x
pcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component. in this example, we will create a simple javascript x
pcom component. the component will hold a small array of javascript objects as its datasource. in practice, you would use your own custom source of data. here is an example of what our xul might look like when using a custom query processor: <?xml version="1.0"?> <?
...?age"/> <label value="?hair"/> <label value="?eye"/> </row> </template> </rows> </grid> </window> a few things to note. we are not really using the datasources in our sample component, so we set it to a dummy value. an empty string would be ok too. the querytype is important. ...
...lue="?hair"/> <label value="?eye"/> </row> </template> </rows> </grid> </window> a few things to note. we are not really using the datasources in our sample component, so we set it to a dummy value. an empty string would be ok too. the querytype is important. it is used to create an instance of our x
pcom object. ...
...And 6 more matches
Overview of Mozilla embedding APIs
introduction the mozilla public api consists of a collection of services and components which are accessed via x
pcom interfaces. mozilla's x
pcom layer consists of a component model (called x
pcom) and the infrastructure necessary to support dynamic registration, instantiation and manipulation of x
pcom components. at the heart of x
pcom's implementation is the service manager and the component manager. together, these two services provide a centralized point for gaining access to all of the public mozilla interfaces. the service manager exposes all of the available x
pcom services - each service represents a global object which provides some piece of functionality. the component manager allows new instances of registered x
pcom components to be instantiated. the embedding layer consists ...
...much of the gecko functionality is exposed through a component called the nswebbrowser. embedding applications can leverage this component to easily access many of gecko's features. ...
...instance represents the "client-area" of a typical browser window. the webbrowser exposes a set of interfaces which allow the embedding application to control activity and respond to changes within this client area. using these interfaces an embedding application can build up its own user interface around a webbrowser instance. public classes the following utility classes are available from the x
pcom dll. they provide some basic functionality which should be leveraged when building new x
pcom components. nscomptr<interface-type> these are templatized smart pointers which transparently deal with x
pcom reference counting issues. see the nscomptr user's manual for more information. nsstring there are a collection of string classes which support both unicode and ascii strings. these clas...
...And 6 more matches
How to implement a custom autocomplete search component
seamonkey: 1.1+; gtk builds only). the component uses the autocompletesearchparam attribute or searchparam property to allow the developer to define the default directory otherwise only paths beginning with / or ~/ will be autocompleted. building your custom autocomplete search components sometimes, you may want to build your own autocomplete source. ...
...am property to allow the developer to define the default directory otherwise only paths beginning with / or ~/ will be autocompleted. building your custom autocomplete search components sometimes, you may want to build your own autocomplete source. to do so you need the following: create an x
pcom component that implements the nsiautocompletesearch interface. ...
... so you need the following: create an x
pcom component that implements the nsiautocompletesearch interface. make sure the contract id of your x
pcom component follows the following form: "@mozilla.org/autocomplete/search;1?name=xxx", where "xxx" is the name of your autocomplete source. implement the list of matched strings using the nsiautocompleteresult interface. the simplest way to make an x
pcom component is to build an x
pcom javascript component (this cannot be done with a javascript module). how to build an x
pcom component in javascript will step you through the process. ...
...And 6 more matches
JavaScript-DOM Prototypes in Mozilla
prototype setup on an x
pconnect wrapped dom node in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using x
pconnect and the wrapper is exposed to javascript as the javascript representation of the dom node. when x
pconnect wraps a c++ object it will create a jsobject that is unique to this c++ object. in the case where the c++ object has class info (nsiclassinfo), the jsobject is a more or less empty jsobject which is not really that special. ...
...to this c++ object. in the case where the c++ object has class info (nsiclassinfo), the jsobject is a more or less empty jsobject which is not really that special. all the methods that are supposed to show up on this jsobject are actually not properties of the object itself, but rather properties of the prototype of the jsobject for the wrapper (unless the c++ object's class info has the flag nsix
pcscriptable::dont_share_prototype set, but lets assume that's not the case here). as an example of this let's look at an html image element in a document. var obj = document.images[0]; here, obj will not really have any properties (except for the standard jsobject properties such as constructor, and the non-standard __parent__, __proto__, etc.), all the dom functionality of obj comes from obj's...
...set, but lets assume that's not the case here). as an example of this let's look at an html image element in a document. var obj = document.images[0]; here, obj will not really have any properties (except for the standard jsobject properties such as constructor, and the non-standard __parent__, __proto__, etc.), all the dom functionality of obj comes from obj's prototype (obj.__proto__) that x
pconnect sets up when exposing the first image in document to javascript. here are a few of the properties of obj's prototype: obj.__proto__ parentnode (getter function) src (getter and setter functions) getelementsbytagname (function) text_node (number property, constant) ... all those properties come from the interfaces that the c++ image object (nshtmlimageelement) implements and cho...
...And 6 more matches
BloatView
bloatview is a tool that shows information about cumulative memory usage and leaks. if it finds leaks, you can use refcount tracing and balancing to discover the root cause. how to build with bloatview build with --enable-debug or --enable-logrefcnt. how to run with bloatview the are two environment variables that can be used. x
pcom_mem_bloat_log if set, this causes a bloat log to be printed on program exit, and each time nstracerefcnt::dumpstatistics is called. this log contains data on leaks and bloat (a.k.a. usage). x
pcom_mem_leak_log this is similar to x
pcom_mem_bloat_log, but restricts the log to only show data on leaks. you can set these environment variables to any of the following values. 1 - log to stdout. 2 - log to stderr. filename - write log to ...
... here's how you interpret the columns. the first, numerical column is the index of the leaking class. class - the name of the class in question (trun...
...fenders. (should be zero!) objects total - the total count of objects allocated of a given class. objects rem - the number of objects allocated of a given class that weren't deleted. (should be zero!) interesting things to look for: are your classes in the list? - look! if they aren't, then you're not using the ns_impl_addref and ns_impl_release (or ns_impl_isupports which calls them) for x
pcom objects, or moz_count_ctor and moz_count_dtor for non-x
pcom objects. not having your classes in the list is not ok. that means no one is looking at them, and we won't be able to tell if someone introduces a leak. (see below for how to fix this.) the bytes leaked for your classes should be zero! - need i say more? if it isn't, you should use the other tools to fix it. the number of objects rem...
...And 6 more matches
Leak-hunting strategies and tips
uilding up from as little as possible to the complete task, and fixing most of the leaks in the first steps before adding additional steps. (by most of the leaks, i mean the leaks of large numbers of different types of objects or leaks of objects that are known to entrain many non-logged objects such as js objects. seeing a leaked globalwindowimpl, nsxulpdglobalobject, nsxbldocglobalobject, or nsx
pcwrappedjs is a sign that there could be significant numbers of js objects leaked.) for example, start with bringing up the mail window and closing the window without doing anything. then go on to selecting a folder, then selecting a message, and then other activities one does while reading mail. once you've done this, and it doesn't leak much, then try the action under trace-malloc or lsan or va...
...tructors that should have been virtual: if you expect to override an object's destructor (which includes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual. ...
...override an object's destructor (which includes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual. (but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through x
pconnect many large object graphs that leak go through x
pconnect. ...
...And 6 more matches
NSS functions
rsions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and later cert_addocspacceptableresponses mxr 3.6 and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 and later cert_cachecrl mxr 3.10 and later cert_clearocs
pcache mxr 3.11.7 and later cert_certchainfromcert mxr 3.2 and later cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr ...
... cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificaterequest mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocs
pcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoa...
... 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificaterequest mxr 3.2 and later cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocs
pcertid mxr 3.6 and later cert_destroyocsprequest mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_du
pcertificate mxr 3.2 and later cert_du
pcertlist mxr ...
...And 6 more matches
Preface
next » this is a book about gecko, and about creating x
pcom components for gecko-based applications. though the emphasis is on the practical steps you take to make your c++ code into a component that can be used in gecko, we hope that these steps will also give us an occasion to discuss all of the tools, techniques, and technologies that make up x
pcom. accordingly, the book is arranged so that you can follow along and create your own components or learn about different x
pcom topics individually, as in a reference work. ...
...s arranged so that you can follow along and create your own components or learn about different x
pcom topics individually, as in a reference work. for example, the introduction includes a discussion of components and what they are, and the first chapter - in which you compile the basic code and register it with mozilla - prompts a discussion of the relationship between components and modules, of x
pcom interfaces, and of the registration process in general. the top of each chapter provides a list of the major topics covered. sidebar sections are included to highlight technical details. by the end of the book, if we've done our job, you will have learned how to build a component and you will know something about the framework for these components in gecko, which is x
pcom. who should read thi...
...l details. by the end of the book, if we've done our job, you will have learned how to build a component and you will know something about the framework for these components in gecko, which is x
pcom. who should read this book no one. it is badly out of date, and much of what it says is either no longer remotely accurate, or is severely deprecated. if you are a historian, though... creating x
pcom components is meant for c++ developers. though you can create x
pcom components in javascript and other languages, and though you might be able to follow along as a c programmer, the component implementation code is written in c++, and much of the discussion of how to make your codeinto an x
pcom component starts from c++. you don't need to be a c++ expert, however. although basic ideas such as i...
...And 6 more matches
xptcall FAQ
it may also be used by other subsystems in the future. ...
...it may also be used by other subsystems in the future. ...
...ibrary. it is implemented using platform specific c/c++ and assembly language code. it is used to facilitate cross language and cross thread method calls. porting this code is required in order to make mozilla run on any given platform. why does xptcall exist? xptcall exists for two reasons: to support invoking arbitrary methods on x
pcom interfaces. to support dynamically impersonating any x
pcom interface. both of these facilities are required by x
pconnect. these facilities are also used by x
pcom/proxy. it may also be used by other subsystems in the future. the xptcall approach was chosen over an approach that would have required generating stub code for calling and implementing all interfaces. though the chosen approach requires some core platform specific code, it has minimal foot...
...And 6 more matches
RTCPeerConnection.canTrickleIceCandidates - Web APIs
e if the remote peer can accept trickled ice candidates and false if it cannot. if no remote peer has been established, this value is null. note: this property's value is determined once the local peer has called rtcpeerconnection.setremotedescription(); the provided description is used by the ice agent to determine whether or not the remote peer supports trickled ice candidates. ...
...property's value is determined once the local peer has called rtcpeerconnection.setremotedescription(); the provided description is used by the ice agent to determine whether or not the remote peer supports trickled ice candidates. example var
pc = new rtcpeerconnection(); // the following code might be used to handle an offer from a peer when // it isn't known whether it supports trickle ice. ...
... has called rtcpeerconnection.setremotedescription(); the provided description is used by the ice agent to determine whether or not the remote peer supports trickled ice candidates. example var
pc = new rtcpeerconnection(); // the following code might be used to handle an offer from a peer when // it isn't known whether it supports trickle ice. ...
...And 6 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
taiga (gomita) gomibuchi and was originally published in japanese for the firefox developers conference summer 2007. gomita-san won "most useful upgraded extension" award in mozilla's 2006 "extend firefox" competition for scrapbook, and was runner-up in the "extend firefox 2" contest for firegestures. the chapters so far have each focused on technologies in isolation—xul, javascript, css, and x
pcom. in this chapter, we’ll discuss how to put them together to actually build an extension. an easier method of building a firefox/thunderbird addon for developers who are well-acquainted with ides like netbeans, eclipse, etc. is to use netbeans (ide from sun microsystems) and foxbeans (plugin for netbeans, by teesoft). setting up your development environment in order to develop (and test) e...
...ile. chrome urls are structured as: chrome://%package name%/%package type%/%relative path to source file% for example, the chrome url for the firefox browser window is as follows: chrome://browser/content/browser.xul here, the package name is “browser”, the file “browser.xul”, and the type of the package is “content”. source files represented through chrome urls run with universalx
pconnect privileges; even if they haven’t been granted “use x
pconnect as local file” privileges, as discussed in chapter 4, they will be able to use x
pcom functions (figure 1). extension/ chrome manifest chrome/ #registered in the chrome content package #run with privileges locale package skin package figure 1: chrome packages and chrome registration (fixme: not really explic...
...ional implementation. open a new window and make sure that all three functions—saving a session, restoring a session, and deleting sessions—all work correctly. phase 3: creating a preference panel you don’t need to use ini files, registries, or anything like that to give users options they can set through a preference panel. firefox lets you read and write preference values using handy x
pcom services and create preference panels with interface widgets. in phase 3, we’ll try this out (figure 15). fixme: figure 15: finished preference panel directory structure figure 16 shows the directory structure we’ll be using in phase 3. table 5 explains the new files being used. table 5: files used in phase 3 fixme: make the table cleaner name purpose ...
...And 5 more matches
The Joy of XUL - Archive of obsolete content
hey wish to keep proprietary. the netscape public license (npl) and mozilla public license (mpl) require developers who alter original work (source code files that are provided with mozilla) to release the source code for these changes to their customers. overlays can be used to add features to mozilla without contaminating the original open source code with proprietary alterations. x
pcom/x
pconnect x
pcom and x
pconnect are complementary technologies that enable the integration of external libraries with xul applications. x
pcom, which stands for cross platform component object model, is a framework for writing cross-platform, modular software. x
pcom components can be written in c, c++, and javascript, and they can be used from c, c++, javascript, python, java, and perl. ...
...x
pconnect x
pcom and x
pconnect are complementary technologies that enable the integration of external libraries with xul applications. x
pcom, which stands for cross platform component object model, is a framework for writing cross-platform, modular software. x
pcom components can be written in c, c++, and javascript, and they can be used from c, c++, javascript, python, java, and perl. x
pconnect is a technology which enables simple interoperation between x
pcom and javascript. x
pconnect allows javascript objects to transparently access and manipulate x
pcom objects. it also enables javascript objects to present x
pcom compliant interfaces to be called by x
pcom objects. ...
..., c++, and javascript, and they can be used from c, c++, javascript, python, java, and perl. x
pconnect is a technology which enables simple interoperation between x
pcom and javascript. x
pconnect allows javascript objects to transparently access and manipulate x
pcom objects. it also enables javascript objects to present x
pcom compliant interfaces to be called by x
pcom objects. together, x
pcom and x
pconnect enable developers to create xul applications that require the raw processing power of compiled languages (c/c++) or access to the underlying operating system. xpinstall xpinstall, mozilla's cross platform install facility, provides a standard way of packaging xul application components with an install script that mozilla can download and execute. xpinstall enab...
...And 5 more matches
Extentsions FAQ - Archive of obsolete content
how to customizes toolbar button to coexist in a toolbar palette and status bar? option #3 install status buttons 1.0 <https://addons.mozilla.org/firefox/1272/> "lets you put toolbar buttons at either end of the status-bar. ...
... how to customizes toolbar button to coexist in a toolbar palette and status bar? option #3 install status buttons 1.0 <https://addons.mozilla.org/firefox/1272/> "lets you put toolbar buttons at either end of the status-bar. ...
...(↑ top) any suggestions to remove tool tip appears on the menu it when it should not? what you described was a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=147670). it looks like it has been fixed for firefox version 2. what do i need to do to avoid deadlocks? do i need to marshalinvokations to a particular thread? if so, how? are there any fundamental rules related to threading in x
pcom, and if so, where are these defined? dom can only be accessed from the main thread. also, check out this site to learn how to set up a proxy: http://www.mozilla.org/projects/x
pcom/proxies.html how to test a tab has been closed or not? you can capture the even of tab closing. you can get the tab that is being closed. this should be enough for you. is it possible to fix the size exactly...
...And 5 more matches
turbostat
n't already. it may make parts of this document easier to understand. ...
...ady. it may make parts of this document easier to understand. ...
...may make parts of this document easier to understand. ...
...And 5 more matches
Rebranding SpiderMonkey (1.8.5)
e it is called for, you must delete this build directory and restart this process from the beginning. this time paying careful attention to the commands you issue to your command shell. the above command has actually changed some information we need changed back so we will re-issue the recursive find and replace text in files command with some modifications. ...
...ed for, you must delete this build directory and restart this process from the beginning. this time paying careful attention to the commands you issue to your command shell. the above command has actually changed some information we need changed back so we will re-issue the recursive find and replace text in files command with some modifications. ...
...mmand with some modifications. find ./ -type f -exec sed -i "s/$brand.
pc/mozjs185.
pc/" {} \; the last recursive search and replace, changes the file name of the static library: find ./ -type f -exec sed -i "s/js_static/$brand_static/" {} \; allright, almost there. now comes the manual editing. using your favorite editor open up the file named makefile for editing. ...
...And 5 more matches
64-bit Compatibility
ze_i - 32-bit integer argsize_q - 64-bit integer argsize_p - 32-bit integer on 32-bit platforms, 64-bit integer on 64-bit platforms. remember to use argsize_p where appropriate - on pointers or natively sized integers (including jsvals). similarly, when adding types to jsbuiltins.h, remember to use _js_ptr for pointer-width values. lir safety it is not immediately clear from reading lir which o
pcodes should be used for 64-bit safety. if you make a mistake, there's an extremely good chance the sanityfilter in nanojit will catch it while generating code. if this happens you will get an assert that points directly to the ill-typed lir. not all pointer-width values are actually pointers. to avoid equivocating, the rest of this article will use the term "native integers". a native integer is t...
...g and storing native integers the harder cases to detect usually involve runtime value truncation. for example, this code will not load a native integer correctly on a 64-bit machine: struct object { void *data; }; lir->insload(lir_ld, objins, ins->insimm(offsetof(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 o
pcode 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 al...
...tomatically, 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. ...
...And 5 more matches
Finishing the Component
when the component starts up, it populates a list of urls read in from a file stored next to the gecko binary on the local system. using frozen interfaces the core functionality of blocking sites is still missing, however. ...
...are not ready to be published. this puts you in the same situation as many developers using mozilla - you want to use some specific functionality, but the interfaces seem to change on a daily basis. all of the mozilla source code is publicly available, and interfaces can be used easily enough. grab the right headers, use the component or service manager to access the interface you want, and the x
pcom object(s) that implement that interface will do your bidding. with this huge amount of flexibility, however, you lose compatibility. if you use "stuff" that isn't frozen, that stuff is subject to change in future versions of gecko. if you want to be protected against changes in gecko, you must only use interfaces and apis that are clearly marked as frozen. the marking is made in the comments a...
...e 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. weblock interfaces interface name defined by status summary nsisupports x
pcom frozen provides interface discovery, and object reference counting nsiobserver x
pcom 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. implemen...
...And 5 more matches
Using components
var {cc: classes, ci: interfaces} = components; there are many more than just classes and interfaces. ...
...var {cc: classes, ci: interfaces} = components; there are many more than just classes and interfaces. ...
...: classes, ci: interfaces} = components; there are many more than just classes and interfaces. var { cu: utils, ci: interfaces, cc: classes, cr: results, cs: stack, cm: manager, ce: exception, } = components; here is a full breakdown of what is contained in components. ...
...And 5 more matches
getFile
if true, this lets the directory service cache results to improve the performance of directory lookups. ...
...iven standard path location. the individual platform implementation of nsidirectoryserviceprovider maps the symbolic path location passed to this function and returns the appropriate nsifile. nsifile getfile( in string aname, out boolean apersistent ); parameters aname [in] the symbolic name for a file or directory location. see symbolic names below for a list of accepted values. x
pcom file system aliases apersistent [out] this output parameter indicates to the caller whether or not the returned location is persistent. if true, this lets the directory service cache results to improve the performance of directory lookups. if false, then the directory service will not cache the results of this method. symbolic names the list of symbolic names is subject to change, so ...
...rsistent [out] this output parameter indicates to the caller whether or not the returned location is persistent. if true, this lets the directory service cache results to improve the performance of directory lookups. if false, then the directory service will not cache the results of this method. symbolic names the list of symbolic names is subject to change, so be sure to take a look at the x
pcom/io/nsdirectoryservicedefs.h file for the version of gecko you're working with for the latest list. available on all platforms these symbolic names are available on all platforms (although, of course, they may refer to different physical paths on the storage device). c constant string value notes ns_os_home_dir "home" ns_os_temp_dir "tmpd" ...
...And 5 more matches
Xptcall Porting Guide
overview xptcall is a library that supports both invoking methods on arbitrary x
pcom objects and implementing classes whose objects can impersonate any x
pcom interface. it does this using platform specific assembly language code. this code needs to be ported to all platforms that want to support xptcall (and thus mozilla). ...
... overview xptcall is a library that supports both invoking methods on arbitrary x
pcom objects and implementing classes whose objects can impersonate any x
pcom interface. it does this using platform specific assembly language code. this code needs to be ported to all platforms that want to support xptcall (and thus mozilla). ...
...bjects and implementing classes whose objects can impersonate any x
pcom interface. it does this using platform specific assembly language code. this code needs to be ported to all platforms that want to support xptcall (and thus mozilla). the tree mozilla/x
pcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac p
pc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform. theory of operation there are really two pieces of functionality: invoke and stubs... th...
...And 5 more matches
Mozilla
uting to or exploring the various parts of the codebase. android-specific test suites there are several android-specific test suites that run on the firefox for android codebase: api change rules until further notice, the following rules govern api changes: application cache implementation overview this happens in nshtt
pchannel::opencacheentry(). all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload(). channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache. nsiapplicationcacheservice::chooseapplicationcache is given the url the channel is about to load. it synchronously retu...
...an any secondary replacements of kdewallet. creating a spell check dictionary add-on this page describes how to package a hunspell spell check dictionary as a firefox add-on, or how to update your existing add-on, so that it can be installed, uninstalled and updated without a restart. creating javascript callbacks in components x
pcom components use idl to create interfaces. these interfaces are used to manipulate the component in c++ and javascript. a common pattern used with interfaces to create a bi-directional communication between two groups of code is the observer (or listener) pattern. basically, the component defines an observer (or listener) interface which is implemented by some external cod...
...eve the same visual effect. reftest will then compare them and verify whether they produce the same bitmap. creating sandboxed http connections starting with gecko 1.8.1 (firefox 2), it is possible to create sandboxed http connections which don't affect the user's cookies. this article will cover the basics of doing http connections from x
pcom javascript, and should easily translate to c++ x
pcom. debugging debugging a project as large as mozilla can be a daunting task. fortunately, over the years, mozilla developers have come up with not just technologies and features to help you debug code, but have devised tips and techniques that can help too. also available are assorted t...
...And 5 more matches
SubtleCrypto.wrapKey() - Web APIs
erial and some random salt derive an aes-kw key using pbkdf2. */ function getkey(keymaterial, salt) { return window.crypto.subtle.derivekey( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, { "name": "aes-kw", "length": 256}, true, [ "wrapkey", "unwrapkey" ] ); } /* wrap the given key. */ async function wra
pcryptokey(keytowrap) { // get the key encryption key const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new uint8array(16)); const wrappingkey = await getkey(keymaterial, salt); return window.crypto.subtle.wrapkey( "raw", keytowrap, wrappingkey, "aes-kw" ); } /* generate an encrypt/decrypt secret key, then wrap it. */ window.crypto.subtle...
...mvalues(new uint8array(16)); const wrappingkey = await getkey(keymaterial, salt); return window.crypto.subtle.wrapkey( "raw", keytowrap, wrappingkey, "aes-kw" ); } /* generate an encrypt/decrypt secret key, then wrap it. */ window.crypto.subtle.generatekey( { name: "aes-gcm", length: 256, }, true, ["encrypt", "decrypt"] ) .then((secretkey) => { return wra
pcryptokey(secretkey); }) .then((wrappedkey) => { console.log(wrappedkey); }); pkcs #8 wrap this example wraps an rsa private signing key. it uses "pkcs8" as the export format and aes-gcm, with a password-derived key, to encrypt it. see the complete code on github. let salt; let iv; /* get some key material to use as input to the derivekey method. the key material is a password supplied by t...
...ial and some random salt derive an aes-gcm key using pbkdf2. */ function getkey(keymaterial, salt) { return window.crypto.subtle.derivekey( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, { "name": "aes-gcm", "length": 256}, true, [ "wrapkey", "unwrapkey" ] ); } /* wrap the given key. ...
...And 5 more matches
Multi-touch interaction - Web APIs
> elements to represent four touch areas. <style> div { margin: 0em; padding: 2em; } #target1 { background: white; border: 1px solid black; } #target2 { background: white; border: 1px solid black; } #target3 { background: white; border: 1px solid black; } #target4 { background: white; border: 1px solid black; } </style> global state t
pcache is used to cache touch points for processing outside of the event where they were fired. // log events flag var logevents = false; // touch point cache var t
pcache = new array(); register event handlers event handlers are registered for all four touch event types. the touchend and touchcancel event types use the same handler. function set_handlers(name) { // install event handlers for ...
...(and device dependent). // this is a very basic 2-touch move/pinch/zoom handler that does not include // error handling, only handles horizontal moves, etc. ...
... is a very basic 2-touch move/pinch/zoom handler that does not include // error handling, only handles horizontal moves, etc. ...
...And 5 more matches
Writing a WebSocket server in C# - Web APIs
n order to write less. it allows usage of a namespace's classes without typing the full namespace every time. tcplistener constructor: tcplistener(system.net.ipaddress localaddr, int port) localaddr specifies the ip of the listener, and port specifies the port. to create an ipaddress object from a string, use the parse static method of ipaddress. methods: start() system.net.sockets.tc
pclient accepttc
pclient() waits for a tcp connection, accepts it and returns it as a tc
pclient object. here's a barebones server implementation: using system.net.sockets; using system.net; using system; class server { public static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has ...
...ient object. here's a barebones server implementation: using system.net.sockets; using system.net; using system; class server { public static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has started on 127.0.0.1:80.{0}waiting for a connection...", environment.newline); tc
pclient client = server.accepttc
pclient(); console.writeline("a client connected."); } } tc
pclient methods: system.net.sockets.networkstream getstream() gets the stream which is the communication channel. both sides of the channel have reading and writing capability. properties: int available this property indicates how many bytes of data have been sent. the value is zero...
...s how many bytes of data have been sent. the value is zero until networkstream.dataavailable is true. networkstream methods: write(byte[] buffer, int offset, int size) writes bytes from buffer, offset and size determine length of message. read(byte[] buffer, int offset, int size) reads bytes to buffer. offset and size determine the length of the message. let us extend our example. ...
...And 5 more matches
font - CSS: Cascading Style Sheets
the font-style to italic, the font size to large, and the font family to serif. */ p { font: bold italic large serif } /* use the same font as the status bar of the window */ p { font: status-bar } live sample html <p> change the radio buttons below to see the generated shorthand and it's effect. ...
...font-style-normal">normal</label><br/> <input type="radio" id="font-style-italic" name="font_style" value="italic" onchange="setcss()"> <label for="font-style-italic">italic</label><br/> <input type="radio" id="font-style-oblique" name="font_style" value="oblique" onchange="setcss()"> <label for="font-style-oblique">oblique</label> </div> <div class="setpro
pcont"> font-variant<br> <input type="radio" id="font-variant-none" name="font_variant" checked="" value=" " onchange="setcss()"> <label for="font-variant-none">none</label><br/> <input type="radio" id="font-variant-normal" name="font_variant" value="normal" onchange="setcss()"> <label for="font-variant-normal">normal</label><br/> <input type="radio" i...
...e</label><br/> <input type="radio" id="font-variant-normal" name="font_variant" value="normal" onchange="setcss()"> <label for="font-variant-normal">normal</label><br/> <input type="radio" id="font-variant-small-caps" name="font_variant" value="small-caps" onchange="setcss()"> <label for="font-variant-small-caps">small-caps</label> </div> <div class="setpro
pcont"> font-weight<br/> <input type="radio" id="font-weight-none" name="font_weight" value="" onchange="setcss()"> <label for="font-weight-none">none</label><br/> <input type="radio" id="font-weight-normal" checked="" name="font_weight" value="400" onchange="setcss()"> <label for="font-weight-normal">normal</label><br/> <input type="radio" id="font-we...
...And 5 more matches
XUL Migration Guide - Archive of obsolete content
s a good candidate for migration via a comparison of the benefits and limitations of the sdk versus xul development. next, we'll look at some of the main tasks involved in migrating: working with content scripts using the sdk's supported apis how to go beyond the supported apis when necessary, by: using third party modules using the sdk's low-level apis getting direct access to x
pcom finally, we'll walk through a simple example. should you migrate? see this comparison of the benefits and limitations of sdk development and xul development. whether you should migrate a particular add-on is largely a matter of how well the sdk's supported apis meet its needs. if your add-on can accomplish everything it needs using only the supported apis, it's a good candidat...
... benefits and limitations of sdk development and xul development. whether you should migrate a particular add-on is largely a matter of how well the sdk's supported apis meet its needs. if your add-on can accomplish everything it needs using only the supported apis, it's a good candidate for migration. if your add-on needs a lot of help from third party packages, low-level apis, or x
pcom, then the cost of migrating is high, and may not be worth it at this point. if your add-on only needs a little help from those techniques, and can accomplish most of what it needs using the supported apis, then it might still be worth migrating: we'll add more supported apis in future releases to meet important use cases. user interface components xul-based add-ons typically implemen...
...ectory there called "chrome". in that directory you can keep your "content", "locale", and "skin" subdirectories: this allows you to refer to objects in these directories from "chrome.manifest" using a relative path, like "chrome/content". this is provided only as a migration aid, and it's still a good idea to port xul windows to html. content scripts in a xul-based add-on, code that uses x
pcom objects, code that manipulates the browser chrome, and code that interacts with web pages all runs in the same context. but the sdk makes a distinction between: add-on scripts, which can use the sdk apis, but are not able to interact with web pages content scripts, which can access web pages, but do not have access to the sdk's apis content scripts and add-on scripts communicate by sendin...
...And 4 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
rce rpm (check bug 295329) ; patch: [root@b008-02 sources]# cat thunderbird-autoconfigandldap.patch diff -ur thunderbird-3.0/configure thunderbird-3.0.autoldap/configure --- thunderbird-3.0/configure 2009-06-29 11:37:21.677372297 +0200 +++ thunderbird-3.0.autoldap/configure 2009-06-29 14:41:11.547435040 +0200 @@ -12855,7 +12855,7 @@ moz_feeds=1 moz_jsdebugger=1 moz_jsloader=1 -moz_ldap_x
pcom= +moz_ldap_x
pcom=1 moz_mail_news= moz_mork=1 moz_morkreader= and set --enable-extensions=pref in mozconfig file, in fedora source rpm it is: [root@b008-02 sources]# grep enable-extensions /root/rpmbuild/sources/thunderbird-mozconfig ac_add_options --enable-extensions=pref it seems worse this time , as even after applying those compilation options mentioned above, i now get the following...
...or_not_initialized) [nsildapurl.spec]" nsresult: "0xc1f30001 (ns_error_not_initialized)" location: "js frame :: file:////usr/lib/thunderbird-3.0b2/defaults/autoconfig/prefcalls.js :: getldapattributes :: line 174" data: no] bug 295329 had been re-opened . autoconfig option and ldap support in thunderbird 1.5.x fortunately, autoconfig is now part of thunderbird default packages. moz_ldap_x
pcom=1 and moz_extensions_default="wallet spellcheck xmlextras pref webservices universalcharset auth" are now present in the default configure script. see bug 295329 for details. add the autoconfig option for old thunderbird 1.0.x by default, autoconfig did not make part of the binaries distribution of thunderbird (1.0.x). it was apparently supposed to increase the load of the binary for a featur...
...erride it. function displayerror(title, msg) { log.debug(title + ": " + msg); alerts.showalertnotification("chrome://branding/content/icon48.png", title, msg); } firefox it's the same principles as for firefox as it was described above for thunderbir. binary distributions should now include support for autoconfig (pref extension!) but unfortunately not for ldap calls :-( (cf. moz_ldap_x
pcom=1). it is not vital in firefox as it is for us in thunderbird (need to get the cn and email address to set email account, which are not available by default in the environment variables). however i could be useful to get ldap values for firefox extra config, for example to set the default home page to the labeleduri ldap attribute of the user. firefox 22 omni.jar archive file became omni.ja s...
...And 4 more matches
Source code directories overview - Archive of obsolete content
esses, html or xul that exercise this module. tools contains scripts for automatically generating certain source code and other special tools for building this module. there are also platform dependent subdirectories which contain source code for specific platforms. windows contains source code for windows 95, windows 98 and windows nt 4.0. mac contains source code for macos: both the power
pc and 68000 versions. gtk contains source code for gtk (a.k.a. the gimp toolkit) which runs on x-windows on unix. motif contains source code for motif, a toolkit which runs on x-windows on unix. os2 contains source code for os/2 warp. rhapsody contains source code for mac os x server (which is based on nextstep which is based on x-windows on unix) using yellow box (cocoa). beos contains sourc...
... level things instead of build level things (which are a stored in the build directory). content was split off from layout and contains objects as they are exposed to the dom. db contains c code for the mdb/mork database which is a low-level, general-purpose and cross-platform file library. it is used to store mail box data, news data and global history data. it has not been updated to support x
pcom yet. this code originated in the mozilla classic code base. dbm contains c code for managing, reading and writing hash tables. it is used for the auto-completion feature on the url edit box (stored in netscape.hst in mozilla classic) and for the cached pages index (stored in fat.db in mozilla classic). this code originated at uc berkeley. directory contains the ldap sdk. docshell contains c ...
...nterfaces for a platform-independent device (drawing) context. it does not handle widgets or specific drawing routines; it just provides the primitive operations for drawing. intl contains c interfaces and code for supporting localization. it contains code for various character sets, locale formats (e.g. the format of the date and time for different cultures) and other localization facilities. i
pc contains jpeg contains c code for reading/writing jpeg images. this code originated as the reference implementation for the jpeg specification from the independent jpeg group. js contains c code for tokenizing, parsing, interpretting and executing javascript scripts. this code originated in mozilla classic. l10n contains code for building localizations. layout contains the c interfaces and co...
...And 4 more matches
Table Layout Strategy - Archive of obsolete content
unter part. in the following the basic table layout strategy is discussed. the functionality is distributed over a large number of subroutines as shown in the chart below. the words the table layout is width oriented and knows the following widths: minimum content width - min the minimum width that is required to layout the content, all linebreak possibilities will be used percent width -
pct the cell width specified in percent, fixed width - fix the cell width specified as px, mm etc., proportional width - prop the cell width specified via 1*, 2* etc. and the desired width - des the width the content could fill without any linebreaks. cells can be members of colspans. these colspans have to distribute their space to the columns they include. this information is hold in the a...
...cell width specified via 1*, 2* etc. and the desired width - des the width the content could fill without any linebreaks. cells can be members of colspans. these colspans have to distribute their space to the columns they include. this information is hold in the adjusted width's. due to this there are 10 width informations for every column. ...
...width specified via 1*, 2* etc. and the desired width - des the width the content could fill without any linebreaks. cells can be members of colspans. these colspans have to distribute their space to the columns they include. this information is hold in the adjusted width's. due to this there are 10 width informations for every column. ...
...And 4 more matches
XPJS Components Proposal - Archive of obsolete content
this is a proposal for a system that got implemented, but it may differ from the actual implementation. see the status document for more recent info on the status of this proposal. draft 1.0 what are xpjs components? xpjs components is a (cheesy) name for a system to support x
pcom components written in javascript. now, you might ask: "isn't that what x
pconnect does?" and i would answer that x
pconnect is necessary, but not sufficient to the task. x
pconnect provides the mechanisms for communication between native and js x
pcom components, but it does not provide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window. xpjs will provide that infrastructure. so what does this mean? the xpjs component system will support i...
...it will support service and factory registration. these components will be independent of web content and browser windows. they will run from the user's disk just like native components. how will it work? the overriding principle is to make this work as much like native components as possible. ...
...expected to have the functions: nsregisterself nsgetfactory nsunregisterself (optional) nscanunload (optional) each .js file might implement one or more components. we will have one native module - called the xpjsmanager - which holds this system together. ...
...And 4 more matches
Multiprocess on Windows
apartment, readers of this document should have a solid understanding of what apartments are. unfortunately this topic is often poorly explained. one of the better pieces of documentation is a two-part series written by jeff prosise: understanding com apartments, part i understanding com apartments, part ii for the purposes of this document, "com" will refer to microsoft com (as opposed to x
pcom). gecko and apartments most code that runs on gecko's main thread is not thread safe. since gecko's main thread uses com, and com requires threads to declare their threading model, the main thread must initialize itself to live inside its own single threaded apartment (sta). this is true for both chrome and content processes. as you should already know from the prerequisite reading, single t...
...ecko's main thread is not thread safe. since gecko's main thread uses com, and com requires threads to declare their threading model, the main thread must initialize itself to live inside its own single threaded apartment (sta). this is true for both chrome and content processes. ...
... you should already know from the prerequisite reading, single threaded apartments receive remote procedure calls (r
pcs) from com, via the windows message queue. from a performance standpoint, this is less than ideal. the windows message queue carries a lot of baggage for the purposes of maintaining backward compatibility. on the other hand, com's multithreaded apartment (mta) uses a much faster i
pc mechanism that does not suffer from the same problems as the message queue. ideally, we would like to receive r
pcs via threads in the mta, and then forward them in a thread-safe way to gecko's main thread. ...
...And 4 more matches
Creating Sandboxed HTTP Connections
introduction starting with gecko 1.8.1 (firefox 2), it is possible to create sandboxed http connections which don't affect the user's cookies. this article will cover the basics of doing http connections from x
pcom javascript, and should easily translate to c++ x
pcom. setting up an http connection the first step in setting up an http connection from an url (stored in a string) is to create an nsiuri out of it. nsiuri is an x
pcom representation of an uri, with useful methods to query and manipulate the uri. to create an nsiuri from an string, we use the newuri method of nsiioservice: // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioser...
...s_nointerface; } }, // nsiprogresseventsink (not implementing will cause annoying exceptions) onprogress : function (arequest, acontext, aprogress, aprogressmax) { }, onstatus : function (arequest, acontext, astatus, astatusarg) { }, // nsihttpeventsink (not implementing will cause annoying exceptions) onredirect : function (aoldchannel, anewchannel) { }, // we are faking an x
pcom interface, so we need to implement qi queryinterface : function(aiid) { if (aiid.equals(components.interfaces.nsisupports) || aiid.equals(components.interfaces.nsiinterfacerequestor) || aiid.equals(components.interfaces.nsichanneleventsink) || aiid.equals(components.interfaces.nsiprogresseventsink) || aiid.equals(components.interfaces.nsihttpeventsink) || ...
...hannel that causes the notification is passed in as the first argument, comparing it to the globally stored channel (gchannel) in the previous section (which also gets updated each time a redirect happens). // create an nsiobserver implementor var listener = { observe : function(asubject, atopic, adata) { // make sure it is our connection first. if (asubject == gchannel) { var htt
pchannel = asubject.queryinterface(components.interfaces.nsihtt
pchannel); if (atopic == "http-on-modify-request") { // ... } else if (atopic == "http-on-examine-response") { // ... } } }, queryinterface : function(aiid) { if (aiid.equals(components.interfaces.nsisupports) || aiid.equals(components.interfaces.nsiobserver)) return this; ...
...And 4 more matches
Debugging Table Reflow
ng table code: <table border width="300"> <colgroup> <col> <col width="50%"> <col width="1*"> <col> </colgroup> <tr> <td style="width:80px">cell 1</td> <td>cell 2</td> <td>cell 3</td> <td>cell 4</td> </tr> </table> rendering: <colgroup><col><col width="50%"><col width="1*"><col></colgroup>cell 1cell 2cell 3cell 4 it will produce the following log at the entrance of assignnon
pctcolwidths: assignnon
pctcolwidths en max=4500 count=0 ***start table dump*** mcolwidths=-1 -1 -1 -1 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** colindex=0 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** colindex=1 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **s...
...ontent + padding #define des_con 1 // desired width of the content + padding #define fix 2 // fixed width either from the content or cell, col, etc. ...
...h of the content + padding #define fix 2 // fixed width either from the content or cell, col, etc. ...
...And 4 more matches
Hacking Tips
st the members of that "namespace". getting the bytecode of a function (from js shell) the shell has a small function named dis to dump the bytecode of a function with its source notes. without arguments, it will dump the bytecode of its caller. js> function f () { return 1; } js> dis(f); flags: loc op ----- -- main: 00000: one 00001: return 00002: stop source notes: ofs line
pc delta desc args ---- ---- ----- ------ -------- ------ 0: 1 0 [ 0] newline 1: 2 0 [ 0] colspan 2 3: 2 2 [ 2] colspan 9 getting the bytecode of a function (from gdb) in jso
pcode.cpp, a function named js::disassembleat
pc can print the bytecode of a script. some variants of this function such as js::dumpscript etc are convenient for debugging. printing the...
...(from gdb) in jsobj.cpp, a function named js::dumpbacktrace prints a backtrace à la gdb for the js stack. the backtrace contains in the following order, the stack depth, the interpreter frame pointer (see js/src/vm/stack.h, stackframe class) or (nil) if compiled with ionmonkey, the file and line number of the call location and under parentheses, the jsscript pointer and the jsbytecode pointer (
pc) executed. $ gdb --args js […] (gdb) b js::reportoverrecursed (gdb) r js> function f(i) { if (i % 2) f(i + 1); else f(i + 3); } js> f(0) breakpoint 1, js::reportoverrecursed (maybecx=0xfdca70) at /home/nicolas/mozilla/ionmonkey/js/src/jscntxt.cpp:495 495 if (maybecx) (gdb) call js::dumpbacktrace(maybecx) #0 (nil) typein:2 (0x7fffef1231c0 @ 0) #1 (nil) typein:...
...illa/ionmonkey/js/src/ion/codegenerator.cpp:609 609 } program received signal sigtrap, trace/breakpoint trap. 0x00007ffff7fb165a in ?? () (gdb) once you hit the generated breakpoint, you can replace it by a gdb breakpoint to make it conditional, the procedure is to first replace the generated breakpoint by a nop instruction, and to set a breakpoint at the address of the nop. ...
...And 4 more matches
Property cache
describe the context in which a property lookup occurs. the values consist of two word-sized members. entry->vcap caches the results of part 1 above, telling which object contains the desired property. entry->vword is described in the section entry value words below. it caches the results of part 2, if the property is simple enough for optimized access, or a pointer to the js::shape if not. the o
pcodes that take advantage of the property cache, as of june 2009, are: getprop, get{x,this,arg,local}prop, and length; name; setprop, bindname, and setname; callprop and callname; and {inc,dec}name and name{inc,dec}. elem o
pcodes do not use it. nor do {inc,dec}prop or prop{inc,dec}. nor do operations such as add that only need to look up a property (.tostring) in unusual cases. throughout this ar...
...on possible. a branded object always has a unique shape. overflow. if there come to be more than 224 objects that need distinct shapes, the shape rules can no longer be satisfied. the property cache cannot operate without them, so it is disabled permanently. see bug 440834. property cache entries each entry in the property cache hash table is either populated or not; unpopulated entries have .k
pc == null. if an entry is populated, the .k
pc field points to the bytecode instruction at which it was populated. the entry is valid only for subsequent lookups that occur at the same instruction, for several reasons: the script, not the property cache entry, contains the id of the property being accessed. a property cache entry could be valid for a getprop but not a setprop, e.g. because the ...
...lid for a getprop but not a setprop, e.g. because the property has a setter and not a getter; or vice versa. lookups for jof_name instructions are quite different from ordinary property lookups: name lookups follow the scope chain and the prototype chain, whereas the others only follow the prototype chain. there are two different types of property cache entry. ...
...And 4 more matches
Observer Notifications
e observer service for the profile-after-change notification. see receiving startup notifications for more information about how this works. starting in firefox 3.5 components can simply register for the profile-after-change notification in nsicategorymanager. topic description * everything. [nsobserverservice.cpp] topic description x
pcom-startup note: an extension can no longer be registered to receive this notification in firefox 4 and later. see x
pcom changes in gecko 2.0 for details. called when x
pcom is initialized. many things are not available for use at this point. to receive this notification you have to register with nsicategorymanager. the registered component is always retrieved as a singleton (that is g...
...om is initialized. many things are not available for use at this point. to receive this notification you have to register with nsicategorymanager. the registered component is always retrieved as a singleton (that is getservice() will be used to instantiate it). app-startup note: an extension can no longer be registered to receive this notification in firefox 4 and later. see x
pcom changes in gecko 2.0 for details. general event for application startup. to receive this notification you have to register with nsicategorymanager. prepend "service," to the contract id in the category registration to be invoked via getservice() instead of createinstance(). profile-do-change this is fired after the profile has been selected. you will not be able to access u...
...ences, bookmarks, or anything that uses the profile folder until this event occurs. this occurs after any profile migration. profile-after-change this is fired after all the observers for profile-do-change have been notified. you can register with nsicategorymanager to receive this notification. prior to firefox 3.5, this was available to observers observing the app-startup/x
pcom-startup notification. final-ui-startup triggered just before the first window for the application is displayed. sessionstore-windows-restored sent by the session restore process to indicate that all initial browser windows have opened. note that while the window are open and the chrome loaded the tabs in the windows may still be being restored after thi...
...And 4 more matches
imgIContainer
void getframecolormap(in unsigned long framenumber, [array, size_is(palettelength)] out pruint32 palettedata, out unsigned long palettelength); obsolete since gecko 2.0 unsigned long getframeimagedatalength(in unsigned long framenumber); obsolete since gecko 2.0 imagecontainer getimagecontainer(); native code only! ...
...ze_is(palettelength)] out pruint32 palettedata, out unsigned long palettelength); obsolete since gecko 2.0 unsigned long getframeimagedatalength(in unsigned long framenumber); obsolete since gecko 2.0 imagecontainer getimagecontainer(); native code only! ...
... obsolete since gecko 2.0 void setdiscardable(in string amimetype); native code only! ...
...And 4 more matches
nsISupports proxies
this technology has been removed in firefox 12 because it was very complex and often lead to strange deadlock conditions. ...
...this technology has been removed in firefox 12 because it was very complex and often lead to strange deadlock conditions. ...
...this technology has been removed in firefox 12 because it was very complex and often lead to strange deadlock conditions. ...
...And 4 more matches
Using the Gecko SDK
a frozen gecko api is one that is included in the gecko and marked frozen with the text <tt>@status frozen</tt> (with nspr as the exception to the rule). ...
...a frozen gecko api is one that is included in the gecko and marked frozen with the text <tt>@status frozen</tt> (with nspr as the exception to the rule). ...
...a frozen gecko api is one that is included in the gecko and marked frozen with the text <tt>@status frozen</tt> (with nspr as the exception to the rule). ...
...And 4 more matches
Xptcall Porting Status
m> unix (same as linux 86 code) bert contributed patches that *should* do the right thing for all the unixish-x86 versions of this code for gcc 2.7 or 2.8 vs. egcs 1.1. he notes that the vtbl scheme is different. he is hoping that others will help test the changes using these two compilers on the various platforms where this same code is used. bert's details <font color="white">done</font> mac p
pc roger lawrence <rogerl@netscape.com>, patrick beard <beard@netscape.com> mac (passing tests and checked in) <font color="white">done</font> solaris sparc roger lawrence <rogerl@netscape.com>, chris mcafee <mcafee@netscape.com> unix this is checked in and working. <font color="white">done</font> solaris sparc v9 (64bit) stuart parmenter <pavlov@netscape.com>, chris seawood <cls@seawood.o...
... a long time now. <font color="white">done</font> openvms alpha colin r. blake <colin@theblakes.com> colin says this is passing all the tests on openvms alpha! <font color="white">done</font> nt alpha bob meader <bob@guiduck.com> bob writes: enclosed is xptcall for alpha/nt target.. it is a variation of the iris port (only targeted for win32). notice the last 2 files (the change to mozilla\x
pcom\build\makefile.win and mozilla\x
pcom\build) are needed because i was unable to figure how to do a "declspecexport" from the assembler asaxp ... if some knows how to do that then those last 2 files won't be needed. i have had someone look over this code at bridge.com (the entry point to compaq/gem compiler team) and this code was given the ok. i consider it "done". this code lives in the files w...
...done</font> linux sparc anton blanchard <anton@progsoc.uts.edu.au>, roger lawrence <rogerl@netscape.com>, brandon ehle <ehle.3@osu.edu> anton contributed patches to roger's sparc code. anton says it works and passes the tests! (24-aug-1999) brandon writes: i've finished testing xptcall sparc linux on 12 different sparc machines and it checks out good. ...
...And 4 more matches
XPIDL
interface description languages (idl) are used to describe interfaces in a language- and machine-independent way. idls make it possible to define interfaces which can then be processed by tools to autogenerate language-dependent interface specifications. xpidl is expected to converge towards webidl in the future. note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk. pyxpidl has been used for some time now, but now the older tool has been fully retired. ...
...e older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk. pyxpidl has been used for some time now, but now the older tool has been fully retired. writing xpidl interface files xpidl closely resembles omg idl, with extended syntax to handle iids and additional types. some examples are in the x
pcom/base and x
pcom/ds directories of the mozilla tree. xpidl:syntax (now up to date 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 typ...
...parameters. when called from a javascript context, they invocation looks as it is declared for the most part; some parameter properties can adjust what the code looks like. the calls are more mangled in native contexts. an important attribute for methods and attributes is scriptability. a method or attribute is scriptable if it is declared in a scriptable interface and it lacks a noscript or notx
pcom property. any method that is not scriptable can only be accessed by native code. however, scriptable methods must contain parameters and a return type that can be translated to script: any native type, save those declared with an nsid, utf8string, cstring, astring, or jsval property, may not be used in a scriptable method or attribute. an exception to the above rule is if the parameter has the ...
...And 4 more matches
RTCPeerConnection.addStream() - Web APIs
er the new stream. syntax rtcpeerconnection.addstream(mediastream); parameters mediastream a mediastream object indicating the stream to add to the webrtc peer connection. return value none. example this simple example adds the audio and video stream coming from the user's camera to the connection. ...
...eerconnection.addstream(mediastream); parameters mediastream a mediastream object indicating the stream to add to the webrtc peer connection. return value none. example this simple example adds the audio and video stream coming from the user's camera to the connection. ...
... video stream coming from the user's camera to the connection. navigator.mediadevices.getusermedia({video:true, audio:true}, function(stream) { var
pc = new rtcpeerconnection();
pc.addstream(stream); }); migrating to addtrack() compatibility allowing, you should update your code to instead use the addtrack() method: navigator.getusermedia({video:true, audio:true}, function(stream) { var
pc = new rtcpeerconnection(); stream.gettracks().foreach(function(track) {
pc.addtrack(track, stream); }); }); the newer addtrack() api avoids confusion over whether later changes to the track-makeup of a stream affects a peer connection (they do not). the exception is in chrome, where addstream() does make the peer connection sensitive to later stream changes (though such changes do not f...
...And 4 more matches
d - SVG: Scalable Vector Graphics
command parameters notes c (x1,y1, x2,y2, x,y)+ draw a cubic bézier curve from the current point to the end point spec...
... command parameters notes c (x1,y1, x2,y2, x,y)+ draw a cubic bézier curve from the current point to the end point specified by x,y. the start control point is specified by x1,y1 and the end control point is ...
... (x1,y1, x2,y2, x,y)+ draw a cubic bézier curve from the current point to the end point specified by x,y. the start control point is specified by x1,y1 and the end control point is specified by x2,y2. any subsequent triplet(s) of coordinate pairs are interpreted as parameter(s) for implicit absolute cubic bézier curve (c) command(s). formulae: po′ = pn = {x, y} ;
pcs = {x1, y1} ;
pce = {x2, y2} c (dx1,dy1, dx2,dy2, dx,dy)+ draw a cubic bézier curve from the current point to the end point, which is the current point shifted by dx along the x-axis and dy along the y-axis. the start control point is the current point (starting point of the curve) shifted by dx1 along the x-axis and dy1 along the y-axis. the end control point i...
...And 4 more matches
Miscellaneous - Archive of obsolete content
to a xulrunner application you need to ship a xulrunner application with your own ssl certificates? for firefox, you could use the client customization kit (cck) to create an extension that does exactly that. to get the same feature for your xulrunner application, follow those steps: first, put the certificates you want to ship into the content/certs folder of your application. ...
...e steps: first, put the certificates you want to ship into the content/certs folder of your application. then create a x
pcom service that adds the certificates inside that directory to the certs database on application startup. ...
...utils.jsm"); const gobserver = cc['@mozilla.org/observer-service;1'].getservice(ci.nsiobserverservice); const gioservice = cc["@mozilla.org/network/io-service;1"].getservice(ci.nsiioservice); function certsservice() {} certsservice.prototype = { observe: function(asubject, atopic, adata) { switch(atopic) { case "app-startup": gobserver.addobserver(this,"x
pcom-shutdown",false); gobserver.addobserver(this,"final-ui-startup",false); break; case "x
pcom-shutdown": gobserver.removeobserver(this,"final-ui-startup"); gobserver.removeobserver(this,"x
pcom-shutdown"); break; case "final-ui-startup": this.init(); break; ...
...And 3 more matches
Intercepting Page Loads - Archive of obsolete content
is downloaded, and before the user sees anything in the tab. http observers another common way of detecting and intercepting loads is using http observer topics. this is how the tamper data extension and others do it. http notifications are fired for all http requests originating from firefox. they are window-independent, so it is better to keep your observer code in non-chrome objects (your x
pcom service or jsm module). otherwise you have to make sure to avoid duplicated work if you have 2 or more windows open. there are 2 http topics you can listen to, as specified in the observer notifications page: topic description http-on-modify-request called as an http request is made. the channel is available to allow you to modify headers and such. http-on-exa...
...the observer notifications page: topic description http-on-modify-request called as an http request is made. the channel is available to allow you to modify headers and such. http-on-examine-response called after a response has been received from the webserver. headers are available on the channel. the subject argument on the observe method is the nsihtt
pchannel object that corresponds to the http channel being opened or already opened, depending on the topic. observe : function(asubject, atopic, adata) { if (topic_modify_request == atopic) { let url; asubject.queryinterface(components.interfaces.nsihtt
pchannel); url = asubject.uri.spec; if (re_url_to_modify.test(url)) { // re_url_to_modify is a regular expression. asubje...
...se, the url can be obtained from arequest.name. make sure you access it from inside the state validation if condition. there may be other cases where accessing this property will throw an exception. canceling the request works just like with onlocationchange. see "recognizing page load failure" at mozilla.dev.extensions for tips on detecting connection failures and http response codes. x
pcom solutions there are a couple more solutions you may be interested in trying if the previous ones are insufficient. these require creating x
pcom components that implement existing firefox interfaces. they may be useful in case you have most of your application logic in x
pcom, or if you absolutely need a single point of inspection for loads. the previously explained solutions are enough for most...
...And 3 more matches
JavaScript Object Management - Archive of obsolete content
space is declared using var. we need the namespace to be a global object that it can be used everywhere in the window chrome. you can include functions in any namespace, since namespaces are just regular js objects. that should come in handy when you have general utility functions or properties that you want to use across all objects within the namespace. for instance, there are frequently used x
pcom services such as the observer service that can be included as members in the namespace: /** * 〈namespace〉 namespace. */ if (typeof 〈namespace〉 == "undefined") { var 〈namespace〉 = { /** * initializes this object. */ init : function() { this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); } }; 〈nam...
...rameter. in this case we set the delay to 0, which means the function should be executed as soon as possible. firefox has a minimum delay of 10-15ms (taken from this blog post), so it won't really run instantly. it is more than enough to let the window finish its load. use window.settimeout and window.setinterval to control timed code execution. in case you're using javascript code modules or x
pcom objects, where a window object is not readily available, use an nsitimer instead. this post suggests a way to achieve a true zero ms timeout, as a simple way to achieve parallelism in js code. notice the way we send callback functions as parameters, and the use of an alternate reference for this which we always name that. this is all necessary due to a javascript feature (quirk would be a ...
...windows open; never assume everything will work the same as with a single window. now, in most cases you'll need to coordinate data in a way that it is consistent for all open firefox windows. there are several ways in which you can do this. preferences is one of them, and they are covered in another section of this tutorial. two other ways are javascript code modules (firefox 3 and above), and x
pcom. javascript code modules javascript code modules (also known as jsm) are new to firefox 3, and they're the best tool for keeping everything in sync between windows. they're very simple to set up. the first thing you need to do is add an entry in the chrome.manifest file: resource xulschoolhello modules/ javascript code modules are accessed with the resource protocol, which is very...
...And 3 more matches
A XUL Bestiary - Archive of obsolete content
ans the xul content and structure, plus the css skin, plus whatever localization and platform-specific files are part of that xul interface. by contrast, the skin is just the css and referenced graphics for a xul file, the localization strings are just a dtd, and the content is just the xul. the chrome url this concept of a chrome as an integrated, dynamic thing in some way divorced from the "ap
pcore" is realized in the use of the chrome url to point to chunks of xul and their related files. the chrome url, which appears in place of the http url in pointers like the following global skin processing instruction: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> specifies a chrome to be loaded by the gecko rendering engine. in the example above, the chrome is simply a skin f...
...ed in the application object model in the hierarchy of xul widgets: browser, menu, menuitem, and so on. the dom and the aom form a kind of continuum, the whole of which is manipulable from the standards upon which xul is based. near synonyms for xul there is much confusion about the words that begin with "x" in the mozilla open source project. the mozilla xparchitecture section below describes x
pcom, xpidl, and x
pconnect, three somewhat related technologies for getting access to application code from the interface. this section describes xul, xptoolkit, and xpfe, which are in some respects synonymous and in others quite different. in briefest terms, xul is the xml-based language used for creating interfaces, xptoolkit is the set of xul widgets (menus, toolbar, etc.) actually assembed for ...
... like socket interfaces, editing, mail/news, security. the technologies that make this possible are perhaps the least understood of the phalanx of innovations that is mozilla. in addition to the small matter of programming these serious things in c++ and compiling them platform for platform, the architects and developers of mozilla use three "xp" technologies to link the core with the interface. ...
...And 3 more matches
Index - Archive of obsolete content
how to implement a custom xul query processor component xul supports templating to create a block of content from a datasource query. the xul template guide has lots of detailed information on using xul templates. xul provides template query processors for rdf, xml and sql (mozstorage). the templating system also supports building custom query processors. ...
...stem also supports building custom query processors. custom query processors are x
pcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component. 436 index found 1218 pages: 437 international characters in xul javascript firefox, gecko, guide, internationalization, javascript, mozilla, x
pcom, xul gecko 1.8, as used in firefox 1.5 and other applications, added support for non-ascii characters in javascript files loaded from xul files. 438 introduction to xul guide, xul mozilla has configurable, downloadable chrome, meaning that the arrangement and even presence or absence of controls in the main window is not hardwired into the application, but loaded from...
... 596 other resources xul no summary! 597 popup guide xul, xul popup guide no summary! 598 contextmenus xul, xul popup guide a context menu is a menu where the items on the menu are specific to the context in which the menu was opened. a typical usage is for the user to right-click on an element to display a menu of command...
...And 3 more matches
Using SOAP in XULRunner 1.9 - Archive of obsolete content
since the native soap interface was removed from gecko 1.9, those stuck speaking to soap apis need a new place to turn. after some experimentation, the following seems to be the best way to speak soap in xulrunner. several alternatives were considered: soa
pclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested. it requires servers to support wsdl which took it out of the running. xulrunner 1.8.* - using an old xulrunner is certainly an option but brings up a host of speed, stability and memory issues. manual implementation - the author doesn't know enough about soap to implement a robust client in an afternoon. the best solution proved to be jqsoa
pclient. this library doesn't require a wsdl. though jquery is liste...
...nner is certainly an option but brings up a host of speed, stability and memory issues. manual implementation - the author doesn't know enough about soap to implement a robust client in an afternoon. the best solution proved to be jqsoa
pclient. this library doesn't require a wsdl. though jquery is listed as a dependency, it can be worked around easily. ...
...query is listed as a dependency, it can be worked around easily. ...
...And 3 more matches
What XULRunner Provides - Archive of obsolete content
the goal of xulrunner is to provide a solution for deploying xul applications (primarily firefox and thunderbird), as well as providing an embedding mechanism. ...
...see the wikimo:xul:installation story. ...
...erface for installing, uninstalling, and upgrading xul applications. see the wikimo:xul:installation story. ...
...And 3 more matches
RDF in Mozilla FAQ - Archive of obsolete content
urce. datasources may be loaded via the rdf service using the getdatasource() method. if the uri argument refers to an rdf/xml file's url, then the rdf service will create an rdf/xml datasource and asynchronously parse it. the datasource will remain "cached" until the last reference to the datasource is released. if the uri argument refers to a built-in datasource, the rdf service will use the x
pcom component manager to load a component whose contractid is constructed using the "special" uri and the well-known prefix@mozilla.org/rdf/datasource;1?name=</code>. for example, rdf:foo would load: @mozilla.org/rdf/datasource;1?name=foo as with rdf/xml datasources, a datasource that is retrieved this way is "cached" by the rdf service until the last reference is dropped. how do i create a...
...] .getservice(components.interfaces.nsirdfservice); // ...and from it, get the datasource. make sure that your web server // dishes it up as text/xml (recommended) or text/rdf! var ds = rdf.getdatasource("http://www.mozilla.org/some-rdf-file.rdf"); // note that ds will load asynchronously, so assertions will not // be immediately available alternatively, you can create one directly using the x
pcom component manager, as the following code fragment illustrates: // create an rdf/xml datasource using the x
pcom component manager var ds = components .classes["@mozilla.org/rdf/datasource;1?name=xml-datasource"] .createinstance(components.interfaces.nsirdfdatasource); // the nsirdfremotedatasource interface has the interfaces // that we need to setup the datasource. var remote = ds.que...
...rce. how do i access "built-in" datasources? a built-in datasource is a locally-installed component that implements nsirdfdatasource. for example, the bookmarks service. first, check here to make sure you will be allowed to access a built-in datasource. there are several security restrictions on accessing built-in datasources from "untrusted" xul and js. since a built-in datasource is just an x
pcom component, you can instantiate it directly using the x
pconnect component manager. // use the component manager to get the bookmarks service var bookmarks = components. classes["@mozilla.org/rdf/datasource;1?name=bookmarks"]. getservice(components.interfaces.nsirdfdatasource); // now do something interesting with it... if (bookmarks.hasassertion( rdf.getresource("http://home.netscap...
...And 3 more matches
Common causes of memory leaks in extensions - Extensions
this idea: if the user disables javascript globally or locally (such as by using an add-on like noscript), then using the content window functions won't work. problems in bootstrapped (restartless) add-ons bootstrapped extensions use a bootstrap.js compartment. if you put a reference to anything within this compartment into a long-lived window object (such as browser.xul), javascript module or x
pcom component, the bootstrap.js compartment will become a zombie. for example, the following code snippets — part of a bootstrap.js — will leak: function leakref() {} function modifydocument(document) { var a = document.createelement("a"); document.body.appendchild(a); // the new dom node holding a reference to leakref will prevent // that function object from being garbage collected...
... use an unload event listener: addeventlistener("unload", function() { services.obs.removeobserver(myobserver, "private-browsing"); }, false); in bootstrap.js (restartless add-ons) unregister your observer in your shutdown function: function shutdown() { // ... ...
...dd-ons) unregister your observer in your shutdown function: function shutdown() { // ... ...
...And 3 more matches
Debugging on Windows
tring=<mdata,s> nscautostring=<mdata,s> nsrect=x=<x,d> y=<y,d> width=<width,d>; height=<height,d> nsstaticatomwrapper=<mstaticatom->mstring,s> nsiatom=<mstring,su> ; the following are not necessary in vc8 nscomptr<*>=<mrawptr,x> nsrefptr=<mrawptr,x> nsautoptr=<mrawptr,x> after you have made the changes and saved the file, you will need to restart visual c++ for the changes to take effect. ...
...>=<mrawptr,x> nsrefptr=<mrawptr,x> nsautoptr=<mrawptr,x> after you have made the changes and saved the file, you will need to restart visual c++ for the changes to take effect. for x
pcom strings (the "external" string api) you can use the following values: ;; mozilla (1.9) ; internal strings nsastring_internal=<mdata,su>, length=<mlength,u> nsacstring_internal=<mdata,s>, length=<mlength,u> ; x
pcom strings nsastring=<nsstringcontainer.v,su>, length=<nsstringcontainer.d1,u> nsacstring=<nscstringcontainer.v,s>, length=<nscstringcontainer.d1,u> nsstringcontainer=<v,su>, length=<d1,u> nscstringcontainer=<v,s>, length=<d1,u> there is a more extensive version of this file in progress in autoexpforvc8. avoiding stepping into certain functions you can avoid stepping into certain functions, su...
...bugging output until you flush or close the file handle. disabling assertions there are basically two ways to disable assertions. one requires setting an environment variable, while the other affects only the currently running program instance in memory. environment variable there is an environment variable that can disable breaking for assertions. ...
...And 3 more matches
AddonManager
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 getstartu
pchanges(), addstartu
pchange(), and removestartu
pchange() 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 last time the application was running. startup_change_changed a list of add-ons that were detected as h...
...abled the last time the application was running. startup_change_enabled a list of add-ons that were detected as having become enabled during startup. this normally means the application determined that an application change has made the add-on compatible. this doesn't include add-ons that were pending becoming enabled the last time the application was running. ...
...nabled during startup. this normally means the application determined that an application change has made the add-on compatible. this doesn't include add-ons that were pending becoming enabled the last time the application was running. methods addstartu
pchange() adds an add-on change from the add-on changes list. this is used to build the lists of changed add-ons reported by the getstartu
pchanges() method. note: calling this method more than once for the same add-on will replace the last change that was recorded with the new one; an add-on can only appear once across all change types. void addstartu
pchange( in string changetype, in string id ); parameters changetype the type of change that occurred for the specified add-on. this can be one of the startup change types or ...
...And 3 more matches
Certificate functions
rsions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and later cert_addocspacceptableresponses mxr 3.6 and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 and later cert_cachecrl mxr 3.10 and later cert_clearocs
pcache mxr 3.11.7 and later cert_certchainfromcert mxr 3.2 and later cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr ...
... cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificaterequest mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocs
pcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoa...
... 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificaterequest mxr 3.2 and later cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocs
pcertid mxr 3.6 and later cert_destroyocsprequest mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_du
pcertificate mxr 3.2 and later cert_du
pcertlist mxr ...
...And 3 more matches
Bytecode Descriptions
constants undefined stack: ⇒ undefined push undefined. 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. ...
...: delete obj[key] step 5 in non-strict code. format: jof_elem, jof_checksloppy strictdelelem stack: obj, key ⇒ succeeded like jsop::delelem, but for strict mode code. pushtrue` on success, else throw a typeerror. format: jof_elem, jof_checkstrict hasown stack: id, obj ⇒ (obj.hasownproperty(id)) push true if obj has an own property id. note that obj is the top value, like jsop::in. this o
pcode is not used for normal js. self-hosted code uses it by calling the intrinsic hasown(id, obj). for example, object.prototype.hasownproperty is implemented this way (see js/src/builtin/object.js). format: jof_ic super superbase stack: callee ⇒ superbase push the superbase of the method callee. the superbase is callee.[[homeobject]].[[getprototypeof]](), the object where super property loo...
...trong hint that it's a packed array whose prototype is array.prototype. see js::optimizespreadcall. eval operands: (uint16_t argc) stack: callee, this, args[0], ..., args[argc-1] ⇒ rval perform a direct eval in the current environment if callee is the builtin eval function, otherwise follow same behaviour as jsop::call. all direct evals use one of the jsop::*eval instructions here and these o
pcodes are only used when the syntactic conditions for a direct eval are met. if the builtin eval function is called though other means, it becomes an indirect eval. direct eval causes all bindings in enclosing non-global scopes to be marked "aliased". the optimization that puts bindings in stack slots has to prove that the bindings won't need to be captured by closures or accessed using jsop::{get,...
...And 3 more matches
Components.Constructor
summary creates a javascript function which can be used to create or construct new instances of x
pcom components. syntax var func = [ new ] components.constructor(contractid [, interfacename [, initializer ] ]); parameters contractid a string containing the contract id of the component interfacename if given, nsisupports.queryinterface() will be called on each newly-created instance with the interface named by this string initializer if given, a string containing the name of a function which will be called on the newly-created instance, using the arguments provided to the created function when called description components.constructor() is a handy shortcut for creating instances of x
pcom components. it eliminates the clutter of typing components.classes, components.in...
...ion which will be called on the newly-created instance, using the arguments provided to the created function when called description components.constructor() is a handy shortcut for creating instances of x
pcom components. it eliminates the clutter of typing components.classes, components.interfaces, createinstance, and so on every time you wish to create an instance. it also gives creation of x
pcom objects more javascript-like syntax. ...
...instances of x
pcom components. it eliminates the clutter of typing components.classes, components.interfaces, createinstance, and so on every time you wish to create an instance. it also gives creation of x
pcom objects more javascript-like syntax. another important benefit is that it precomputes some of the computation it does, so using a function returned from components.constructor() to create x
pcom objects is faster than creating the object from base principles, as demonstrated below. (this benefit is also partly a result of having to travel through the layer between the javascript engine and x
pcom fewer times.) the behavior of functions returned by components.constructor() varies depending upon the arguments given to components.constructor() when called. if only one argument is given, t...
...And 3 more matches
Components.lastResult
most interfaces only return one success code -- ns_ok -- so components.lastresult is rarely necessary. ...
...most interfaces only return one success code -- ns_ok -- so components.lastresult is rarely necessary. ...
...most interfaces only return one success code -- ns_ok -- so components.lastresult is rarely necessary. ...
...And 3 more matches
Components object
ure. warning: this object is only intended for code running with chrome privileges. exposing the object to regular web code was a mistake. if you use this object on your web page, your site might break at any time! in current versions of firefox only a few interfaces required for compatibility are still accessible. don't use components! the components object is the object through which x
pconnect functionality is reflected into javascript. the components object is actually a native instance of the nsix
pccomponents interface which is reflected into javascript as a top level object using x
pconnect. some properties of components require advanced privileges and may not work in web pages. the components object has the following members: classes array of classes by contractid ...
...hich is reflected into javascript as a top level object using x
pconnect. some properties of components require advanced privileges and may not work in web pages. ...
... object using x
pconnect. some properties of components require advanced privileges and may not work in web pages. ...
...And 3 more matches
mozIRegistry
inct from your source code. and it happens that we've chosen, up till now, to store that information in the "netscape registry" file. which explains how this information came to be associated with the notion of a "registry." someday (i hope) this page will be properly titled so that everybody knows it is the place to come to in order to find out how they are supposed to link together the various x
pcom components that together form the mozilla browser. the information below is intended to tell you everything you need to know about how to do that. summary clients will rely on nsrepository to create instances of a given class. clients requiring dynamic "binding" of clsids will be required to use some higher-level services (tbd) to figure out the clsids they should use. the intent is that suc...
...ou need to know about how to do that. summary clients will rely on nsrepository to create instances of a given class. clients requiring dynamic "binding" of clsids will be required to use some higher-level services (tbd) to figure out the clsids they should use. the intent is that such services themselves be built on top of the new moziregistry interface. we are proposing a new "moziregistry" x
pcom interface that provides the same level of function as is currently provided by the "netscape registry" implemented in libreg. nsrepository will be modified to use this interface, thereby enabling alternative registry implementations to be substituted at run/link time. there will be two registry interface implementations: one based solely on libreg (for "compatibility") and a fancier rdf-based o...
...er add the information about it or at least put in a link to it's documentation. higher-level application components this box represents all the potential user's of the core registry/repository interfaces. your code (most likely) falls in this box. these components will, to various degrees, need to use other components to do their thing. those other components presumably implement particular x
pcom interfaces. so how do you go about creating an object that can provide the interface your component requires? one way is to create instances by using nsrepository. nsrepository is essentially a mapping from x
pcom clsids to class factories, plus code to manage that mapping, including functions that create instances of a given clsid. the nsrepository functions are declared in nsrepository.h. much...
...And 3 more matches
nsIContentViewer
2.7) implemented by: ?????????????????????????????????????. ...
...g/????????????????????????????"] .createinstance(components.interfaces.nsicontentviewer); method overview void clearhistoryentry(); void close(in nsishentry historyentry); void destroy(); [noscript,notx
pcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only! [noscript,notx
pcom] nsidocumentptr getdocument(); void hide(); void init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only! void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports astate, in nsishentry ashentry); void pagehide(in boo...
...id pagehide(in boolean isunload); boolean permitunload([optional] in boolean acallercloseswindow); boolean requestwindowclose(); void resetclosewindow(); void setbounds([const] in nsintrectref abounds); native code only! void setdocumentinternal(in nsidocumentptr adocument, in boolean aforcereuseinnerwindow); native code only! ...
...And 3 more matches
nsISHEntry
long index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation); native code only! ...
...ner, in unsigned long long docshellid, in boolean dynamiccreation); native code only! nsdocshelleditordataptr forgeteditordata(); violates the x
pcom interface guidelines nsicontentviewer getanycontentviewer(out nsishentry ownerentry); void getscrollposition(out long x, out long y); void getviewerbounds(in nsintrect bounds); native code only! ...
...es 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 x
pcom interface guidelines boolean hasdynamicallyaddedchild(); boolean isdynamicallyadded(); void seteditordata(in nsdocshelleditordataptr adata); violates the x
pcom interface guidelines void setissubframe(in boolean aflag); void setscrollposition(in long x, in long y); void settitle(in astring atitle); void setuniquedocidentifier(); void seturi(in nsiuri auri); void setviewerbounds(in nsintrect bounds); native code only! void syncpresentationstate(); attributes attribute type description cachekey nsisupports set and get the cache ...
...And 3 more matches
nsIServiceManager
x
pcom/components/nsiservicemanager.idlscriptable this interface provides a means to obtain global services in an application. the service manager depends on the repository to find and instantiate factories to obtain services. ...
...unlike createinstance, this will always return the same object each time it is called with the same arguments. void getservice( in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the service that is being requested. aiid the interface type to be returned. result the resu...
...id, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the service that is being requested. aiid the interface type to be returned. result the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indicates that the specified class is not registered. getservicebycontractid() this method returns a reference to a particular x
pcom service given the contractid of the service. void getservicebycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the service that is being requested. aiid the interface type to be returned. result the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indi...
...And 3 more matches
nsIVariant
x
pcom/ds/nsivariant.idlscriptable x
pconnect has magic to transparently convert between nsivariant and js types. we mark the interface [scriptable] so that js can use methods that refer to this interface. but we mark all the methods and attributes [noscript] since any nsivariant object will be automatically converted to a js type anyway. ...
...ributes [noscript] since any nsivariant object will be automatically converted to a js type anyway. ...
... autf8string getasautf8string(); native code only! prbool getasbool(); native code only! char getaschar(); native code only! domstring getasdomstring(); native code only! double getasdouble(); native code only! float getasfloat(); native code only! nsresult getasid(out nsid retval); violates the x
pcom interface guidelines print16 getasint16(); native code only! print32 getasint32(); native code only! print64 getasint64(); native code only! pruint8 getasint8(); native code only! void getasinterface(out nsiidptr iid, [iid_is(iid), retval] out nsqiresult iface); native code only! nsisupports getasisu...
...And 3 more matches
Element.classList - Web APIs
"+v[wsindex]+"') contains html space characters, which are not valid in tokens."); } // 2. ...
...uments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v!==arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("add", val); for (var i=0, len=proto.length, resstr=val; i !== len; ++i) if (this[i] === val) continue a; else resstr += " " + this[i]; this[len] = val, proto.length += 1, proto.value = resstr; } skippro
pchange = 1, ele.classname = proto.value, skippro
pchange = 0; }; domtokenlist.prototype.remove = function(){ for (var v=0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v !== arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("remove", val); for (var i=0, len=proto.length, resstr="", is=0; i !== len; ++i) i...
... ++v) { val = arguments[v] + "", checkifvalidclasslistentry("remove", val); for (var i=0, len=proto.length, resstr="", is=0; i !== len; ++i) if(is){ this[i-1]=this[i] }else{ if(this[i] !== val){ resstr+=this[i]+" "; }else{ is=1; } } if (!is) continue; delete this[len], proto.length -= 1, proto.value = resstr; } skippro
pchange = 1, ele.classname = proto.value, skippro
pchange = 0; }; window.domtokenlist = domtokenlist; function whenpro
pchanges(){ var evt = window.event, prop = evt.propertyname; if ( !skippro
pchange && (prop==="classname" || (prop==="classlist" && !defineproperty)) ) { var target = evt.srcelement, protoobjproto = target[" uclp"], strval = "" + target[prop]; ...
...And 3 more matches
RTCPeerConnection.addTrack() - Web APIs
io track and a video track, you don't need to deal with managing what track is in what stream, so you might as well just let the transceiver handle it for you. here's an example showing a function that uses getusermedia() to obtain a stream from a user's camera and microphone, then adds each track from the stream to the peer connection, without specifying a stream for each track: async opencall(
pc) { const gumstream = await navigator.mediadevices.getusermedia( {video: true, audio: true}); for (const track of gumstream.gettracks()) {
pc.addtrack(track); } } the result is a set of tracks being sent to the remote peer, with no stream associations. the handler for the track event on the remote peer will be responsible for determining what stream to add each...
... gumstream.gettracks()) {
pc.addtrack(track); } } the result is a set of tracks being sent to the remote peer, with no stream associations. the handler for the track event on the remote peer will be responsible for determining what stream to add each track to, even if that means simply adding them all to the same stream. the ontrack handler might look like this: let inboundstream = null;
pc.ontrack = ev => { if (ev.streams && ev.streams[0]) { videoelem.srcobject = ev.streams[0]; } else { if (!inboundstream) { inboundstream = new mediastream(); videoelem.srcobject = inboundstream; } inboundstream.addtrack(ev.track); } } here, the track event handler adds the track to the first stream specified by the event, if a stream is specified. otherwise, the f...
....track); } } here, the track event handler adds the track to the first stream specified by the event, if a stream is specified. otherwise, the first time ontrack is called, a new stream is created and attached to the video element, and then the track is added to the new stream. from then on, new tracks are added to that stream. ...
...And 3 more matches
Codecs used by WebRTC - Web media technologies
e peer to another, without a container or even a mediastream associated with the tracks. which codecs can be within those tracks is not mandated by the webrtc specification. however, rfc 7742 specifies that all webrtc-compatible browsers must support vp8 and h.264's constrained baseline profile for video, and rfc 7874 specifies that browsers must support at least the opus codec as well as g.711's
pcma and
pcmu formats. these two rfcs also lay out options that must be supported for each codec, as well as specific user comfort features such as echo cancelation. this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc. while compression is always a necessity when dealing with media on the web, it's of additional...
...ad" and "full frame freeze" sei messages; these are used to support switching among multiple input streams seamlessly. supported audio codecs the audio codecs which rfc 7874 mandates that all webrtc-compatible browsers must support are shown in the table below. mandatory audio codecs codec name browser compatibility opus chrome, edge, firefox, safari g.711
pcm (a-law) chrome, firefox, safari g.711
pcm (µ-law) chrome, firefox, safari see below for more details about any webrtc-specific considerations that exist for each codec listed above. it's useful to note that rfc 7874 defines more than a list of audio codecs that a webrtc-compliant browser must support; it also provides recommendations and requirements for special audio fea...
...nd monaural music (fb mono) 48 to 64 kbps full-band stereo music (fb stereo) 64 to 128 kbps the bit rate may be adjusted at any time. in order to avoid network congestion, the average audio bit rate should not exceed the available network bandwidth (minus any other known or anticipated added bandwidth requirements). g.711 g.711 defines the format for pulse code modulation (
pcm) audio as a series of 8-bit integer samples taken at a sample rate of 8,000 hz, yielding a bit rate of 64 kbps. both µ-law and a-law encodings are allowed. g.711 is defined by the itu and its payload format is defined in rfc 3551: 4.5.14. webrtc requires that g.711 use 8-bit samples at the standard 64 kbps rate, even though g.711 supports some other variations. neither g.711.0 (lossless compr...
...And 3 more matches
Handling Preferences - Archive of obsolete content
nce appear in about:config after installing the extension. just type "xulschool" in the filter box to see your new preference. note: always begin your preference names with "extensions", followed by some namespacing and finally the actual name of the preference. name parts are normally separated by dots. now let's look at how we actually manage the preference values. managing preferences with x
pcom we use the preferences service in order to get and set preference values: this._prefservice = cc["@mozilla.org/preferences-service;1"].getservice(ci.nsiprefbranch); // ... get count() { return this._prefservice.getintpref("extensions.xulschoolhello.message.count"); }, increment : function() { let currentcount = this._prefservice.getintpref("extensions.xulschoolhello.message.count"...
....message.count"); }, increment : function() { let currentcount = this._prefservice.getintpref("extensions.xulschoolhello.message.count"); this._prefservice.setintpref("extensions.xulschoolhello.message.count", currentcount + 1); } one important thing to keep in mind is that the "get" methods of the service can throw an exception if the preference is not found. ...
...is._prefservice.setintpref("extensions.xulschoolhello.message.count", currentcount + 1); } one important thing to keep in mind is that the "get" methods of the service can throw an exception if the preference is not found. if you are going to use x
pcom, you should always set a default value to your preferences, or use a try / catch block to prevent unhandled errors. ...
...And 2 more matches
Observer Notifications - Archive of obsolete content
« previousnext » sometimes you need your code to send a message to other parts of your code. for example, you might want to notify that a task is completed, and then several different actions must be performed. you could do that by calling all those functions directly, but x
pcom offers you a better and cleaner way to achieve that using observers and the observer service. an observer is an object that is responsible to observe (wait for) notifications and then to carry out subsequent actions. ...
... you a better and cleaner way to achieve that using observers and the observer service. an observer is an object that is responsible to observe (wait for) notifications and then to carry out subsequent actions. to create an observer, you need to implement the nsiobserver interface. the interface has only one method observe() which takes three parameters. the first parameter (subject) can be any x
pcom object, the second parameter is a notification topic, and the final parameter is a string that further describes the notification. this example code shows you what an implementation of the nsiobserver interface looks like: let testobserver = { observe : function(asubject, atopic, adata) { if (atopic == "xulschoolhello-test-topic") { window.alert("data received: " + adata); }...
...eobserver method. the method takes the observer object and notification topic as parameters. observerservice.removeobserver(testobserver, "xulschoolhello-test-topic"); after you have registered some observers to listen to a notification topic, you can then use the notifyobservers method to send a notification to all of them. the method takes three parameters. the first parameter can be any x
pcom object to pass to those observers (can be null), the second parameter is the notification topic and the last parameter is an additional string to pass to those observers (can be null). observerservice.notifyobservers(null, "xulschoolhello-test-topic", "hello"); non-chrome to chrome communication non-chrome to chrome communication is one of the main uses of observers. by non-chrome we mea...
...And 2 more matches
Setting Up a Development Environment - Archive of obsolete content
akefile specifies which profile folder the add-on will be reinstalled to. this is set in the profile_dir variable (set to "xulschool-dev" in this case). when creating a development profile for your add-on, make sure you choose an easy name for the profile folder, and set it in your makefile in order to take advantage of the install command. building idl files some extensions require developing x
pcom components to add certain advanced functions. there's a section dedicated to x
pcom in this tutorial, but we'll briefly discuss the impact it has on building the extension. you can skip this section and keep it present as a reference in case you do need to use x
pcom in your project. x
pcom interfaces are defined using idl files. these are text files that define the attributes and methods in one ...
...default executable path, and also add a variable called gecko_sdk, that points to your sdk build: export gecko_sdk=/path/to/your/sdk our build system should pick it up from there. to make it work in komodo in unix-based systems, we add the command to the .bash_login file in the home directory, and we modify the commands to this: bash -c ". ~/.bash_login; make" an example project with x
pcom components is included in the x
pcom section. there is also a mention about building c++ x
pcom, which is something much more complicated. signing extensions in order to provide additional security for your users, you can choose to add a signature to your extension. the signature verifies that you are the author of this extension, and it can only be done if you have a valid certificate provided...
...ery useful in this case. you can set breakpoints, step in and out of methods, and even get profiling information from javascript execution. you can inspect variables, keep track of watch expressions, and evaluate arbitrary js at any point in execution. this extension has seen little maintenance in quite some time, so it is very buggy. it is specially unreliable when debugging code in javascript x
pcom and xbl files. nevertheless, it is a valuable tool when trying to figure out why a certain function is misbehaving. tamper data tamper data intercepts http requests and their responses. it allows you to cancel them and even replace payload data before it is sent. there are several similar extensions, such as live http headers, but tamper data is the one that we use the most. we'll cover more ...
...And 2 more matches
Using Dependent Libraries In Extension Components - Archive of obsolete content
nsion-directory/components/interface2.xpt extension-directory/components/bsmedberg_stub.dll extensions/stub/makefile.in # copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> depth = ../.. ...
...tub/makefile.in # copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> depth = ../.. ...
... 2005 benjamin smedberg <benjamin@smedbergs.us> depth = ../.. ...
...And 2 more matches
RDF Datasource How-To - Archive of obsolete content
this document is a cookbook that describes how to create a native, client-side datasource that works with mozilla's rdf implementation. it supersedes (and borrows from) the original document put together by robert churchill. what is a datasource? the "rdf universe" consists of a set of statements about internet resources; for example, "my home page was last modified april 2nd", or "that news article was sent by bob". ...
... for examples of an implementation like this, look at the rdf/xml datasource or the bookmarks datasource. you may want to choose this implementation if your primary goal is to "wrap" a legacy data store. this implementation may cause problems if your data store can be modified "on the fly" by other agents. aggregate the in-memory datasource. this is an extreme case of delegation, where you use x
pcom aggregation to implement the nsirdfdatasource interface. see aggregating the in-memory datasource for technical details. if you take this approach, you won't be able to selectively implement methods of the nsirdfdatasource interface; instead, all of the methods will be "forwarded" to the in-memory datasource. this can be useful if your datasource is "read-only", and you aren't worried about mod...
...some outside agent (e.g., new mail arriving). you may also need to choose this implementation if the data set which your datasource is modeling is too large to fit in to memory (e.g., the entire file system structure). [more info on what each method needs to do here] rdf commands [describe what commands are, and why you'd implement them.] registering the datasource component a datasource is an x
pcom component. as such, it must (currently, see [1]) have: an x
pcom clsid to identify the data source implementation an implementation class (that corresponds to the clsid) whose code lives in a dll. the dll must be located in the x
pcom components directory a factory that is registered to an x
pcom progid in order to be instantiated from the repository. constructing a dll for a component is beyond...
...And 2 more matches
Building XULRunner with Python - Archive of obsolete content
this page describes how to build and use xulrunner with the python extension on windows and while generally useful it is written based on experiences with accessibility projects. see also xulrunner. or, if you are interested in working with xulrunner with python on linux, see mark lise's post with the python extensions enabled xulrunner provides python script access to the dom and x
pcom in addition to the usual java script. this gives access to python features and modules and builds on mark hammond's pyx
pcom work from active state. x
pcom components can also be created in python. currently (mar 07) python is not enabled by default so a custom build of mozilla is needed. this page provides instructions in the hope of eliminating much trial and error. you should also read the the developer d...
...of particular interested is access to msaa and iaccessible2 via the python comtypes package. ...
...is access to msaa and iaccessible2 via the python comtypes package. development machine setup first a word of warning that zonealarm has exhibited memory leaks that cause build machines to crash with rather spurious errors. you may want to uninstall it if you suspect this to be a problem. you will also want to disable any virus scanner resident monitoring as that will slow builds. ensure the
pc is running xp with all the latest service packs and patches applied. microsoft c++ compiler is required and whilst the current free version is visual studio 8 express (msvc8) you will almost certainly want to use visual studio .net 2003 (msvc71) which is not longer officially available. the issue is that xulrunner must be built with the same version of c as python and with python 2.5 that is msv...
...And 2 more matches
UI pseudo-classes - Learn web development
illing address fields are disabled by default. ...
...rm> <fieldset id="shipping"> <legend>shipping address</legend> <div> <label for="name1">name: </label> <input id="name1" name="name1" type="text" required> </div> <div> <label for="address1">address: </label> <input id="address1" name="address1" type="text" required> </div> <div> <label for="
pcode1">zip/postal code: </label> <input id="
pcode1" name="
pcode1" type="text" required> </div> </fieldset> <fieldset id="billing"> <legend>billing address</legend> <div> <label for="billing-checkbox">same as shipping address:</label> <input type="checkbox" id="billing-checkbox" checked> </div> <div> <label for="name" class="billing-label disabled-label">name: </label> <input id="name" name="name...
...the most relevant parts of this example are as follows: input[type="text"]:disabled { background: #eee; border: 1px solid #ccc; } .disabled-label { color: #aaa...
...And 2 more matches
Chrome registration
atically. interfaces interfaces component/mycomponent.xpt [flags] instructs mozilla to load interface information from a typelib file produced by xpidl. prior to firefox 4, files in the components directory were registered automatically. component component {00000000-0000-0000-0000-000000000000} components/mycomponent.js [flags] informs mozilla about a component cid implemented by an x
pcom component implemented in javascript (or another scripting language, if applicable). the classid {0000...} must match the classid implemented by the component. to generate a unique classid, use a uuid generator program or site. contract contract @foobar/mycontract;1 {00000000-0000-0000-0000-000000000000} [flags] maps a contract id (a readable string) to the classid for a specific implement...
.... osversion an extension or theme may need to operate differently depending on which version of an operating system is running. for example, a theme may wish to adopt a different look on mac os x 10.5 than 10.4: osversion>=10.5 abi if a component is only compatible with a particular abi, it can specify which abi/os by using this directive. the value is taken from the nsixulruntime os and x
pcomabi values (concatenated with an underscore). for example: binary-component component/mylib.dll abi=winnt_x86-msvc binary-component component/mylib.so abi=linux_x86-gcc3 see x
pcom abi for more details. platform (platform-specific packages) some packages are marked with a special flag indicating that they are platform specific. some parts of content, skin, and locales may be different based...
...component can only be loaded in the main process. note: extensions can't currently (bug 1131065) register components to load in the content process using the manifest file so this flag is largely useless to extension developers. component {09543782-22b1-4a0b-ba07-9134365776ee} maincomponent.js process=main component {98309951-ac89-4642-afea-7b2b6216bcef} contentcomponent.js process=content x
pcnativewrappers chrome packages can decide whether to use the x
pcnativewrapper security mechanism to automatically protect their code against malicious content that they might access. see safely accessing content dom from chrome for details. this flag is enabled by default since firefox 1.5. disabling it manually was possible by specifying x
pcnativewrappers=no until firefox 4. note: support for...
...And 2 more matches
Gecko SDK
the gecko sdk, also known as the xulrunner sdk, is a set of xpidl files, headers and tools to develop x
pcom components which can then in turn e.g. be accessed from xul using javascript. note that in order to develop such components, you do not need the full sources of e.g. firefox, since you do not access parts of the front end from within a component. furthermore, since a component contains basic functionality, it is intended to run with every product of the mozilla platform. therefore it makes no sense to use a particular product to build general functionality. that's the reason why the gecko sdk was devised. do not confuse the gecko/xulrunner sdk with xulrunner itself. ...
...ore, since a component contains basic functionality, it is intended to run with every product of the mozilla platform. therefore it makes no sense to use a particular product to build general functionality. that's the reason why the gecko sdk was devised. do not confuse the gecko/xulrunner sdk with xulrunner itself. the gecko sdk is a collection of header files and tools used to develop general x
pcom components which add functionality to the existing platform, whereas xulrunner is a framework which can be used to run standalone or embedded applications based on the mozilla framework. the gecko sdk contains all of the necessary tools and headers for making scriptable npapi plugins including the xpidl compiler/linker and the latest npapi.h. get the sdk updates there is no need to download...
... note: you can subscribe to a calendar of the firefox release schedule. also,...
...And 2 more matches
How to add a build-time test
t is written in c or c++ and which is called as a standalone executable, a few things must be done. for standalone executables, if one sets up the right variables, then the rules.mk file will do lots of magic and most of the heavy lifting. a simple example of adding a test is in . note that the following variables are supplied by the rules.mk file: cppsrcs, simple_programs, run_test_program. x
pcshell tests here are the simple guidelines for adding an x
pcshell test to the build system. for now, enclose your test-related code (in the makefile) with ifdef enable_tests run the test program from the "check" target in the makefile. (example to run the testcookie program) in the test program: if the test fails, exit with a non-zero status and/or print the string "fail" to stdout...
... fails, exit with a non-zero status and/or print the string "fail" to stdout if the test passes, exit with a zero status and don't print the string "fail" (bonus points for printing "pass" :) ) write the test so that you expect it to pass on all platforms, since if the test fails, the tree will go orange (once we've set this up - see bug 352240 for status). ...
...out if the test passes, exit with a zero status and don't print the string "fail" (bonus points for printing "pass" :) ) write the test so that you expect it to pass on all platforms, since if the test fails, the tree will go orange (once we've set this up - see bug 352240 for status). for example, to add an x
pcshell test to a module, do the following: copy tools/test-harness/x
pcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests. you can of course use unit or test if you're not feeling creative. in <tt>yourmoduledir/tests_type/makefile.in</tt> change depth, module, and x
pcshell_tests appropriately: depth should be a relative path pointing to <tt>mozilla/</tt>, e.g. if you're in <tt>netwerk/test</tt>, set depth =...
...And 2 more matches
JavaScript Tips
xul tips when inserting code with an xul overlay, wrap functions and variables inside an object with a unique name to avoid conflicting with existing or future function and variable names. var uniquename = { _privatemember: 3, publicmember: "a string", init: function() { this.dosomething(this.anothermember); }, dosomething: function(aparam) { alert(aparam); } }; x
pconnect don't use object methods and properties more than you have to. it is often faster to store the result in a temporary variable. don't call methods that you don't have to. for instance, windowmanager.getenumerator(atype).hasmoreelements() may be replaced with windowmanager.getmostrecentwindow(atype) != null for a single window. don't query interfaces unless you need to access methods and...
...erfaces in both cases). don't call queryinterface unless you expect to succeed. instead, use instanceof, e,g,: if (target instanceof components.interfaces.nsirdfresource) return target.value; if (target instanceof components.interfaces.nsirdfliteral) return target.value; return null; don't test the return value of queryinterface, it always returns the original variable if it succeeds. x
pconnect knows all about tearoffs and modifies the object that you queryinterface or instanceof to cache all its known interfaces. when passing an object to an x
pcom method it is helpful if the object you pass is an x
pcom object, so that the c++ method access a c++ object. however, this is not always necessary or desirable. for instance the offline observer declared above is a javascript object tha...
...aroffs and modifies the object that you queryinterface or instanceof to cache all its known interfaces. when passing an object to an x
pcom method it is helpful if the object you pass is an x
pcom object, so that the c++ method access a c++ object. however, this is not always necessary or desirable. for instance the offline observer declared above is a javascript object that is registered with an x
pcom object, so that the call back from x
pcom executes the javascript method. some x
pcom methods expect an object that implements several interfaces thus requiring you to write a queryinterface method. however, in javascript this is quite simple even in the case of a weak reference which in c++ requires a helper class: var weakobserver = { queryinterface: function queryinterface(aiid) { if (...
...And 2 more matches
DMD
eap these blocks represent. within each section, records are listed from largest to smallest. once-reported and twice-reported stack trace records also have stack traces for the report point(s). ...
... have stack traces for the report point(s). ...
...njn/moz/mi2/x
pcom/base/nscyclecollector.cpp:3008) 0x7f6860fdfe02 #03: nspurplebuffer::sizeofexcludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi2/x
pcom/base/nscyclecollector.cpp:933) 0x7f6860fdb7af #04: nscyclecollector::sizeofincludingthis(unsigned long (*)(void const*), unsigned long*, unsigned long*, unsigned long*, unsigned long*, unsigned long*) const (/home/njn/moz/mi2/x
pcom/base/nscyclecollector.cpp:3029) 0x7f6860fdb6b1 #05: cyclecollectormultireporter::collectreports(nsimemorymultireportercallback*, nsisupports*) (/home/njn/moz/mi2/x
pcom/base/nscyclecollector.cpp:3075) 0x7f6860fde432 #06: nsmemoryinfodumper::dumpmemoryreportstofileimpl(nsastring_internal const&) (/home/njn/moz/mi2/x
pcom/base/nsmemoryinfodumper.cpp:626) 0x7f6860fece79 #07: nsmemoryinfodumper...
...And 2 more matches
Index
alue list contains various attributes of the platform. the platform string is in the format system name:os release:architecture. the installer obtains these values from nspr. os release is an empty string on non-unix operating systems. ...
...utes of the platform. the platform string is in the format system name:os release:architecture. the installer obtains these values from nspr. os release is an empty string on non-unix operating systems. ...
...xtension to the certificate. x.509 certificate extensions are described in rfc 5280. --extcp add the certificate policies extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extpm add the policy mappings extension to the certificate. x.509 certificate extensions are described in rfc 5280. --ext
pc add the policy constraints extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extia add the inhibit any policy access extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extskid add the subject key id extension to the certificate. x.509 certificate ...
...And 2 more matches
sslcrt.html
certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. validating certificates manipulating certificates getting certificate information comparing secitem objects validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cm
pcertchainwcanames cert_verifycertnow checks that the current date is within the certificate's validity period and that the ca signature on the certificate is valid. syntax #include <cert.h> secstatus cert_verifycertnow( certcertdbhandle *handle, certcertificate *cert, prbool checksig, seccertusage certusage, void *wincx); parameters this function has the following paramet...
...t to check against. t the time to check against the certificate's validity period. for more information, see the nspr header pr_time.h. ...
... returns the function returns an enumerator of type seccerttimevalidity: typedef enum { seccerttimevalid, seccerttimeexpired, seccerttimenotvalidyet } seccerttimevalidity; nss_cm
pcertchainwcanames determines whether any of the signers in the certificate chain for a specified certificate are on a specified list of ca names. syntax #include <nss.h> secstatus nss_cm
pcertchainwcanames( certcertificate *cert, certdistnames *canames); parameters this function has the following parameters: cert a pointer to the certificate structure for the certificate whose certificate chain is to be checked. canames a pointer to a structure that contains a list of d...
...And 2 more matches
Tracing JIT
nitoring, recording, or executing. the transitions between these states are somewhat complex and delicate, but the overall picture is simple: monitoring the trace monitor's initial state is monitoring. this means that spidermonkey is interpreting bytecode. every timespidermonkey interprets a backward-jump bytecode, the monitor makes note of the number of times the jump-target program-counter (
pc) value has been jumped-to. this number is called the hit count for the
pc. if the hit count of a particular
pc reaches a threshold value, the target is considered hot. when the monitor decides a target
pc is hot, it looks in a hashtable of fragments to see if there is a fragment holding native code for that target
pc. if it finds such a fragment, it transitions to executing mode. otherwise it tr...
...asked to record a bytecode that it cannot, for various low-level reasons, faithfully record, the recorder may choose to abort the recording. aborting a recording is always an option in tracemonkey, and on abort the monitor simply discards the recorder and its fragment and returns to monitoring mode. the monitor also keeps track of how many times it has attempted to record a trace starting at each
pc value, so if a particular
pc causes too many aborted recordings, the monitor blacklists the
pc and will not attempt recording it any longer. if the recorder completes recording at a backward branch back to the initial
pc value that triggered recording mode, it is said to have successfully closed the loop. a closed loop is passed through the nanojit assembler and thereby compiled to native machin...
...rpreted. the compiled fragment of code returned to the monitor on successful loop-close is called a trace. if the recorder is asked to record a bytecode that implies a call to a native function elsewhere in spidermonkey -- some helper function written in c -- and that native happens to re-enter the interpreter to interpret yet more bytecode, and furthermore if that bytecode itself contains a hot
pc that has not yet been traced, the trace monitor may be asked to begin nested recording. this is the same as normal recording mode, except that the outermost recorder is placed on a deferred-abort stack. when the innermost recorder completes -- successfully or otherwise -- every recorder on the deferred abort stack is aborted. this process is called deep aborting the suspended recorders. executi...
...And 2 more matches
Introduction to the JavaScript shell
.]) displays brief help information about the specified commands, or about all available functions if none are specified. intern(string) internalizes the specified string into the atom table. every string has a unique identifier, called an atom. this system makes it easier to do comparisons between strings. note: this function is intended only for use when testing the javascript engine. line2
pc([function, ] line) returns the program counter value corresponding to the specified line of code. if function is specified, line is an offset into the specified function. load(filename1 [filename]) loads the javascript files with the specified names. note: for loading non-javascript files, use read(). options([option ...]) lets you set or get options. if you specified options on the command...
...lts of calling options will indicate which options you requested. you can also pass in new options to set. the available options are: option name description strict strict mode is enabled. werror warnings should be treated as errors. atline when atline is enabled, comments of the form //@line num set the number of the following line to num.
pc2line(function, [
pc]) returns the line number of the javascript code that corresponds to the first line of the specified function. if you specify a program counter offset into the function, the line number of the line of code containing that offset is returned. print([expression ...]) evaluates the expression(s) and displays the result(s) on stdout, separated by spaces (" ") and terminated by a...
...ed in spidermonkey 1.8 only in js_threadsafe builds. sleep for dt seconds. fractions of a second are supported. returns true on success, false if the sleep was interrupted. stackquota([number]) get or set the script stack quota. throwerror() throws an error from the js_reporterror() function. note: this function is intended only for use when testing the javascript engine. trap([function, [
pc,]] expression) sets a trap at the specific point in the javascript code. when the bytecode at the offset specified by
pc in the function function is about to be executed, the expression is evaluated. this is a powerful debugging mechanism when used in concert with line2
pc(). for example, if you want to display a message when line 6 of a function, dosomething() is executed, you can enter the fol...
...And 2 more matches
JSDBGAPI
the jsdbg api is obsolete and has been removed in spidermonkey 35. see bug 1069694. ...
... the jsdbg api is obsolete and has been removed in spidermonkey 35. see bug 1069694. ...
...e jsdbg api is obsolete and has been removed in spidermonkey 35. see bug 1069694. ...
...And 2 more matches
Building the WebLock UI
in this chapter, however, we are going to be building a user interface for the weblock component that's meant to be added to the existing mozilla browser[other-mozlike-browsers]. ...
...arkup map to widgets in the interface that gecko renders in a fairly straightforward way - so, for instance, the root element of an application window is the element <window/>, the root element of the dialog we'll be creating here is <dialog/>, and so forth. ...
...- so, for instance, the root element of an application window is the element <window/>, the root element of the dialog we'll be creating here is <dialog/>, and so forth. within a xul application file, elements like <button/>, <menu/>, and <checkbox/> can be hooked up to an event model, to scripts, and to the x
pcom interfaces that carry out a lot of the browser functionality in mozilla. in using x
pcom components you saw how x
pcom objects are reflected into the interface layer as javascript objects. in this chapter, now that we've created the weblock component and made it available to x
pcom, we create the ui that actually instantiates the weblock component and uses its methods to control page loading in the browser. in the previous section, we outlined the javascript that interacts with the ...
...And 2 more matches
Components.utils.import
see using javascript code modules for more details. note: prior to gecko 2.0, javascript code modules could only be loaded using file: or resource: urls. gecko 2.0 adds support for loading modules from chrome: urls, even those inside jar archives. ...
...ays provide a scope. in case of doubt, this is generally a good scope. return value the module's global object. use of the return value is discouraged since it grants access to the module's internal properties which are not part of its public api. import throws if it encounters an error (like a syntax error) in the file it reads. example components.utils.import("resource://gre/modules/x
pcomutils.jsm", this); difference from mozijssubscriptloader the differences from mozijssubscriptloader: the behavior when importing/loading the same code from different locations: the subscript loader evaluates the specified code each time it is invoked, with the caller's global object. components.utils.import evaluates the code of each module only once, in its own scope. for example: va...
...ns: the subscript loader evaluates the specified code each time it is invoked, with the caller's global object. components.utils.import evaluates the code of each module only once, in its own scope. ...
...And 2 more matches
NS_ConvertASCIItoUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... methods constructors void ns_convertasciitoutf16(const char*) - source parameters char* acstring void ns_convertasciitoutf16(const char*, pruint32) - source parameters char* acstring pruint32 alength void ns_convertasciitoutf16(const nsacstring_internal&) - source parameters nsacstring_internal& acstring ...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
NS_ConvertUTF16toUTF8
class declaration a helper class that converts a utf-16 string to utf-8 method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowerca...
... methods constructors void ns_convertutf16toutf8(const prunichar*) - source a helper class that converts a utf-16 string to utf-8 parameters prunichar* astring void ns_convertutf16toutf8(const prunichar*, pruint32) - source parameters prunichar* astring pruint32 alength void ns_convertutf16toutf8(const nsastrin...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
NS_ConvertUTF8toUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... methods constructors void ns_convertutf8toutf16(const char*) - source parameters char* acstring void ns_convertutf8toutf16(const char*, pruint32) - source parameters char* acstring pruint32 alength void ns_convertutf8toutf16(const nsacstring_internal&) - source parameters nsacstring_internal& acstring o...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
NS_LossyConvertUTF16toASCII
class declaration a helper class that converts a utf-16 string to ascii in a lossy manner method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequal...
... methods constructors void ns_lossyconvertutf16toascii(const prunichar*) - source a helper class that converts a utf-16 string to ascii in a lossy manner parameters prunichar* astring void ns_lossyconvertutf16toascii(const prunichar*, pruint32) - source parameters prunichar* astring pruint32 alength void ns_los...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
nsAdoptingCString
of what's given, and make what's given forget its value. note that this class violates constness in a few places. ...
... methods constructors void nsadoptingcstring() - source void nsadoptingcstring(char*, pruint32) - source parameters char* str pruint32 length void nsadoptingcstring(const nsadoptingcstring&) - source parameters nsadoptingcstring& str operator= nsadoptingcstring& operator=(const nsadoptingcstring&) - sou...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
nsAdoptingString
e value of what's given, and make what's given forget its value. note that this class violates constness in a few places. ...
... methods constructors void nsadoptingstring() - source void nsadoptingstring(prunichar*, pruint32) - source parameters prunichar* str pruint32 length void nsadoptingstring(const nsadoptingstring&) - source parameters nsadoptingstring& str operator= nsadoptingstring& operator=(const nsadoptingstring&) - s...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
nsAutoString
ch may be wasted if the string it contains is significantly smaller or any larger than 64 characters. ...
... methods constructors void nsautostring() - source constructors void nsautostring(prunichar) - source parameters prunichar c void nsautostring(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void nsautostring(const nsautostring&) - source parameters nsautostring& str vo...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
nsCAutoString
s. ...
... methods constructors void nscautostring() - source constructors void nscautostring(char) - source parameters char c void nscautostring(const char*, pruint32) - source parameters char* data pruint32 length void nscautostring(const nscautostring&) - source parameters nscautos...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source ...
...And 2 more matches
nsCString
: nsstring for wide characters nscstring for narrow characters this class is also known as nsaflat[c]string, where "flat" is used to denote a null-terminated string. ...
... methods constructors void nscstring() - source constructors void nscstring(char) - source parameters char c void nscstring(const char*, pruint32) - source parameters char* data pruint32 length void nscstring(const nscstring&) - source parameters nscstring& str void nscstring(const nscsubstringt...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
nsDependentCString
of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
... methods constructors nsdependentcstring(const char*, const char*) - source parameters char* start a pointer to the start of the string. must not be null. char* end a pointer to the string's null terminator. must not be null. nsdependentcstring(const char*, pruint32) - source parameters char* data a pointer to the string. m...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
nsDependentString
the creator of objects of this type must take care to ensure that a nstdependentstring continues to reference valid memory for the duration of its use. ...
... methods constructors void nsdependentstring(const prunichar*, const prunichar*) - source constructors parameters prunichar* start prunichar* end void nsdependentstring(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void nsdependentstring(const prunichar*) - source parameters prun...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
nsFixedCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
... methods constructors void nsfixedcstring(char*, pruint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (optional) the length of the string already contained in the buffer parameters c...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
nsFixedString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... methods constructors void nsfixedstring(prunichar*, pruint32) - source @param data fixed-size buffer to be used by the string (the contents of this buffer may be modified by the string) @param storagesize the size of the fixed buffer @param length (optional) the length of the string already contained in the buffer parameters...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
nsPromiseFlatCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
... methods constructors void nspromiseflatcstring(const nsacstring_internal&) - source parameters nsacstring_internal& str void nspromiseflatcstring(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple operator= nscstring& operator=(const nscstring&) - source parameters nscstring& str nsac...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
nsPromiseFlatString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
... methods constructors void nspromiseflatstring(const nsastring_internal&) - source parameters nsastring_internal& str void nspromiseflatstring(const nssubstringtuple&) - source parameters nssubstringtuple& tuple operator= nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_inte...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
nsString
heap. names: nsstring for wide characters nscstring for narrow characters this class is also known as nsaflat[c]string, where "flat" is used to denote a null-terminated string. ...
... methods constructors void nsstring() - source constructors void nsstring(prunichar) - source parameters prunichar c void nsstring(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void nsstring(const nsstring&) - source parameters nsstring& str void nsstring(const n...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
nsXPIDLCString
lloc, such as "out string" parameters in xpidl. ...
... methods constructors void nsxpidlcstring() - source void nsxpidlcstring(const nsxpidlcstring&) - source parameters nsxpidlcstring& str operator const char* char* operator const char*() const - source operator[] char operator[](print32) const - source parameters print32 i char operator[](pruint32) con...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(char, char) - source swaps occurence...
...And 2 more matches
nsXPIDLString
th ns_alloc, such as "out string" parameters in xpidl. ...
... methods constructors void nsxpidlstring() - source void nsxpidlstring(const nsxpidlstring&) - source parameters nsxpidlstring& str operator const prunichar* prunichar* operator const prunichar*() const - source operator[] prunichar operator[](print32) const - source parameters print32 i prunichar oper...
... @param aset -- characters to be cut from this parameters char* aset stripwhitespace void stripwhitespace() - source this method strips whitespace throughout the string. replacechar void replacechar(prunichar, prunichar) - source swaps...
...And 2 more matches
Building an Account Manager Extension
step 1: implementing nsiaccountmanagerextension as first step we have to implement the nsiaccountmanagerextension. we name the extension "devmo-account" and state that it is located in the chrome package "example@mozilla.org". furthermore we show the new panel only for imap accounts... ...
... constructor function devmoaccountmanagerextension() {}; // class definition devmoaccountmanagerextension.prototype = { name : "devmo-account", chromepackagename : "example@mozilla.org", showpanel: function(server) { //this panel is only shown for imap accounts... if (server.type == \"imap\") return true; return false; }, queryinterface: x
pcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextension ]) } step 2: building a component we convert the interface to a x
pcom component and register it in the component manager as account manager extension. therefore we add the following code to the previous. the javascript file has to be saved either in the extension's or thunderbird's component directory. // def...
...countmanagerextension.prototype.classdescription = "devmo account manager extension"; // ... textual unique identifier or rendez-vous point in the category manager. ...
...And 2 more matches
Component; nsIPrefBranch
ranch at which to start enumerating the child preferences. pass in "" to enumerate all preferences referenced by this branch. acount optional from gecko 2.0 receives the number of elements in the array. achildarray receives the array of child preferences. getcomplexvalue() called to get the state of an individual complex preference. a complex preference is a preference which represents an x
pcom object that can not be easily represented using a standard boolean, integer or string value. void getcomplexvalue( in string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue ); parameters aprefname the complex preference to get the value of. atype the x
pcom interface that this complex preference represents. interfaces currently supported are: nsiloc...
... getintpref() called to get the state of an individual integer preference. long getintpref( in string aprefname, [optional] in long adefaultvalue ); parameters aprefname the integer preference to get the value of. ...
...storing data separately, for example in a flat file or an sqlite database. void setstringpref( in string aprefname, in utf8string avalue ); parameters aprefname the string preference to set. avalue the utf-8 string value to set the preference to. setcomplexvalue() called to set the state of an individual complex preference. a complex preference is a preference which represents an x
pcom object that can not be easily represented using a standard boolean, integer or string value. void setcomplexvalue( in string aprefname, in nsiidref atype, in nsisupports avalue ); parameters aprefname the complex preference to set the value of. atype the x
pcom interface that this complex preference represents. interfaces currently supported are: nsilocalfile nsisupportsstri...
...And 2 more matches
nsIPropertyBag
inherits from: nsisupports last changed in gecko 1.0 method overview nsivariant getproperty(in astring name); attributes attribute type description enumerator nsisimpleenumerator get a nsisimpleenumerator whose elements are nsiproperty objects. read only. methods getproperty() get a property value for the given name. nsivariant getproperty( in astring name ); parameters name the name to return the matching property. return value the property matching the given name. exceptions thrown ns_error_failure if a property with that name doesn't exist. ...
...rameters name the name to return the matching property. return value the property matching the given name. exceptions thrown ns_error_failure if a property with that name doesn't exist. examples get user agent information (operating system specifics. the window scope is not always accessible so the window.navigator cannot be accessed. ...
...perating system specifics. the window scope is not always accessible so the window.navigator cannot be accessed. ...
...And 2 more matches
nsISupports
nsrefcnt addref(); parameters none. return value an integer value that is generally ignored. queryinterface() the queryinterface method provides runtime type discovery. ...
...nsrefcnt addref(); parameters none. return value an integer value that is generally ignored. queryinterface() the queryinterface method provides runtime type discovery. ...
...nsrefcnt addref(); parameters none. return value an integer value that is generally ignored. queryinterface() the queryinterface method provides runtime type discovery. ...
...And 2 more matches
Using nsIDirectoryService
this implementation will allow you to get(), set(), define(), and undefine() nsifile. getting a location: most developers need to find where a file or directory is located. with nsdirectoryservice, there are two steps involved. first, you must know what the string key (or property) is that refers to this locations. header files containing known keys are listed in the known locations section of this document. bear in mind that this list is not static. components can add and remove locations at their will. ...
...e persistant flag allows you to specify if you want the nsdirectoryservice to cache this value. in most cases you would set this to be true. the interfaces for this can be found here. known locations the nsiproperties strings for currently defined locations can be found in: nsdirectoryservicedefs.h nsappdirectoryservicedefs.h nsxulappapi.h content formerly at http://www.mozilla.org/projects/x
pco...locations.html background the way in which mozilla components locate special files and directories has changed. in the past, this was done using nsifilelocator. this component was a problem for embedding applications. since it was a component and was loaded implicitly by many other components, it was difficult to customize. customizing the locations is important if, for example, your applicati...
...le, in seamonkey, the profile service is a provider for locations that are relative to the current profile. the caller asking for the file location, of course, doesn't need to know who the providers are. as a caller of the service, you never deal with the providers, only the service. defined locations the nsiproperties keywords that you will use to get locations are defined in two places. os and x
pcom level nsdirectoryservicedefs.h these locations are provided by x
pcom, are constant with the system, and and should not need customization. although you will not customize these locations, you may need to tell x
pcom where its /bin directory is. this is done by passing a directory to ns_initx
pcom or, for embedding, as the first parameter to ns_initembedding. the location of the components folder ...
...And 2 more matches
Mozilla technologies
projects hosted in the mercurial repositories can be searched and viewed online using searchfox, a fast indexed search engine that runs on aws.xml extrasthe xml extras module contains several features that allow developers to treat xml as data i.e. not as just another document format. ...
...e xml extras module contains several features that allow developers to treat xml as data i.e. not as just another document format. the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/x
pcom users. the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds.x
pcomx
pcom is a cross platform component object model, similar to microsoft com. ...
...rmat. the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/x
pcom users. the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds.x
pcomx
pcom is a cross platform component object model, similar to microsoft com. ...
...And 2 more matches
RTCPeerConnection: connectionstatechange event - Web APIs
ion object after a new track has been added to an rtcrtpreceiver which is part of the connection. the new connection state can be found in connectionstate, and is one of the strings in the rtcpeerconnectionstate enumerated type. ...
...pe. bubbles no cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection,
pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session. it simply calls an app-defined function called setonlinestatus() to update a status display. ...
...e no interface event event handler onconnectionstatechange examples for an rtcpeerconnection,
pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session. it simply calls an app-defined function called setonlinestatus() to update a status display. ...
...And 2 more matches
RTCPeerConnection.createDataChannel() - Web APIs
rror either the specified id is already in use or, if no id was specified, the webrtc layer was unable to automatically generate an id because all ids are in use. examples this example shows how to create a data channel and set up handlers for the open and message events to send and receive messages on it (for brievity, the example assumes onnegotiationneeded is set up). ...
... if no id was specified, the webrtc layer was unable to automatically generate an id because all ids are in use. examples this example shows how to create a data channel and set up handlers for the open and message events to send and receive messages on it (for brievity, the example assumes onnegotiationneeded is set up). ...
...handlers for the open and message events to send and receive messages on it (for brievity, the example assumes onnegotiationneeded is set up). ...
...And 2 more matches
RTCPeerConnection: negotiationneeded event - Web APIs
ing ice candidates through the signaling server. see signaling transaction flow in signaling and video calling for a description of the signaling process that begins with a negotiationneeded event. examples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. ...
...e signaling transaction flow in signaling and video calling for a description of the signaling process that begins with a negotiationneeded event. examples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. ...
... and video calling for a description of the signaling process that begins with a negotiationneeded event. examples in this example, we use addeventlistener() to create an event handler for negotiationneeded. its role is to create an sdp offer and send it through the signaling channel to the remote peer. ...
...And 2 more matches
RTCPeerConnection.removeStream() - Web APIs
versions have implemented it. if the signalingstate is set to "closed", an invalidstateerror is raised. if the signalingstate is set to "stable", the event negotiationneeded is sent on the rtcpeerconnection. ...
...invalidstateerror is raised. if the signalingstate is set to "stable", the event negotiationneeded is sent on the rtcpeerconnection. syntax rtcpeerconnection.removestream(mediastream); parameters mediastream a mediastream specifying the stream to remove from the connection. ...
...t to "stable", the event negotiationneeded is sent on the rtcpeerconnection. syntax rtcpeerconnection.removestream(mediastream); parameters mediastream a mediastream specifying the stream to remove from the connection. return value undefined. ...
...And 2 more matches
ARIA Test Cases - Accessibility
are several purposes for providing this information: help browser vendors provide correct implementations help at vendors provide correct implementations inform authors as to what actually works reliably in general we're testing with the latest public releases. however, where things don't work we may test with nightly builds if they are available, in order to show what is already fixed in u
pcoming releases. we can add more screen readers if people are willing to step up and provide test results for them. tested ua/at combinations: dragon 10 with firefox 3 and ie 8 beta 2 jaws 9 & 10 with firefox 3 jaws 9 & 10 with ie beta 2 nvda 0.6p2 with firefox 3 orca with firefox 3 window-eyes 7 with ie 8 beta 2 and firefox 3 voiceover (leopard) with safari 4.0.2 zoom (leopard) with sa...
...: when focus falls on a button, a screen reader speaks the text of the button plus alternative text of any images within the button (the accessible name of the button). the word "button" is also spoken before or after the accessible name. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-
pc mode, pass in v-
pc-mode also if the button's text is not provided via labelledby or label. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - toggle button buttons w...
... basic button above, plus if the state is pressed, at should indicate that when focus lands on the button and when toggling. at should indicate that it is a toggle button (not a regular button) markup used: role="button" aria-pressed="false" (or true) notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-
pc-mode, button's state is announced when pressed, or when toggling it to pressed. fail in v
pc mode. no indication is given that a button is pressed, or that it is pressed after activating it. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass ...
...And 2 more matches
Finding window handles - Archive of obsolete content
content windows (in tabs) do not have their own hwnds. typically the top level browser window hwnd has no children, although if there are windowed plugins (such as flash) visible in the window, they will have hwnds whose parent is the top level browser window hwnd. here is some simple code that can get access to mozilla window handles. this code can be used from external application or from an x
pcom component within an extension. finding the content window handle hwnd hcontent = 0; // first we need to find the main browser window hwnd hff = ::findwindowex(0, 0, "mozillauiwindowclass", 0); if (hff) { // next we step down through a fixed structure hwnd htemp; htemp = ::findwindowex(hff, 0, "mozillawindowclass", 0); htemp = ::findwindowex(htemp, 0, "mozillawindowclass",...
...ctypes.unsigned_int : ctypes.unsigned_long; var xid = card32; var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var gdkwindowptrstring = basewindow.nativehandle; var gdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var gdk...
...w* like this: var gdkwindow = ctypes.structtype('gdkwindow'); var gdkwindowptrstring = basewindow.nativehandle; var gdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); working with gdkwindow* gdkwindow* to xid var gdkwindow = ctypes.structtype('gdkwindow'); var gdkdrawable = ctypes.structtype('gdkdrawable'); var card32 = /^(alpha|hppa|ia64|p
pc64|s390|x86_64)-/.test(services.appinfo.x
pcomabi) ? ctypes.unsigned_int : ctypes.unsigned_long; var xid = card32; var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var gdkwindowptrstring = basewindow.nativehandle; var gdkwinptr = gdkwindow.ptr(ctypes.uint64(gdkwindowptrstring)); var gdkdrawptr = ctypes.cast(gdkwinptr, gdkdrawabl...
...face(ci.nsibasewindow); var gdkwindowptrstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var x11 = ctypes.open('libx11.so.6'); // types let guint32 = ctypes.uint32_t; let gdkwindow = ctypes.structtype('gdkwindow'); let gdkdrawable = ctypes.structtype('gdkdrawable'); let card32; if (/^(alpha|hppa|ia64|p
pc64|s390|x86_64)-/.test(services.appinfo.x
pcomabi)) { card32 = ctypes.unsigned_int; } else { card32 = ctypes.unsigned_long; } let xid = card32; //https://developer.gnome.org/gdk2/stable/gdk2-x-window-system-interaction.html#gdk-x11-drawable-get-xid var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var browserwindow_madeinto...
Install Manifests - Archive of obsolete content
n their manifests, you can set the extensions.strictcompatibility preference to true. note: starting in gecko 11.0, applications such as firefox will assume add-ons that have not been updated in a very long time are no longer compatible by default. targetplatform a string specifying a platform that the add-on supports. ...
...for extensions including binary (compiled) components, you should never use the os alone, but include the abi (s) that you compiled the components with. ...
... unpack a true or false value that tells the application whether the extension requires its files be unpacked into a directory in order to work or whether the extension can be loaded direct from the xpi. in versions before gecko 2.0 all extensions were unpacked, in gecko 2.0 and later the default is to not unpack. if an extension includes the following then it must request unpacking: binary x
pcom components plugins search plugins dlls loaded with ctypes dictionaries window icons examples <description about="urn:mozilla:install-manifest"> <em:id>extension@mysite.com</em:id> <em:unpack>true</em:unpack> ... </description> updatekey to ensure the security of update rdf data that is retrieved over plain http you must use a digital signature to verify the contents of the...
...listed or softblocked. %app_id% the id of the current application %app_version% the version of the application to check for updates for %current_app_version% the version of the current application %app_os% the value of os_target from the firefox build system, identifying the operating system being used. %app_abi% the value of the target_x
pcom_abi value from the firefox build system, identifying the compiler/architecture combination used to compile the current application. %app_locale% the current application's locale. %update_type% update_type_compatibility(32), update_type_newversion(64) %compatibility_mode% related to default to compatible, values could be normal, ignore or strict. exampl...
Appendix D: Loading Scripts - Archive of obsolete content
properties defined by scripts executing on the page // available to your sandbox script, use content.wrappedjsobject // instead. let context = content; // create the sandbox let sandbox = components.utils.sandbox(context, { // make properties of the context object available via the // script's global scope sandboxprototype: context, // wrap objects retrieved from the sandbox in x
pcnativewrappers. // this is the default action. wantxrays: true }); // the script that will be executed: let script = string(); // evaluate the script: components.utils.evalinsandbox(script, sandbox, // the javascript version "1.8", // the apparent script filename: "...
... 42); the following code will execute a simple script loaded from a local file in the same directory as the current script. the script will execute in the same security context as the current script and will have access to the same globals, but any new globals it creates will be accessible only to the script itself. objects passed out of the sandbox will not be wrapped in x
pcnativewrappers but will still be wrapped in inter-compartment proxies. const xmlhttprequest = components.constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsixmlhttprequest", "open"); function loadscript(name, context) { // create the sandbox let sandbox = components.utils.sandbox(context, {...
... the script's encoding */); the following code will execute a simple script loaded from a local file in the same directory as the current script. the script will execute in the same security context as the current script and will have access to the same globals, but any new globals it creates will be accessible only to the script itself. objects passed out of the sandbox will not be wrapped in x
pcnativewrappers but will still be wrapped in inter-compartment proxies. function loadscript(name, context) { // create the sandbox let sandbox = components.utils.sandbox(context, { sandboxprototype: context, wantxrays: false }); // get the caller's filename let file = components.caller.stack.filename; // strip off any prefixes added by the sub-script loader...
...d scripts into their own global contexts which run in their own threads. in order to ensure thread safety, these contexts are extremely limited, can't be passed javascript objects, and have no access to the dom. all communication between these contexts and outer contexts is marshalled through json encoding and decoding. chromeworkers also have access to ctypes and a limited number of thread safe x
pcom classes, but are otherwise limited to simple computation based on data passed via messages and xmlhttprequests. advantages asynchronous: workers execute asynchronously in their own threads, which means that they have limited risk of interfering with the main thread. they may safely perform synchronous xmlhttprequests or other intensive computation which would normally need to be broken up i...
Monitoring WiFi access points - Archive of obsolete content
code with universalx
pconnect privileges can monitor the list of available wifi access points to obtain information about them including their ssid, mac address, and signal strength. this capability was introduced primarily to allow wifi-based location services to be used by geolocation services. example this example simply displays a list of the available access points. ...
...ty was introduced primarily to allow wifi-based location services to be used by geolocation services. example this example simply displays a list of the available access points. ...
...points.length; i++) { var a = accesspoints[i]; d.innerhtml += "<p>" + a.mac + " " + a.ssid + " " + a.signal + "</p>"; } var c = document.getelementbyid("c"); c.innerhtml = "<p>" + count++ + "</p>"; }, onerror: function (value) { alert("error: " +value); }, queryinterface: function(iid) { netscape.security.privilegemanager.enableprivilege('universalx
pconnect'); if (iid.equals(components.interfaces.nsiwifilistener) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_error_no_interface; }, } netscape.security.privilegemanager.enableprivilege('universalx
pconnect'); var listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"]...
...> </head> <body> <div id="d"><p></p></div> <div id="c"><p></p></div> </body> </html> the nsiwifilistener object the first thing the code above does is to prototype the listener object that will be receiving notifications of changes to the access point list. this object is described in lines 11 through 40 in the code above. the onchange() method (lines 13 through 27) begins by enabling universalx
pconnect privileges, then clearing out the div (d) that will receive the updated list of access points. then the loop in lines 19-22 iterates over the list of access points received in the accesspoints array and adds them to the html in the div. then the c div is updated with the number of times the list has been refreshed. the onerror() method simply opens an alert that displays the error code rece...
Structure of an installable bundle - Archive of obsolete content
.js the bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf). note that other files and directories (e.g. chrome.manifest, components, defaults) in bootstrapped extensions are not processed by a supporting application. ...
...acilitate the first case, the extension/app loader has special sub-directories specifically for platform-specific files (starting with toolkit/gecko 1.8, firefox/thunderbird 1.5). the platform string is defined during the toolkit build process to a value unique for the combination of operating system, processor architecture and compiler. the format of the platform string is: {os_target}_{target_x
pcom_abi} all of the files which are loaded from the main extension directory are loaded from the subdirectory /platform/{platform string} if it exists. for example, if a plugin vendor wanted to make a plugin available for consumer computers running linux(of the form: /platform/linux*/), macintosh(of the form: /platform/darwin*/), and windows(of the form: /platform/win*/), it would provide the ...
...m string} if it exists. ...
...when default preferences are defined in several directories, the ones loaded later overwrite the earlier ones. official references for toolkit api structure of an installable bundle: describes the common structure of installable bundles, including extensions, themes, and xulrunner applications extension packaging: specific information about how to package extensions th...
GRE - Archive of obsolete content
la suite never supported a gre on mac. xulrunner: the new gre xulrunner is the new version of the gre, which not only allows embedding but is capable of bootstrapping entire xul applications such as firefox. xulrunner supports or is planned to support embedding on all three major platforms (windows, mac, and linux). finding and using a gre from application code avoid linking directly against x
pcom.dll if an application wishes to use the gre, it must take careful steps to ensure that it links against the proper libraries. if you link directly against x
pcom.dll/libx
pcom.so (x
pcom.lib import lib), your application will not launch unless x
pcom.dll is in your path. this prevents dynamically finding a compatible gre at runtime. find a compatible gre note: support for locating a standalone ...
... you link directly against x
pcom.dll/libx
pcom.so (x
pcom.lib import lib), your application will not launch unless x
pcom.dll is in your path. this prevents dynamically finding a compatible gre at runtime. find a compatible gre note: support for locating a standalone glue was removed in gecko 6.0. to find a compatible gre, you should use the function gre_getgrepathwithproperties() (declared in x
pcom/glue/standalone/nsx
pcomglue.h). this allows the embedder to specify what version(s) of gre are appropriate, and to specify any special features the gre must have (currently there are no special features defined). statically link to x
pcomglue.lib (the "standalone glue") the solution is to statically link against x
pcomglue.lib, also known as the "standalone glue" (see x
pcom glue). this library ...
...to specify what version(s) of gre are appropriate, and to specify any special features the gre must have (currently there are no special features defined). statically link to x
pcomglue.lib (the "standalone glue") the solution is to statically link against x
pcomglue.lib, also known as the "standalone glue" (see x
pcom glue). this library provides a layer of indirection between embedding code and x
pcom. to use the x
pcom glue, you must follow these steps: compile your code with x
pcom_glue defined. link with x
pcomglue.lib (not x
pcomglue_s.lib!). don't link against the nspr libs. find a compatible gre (see above). dynamically link to that gre using the x
pcomgluestartup() function. see environment variables below. initialize x
pcom and do your work; when finished, shut down x
pcom. unlink x...
...om. to use the x
pcom glue, you must follow these steps: compile your code with x
pcom_glue defined. link with x
pcomglue.lib (not x
pcomglue_s.lib!). don't link against the nspr libs. find a compatible gre (see above). dynamically link to that gre using the x
pcomgluestartup() function. see environment variables below. initialize x
pcom and do your work; when finished, shut down x
pcom. unlink x
pcom with x
pcomglueshutdown(). dependent libraries and environment variables the xulrunner gre is designed so that the embedder does not need to set any environment variables such as path or ld_library_path before calling x
pcomgluestartup(), because it dynamically loads the correct dependent libraries. unfortunately, the mozilla suite-based gre is not as forgiving, especially on linux. embedders ...
HTTP Class Overview - Archive of obsolete content
e may be out of date. it was last updated in 2002. this document provides an overview of the classes used by the mozilla http implementation. it's meant as a guide to developers wishing to understand or extend the mozilla http implementation. ...
...last updated in 2002. this document provides an overview of the classes used by the mozilla http implementation. it's meant as a guide to developers wishing to understand or extend the mozilla http implementation. ...
...a guide to developers wishing to understand or extend the mozilla http implementation. ...
...n cache holds references to frequently used services nshtt
pchannel implements nsihtt
pchannel talks to the cache initiates http transactions processes http response codes intercepts progress notifications nshtt
pconnection implements nsistreamlistener & nsistreamprovider talks to the socket transport service feeds data to its transaction object routes progress notifications nshtt
pconnectioninfo identifies a connection nshttptransaction implements nsirequest encapsulates a http request and response parses incoming data nshtt
pchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines...
The new nsString class implementation (1999) - Archive of obsolete content
in fact, it's very unlikely this is really the page you want. if you happen to see dbaron lying around somewhere, please direct him here so he can fix this message. in the meantime, try the x
pcom string guide—but note that that article bears a warning of its own! this document is intended to briefly describe the new nsstring class architecture, and discuss the implications on memory management, optimizations, internationalization and usage patterns. disclaimer: i absolutely hate string classes. no one has ever devised one that more than 2 programmers can agree on. so, why then am i proposing this? well, nsstring has served us well so far, but it's in need of a facelift. and x
pcom has really taken off, so nsstring needs to be brought into alignment. justification the nsstring cla...
...a few implementation details which need to be addressed and that are the subject of this document. ...
... static void ensurecapacity(nsstr...
...cter storage model. this will allow programmers to use the nsstring api's like a standard char* without incurring the 2-byte per character overhead. this class fully interoperates with nsstring, nsautostring and nsstrimpl. nsistring naturally we will need include an nsistring interface onto the nsstrimpl/nsstring classes. i won't repeat it's interface here since it is basically a restatement (in x
pcom terms) of the nsstring interface. usage patterns how to use these classes to increase the portability, thread and process safety of gecko, i suggest the following rules regarding the use of each of our string class derivatives: <center> string class</center> <center> where to use</center> nsstrimpl use to pass strings between modules who have ...
Providing Command-Line Options - Archive of obsolete content
you can learn more about how the command line is interpreted by looking at the documentation for the nsicommandline interface. ...
... * @param achromeurispec a string specifying the uri of the window to open. * @param aargument an argument to pass to the window (may be null) */ f...
...} // command line handler function commandlinehandler() { }; commandlinehandler.prototype = { classdescription: "myapphandler", // changeme: generate a unique id classid: components.id('{2991c315-b871-42cd-b33f-bfee4fcbf682}'), // changeme: change the type in the contractid to be unique to your application contractid: "@mozilla.org/commandlinehandler/general-startup;1?type=myapp", _x
pcom_categories: [{ category: "command-line-handler", // changeme: // category names are sorted alphabetically. typical command-line handlers use a // category that begins with the letter "m". entry: "m-myapp" }], queryinterface: x
pcomutils.generateqi([ ci.nsicommandlinehandler ]), /* nsicommandlinehandler */ handle : function clh_handle(cmdline) { try { ...
... should start at // character 24, and lines should be wrapped at // 72 characters with embedded newlines, // and finally, the string should end with a newline helpinfo : " -myapp open my application\n" + " -viewapp <uri> view and edit the uri in my application,\n" + " wrapping this description\n" }; var nsgetfactory = x
pcomutils.generatensgetfactory([commandlinehandler]); ...
Manifest Files - Archive of obsolete content
ome://browser/content/. the final field is the path where the files are located. this can be either a local file path using a file url or a jar archive using a jar url, which will be described in a moment. you can specify multiple packages by including another line in the manifest file. ...
...located. this can be either a local file path using a file url or a jar archive using a jar url, which will be described in a moment. you can specify multiple packages by including another line in the manifest file. the browser.manifest file used by firefox looks like this: content branding jar:browser.jar!/content/branding/ x
pcnativewrappers=yes content browser jar:browser.jar!/content/browser/ x
pcnativewrappers=yes overlay chrome://global/content/viewsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://global/content/viewpartialsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://browser/content/pageinfo.xul chrome://pippki/content/pageinfooverlay.xul two packages are listed here, 'branding' and 'browser'. three overlays are also specified, whic...
... same archive. for the 'tests' package created above, the files are not packaged into an archive, so a direct file path is used instead. this is good for development since you don't have to package up all the files every time you change them. however, when distributing an application or extension, you will want to package them into an archive to avoid having to install lots of smaller files. the x
pcnativewrappers=yes part at the end of the manifest line is a flag that may optionally be used. in javascript, it is possible for a web page to override built-in functions with their own code. if the x
pcnativewrappers flag is specified, it indicates that scripts running in a privileged context don't call these overridden versions, but the original built-in versions instead. otherwise, if an extensi...
...t the original built-in versions instead. otherwise, if an extension attempted to call the modified versions, it would likely not work properly, or worse, create a security hole. this flag was added to prevent this problem and should always be used for newer extensions, but is left out for older extensions that might not be compatible with the change. for more information about this feature, see x
pcnativewrapper. themes and locales the themes and locales, the syntax is similar as for content packages, but you also need to specify the content package you are providing a theme or locale for. for example: skin browser classic/1.0 jar:classic.jar!/skin/classic/browser/ locale browser en-us jar:en-us.jar!/locale/browser/ for these, the extra field has been added to indicate that the skin and loc...
Getting started with XULRunner - Archive of obsolete content
ion. there is an article with a more complicated approach to building xulrunner applications at creating xulrunner apps with the mozilla build system. if you need to change xulrunner itself or integrate it with external binaries you may need to read that article. step 1: download xulrunner you can find a download link on the main xulrunner page here on mdn. since we are not creating any binary x
pcom components, we only need to download and install the xulrunner runtime package, not the sdk. the xulrunner download for windows is a zip file, not a true install. as a developer, i like the idea that xulrunner only needs to be unzipped onto my machine. i am assuming that it doesn’t need to hook into my windows system and that’s a good thing. it also means that the xulrunner is portable so,...
... note: if you are using firefox build from ubuntuzilla repository, replace /usr/lib/firefox/platform.ini with /opt/firefox/platform.ini. step 2: install xulrunner on windows, unzip the archive someplace reasonable. i unzipped it to a new c:\program files\xulrunner folder. on the mac, extract the tar.bz2 archive...
... note: if you are using firefox build from ubuntuzilla repository, replace /usr/lib/firefox/platform.ini with /opt/firefox/platform.ini. step 2: install xulrunner on windows, unzip the archive someplace reasonable. i unzipped it to a new c:\program files\xulrunner folder. on the mac, extract the tar.bz2 archive, which contains x...
...here are 5 files in the folder structure: application.ini, chrome.manifest (2), prefs.js, and main.xul. the /chrome/chrome.manifest file is optional, but might be useful for backward compatibility. see the note below. for more details on the structure of installable bundles in general see: structure of an installable bundle. note: in xulrunner 2.0, the chrome.manifest is now used to register x
pcom components in addition to its previous uses. part of this change means the /chrome/chrome.manifest is no longer considered the "root" manifest. xulrunner will not check that folder location for a root-level chrome.manifest. you need to move your existing chrome.manifest to the application root folder, remembering to update the relative paths within the file. you could also just create a new app...
Archived Mozilla and build documentation - Archive of obsolete content
that have little to no effect on performance when not in use and very little when active. probe data can be collected with scripts written in d (no, not that one). mozilla dtrace support has been added by the sun dtrace team and can be used on solaris 10 and mac os x 10.5. embedding faq embedding mozilla in a java application using javax
pcom xulrunner ships with the javax
pcom component, which allows java code to interact with x
pcom objects. as you will see in this article, working with x
pcom objects in java is not that much different than doing so in c++. error console the error console is a tool available in most mozilla-based applications that is used for reporting err...
...ace and influence where other elements can be placed. the space manager is responsible for keeping track of where space is taken up and where it is available. this information is used by block layout to correctly compute where other floated elements should be placed, and how much space is available to normal in-flow elements that flow around the floated bits. ...
...ther elements can be placed. the space manager is responsible for keeping track of where space is taken up and where it is available. this information is used by block layout to correctly compute where other floated elements should be placed, and how much space is available to normal in-flow elements that flow around the floated bits. standalone x
pcom standalone x
pcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of x
pcom. the contents of this standalone x
pcom in general are: stress testing consume.exe from the windows server 2003 resource kit tools can consume various resources: physical memory, cpu time, page file, disk space and even the kernel pool. a...
...rted into the editor. the xul can be loaded from and saved to files. a xul validator and the error console are both available to help debug problems. the help menu provides access to xul information on mdc. there is even simple “keyword” help lookup for xul elements. xulrunner xulrunner is a mozilla runtime package that can be used to bootstrap xul+x
pcom applications that are as rich as firefox and thunderbird. it provides mechanisms for installing, upgrading, and uninstalling these applications. ...
2006-11-24 - Archive of obsolete content
to build xulrunner using the ming compiler on windowsxp. however he has been unsuccessful and a bunch of errors. to view the joe's error please check the posting. he is using make 3.80, working with the source tarball for xulrunner 1.8.4,running "make -f client.mk distclean" followed by "make -f client.mk build_all". joe is asking for help on a possible solution to fix his problem. ...
... bunch of errors. to view the joe's error please check the posting. he is using make 3.80, working with the source tarball for xulrunner 1.8.4,running "make -f client.mk distclean" followed by "make -f client.mk build_all". joe is asking for help on a possible solution to fix his problem. building x
pcom components with msvs 2005 november 21st: buffaloaf is having trouble getting a personal x
pcom component to work under xulrunner when compiled with msvs 2005. ...
... luke wants to know if compiling xulrunner with a static crt is better or worse than compiling with the mscvr80.dll dependency. ...
... luke wants to know if compiling xulrunner with a static crt is better or worse than compiling with the mscvr80.dll dependency. ...
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - nov 18-nov 24, 2006 announcements none during this week. ...
... summary: mozilla.dev.tech.x
pcom - nov 18-nov 24, 2006 announcements none during this week. ...
... summary: mozilla.dev.tech.x
pcom - nov 18-nov 24, 2006 announcements none during this week. ...
... ...
Archive of obsolete content
and can be incorporated into other programs. mozilla release faq this document may be distributed and modified freely. no guarantee of factuality in this faq is made, and it is maintained by pat gunn, who is not affiliated with netscape. various other people have contributed to this faq. ...
...we leverage some of these ideas to help you make your netscape communicator 4.x plugins exposed to javascript in mozilla based browsers. ...
...we leverage some of these ideas to help you make your netscape communicator 4.x plugins exposed to javascript in mozilla based browsers. plugins for more information about plugin roadmap, see non-archived plugin information. ...
... plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world. the main reason for this is that there is no guarantee of java compatibility on a binary level due to the jri/jni switch. the new mozilla x
pcom architecture allows x
pcom components be scriptable via a different mechanism called x
pconnect. we leverage some of these ideas to help you make your netscape communicator 4.x plugins exposed to javascript in mozilla based browsers. plugins for more information about plugin roadmap, see non-archived plugin information. rss really simple syndication (rss) is a popular html-like xml-based data format used for syndication. rss has a sor...
Mozilla accessibility architecture
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 the platform differences on a consistent manner. the shared code makes itself available to the toolkit-specific code via generic x
pcom interfaces that return information about objects we want to expose. all focusable nodes, tables and text have accessibility interfaces. we call these objects "accessible nodes". each of these accessible nodes supports at minimum the generic cross-platform accessibility interface nsiaccessible (which provides a text name, enumerated role identifier and a set of state flags) and sometimes additi...
...es additional interfaces. for example, tables support nsiaccessibletable, text supports nsiaccessibletext and edit boxes support nsieditabletext., although this code has been moved into the atk specific directories because it is not currently used in windows. we will not rule out the possibility of supporting some of the rich atk interfaces on windows. the toolkit-specific classes then use these x
pcom interfaces to gather information about the objects they want to expose, make any necessary changes, and then expose the information using microsoft com on windows, or through gtk2's atk api's on linux and unix. the assistive technology can then use this information in a number of ways. it can read in an entire document at once, look only pieces of a document related to recent events, or travers...
...ame. for example, document specific code for each toolkit goes in nsdocaccessiblewrap: public nsdocaccessible. ...
... iterate through all the dom nodes in the subtree, checking for nsiaccessnode entries in the cache for each dom node, shutting them down if they exist. this is better than just traversing the accessibles by using the member variables mfirstchild and mnextsibling, because that would miss nsaccessnode's that are not nsaccessible's. at program shutdown, when the nsaccessibilityservice observes ns_x
pcom_shutdown_observer_id, it iterates through the doc accessibles in gglobaldocaccessiblecache and destroys all of the doc accessibles them. challenges of the accessibility cache there are some tricky issues when dealing with the accessibility cache: remaining valid: changes in a given document, or the destruction of documents must update or shutdown parts of the cache. we use dom mutation even...
Creating a Login Manager storage module
(bug 106400) and gnome keyring manager (bug 309807). you should start with the existing code if you want to implement that in your extension. to see some debugging output in the console set signon.debug to true using about:config. sample javascript implementation the following code snippet is a javascript component that implements a dummy nsiloginmanagerstorage interface. ...
... signon.debug to true using about:config. sample javascript implementation the following code snippet is a javascript component that implements a dummy nsiloginmanagerstorage interface. see how_to_build_an_x
pcom_component_in_javascript for more details about javascript components. ...
...; const ci = components.interfaces; components.utils.import("resource://gre/modules/x
pcomutils.jsm"); function sampleloginmanagerstorage() {} sampleloginmanagerstorage.prototype = { classdescription: "sample nsiloginmanagerstorage implementation", contractid: "@example.com/login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: x
pcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the built-in nsiloginmanagerstorage _x
pcom_categories: [ { category: "login-manager-storage", entry: "nsiloginmanagerstorage" } ], // console logging service, used for debugging. __logservice : null, get _logservice() { if (!this.__logservice) this.__logservice...
...the category registration looks like this: nscomptr<nsicategorymanager> cat = do_getservice(ns_categorymanager_contractid); ns_ensure_state(cat); cat->addcategoryentry("login-manager-storage", "nsiloginmanagerstorage", kyourcontractid, pr_...
Makefile - variables
exports a list of exported header files and sources to install for external use. exports_namespaces exported package include directory: dist/include/${namespace} exports_${namespace} a list of exports/headers that should be copied into the exported namespace directory. extra_components nsdefaultclh.manifest, javascript x
pcomm files extra_dso_libs extra_dso_ldopts extra_js_modules extra_pp_components x
pcomm files to pre-process before installation. garbage a "clean target" macro containing a list of files to remove. garbage_dirs a "clean target" macro containing a list of director...
... python_unit_tests list of python scripts to check exit status for make check ...
... moz_xul moz_x11 test variable description enable_tests boolean value that should wrapper all unit tests to allow disabling on demand[1]. python_unit_tests list of python scripts to check exit status for make check x
pc_shell_tests no_x
pcshell_manifest_check inhibit validating manifest files when running x
pcshell tests. compiler variable description gnu_cc defined if the gnu gcc compiler is available. module_optimize_flags additional flags for enabling or overriding compiler optimizations...
... moz_chrome_multilocale a list of locale names to process moz_chrome_file_format both, file, jar, omni, symlink packager_no_libs hack to allow one makefile to include another without pulling in libs:: target definitions. stagedist local staging directory for localization and packaging. todo: x
pcom/xpinstall variables: https://developer.mozilla.org/en/adding_x
pcom_components_to_mozilla_build_system ...
Interface Compatibility
d apis are not yet complete. the stable version 1.0 of the jetpack sdk is planned for later in 2010. documented apis which are shipped as part of the jetpack sdk are designed to work in future versions of firefox. achieving this compatibility may require rebuilding the extension with a new version of the jetpack sdk. ...
... between major releases, there is no guarantee of interface stability. changes should not be taken lightly, however: especially if a change is likely to affect many extensions, the change should try to maintain backwards compatibility by using optional/default parameters or other javascript techniques. ...
... there is no guarantee of interface stability. changes should not be taken lightly, however: especially if a change is likely to affect many extensions, the change should try to maintain backwards compatibility by using optional/default parameters or other javascript techniques. ...
...compatibility by using optional/default parameters or other javascript techniques. where appropriate, new apis should be designed so that they are compatible with future plans, and clients do not need x
pcom boilerplate. this may involve using javascript modules, passing named parameters using objects, or other similar techniques. binary interfaces traditionally, mozilla has maintained a set of x
pcom interfaces and functions with the @status frozen marking. using these interfaces, and using dynamic calls to queryinterface, it has been possible to write binary x
pcom components which were compatible with multiple versions of firefox. beginning with mozilla 2 (firefox 4), this will no longer be supported: all @status markings have been removed, and extensions that use binary components will ne...
IPDL Type Serialization
all types used in ipdl must be serializable. this is accomplished through type specialization of a c++ traits class. types are serialized and deserialized from an i
pc::message type declared in i
pc_message.h. each type specializes i
pc::paramtraits as follows: namespace i
pc { template <> struct paramtraits<mytype> { typedef mytype paramtype; static void write(message* amsg, const paramtype& aparam) { // implement serialization here } static bool read(const message* amsg, void** aiter, paramtype* aresult) { // implement deserialization here. return false if deserialization failed } }; } // namespace i
pc the standard ipdl types (integers, floats, and x
pcom strings) already have serializers. other types need to have serializers written for them explicitly. in m...
...ization failed } }; } // namespace i
pc the standard ipdl types (integers, floats, and x
pcom strings) already have serializers. other types need to have serializers written for them explicitly. in many cases a serializer can be written by combining existing serializers. ...
...if in doubt, please ask for help! it i...
..., aiter, &(aresult->j))) return false; for (int i = 0; i < 4; ++i) if (!readparam(amsg, aiter, &(aresult->k[i]))) return false; return true; } }; } // namespace i
pc once you have a serializer for a type, you can serialize a collection of it (ex: an nstarray<examplestruct>) by simply declaring "using nstarray<examplestruct>;' in your ipdl file, then using it in a i
pc method. serializers and deserializers are security-sensitive and must always receive two reviews from module owners who understand i
pc serialization well. if in doubt, please ask for help! it is never acceptable to serialize/deserialize raw pointer values; if you are tempted, you probably should create a subprotocol for that data, so that ipdl can check the values and lifetime. ...
SourceMap.jsm
according to the spec, source maps have the following attributes: version: which version of the source map spec this map is following. ...
...according to the spec, source maps have the following attributes: version: which version of the source map spec this map is following. ...
...according to the spec, source maps have the following attributes: version: which version of the source map spec this map is following. ...
...map is following. sources: an array of urls to the original source files. names: an array of identifiers that can be referenced by individual mappings. sourceroot: optional. the url root from which all sources are relative. mappings: a string of base64 vlqs which contain the actual mappings. file: the generated filename this source map is associated with. sourcema
pconsumer.prototype.originalpositionfor(generatedposition) returns the original source, line, and column information for the generated source's line and column positions provided. the only argument is an object with the following properties: line: the line number in the generated source. column: the column number in the generated source. and an object is returned with the following ...
Using JavaScript code modules
javascript code modules are a concept introduced in gecko 1.9 and can be used for sharing code between different privileged scopes. modules can also be used to create global javascript singletons that previously required using javascript x
pcom objects. a javascript code module is simply some javascript code located in a registered location. the module is loaded into a specific javascript scope, such as xul script or javascript x
pcom 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 functio...
... note: each scope that imports a module receives a by-value copy of the exported symbols in that module. changes to the symbol's value will not propagate to other scopes (though an object's properties will be manipulated by reference). scope 1: components.utils.import("resource://app/my_module.jsm"); bar = "foo"; alert(bar); // displays "foo" scope 2: components.utils.
... packaging notes it's important to note that you sh...
..."@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); aliasfile.initwithpath("/some/absolute/path"); var aliasuri = services.io.newfileuri(aliasfile); resprot.setsubstitution("myalias", aliasuri); // assuming the code modules are in the alias folder itself notes custom modules and x
pcom components note that prior to gecko 2.0 javascript x
pcom components are loaded before chrome registration. this means you can't use components.utils.import() with your own resource url at the top level in a component source. a possible solution is moving the call to components.utils.import() into the x
pcom component constructor (discussion). packaging notes it's important to note that you should not typically put your javascript code modules in a j...
Investigating leaks using DMD heap scan mode
the build is going to be very slow, so you may need to disable some shutdown checks. first, in toolkit/components/terminator/nsterminator.cpp, delete everything in runwatchdog but the call to ns_setcurrentthreadname. this will keep the watch dog from killing the browser when shut down takes multiple minutes. secondly, you may need to comment out the call to moz_crash("nss_shutdown failed"); in x
pcom/build/x
pcominit.cpp, as this also seems to trigger when shutdown is extremely slow. you need the cycle collector analysis script find_roots.py, which can be downloaded as part of this repo on github. generating logs the next step is to generate a number of log files. you need to get a shutdown cc log and a dmd log, for a single run. definitions i'll write $objdir for the object directory f...
...ngle run. definitions i'll write $objdir for the object directory for your firefox dmd build, $srcdir for the top level of the firefox source directory, and $heapgraph for the location of the heapgraph repo, and $logdir for the location you want logs to go to. $logdir should end in a path separator. for instance, ~/logs/leak/. the command you need to run firefox will look something like this: x
pcom_mem_bloat_log=1 moz_cc_log_shutdown=1 moz_disable_content_sandbox=t moz_cc_log_directory=$logdir moz_cc_log_process=content moz_cc_log_thread=main moz_dmd_shutdown_log=$logdir moz_dmd_log_process=tab ./mach run --dmd --mode=scan breaking this down: x
pcom_mem_bloat_log=1: this reports a list of the counts of every object created and destroyed and tracked by the x
pcom leak tracking system. fr...
... directly by the child processes. moz_cc_log_directory=$logdir: this selects the location for cycle collector logs to be saved. moz_cc_log_process=content moz_cc_log_thread=main: these options specify that we only want cc logs for the main thread of content processes, to make shutdown less slow. if your leak is happening in a different process or thread, change the options, which are listed in x
pcom/base/nscyclecollector.cpp. moz_dmd_shutdown_log=$logdir: this option specifies that we want a dmd log to be taken very late in x
pcom shutdown, and the location for that log to be saved. like with the cc log, we want this log very late to avoid as many non-leaking things as possible. moz_dmd_log_process=tab: as with the cc, this means that we only want these logs in content processes, in order...
...loadrequest(). fortunately, this method mostly just contains two calls to new, one for scriptloadrequest and one for moduleloadrequest. (this is where an unoptimized build comes in handy, as it would have pointed out the exact line. unfortunately, in this particular case, the unoptimized build was so slow i wasn’t getting any logs.) i then looked through the list of leaked objects generated by x
pcom_mem_bloat_log and saw that we were leaking a scriptloadrequest, so i went and looked at its class definition, where i noticed that scriptloadrequest had a strong reference to an element that it wasn’t telling the cycle collector about, which seemed suspicious. the first thing i did to try to confirm that this was the source of the leak was pass the address of this object into the cycle colle...
Profiling with the Firefox Profiler
l allowing the user to pan and zoom around thanks to apz. tracing markers red: these indicate that the event loop is being unresponsive. note that high priority events such as vsync are not included here. also note that this indicates what would have happened had there been an event waiting and not necessarily that there was an event pending for that long. black: these indicate synchronous i
pc calls. ranges ranges of time can be zoomed in on by clicking and dragging anywhere in the tracing marker or thread areas. once a range is selected, a magnifying glass appears which zooms into that range. clicking on a tracing marker will create a selection corresponding with its duration allowing for easy zooming in on interesting time ranges. as you zoom in on ranges, breadcrumbs are create...
...age name is org.mozilla.fennec_aurora), and you have to allow storage access on permission settings before launching it. adb shell am start -n org.mozilla.fennec_aurora/.app \ --es env0 moz_profiler_startup=1 \ --es env1 moz_profiler_shutdown=/sdcard/download/profiler.json then, if you select quit menu, you can collect profiling data to moz_profiler_shutdown file. ...
...zilla.fennec_aurora/.app \ --es env0 moz_profiler_startup=1 \ --es env1 moz_profiler_shutdown=/sdcard/download/profiler.json then, if you select quit menu, you can collect profiling data to moz_profiler_shutdown file. profiling js benchmark (x
pcshell) to profile the script run.js with ionmonkey (-i), type inference (-n) and jäegermonkey (-m). thgis requires the following command: $ x
pcshell -m -i -n -e ' const ci = components.interfaces; const cc = components.classes; var profiler = cc["@mozilla.org/tools/profiler;1"].getservice(ci.nsiprofiler); profiler.startprofiler( 10000000 /* = profiler memory */, 1 /* = sample rate: 100µs with patch, 1ms without */, ["stackwalk", "js"], 2 /* = features, and number of features. */ ); ' -f ./run.js -e ' var profil...
... cc["@mozilla.org/tools/profiler;1"].getservice(ci.nsiprofiler); profiler.startprofiler( 10000000 /* = profiler memory */, 1 /* = sample rate: 100µs with patch, 1ms without */, ["stackwalk", "js"], 2 /* = features, and number of features. */ ); ' -f ./run.js -e ' var profileobj = profiler.getprofiledata(); print(json.stringify(profileobj)); ' | tail -n 1 > run.cleo the x
pcshell output all benchmark information and on its last line it output the result of the profiling, you can filter it with tail -n 1 and redirect it to a file to prevent printing it in your shell. the expected size of the output is around 100 of mb. to add symbols to your build, you need to call ./scripts/profile-symbolicate.py available in b2g repository. $ gecko_objdir=<objdir> product_out=<o...
NSS 3.12.4 release notes
groups/stm/cmvp/documents/140-1/140inprocess.pdf added crl distribution point support (see cert.h). cert_decodecrlissuingdistributionpoint cert_findcrlissuingdistpointexten the old documentation of the expression matching syntax rules was incorrect, and the new corrected documentation is as follows for public nssutil functions (see portreq.h): port_regexpvalid port_regexpsearch port_regex
pcasesearch these functions will match a string with a shell expression. the expressions accepted are based loosely on the expressions accepted by zsh. expected return values: non_sxp if exp is a standard string invalid_sxp if exp is a shell expression, but invalid valid_sxp if exp is a valid shell expression expression matching rules: * matches anything ? matches one character \ will escape a...
...bug 470500: firefox 3.1b2 crash report [[@ nssutil3.dll@0x34c0 ] bug 482742: enable building util independently of the rest of nss bug 483653: unable to build certutil.exe for fennec/wince bug 485145: miscellaneous cr...
...bug 504408: pkix_pl_crldp_create will always fail if dp->distpointtype != generalname bug 504456: exploitable heap overflow in nss shell expression (filename globbing) parsing bug 505559: need function to identify the one and only default internal private key slo...
...bug 505561: need a generic function a l...
extIApplication
method overview boolean quit() boolean restart() void getextensions(extiextensionscallback acallback) attributes the following interfaces are available to all applications: attribute type description id readonly attribute astring the id of the application. ...
...indicating whether the shutdown was successful. restart() attempts to restart the application. it is possible for the restart to be canceled. boolean restart() return value boolean value indicating whether the restart was successful. getextensions(acallback) calls acallback with the list of installed extensions. void getextensions(extiextensionscallback acallback) return value none. ...
...ssible for the restart to be canceled. boolean restart() return value boolean value indicating whether the restart was successful. getextensions(acallback) calls acallback with the list of installed extensions. void getextensions(extiextensionscallback acallback) return value none. ...
...return value boolean value indicating whether the restart was successful. getextensions(acallback) calls acallback with the list of installed extensions. void getextensions(extiextensionscallback acallback) return value none. x
pcom although the application object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code. ...
Receiving startup notifications
see the startup process for details on how this now works, if you're interested in specifics. the important thing to note is that now instead of registering with the category manager programmatically as was done in the past, you add lines to your chrome.manifest to let the application handle it for you. ...
...see the startup process for details on how this now works, if you're interested in specifics. the important thing to note is that now instead of registering with the category manager programmatically as was done in the past, you add lines to your chrome.manifest to let the application handle it for you. ...
...profile-after-change mycomponent @foobar/mycomponent;1 important: in the past, the contract id of the category entry started with "service," if the component was implemented as a service. this is no longer the case, so be sure to remove that when migrating existing code. additionally, the earliest startup time notification you can receive is now profile-after-change. your add-on will not receive x
pcom-startup or app-startup notifications. the startup process during application startup, the application's manifest is used to get a list of the components it needs to register, and those components are loaded. this gets enough of x
pcom and the application loaded and running that the extension manager can then be loaded and handle installing, uninstalling, and updating any installed extensions. on...
...ly reading their manifests, loading their components, and continuing with application startup, all without having to restart the browser. receiving startup notifications prior to gecko 2.0 (firefox 4) to receive startup notifications, one needs to register with the "app-startup" category using nsicategorymanager; having done so, the component will receive these startup notifications, including: x
pcom-startup sent when x
pcom finishes starting up. most application features are not yet available at this point, but x
pcom itself is. app-startup sent when the application has finished starting up. final-ui-startup sent just before the first application window is displayed. registering with the category manager to register with the category manager, simply call its nsicategorymanager.addcategoryen...
Components.classes
the properties of this object are indexed by the contractid (or human-readable name) of the component class. ...
... the properties of this object are indexed by the contractid (or human-readable name) of the component class. ...
...e components.classes array as follows: var clazz0 = components.classes["@mozilla.org/messenger;1"]; clazz0 is the class object for the contractid @mozilla.org/messenger;1, which is not usually used by itself, but whose createinstance and getservice methods can be used to create a new instance of the component or to access the singleton instance, if the contract id represents a service. ...
... to access a service (a singleton component, only single instance of which exists at any time), you should use getservice instead of createinstance: var os = components.classes["@mozilla.org/observer-service;1"] ...
Components.utils.importGlobalProperties
ope. this function is not intended for sandboxes but for system-privileged scopes. to import these objects into a sandbox, use the wantglobalproperties option in the sandbox constructor. this function is passed an array of strings. each string is the name of an object to import, and will be defined on the importing scope's global. ...
...iddendomwindow is that on startup of firefox, the hiddendomwindow objects cannot be accessed until it is fully loaded. therefore readystate must be checked, if it is not complete, then a load listener must be attached. once readystate is complete then the objects can be used. for example this is how to ues the file object. ...
...refox, the hiddendomwindow objects cannot be accessed until it is fully loaded. therefore readystate must be checked, if it is not complete, then a load listener must be attached. once readystate is complete then the objects can be used. for example this is how to ues the file object. ...
... a load listener must be attached. once readystate is complete then the objects can be used. for example this is how to ues the file object. ...
HOWTO
async network requests problem you want to make network requests or do other asynchronous work in x
pcshell. however, when you start your script, it exits immediately, before the network request returns. solution 1. put the following at the end of your script: // do async processing // from <https://developer.mozilla.org/en/x
pconnect/x
pcshell/howto> print("doing async work"); gscriptdone = false; var gthreadmanager = cc["@mozilla.org/thread-manager;1"] .getservice(ci.nsithreadmanager); var mainthread = gthreadmanager.currentthread; while (!gscriptdone) mainthread.processnextevent(true); while (mainthread.haspendingevents()) mainthread.processnextevent(true); 2. in all callbacks where your script is finished, i.e. both success and error callbacks, put: gscriptdone = true; if ...
...e); while (mainthread.haspendingevents()) mainthread.processnextevent(true); 2. in all callbacks where your script is finished, i.e. both success and error callbacks, put: gscriptdone = true; if you forget some condition where your script should exit but you don't add this statement, your script will hang (busy wait). this is of course a massive, ugly hack prone to error, but this is what the x
pcshell test harness does. there should really be a better solution in x
pcshell. using js modules and non-ui javascript chrome files problem you want to write a javascript file, and run it in x
pcshell. the file uses js modules. maybe it even uses javascript files from chrome:// urls. e.g., you use: components.utils.import("resource://app/modules/gloda/log4moz.js"); however, you get (for that partic...
...to write a javascript file, and run it in x
pcshell. the file uses js modules. maybe it even uses javascript files from chrome:// urls. e.g., you use: components.utils.import("resource://app/modules/gloda/log4moz.js"); however, you get (for that particular line, which is the first import): uncaught exception: [exception... ...
...e :: file.js :: <top_level> :: line 12" data: no] solution 1 var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript("chrome://myall/content/file.jsm"); see: http://mxr.mozilla.org/comm-central/...figutils.js#54 solution 2 append the following at the top of your js file which you want to run in x
pcshell { // <https://developer.mozilla.org/en/x
pconnect/x
pcshell/howto> // <https://bugzilla.mozilla.org/show_bug.cgi?id=546628> let cc = components.classes; let ci = components.interfaces; // register resource://app/ uri let ios = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice); let reshandler = ios.getprotocolhandler("resource") .queryinterface(ci.nsi...
nsMemory
heapminimize the heapminimize function attempts to shrink the size of the heap. ...
... heapminimize the heapminimize function attempts to shrink the size of the heap. ...
...memory implementation without having to go through the service manager to get it. #include "nsmemory.h" class nsmemory { ... }; methods alloc the alloc function allocates a block of memory of a particular size. realloc the realloc function reallocates a block of memory to a new size. free the free function frees a block of memory that was allocated by x
pcom's memory manager. heapminimize the heapminimize function attempts to shrink the size of the heap. clone the clone function creates a copy of an existing memory block up to the size specified. getglobalmemoryservice the getglobalmemoryservice function returns a reference to x
pcom's global nsimemory object. remarks to use the methods in this class, you m...
...heapminimize function attempts to shrink the size of the heap. clone the clone function creates a copy of an existing memory block up to the size specified. getglobalmemoryservice the getglobalmemoryservice function returns a reference to x
pcom's global nsimemory object. remarks to use the methods in this class, you must link your component or application against the x
pcom glue library. the static methods defined on this class are not frozen. however, if you use these functions in your x
pcom component, and if you link to the x
pcom glue library, then your component will only have a runtime dependency on the frozen x
pcom api. see also nsimemory ...
nsIDOMParser
a web developer, please refer to the domparser documentation instead. creating a domparser to create a domparser object from a web page or a chrome script running in a window, simply use new domparser(). when you create a domparser from a privileged script, you can pass parameters to the constructor, more on that below. to create a domparser when the constructor is not available (e.g., from a js x
pcom component, a js module, or an x
pcshell test), use: var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); // optionally, call parser.init(principal, documenturi, baseuri); principals, document and base uri note: this section covers changes introduced to domparser in gecko 1.9. (this section is only relevant to fir...
... these matter, feel free to ask questions in mozilla.dev.tech.dom and update this documentation to mention these cases. when a domparser is instantiated by calling new domparser(), it inherits the calling code's principal (except that for chrome callers the principal is set to the null principal) and the documenturi and baseuri of the window the constructor came from. if the caller has universalx
pconnect privileges, it can pass parameters to new domparser(). if fewer than three parameters are passed, the remaining parameters will default to null. the first parameter is the principal to use; this overrides the default principal normally inherited. the second parameter is the documenturi to use. the third parameter is the baseuri to use. if you instantiate a domparser by calling createinst...
...rivileged code will be able to access (see discussion in bug 565480). parsing a string once you've created a domparser object, you can use its parsefromstring method to parse xml or html as described in the web platform documentation. ...
...s (see discussion in bug 565480). parsing a string once you've created a domparser object, you can use its parsefromstring method to parse xml or html as described in the web platform documentation. ...
nsIDocShell
void fireunloadnotification(); native code only! obsolete since gecko 1.8 nsisimpleenumerator getdocshellenumerator(in long aitemtype, in long adirection); nsidomstorage getsessionstorageforprincipal(in nsiprincipal principal, in domstr...
...t viewer. void createaboutblankcontentviewer( in nsiprincipal aprincipal ); parameters aprincipal the principal to use for the new document. createloadinfo() creates a docshellloadinfo object that you can manipulate and then pass to loaduri(). void createloadinfo( out nsidocshellloadinfo loadinfo ); parameters loadinfo the new nsidocshellloadinfo object. violates the x
pcom interface guidelines detacheditorfromwindow() disconnects this docshell's editor from its window, and stores the editor data in the open document's session history entry. this should be called only during page transitions. void detacheditorfromwindow(); parameters none. finishrestore() finish firing webprogresslistener notifications and dom events for restoring a page presentation. this sh...
...some of those might not be allowed. use at your own risk. firstparty true if this is the master top-level document. preparefornewcontentmodel() reset state to a new content model within the current document and the document viewer. called by the document before initiating an out of band document.write(). void preparefornewcontentmodel(); parameters none. resumerefreshuris() restart the x
pcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively. if the timers are already running, this has no effect. void resumerefreshuris(); parameters none. native code only!setchildoffset set the offset of this child in its container. void setchildoffset( in unsigned long offset ); parameters offset the offset of this nsidocshell within its pare...
... the offset of this nsidocshell within its parent. used to restore session history for frames. setcurrenturi() for editors and suchlike who wish to change the uri associated with the document. note if you want to get the current uri, use the read-only property on nsiwebnavigation. void setcurrenturi( in nsiuri auri ); parameters auri the uri to load. suspendrefreshuris() cancel the x
pcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively. the meta-refresh timers can be restarted using resumerefreshuris(). if the timers are already suspended, this has no effect. void suspendrefreshuris(); parameters none. tabtotreeowner() tells the docshell to offer focus to its tree owner. this is currently only necessary for embedding chrome. void tab...
nsIErrorService
x
pcom/base/nsierrorservice.idlscriptable this is a service that allows nsresult codes to be mapped to string bundles that can be used to look up error messages. string bundle keys can also be mapped. ...
... x
pcom/base/nsierrorservice.idlscriptable this is a service that allows nsresult codes to be mapped to string bundles that can be used to look up error messages. string bundle keys can also be mapped. ...
... value the key to use to retrieve the error string from the nsresult's module's string bundle. registererrorstringbundle() registers a string bundle url for an error module. void registererrorstringbundle( in short errormodule, in string stringbundleurl ); parameters errormodule the module for which the string bundle is to be registered. should be one of the modules listed in x
pcom/base/nserror.h, such as ns_error_module_storage. stringbundleurl the url of the string bundle to register for the module. registererrorstringbundlekey() registers a key in a string bundle for an nsresult error code. void registererrorstringbundlekey( in nsresult error, in string stringbundlekey ); parameters error the nsresult for which the string bundle key i...
...ndlekey the key that should be used to retrieve the error string from string bundle for the given nsresult. unregistererrorstringbundle() unregisters a string bundle url for an error module. void unregistererrorstringbundle( in short errormodule ); parameters errormodule the module for which the string bundle is to be unregistered. should be one of the modules listed in x
pcom/base/nserror.h, such as ns_error_module_storage. unregistererrorstringbundlekey() unregisters a key in a string bundle for an nsresult error code. void unregistererrorstringbundlekey( in nsresult error ); parameters error the nsresult for which the string bundle key is to be unregistered. ...
nsIWebBrowserPersist
t;1"] .createinstance(components.interfaces.nsiwebbrowserpersist); method overview void cancelsave(); void savechannel(in nsichannel achannel, in nsisupports afile); void savedocument(in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awra
pcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextrahea...
... scheme. savedocument() save the specified dom document to file and optionally all linked files (for example images, css, js & subframes). do not call this method until the document has finished loading! void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awra
pcolumn ); parameters adocument document to save to file. some implementations of this interface may also support nsnull to imply the currently loaded document. afile target local file. this may be a nsilocalfile object or an nsiuri object with a file scheme or a scheme that supports uploading (for example ftp). adatapath path to directory where uris linked to the document are saved or nsn...
...for example ftp). adatapath path to directory where uris linked to the document are saved or nsnull if no linked uris should be saved. this may be a nsilocalfile object or an nsiuri object with a file scheme. aoutputcontenttype the desired mime type format to save the document and all sub-documents into or nsnull to use the default behavior. aencodingflags flags to pass to the encoder. awra
pcolumn for text documents, indicates the desired width to wrap text at. parameter is ignored if wrapping is not specified by the encoding flags. exceptions thrown ns_error_invalid_arg one or more arguments was invalid. saveuri() as of firefox 26, this method should no longer be used from add-on code. please use downloads.createdownload() instead. as of firefox 36, a new parameter arefer...
... this interface may also support nsnull to imply the currently loaded uri. acachekey an object representing the uri in the cache or nsnull. this can be a necko cache key, an nsiwebpagedescriptor, or the currentdescriptor of an nsiwebpagedescriptor. areferrer the referrer uri to pass with an http request or nsnull. areferrerpolicy the referrer policy to use for the request, taken from nsihtt
pchannel. apostdata post data to pass with an http request or nsnull. aextraheaders additional headers to supply with an http request or nsnull. afile target file. this may be a nsilocalfile object or an nsiuri object with a file scheme or a scheme that supports uploading (for example ftp). aprivacycontext a context derived from a relevant window or document (eg. the window containing a link...
Using the clipboard
ort string to the clipboard. this method only works to put strings on the clipboard. for other types of data, such as urls or images, you will need to use a more complex method. a component @mozilla.org/widget/clipboard;1 and an interface nsiclipboard provide general access to the system clipboard. you can use them to copy and paste any type of data from your application to the clipboard. ...
...this is needed because you can put anything on the clipboard from text to images. create a transferring object. this object can be the component @mozilla.org/widget/transferable;1 which implements the interface nsitransferable. ...
...lipboard and doesn't understand html, it can use the plain text version. if it does understand html, it can grab that version. the transferring object will hold the clipboard contents until the application has decided what it needs. this allows the clipboard to be used by another application right away. let's break down the steps needed to copy data to the clipboard. first, we need to create an x
pcom object to wrap what we want to copy. we'll assume that we want to copy some text. we will use the interface nsisupportsstring which can be used to represent strings (specifically, unicode strings). the following boilerplate utility functions will be used in all later code examples. // import the services module for future use, if we're not in // a browser window where it's already loaded. com...
...le flavor is possible. if you originally copied data of multiple flavors onto the clipboard, you can retrieve the data in the best format necessary. for example, a textbox would accept "text/unicode" (or "text/plain") while a composer window might accept html and image data. the variable str now holds the data from the clipboard. we need to convert the data back into a javascript string from an x
pcom object. the code below can be used for this purpose: if (str) { var pastetext = str.value.queryinterface(ci.nsisupportsstring).data; } because the data from the transferable is an nsisupportsstring, we need to convert it into a javascript string. the property value of the object filled in by gettransferdata, which is str in this case, provides the actual value of the object. we assign the ...
Weak reference
if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull. why do i need this? when you hold an owning reference on an object (i.e., you have addrefed it), you are holding that object in existence for the duration of your reference. this isn't always appropriate, and can lead to trouble. if, for instance, this owning reference is part of a cycle of owning references (e.g., if the referenced object also holds a owning reference back to you), then none of the objects in the cycle can be reclaimed without taking special measures. there are less severe situations. ...
...rence; and nsiweakreference::queryreferent gives you the same functionality as queryinterface for getting back. additionally, nscomptr now supports the new key do_queryreferent to simplify life even further. how do i make a class support weak references? in javascript, just make sure that your queryinterface method returns your object for the nsisupportsweakreference interface, and you're set; x
pconnect does all the work for you. just roll in nssupportsweakreference, a mix-in class that does all the work, and adjust your queryinterface accordingly, e.g., //... #include "nsweakreference.h" class nsfoo : public nsifoo, ..., public nssupportsweakreference { ... }; // ...if you used the table macros to implement |queryinterface|, add an entry ns_interface_map_begin(nsfoo) // ... ns_i...
... in situations where you need this, there are two alternatives which you may want to consider: you might hold an owning reference, but arrange to release it out-of-band; this must be before the destructor, which would otherwise never be called. you might hold a raw pointer (without addrefing and releaseing it), and avoid using it in cases where it might dangle. ...
... there are two alternatives which you may want to consider: you might hold an owning reference, but arrange to release it out-of-band; this must be before the destructor, which would otherwise never be called. you might hold a raw pointer (without addrefing and releaseing it), and avoid using it in cases where it might dangle. see also the source x
pcom/base/nsiweakreference.idl x
pcom/glue/nsweakreference.h x
pcom/glue/nsweakreference.cpp x
pcom ownership guidelines using nscomptr original document information author: scott collins last updated date: september 23, 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Working with Multiple Versions of Interfaces
in the extension that prompted this note, i needed to obtain the hwnd of the document (yes its on windows) in order to identify each particular extension instance. to do this i used the accessibility framework: hwnd gethwnd(nsidomnode *node){ hwnd self = null; nsresult rv; nscomptr<nsiaccessibleretrieval> refp; refp = do_createinstance( "@mozilla.org/accessibleretrieval;1", &rv); if (ns_failed(rv)){ return self; } //line 6. ...
...essibleretrieval). unfortunately we compiled this in the latest sdk, and so this magic number happens to be: "244e4c67-a1d3-44f2-9cab-cdaa31b68046" whereas, inside firefox 2, the iid it happens to know about is: "663ca4a8-d219-4000-925d-d8f66406b626". and this explains our ns_error_no_interface. fortunately there is a plan of action that we can follow to rectify this. we build construct our x
pcom component so that first tries to get the interface by it's new iid, then if that fails, attempts plan b. plan b is simply trying to get the interface by it's older iid. for expository purposes we will do this in two stages; buoyed by the fact that it is the actual route we took. the optimist's solution the first thing we do is replace line 6 above by our plan b: if (ns_failed(rv)){ return...
...d *wh = null; nscomptr<nsiaccessibledocument> accdocnode; rv = accnode->queryinterface(iad_iid_old, getter_addrefs(accdocnode)); if(ns_failed(rv)){ return self; } rv = accdocnode->getwindowhandle(&wh); if(ns_succeeded(rv)){ self = static_cast<hwnd>(wh); } return self; } there is good news and bad news. first the good news. plan b inside firefox 2 happily runs to completion. all the x
pcom calls succeed, or at least think they succeed. the bad news is that the thing we get back is not a valid hwnd. the problem now is not just interface identifier mismatch, but class declaration mismatch. getwindowhandle is the tenth method declared in the nsiaccessibledocument.h that firefox 2 was built with, but actually the eighth method in the sdk that i used to build my extension (and hence...
... calls succeed, or at least think they succeed. the bad news is that the thing we get back is not a valid hwnd. the problem now is not just interface identifier mismatch, but class declaration mismatch. getwindowhandle is the tenth method declared in the nsiaccessibledocument.h that firefox 2 was built with, but actually the eighth method in the sdk that i used to build my extension (and hence x
pcom component). since these classes don't use vtables this means i'm probably, no i can be more positive, definitely calling the wrong method. if i were a betting man, i'd hedge a bet on getaccessibleinparentchain, that being the tenth method in the interface declaration in the new sdk. in actual fact we were lucky we actually got as far as we did, since the very first interface we made use of has ...
MailNews fakeserver
eturns description closesocket none nothing closes the socket and stops the test. setmultiline the new value of multiline nothing the value is a boolean, with true invoking multiline mode. it is off by default. extending a handler to provide different mechanisms is a process not defined here; please check the documentation of the corresponding handler for instructions. using fakeserver in x
pcshell tests since there are three different components of fakeserver, a total of four objects need to be set up in a fakeserver test on top of other testing. the outline of a test looks like this: var daemon = setupdaemon(); // check with your local fakeserver docs var handlers = [ /* some set of handlers */ ]; for (var handler in handlers) { // this sets up the fake server var server = new ...
... server.playtransaction(); // finished with tests server.stop(); } currently, fakeserver provides no means to keep a persistent connection past a test, requiring connections to be closed, possibly forcibly. alternatively, one can wait for the timeout, which occurs after 3 minutes, so not closing connections would make the tests take unbearably long. ...
...d with tests server.stop(); } currently, fakeserver provides no means to keep a persistent connection past a test, requiring connections to be closed, possibly forcibly. alternatively, one can wait for the timeout, which occurs after 3 minutes, so not closing connections would make the tests take unbearably long. ...
...ceived + sent commands, no data const fsdebugall = 3; // dump everything debugging is set to "none" by default. specific fakeserver guidelines pop imap smtp nntp nntpd.js defines a few different classes of nntp servers: compliance for rfc 977, rfc 2980, and rfc 3977, as well as a giganews and an inn server. (full 2980 and 3977 compliance as well as inn is not yet written). for x
pcshell tests in mailnews/news, all files in mailnews/news/test/postings/auto-add are automatically added based on the newsgroups header. there are added in alphabetical order, which may help for purposes that rely on article key orders. the only generated header is lines. the following comprises the api of the news fakeserver itself: nntpdaemon api name arguments returns notes [constructor] ...
Using COM from js-ctypes
ispnotifysource */ /* start inherit from ispeventsource */ void* setinterest; void* getevents; void* getinfo; /* end inherit from ispeventsource */ /* start ispvoice */ void* setoutput; void* getoutputobjecttoken; void* getoutputstream; void* pause; void* resume; void* setvoice; void* getvoice; hresult (__stdcall *speak)(struct myispvoice*, l
pcwstr pwcs, dword dwflags, ulong* pulstreamnumber); void* speakstream; void* getstatus; void* skip; void* setpriority; void* getpriority; void* setalertboundary; void* getalertboundary; void* setrate; void* getrate; void* setvolume; void* getvolume; void* waituntildone; void* setsyncspeaktimeout; void* getsyncspe...
...dcall_abi; // libraries let lib = ctypes.open('ole32.dll'); // types // simple types let byte = ctypes.unsigned_char; let dword = ctypes.unsigned_long; let long = ctypes.long; let lpvoid = ctypes.voidptr_t; let void = ctypes.void_t; let ulong = ctypes.unsigned_long; let ushort = ctypes.unsigned_short; let wchar = ctypes.jschar; // advanced types - based on simple types let hresult = long; let l
pcwstr = wchar.ptr; // guess types - these just work i couldnt find a proper defintion for it let lpunknown = ctypes.voidptr_t; // structures // simple structures let guid = ctypes.structtype('guid', [ { 'data1': ulong }, { 'data2': ushort }, { 'data3': ushort }, { 'data4': byte.array(8) } ]); // advanced structures let clsid = guid; let iid = guid; // super advanced structures let refii...
...: ctypes.voidptr_t }, { 'getoutputobjecttoken': ctypes.voidptr_t }, { 'getoutputstream': ctypes.voidptr_t }, { 'pause': ctypes.voidptr_t }, { 'resume': ctypes.voidptr_t }, { 'setvoice': ctypes.voidptr_t }, { 'getvoice': ctypes.voidptr_t }, { 'speak': ctypes.functiontype(callback_abi, hresult, // return [ ispvoice.ptr, l
pcwstr, // *pwcs dword, // dwflags ulong // *pulstreamnumber ]).ptr }, { 'speakstream': ctypes.voidptr_t }, { 'getstatus': ctypes.voidptr_t }, { 'skip': ctypes.voidptr_t }, { 'setpriority': ctypes.voidptr_t }, { 'getpriority': ctypes.voidptr_t }, { 'setalertboundary': ctypes.voidptr_t }, { 'getalertboundary': c...
... primative_hr = coinitializeex(null, coinit_apartmentthreaded); checkhresult(primative_hr, "coinitializeex"); spvoiceptr = ispvoice.ptr(); primative_hr = cocreateinstance(clsid_spvoice.address(), null, clsctx_all, iid_ispvoice.address(), ...
RTCDtlsTransport - Web APIs
rtcconfiguration property bundlepolicy may be provided when creating the connection. the bundlepolicy lets you control how to negotiate with these legacy endpoints. the default policy is "balanced", which provides a balance between performance and compatibility. for example, to create the connection using the highest level of bundling: const rtcconfig = { bundlepolicy: "max-bundle" }; const
pc = new rtcpeerconnection(rtcconfig); bundling lets you use one rtcdtlstransport to carry the data for multiple higher-level transports, such as multiple rtcrtptransceivers. when not using bundle when the connection is created without using bundle, each rtp or rtcp component of each rtcrtptransceiver has its own rtcdtlstransport; that is, every rtcrtpsender and rtcrtpreceiver, has its own trans...
...te the data channels' sctp communications by looking at the rtcsctptransport object's transport property. examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. ...
...t property. examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. let
pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ... ...
... in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. let
pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ... ...
RTCIceTransport: statechange event - Web APIs
es state. the state can be used to determine how far through the process of examining, verifying, and selecting a valid candidate pair is prior to successfully connecting the two peers for webrtc communications. ...
...ly connecting the two peers for webrtc communications. bubbles no cancelable no interface event event handler property rtcicetransport.onstatechange examples given an rtcpeerconnection,
pc, the following code creates an event handler that calls a function named handlefailure() if the ice transport enters a failure state. ...
...property rtcicetransport.onstatechange examples given an rtcpeerconnection,
pc, the following code creates an event handler that calls a function named handlefailure() if the ice transport enters a failure state. ...
...vent handler that calls a function named handlefailure() if the ice transport enters a failure state. let icetransport =
pc.getsenders()[0].transport.icetransport; icetransport.addeventlistener("statechange", ev => { if (icetransport.state === "failed") { handlefailure(
pc); } }, false); the same code, using the onstatechange event handler property, looks like this: let icetransport =
pc.getsenders()[0].transport.icetransport; icetransport.onstatechange = ev => { if (icetransport.state === "failed") { handlefailure(
pc); } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'statechange' in that specification. candidate recommendation ...
RTCPeerConnection: icecandidate event - Web APIs
ward compatibility purposes and does not need to be delivered onward to the remote peer (which is why the code snippet above checks to see if event.candidate is null prior to sending the candidate along. ...
...ward to the remote peer (which is why the code snippet above checks to see if event.candidate is null prior to sending the candidate along. ...
...ce gathering has just ended. this is a more reliable approach than looking at the individual ice messages for one indicating that the ice session is finished. examples this example creates a simple handler for the icecandidate event that uses a function called sendmessage() to create and send a reply to the remote peer through the signaling server. ...
... a function called sendmessage() to create and send a reply to the remote peer through the signaling server. first, an example using addeventlistener():
pc.addeventlistener("icecandidate", ev => { if (ev.candidate) { sendmessage({ type: "new-ice-candidate", candidate: event.candidate }); } }, false); you can also set the onicecandidate event handler property directly:
pc.onicecandidate = ev => { if (ev.candidate) { sendmessage({ type: "new-ice-candidate", candidate: event.candidate }); } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'icecandidate' in that specification. candidate recommendation ...
RTCPeerConnection.removeTrack() - Web APIs
r is not in the connection's senders list, this method has no effect. if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. ...
...tiation must occur. syntax
pc.removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button. ...
...diatrack a rtcrtpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button. ...
...urn value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button. var
pc, sender; navigator.getusermedia({video: true}, function(stream) {
pc = new rtcpeerconnection(); var track = stream.getvideotracks()[0]; sender =
pc.addtrack(track, stream); }); document.getelementbyid("closebutton").addeventlistener("click", function(event) {
pc.removetrack(sender);
pc.close(); }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.removetrack()' in that specification. candidate recommendation ini...
RTCPeerConnection.setLocalDescription() - Web APIs
scriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setlocaldescription() does not immediately take effect. instead, the current connection configuration remains in place until negotiation is complete. only then does the agreed-upon configuration take effect. syntax apromise = rtcpeerconnection.setlocaldescription(sessiondescription);
pc.setlocaldescription(sessiondescription, successcallback, errorcallback); parameters sessiondescription optional an rtcsessiondescriptioninit or rtcsessiondescription which specifies the configuration to be applied to the local end of the connection. if the description is omitted, the webrtc runtime tries to automatically do the right thing. implicit description if you don't explicity p...
...ssiondescription parameter is invalid. examples implicit descriptions one of the advantages of the parameter-free form of setlocaldescription() is that it lets you simplify your negotiation code substantially. this is all your negotiationneeded event handler needs to look like, for the most part. just add the signaling server code, which here is represented by the call to signalremotepeer(). ...
...ions one of the advantages of the parameter-free form of setlocaldescription() is that it lets you simplify your negotiation code substantially. this is all your negotiationneeded event handler needs to look like, for the most part. just add the signaling server code, which here is represented by the call to signalremotepeer().
pc.addeventlistener("negotiationneeded", async (event) => { await
pc.setlocaldescription(); signalremotepeer({ description:
pc.localdescription }); }); other than error handling, that's about it! providing your own offer or answer the example below shows the implementation of a handler for the negotiationneeded event that explicitly creates an offer, rather than letting setlocaldescription() do it. async function handlenegotiationneededevent() { try { ...
...ption(); signalremotepeer({ description:
pc.localdescription }); }); other than error handling, that's about it! providing your own offer or answer the example below shows the implementation of a handler for the negotiationneeded event that explicitly creates an offer, rather than letting setlocaldescription() do it. async function handlenegotiationneededevent() { try { await offer =
pc.createoffer();
pc.setlocaldescription(offer); signalremotepeer({ description:
pc.localdescription }); } catch(err) { reporterror(err); } } this begins by creating an offer by calling createoffer(); when that succeeds, we call setlocaldescription(). we can then send the newly-created offer along to the other peer using the signaling server, which here is done by calling a function...
RTCPeerConnection: signalingstatechange event - Web APIs
an signalingstatechange event is sent to an rtcpeerconnection to notify it that its signaling state, as indicated by the signalingstate property, has changed. ...
...ty, has changed. bubbles no cancelable no interface event event handler property rtcpeerconnection.onsignalingstatechange examples given an rtcpeerconnection,
pc, and an updatestatus() function that presents status information to the user, this code sets up an event handler to let the user know when the ice negotiation process finishes up. ...
... no interface event event handler property rtcpeerconnection.onsignalingstatechange examples given an rtcpeerconnection,
pc, and an updatestatus() function that presents status information to the user, this code sets up an event handler to let the user know when the ice negotiation process finishes up. ...
...atestatus() function that presents status information to the user, this code sets up an event handler to let the user know when the ice negotiation process finishes up.
pc.addeventlistener("signalingstatechange", ev => { switch(
pc.signalingstate) { case "stable": updatestatus("ice negotiation complete"); break; } }, false); using onsignalingstatechange, it looks like this:
pc.onsignalingstatechange = ev => { switch(
pc.signalingstate) { case "stable": updatestatus("ice negotiation complete"); break; } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'signalingstatechange' in that specification. candidate recommendation ...
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
tart(), captures an initial report, and the second, networkteststop(), captures a second report, then uses the two reports to output some information about the network conditions... xxx ... networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and store it in the variable startreport. let startreport; async function networkteststart(
pc) { if (
pc) { startreport = await
pc.getstats(); } } given an rtcpeerconnection,
pc, this calls its getstats() method to obtain a statistics report object, which it stores in startreport for use once the end-of-test data has been collected by networkteststop(). networkteststop() the networkteststop() function obtains a second report, endreport, then uses the two reports together to dete...
...w let's look at the networkteststop() function itself. it takes as input the rtcpeerconnection being tested, calls getstats() to get a new rtcstatsreport with current statistics, then computes the results it's looking for, outputting those results as appropriate to the user by appending appropriate html to the contents of the <div> element whose class is stats-box. ...
... at the networkteststop() function itself. it takes as input the rtcpeerconnection being tested, calls getstats() to get a new rtcstatsreport with current statistics, then computes the results it's looking for, outputting those results as appropriate to the user by appending appropriate html to the contents of the <div> element whose class is stats-box. ...
...tested, calls getstats() to get a new rtcstatsreport with current statistics, then computes the results it's looking for, outputting those results as appropriate to the user by appending appropriate html to the contents of the <div> element whose class is stats-box. ...
RTCSessionDescription - Web APIs
cription() this constructor returns a new rtcsessiondescription. the parameter is a rtcsessiondescriptioninit dictionary containing the values to assign the two properties. rtcsessiondescription.tojson() returns a json description of the object. the values of both properties, type and sdp, are contained in the generated json. ...
...ndescriptioninit dictionary containing the values to assign the two properties. rtcsessiondescription.tojson() returns a json description of the object. the values of both properties, type and sdp, are contained in the generated json. ...
...bject. the values of both properties, type and sdp, are contained in the generated json. ...
...e contained in the generated json. example signalingchannel.onmessage = function (evt) { if (!
pc) start(false); var message = json.parse(evt.data); if (message.sdp)
pc.setremotedescription(new rtcsessiondescription(message), function () { // if we received an offer, we need to answer if (
pc.remotedescription.type == "offer")
pc.createanswer(localdesccreated, logerror); }, logerror); else
pc.addicecandidate(new rtcicecandidate(message.candidate), function () {}, logerror); }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription' in that specification. candidate recommendation ...
Using the Screen Capture API - Web APIs
console.log = msg => logelem.innerhtml += `${msg}<br>`; console.error = msg => logelem.innerhtml += `<span class="error">${msg}</span><br>`; console.warn = msg => logelem.innerhtml += `<span class="warn"...
... selected by the user. the stream is connected to the <video> element by storing the returned mediastream into the element's srcobject. the dumpoptionsinfo() function—which we will look at in a moment—dumps information about the stream to the log box for educational purposes. if any of that fails, the catch() clause outputs an error message to the log box. ...
...stopping display capture the sto
pcapture() method is called when the "stop capture" button is clicked. it stops the stream by getting its track list using mediastream.gettracks(), then calling each track's {domxref("mediastreamtrack.stop, "stop()")}} method. once that's done, srcobject is set to null to make sure it's understood by anyone interested that there's no stream connected. function sto
pcapture(evt) { let tracks = videoelem.srcobject.gettracks(); tracks.foreach(track => track.stop()); videoelem.srcobject = null; } dumping configuration information for informational purposes, the startcapture() method shown above calls a method named dumpoptions(), which outputs the current track settings as well as the constraints that were placed upon the stream when it was created. fun...
...utton> <button id="stop">stop capture</button></p> <video id="video" autoplay></video> <br> <strong>log:</strong> <br> <pre id="log"></pre> the key parts of the html are: a <button> labeled "start capture" which, when clicked, calls the startcapture() function to request access to, and begin capturing, screen contents. a second button, "stop capture", which upon being clicked calls sto
pcapture() to terminate capture of screen contents. a <video> into which the captured screen contents are streamed. a <pre> block into which logged text is placed by the intercepted consolemethod. css the css is entirely cosmetic in this example. the video is given a border, and its width is set to occupy nearly the entire available horizontal space (width: 98%). max-width is set to 860px to se...
Using Service Workers - Web APIs
of connectivity. the best web app in the world will provide a terrible user experience if you can’t download it. there have been various attempts to create technologies to solve this problem, and some of the issues have been solved. but the overriding problem is that there still isn’t a good overall control mechanism for asset caching and custom network requests. ...
......
...'s (unfortunately-titled but well-written) application cache is a douchebag for more details. note: as of firefox 44, when ap
pcache is used to provide offline support for a page a warning message is now displayed in the console advising developers to use service workers instead (bug 1204581.) service workers should finally fix these issues. service worker syntax is more complex than that of ap
pcache, but the trade off is that you can use javascript to control your ap
pcache-implied behaviors with a fine degree of granularity, allowing you to handle this problem and many more. using a service worker you can easily set an app up to use cached assets first, thus providing a default experience even when offline, before then getting more data from the network (commonly known as offline first).
...ote: your service worker functions like a proxy server, allowing you to modify requests and responses, replace them with items from its own cache, and more. note: one great thing about service workers is that if you use feature detection like we’ve shown above, browsers that don’t support service workers can just use your app online in the normal expected fashion. furthermore, if you use ap
pcache and sw on a page, browsers that don’t support sw but do support ap
pcache will use that, and browsers that support both will ignore the ap
pcache and let sw take over. why is my service worker failing to register? this could be for the following reasons: you are not running your application through https. the path to your service worker file is not written correctly — it needs to be ...
Signaling and video calling - Web APIs
onnection between them. every ice candidate describes a method that the sending peer is able to use to communicate. each peer sends candidates in the order they're discovered, and keeps sending candidates until it runs out of suggestions, even if media has already started streaming. an icecandidate event is sent to the rtcpeerconnection to complete the process of adding a local description using
pc.setlocaldescription(offer). once the two peers agree upon a mutually-compatible candidate, that candidate's sdp is used by each peer to construct and open a connection, through which media then begins to flow. if they later agree on a better (usually higher-performance) candidate, the stream may change formats as needed. though not currently supported, a candidate received after media is alread...
...t to support video calling. updating the html the html for our client needs a location for video to be presented. this requires video elements, and a button to hang up the call: <div class="flexchild" id="camera-container"> <div class="camera-box"> <video id="received_video" autoplay></video> <video id="local_video" autoplay muted></video> <button id="hangup-button" onclick="hangu
pcall();" disabled> hang up </button> </div> </div> the page structure defined here is using <div> elements, giving us full control over the page layout by enabling the use of css. we'll skip layout detail in this guide, but take a look at the css on github to see how we handled it. take note of the two <video> elements, one for your self-view, one for the connection, and the <button> e...
...tly handle playback in our code. the "local_video" <video> element presents a preview of the user's camera; specifiying the muted attribute, as we don't need to hear local audio in this preview panel. finally, the "hangup-button" <button>, to disconnect from a call, is defined and configured to start disabled (setting this as our default for when no call is connected) and apply the function hangu
pcall() on click. this function's role is to close the call, and send a signalling server notification to the other peer, requesting it also close. the javascript code we'll divide this code into functional areas to more easily describe how it works. the main body of this code is found in the connect() function: it opens up a websocket server on port 6503, and establishes a handler to receive mess...
... learn how closevideocall() works. ending the call there are many reasons why calls may end. a call might have completed, with one or both sides having hung up. perhaps a network failure has occurred, or one user might have quit their browser, or had a system crash. in any case, all good things must come to an end. hanging up when the user clicks the "hang up" button to end the call, the hangu
pcall() function is called: function hangu
pcall() { closevideocall(); sendtoserver({ name: myusername, target: targetusername, type: "hang-up" }); } hangu
pcall() executes closevideocall() to shut down and reset the connection and release resources. it then builds a "hang-up" message and sends it to the other end of the call to tell the other peer to neatly shut itself down. endi...
Web audio codec guide - Web media technologies
e to support additional codecs not included on this list. ...
...e no licensing fully open and free of any licensing requirements g.711 (pulse code modulation of voice frequencies) the g.711 specification, published by the international telecommunications union (itu), was initially created in 1972 to define standards for encoding the voice frequencies on telephone lines into digital form. the audio is encoded using pulse code modulation (
pcm) with either µ-law or a-law encoding. the primary benefit to µ-law encoding is that the byte 0x00 never appears in the encoded audio, which may be beneficial in certain applications or networking environments. µ-law is primarily used in north america and japan, with a-law being predominant elsewhere. the drawbacks to g.711 are obvious: small 8-bit samples and narrow audio frequency bandwidt...
...tu), the g.722 codec is designed specifically for voice compression. its audio coding bandwidth is limited to the 50 hz to 7,000 hz range, which covers most of the frequency range of typical human vocalization. this makes it ill-suited for handling any audio that might range outside the human speech range, such as music. g.722 audio is encoded using adaptive differential pulse code modulation (ad
pcm), in which each sample is represented not by its absolute value, but as a value indicating how much the new sample differs from the previous sample. g.722 is primarily used with webrtc connections, as it's one of the audio codecs mandated by the webrtc specification. supported bit rates g.722: 48 kbps, 56 kbps, and 64 kbps; however, in practice 64 kbps is always used g.722 anne...
...4 kbps; however, in practice 64 kbps is always used g.722 annex b super wide-band: 64 kbps, 80 kbps, and 96 kbps g.722 annex d stereo wide-band: 64 kbps and 80 kbps g.722 annex d stereo super wide-band: 80 kbps, 96 kbps, 112 kbps, and 128 kbps variable bit rate (vbr) support no supported sample formats 14-bit integer supported sample rates 16 khz (ad
pcm is specified to allow 8 khz, 11.025 khz, 22.05 khz, 44.1 khz, but g.722 uses 16 khz) recommended minimum bit rate for stereo sound 128 kbps at 44.1 khz sample rate compression lossy maximum audio channels 2 audio frequency bandwidth 50 hz - 7 khz latency 4 ms browser compatibility feature chr...
Media container formats (file types) - Web media technologies
ons. on mac os, the quicktime framework not only supported quicktime format movie files and codecs, but supported a vast array of popular and specialty audio and video codecs, as well as still image formats. through quicktime, mac applications (including web browsers, through the quicktime plugin or direct quicktime integration) were able to read and write audio formats including aac, aiff, mp3,
pcm, and qualcomm purevoice; and video formats including avi, dv, pixlet, prores, flac, cinepak, 3gp, h.261 through h.265, mjpeg, mpeg-1 and mpeg-4 part 2, sorenson, and many more. in addition, a number of third-party components are available for quicktime, some of which add support for additional codecs. because quicktime support is, for all intents and purposes, primarily available on apple devi...
... it is derived from the resource interchange file format (riff), and as such is similar to other formats such as apple's aiff.
...udio file format (wave), usually referred to simply as wav due to its filename extension being .wav, is a format developed by microsoft and ibm to store audio bitstream data. it is derived from the resource interchange file format (riff), and as such is similar to other formats such as apple's aiff. the wav codec registry can be found at rfc 2361; however, because nearly all wav files use linear
pcm, support for the other codecs is sparse. the wave format was first released in 1991. wave media mime types audio audio/wave1 audio/wav audio/x-wav audio/x-pn-wav [1] the audio/wave mime type is the standard type, and is preferred; however, the others have been used by various products over the years and may be used as well in some enviro...
... audio/wave1 audio/wav audio/x-wav audio/x-pn-wav [1] the audio/wave mime type is the standard type, and is preferred; however, the others have been used by various products over the years and may be used as well in some environments. audio codecs supported by wave codec browser support chrome edge firefox safari ad
pcm (adaptive differential pulse code modulation) no gsm 06.10 no l
pcm (linear pulse code modulation) yes mpeg-1 audio layer iii (mp3) no µ-law (u-law) no webm webm (web media) is a format based on matroska which is designed specifically for use in modern web environments. it's bas...
Bookmarks - Archive of obsolete content
getfolderidforitem() method. var parentfolderid = bmsvc.getfolderidforitem(newbkmkid); observing changes to bookmarks and tags to set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of x
pcomutils to generate the nsisupports.queryinterface() method. // an nsinavbookmarkobserver var myext_bookmarklistener = { onbeginupdatebatch: function() {}, onendupdatebatch: function() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextensi...
...ion() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextension.dosomething(); }, onitemvisited: function(abookmarkid, avisitid, time) {}, onitemmoved: function(aitemid, aoldparent, aoldindex, anewparent, anewindex) {}, queryinterface: x
pcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmarklistener); }, dosomething: functio...
...ction is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmarklistener); }, dosomething: function() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using x
pcom without chrome - bookmark observer ...
Preferences - Archive of obsolete content
formation here applies to the mozilla suite, firefox, thunderbird, and possibly other mozilla-based applications. for more details on preferences in mozilla, see preferences system. if you haven't yet, read other documents about mozilla preferences on mdn (links below in resources section). note: this article doesn't cover all available methods for manipulating preferences; please refer to the x
pcom reference pages listed in resources section for the complete list of methods. the interfaces dealing with preferences are fairly well documented, so using the methods not mentioned here should be straightforward. x
pcom interfaces for preferences system mozilla exposes its preferences system through a few x
pcom interfaces. look in the resources section below for the link to a list of preferenc...
...to get an nsiprefbranch, either queryinterface() the pref service (that will give you the root branch) or call nsiprefservice.getbranch() to get a sub-branch. ...
...erence and has the old value and along with the new value of the preference. it also uses a technique so you can just do prefs.preferencename.setval('blah') instead of having to branch.setcharpref etc. ...
StringView - Archive of obsolete content
l a number expressing the position in raw elements of the characters parts to skip. if omitted it will be considered as 0. examples var mystringview = new stringview("\u6432\u6432\u6432\u6432"); alert(mystringview.makeindex()) // 4 alert(mystringview.makeindex(2)) // 6 …using the startfrom argument… var mystringview = stringview.makefrombase64("5lit5pahigvzcghdsw9sievuz2x
pc2gg4ks54ks/4kso4kwn4ksm4kwainin2ytyudix2kjzitipihbvcnr1z3xdqnmg4kas4ka+4kac4kay4ka+inga0yprgdgb0lrqunc5ioaxpeacroiqnidgqkrgqbdgqjzgql7gqkzgqy=="); alert(mystringview); /* get the hindi subview... */ var mysubview1 = mystringview.subview(19, 6); /* get the hindi subview passing an uint8array as argument... */ var nhindistart = mystringview.makeindex(19); var nhindiend = mystringview.makeindex(6...
...aaaaakefxqyn/qvzjifzbvumj1ufuti0lqaegafvijs2oasaau0wp5thbsmh9a0id7ajovf7//0if7xqedx+eaaaaaabmiepmifzeif9b/xtcsipdaug563xqsipecftdqvxbxufeqv/dzmyudx+eaaaaaadzw2aqsipsceidxajdaaaaaqacaehlbgxvihdvcmxkiqaaaaabgwm7maaaaauaaaac/v//faaaafz+//9maaaatp///6qaaabs////xaaaanz///8maqaafaaaaaaaaaabeliaaxgqarsmbwiqaqcqfaaaabwaaaai/v//kgaaaaaaaaaaaaaafaaaaaaaaaabeliaaxgqarsmbwiqaqaajaaaabwaaacy/f//qaaaaaaoeeyogeo
pc3cigaa/gjsqmyqiaaaaabwaaabeaaaaop7//xuaaaaaqq4qhgjddqzqdaciaaaaraaaagqaaacg/v//zqaaaabcdhcpakuogi4drq4gjqrfdiimbugomiygsa44gwdndkbsdjhbdjbbdihcdibcdhhcdhbcdggafaaaakwaaadi/v//agaaaaaaaaaaaaaaaaaaaaaaaadqbeaaaaaaalaeqaaaaaaaaaaaaaaaaaabaaaaaaaaaaeaaaaaaaaadaaaaaaaaacoa0aaaaaaaa0aaaaaaaaalavaaaaaaaazaaaaaaaaaoagyaaaaaaagwaaaaaaaaaiaaaaaaaaaboaaaaaaaaa6azgaaaaaaacaaaaaaaaaagaaaaaaaaa9f7/bwaaaabgakaaa...
...aaaaawgeaabeadwcgbuaaaaaaaaqaaaaaaaaa0qeaabiadqagbuaaaaaaaguaaaaaaaaa4qeaabaagqaycwaaaaaaaaaaaaaaaaaa5geaabiadqaqbeaaaaaaaaaaaaaaaaaa7qeaabaagqaqcwaaaaaaaaaaaaaaaaaa+qeaabiadqaabuaaaaaaabuaaaaaaaaa/geaacaaaaaaaaaaaaaaaaaaaaaaaaaaegiaabecgaaqcwaaaaaaaaaaaaaaaaaahgiaacaaaaaaaaaaaaaaaaaaaaaaaaaaoaiaabiacwcoa0aaaaaaaaaaaaaaaaaaagluaxquywbjcnrzdhvmzi5jaf9fsknsx0xju1rfxwbkzxjlz2lzdgvyx3rtx2nsb25lcwbyzwd
pc3rlcl90bv9jbg9uzxmax19kb19nbg9iywxfzhrvcnnfyxv4agnvbxbszxrlzc42mzu5af9fzg9fz2xvymfsx2r0b3jzx2f1ef9maw5px2fycmf5x2vudhj5agzyyw1lx2r1bw15af9fznjhbwvfzhvtbxlfaw5pdf9hcnjhev9lbnryeqbozwxsby5jaf9frljbtuvfru5ex18ax19kq1jfru5ex18ax19pbml0x2fycmf5x2vuzabfrfloqu1jqwbfx2luaxrfyxjyyxlfc3rhcnqax0dmt0jbtf9prkztrvrfvefctevfaf9fbgliy19jc3vfzmluaqbfsvrnx2rlcmvnaxn0zxjutunsb25lvgfibguazgf0yv9zdgfydabwdxrzqebhtelcq...
How to convert an overlay extension to restartless - Archive of obsolete content
this article is a step-by-step tutorial on how to convert an old overlay-based extension into a restartless (bootstrapped) extension that is also extractionless. requirements first off, what kind of add-on are we talking about here? well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no x
pcom components of your own. some of that will have to be replaced and the rest will need to be loaded differently. next, what's the minimum version of firefox we should require (preferably an esr)? this guide targets firefox 17 esr or later (or anything else gecko 17+, such as seamonkey 2.14+). this is two esrs back (as of this writing), which should be plenty. using the current firefox esr, stable version, or nightly is generally a better ...
...for whatever reason. string changes seem to be fine, however the addition or removal of strings can sometimes produce this error. it's not reliably reproducible, but it does happen. yes, this is a pain in the ass. the suggestion that seems to work is to use a hack to bypass the string bundle cache. ...
...it does happen. yes, this is a pain in the ass. the suggestion that seems to work is to use a hack to bypass the string bundle cache. you should still be caching a reference to your string bundle on add-on startup, preferably using x
pcomutils.jsm to lazily load the file. for example: components.utils.import("resource://gre/modules/services.jsm"); components.utils.import("resource://gre/modules/x
pcomutils.jsm"); x
pcomutils.definelazygetter(this, "strings", function() { return loadpropertiesfile("chrome://myaddon/locale/mystrings.properties"); }); function loadpropertiesfile(path) { /* hack: the string bundle cache is cleared on addon shutdown, however it doesn't appear to do so reliably. errors can erratically happen on next load of the same file in certain instances. (at min...
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
t all). for errors about undeclared do_createinstance: #include "nscomponentmanagerutils.h" for errors about undeclared do_getservice: #include "nsservicemanagerutils.h" for errors about undeclared ns_getspecialdirectory: #include "nsdirectoryserviceutils.h" utility classes some utility classes could previously be created with ns_new* utility functions. ...
...don't use it in new code. use nsiarray instead. ...
...the nsmsgutils.h header for developing core mail/news code, the nsmsgutils.h header is being enhanced to fill in some of the gaps caused by the differences between the internal and external apis. these enhancements make it easier to write code that will transparently compile using either api. the list of enhancements fall in to three categories. changes to internal apis to make them compa...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
please be aware that if you attempt to open this sample directly in firefox, it will not run correctly. menus hierarchically structured dropdown menus are the part of the user interface used for frequently accessed functions in an applica...
... autocompletesearch attribute. if you want to use the location bar history, set the value for this to history; if you want it to be the search bar history, use search-history; and if you want it to be another form’s input history, use form-history; this attribute can take one value or multiple space-delimited values. also, in order to actually read in a history for autocomplete, you will need x
pconnect privileges, which we will cover in chapter 4. menu list use the menulist element to create a control for making selections from a drop-down list. as shown in listing 17, this is implemented in combination with the menupopup element; it produces output as shown in figure 14. a click reveals the drop-down list; when an item is selected, the values of that item’s label and value attribute...
...e backward and forward through pages and includes the ability to prevent scripts in embedded frames from accessing outside the frame. for building applications linked to external web pages, this is a more secure and more convenient approach. the tabbrowser element is even more capable than the browser element because it includes the basic tab-handling features from firefox. to use this requires x
pconnect privileges, the same as autocomplete does; this will be covered in chapter 4. opening a page if you specify a uri value for the src attribute in the browser element, that uri will be opened by default. if the src attribute's value changes, you can dynamically open a different web page or xul document. functions like back, forward, reload can all be called using the goback(), goforward(),...
Introduction - Archive of obsolete content
next » welcome to the xul school tutorial! this tutorial is meant to be the stepping stone that will turn you into a professional firefox extension developer in no time. we have poured years of xul experience into it, providing many solutions for problems extension developers commonly run into. xul school was created by ap
pcoast (formerly glaxstar), one of the few companies dedicated to building high-quality firefox extensions. a team of over a dozen xul developers conformed glaxstar at the time this tutorial was created, and the combined experiences of years creating firefox extensions are reflected here. with this tutorial you'll learn how to develop firefox extensions. you'll learn how to quickly do the most common tasks in extension development, comparing several...
...lla, it tends to be used to identify all mozilla-related development. you'll sometimes read terms like "xul applications" and "xul extensions", but rarely will they refer to projects that are exclusively built with xul. it usually means that the projects were built using mozilla technologies. even this project, called xul school, covers several other technologies such as javascript, css, xbl and x
pcom. xulrunner xulrunner includes the gecko rendering engine, the necko networking library, and several other components that provide os-independent file management, accessibility, and localization, among others. it is this very powerful platform that has allowed such a fast growth of the development community surrounding mozilla and firefox. xulrunner is available in binary form at the xulrunne...
... ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
it works by providing an object which implements the event handlers. all you have to do is write some simpler functions which work with the data being dragged. ...
...vent,textobserver)" ondragdrop="nsdraganddrop.drop(event,textobserver)" /> as mentioned earlier, there is nothing special that happens during a dragenter event, so you can just write that yourself. the functions are implemented by the nsdraganddrop object, which is declared in the file nsdraganddrop.js, which was included in one of the script tags. they handle the event, handle the x
pcom interfaces and pass a simpler data structure to functions of the observer object. the observer is an object that you declare yourself. in the above examples, this observer is stored in the buttonobserver and textobserver variables. the observer is declared in a script which you would include in the xul file using the script tag. the observer is an object which may have a number of properties, e...
...nction. we'll allow only one flavour here, that for a string. var textobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavour("text/unicode"); return flavours; } } the flavours list contains only one flavour, which is 'text/unicode'. the flavourset object can be used to hold a list of flavours. in some cases, you must provide the x
pcom interface as well. for example, for files: var textobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavour("application/x-moz-file","nsifile"); flavours.appendflavour("text/unicode"); return flavours; } } the ondragover function defines what happens when an object is dragged over. you might use it to change the appearance of...
Embedding FAQ - Archive of obsolete content
code examples found. however, there is a stripped down, uncommented code with eclipse libraries in this thread. ...
...you can find a better quality answer repeated and with an example in this newsgroup thread. ...
...you can find a better quality answer repeated and with an example in this newsgroup thread. ...
PyDOM - Archive of obsolete content
the globals are 'bound' to the global object (i.e., the window), instead of to a module's __dict__ as you expect in the python world. ...
...> block does. almost python code can not be secured - so it will only run from trusted sources. this means you can only have python code in chrome. content loaded from anywhere other than a chrome:// url can not host python. ...
...ython code can not be secured - so it will only run from trusted sources. this means you can only have python code in chrome. content loaded from anywhere other than a chrome:// url can not host python. ...
Table Layout Regression Tests - Archive of obsolete content
d either all extensions or include layoutdebug in your .mozconfig file. for example ac_add_options --enable-extensions=all. a mozilla tree with the test files at %moz_src%/layout/html/tests, disable_tests should not be defined (so ac_add_options --enable-tests), patience and time. test runs go to the %moz_src%/layout/html/tests/block directory. avoid the nasty assertions to pop up by set x
pcom_debug_break=warn, the world would be a much better place if we could first fix those assertions. as you will probably run your normal mozilla in parallel with the testing issue then: set moz_no_remote=1 at the command prompt. start the layout debugger via mozilla -layoutdebug - p foo where foo is just another profile than your main profile. select from the regression-test menu the add new li...
...++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note: styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running baseline test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst. writing regression data to e:\moz_src\mozilla...
...ession data to e:\moz_src\mozilla\layout\html\tests\block\base\baseline\pre1_html.rgd the second verify run creates first the frame dumps in the verify subdirectories (verify) and compares each frame dump with the corresponding reference frame dump. if they differ in critical points the test fails. a typical part of the verify log would look like: type manifest file: e:\moz_src\mozilla\obj-i586-
pc-msvc\dist\bin\components\xpti.dat +++ javascript debugging hooks installed. ++webshell == 1 ++domwindow == 1 ++webshell == 2 ++domwindow == 2 note: styleverifytree is disabled note: frameverifytree is disabled note: verifyreflow is disabled ++webshell == 3 ++domwindow == 3 running verify test for e:\moz_src\mozilla\layout\html\tests\block\rtest.lst. writing regression data to e:\moz_src\mozilla\l...
Elements - Archive of obsolete content
- the onset attribute's value is a script that executes when the value of the property is being altered. if this attribute is set, any initial value contained underneath the element will be ignored. within the script, the parameter val represents the new value being assigned. a property setter can also be specified as a child of the property element using a setter tag. ...
...the setter tag must be inside the property tag. id - the id attribute is a document-unique identifier. ...
...d id #implied > the handlers element contains event handlers that can be attached to elements within the bound document. these handlers are installed when the binding is attached and removed when the binding is detached. the handlers tag must be inside the binding tag. id - the id attribute is a document-unique identifier. ...
Mac stub installer - Archive of obsolete content
ior project. how we get setup to debug the xpinstall engine from the mac installer? once you have the mac installer built and ready to debug you may want to debug the xpinstall engine in the context of the installer rather than in the context of the browser. ...
... installer? once you have the mac installer built and ready to debug you may want to debug the xpinstall engine in the context of the installer rather than in the context of the browser. ...
...nd step into xpistub and eventually the xpinstall engine will load including symbols so you can set a break point in the xpinstall engine itself. how do i add an installer package to the mac installer? adding a package involves a few steps: add a section named for your <component> to the packages-mac manifest that describes which files from dist belong to which module. for example, see the x
pcom section that lists all the shared libraries as seen in dist. these are eventually zipped with the directory structure preserved. read the top of the packages-mac file for it's simple syntax and semantics. add an <component>.jst install script template file (the jst extension stands for javascript template indicating this is a template for the final install.js for the <component>.xpi. checkin t...
Using nsIXULAppInfo - Archive of obsolete content
older applications, such as firefox and thunderbird 1.0, do not support it. you'll need to have additional code for those older versions. getting nsixulappinfo to get a component implementing nsixulappinfo use this code: var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); (for explanation see this creating x
pcom article.) getting application information after you obtained the app info component, you can read its properties to get the application's id, human-readable name, version, platform version, etc. for complete list of nsixulappinfo's properties, please see nsixulappinfo interface description. id you can tell which application you're running under using the nsixulappinfo.id property. const fi...
...ication, and the former can be useful if you only support official releases, and to distinguish between branch and trunk builds. ...
...he information you need, especially when dealing with xulrunner-based applications. obtaining platform version information is done like this: var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); var platformver = appinfo.platformversion; var platformbuildid = appinfo.platformbuildid; getting nsixulappinfo in x
pcshell tests in firefox 21, a testing module was added that provides access to app info during the execution of x
pcshell tests. see bug 809920, and in summary: // work around the fact that x
pcshell doesn't have a proper app-info x
pcom object. cu.import("resource://testing-common/appinfo.jsm"); updateappinfo(); older versions as stated above, older mozilla 1.7-based applications do not support n...
JS-Engine FAQ - Archive of obsolete content
spidermonkey how long are private pointers? 2-byte aligned. check the jsval macros at the top of js/src/jsapi.h can an embedded spidermonkey js engine use domparser extension of mozilla? domparser is not part of js but part of mozilla browser which makes it available to script in the browser using x
pconnect. an alternative would be to use built-in e4x. ...
...ould be to use built-in e4x. newly created threads in js from mozilla_1_8_branch causes to hang in windows patch from bug 351602 should fix the problem. after applying that patch, recompile js and define js_use_only_nspr_locks in the build. spidermonkey library loading mechanism? to write wrappers in pure javascript to interface with any c library on the system there are mechanisms such as x
pcshell, wxjs, jsdb, jsni coding spidermonkey in c check out this tutorial how to compile tamarin on linux/x86 there is a patch that allows you to compile it. rhino what is the performance between rhino js and native java rhino js is significantly slower in run-time than native java. even when rhino is pre-compiled with high optimization, it still is no match for a compiled java program. ho...
...1.6 release 2 2005 09 19</tt>. how to compile javascript into java invoking compiler: java org.mozilla.javascript.tools.jsc.main [options] file1.js [file2.js...] this results in a class file. compiler options can be vied here. non-js-engine questions can i call functions in mozilla extensions from web page? no, accessing anything in the web page's script may lead to security problems. see x
pcnativewrapper. ...
2006-09-06 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - oct 06-13, 2006 announcements none during this week. discussions windows gecko-sdk and g++ components discussion on the problems and possible solutions running cygwin/g++ compiled x
pcom components with windows-based gecko-sdk/xulrunner dll/exes. threading in x
pcom rules on threading in x
pcom or to firefox extensions. ...
... summary: mozilla.dev.tech.x
pcom - oct 06-13, 2006 announcements none during this week. discussions windows gecko-sdk and g++ components discussion on the problems and possible solutions running cygwin/g++ compiled x
pcom components with windows-based gecko-sdk/xulrunner dll/exes. threading in x
pcom rules on threading in x
pcom or to firefox extensions. ...
... oct 06-13, 2006 announcements none during this week. discussions windows gecko-sdk and g++ components discussion on the problems and possible solutions running cygwin/g++ compiled x
pcom components with windows-based gecko-sdk/xulrunner dll/exes. threading in x
pcom rules on threading in x
pcom or to firefox extensions. how to build x
pcom component on mac os x a tutorial on how to build x
pcom component on mac os x firefox crashes when calling a function provided by a .so library a solution to the problem loading a shared library when using x
pcom firefoxes crashes while getting url in x
pcom solutions to resolve the problem of the firefox crash when trying to get the path and the prepath of the url of the current page in x
pcom meetings none during this week. ...
2006-09-22 - Archive of obsolete content
xpidl.exe crashes on windows problem with creating header files from idl's in 1.8 branch due to wrong compiler. ...
... xpidl.exe crashes on windows problem with creating header files from idl's in 1.8 branch due to wrong compiler. ...
... xpidl.exe crashes on windows problem with creating header files from idl's in 1.8 branch due to wrong compiler. ...
NPN_GetValue - Archive of obsolete content
de <npapi.h> nperror npn_getvalue(npp instance, npnvariable variable, void *value); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable information the call gets. ...
...ance, npnvariable variable, void *value); parameters this function has the following parameters: instance pointer to the current plug-in instance. variable information the call gets. ...
...he function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description npn_getvalue returns the browser information set with npn_setvalue. the queried information is returned in the value parameter. unix the platform-specific values for this parameter are npnvxdisplay (the current display), npnvxtap
pcontext (the browser's xtap
pcontext), and npnvnetscapewindow (the browser toplevel window in which the plugin is displayed). you can use npnvnetscapewindow to obtain the appropriate window for the wm_transient_for property of a dialog box created from the plug-in. microsoft windows you can use this method to help create a menu or dialog box for a windowless plug-in. in order to bring up popup menus...
NPObject - Archive of obsolete content
plugin specific, or browser specific) members. npobject is the type used to express objects exposed by either the plugin or by the browser through this api. the browsers are expected to expose their window objects and everything reachable from it through this api. npobjects are reference counted objects, so callers need to be careful to properly release acquired references to them. ...
...e reference counted objects, so callers need to be careful to properly release acquired references to them. to aid with the reference counting and ownership management in general, the functions npn_createobject(), npn_retainobject(), npn_releaseobject(), and npn_releasevariantvalue() are provided as part of this api. npobject behavior is implemented using the set of callback functions defined in n
pclass. syntax struct npobject { n
pclass *_class; uint32_t referencecount; /* * additional space may be allocated here by types of npobjects */ }; fields _class a pointer to the n
pclass of which the object is a member. referencecount the reference count for the object. warning: do not manipulate the _class and referencecount fields directly; use the f...
...t. ...
Application cache implementation overview
all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload(). channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache. nsiapplicationcacheservice::chooseapplicationcache is given the url the channel is about to load. it synchronously returns an nsiapplicationcache object representing the most recent cache version from the most recent cache group containing the entry under the url or a matching namespace. ...
...rom and the load continues a usual way by loading from normal http cache, further steps are not executed. the channel remembers the nsiapplicationcache object. nsiapplicationcache is then queried a client id (= the manifest url + a unique time stamp). then, nsicacheservice is asked to open nsicachesession with store_offline policy and the given client id. entry is queried using that session. nshtt
pchannel::onofflinecacheentryavailable is then invoked. when aentrystatus is a success code, entry has been found and we are loading it from the cache. loadedfromapplicationcache flag is now set true on the channel. when aentrystatus is a failure code, entry has not been found, but the url is falling under one of the network or fallback namespaces. when matching fallback namespace, the associated fa...
...“falling back on a resource load failure” chapter). associating the top level document with offline cache this happens between document load start and the first sub-resource download start and is not about associating nsiapplicationcache object with the channel, but with the document object the load is performed for. until steps described further the document doesn't know anything about its ap
pcache. the association happens in nscontentsink::processofflinemanifest() called from the html parser every time <html> tag has been parsed. processofflinemanifest is an effective implementation of “cache selection algorithm” as described by the html5 spec. for purpose of this documentation it's enough to describe the simplest case ; for complete documentation of the selection algorithm refer t...
Choosing the right memory allocator
there are a lot of different memory allocators in the mozilla source tree. this article looks over some of them and tries to sort out which should be used under what circumstances. allocating memory in x
pcom these are general purpose memory-management routines that you should use unless your code falls into one of the other categories below. use these if you link against x
pcom or x
pcom glue; this includes extensions with binary components. see the x
pcom string guide for additional information. ns_alloc() == nsimemory::alloc() ns_realloc() == nsimemory::realloc() ns_free() == nsimemory::free() nsmemory::clone() (note: not part of nsimemory) see infallible memory allocation for information about how to allocate memory infallibly; that is, how to use memory allocators that wil...
...additional information. ns_alloc() == nsimemory::alloc() ns_realloc() == nsimemory::realloc() ns_free() == nsimemory::free() nsmemory::clone() (note: not part of nsimemory) see infallible memory allocation for information about how to allocate memory infallibly; that is, how to use memory allocators that will only return valid memory buffers, and never return null. allocating strings in x
pcom code see "callee-allocated parameters" in the x
pcom strings guide; use tonewcstring() or tonewunicode() to allocate strings that will be passed out. these methods convert ns*string to nsimemory allocated, unowned [pruni]char* buffers. do not use nscrt::strdup for returning values from an x
pcom object, as that uses a different allocator. nspr memory allocators you should only use the nspr al...
... ...
Interface development guide
if you're going to be changing an interface, be sure to read these first! commenting idl for better documentation a guide explaining how to properly comment your interface's idl in order to ensure that not only can others understand your interface, but to ensure that the documentation here on mdc is as accurate as possible. community view mozilla embedding forums... ...
...if you're going to be changing an interface, be sure to read these first! commenting idl for better documentation a guide explaining how to properly comment your interface's idl in order to ensure that not only can others understand your interface, but to ensure that the documentation here on mdc is as accurate as possible. community view mozilla embedding forums... ...
...sure to read these first! ...
IPDL Best Practices
pdl deletes your protocol all protocols must be deleted. period. are you sending the __delete__ message to trigger protocol deletion? this one is easy to miss, as the corresponding recv__delete__ function has a stub implementation automatically generated in the base class. simply calling delete on a pointer to an actor is not enough. using ipdl generated structs as data structures outside of i
pc serialization/deserialization ipdl generated structures are meant to facilitate serialization/deserialization and message passing. do not use them as data structures outside of ipdl, or wou will eventually find yourself in bad situations to implement proper memory management. a good example of this problem is the amount of memory management bugs that we have had with using surfacedescriptor direc...
...that implements an ipdl interface, but it also outlives it (case in point: reference-counted). is there any chance that an ipdl function could be called after the protocol itself has been destroyed, or before it has been created? don't let it happen - that is a guaranteed crash right there. use a flag and the generated actordestroy function to control when ipdl functions can be called; see phtt
pchannelparent/child for an example. when to run code here's a rundown on appropriate places to run certain kinds of code: manager::allocpprotocol - allocation manager::recvpprotocolconstructor - initialization, protocol deletion (the typeaheadfind protocol uses one-shot protocols like this) actor::recv__delete__ - cleanup, ipdl calls still valid but ill-advised actor::actordestroy - non-ip...
...ipdl ends up shutting down the protocol tree due to an error, the auto pointer will attempt to trigger protocol deletion a second time. while this can be worked around with actordestroy, being explicit about deleting the protocol with send__delete__ is easier to maintain, with symmetric alloc/deallocpprotocol functions also being easier to reason about. minimize overall use of messages reducing i
pc traffic is a righteous goal. consider the following protocol: async protocol pasyncquerier { child: pasyncquery(); } async protocol pasyncquery { child: kickoffquery(nsstring query); parent: returnresult(nsstring result); __delete__(); } in this situation, there is a guaranteed sequence of messages that will be sent. following actor construction, the parent will send a kickoffquery m...
Creating a New Protocol
works first! create the protocol file the protocol file should live in the same directory as the code which will implement it. protocol names start with p, and protocol files must be named pprotocolname.ipdl. ipdl protocols should be in the mozilla namespace or a sub-namespace. to hook up the file to the build, you need to add your ipdl file to ipdl_sources in the nearest moz.build file. see dom/i
pc/moz.build for an example. the protocol hierarchy unless you are working on some special project, your protocol will fit into the protocol hierarchy for multi-process plugins or tabs. the toplevel protocol for plugins is ppluginmodule. the toplevel protocol for tabs is
pcontent. you should know what protocol will manage the new protocol and what lifetime issues that creates. if there is any doubt,...
...otocol hierarchy for multi-process plugins or tabs. the toplevel protocol for plugins is ppluginmodule. the toplevel protocol for tabs is
pcontent. you should know what protocol will manage the new protocol and what lifetime issues that creates. if there is any doubt, ask on irc in the #content channel. building the new protocol to build the new protocol declaration and generate headers, make in i
pc/ipdl: make -c objdir/i
pc/ipdl if there are any protocol-level errors, the ipdl compiler will print the relevant error messages and stop. to view the generated headers, look in objdir/i
pc/ipdl/_ipdlheaders . creating the implementation the c++ implementation inherits from the abstract ipdl-generated classes pnewprotocolparent and pnewprotocolchild. it must implement abstract methods for receiving...
...atures can be read from the generated pnewprotocolparent.h and pnewprotocolchild.h headers. writing the tests protocols which are managed by pbrowser must be tested using the mochitest-chrome test framework with a <browser remote="true">. it is acceptable to use synchronous calls on jpw wrappers for testing purposes. it may be possible to test protocols unrelated to a particular window using the x
pcshell testing framework, which has additional primitives in electrolysis for launching and running js commands in a content process. ...
MailNews automated testing
automated testing is an increasingly significant and important part of mailnews development. it allows reviewers to quickly pick up regressions in patches and helps developers to think about different cases. this page and its sub-pages describe (and link to) the available test mechanisms within mailnews, and provide supporting information for developers and testers. ...
...s page and its sub-pages describe (and link to) the available test mechanisms within mailnews, and provide supporting information for developers and testers. functional testing x
pcshell-tests and make check these are core test harnesses to which mailnews adds its own tests. these tests are run against almost every changeset that gets committed to the thunderbird and seamonkey code bases. x
pcshell-tests are run in javascript without any chrome present. this makes them especially useful for testing at the component / module level. x
pcshell-tests are the quickest tests to run. ...
... testing frameworks the asynctestutils extended framework supports: asynchronous test operation: a reasonably convenient means of writing tests that involve asynchronous operations by using generators. ...
NSS tools : certutil
certificate. x.509 certificate extensions are described in rfc 5280. --extcp add the certificate policies extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extpm add the policy mappings extension to the certificate. x.509 certificate extensions are described in rfc 5280. --ext
pc add the policy constraints extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extia add the inhibit any policy access extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extskid add the subject key id extension to the certificate. x.509 ...
...you can create a self-signed certificate using the -x argument with the -s command option. $ certutil -s -k rsa|dsa|ec -n certname -s subject [-c issuer |-x] -t tr ustargs -d [sql:]directory [-m serial-number] [-v valid-months] [-w offs et-months] [-p phone] [-1] [-2] [-3] [-4] [-5 keyword] [-6 keyword] [-7 emailaddress] [-8 dns-names] [--extaia] [--extsia] [--extcp] [--extpm] [ --ext
pc] [--extia] [--extskid] the series of numbers and --ext* options set certificate extensions that can be added to the certificate when it is generated by the ca. for example, this creates a self-signed certificate: $ certutil -s -s "cn=example ca" -n my-ca-cert -x -t "c,c,c" -1 -2 -5 -m 3650 from there, new certificates can reference the self-signed certificate: $ ...
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkf
pcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
certutil
xtension to the certificate. x.509 certificate extensions are described in rfc 5280. --extcp add the certificate policies extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extpm add the policy mappings extension to the certificate. x.509 certificate extensions are described in rfc 5280. --ext
pc add the policy constraints extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extia add the inhibit any policy access extension to the certificate. x.509 certificate extensions are described in rfc 5280. --extskid add the subject key id extension to the certificate. x.509 certificate ...
...available, you can create a self-signed certificate using the -x argument with the -s command option. $ certutil -s -k rsa|dsa|ec -n certname -s subject [-c issuer |-x] -t trustargs -d [sql:]directory [-m serial-number] [-v valid-months] [-w offset-months] [-p phone] [-1] [-2] [-3] [-4] [-5 keyword] [-6 keyword] [-7 emailaddress] [-8 dns-names] [--extaia] [--extsia] [--extcp] [--extpm] [--ext
pc] [--extia] [--extskid] the series of numbers and --ext* options set certificate extensions that can be added to the certificate when it is generated by the ca. for example, this creates a self-signed certificate: $ certutil -s -s "cn=example ca" -n my-ca-cert -x -t "c,c,c" -1 -2 -5 -m 3650 from there, new certificates can reference the self-signed certificate: $ certutil -s -s ...
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkf
pcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
SpiderMonkey Build Documentation
ce, the following instructions should only be relevant if you're on windows or compiling an older version of spidermonkey. the mozillabuild batch file you used to open your shell (e.g. start-shell-msvc2013.bat or start-shell-msvc2013-x64.bat) determines whether the compiler toolchain will target 32-bit or 64-bit builds. to create a 64-bit build, note that you must configure with --target=x86_64-
pc-mingw32 --host=x86_64-
pc-mingw32. since the posix nspr emulation is not available for windows, a working version of nspr must be available to your build. the easiest option is to configure with --enable-nspr-build. this configure option builds the in-tree version of nspr which is probably what you want; because spidermonkey uses newer nspr symbols, the nspr that ships with your operating system ...
...t toolchain (don't add a new toolchain spidermonkey will use only one toolchain and use it for both host and target code: rustup target add i686-unknown-linux-gnu to build a 32-bit version on a 64-bit linux system, you can use the following: pkg_config_libdir=/usr/lib/pkgconfig cc="gcc -m32 -mfpmath=sse -msse -msse2" cxx="g++ -m32 -mfpmath=sse -msse -msse2" ar=ar \ $src/configure --target=i686-
pc-linux or for clang. $src/configure --target=i686-
pc-linux-gnu to build a 32-bit arm version on a 64-bit linux system, that runs in the arm simulator, you can use the following: ar=ar cc="gcc -m32 -mfpmath=sse -msse -msse2" cxx="g++ -m32 -mfpmath=sse -msse -msse2" \ $src/configure --target=i686-
pc-linux --enable-simulator=arm to build a 32-bit version on a 64-bit mac system (the targ...
... following: $src/configure --target=i386-apple-darwin16.7.0 # choose the appropriate sdk version for your version of os/x to build a 64-bit version on a 32-bit mac system (e.g. mac os x 10.5), you can use the following: ar=ar cc="gcc -m64" cxx="g++ -m64" ../configure --target=x86_64-apple-darwin10.0.0 to build a 64-bit windows version, you can use the following: $src/configure --host=x86_64-
pc-mingw32 --target=x86_64-
pc-mingw32 note: you must have started your mozillabuild shell with the proper -x64.bat script in order for the 64-bit compilers to be in your path. whatever compiler and flags you pass to configure are recorded in the generated makefile, so you don't need to specify them again until you re-run configure. building your application while "how to build your complete app...
GCIntegration - SpiderMonkey Redirect 1
n the first slice of the gc. therefore, it's not possible for code to modify them between when the initial snapshot is taken and when the pointer is marked, so no write barrier is needed. many pointers in gecko are traced via ns_decl_cycle_collection_script_holder_class and its related macros. these pointers are always traced in the first slice, and so they don't need a write barrier. many other x
pconnect pointers are also traced in this way. see x
pcjsruntime::traceblackjs and x
pcjsruntime::tracegrayjs. if a pointer doesn't fit one of these categories, then it probably requires a write barrier. before the pointer is modified (except initializing writes, which don't need a barrier), you should call incrementalreferencebarrier() or incrementalvaluebarrier(), passing it the value the pointer ...
... the js::objectptr class is intended to serve as a drop-in replacement for jsobject *. it has an assignment operator that automatically invokes a write barrier. so far, though, there hasn't been much use for this class—there aren't many places outside of spidermonkey where a write barrier is required. ...
...ters is to look for usage of js_isabouttobefinalized(). if a pointer is weak, there's a good chance that js_isabouttobefinalized() is used to null it out if its referent is about to be finalized. however, this search misses some cases like the wrapper cache, where clearwrapper() is called directly from a finalizer. one saving grace is that most weak pointers already have a read barrier on them: x
pc_unmarkgray(). besides gray unmarking, this function automatically checks if an incremental gc is running and, if so, marks the given object black. this is how the read barrier for nswrappercache::getwrapper() actually works. moving gc there are two forms of moving gc we are likely to implement: generational gc and compacting gc. in generational gc, certain newly allocated are moved from one pla...
Manipulating bookmarks using Places
getfolderidforitem() method. var parentfolderid = bmsvc.getfolderidforitem(newbkmkid); observing changes to bookmarks and tags to set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods. note that this example takes advantage of x
pcomutils to generate the nsisupports.queryinterface() method. // an nsinavbookmarkobserver var myext_bookmarklistener = { onbeginupdatebatch: function() {}, onendupdatebatch: function() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextensi...
...ion() {}, onitemadded: function(aitemid, afolder, aindex) {}, onitemremoved: function(aitemid, afolder, aindex) {}, onitemchanged: function(abookmarkid, aproperty, aisannotationproperty, avalue) { myextension.dosomething(); }, onitemvisited: function(abookmarkid, avisitid, time) {}, onitemmoved: function(aitemid, aoldparent, aoldindex, anewparent, anewindex) {}, queryinterface: x
pcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmarklistener); }, dosomething: functio...
...ction is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmarklistener); }, dosomething: function() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using x
pcom without chrome - bookmark observer ...
FUEL
fuel is deprecated as of firefox 40 and removed as of firefox 47. consider using the add-ons sdk instead fuel is a javascript library designed to help developers build extensions using terminology and interfaces that are familiar to them. fuel is new in firefox 3. fuel is about making it easier for extension developers to be productive, by minimizing some of the x
pcom formality and adding some "modern" javascript ideas. we want to start with areas that will provide the most benefit. fuel has a fueliapplication interface that implements all the functions of extiapplication. the library has also been implemented in thunderbird ("steel") and in seamonkey ("smile"). objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents ext...
...erbird ("steel") and in seamonkey ("smile"). ...
...extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage fueliapplication objects fueliannotations fueliapplication fuelibookmark fuelibookmarkfolder fuelibookmarkroots fuelibrowsertab fueliwindow x
pcom although the fuel application object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code. the object needs to be accessed like any other x
pcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplication); ...
SMILE
we want to start with areas that will provide the most benefit. ...
...ns of extiapplication. the library has also been implemented in firefox ("fuel") and in thunderbird ("steel"). ...
... objects extiapplication objects exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage smileiapplication objects smileibookmarkroots smileiwindow smileibrowsertab smileiapplication x
pcom although the extiapplication object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code. the object needs to be accessed like any other x
pcom service: var application = components.classes["@mozilla.org/smile/application;1"].getservice(components.interfaces.smileiapplication); ...
Bundling multiple binary components
the more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between gecko versions. this can create a difficult situation for extension developers trying to support multiple gecko versions (firefox 2 and 3, for example). ...
...the more likely case is that the component uses "unfrozen" interfaces and those interfaces can change between gecko versions. this can create a difficult situation for extension developers trying to support multiple gecko versions (firefox 2 and 3, for example). ...
...lly, nspr has portable versions of those features that work across platforms. this approach uses only one binary for each platform (win/mac/linux) but creates complexity in the binaries - loading the methods and creating the wrappers. the costs get higher if you have many methods that need to be loaded. stub loader this approach involves using a stub loader component. the stub component is an x
pcom component itself and when registered by x
pcom, the code would sniff the runtime version and operating system then the stub load the appropriate "real" x
pcom component for the current configuration. it's pretty simple to do and the concept can be used to load third-party shared libraries (dll, so, dylib) used in x
pcom components. in this case, we would use the stub to load the right binary compo...
Resources
« previous this last section of the book provides a list of resources referred to in the tutorial and other links that may be useful to the gecko developer. ...
...this material may be distributed only ...
....4a/gecko-sdk-i686-
pc-linux-gnu-1.4a.tar.gz windows: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-win32-1.4a.zip other mozilla downloads gecko resources internal string guide external string guide the gecko networking library ("necko") the netscape portable runtime environment embedding mozilla current module owners xpinstall xul x
pcom resources the x
pcom project page xulplanet's online x
pcom reference information on x
pconnect and scriptable components the smart pointer guide xpidl xpidl compiler reference general development resources the world wide web consortium url specification at the w3 gnu make « previous copyright (c) 2003 by doug turner and ian oeschger. this material may be distributed only subject to the terms an...
Components.Exception
summary components.exception is a javascript constructor to create nsix
pcexception objects. these exception objects may be thrown when implementing x
pcom interfaces in javascript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will. see also nsix
pcexception. ...
...exception. ...
...eloper-facing locations, defaulting to 'exception' result the nsresult value of the exception, which defaults to components.results.ns_error_failure stack an x
pcom stack to be set on the exception (defaulting to the current stack chain) data any additional data you might want to store, defaulting to null example throw components.exception("i am throwing an exception from a javascript x
pcom component."); ...
Components.results
elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure... ...
...elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure... ...
...elements in this array can be used to test against unknown nsresult variables or they can be 'thrown' to indicate failure... ...
Components.utils
the object currently has the following members: editors! please keep this list in sync with the components object page methods method description cloneinto() create a structured clone of an object in a different javascript context. createarrayin() removed in gecko 31 returns an array created in specified compartment. createobjectin() creates a new object, created in the scope of the specified object's compartment. dispatch() dispatches a runnable to the current/main thread. ...
...() specify a list of constructors to import into the scope. isxraywrapper() test whether a given object is an xray or not. unload() unloads a js module loaded with import(). isdeadwrapper() determines whether this object is backed by a deadobjectproxy. lookupmethod() looks up a native (i.e. declared in the interface) method or property of an x
pcom object. serves the same purpose as x
pcnativewrapper. makeobjectpropsnormal() ensures that all functions come from the specified object's scope, and aren't cross-compartment wrappers. may only be called from javascript code. nondeterministicgetweakmapkeys() return the keys in a weak map. this operation is non-deterministic because it is affected by the scheduling of...
...age collection level for full garbage collection. see js_setgczeal for details; this method calls through to that with the specified value as the zeal value. unwaivexrays() undoes waivexrays(): reapplies the xray filtering protection. waivexrays() removes the filtering provided by an xray. properties property type description sandbox nsix
pccomponents_utils_sandbox creates sandbox objects for use with evalinsandbox(). ion boolean read only. strict boolean strict mode is enabled. this reflects the value of the javascript environment's option by the same name. read only. strict_mode boolean read only. werror boolean warnings should be treated as errors. this reflects th...
Development
source the latest source code is available on the mozilla trunk, in the extensions/java/x
pcom directory. build instructions the build instructions are available here: building javax
pcom. bugs all javax
pcom bugs are tracked in bugzilla, using the "core" product and "java to x
pcom bridge" component. ...
... source the latest source code is available on the mozilla trunk, in the extensions/java/x
pcom directory. build instructions the build instructions are available here: building javax
pcom. bugs all javax
pcom bugs are tracked in bugzilla, using the "core" product and "java to x
pcom bridge" component. ...
... source the latest source code is available on the mozilla trunk, in the extensions/java/x
pcom directory. build instructions the build instructions are available here: building javax
pcom. bugs all javax
pcom bugs are tracked in bugzilla, using the "core" product and "java to x
pcom bridge" component. ...
NS_GetComponentManager
the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
...the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
...the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
NS_GetComponentRegistrar
the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
...the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
...the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
NS_GetServiceManager
the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
...the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
...the interface pointer should be release'd when it is no longer needed. history this function was finalized for mozilla 0.9.6. see bug 99147 for details. ...
NS ConvertASCIItoUTF16 external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
NS ConvertUTF16toUTF8 external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
NS ConvertUTF8toUTF16 external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
NS LossyConvertUTF16toASCII external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
PromiseFlatCString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
PromiseFlatString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsACString (External)
methods ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsAString (External)
methods beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the lengt...
...parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const ...
...parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading prbool atrailing defaultcomparator print32 defaultcomparator(const prunichar*, const...
nsAutoString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsCAutoString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsCStringContainer (External)
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral f...
... parameters char aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char ...
... parameters char aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char aset prbool aleading ...
nsCString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsDependentCString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsDependentCSubstring external
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsDependentString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsDependentSubstring external
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare(const prunichar*, print32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral ...
... parameters char aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char ...
... parameters char aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char aset prbool aleading ...
nsLiteralCString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsLiteralString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsStringContainer (External)
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
nsString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char...
... parameters char* aset stripwhitespace void stripwhitespace() - source strip whitespace characters from the string. trim void trim(const char*, prbool, prbool) - source parameters char* aset prbool aleading...
imgIDecoderObserver
called when there...
...ion onstartrequest() a load notification which is called at the same time that nsirequestobserver.onstartrequest() would be (used only for observers of imgirequest objects, which are nsirequests, not imgidecoder objects). void onstartrequest( in imgirequest arequest ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. onsto
pcontainer() warning: do not implement this. it is useless and going away. void onsto
pcontainer( in imgirequest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. acontainer missing description onstopdecode() in theory a decode notification, but currently a load notification.
...s complete. unfortunately, this is currently the only way to signal decoding errors to consumers, and the only decoding errors that consumers care about (indeed, the only ones that they're prepared to hear about) are failures to instantiate the decoder (<img src="foo.html"> for example). thus, currently this is just a companion to onstoprequest to signal success or failure. you probably want onsto
pcontainer instead. this will be revisited in bug 505385. if you're thinking of doing something new with this, please talk to bholley first. void onstopdecode( in imgirequest arequest, in nsresult status, in wstring statusarg ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object. status missing description statusa...
nsIChannel
vice.newchannel()), parameters for that request may be set by using the channel attributes, or by calling queryinterface() to retrieve a subclass of nsichannel for protocol-specific parameters. then, the uri can be fetched by calling open() or asyncopen(). after a request has been completed, the channel is still valid for accessing protocol-specific results. for example, queryinterfacing to nsihtt
pchannel allows response headers to be retrieved for the corresponding http transaction. this interface must be used only from the x
pcom main thread. implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshtt
pchannel.cpp. method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes ...
...t the original pre-redirect uri can still be obtained. this is also used as the ri of the document resulting from the channel, unless the channel has the load_replace flag set. this is never null. attempts to set it to null must throw. note: this is distinctly different from the http referer (referring uri), which is typically the page that contained the original uri (accessible from nsihtt
pchannel.) owner nsisupports the owner, corresponding to the entity that is responsible for this channel. used by the security manager to grant or deny privileges to mobile code loaded from this channel. note: this is a strong reference to the owner, so if the owner is also holding a strong reference to the channel, care must be taken to explicitly drop its reference to the ...
...ould not call this method, because it tends to fail when a request is redirected, rather than redirecting transparentlynote: nsichannel implementations are not required to implement this method. moreover, since this method may block the calling thread, it should not be called on a thread that processes ui events. like any other nsichannel method it must not be called on any thread other than the x
pcom main thread. nsiinputstream open(); parameters none. return value blocking input stream to the channel's data. exceptions thrown ns_error_in_progress if the channel is reopened. see also nsichanneleventsink for onchannelredirect ...
nsIClassInfo
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsisupports gethelperforlanguage(in pruint32 language); void getinterfaces(out pruint32 count, [array, size_is(count), retval] out nsiidptr array); attributes attribute type description classdescription string a human readable string naming the class, or null. read only. classid nscidptr a classid through which an instance of this class can be created, or null. ...
...tribute has the singleton bit set, then the value of this attribute specifies a classid through which this class can be accessed as a service using nsiservicemanager.getservice(). this attribute is similar to the classid attribute; however, this attribute exists so that c++ callers can avoid allocating and freeing a nscid object, as would happen if they used classid. read only. violates the x
pcom interface guidelines exceptions thrown ns_error_not_available if the class does not have a classid contractid string a contractid through which an instance of this class 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 servi...
...m the flags attribute of a nsiclassinfo implementation. obsolete since gecko 2.0 methods gethelperforlanguage() get a language mapping specific helper object that may assist in using objects of this class in a specific lanaguage. for example, if asked for the helper for nsiprogramminglanguage::javascript this might return an object that can be nsisupports.queryinterface()'d into the nsix
pcscriptable interface to assist x
pconnect in supplying javascript specific behavior to callers of the instance object. nsisupports gethelperforlanguage( in pruint32 language ); parameters language this parameter selects the language mapping specific helper object to be returned. nsiprogramminglanguage defines language identifiers that may be passed for this parameter. return value shoul...
nsIComponentRegistrar
x
pcom/components/nsicomponentregistrar.idlscriptable this interface provides methods to access and modify the x
pcom component registry. inherits from: nsisupports last changed in gecko 1.0 method overview void autoregister(in nsifile aspec); void autounregister(in nsifile aspec); string cidtocontractid(in nscidref aclass); nscidptr contractidtocid(in string acontractid); nsisimpleenumerator enumeratecids(); nsisimpleenumerator enumeratecontractids(); boolean iscidregistered(in nscidref aclass); boolean iscontractidregistered(in string acontractid); void registerfactory(in nscidref aclass, in string aclassname, in string acontractid, in nsifactory afactory); void registerfactorylocation(in nscidref aclass, in string aclassname, in string acontractid, in ns...
...ch this loader defines. for example, if the given file is a native library, it must export the symbol nsgetmodule. other loaders may have different semantics. this method may only be called from the main thread. void autoregister( in nsifile aspec ); parameters aspec this parameter indicates either a component file to be registered or a directory containing component files to be registered. x
pcom <= 1.8: if aspec is null, then the application component's directory as defined by ns_x
pcom_component_dir will be registered. see nsdirectoryservice. x
pcom >= 1.9: if aspec is null, static components, gre components, and the the application's component directories will be registered. see ns_gre_dir, ns_x
pcom_component_dir, and ns_x
pcom_component_dir_list in nsdirectoryservice. autounregister()...
...gister() unregister a component file or all component files in a directory. this method may only be called from the main thread. void autounregister( in nsifile aspec ); parameters aspec this parameter indicates either a component file to be unregistered or a directory containing component files to be unregistered. if aspec is null, then the application component's directory as defined by ns_x
pcom_component_dir will be unregistered. see nsdirectoryservice. cidtocontractid() this method returns the contractid corresponding to a given classid. string cidtocontractid( in nscidref aclass ); parameters aclass the classid to be queried. return value the contractid corresponding to aclassid if one exists and is registered. contractidtocid() returns the classid for a given contractid, if o...
nsIContentSecurityPolicy
content/base/public/nsicontentsecuritypolicy.idlscriptable describes an x
pcom component used to model and enforce content security policies. ...
... describes an x
pcom component used to model and enforce content security policies. ...
... be "refined" or tightened by the one specified in the string policystring. void refinepolicy( in astring policystring, in nsiuri selfuri ); parameters policystring selfuri scanrequestdata() called after the content security policy object is created to fill in the appropriate request and request header information needed in case a report needs to be sent. void scanrequestdata( in nsihtt
pchannel achannel ); parameters achannel sendreports() manually triggers violation report sending given a uri and reason. the uri may be null, in which case "self" is sent. void sendreports( in astring blockeduri, in astring violateddirective ); parameters blockeduri the uri that violated the policy. violateddirective the directive that was violated. shouldload() delegate method called by...
nsIFile
inherits from: nsisupports last changed in gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27) nsifile is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility. with an nsifile you can navigate to ancestors or descendants without having to deal with the different path separators used on different platforms, query the state of any file or directory at the position represented by the nsifile and create, move or copy items in the filesystem. ...
...specific path string or by using cross-platform locations retrieved from the directory service. all methods with string parameters have two forms. the preferred form operates on utf-16 encoded characters strings. an alternate form operates on characters strings encoded in the "native" charset. a string containing characters encoded in the native charset cannot be safely passed to javascript via x
pconnect. therefore, the utf-16 forms are scriptable, but the "native methods" are not. in addition, the native form cannot deal with files whose name contains characters outside the default system code page on windows. using the native form limits the ability of your code to deal with the full unicode support on windows 2000 or later where the os itself does not have such a limitation. therefore, y...
...ronment variables (with the precedence the same as the order they're enumerated). on win32 platforms, it is the currently selected ansi codepage (specified by cp_acp). the word "native" appears in the name of methods that operate on or return strings encoded in the native character set. a string containing characters encoded in the native character set cannot be safely passed to javascript via x
pconnect. therefore, the "native" methods and attributes are not scriptable. x
pcom provides the string conversion functions ns_cstringtoutf16 and ns_utf16tocstring, which can be used to convert a string between utf-16 and the native character encoding. this interface was frozen for gecko 1.0. see bug 129279 for details. from gecko 2.0 interfaces are no longer frozen. see also nsilocalfile ns_...
nsIHttpHeaderVisitor
netwerk/protocol/http/nsihttpheadervisitor.idlscriptable this interface is used to view http request and response headers. inherits from: nsisupports last changed in gecko 1.7 method overview void visitheader(in acstring aheader, in acstring avalue); methods visitheader() called by the nsihtt
pchannel implementation when visiting request and response headers. this method can throw an exception to terminate enumeration of the channel's headers. void visitheader( in acstring aheader, in acstring avalue ); parameters aheader a string containing the key for a header such as "content-type" avalue the header's value field such as "text/html". multiple values are separated by a comma. example this example shows how to detect flash content. it imple...
...ontent-type" ) !== -1 ) { if ( avalue.indexof( "application/x-shockwave-flash" ) !== -1 ) { this._isflash = true; } } }; mynsihttpheadervisitor.prototype.isflash = function ( ) { return this._isflash; }; myhttprequestobserver = function ( ) { this.register( ); this.aborted = components.results.ns_binding_aborted; this.nsihtt
pchannel = components.interfaces.nsihtt
pchannel; this.nsichannel = components.interfaces.nsichannel; this.nsirequest = components.interfaces.nsirequest; }; myhttprequestobserver.prototype.observe = function ( subject, topic, data ) { var uri, avisitor; if ( subject instanceof this.nsihtt
pchannel ) { avisitor = new mynsihttpheadervisitor( ); ...
...nse", false); }; myhttprequestobserver.prototype.unregister = function ( ) { var observerservice = components.classes[ "@mozilla.org/observer-service;1" ].getservice( components.interfaces.nsiobserverservice ); observerservice.removeobserver( this, "http-on-examine-response" ); observerservice.removeobserver(this, "http-on-examine-cached-response"); }; see also nsihtt
pchannel ...
nsIJSID
js/src/x
pconnect/idl/x
pcjsid.idlscriptable this interface provides information about a contract or interface. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) the following methods return objects that implement this interface: components.interfaces.name components.classes[contract] components.interfacesbyid[uuid] components.classesbyid[cid] the first two cases create a named jsid while the last two cases create an unnamed jsid. an unnamed jsid also results when you implement a function that is passed an nsiidref parameter, such as queryinterface(). note that for these cases of jsid the specified class or interface must exist and be scriptable. ...
... the first two cases create a named jsid while the last two cases create an unnamed jsid. an unnamed jsid also results when you implement a function that is passed an nsiidref parameter, such as queryinterface(). note that for these cases of jsid the specified class or interface must exist and be scriptable. method overview boolean equals(in nsijsid other); const nsid* getid(); violates the x
pcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only. native code only! obsolete since gecko 1.9 the internal nsid. name string read only. the name of the jsid, if it was set. number string read only. the string representation of the internal nsid. valid boolean read only. returns true if the j...
...presentation of the internal nsid. valid boolean read only. returns true if the jsid has been initialised. methods equals() this method determines if this nsijsid has the same nsid as another nsijsid. boolean equals( in nsijsid other ); parameters other the other nsijsid to compare to. return value true if the nsijsid's are valid and have the same nsid, otherwise false. violates the x
pcom interface guidelines getid() const nsid* getid(); parameters none. return value a pointer to the internal nsid structure. initialize() initializes the jsid. void initialize( in string idstring ); parameters idstring the number to initialize the jsid, in string format, e.g. {00000000-0000-0000-c000-000000000046}. a jsid can only be initialized once. tostring() this methods returns a st...
nsILocalFileMac
x
pcom/io/nsilocalfilemac.idlscriptable please add a summary to this article. ...
... x
pcom/io/nsilocalfilemac.idlscriptable please add a summary to this article. ...
.../ 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. init this object to point to an application having the given creator code. if this app is missing, this will fail. it will first look for running application with the given creator. void inittoappwithcreatorcode( in ostype aap
pcreator ); parameters aap
pcreator the signature of the app. native code only!initwithcfurl init this object with a cfurlref. note: supported only for xp_macosx. note: if the path of the cfurl is /a/b/c, at least a/b must exist beforehand. void initwithcfurl( in cfurlref acfurl ); parameters acfurl the corefoundation url. native code only!initwithfsref init this object with an fsref. note: s...
nsIProperties
x
pcom/ds/nsiproperties.idlscriptable this interface provides methods to access a map of named x
pcom object values. inherits from: nsisupports last changed in gecko 1.2 implemented by: @mozilla.org/file/directory_service;1. to get an instance, use: var properties = components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties); method overview void get(in string prop, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); void getkeys(out pruint32 count, [array, size_is(count), retval] out string keys); boolean has(in string prop); void set(in string prop, in nsisupports value); void undefine(in string prop); methods get() gets the x
pcom object associated with a particular name. void get( in...
...id, [iid_is(iid),retval] out nsqiresult result ); parameters prop the property name. iid the desired interface. result the resulting object instance. exceptions thrown ns_error_failure if the property does not exist. ns_error_no_interface if the property exists, but does not support the requested interface. getkeys() returns an array of property names. nsmemory.h defines the macro ns_free_x
pcom_allocated_pointer_array, which can be used to free akeys when it is no longer needed. void getkeys( out pruint32 count, [array, size_is(count), retval] out string keys ); parameters count the length of the result array. keys the resulting array of keys. has() tests if a property exists. boolean has( in string prop ); parameters prop the property name. return value true if the proper...
...it is no longer needed. void getkeys( out pruint32 count, [array, size_is(count), retval] out string keys ); parameters count the length of the result array. keys the resulting array of keys. has() tests if a property exists. boolean has( in string prop ); parameters prop the property name. return value true if the property exists, false if the property does not exist. set() sets the x
pcom object associated with a particular name. void set( in string prop, in nsisupports value ); parameters prop the property name. value the x
pcom object value to associate with prop. undefine() undefines a property. void undefine( in string prop ); parameters prop the property name. remarks this interface was frozen for gecko 1.2. see bug 162114 for details. from gecko 2.0 interfaces a...
nsISyncMessageSender
dl inherits from: nsimessagelistenermanager message "senders" have a single "other side" to which messages are sent. for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager. see message manager interfaces for more details on the distinction between message senders and message broadcasters. both sendsyncmessage() and sendr
pcmessage() will block until a reply is received, but they may be temporarily interrupted to process an urgent incoming message (such as a cpow request). methods jsval sendsyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); ...
...ock until a reply is received, but they may be temporarily interrupted to process an urgent incoming message (such as a cpow request). methods jsval sendsyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); jsval sendr
pcmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendsyncmessage() like sendasyncmessage(), except blocks the sender until all listeners of the message have been invoked. returns an array containing return values from each liste...
...his becomes the objects property of the received message, with each original object replaced with a cross process object wrapper for it. principal nsiprincipal returns array: an array of structured clones of the objects returned by all the listeners to this message, one element for each listener. if there was only one listener, it is an array with a single element. sendr
pcmessage() like sendsyncmessage(), except re-entrant. new r
pc messages may be issued even if, earlier on the call stack, we are waiting for a reply to an earlier sendr
pcmessage() call. parameters name type description messagename string the name of the message. optional. this becomes the name property of the received message. obj jsonable o...
nsITaskbarTabPreview
this is done by windows and cannot be prevented. when there are no more tab previews left for a window, the window preview is automatically made visible again. an application may have as many tab previews as memory allows. you can't directly instantiate this interface; instead, call the nsiwintaskbar.createtaskbartabpreview(). method overview void ensureregistration(); violates the x
pcom interface guidelines nativewindow gethwnd(); violates the x
pcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview. this is null by default. title domstring the title displayed above the thumbnail. by defa...
...es the x
pcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview. this is null by default. title domstring the title displayed above the thumbnail. by default, this is an empty string. methods violates the x
pcom interface guidelines ensureregistration() used internally to ensure that the taskbar knows about this preview. if a preview is not registered, the api call to set its sibling (via the move() method) will fail silently. this method is only invoked when it's safe to make taskbar api calls. void ensureregistration(); parameters none. ...
... nativewindow gethwnd(); parameters none. return value the hwnd for the preview's proxy window. move() relocates the preview relative to another tab preview from the same window. ...
nsITextInputProcessor
attribute value of dispatching printable keyboard events is computed from key value automatically if the attribute isn't initialized or initialized with 0. for the latter case, you may not want textinputprocessor to compute keycode attribute value. in this case, you can suppress the computation with this flag. if this is specified with non-zero keycode attribute value, this causes throwing an exce
pction since it doesn't make sense. key_dont_dispatch_modifier_key_event 0x00000020 one of akeyflags. textinputprocessor manages modifier state with every modifier key events. in other words, when you need to specify modifier key state of dispatching keyboard events, you need to dispatch modifier key events before and after that. however, especially for keeping compatibility with lega...
...ing suppressing text input are not pressed. for example, ctrl+c should be "c", ctrl+shift+cshould be "c", altgr+c may be "©" and then, ctrl+altgr+c should be "©". when you dispatch non-printable key events, this value should be one of the key names defined by dom level 3 keyboardevent key values or registered by gecko with "moz" prefix. code optional, but should be specified when you emulate
pc keyboard operation. the value should be one of the physical key names defined by dom level 3 keyboardevent code values. keycode optional, but should be specified when you dispatch printable key events. when you emulate
pc keyboard, deciding the value may be complicated. although the rules to decide the keycode value are different on each web browser, you should use same rules as gecko because...
...rdevent.keycode for the strict rules of gecko. when you dispatch non-printable key events, preferred keycode value is computed from key value automatically if you don't initialize this value. but the computation doesn't emulate the mapping of native key event handling completely because it has some special cases depending on platform or selected keyboard layout. therefore, if you need to emulate
pc keyboard on specific platform, you may need to specify this explicitly. location optional. it's not recommended to specify this explicitly since this value should be linked with code attribute value. the automatic computation can compute the best value for this. repeat optional. when you emulate auto-repeat caused by long keypress, you can specify this true. modifier state management this ...
nsIUpdateChecker
toolkit/mozapps/update/nsiupdateservice.idlscriptable this interface describes an object that knows how to check for software updates. ...
... 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 sto
pchecking(in unsigned short duration); constants constant value description current_check 1 constant for the sto
pchecking() method indicating that only the current update check should be stopped. current_session 2 constant for the sto
pchecking() method indicating that all update checks during the current session should be stopped. any_checks 3 constant for the sto
pchecking() method indicating that all update checking should be stopped. this disables the update checking preferences. methods checkforupda...
...pdatechecklistener to be notified of the results of an update check. force if true, the update checker checks for updates, regardless 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. sto
pchecking() ends any pending update check. void sto
pchecking( 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 ...
nsIVersionComparator
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) version strings are dot-separated sequences of version-parts. a version-part consists of up to four parts, all of which are optional: <number-a><string-b><number-c><string-d (everything else)> a version-part may also consist of a single asterisk "*" which indicates * "infinity". numbers are base-10, and are zero if left out. strings are compared bytewise. for additional backwards compatibility, if "string-b" is "+" then "number-a" is incremented by 1 and "string-b" becomes "pre". ...
...are base-10, and are zero if left out. strings are compared bytewise. for additional backwards compatibility, if "string-b" is "+" then "number-a" is incremented by 1 and "string-b" becomes "pre". ...
...re". 1.0pre1 < 1.0pre2 < 1.0 == 1.0.0 == 1.0.0.0 < 1.1pre == 1.1pre0 == 1.0+ < 1.1pre1a < 1.1pre1 < 1.1pre10a < 1.1pre10 implemented by: @mozilla.org/x
pcom/version-comparator;1. the service can be accessed directly via services.vc after loading services.jsm or with the following code: var versioncomparator = components.classes["@mozilla.org/x
pcom/version-comparator;1"] .getservice(components.interfaces.nsiversioncomparator); method overview long compare(in acstring a, in acstring b); methods compare() compare two version strings. long compare( in acstring a, in acstring b ); parameters a the first version. b the second version. return value if a and b are two versi...
nsIWebProgressListener
er should be ignored unless astateflags includes the state_stop bit. the status code indicates success or failure of the request associated with the state change. note: astatus may be a success code even for server generated errors, such as the http 404 file not found error. in such cases, the request itself should be queried for extended error information (for example for http requests see nsihtt
pchannel. onstatuschange() notification that the status of a request has changed. the status message is intended to be displayed to the user (for example, in the status bar of the browser). void onstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage ); parameters awebprogress the nsiwebprogress instance that fired the notifi...
...he webprogress, use // the outerwindowid. this can be communicated back down to the content // in order to do send a command to a particular dom window. ...
...mmunicated back down to the content // in order to do send a command to a particular dom window. ...
nsIAbCard/Thunderbird3
, properties are now stored in a hash table instead of as attributes on the interface, allowing it to be more flexible. properties currently supported on the card: names: firstname, lastname phoneticfirstname, phoneticlastname displayname, nickname spousename, familyname primaryemail, secondemail home contact: homeaddress, homeaddress2, homecity, homestate, homezi
pcode, homecountry homephone, homephonetype work contact. same as home, but with `work' instead of `home' other contact: faxnumber, faxnumbertype pagernumber, pagernumbertype cellularnumber, cellularnumbertype jobtitle, department, company _aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 ...
...opertyasbool(in string name); returns a property for the given name. these functions convert values in the same manner as the default implementation of nsivariant. of particular note is that boolean variables are converted to integers as in c/c++ (true is a non-zero value), so that false will be converted to a string of 0 and not false<code>. these functions are marked <code>[noscript] since x
pcconnect performs automatic type conversion on nsivariant such that they are not needed for scripts, only for c++ callers. parameters name the case-sensitive name of the property to get. return value the value of the attribute asked for. exceptions thrown ns_error_not_available<tt> if the named property does not exist. <tt>ns_error_cannot_convert_data if the property cannot be con...
...constraints for certain properties. however, such constraints might not be checked by this method. these functions convert values in the same manner as the default implementation of nsivariant. a value must be convertible to a string; if this convention is not followed, consumers of cards may fail unpredictably or return incorrect results. the non-variant functions are marked [noscript] since x
pconnect uses magic with nsivariant such that the other functions are not needed, although c++ does need them. void setproperty(in autf8string name, in nsivariant value); [noscript] void setpropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyasuint32(in string name, in pruint32 value); [...
Frequently Asked Questions
you find what you're looking for faster. in most cases, the answer will just refer back into the reference manual, above. no need to explain things twice :-). buildtime errors the build just broke. it's not in your code, or it's not on your platform, but there's an nscomptr on the line where the error is and you're suspicious. you're looking in the right place. ...
...to the reference manual, above. no need to explain things twice :-). buildtime errors the build just broke. it's not in your code, or it's not on your platform, but there's an nscomptr on the line where the error is and you're suspicious. you're looking in the right place. comparing an nscomptr to a raw x
pcom interface pointer declaring an nscomptr to a forward-declared class not linking to x
pcom not including nscomptr.h different settings of nscap_feature_debug_ptr_types runtime errors ns_assertion "queryinterface needed" may be caused by a class that derives from a given interface, when you forgetting to also specify the interface name in the ns_impl_isupports / ns_impl_threadsafe_isupports macro. for example, the assertion occurs when you convert the pointer to the object to a ...
..., &rv) ); if ( foo ) foo->dosomefoothing(); // |foo| goes out of scope, and so |release|s its referent, here } // ...tons of stuff here, during which i don't need an |nsifoo| return rv; } editors note: move this discussion to the efficiency section, and link to it from here. make an nscomptr leak (for a debug test)? call a getter that uses a raw x
pcom interface pointer as an `in/out' parameter? call a getter that fills in an nsifoo*& parameter? call a getter that doesn't addref its result? any x
pcom function that returns an interface pointer, i.e., a `getter', must have already addrefed that pointer. if it didn't, you should probably report it as a bug. no matter which code pattern you use to solve this problem, you should comment it, e.g...
Index
s implemented in js and doesn't follow the same pattern as the c++ protocols. 40 mailnews fakeserver mailnews, seamonkey, thunderbird fakeserver is a testing server that implements a generic text-based protocol common to all major mailnews protocols (pop, imap, smtp, and nntp) designed for use in automated tests. it can also be used in manual qa tests. 41 mailnews x
pcshell-tests automated testing, developing mozilla, mailnews, seamonkey, thunderbird mailnews x
pcshell-tests are written and run in the same manner as the core x
pcshell-tests. this page describes additional resources and facilities that mailnews has developed to support the x
pcshell-tests; see the core x
pcshell-tests page for more information on how to develop these. 42 mailbox...
...erbird can sometimes appear confusing when you're just beginning to look at it. as such, i've always thought it would be nice to have a list of what xul, js, or other files are that are here, what they do, and where they overlay at different points within the client. things appear confusing for several reasons: 45 message interfaces interfaces, interfaces:scriptable, needscontent, x
pcom api reference, thunderbird nsimsghdr - this interface describes headers for all mail messages. it can be used to retrieve address, subject and related header information for a mail message. 46 message examples thunderbird no summary! 47 message list examples thunderbird no summary! 48 message list interfaces thunderbird no sum...
... in many cases you only need to learn a few concepts to write an extension. 74 building a thunderbird extension 1: introduction add-ons, extensions, thunderbird thunderbird is a community managed open-source email application. it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the x
pcom cross-platform component object model. similar to firefox, thunderbird functionality can be enhanced and customized via extensions. 75 building a thunderbird extension 2: extension file layout extensions, thunderbird extensions are packaged and distributed in archive files (also known as bundles), with the xpi (pronounced “zippy”) file extension. at a minimum, they cont...
ctypes
to do this, we can use arraytype, but example for this i don't know at this time. ...
... but example for this i don't know at this time. ...
...: getting tb_button is crashing and not working) example of cast and functiontype on windows components.utils.import("resource://gre/modules/ctypes.jsm"); var kernel = ctypes.open("kernel32.dll"); var hmodule = ctypes.uint32_t; var hwnd = ctypes.uint32_t; var l
pctstr = ctypes.jschar.ptr; var l
pcstr = ctypes.char.ptr; var loadlibrary = kernel.declare("loadlibraryw", ctypes.winapi_abi, hmodule, l
pctstr); var getprocaddress = kernel.declare("getprocaddress", ctypes.winapi_abi, ctypes.void_t.ptr, hmodule, l
pcstr); var huser = loadlibrary("user32"); var funcptr = getprocaddress(huser, "messageboxw"); // now we have a pointer to a function, let's cast it to the right type var messageboxtype = ctypes.functiontype(ctypes.winapi_abi, ctypes.int32_t, [hwnd, l
pctstr, l
pctstr, ctypes.uint32_t]); fu...
Animation.pause() - Web APIs
is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity. ...
...cake.addeventlistener("mouseup", stopplayingalice, false); bottle.addeventlistener("mouseup", stopplayingalice, false); specifications specification status co...
...tion / 2 }); // doesn't actually need to be eaten until a click event, so pause it initially: nommingcake.pause(); additionally, when resetting : // an all-purpose function to pause the animations on alice, the cu
pcake, and the bottle that reads "drink me." var stopplayingalice = function() { alicechange.pause(); nommingcake.pause(); drinking.pause(); }; // when the user releases the cu
pcake or the bottle, pause the animations. cake.addeventlistener("mouseup", stopplayingalice, false); bottle.addeventlistener("mouseup", stopplayingalice, false); specifications specification status comment web animationsthe definition of 'play()' in that specification. working draft ...
AudioBuffer - Web APIs
ntext.createbuffer(). once put into an audiobuffer, the audio can then be played by being passed into an audiobuffersourcenode. objects of these types are designed to hold small audio snippets, typically less than 45 s. for longer sounds, objects implementing the mediaelementaudiosourcenode are more suitable. the buffer contains data in the following format: non-interleaved ieee754 32-bit linear
pcm with a nominal range between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. if the audiobuffer has multiple channels, they are stored in separate buffer. constructor audiobuffer() creates and returns a new audiobuffer object instance. properties audiobuffer.samplerate read only returns a float representing the sample rate, in samples per sec...
...inal range between -1 and +1, that is, 32bits floating point buffer, with each samples between -1.0 and 1.0. if the audiobuffer has multiple channels, they are stored in separate buffer. constructor audiobuffer() creates and returns a new audiobuffer object instance. properties audiobuffer.samplerate read only returns a float representing the sample rate, in samples per second, of the
pcm data stored in the buffer. audiobuffer.length read only returns an integer representing the length, in sample-frames, of the
pcm data stored in the buffer. audiobuffer.duration read only returns a double representing the duration, in seconds, of the
pcm data stored in the buffer. audiobuffer.numberofchannels read only returns an integer representing the number of discrete audio channels...
...he buffer. audiobuffer.length read only returns an integer representing the length, in sample-frames, of the
pcm data stored in the buffer. audiobuffer.duration read only returns a double representing the duration, in seconds, of the
pcm data stored in the buffer. audiobuffer.numberofchannels read only returns an integer representing the number of discrete audio channels described by the
pcm data stored in the buffer. methods audiobuffer.getchanneldata() returns a float32array containing the
pcm data associated with the channel, defined by the channel parameter (with 0 representing the first channel). audiobuffer.copyfromchannel() copies the samples from the specified channel of the audiobuffer to the destination array. audiobuffer.copytochannel() copies the samples to the...
RTCDataChannel: bufferedamountlow event - Web APIs
t event handler property onbufferedamountlow examples this example sets up a handler for bufferedamountlow to request more data any time the data channel's buffer falls below the number of bytes specified by bufferedamountlowthreshold, which we have set to 65536. in other words, we'll try to keep at least 64kb of data in the buffer, reading 64kb at a time from the source. ...
...bufferedamountlow examples this example sets up a handler for bufferedamountlow to request more data any time the data channel's buffer falls below the number of bytes specified by bufferedamountlowthreshold, which we have set to 65536. in other words, we'll try to keep at least 64kb of data in the buffer, reading 64kb at a time from the source. let
pc = new rtcpeerconnection(); let dc =
pc.createdatachannel("sendfile"); let source = /* source data object */ dc.bufferedamountlowthreshold = 65536;
pc.addeventlistener("bufferedamountlow", ev => { if (source.position <= source.length) { dc.send(source.readfile(65536)); } }, false); after creating the rtcpeerconnection, this calls rtcpeerconnection.createdatachannel() to create the data channel. then a listener is created fo...
...nd(source.readfile(65536)); } }, false); after creating the rtcpeerconnection, this calls rtcpeerconnection.createdatachannel() to create the data channel. then a listener is created for bufferedamountlow to refill the incoming data buffer any time its contents fall below 65536 bytes. you can also set up a listener for bufferedamountlow using its event handler property, onbufferedamountlow:
pc.onbufferedamountlow = ev => { if (source.position <= source.length) { dc.send(source.readfile(65536)); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'bufferedamountlow' in that specification. candidate recommendation ...
RTCDtlsTransport.state - Web APIs
he result of an error (such as receipt of an error alert or failure to validate the remote fingerprint). examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. ...
...gerprint). examples this example presents a function, tallysenders(), which iterates over an rtcpeerconnection's rtcrtpsenders, tallying up how many of them are in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. let
pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ... ...
... in various states. the function returns an object containing properties whose values indicate how many of the senders are in each state. let
pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ... ...
RTCIceTransport: selectedcandidatepairchange event - Web APIs
d, by extension, by an rtcpeerconnection. bubbles no cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user information about the progress of the ice negotiation for an rtcpeerconnection called
pc. ...
...tcpeerconnection. bubbles no cancelable no interface event event handler property onselectedcandidatepairchange examples this example creates an event handler for selectedcandidatepairchange that updates a display providing the user information about the progress of the ice negotiation for an rtcpeerconnection called
pc. ...
...te-protocol"); icetransport.addeventlistener("selectedcandidatepairchange", ev => { let pair = icetransport.getselectedcandidatepair(); localprotoelem.innertext = pair.local.protocol.touppercase(); remoteprotoelem.innertext = pair.remote.protocol.touppercase(); }, false) this can also be done by setting the onselectedcandidatepairchange event handler property directly. ...
RTCOfferOptions.iceRestart - Web APIs
od, if it's available. fundamentally, this renegotiation is triggered by generating and using new values for the ice username fragment ("ufrag")}} example this example shows a handler for the iceconnectionstatechange event. it watches for the ice connection state to transition to "failed", which indicates that an ice restart should be tried in order to attempt to bring the connection back up. ...
...ion is triggered by generating and using new values for the ice username fragment ("ufrag")}} example this example shows a handler for the iceconnectionstatechange event. it watches for the ice connection state to transition to "failed", which indicates that an ice restart should be tried in order to attempt to bring the connection back up. ...
...alues for the ice username fragment ("ufrag")}} example this example shows a handler for the iceconnectionstatechange event. it watches for the ice connection state to transition to "failed", which indicates that an ice restart should be tried in order to attempt to bring the connection back up.
pc.oniceconnectionstatechange = function(evt) { if (
pc.iceconnectionstate === "failed") { if (
pc.restartice) {
pc.restartice(); } else {
pc.createoffer({ icerestart: true }) .then(
pc.setlocaldescription) .then(sendoffertoserver); } } } if the state changes to failed, this handler starts by looking to see if the rtcpeerconnection includes the restartice() method; if it does, we call that to request an ice restart. otherwise, we call back to the older techni...
RTCPeerConnection.addIceCandidate() - Web APIs
ion is transmitted to the remote peer using a candidate with an a-line value of end-of-candidates. during negotiation, your app will likely receive many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list of potential connection methods. this is covered in more detail in the articles webrtc connectivity and signaling and video calling. ...
...ld in any of the remote descriptions being considered. one or more of the values in the candidate string are invalid or could not be parsed. attempting to add the candidate fails for any reason. examples this code snippet shows how to signal ice candidates across an arbitrary signaling channel. ...
... // all ice candidates have been sent // } // } signalingchannel.onmessage = receivedstring => { const message = json.parse(receivedstring); if (message.ice) { // a typical value of ice here might look something like this: // // {candidate: "candidate:0 1 udp 2122154243 192.168.1.9 53421 typ host", sdpmid: "0", ...} // // pass the whole thing to addicecandidate:
pc.addicecandidate(message.ice).catch(e => { console.log("failure during addicecandidate(): " + e.name); }); } else { // handle other things you might be signaling, like sdp } } the last candidate to be signaled this way by the remote peer will be a special candidate denoting end-of-candidates. out of interest, end-of-candidates may be manually indicated as follows:
pc.addicecan...
RTCPeerConnection.close() - Web APIs
ing, but for all intents and purposes, they're stopped). once this method returns, the signaling state as returned by rtcpeerconnection.signalingstate is closed. make sure that you delete all references to the previous rtcpeerconnection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser. ...
...they're stopped). once this method returns, the signaling state as returned by rtcpeerconnection.signalingstate is closed. make sure that you delete all references to the previous rtcpeerconnection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser. ...
... closed. make sure that you delete all references to the previous rtcpeerconnection before attempting to create a new one that connects to the same remote peer, as not doing so might result in some errors depending on the browser. example var
pc = new rtcpeerconnection(); var dc =
pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data);
pc.close(); // we decided to close after the first received message }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function () { console.log("datachannel close"); }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.close()' in that specification. c...
RTCPeerConnection: iceconnectionstatechange event - Web APIs
iceconnectionstatechange property or by using addeventlistener() on the rtcpeerconnection. in this example, a handler for iceconnectionstatechange is set up to update a call state indicator by using the value of iceconnectionstate to create a string which corresponds to the name of a css class that we can assign to the status indicator to cause it to reflect the current state of the connection. ...
...echange is set up to update a call state indicator by using the value of iceconnectionstate to create a string which corresponds to the name of a css class that we can assign to the status indicator to cause it to reflect the current state of the connection. ...
...ceconnectionstate to create a string which corresponds to the name of a css class that we can assign to the status indicator to cause it to reflect the current state of the connection.
pc.addeventlistener("iceconnectionstatechange", ev => { let stateelem = document.queryselector("#call-state"); stateelem.classname = `${
pc.iceconnectionstate}-state`; }, false); this can also be written as:
pc.oniceconnectionstatechange = ev => { let stateelem = document.queryselector("#call-state"); stateelem.classname = `${
pc.iceconnectionstate}-state`; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'iceconnectionstatechange' in that specification. candidate recommendation ...
RTCPeerConnection.sctp - Web APIs
ed, this value is null. the sctp transport is used for transmitting and receiving data for any and all rtcdatachannels on the peer connection. syntax var sctp = rtcpeerconnection.sctp; value a rtcsctptransport object describing the sctp transport being used by the rtcpeerconnection for transmitting and receiving on its data channels, or null if sctp negotiation hasn't happened. ...
...s used for transmitting and receiving data for any and all rtcdatachannels on the peer connection. syntax var sctp = rtcpeerconnection.sctp; value a rtcsctptransport object describing the sctp transport being used by the rtcpeerconnection for transmitting and receiving on its data channels, or null if sctp negotiation hasn't happened. ...
...n for transmitting and receiving on its data channels, or null if sctp negotiation hasn't happened. example var
pc = new rtcpeerconnection(); var channel =
pc.createdatachannel("mydata"); channel.onopen = function(event) { channel.send('sending a message'); } channel.onmessage = function(event) { console.log(event.data); } // determine the largest message size that can be sent var sctp =
pc.sctp; var maxmessagesize = sctp.maxmessagesize; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.sctp' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection: track event - Web APIs
on. bubbles yes cancelable no interface rtctrackevent event handler property ontrack by the time this event is delivered, the new track has been fully added to the peer connection. see track event types in rtctrackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new track event handler. ...
...vered, the new track has been fully added to the peer connection. see track event types in rtctrackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new track event handler. ...
...ntial: "somepassword" } ] });
pc.addeventlistener("track", e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new track's first stream to an existing <video> element, identified using the variable videoelement. you can also assign the event handler function to the ontrack property, rather than use addeventlistener().
pc.ontrack = e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; return false; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'track' in that specification. candidate recommendation initial specification. ...
RTCRtpReceiver.getContributingSources() - Web APIs
each instance describes one of the contributing sources that provided data to the incoming stream in the past ten seconds. ...
...each instance describes one of the contributing sources that provided data to the incoming stream in the past ten seconds. ...
...each instance describes one of the contributing sources that provided data to the incoming stream in the past ten seconds. ...
RTCSessionDescription.sdp - Web APIs
e property rtcsessiondescription.sdp is a read-only domstring containing the sdp which describes the session. ...
... candidate recommendation initial specification. ...
... candidate recommendation initial specification. ...
SubtleCrypto.importKey() - Web APIs
y format is defined in rfc 7517. it describes a way to represent public, private, and secret keys as json objects. a json web key looks something like this (this is an ec private key): { "crv": "p-384", "d": "wouctu7nw4e8_7n5c1-xbjb4xqsb_lizhymsy8mggxuny6q8ncoh9xsiviwlffk_", "ext": true, "key_ops": ["sign"], "kty": "ec", "x": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqyg
pcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; examples note: you can try the working examples on github. raw import this example imports an aes key from an arraybuffer containing the bytes to use. see the complete code on github. const rawkey = window.crypto.getrandomvalues(new uint8array(16)); /* import an aes secret key from an arraybuffer containin...
...rlen; i++) { bufview[i] = str.charcodeat(i); } return buf; } const pemencodedkey = `-----begin private key----- miievqibadanbgkqhkig9w0baqefaascbkcwggsjageaaoibaqdd0tpv/du2vftjvxj1t/gxtk39snbvroaeb/jkzxae+xa0h+3lhzaqiqnmfacibsgifzuvegb+7tqxwqpolofr/r7mvgwcsk98jyrvtved8zmzyyitsy7m2hcasqafikyoouv5vzyre87/leyzzbpf3bqq4idaqu+k9hj5fkuu6rroeohsdnjc+vddqlschxvmolz9vtt+ok9j4/tolwr4cg8khdlburcby6g
pclo3dpu09sw+6ctx2cx4mkxx6o/0mmdtmacr/vu50kdrmlefezyowpaehhmfywybtuzbipvizvp8wfcsknmbfi1s9a9pdbqnebwwhhx3/hsebt2bagmbaaecggeabei1p6nf6zs7mjlybdv+pfl5rjl2coqly6tovvzvblmkcppjyfunipdk2tk2i897zaxfhpdbikmllm2hq6jzqkb110oantpdg0jxzmiihps32s1d/kilhjgff4hjd4nxp1l1dp8bupollorr2tym2x6dccgfw9lhtr8o03qp4hjn84vjgiwadyck83mgs4nrsnhkdiqynwx1ajkly51yek6rcrdmi0th2rxrrinoc35svv+apt2rkomgi52rwtesea1kzgfrxjq61rejif6p2...
...rypt"] ); } json web key import this code imports an ecdsa private signing key, given a json web key object that represents it. see the complete code on github. const jwkeckey = { "crv": "p-384", "d": "wouctu7nw4e8_7n5c1-xbjb4xqsb_lizhymsy8mggxuny6q8ncoh9xsiviwlffk_", "ext": true, "key_ops": ["sign"], "kty": "ec", "x": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqyg
pcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; /* import a pem encoded rsa private key, to use for rsa-pss signing. takes a string containing the pem encoded key, and returns a promise that will resolve to a cryptokey representing the private key. */ function importprivatekey(jwk) { return window.crypto.subtle.importkey( "jwk", jwk, { name...
Using the Web Animations API - Web APIs
he api really comes in handy is manipulating the animation’s playback. the web animations api provides several useful methods for controlling playback. ...
...at pausing and playing animations in the growing/shrinking alice game (check out the full code on codepen): in this game, alice has an animation that causes her to go from small to big which we control via a bottle and a cu
pcake. both of these have their own animations. pausing and playing animations we’ll talk more about alice’s animation later, but for now, let’s look closer at the cu
pcake’s animation: var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); the element.animate() method will immediately run after it is called. to prevent the cake from eating itself up before the user has ...
...y run after it is called. to prevent the cake from eating itself up before the user has had the chance to click on it, we call animation.pause() on it immediately after it is defined, like so: nommingcake.pause(); we can now use the animation.play() method to run it whenever we’re ready: nommingcake.play(); specifically, we want to link it to alice’s animation, so she gets bigger as the cu
pcake gets eaten. we can achieve this via the following function: var growalice = function() { // play alice's animation. alicechange.play(); // play the cake's animation. nommingcake.play(); } when a user holds their mouse down or presses their finger on the cake on a touch screen, we can now call growalice to make all the animations play: cake.addeventlistener("mousedown", growalice,...
ARIA: textbox role - Accessibility
line input, in which return or enter submits the form; in this case, it is preferable to use an html <input> with type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. ...
...le to use an html <input> with type="text". to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true". including the html contenteditable attribute ensures the text node is editable. <!-- simple text input field --> <div id="txtboxlabel">enter your five-digit zi
pcode</div> <div role="textbox" contenteditable="true" aria-placeholder="5-digit zi
pcode" aria-labelledby="txtboxlabel"></div> <!-- multi-line text area --> <div id="txtboxmultilinelabel">enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxmultilinelabel" aria-required="true"></div> semantic elements are more concise and require no javascript to support textbox features. <label for="txtbox">enter you...
...ledby="txtboxlabel"></div> <!-- multi-line text area --> <div id="txtboxmultilinelabel">enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxmultilinelabel" aria-required="true"></div> semantic elements are more concise and require no javascript to support textbox features. <label for="txtbox">enter your five-digit zi
pcode</label> <input type="text" placeholder="5-digit zi
pcode" id="txtbox"/> <!-- multi-line text area --> <label for="txtboxmultiline">enter the tags for the article</label> <textarea id="txtboxmultiline" required></textarea> where a text field is read-only, indicated this by setting aria-readonly="true" on the element. associated aria properties aria-activedescendent attribute taking ...
CSS reference - CSS: Cascading Style Sheets
er-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearcli
pclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-ga
pcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box...
...le-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box><display-inside><display-internal><display-legacy><display-listitem><display-outside>d
pcmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfont-feature-settings (...
...rflow-wrapoverflow-xoverflow-yoverscroll-behavioroverscroll-behavior-blockoverscroll-behavior-inlineoverscroll-behavior-xoverscroll-behavior-yppad (@counter-style)paddingpadding-blockpadding-block-endpadding-block-startpadding-bottompadding-inlinepadding-inline-endpadding-inline-startpadding-leftpadding-rightpadding-top@pagepage-break-afterpage-break-beforepage-break-insidepaint()paint-orderpath()
pc<percentage>perspectiveperspective()perspective-originplace-contentplace-itemsplace-self::placeholderpointer-eventspolygon()<position>positionprefix (@counter-style)ptpxqqquotesrradradial-gradient()range (@counter-style)<ratio>:read-only:read-writerect()remrepeat()repeating-linear-gradient()repeating-radial-gradient():requiredresize<resolution>revertrgb()rgba():rightright@right-bottom:rootrotatero...
Rich-Text Editing in Mozilla - Developer guides
option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7o
pcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8...
...e/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8ycmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwu
pc+6cktlxz/sddp2uu9uxlmyxz6qm8v4tz8lhf1h+zdqxt7s8olmxtbf4e8qafhjj3kbp2mzkkthpitjp9vh6ihia+whtasx5brpwuemgdondf/2a4m7ukds1jw662+xkqtkeuoqjktojm2h53yfl15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwagd7fg5tnnyntp8/fzvgwjofmgg7gox0sakkgqgdmgkbi0njgmeimp...
...ormatdoc('redo');" src="data:image/gif;base64,r0lgodlhfgawamihab1chdljwl9vj1ie34kl8apd+7/i1////yh5baekaacalaaaaaawabyaaankelrc/jdksesyphi7siegsvxzeatdicqbvjjpqwzt9naednbqk1wcqsxlynxmaimhydofaeljasrrvazvrqqqxuy7cgx4tc6bswkaow==" /> <img class="intlink" title="remove formatting" onclick="formatdoc('removeformat')" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8fpj2icml8z92dlbtmzdeig3fco7j08foh1kurkm3e9iw54yvkwutuom+lpt/bgbwf3//sf37/1/c02ccg1lb8f//f95dzx74mtmzshhosm6szrq/a6ir/z2rkfejbxulyfpdidi6af///...
Making content editable - Developer guides
option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7o
pcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8...
...e/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8ycmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwu
pc+6cktlxz/sddp2uu9uxlmyxz6qm8v4tz8lhf1h+zdqxt7s8olmxtbf4e8qafhjj3kbp2mzkkthpitjp9vh6ihia+whtasx5brpwuemgdondf/2a4m7ukds1jw662+xkqtkeuoqjktojm2h53yfl15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwagd7fg5tnnyntp8/fzvgwjofmgg7gox0sakkgqgdmgkbi0njgmeimp...
...ormatdoc('redo');" src="data:image/gif;base64,r0lgodlhfgawamihab1chdljwl9vj1ie34kl8apd+7/i1////yh5baekaacalaaaaaawabyaaankelrc/jdksesyphi7siegsvxzeatdicqbvjjpqwzt9naednbqk1wcqsxlynxmaimhydofaeljasrrvazvrqqqxuy7cgx4tc6bswkaow==" /> <img class="intlink" title="remove formatting" onclick="formatdoc('removeformat')" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8fpj2icml8z92dlbtmzdeig3fco7j08foh1kurkm3e9iw54yvkwutuom+lpt/bgbwf3//sf37/1/c02ccg1lb8f//f95dzx74mtmzshhosm6szrq/a6ir/z2rkfejbxulyfpdidi6af///...
Closures - JavaScript
executed. because the loop has already run its course by that time, the item variable object (shared by all three closures) has been left pointing to the last entry in the helptext list. ...
... one other way to write the above using anonymous closures is: funct...
...r full name'}, {'id': 'age', 'help': 'your age (you must be over 16)'} ]; for (var i = 0; i < helptext.length; i++) { var item = helptext[i]; document.getelementbyid(item.id).onfocus = makehel
pcallback(item.help); } } setuphelp(); run the code using this jsfiddle link. this works as expected. rather than the callbacks all sharing a single lexical environment, the makehel
pcallback function creates a new lexical environment for each callback, in which help refers to the corresponding string from the helptext array. one other way to write the above using anonymous closures is: function showhelp(help) { document.getelementbyid('help').innerhtml = help; } function setuphelp() { var helptext = [ {'id': 'email', 'help': 'your e-mail address'}, {'id': 'n...
delete operator - JavaScript
and then added it back. if you want to use an ordered associative array in a cross-browser environment, use a map object if available, or simulate this structure with two separate arrays (one for the keys and the other for the values), or build an array of single-property objects, etc. examples // creates the property adminname on the global scope. adminname = 'xyz'; // creates the property em
pcount on the global scope. // since we are using var, this is marked as non-configurable. the same is true of let and const. var em
pcount = 43; employeedetails = { name: 'xyz', age: 5, designation: 'developer' }; // adminname is a property of the global scope. // it can be deleted since it is created without var, // and is therefore configurable. delete adminname; // returns true // ...
...delete employeedetails.name; // returns true // even when the property does not exist, delete returns "true". ...
...delete employeedetails.name; // returns true // even when the property does not exist, delete returns "true". delete employeedetails.salary; // returns true // delete does not affect built-in static properties. ...
SDK and XUL Comparison - Archive of obsolete content
r developing add-ons on the new native version of firefox mobile. see the tutorial on mobile development. advantages of xul-based add-ons user interface flexibility xul overlays offer a great deal of options for building a ui and integrating it into the browser. using only the sdk's supported apis you have much more limited options for your ui. ...
... development. advantages of xul-based add-ons user interface flexibility xul overlays offer a great deal of options for building a ui and integrating it into the browser. using only the sdk's supported apis you have much more limited options for your ui. x
pcom traditional add-ons have access to a vast amount of firefox functionality via x
pcom. the sdk's supported apis expose a relatively small set of this functionality. low-level apis and third-party modules that's not the whole story. if you need more flexibility than the sdk's high-level apis provide, you can use its low-level apis to load x
pcom objects directly or to manipulate the dom directly as in a traditional bootstrapped extension. alternatively, you can load t...
clipboard - Archive of obsolete content
f("html") != -1) require("sdk/tabs").open("data:text/html;charset=utf-8," + clipboard.get("html")); set the clipboard contents to an image. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahg
pcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d"); if the clipboard contains an image, open it in a new tab. var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.indexof("image") != -1) require("sdk/tabs").open(clipboard.get()); as noted before, data type can be easily omitted for images. if the intention is set the clipboard to a data url as string and not as ima...
.... if the intention is set the clipboard to a data url as string and not as image, it can be done by specifying a different flavor, like text. var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahg
pcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d", "text"); globals functions set(data, datatype) replace the contents of the user's clipboard with the provided data. parameters data : string the data to put on the clipboard. datatype : string the type of the data, , one of "text", "html", "image". optional. get(datatype) get the contents of the user's clipboard. parameters ...
Creating Reusable Modules - Archive of obsolete content
h, and produces a short, fixed length string of bytes as output. it's a useful way to create a "fingerprint" that can be used to identify a file. md5 is a commonly used hash function: although it's no longer considered secure, it works fine outside a security context. here we'll write an add-on that lets the user select a file on disk and calculates its hash. for both these operations we'll use x
pcom interfaces. file picker to let the user select a file we'll use nsifilepicker. the documentation for that interface includes an example which we can adapt like this: var {cc, ci} = require("chrome"); function promptforfile() { const nsifilepicker = ci.nsifilepicker; var fp = cc["@mozilla.org/filepicker;1"] .createinstance(nsifilepicker); var window = require("sdk/window/u...
...fp.show(); if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the path as string. note that you usually won't // need to work with the string paths. var path = fp.file.path; // work with returned nsilocalfile... } return path; } hash function firefox has built-in support for hash functions, exposed via the nsicryptohash x
pcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path. we can adapt it like this: var {cc, ci} = require("chrome"); // return the two-digit hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } function md5file(path) { var f = cc["@mozilla.org/file/lo...
Downloading Files - Archive of obsolete content
browserpersist(); // obtain the privacy context of the browser window that the url // we are downloading comes from. if, and only if, the url is not // related to a window, null should be used instead. ...
... file is not found (with an 404 error for instance). // tried with .jpg, .ico, .gif (even .html). ...
File I/O - Archive of obsolete content
note: file objects are nsifile. for legacy reasons, there is also an nsilocalfile interface. ...
...\start menu\programs). this is a windows-specific value. tmpd d the operating system's temporary files directory (for example, /tmp on mac os x and linux). uchrm f the user chrome directory in their profile: %profile%/chrome. resource:app d the application directory in an xulrunner application. look in the source for other strings available: x
pcom/io/nsappdirectoryservicedefs.h, x
pcom/io/nsdirectoryservicedefs.h. other such keys as the "profd" key are available; check the known locations. enumerating drives on windows while you can use initwithpath("/") on unix-like systems (linux, mac) to get the root of the file system, there's no such root on windows. however, you can enumerate available drives using the following code: component...
Forms related code snippets - Archive of obsolete content
-1 : 1, othiscal = ainstances[this.id.replace(rbgnnan, "")]; othiscal.current[bismonth ? "setmonth" : "setyear...
...{ const othiscal = ainstances[this.id.replace(rbgnandend, "")]; othiscal.target.value = (this.innerhtml / 100).tofixed(2).substr(-2) + "\/" + (othiscal.current.getmonth() + 1) + "\/" + othiscal.current.getfullyear(); othiscal.container.parentnode.removechild(othiscal.container); return false; } function buildcalendars () { const afields = document.getelementsbyclassname(sd
pclass), nlen = afields.length; for (var nitem = 0; nitem < nlen; new datepicker(afields[nitem++])); } const /* customizable by user */ sprefs = "zdp"; sd
pclass = "date-picker", smonthsnames = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], sdays = ["m", "t", "w", "t", "f", "s", "s"], bzeroismonday = true, /* internal usage...
JavaScript Debugger Service - Archive of obsolete content
obsolete since gecko 33 (firefox 33 / thunderbird 33 / seamonkey 2.30) 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. in firefox versions prior to gecko 33 (firefox 33 / thunderbird 33 / seamonkey 2.30), the javascript debugger service (or simply jsd) used to be an x
pcom component that allows the tracking of javascript while it was being executed in the browser. however, jsd has been removed in favor of the debugger api. see the tracking bug bug 800200 for more details. snippets acquiring the service we acquire the service by calling the x
pcom object. var jsd = components.classes["@mozilla.org/js/jsd/debugger-service;1"] .getservice(components.interfaces.jsdidebu...
...you can use insertfilter (jsdifilter filter, jsdifilter after) to insert the filter after a particular filter; you can pass null for jsdifilter after to insert at the head of the list. you can also use swapfilters (jsdifilter filter_a, jsdifilter filter_b) to swa...
On page load - Archive of obsolete content
llowing xul documents: application uri to overlay firefox chrome://browser/content/browser.xul thunderbird chrome://messenger/content/messenger.xul navigator from seamonkey chrome://navigator/content/navigator.xul attaching a script attach a script to your overlay (see "attaching a script to an overlay") that adds a load event listener to ap
pcontent element (browsers) or messagepane (mail): window.addeventlistener("load", function load(event){ window.removeeventlistener("load", load, false); //remove listener, no longer needed myextension.init(); },false); var myextension = { init: function() { var ap
pcontent = document.getelementbyid("ap
pcontent"); // browser if(ap
pcontent){ ap
pcontent.addeventlistener("dom...
...lies will fire the onpageload function for not only documents, but xul:images (favicons in tabbrowser). if you only want to handle documents, ensure aevent.originaltarget.nodename == "#document" . if you are running code on a page load it is likely you would want to run some cleanup code on page unload. to attach to the unload event in above example you can use the "pagehide" event like this: ap
pcontent.addeventlistener("pagehide", myextension.onpageunload, false); for ap
pcontent and similarly for messagepane messagepane.addeventlistener("pagehide", myextension.onpageunload, false); and add your code to onpageunload method. basic onpageload for a browser window var myextension = { init: function() { // the event can be domcontentloaded, pageshow, pagehide, load or unl...
Progress Listeners - Archive of obsolete content
means you don't get any notifications for inactive tabs. firefox 3.5 includes a way to set up a listener for all tabs, selected and not: listening to events on all tabs. ...
..., init: function() { gbrowser.addprogresslistener(this); }, uninit: function() { gbrowser.removeprogresslistener(this); }, processnewurl: function(auri) { if (auri.spec == this.oldurl) return; // now we know the url is new... ...
Code snippets - Archive of obsolete content
d code forms forms related code xml code used to parse, write, manipulate, etc. xml file i/o code used to read, write and process files drag & drop code used to setup and handle drag and drop events dialogs code used to display and process dialog boxes alerts and notifications modal and non-modal ways to notify users preferences code used to read, write, and modify preferences js x
pcom code used to define and call x
pcom components in javascript running applications code used to run other applications <canvas> related what wg canvas-related code signing a xpi how to sign an xpi with pki delayed execution performing background operations. miscellaneous miscellaneous useful code fragments html to dom using a hidden browser element to parse html to a window's dom j...
... applies to scrollbars in browser and iframe as well. autocomplete code used to enable form autocomplete in a browser boxes tips and tricks when using boxes as containers tabbox removing and manipulating tabs in a tabbox windows-specific finding window handles (hwnd) (firefox) how to use windows api calls to find various kinds of mozilla window handles. window handles can be used for i
pc and accessibility purposes. using the windows registry with x
pcom how to read, write, modify, delete, enumerate, and watch registry keys and values. external links the content at mozillazine example code is slowly being moved here, but you can still find useful examples there for now. ...
Enhanced Extension Installation - Archive of obsolete content
mpatibility information held by the item. if there is, and this remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). finalization for themes, the item is immediately installed fully, rather than awaiting the next restart, since themes do not supply x
pcom components, preferences defaults etc. for extensions, on the next startup, the startup system notices the presence of the .autoreg file and starts the extension manager with a "dirty" flag, telling it to finish any install operations that may be pending. the extension manager loads the xml/rdf datasources (this is allowable and necessary because a major change has happened) and gets a list of...
...onent manager, preferences system and chrome registry can locate additional files on the next start. the finalization process then notifies the startup process that finalization has changed this manifest, and that the application must be restarted to pick up changes specified therein. the startup process receives this "needsrestart" bit when the extension manager's startup completes, shuts down x
pcom and relaunches the application. on the next restart, the xredirprovider now supplies a list of directories to requesting systems listing the new item's components, defaults and chrome manifests. uninstallation, disabling, enabling these functions work on the same principle as installation - the user requests an action through the ui while the application is running and metadata is written (to...
Extension Versioning, Update and Compatibility - Archive of obsolete content
> </rdf:li> </rdf:seq> </em:updates> <!-- a signature is only necessary if your add-on includes an updatekey in its install.rdf. ...
...:extension:foobar@developer.mozilla.org:2.2"/> <rdf:li resource="urn:mozilla:extension:foobar@developer.mozilla.org:2.5"/> </rdf:seq> </em:updates> <em:signature>migtma0gcsqgsib3dqebbquaa4gbamo1o2gwsccth1gwymgscfanakpn40pjfowt ub2hvdg8+oxmcif8d/9evwm8eh/ixuxyzlmrzts3o5tv9eway5ubctqdf1wgtsgk jrgzow1fitkzi7w0//c8ekdmlatguegfns2iltd5p/0kh/hf1r
pc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> <!-- this represents the same description within the li from the previous example --> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org:2.2"> <em:version>2.2</em:version> <!-- trimmed the rest of the contents here --> </rdf:description> <rdf:description about="urn:mozilla:extens...
Extension Etiquette - Archive of obsolete content
ects. global variables, such as top-level declarations on scripts loaded into shared windows or web pages. expando properties of shared objects, such as document objects, or dom nodes. ids and class names in html and xul documents, when extensions add elements to web pages or browser windows. chrome: or resource: packages, which are often defined in chrome.manifest files. about: page urls. x
pcom contract ids, which are often registered in chrome.manifest files. while these are among the most common examples of namespaces in which conflicts can occur, there are many others. in general, care must be taken whenever defining a name anywhere that other code might do likewise. strategies to avoid such conflicts include: avoid shared namespaces where possible many naming conflicts are b...
... the simplest solution to prevent conflicts is to use a distinct prefix for all of your names. class names for html elements created by the cool beans extension, for instance, might all be prefixed with cool-beans-. global variables might all be defined as properties of the coolbeans object. some namespaces have specific conflict prevention conventions, which should be followed as appropriate. x
pcom contract ids, for instance, should always begin with an @, followed by a domain name that the author controls, e.g., "@example.com/foo/bar;1" it is important that the prefix that you use be unlikely to conflict with other code, and that it be indicative of the name of your add-on. generic prefixes such as myextension-, or short prefixes such as ffx-, are likely to be used elsewhere, and there...
Firefox addons developer guide - Archive of obsolete content
the firefox add-ons developer guide was contributed by the mozilla japan community; it covers how to go about building firefox extensions using x
pcom and xul. these days, we recommend using the add-on sdk instead, but there are times when you need the additional control offered by a more direct approach. ...
...mozilla japan community; it covers how to go about building firefox extensions using x
pcom and xul. these days, we recommend using the add-on sdk instead, but there are times when you need the additional control offered by a more direct approach. ...
Connecting to Remote Content - Archive of obsolete content
ext); }; request.onerror = function(aevent) { window.alert("error status: " + aevent.target.status); }; request.open("get", url, true); request.send(null); in this example we demonstrate how to make a xmlhttprequest call in asynchronous mode. you can see that an instance of the xmlhttprequest class is created and it holds all functionality for making a request. we create this instance using x
pcom instead of the usual way (new xmlhttprequest()) because this way works both in chrome and non-chrome code. following initialization, onload and onerror handlers are registered to a callback function to handle the response returned from the remote server. in both cases aevent.target is an nsixmlhttprequest. in the onload callback function, the responsetext parameter contains the server response...
... ...
Custom XUL Elements with XBL - Archive of obsolete content
me="aevent" /> <body><![cdata[ this.parentnode.removechild(this); ]]></body> </method> as you can see, it's very easy to define a method and the parameters it takes. you can also have a return value using the return keyword, just like on regular js code. the method uses the parent node to remove the person node. simple enough. you can do almost anything from xbl code, including using x
pcom components, js code modules and available chrome scripts. the main setback is that you can't have script tags defined in a binding, so you depend on the scripts that have been included in the xul files that use the binding. also unlike scripts, you can include stylesheets using the stylesheet xbl element. dtd and properties files can be handled just like in regular xul. there are two conflic...
... ...
Mozilla Documentation Roadmap - Archive of obsolete content
here are a few problems with it. first of all, the in-site search is not reliable, so we recommend using a search engine like google, with queries such as "mdc javascript code modules" or "javascript code modules site:developer.mozilla.org". secondly, there are several important articles that are very lacking in information, like the preferences system page. and finally, what we mentioned in our x
pcom section: almost no documentation on x
pcom components. the documentation on interfaces is very complete, but it isn't nearly as useful as the documentation that existed at xulplanet and was later taken down. xulplanet allowed you to navigate between interfaces and their related components, which makes locating components very easy. hopefully this will be corrected in the future. in the meantime,...
... ...
The Essentials of an Extension - Archive of obsolete content
led uuidgen that generates uuids. there are also downloadable tools for all platforms that generate them. the enclosing brackets are just notation, and they're just common practice. as long as your id has some uniqueness to it, it's ok to use either form. <em:name>xul school hello world</em:name> <em:description>welcome to xul school!</em:description> <em:version>0.1</em:version> <em:creator>ap
pcoast</em:creator> <em:homepageurl>https://developer.mozilla.org/docs/xul_school</em:homepageurl> this is the data that is displayed before and after the extension is installed, that you can see in the add-ons manager. there are many other tags that can be added, for contributors and translators. the full specification of the install.rdf file has all the details. since extensions can be transla...
... ...
User Notifications and Alerts - Archive of obsolete content
ification to be immediately closed, so you should only use notification boxes for single-step processes. the alerts service this is a very good option when you want to alert users about events without requiring input from them. alerts are displayed in an os-specific way, so their look is native. you can associate an action to the user clicking on the alert. another advantage is that you use an x
pcom service to do this (nsialertsservice), so you can easily trigger alerts from chrome and non-chrome code. on the other hand, alerts are displayed only temporarily using the alerts service is similar to using notification boxes: let alertsservice = cc["@mozilla.org/alerts-service;1"].getservice(ci.nsialertsservice); let title = this._bundle.getstring("xulschoolhello.greeting.title"); let me...
... ...
XUL School Tutorial - Archive of obsolete content
pt object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the box model x
pcom objects observer notifications custom xul elements with xbl mozilla documentation roadmap useful mozilla community sites appendices appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and html insertion appendix f: monitoring dom changes the xul...
...the project is now published here following its sharing licenses. its contents have been modified from the original source as necessary. ...
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
oductx.y\. the keys "product x.y" contain application keys for the given mozilla based browser. example: netscape 6 6.1\ look at the extensions subkey, e.g. hkey_local_machine\software\mozilla\netscape 6 6.1\extensions\ access the plugins value and value-data pair, e.g: plugins = c:\program files\netscape\netscape 6\plugins. you also have the components value and value-data pair; this is for x
pcom components. in addition, if you have made your plugin scriptable and accessible from javascript, you ought to put the associated xpt file in the components directory. you can access the components value and value-data pair (telling you where the components directory is) in a similar manner, e.g.: components=c:\program files\netscape\netscape 6\components. future mozilla based browsers won't dis...
...ents directory. you can access the components value and value-data pair (telling you where the components directory is) in a similar manner, e.g.: components=c:\program files\netscape\netscape 6\components. future mozilla based browsers won't distinguish between plugins and components, and will pick both up from a common location. however, for netscape 6.1 and netscape 6.2, xpt files, as well as x
pcom plugins, ought to go in the components directory. on these browsers, this is the only directory that can "pick up" an xpt file, as well the only directory that can recognize x
pcom components. you now have information about the plugins directory for gecko embedding browsers. examples given for "product x.y" were using netscape 6 but other possible mozilla based browsers exist as well; all geck...
Documentation for BiDi Mozilla - Archive of obsolete content
luding support for explicit directional controls (lro, rlo, etc, and their html equivalents). bidi processing for a given html document will only take place if one of the following is true: the page includes a hebrew or arabic character or a hindi digit. this is determined in nstextfragment::setto the page includes a element with the attribute dir=rtl, either explicitly (nsgenerichtmlelement::ma
pcommonattributesinto), or as a consequence of a style rule (mapdeclarationtextinto in nscssstylerule.cpp) all these cases use nsdocument::enablebidi to set the flag mbidienabled. in a bidi-enabled document, the following things happen: during a reflow, nsbidipresutils::resolve is called. this method uses the uba to determine the directional properties of the text and reorder frames if necessary. ...
...ext mode of form controls may be "logical", "visual" or "like containing document". we have also tested behaviour of all controls with dir=rtl and added support where necessary. some support added for alignment in tables and lists, and fixes for problems with different combinations of dir and align. ...
Java in Firefox Extensions - Archive of obsolete content
ext of firefox extensions."). these 2 objects let you make use of the standard jdk classes, e.g., var ajavalist = new java.util.linkedlist(); if you want to load your own jars, then you can create your own java class loader. the following technique only works in javascript code linked from or contained in xul files. if you wish to call java code from within javascript code that implements some x
pcom components, at this time, you need a different technique (refer to the complete java firefox extension). a good reason for calling java from within an x
pcom component rather than from xul is to maintain a singleton (some singular java object) across all firefox windows. if you call java from xul, then each firefox window will have its own class loader and hence its own "singleton". the followin...
...[note: a simpler hello world version than that below is now available at http://brett-zamir.me/java_demo/ ] for privileges, the basic procedure is: download and include http://simile.mit.edu/repository/jav...nsionutils.jar within your extension (you can also build your own from the source files at http://simile.mit.edu/repository/jav...xtensionutils/ ) build and add references lea...
LIR - Archive of obsolete content
code for manipulating lir is in nanojit/lir.h. nanojit lir instruction cheat sheet.also in pdf format see attachment. ...
...the back-ends cannot generate code for it.it's used in tracemonkey briefly but is always demoted to a lir_modl or converted to a function call before nanojit has to do anything serious with it. 105 cmovi integer conditional move int 106 cmovq quad 64 bit conditional move quad 107 cmovd double conditional move double conversions 108 i2q qua...
New Skin Notes - Archive of obsolete content
ight now. --dria yeah, i think we want them off by default, as the more common case for a reader will be to read documentation, not to edit it. --beltzner put these back in. will try to sort out how to change the default behaviour. --dria headers which are also links that point to as-yet-unwritten wiki pages are colored as though they actually do exist. for an example of this, see creating x
pcom components. --waldo 21:09, 25 aug 2005 (pdt) not going to change (yet or possibly ever) adding pipes between buttons in horizontal nav-bar (ie: my talk | preferences | my watchlist) (stricken part is done). also, and this is a nit, it's a little "my" crazy up there -- do we need all the "my"s? --beltzner any chance we can mobe the "main page" scrollbar to the actual "content area" of the ...
...small text columns do seem reasonable, but i don't think this is nice for technical documentation which requires usage of tables, etc... wikipedia's side bar is smaller, btw, probably for the same reasons. since i manage a number of sites for which i must respect quality standards at 800 pixels width for compatibility (we accept break 640 compatibility nowadays except for sites intended for pdas/p
pcs), i find myself needing to use ctrl+- with the devmo wikki currently, not to change my global settings of course, which are fine and factory-default, working well with the other sites i visit regularily or manage... thanks again --mmondor future fixes in l10n versions there all heading links are wrong - main link and documentation leads to english devmo, and devnews and webwatch should be hi...
Tamarin build documentation - Archive of obsolete content
tamarin source versions the following instructions are for obtaining and building the tamarin central source code. for instructions on tamarin tracing, please see tamarin tracing build documentation. supported platforms tamarin currently supports the following operating systems and/or architectures. windows 32 and 64 bit mac osx 10.4, 10.5 on p
pc mac osx 10.5, 10.6 on intel linux 32 and 64 bit solaris 10 on sparc android 2.2 on arm windows mobile 6.5 mips (linux) sh4 (linux) getting the tamarin source the tamarin source resides in mercurial at tamarin central. active development source resides at tamarin redux. in this document replace instances of tamarin-central with tamarin-redux to operate in the redux repository. use the following command to create a copy of ...
... will build both targets. note that, whereas before when you selected the aggregate target you got a 'shell' 32-bit executable and a 'shell64' 64-bit executable in the same folder, now because of the fix to bug 478714 you will get an 'avm' executable in two separate folders, /debug and /debug64 respectively. the command to build from the terminal is: $ cd tamarin-redux $ xcodebuild archs=p
pc -project platform/mac/avmshell/avmshell.xcodeproj for a debug build, add '-configuration debug' (note the capital d and no "="). additional configurations are: debug_debugger, release and release_debugger. the resulting debug executable for the command above would be built at /platform/mac/avmshell/build/debug/avm. intel macs build correctly by setting archs=i386. eclipse (currently mac only...
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
tamarin-central rev 703:2cee46be9ce0 was declared stable on 12/02/08. the announcement sent to tamarin-devel can be read here. testing summary acceptance tests have passed on the following supported platforms: * windows, 32 & 64 bit * mac ox x p
pc & intel, 32 bit * linux, 32 bit * windows mobile arm version asc-4200 of the actionscript compiler was used for all tests. performance testsuite time metric the following is a comparison of the current tamarin-central (tc-703) versus the prior build (tc-700) as well as current against the vm in flash player 10. the key takeaway is that the interpreter is much improved. osdefault-jitinterpretedaggressive jit mac (os/x 10.4 ...
...e include: number failures in testsuite when running on linux windows mobile system.privatebytes and -memstats privatebytes always returns 0 amd64 longjmp hack needs reengineering on non-windows platforms different runtime errors when -dforcemir set in acceptance test run arm: math failures running with thumb or arm jit and interp. recursive
pcre testcases kills the stack on pocket
pc builds ...
Unix stub installer - Archive of obsolete content
gdb to debug the installer run it by typing "gdb mozilla-installer-bin" on the shell prompt. how we get setup to debug the xpinstall engine from the unix stub installer? build your entire mozilla tree (which should build the installer in the src2 directory as well). go to mozilla/xpinstall/packager/unix. on the shell prompt type "perl deliver.pl". now you will find an installer *and* the x
pcom.xpi and other debug xpis delivered to mozilla/installer/raw. debug using "gdb mozilla-installer-bin" and set a breakpoint at xpi_init(). you can step into the xpinstall engine through the xpistub once the xpistub dll is loaded. how do i add an installer package to the unix installer? adding a package involves a few steps: add a section named for your <component> to the packages-unix man...
...-installer-bin" and set a breakpoint at xpi_init(). you can step into the xpinstall engine through the xpistub once the xpistub dll is loaded. how do i add an installer package to the unix installer? adding a package involves a few steps: add a section named for your <component> to the packages-unix manifest that describes which files from dist belong to which module. for example, see the x
pcom section that lists all the shared libraries as seen in dist. these are eventually zipped with the directory structure preserved. read the top of the packages-unix file for it's simple syntax and semantics. add an <component>.jst install script template file (the jst extension stands for javascript template indicating this is a template for the final install.js for the <component>.xpi. checkin ...
Windows stub installer - Archive of obsolete content
tup to debug the windows stub installer? build your entire mozilla tree, which should build the stub installer in the setup directory as well. (if you need to rebuild stub installer, got to /mozilla/xpinstall/wizard/windows/setup and type "nmake /f makefile.win") go to mozilla/xpinstall/wizard/windows/builder on the shell prompt type "perl build.pl". now you will find an installer *and* the x
pcom.xpi and other debug xpis delivered to mozilla/dist/win32_d.obj/install. run the stub installer setup.exe from the install directory. if you need to use vc++ to debug the installer: under project | settings | debug set "executable for debug session" to be the path to mozilla/dist/win32_d.obj/install/setup.exe set "working directory" to be the path to mozilla/dist/wind32_d.obj/install pres...
... f10 to step into the code how we get setup to debug the xpinstall engine from the windows stub installer? this section needs to be added how do i add an installer package to the windows installer? adding a package involves a few steps: add a section named for your <component> to the packages-win manifest that describes which files from dist belong to which module. for example, see the x
pcom section that lists all the shared libraries as seen in dist. these are eventually zipped with the directory structure preserved. read the top of the packages-win file for it's simple syntax and semantics. add an <component>.jst install script template file. the jst extension stands for javascript template indicating this is a template for the final install.js for the <component>.xpi. checkin t...
Accessing Files - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. accessing files this section describes how to create a file reference. retrieving a file...
...stance, this will be the directory where the application was launched from, which may be different from the 'application' value. profile the profile directory where preferences are stored. desktop the desktop directory. usually, you would use this as the default directory for saving files. components the components directory where x
pcom components are installed. temp the temporary directory. you would store any temporary or cache files here. there are a number of other values that may be used, most of which are platform specific. for instance, on windows, the value 'strt' returns the start directory, where applications which run when the system starts up are placed. on other platforms, using this...
Template and Tree Listeners - Archive of obsolete content
nsixultreebuilderobserver - used to listen to particular tree operations. nsirdfobserver - for rdf datasources, used to listen to changes in the underlying rdf datasource. listening for template rebuilds the first of these is the simplest and involves two methods, willrebuild and didrebuild. ...
...e 'drag on' case only allows dragging onto containers, not ordinary rows. var treebuilderobserver = { candropbeforeafter : function(idx, orient) { return false; }, candropon : function(idx, orient) { return true; }, candrop : function(idx, orient) { return !orient; }, ondrop : function(idx, orient) { // do something here }, }; //tree.builderview.addobserver(treebuilderobserver); // p
pchenhui@hotmail.com tree.builder.queryinterface (components.interfaces.nsixultreebuilder) .addobserver(treebuilderobserver); the candropbeforeafter method returns false since we do not want to allow before and after drops. the candropon method returns true however. the candrop method is there for compatibility with older versions; this function checks the orientation and returns the opposite. this ...
Styling a Tree - Archive of obsolete content
every fourth row have blue text, using the example from a previous section. we'll need to add code to the getcellproperties() function, to add a property 'makeitblue' for cells in every fourth row. (we don't use getrowproperties() as the text color will not be inherited into each cell.) prior to gecko 22 the properties object that is passed as the last argument to the getcellproperties() is an x
pcom object that implements nsisupportsarray. it is really just an x
pcom version of an array. it contains a function appendelement() which can be used to add an element to the array. we can use the interface nsiatomservice to construct string atoms for the properties. getcellproperties: function(row,col,props){ if ((row %4) == 0){ var aserv=components.classes["@mozilla.org/atom-service;1"]. ...
...the properties. getcellproperties: function(row,col,props){ if ((row %4) == 0){ var aserv=components.classes["@mozilla.org/atom-service;1"]. getservice(components.interfaces.nsiatomservice); props.appendelement(aserv.getatom("makeitblue")); } } the properties list requires an array of atom objects, which can be thought of as constant strings. we create them using the x
pcom interface nsiatomservice and add them to the array using the appendelement() function. here, we create an atom 'makeitblue'. you can call appendelement() again to add additional properties. from gecko 22 your function should return a string containing the property. getcellproperties: function(row,col){ if ((row %4) == 0){ return "makeitblue"; } } to support gecko versions before and ...
stringbundle - Archive of obsolete content
strings type: nsisimpleenumerator an enumeration of all of the strings in the string bundle. the enumerat...
... strings type: nsisimpleenumerator an enumeration of all of the strings in the string bundle. the enumeration contains nsipropertyelement objects. ...
Building XULRunner - Archive of obsolete content
xulrunner is built using basically the same process as firefox or other applications. please read and follow the general build documentation for instructions on how to get sources and set up build prerequisites. by default, xulrunner is built with javax
pcom support; the build system must be able to find an appropriate jdk on the system; see the instructions on building javax
pcom for more details. if you do not want to build javax
pcom support, specify --disable-javax
pcom in your configuration. on mac, xulrunner requires mac os x 10.3 or higher and xcode 1.5 or higher to build properly. the runtime requirement is mac os x 10.2. a basic minimal mozconfig which will build a release configuration of xulrunner is: mk_add_options moz_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/o...
...res mac os x 10.3 or higher and xcode 1.5 or higher to build properly. the runtime requirement is mac os x 10.2. a basic minimal mozconfig which will build a release configuration of xulrunner is: mk_add_options moz_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/obj-xulrunner ac_add_options --enable-application=xulrunner #uncomment the following line if you don't want to build javax
pcom: #ac_add_options --disable-javax
pcom cvs tags and xulrunner versions older xulrunner releases where tagged in cvs with (for instance xulrunner_1_8_0_5_release ) up to version 1.8.0.5 the cvs repository does not have specific tags for xulrunner anymore. instead a xulrunner build is a just special build made from the firefox/mozilla tree, using the same tag as a firefox build. there is a conv...
Dialogs in XULRunner - Archive of obsolete content
acintosh has always had them. it makes creating an application easier for developers; in addition, the consistent user experience also makes applications easier to use. xul supports native implementations of filepickers (mozilla terminology for file open and save dialogs). newer releases will allow using preferences to switch to a xul emulation filepicker, if you want to. ...
.../ --- do something with the file here --- } } xul does not currently support any other common dialogs. that could change in future releases. firefox and thunderbird both support nearly native page setup and print dialogs. however, xul does support elements to make creating wizards a simple task as well. future articles in this series will look at input controls, printing, the clipboard, and x
pcom. see also dialog xul tutorial:creating dialogs nsifilepicker xul tutorial:open and save dialogs « previous original document information author: mark finkle last updated date: october 2, 2006 ...
XULRunner Hall of Fame - Archive of obsolete content
a web integrator and web clipper tool to build enterprise mashups nightingale nightingale is a communtiy fork of the songbird media player, bringing back linux support and much more. build instructions kirix strata a new specialty browser for accessing and manipulating data from the web telekast an open source teleprompter and script editor. source tomtom home 2
pc application to manage tomtom gps devices understanding faith (desktop version) a multimedia religious education resource for catholic secondary schools in australia. vivipos integrated point-of-sales software-hardware solution with customized xul application as the device front-end. english site. inactive projects these projects appear to be less actively developed, with no updat...
...explorer a patched version of xul explorer to re-enable application and extension skeleton generation. foxkeh clock (for japanese page) a clock application based charactor foxkeh. pyjamas-desktop a python web widget toolkit (similar to pyqt4 and pygtk2) that uses xulrunner dom to implement the widgets and event handling. python-hulahop is required python-hulahop from the ol
pc sugarlabs a python gtk widget with xulrunner embedded, providing full access to nsi dom and all other xulrunner interfaces, in a gtk window. it's possible to create your own python web browser with hulahop, and much much more besides. xuljet a framework that helps to create platform independent desktop applications directly in javascript ...
Make your xulrunner app match the system locale - Archive of obsolete content
also, this may not be the proper way to do this and it may not work for you in all cases. please update if there are more correct ways to do this. the first step is to get the code we're about to write to run before any of the locale specific resources are loaded. democracy does this by creating a command line handler called democracyclh, and then creating a new object of our pybridge component. the code described lives in the pybridge component's onstartup method which gets called automatically. the second step is to figure out the system locale. to be finished later. ...
...ocracy does this by creating a command line handler called democracyclh, and then creating a new object of our pybridge component. the code described lives in the pybridge component's onstartup method which gets called automatically. the second step is to figure out the system locale. to be finished later. then set the locale preference. the following is python code to set this preference. ...
nsIContentPolicy - Archive of obsolete content
etting attributes is a no-no). query any dom properties that depend on layout (e.g., offset* properties). query any dom properties that depend on style (e.g., computed style). query any dom properties that depend on the current state of the dom outside the "context" node (e.g., lengths of node lists). [javascript implementations only] access properties of any sort on any object without using x
pcnativewrapper (either explicitly or implicitly). due to various dom0 things, this leads to item 4. if you do any of these things in your shouldload() implementation, expect unpredictable behavior, possibly including crashes, content not showing up, content showing up doubled, etc. if you need to do any of the things above, do them off timeout or event. note: when multiple content policies are ...
...n with nsicategorymanager. see example below. char* previous = nsnull; nscomptr<nsicategorymanager> catman; servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); rv = catman->addcategoryentry("content-policy", component_classname, component_contractid, pr_true, pr_true, &previous); javascript developers can also implement an x
pcom component that extends nsicontentpolicy. ...
2006-11-10 - Archive of obsolete content
announcements there are no announcements this week. meetings there were no...
... announcements there are no announcements this week. meetings there were no meetings this week. summarized by: vanessa miranda & mohammad tirtashi ...
Logging Multi-Process Plugins - Archive of obsolete content
nment to enable this special logging mode. make sure you have write permissions to wherever you wish to save the log. your safest bet is your home directory (c:\users\username on windows vista and above, c:\documents and settings\username on windows xp, and ~ (home directory) on mac os x and linux). windows make sure firefox is not running. ...
... os x and linux). windows make sure firefox is not running. from within a command prompt: c:\> set nspr_log_modules=i
pcplugins:5 c:\> set nspr_log_file=c:\plugins.log c:\> cd c:\program files\mozilla firefox c:\> firefox.exe the log file will be saved to c:\plugins.log (or wherever nspr_log_file is set). linux make sure firefox is not running. from within a bash shell: $ export nspr_log_modules=i
pcplugins:5 $ export nspr_log_file=~/plugins.log $ /usr/bin/firefox the file will be saved to ~/plugins.log (or wherever nspr_log_file is set). ...
NPAPI plugin reference - Archive of obsolete content
uring embedded mode printing. npapi plug-in side api this chapter describes methods in the plug-in api that are available from the plug-in object; these allow plug-ins to interact with the browser. the names of all of these methods begin with npp_ to indicate that they are implemented by the plug-in and called by the browser. npbyterange represents a particular range of bytes from a stream. n
pclass n
pclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an n
pclass (i.e. an npobject). npembedprint substructure of npprint that contains platform-specific information used during embedded mode printing. npevent represents an event passed by npp_handleevent() to a windowless plug-in. npfullprint substructure of npprint that contains ...
...ur plug-in. npn_utf8fromidentifier returns the utf-8 string corresponding to the given string identifier. npn_version lets plugins obtain version information, both of the plug-in api and of the browser itself. npn_write pushes data into a stream produced by the plug-in and consumed by the browser. npnvariable see npn_getvalue. npobject npobject is a structure that holds a pointer to an n
pclass and an integer reference count, and possibly also implementation specific (i.e. plugin specific, or browser specific) members. npp represents a single instance of a plug-in. you specify one of these to any npapi function that needs to know which plug-in to work with. npp_destroy deletes a specific instance of a plug-in. npp_destroystream tells the plug-in that a stream is about to be cl...
The Basics of Web Services - Archive of obsolete content
y to understand a web service is to compare it to a html form communication with a server side script (such as php or asp) to post and send data. both web services and forms send and receive requests. the only major difference is that a web service uses xml. examples of web services in action as said before, rss and atom feeds are a simple example of how a web service works, most commonly, xml-r
pc or soap are also used to communicate between a server and a client. introducing xml-r
pc xml-r
pc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used. xml-r
pc was developed by useful inc, along with microsoft. warning: xml-r
pc support was removed from firefox starting with firefox 3. introducing soap soap, a web service, is listed as ...
... server and a client. introducing xml-r
pc xml-r
pc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used. xml-r
pc was developed by useful inc, along with microsoft. warning: xml-r
pc support was removed from firefox starting with firefox 3. introducing soap soap, a web service, is listed as a w3c standard, and is similar in ways to xml-r
pc. soap also has backing from ibm, as well as microsoft. warning: soap support was removed from firefox starting with firefox 3. soap or xml-r
pc? briefly, soap was intended to fill gaps in xml-r
pc. an example is, it is easier to send a multi-dimensional array with soap rather then with xml-r
pc. soap also has more features then xml-r
pc, but xml-r
pc on its own, has its uses. ...
Browser Feature Detection - Archive of obsolete content
e wordspacing true true true dom css 2 support for properties/methods in document.body.style</caption> name firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 azimuth true false false backgroundposition true true true bordercollapse true true true borderspacing true false true borderto
pcolor true true true borderrightcolor true true true borderbottomcolor true true true borderleftcolor true true true bordertopstyle true true true borderrightstyle true true true borderbottomstyle true true true borderleftstyle true true true bottom true...
... {name: 'verticalalign', 'supported': false}, {name: 'whitespace', 'supported': false}, {name: 'width', 'supported': false}, {name: 'wordspacing', 'supported': false} ], 'domcss2': [ {name: 'azimuth', 'supported': false}, {name: 'backgroundposition', 'supported': false}, {name: 'bordercollapse', 'supported': false}, {name: 'borderspacing', 'supported': false}, {name: 'borderto
pcolor', 'supported': false}, {name: 'borderrightcolor', 'supported': false}, {name: 'borderbottomcolor', 'supported': false}, {name: 'borderleftcolor', 'supported': false}, {name: 'bordertopstyle', 'supported': false}, {name: 'borderrightstyle', 'supported': false}, {name: 'borderbottomstyle', 'supported': false}, {name: 'borderleftstyle', 'supported': false}, {name: 'bottom', 'supp...
XForms Custom Controls - Archive of obsolete content
e input, output, trigger, etc. we will also show you how to create custom controls that work with the xforms model and are automatically updated just like xforms controls. the purpose of this article is to give you enough background information so that you'll be able to get a good start. to really grasp the following information, a good understanding of xforms, xbl, javascript and css is needed. x
pcom knowledge will certainly not hurt. but even if you are only comfortable with a couple of these technologies, we hope that the possibilities outlined below will inspire you to learn more where you need to. implementation status the framework we use in the mozilla xforms processor is very much a "work in progress". please keep in mind that just about everything we mention here may change to some ...
...ode to get some great examples of how xforms controls can be written. this will also allow you to be up to date with our current approaches (often the result of hard-learned lessons) and that will hopefully help you to more easily write your own controls. to get started, you really only need to know the language where you'd like to use xforms (like xhtml or xul), some xbl and javascript, and the x
pcom interfaces we are exposing for your use. details interfaces this section describes interfaces you need to know. there are two main groups of interfaces -> callback interfaces that must be implemented by the custom controls and the interfaces that custom controls can use to access the mozilla xforms engine. nsixformsuiwidget every custom control should implement the nsixformsuiwidget interface. ...
XUL Parser in Python - Archive of obsolete content
thekeys: for item in elements: w.write('<tr><td class="head">' + item + '</td></tr>\n') for a in el_list[item].values(): w.write('<tr><td class="at">' + a + '</td>') with these modifications, the script creates an output more like a periodic table of xul elements. until i spruce it up a little, this is just a very basic demonstration of using python's xml parser with xul. but mozilla's u
pcoming support for languages like perl and python will really open up the mozilla platform to tools and approaches of this kind--and make now a good time to start thinking about how these various technologies will be put together. the first level of support for python in mozilla will apparently be for python modules made available as x
pcom objects. extending on the approach in this script, then, yo...
... please feel free to suggest changes, change the format of the results output, or adapt this script in any way you want. ...
Gecko FAQ - Gecko Redirect 1
the open standards listed above so that they can have a rich, powerful formatting system and object model at their disposal, and "write once, view anywhere." gecko's robust support for these standards makes gecko the platform of choice for web content and web application developers worldwide. ...
...form of choice for web content and web application developers worldwide. are gecko's apis based on activex? com? javabeans? gecko is reusable on all platforms thanks to x
pcom, a subset of com that works across platforms. com, developed by digital and later adopted by microsoft, is the de facto standard for modular interfaces on windows platforms. additionally, on the windows platform, gecko's x
pcom interfaces are wrapped in an activex control that vb developers can utilize (activex wrappers are not available on other platforms because activex is a windows-only technology). a javabean wrapper is not currently under development, but there is nothing in gecko's architecture that precludes such development in the future. source code and documentation for these interfaces are available throug...
About Scriptable Interfaces - Interfaces
status of this document this is just a starter document, it should not be considered complete. most of the information of this document is based on http://www.mozilla.org/scriptable/ and creating x
pcom components scriptable interfaces interfaces allow x
pcom components to expose their functionality to the outside world while hiding the inner details of the component implementation. interfaces are written in an interface description language. ...
...outside world while hiding the inner details of the component implementation. interfaces are written in an interface description language. when we label an interface as scriptable, we're saying that components exporting this interface can be referenced (through this interface) from scripts (e.g javascript), and that we can write new components implementing the interface using script languages. x
pconnect x
pconnect is a technology that allows scriptable interfaces to be used/implemented from/in javascript scripts. no other scripts languages are supported by x
pconnect. python there's an extension extensions/python that bridges the gap between x
pcom and python, allowing scriptable interfaces to be used/implemented from/in python scripts. ...
Client-Server Overview - Learn web development
the target resource url (/search). the url parameters (q=client%2bserver%2boverview&topic=apps&topic=html&topic=css&topic=js&topic=api&topic=webdev). the tar...
...like gecko) chrome/52.0.2743.116 safari/537.36 content-type: application/x-www-form-urlencoded accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 referer: https://developer.mozilla.org/profiles/hamishwillee/edit accept-encoding: gzip, deflate, br accept-language: en-us,en;q=0.8,es;q=0.6 cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; _gat=1; csrftoken=zipujsazv6
pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _ga=ga1.2.1688886003.1471911953; ffo=true csrfmiddlewaretoken=zipujsazv6
pcgcbjscj1zu6pqzbfmuat&user-username=hamishwillee&user-fullname=hamish+willee&user-title=&user-organization=&user-location=australia&user-locale=en-us&user-timezone=australia%2fmelbourne&user-irc_nickname=&user-interests=&user-expertise=&user-twitter_...
Strategies for carrying out testing - Learn web development
...
... tablet with browser installed that you need to test — this can include chrome, firefox, and opera mini for android, as well as the original android stock browser. a higher-spec ios phone and tablet with the browsers installed that you need to test — this can include ios safari and chrome, firefox, and opera mini for ios. the following are also good options, if you can get them: a linux
pc available, in case you need to test bugs specific to linux versions of browsers. linux users commonly use firefox, opera, and chrome. if you only have one machine available, you could consider creating a dual boot machine running linux and windows on separate partitions. ubuntu's installer makes this quite easy to set up; see windowsdualboot for help with this. a couple of lower-spec mobile devi...
Adding a new event
er files directly. however, if implementing method isn't small and called from a lot of places, implementing it as inline causes to increase binary size. in this case, you should implement the method in widgeteventimple.cpp. and also, if implementing a method needs to include other header files, you should implement it in widgeteventimple.cpp too for avoiding include hell. make new event class i
pc aware for example, new class is caused by native user input event and needed to be dispatch to content, the class should be able to cross process boundary. in such cases, you may need to add new paramtraits for the new event class in nsguieventi
pc.h. modify utility methods of widgetevent widgetevent class has some utility mehtods and all of them are implemented in widgeteventimple.cpp. e.g., i...
...3 (non-dom events), you can skip this section. create webidl of the event write a dom event definition with webidl. it should be created under dom/webidl/. see webidl bindings for the detail. if your new event shouldn't be created with event constructor such as: var event = new fooevent("bar", { bubbles: true, cancelable: true, detail: 5 }); you shouldn't define construnctor in it. create x
pcom interface for the dom event if your event class should be accessible via x
pcom interface, you should create a new nsidomfooevent interface in dom/interfaces/events/. however, in these days, this is not necessary. if all information of the event is stored by its internal event, c++ event handlers can access them with following code: ns_imethodimp aneventlistener::handleevent(nsidomevent* aeven...
Command line options
lication build for and running atop the x11/x.org display and window system to be found on linux and other unix-based systems. --class=wm_class set the wm_class resource class of the x11 windows created by the application. --display=display set the x display to use. --g-fatal-warnings make all warnings fatal. --sync make x calls synchronous. ...
... and running atop the x11/x.org display and window system to be found on linux and other unix-based systems. --class=wm_class set the wm_class resource class of the x11 windows created by the application. --display=display set the x display to use. --g-fatal-warnings make all warnings fatal. --sync make x calls synchronous. ...
Creating JavaScript callbacks in components
these interfaces are used to manipulate the component in c++ and javascript. a common pattern used with interfaces to create a bi-directional communication between two groups of code is the observer (or listener) pattern. basically, the component defines an observer (or listener) interface which is implemented by some external code and this implementation is passed to the component. the component can then call methods on the observer interface to signal the external code when predefined events occur. ...
...ation: function doload(event) { // do something here } window.addeventlistener("load", doload, false); revealing the magic how is this possible? is nsidomeventlistener magical? well, it actually is a little magical. but you can use the same magic in your own idl callbacks. the nsidomeventlistener interface is "marked" with the function attribute. see it here. the function attribute tells the x
pconnect machinery to treat the javascript function as if it was an implementation of the callback interface. note, that since the javascript function is a single method, this magic only works for callback interfaces with a single method, like nsidomeventlistener. the javascript function is passed the same arguments as defined by the callback method. so we could convert the example above to accept j...
Creating reftest-based unit tests
gument: ./mach reftest path/from/sourcedir/reftest.list and to run a single reftest just pass the path to the test file (not the reference file): ./mach reftest path/from/sourcedir/reftest-name.html there is no reftest equivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the script that removes it) will keep it open longer. ...
...ce file): ./mach reftest path/from/sourcedir/reftest-name.html there is no reftest equivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the script that removes it) will keep it open longer. running i
pc reftests reftests can also be run in a separate process, which can differ from same-process rendering in significant ways. currently, i
pc reftests are only being run on linux. to run: moz_layers_force_shmem_surfaces=1 make -c $(objdir) reftest-i
pc note: right now, automation currently only runs layout/reftests/reftest-sanity/reftest.list! if you try to run the full suite, you may experience stalls or other issues. creating reftest-based unit tests your first reftest it is a silly example, but this will step you through creat...
Adding APIs to the navigator object
starting with gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), you can easily add new apis to the window.navigator object by using the category manager. simply add an entry to the "javascript-navigator-property" category. the object must be implemented as an x
pcom component. each method below of adding new objects to the navigator object requires that the new object is a registered x
pcom component. you can read about creating and registering x
pcom components in javascript. programmatically adding an object to navigator var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); categorymanager.addcategoryentry("javascript-navigator-property", "myapi", my_contract_i...
...nts.interfaces.nsicategorymanager); categorymanager.addcategoryentry("javascript-navigator-property", "myapi", my_contract_id, false, true); this adds a new object, myapi, to the window.navigator object. the newly added object is a reference to the component specified by the contract id my_contract_id. you can learn more about contract ids are unique text identifiers for x
pcom components. using a manifest to add an object to navigator you can also add an object to the window.navigator object by using the chrome manifest of an add-on: component {ffffffff-ffff-ffff-ffff-ffffffffffff} mycomponent.js contract @mozilla.org/mycomponent;1 {ffffffff-ffff-ffff-ffff-ffffffffffff} category javascript-navigator-property mycomponent @mozilla.org/mycomponent;1 generate a guid...
How Mozilla's build system works
makefile - targets makefile - variables, values makefile - *.mk files & user config building libraries there are three main types of libraries that are built in mozilla: components are shared libraries (except in static builds), which are installed to dist/bin/components. components are not linked against by any other library. non-component shared libraries include libraries such as libx
pcom and libmozjs. these libraries are installed to dist/bin and are linked against. you will probably not need to create a new library of this type. static libraries are often used as intermediate steps to building a shared library, if there are source files from several directories that are part of the shared library. static libraries may also be linked into an executable. non-component shared ...
...s type. static libraries are often used as intermediate steps to building a shared library, if there are source files from several directories that are part of the shared library. static libraries may also be linked into an executable. non-component shared libraries a non-component shared library is useful when there is common code that several components need to share and sharing it through x
pcom is not appropriate or not possible. as an example, below is a portion of the makefile for libmsgbaseutil, which is linked against by all of the main news components: depth = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = msgbaseutil library_name = msgbaseutil export_libra...
Simple Instantbird build
atically by the hg clone command), and run: ./mozilla/mach build mach is our command-line tool to streamline common developer tasks. see the mach article for more. building can take a significant amount of time, depending on your system, os, and chosen build options. linux builds on a fast box may take under 15 minutes, but windows builds on a slow box may take several hours. ...
.../mozilla/mach build mach is our command-line tool to streamline common developer tasks. see the mach article for more. building can take a significant amount of time, depending on your system, os, and chosen build options. linux builds on a fast box may take under 15 minutes, but windows builds on a slow box may take several hours. building purplex
pcom and libpurple first download the purplex
pcom code: hg clone http://hg.mozilla.org/users/florian_queze.net/purple mozilla/extensions/purple if you've set up your build environment as above, then all you need to do is: echo 'ac_add_options --enable-extensions=purple' >> .mozconfig in the comm-central directory, or just add the ac_add_options --enable-extensions=purple line to your .mozconfig with your favorite editor. then just re-run...
Browser API
rowser <iframe>, the application can listen for new events about what's happening within the browser <iframe>. the following new events can be listened for: mozbrowseractivitydone sent when something inside the browser <iframe> triggers a web activity, and that web activity's message is consumed by the receiving app. mozbrowserasyncscroll sent when the browser <iframe> content scrolls (the a
pcz version.) see also mozbrowserscroll. note that this is obsolete. mozbrowseraudioplaybackchange sent when audio starts or stops playing within the browser <iframe> content. mozbrowsercaretstatechanged sent when the text selected inside the browser <iframe> content changes. mozbrowserclose sent when window.close() is called within a browser <iframe>. mozbrowsercontextmenu sent when a brows...
... mozbrowserresize sent when the browser <iframe>'s window size has changed. mozbrowserscroll sent when the browser <iframe> content scrolls. mozbrowserscrollareachanged sent when the available scrolling area in the browser <iframe> changes. this can occur on resize and when the page size changes (while loading for example.) mozbrowserscrollviewchange sent when asynchronous scrolling (i.e. a
pcz) starts or stops. mozbrowsersecuritychange sent when the ssl state changes within a browser <iframe>. mozbrowserselectionstatechanged sent when the text selected inside the browser <iframe> content changes. note that this is obsolete, and newer implementations use mozbrowsercaretstatechanged instead. mozbrowsershowmodalprompt sent when alert(), confirm(), or prompt() are called within a br...
Embedding Tips
normally it provide some functionality that is required from lots of places such as looking up preference settings, creating new windows, locating files, displaying prompt or password dialog boxes and so on. embedders may wish to override some of the default service implementations with their own. for example, the default prompt service uses xul to render prompt dialogs and embedders may wish to render them in a way more appropriate for their application and platform.. ...
...completed, the onstatechange will be notified by a combination of state_stop | state_is_network state flags. you may also use the progress listener to query the request supplied in onstatechange for more information. for example, if you wanted to check the server response headers, you might check onstatechange for state_start | state_is_request flags, and from the nsirequest argument qi fornsihtt
pchanne and call methods on that to determine response codes and other information from the server. it is left as an exercise to make this sample synchronous, i.e. wait for persistence to complete before returning. hint, add a native message processing loop after the call to saveuri that terminates when onstatechange indicates persistence has finished.. how do i print a page? query the web browse...
Roll your own browser: An embedding how-to
build is done, you can change directory into mozilla/embedding/config, and do a make. this will produce a directory in dist named embed. it should include all of the base support that you need to get a web browser started up. included is the sample test application (gtkembed or winembed). what initializations do i have to do? somewhere during the start of your application, you must initialize x
pcom. you will also want to shut this down when you quit. other initialization must be done to start up event queues and load some string bundles. all of this is somewhat generic and has been isolated into a static library that you can simply call on. if you build mozilla/embedding/base/, a static library (on windows) called baseembed_s.lib is built. just link this library to your application. the...
...een isolated into a static library that you can simply call on. if you build mozilla/embedding/base/, a static library (on windows) called baseembed_s.lib is built. just link this library to your application. there are two functions that are needed: nsresult ns_initembedding(const char *apath); nsresult ns_termembedding(); pretty self-explanatory. the apath parameter will be passed to ns_initx
pcom. ns_initembedding() must be called from the main thread of your application, otherwise it won't work. do you have any simple examples of embedding mozilla? there are many examples of products already using gecko for embedding. here's a partial list. the sections marked 'mozilla examples' refer to clients and sample code to be found within the mozilla source tree. linux external projects ...
HTTP Cache
this document describes the new http cache version 2. the code resides in /network/cache2. api here is a detailed description of the http cache v2 api, examples included. this document only contains what cannot be found or may not be clear directly from the idl files comments. the cache api is completely thread-safe and non-blocking. there is no i
pc support. it's only accessible on the default chrome process. when there is no profile the new http cache works, but everything is stored only in memory not obeying any particular limits. it is strongly encoraged to not use the old cache api any more - nsicacheservice et al. it will soon be completely obsoleted and removed (bug 913828). nsicachestorageservice the http cache entry-point. accessible as a service...
...a particular app cache version in a group) in hands, this storage will provide read and write access to entries in that application cache; when the app cache is not specified, this storage will operate over all existing app caches the service also provides methods to clear the whole disk and memory cache content or...
PBackground
to the other. this is the foundation of how chrome and content processes talk to each other in e10s. the actor tree all live actors exist in a tree. the root of the tree is known as the top-level actor, an instance of one of a small number of top-level protocols. all actors in a tree "live" on the same thread, and can only be used safely from that thread. the top-level actor for most things is
pcontent, which connects the main thread of the chrome process to the main thread of a child process. for most purposes this is great, because the dom is already bound to the main thread. but in some cases we don't necessarily want to talk to the main thread. what if i want to talk to a different thread? not every communication between the chrome and content processes necessarily wants to go thro...
...th (or even either) processes. for example, when we are uploading textures from the content process we don't need to go through the main thread of the parent process. instead we can go directly to the compositor thread in the parent process by creating a new top-level protocol that connects the compositor thread in the parent process to the main thread of a child process. this protocol is called
pcompositor, and allows us to bypass the main thread of the parent process, which trims the latency of texture uploads since they will not get bogged down if that thread is busy. writing code that works in both chrome and content processes a lot of code "just works" in the content process. but some things, such as apis that need to manipulate files or device settings (e.g. geolocation) cannot run ...
Add-on Manager
d an updatelistener to receive information about compatibility information and new update information. any available update is returned as an addoninstall which is ready to be downloaded and installed. detecting add-on changes requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) you can also get lists of add-ons that, at startup, were changed in various ways. ...
...n also get lists of add-ons that, at startup, were changed in various ways. the getstartu
pchanges() method lets you find out which add-ons were installed, removed, updated, enabled, or disabled at application startup. for example, to take a look at the add-ons that were disabled at startup: components.utils.import("resource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartu
pchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "navigator:browser" type. y...
Sqlite.jsm
sqlite.jsm will create, manage, and destroy statement instances for you. you don't need to worry about caching created statement instances, destroying them when you are done, etc. this translates to fewer lines of code to talk to sqlite. all operations are asynchronous. use of synchronous storage apis is discouraged because they block the main thread. ...
...sactions. sqlite.jsm exposes a transaction api built on top of task.jsm that allows transactions to be written as procedural javascript functions (as opposed to a series of callback driven operations). if the function throws, the transaction is automatically rolled back. this makes code easy to write and read. javascript-y api. sqlite.jsm feels like a pure javascript module. the complexities of x
pcom are mostly hidden from view. javascript programmers should feel right at home using sqlite.jsm. note: the sqlite.jsm javascript code module can only be used from chrome -- that is, from within the application itself or an add-on. before you can use this module, you need to import it into your scope: components.utils.import("resource://gre/modules/sqlite.jsm") obtaining a connection sqlite...
Webapps.jsm
pp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterap
pconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterap
pconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, arunupdate) _registeractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister:...
...canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) po
pcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests...
JavaScript code modules
ides a basic standardized interface for performing in-code logical assertions with optional, customizable error reporting. bookmarkhtmlutils.jsm provides utility functions for importing and exporting bookmarks from the old-school "bookmarks.html" style bookmark files. ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an x
pcom component. customizableui.jsm allows you to interact with customizable buttons and items in firefox's main window ui. deferredtask.jsm run a task after a delay. dict.jsm provides an api for key/value pair dictionaries. downloadlastdir.jsm supplies the path to the directory into which the last download occurred. downloads.jsm provides a single entry point to interact with the downloadi...
...perations simple, using the power of javascript's yield operator. timer.jsm a pure js implementation of window.settimeout. webapps.jsm provides an interface to manage open web apps. webrequest.jsm 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. x
pcomutils.jsm contains utilities for javascript components loaded by the js component loader. ...
about:memory
this "explicit" value at the root of the tree represents all the memory allocated via explicit calls to allocation functions. the "window-objects" sub-tree represents all javascript window objects, which includes the browser tabs and ui windows. for example, the "top(http://...
...esents heap-allocated memory that is not measured by any memory reporter. this is typically 10--20% of "explicit". if it gets higher, it indicates that additional memory reporters should be added. dmd can be used to determine where these memory reporters should be added. there are measurements for other content such as images and workers, and for browser subsystems such as the startup cache and x
pconnect. some add-on memory usage is identified, as the following example shows. ├───40,214,384 b (04.17%) -- add-ons │ ├──21,184,320 b (02.20%) ++ {d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/js-non-window/zones/zone(0x100496800)/compartment([system principal], jar:file:///users/njn/library/application%20support/firefox/profiles/puna0zr8.new/extensions/%7bd10d0bf8-f5b5-c8b4-a8b2-2b9...
AsyncTestUtils extended framework
theticmessages held in the set. while you should not modify this list, you can get its length and read from it. getmsghdr(aindex) [function] retrieve the nsimsgdbhdr at the given index. getmsguri(aindex) [function] retrieve the uri of the message header at the given index. msghdrlist [getter] return a js list with all the nsimsgdbhdrs for the messages that have been injected into folders. x
pcomhdrarray [getter] return an nsimutablearray of the message headers that have been injected into folders. folderswithmsghdrs [getter] return a list where each element is a list with two sub-elements. the first is an nsimsgfolder and the second is a js list of all the nsimsgdbhdrs for the messages that were inserted into the folder. this is used by routines that need to process the messages gro...
...en injected into folders. folderswithmsghdrs [getter] return a list where each element is a list with two sub-elements. the first is an nsimsgfolder and the second is a js list of all the nsimsgdbhdrs for the messages that were inserted into the folder. this is used by routines that need to process the messages grouped by the folder they belong to, such as initiating message moves. folderswithx
pcomhdrarrays [getter] same as folderswithmsghdrs but the second element in each sub-list is an nsimutablearray instead of a js list. manipulating messages setread(aberead) setread(true) marks all the messages in the set as read, setread(false) marks them as unread. setstarred(abestarred) setstarred(true) marks all the messages in the set as starred ("flagged" in imap parlance), setstarred(...
Leak And Bloat Tests
m to provide a continuous check within mailnews and its sub-components for the following items: total memory leaks. total memory usage (aka bloat). provide a consistent number from build to build where no source code has changed. provide reasonable coverage for the normal activities that a user performs. method current method: measure leaks and bloats, in a similar way to firefox (using x
pcom_mem_leak_log and --trace-malloc). the method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data. startup main mail window open address book and message composition windows close address book and message composition windows quit the application future improvements will be discussed on the discussion page of the mozilla wiki. results printe...
... 08/04/2008: prefs.js created via tb with the above settings, the first section is for preferences included in tinderb...
Introduction to NSPR
compliant applications to use system facilities such as threads, thread synchronization, i/o, interval timing, atomic operations, and several other low-level services in a platform-independent manner. this chapter introduces key nspr programming concepts and illustrates them with sample code. the current implementation of nspr allows developers to compile a single source code base on macintosh (p
pc), win32 (nt 3.51, nt 4.0, win'95), and over twenty versions of unix. nspr does not provide a platform for porting existing code. it must be used from the beginning of a software project. nspr naming conventions naming of nspr types, functions, and macros follows the following conventions: types exported by nspr begin with pr and are followed by intercap-style declarations, like this: print,...
...acter (_), like this: pr_bytes_per_short, pr_extern nspr threads nspr provides an execution environment that promotes the use of lightweight threads. each thread is an execution entity that is scheduled independently from other threads in the same process. a thread has a limited number of resources that it truly owns. these resources include the thread stack and the cpu register set (including
pc). to an nspr client, a thread is represented by a pointer to an opaque structure of type prthread. a thread is created by an explicit client request and remains a valid, independent execution entity until it returns from its root function or the process abnormally terminates. (prthread and functions for creating and manipulating threads are described in detail in threads.) nspr threads are ligh...
HTTP delegation
functions. your callback functions might be a full implementation of a http client. or you might choose to leverage an existing http client library and implement the callback functions as a thin layer that forwards requests from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthtt
pclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the implementation in mozilla client applications. specifying an ocsp proxy the remainder of this document is a short howto. one might expect the api defines a simple function that accepts the uri and data to be sent, and returns the result data. but there is n...
... read the source code documentation to learn how to use this api synchronously or asynchronously. now that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to initially register the callbacks. make sure you have completed the nss initialization before you attempt to register the callbacks. look at sec_htt
pclientfcn, which is a (versioned) table of function pointers. create an instance of this type and supply a pointer to your implementation for each entry in the function table. finally register your http client implementation with a call to sec_registerdefaulthtt
pclient. ...
HTTP delegation
functions. your callback functions might be a full implementation of a http client. or you might choose to leverage an existing http client library and implement the callback functions as a thin layer that forwards requests from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthtt
pclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which tracks the implementation in mozilla client applications. specifying an ocsp proxy the remainder of this document is a short howto. one might expect the api defines a simple function that accepts the uri and data to be sent, and returns the result data. but there is n...
... read the source code documentation to learn how to use this api synchronously or asynchronously. now that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to initially register the callbacks. make sure you have completed the nss initialization before you attempt to register the callbacks. look at sec_htt
pclientfcn, which is a (versioned) table of function pointers. create an instance of this type and supply a pointer to your implementation for each entry in the function table. finally register your http client implementation with a call to sec_registerdefaulthtt
pclient. ...
NSS_3.12.1_release_notes.html
_not_ default to x86 but result in an error if host is not recognized bug 359302: remove the sslsample code from nss source tree bug 372241: need more versatile form of cert_nametoascii bug 390296: nss ignores subject cn even when san contains no dnsname bug 401928: support generalized pkcs#5 v2 pbes bug 403543: pkix: need a way to enable/disable aia cert fetching bug 408847: pkix_ocs
pchecker_check does not support specified responder (and given signercert) bug 414003: crash [[@ cert_decodecertpackage] sometimes with this testcase bug 415167: memory leak in certutil bug 417399: arena allocation results are not checked in pkix_pl_infoaccess_parselocation bug 420644: improve ssl tracing of key derivation bug 426886: use const char* in pk11_importcertforkey bug 428103: ...
...pher suites in ssl_implementedciphers. ...
NSS 3.46 release notes
see bug 1573118 for details. tls extended master secret will be enabled by default, where possible. see bug 1575411 for details. bugs fixed in nss 3.46 bug 1572164 - don't...
...n-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 - output paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki when possible for delegated credentials bug 1493916 - fix p
pc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized warning in p7env.c bug 1561548 - remove -wmaybe-uninitialized warning in pkix_pl_ldapdefaultclient.c bug 1512605 - incorrect alert description after unencrypted finished msg bug 1564715 - read /proc/cpuinfo when at_hwcap2 returns 0 bug 1532194 - remove or fix -ddebug_$user from make builds bug 1565577 - visual studio's ...
NSS 3.47 release notes
me contributors: christian weisgerber deian stefan jenine distribution information the hg tag is nss_3_47_rtm. nss 3.47 requires nspr 4.23 or newer. nss 3.47 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_47_rtm/src/ other releases are available in nss releases. u
pcoming changes to default tls configuration the next nss team plans to make two changes to the default tls configuration in nss 3.48, which will be released in early december: tls 1.3 will be the default maximum tls version. see bug 1573118 for details. tls extended master secret will be enabled by default, where possible. see bug 1575411 for details. notable changes in nss 3.47 bug 115...
...uniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stan
pcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf outputs bug 1508776 - remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls exporter in tstclnt and selfserv bug 1581024 - heap overflow in nss utility "derdump" bug 1582343 - soft token mac verification no...
NSS 3.53 release notes
attribute provides a more graceful phase-out for certificate authorities than complete removal from the root certificate builtin store. ...
...stop. ...
NSS API Guidelines
and their issues: use hash tables: hash table lookups are usually quite fast, limiting the contention on the lock. this is best for large lists of objects. be sure to calculate the hash value first, then only lock over the hash table value itself. be sure to increment the reference count, on the returned object, before unlocking. examples of hash tables can be found in security/nss/lib/certdb/
pcertdb.c lock over the entire search: for small linked listed, queues, or arrays, you can lock over the entire search. this strategy is best when lists are short, or even better if lists are relatively read only (they don't change very often) and using reader/writer locks. copy the linked list: instead of operating on the global list, you can copy the list. this also requires small lists. lock o...
...t, you must always destroy it. there is no way to destroy an object by bypassing it's reference count. also, the signature of public destruction functions do not have the 'freeit' prbool, since the structures being freed are opaque. dup, copy, and reference functions functions that return a new reference or copy of a given object should have the form layer_dupdatatype(). for instance, cert_du
pcertifiate() will remain the same, but pk11_referenceslot() will become pk11_dupslot(), and pk11_clonecontext() will become pk11_du
pcontext(). search functions there are several different kinds of searches done via the security library. the first is a search for exactly one object, meeting a given criteria. these types of searches include cert_findcertbydercert(), pk11_findanycertfromdercert()...
NSS tools : modutil
is the name of the platform and the value list contains various attributes of the platform. the platform string is in the format system name:os release:architecture. the installer obtains these values from nspr. os release is an empty string on non-unix operating systems. ...
...d the value list contains various attributes of the platform. the platform string is in the format system name:os release:architecture. the installer obtains these values from nspr. os release is an empty string on non-unix operating systems. ...
NSS reference
nss_initreadwrite nss_nodb_init nss_initialize nss_shutdown utility functions based on "utility functions" in nss public functions. certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions. ...
... utility functions based on "utility functions" in nss public functions. certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions. ...
OLD SSL Reference
shake chapter 5 certificate functions this chapter describes the functions and related types used to work with a certificate database such as the cert7.db database provided with communicator. ...
...ed to work with a certificate database such as the cert7.db database provided with communicator. ...
Utility functions
3.2 and later sec_asn1encodersettakefrombuf mxr 3.2 and later sec_asn1encoderstart mxr 3.2 and later sec_asn1encoderupdate mxr 3.2 and later sec_asn1encodeunsignedinteger mxr 3.11.1 and later sec_asn1lengthlength mxr 3.2 and later sec_du
pcrl mxr 3.9 and later sec_getsignaturealgorithmoidtag mxr 3.10 and later sec_getregisteredhtt
pclient mxr 3.12 and later sec_pkcs5getcryptoalgorithm mxr 3.2 and later sec_pkcs5getkeylength mxr 3.2 and later sec_pkcs5getpbealgorithm mxr 3.2 and later ...
... sec_pkcs5getcryptoalgorithm mxr 3.2 and later sec_pkcs5getkeylength mxr 3.2 and later sec_pkcs5getpbealgorithm mxr 3.2 and later sec_pkcs5isalgorithmpbealg mxr 3.2 and later sec_pkcs5isalgorithmpbealgtag mxr 3.12 and later sec_registerdefaulthtt
pclient mxr 3.11.1 and later sec_signdata mxr 3.2 and later sec_stringtooid mxr 3.12 and later secitem_allocitem mxr 3.2 and later secitem_arenadupitem mxr 3.9 and later secitem_compareitem mxr 3.2 and later secitem_copyitem mxr...
NSS tools : modutil
alue list contains various attributes of the platform. the platform string is in the format system name:os release:architecture. the installer obtains these values from nspr. os release is an empty string on non-unix operating systems. ...
...utes of the platform. the platform string is in the format system name:os release:architecture. the installer obtains these values from nspr. os release is an empty string on non-unix operating systems. ...
Invariants
e in the same compartment. so it is utterly crucially important that this invariant always be true if objects are being created. the public api for compartment-hopping, jsautoentercompartment, and the internal api, js::autocompartment, both make sure the invariant is maintained. however, there is another internal api, js::switchtocompartment, that lets you break this invariant, and of course in x
pconnect we use that from time to time when we know we aren't going to be creating any new objects (other than global objects, which have no parent or prototype) or doing anything that might call back into native code that could create objects. we do this in order to save some cpu cycles (in other words, for no good reason whatsoever). if !js_isrunning(cx) && cx->globalobject == null, then cx->comp...
...uced by a preceding jsop_bindname instruction. (taken together, ecma 262-3 §11.13.1 and ecma 262-3 §10.1.4 specify that in an assignment such as x = f(), the name lookup for x occurs before f is called. jsop_bindname performs this lookup.) the rules below (not exactly invariants) govern the bytecode emitted for nameexpressions. background: the fastest instructions for nameexpressions are fat o
pcodes that combine a load with additional operations, as in jsop_inclocal or jsop_getlocalprop. failing that, jsop_{get,call,set}local and jsop_{get,call,set}arg are the fastest, followed by jsop_{get,call}upvar, jsop_{get,call}dslot, jsop_{get,call,set}gvar, and lastly jsop_{,call,set}name. if it cannot be statically proven that a name always refers to a specific variable (meaning either a parame...
Profiling SpiderMonkey
to read up on profiling javascript with shark. here's a sample mozconfig: mk_add_options moz_objdir=@topsrcdir@/ff-opt-libxul mk_add_options moz_make_flags=-j3 ac_add_options --enable-optimize ac_add_options --enable-libxul ac_add_options --enable-shark ac_add_options --enable-debugger-info-modules ac_add_options --enable-application=browser 2.) you'll want to run shark on both the browser and [x
pcshell], since the host environments differ. here are some instrumented tests to work from: media:profiling-ammo.zip 3.) once you have some changes you'd like to try, you can just rebuild the js/src directory, since it produces its own shared library, even in libxul and static builds. make -c my-obj-dir/js/src other ways to profile for linux, there are global jprof functions available. see the doc...
...s. if you'd like to profile something at a higher level of detail than the js shark functions allow, there are corresponding c functions available at the bottom of jsdbgapi.h. costs of thread safety currently, threadsafe spidermonkey costs us 10-15% on some benchmarks vs. a non-threadsafe js shell. if you're looking to investigate that, build a standalone copy of spidermonkey and compare it with x
pcshell. ...
SpiderMonkey 45
known issues detail any known issues here... future direction jscontext and jsruntime are merging. (jscontext will be the only thing visible...
... known issues detail any known issues here... future direction jscontext and jsruntime are merging. (jscontext will be the only thing visible from within the api, there will be just one per runtime, and inheriting from jsruntime.) spidermonkey embedders should be aw...
STEEL
steel is deprecated and will be removed as of thunderbird 52. consider using the functions found in ap
pconstants.jsm or services.jsm instead steel is the scriptable thunderbird easy extension library. 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"). ...
...erface that implements all the functions of extiapplication. the library has also been implemented in firefox ("fuel") and in seamonkey ("smile"). objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage steeliapplication objects steeliapplication x
pcom although the steel steeliapplication object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code. the object needs to be accessed like any other x
pcom service: var application = components.classes["@mozilla.org/steel/application;1"].getservice(components.interfaces.steeliapplication); other resources steel development plan. bug 408370 bug 1278067 ...
Aggregating the In-Memory Datasource
why would you want to do this? say you were writing a datasource2, and the way you chose to implement it was to "wrap" the in-memory datasource; i.e., myclass : public nsimyinterface, public nsirdfdatasource { private: nscomptr<nsirdfdatasource> minner; public: // nsirdfdatasource methods ns_imethod init(const char* auri) { return minner->init(auri); } ns_imethod geturi(char* *auri) { return minner->geturi(auri); } // etc., for each method in nsirdfdatasource! }; very painful, prone to errors, and fragile as the interfaces are still in flux (a wee bit). aggregation to the rescue! here are the gory details on how. ...
...ething() { nscomptr<nsirdfdatasopurce> ds = do_queryinterface(minner); rv = ds->assert(/* something useful here */); // etc... return ns_ok; } it may be tempting to keep a pointer to the aggregate's nsirdfdatasource in a member variable, butyou can't do that. why? because if you did, you'd hold a circular reference that would never unwind. notes describing all of the vagaries of x
pcom aggregation is beyond the scope of this document. the basic idea is to overload queryinterface(), allowing it to return adelegate object that supports the interface. there is some trickery involved on the delegate's part to ensure that reference counting is done sanely, and that the reflexive, symmetric, and transitive properties of queryinterface() are preserved. if you're really interested, i...
Generating GUIDs
add-ons can (and should) be identified with ids of the form extensionname@organization.tld since firefox 1.5. warning: if you just want an id for your add-on, generating a guid is almost definitely not what you want to do. using the extensionname@organization.tld form is approximately one thousand times easier for everyone involved. don't have a domain name? do you have a blog on a subdomain? use that. ...
...usr/bin/uuidgen. perl jkeiser's mozilla tools include a uuid generator with output format of both c++ and idl style. sfink's update-uuids will change the uuid for a given interface and all of its descendants, updating all *.idl files within a directory tree. nsiuuidgenerator a uuid can be generated from privileged mozilla code using nsiuuidgenerator. see the linked page for details. com/x
pcom format when #define-ing iids and cids in mozilla c++ code, you generally use the following format: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx #define ns_...id \ { 0xxxxxxxxx, 0xxxxx, 0xxxxx, \ { 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx } } you can generate code in this format using one of the following tools. online tools http://mozilla.pettay.fi/cgi-bin/mozuuid.pl guidgen guidge...
Generic factory
rick potts wrote a templated-based generic factory (nsfactory<t>) that simplifies the factory creation process that just requires writing a createinstance() method. the new nsigenericfactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsifactory is needed. here is the interface, and a description of its use. /** * provides a generic nsifactory implementation that can be used by * dlls with very simple factory needs. ...
... background (this is based on my original news posting <beard-2402991733140001@h-198-93-95-151.mcom.com>.) we seem to be creating a huge number of different factory implementations. it seems to me that we can cut down on code size (all those queryinterface, addref, release implementations) if we just use the following class for ...
Packaging WebLock
nent installation overview xpinstall is a set of javascript apis for creating installation scripts. using xpinstall, you can create web-based installations for gecko-based applications, mozilla extensions, or individual components. the installation script for the weblock component can also be used to register the component with the browser into which it is installed (see registration methods in x
pcom for more information on registration). the sample installation script shown below uses the mozilla xpinstall technology to manipulate an installer and talk to mozilla'schrome registry as high-level javascript objects. what is the chrome registry? like the windows registry, the chrome registry is a database of information about applications, skins, and other extensions that have been install...
... and say where it'll go addfile("weblock.dll", 1.0, "weblock.dll", componentsdir, ""); // add the typelib also addfile("weblock.xpt", "1.0", "weblock.xpt", componentsdir, ""); // add the weblock subdirectory of the xpi and specify that // it be installed in the chrome application directory err = adddirectory("weblock", "1.0", "", chromedir, ""); // ? have to register component here or with regx
pcom? // register the new ui with the mozilla chrome registry registerchrome(content, getfolder(cf,"weblock.xpi"),"weblock"); registerchrome(skin, getfolder(cf, "weblock.xpi"),"weblock"); // perform the installation if there are no errors if (err==success) performinstall(); else cancelinstall(err); the weblock trigger script the trigger script is the script placed on a web page that actual...
Making cross-thread calls using runnables
each runnable represents a task which can then be dispatched to another thread for execution. ...
...lback(callback) , mdigits(digits) { } ns_imethod run() { nscstring result; calculatepi(mdigits, result); nscomptr<nsirunnable> resultrunnable = new piresulttask(mcallback, result); ns_dispatchtomainthread(resultrunnable); } private: picallback mcallback; int mdigits; }; putting it all together to start a new thread, create it using the thread manager: #include "nsx
pcomcidinternal.h" void calculatepiasynchronously(int digits, picallback callback) { // to create a new thread, get the thread manager nscomptr<nsithreadmanager> tm = do_getservice(ns_threadmanager_contractid); nscomptr<nsithread> mythread; nsresult rv = tm->newthread(0, 0, getter_addrefs(mythread)); if (ns_failed(rv)) { // in case of failure, call back immediately with an empty strin...
Components.returnCode
components.returncode is a property which can hold an x
pcom return code additionally to the value returned by the return statement. note that components.returncode is currently non-functional due to bug 287107. this problem was introduced in mozilla 1.4. usage components.returncode is a property that can be used to indicate to an x
pcom caller of the javascript method that the method is returning a specific nsresult code. generally, x
pconnect does a fine job of making it unnecessary for javascript code to worry about nsresult codes. by default the successful completion of the javascript method will cause x
pconnect to return a result code of ns_ok to the caller. ...
...components.returncode exists in order to make it possible to implement these rare interfaces in javascript. ...
Components.utils.forceGC
components.utils.forcegc lets scripts force a garbage collection cycle. the mozilla javascript engine will perform garbage collection automatically when the javascript heap grows beyond a certain size. this mechanism doesn't account for any native (c++) x
pcom objects hanging off javascript objects though. in many cases a javascript application will have internal knowledge of javascript objects referencing large (trees of) x
pcom objects and know when they are no longer reachable. in this case it can be important to be able to force a garbage collection cycle from javascript. another instance where it can be useful to force garbage collection is before cleaning out dead reference from a hash of weak javascript references. users should note that garbage collection is a very expensive operation...
... dead reference from a hash of weak javascript references. users should note that garbage collection is a very expensive operation and should only be forced when it is known to be absolutely necessary. note: nsidomwindowutils.garbagecollect() offers similar functionality but will trigger the cycle collector in addition to the garbage collector in the javascript engine. this will make sure that x
pcom components that build cycles with javascript objects also get collected which might be important, for example for testcases that depend on the garbage collector. requires universalx
pconnect privileges. if you want to schedule garbage collection to occur in the future, at a time when no javascript code is running, you can use components.utils.scheduleprecisegc() instead. ...
Components.utils.unload
pt. ...
...e called mymodule.jsm using the following line of code: components.utils.unload("resource://myaddon/modules/mymodule.jsm"); note: currently components.utils.unload clears the global object of an unloaded module. this may cause modules to misbehave after unloading even if you have a reference to them. see bug 769253 see also bug 481603 the documentation in x
pccomponents.idl the tests in js/x
pconnect/tests/unit/ ...
nsLocalFile
example code function getfilesize(path) { var file = components.classes["@mozilla.org/file/local;1"]. ...
... example code function getfilesize(path) { var file = components.classes["@mozilla.org/file/local;1"]. ...
nsObserverService
it should be used from the main thread only. ...
...it should be used from the main thread only. ...
NS_Alloc
it is equivalent to calling alloc on the nsimemory instance returned from ns_getmemorymanager. history this function was finalized for mozilla 1.8. see bug 267767 for details. ...
...it is equivalent to calling alloc on the nsimemory instance returned from ns_getmemorymanager. history this function was finalized for mozilla 1.8. see bug 267767 for details. ...
NS_Free
it is equivalent to calling free on the nsimemory instance returned from ns_getmemorymanager. history this function was finalized for mozilla 1.8. see bug 267767 for details. ...
...it is equivalent to calling free on the nsimemory instance returned from ns_getmemorymanager. history this function was finalized for mozilla 1.8. see bug 267767 for details. ...
nsACString
this class is typically used to represent ascii or utf-8 character arrays. #include "nsstringapi.h" class nsacstring { ... }; typedefs char_type [char] storage unit for this class. self_type [nsacstring] an alias for the type of this class. size_type [pruint32] type used to represent the number of bytes stored in the string. index_type [pruint32] type used to represent an offset into the string. methods beginreading the beginreading function returns a const pointer to the first element of the string's internal buffer. ...
...epends on the context in which it is used. if used with xpidl, then the character encodings of the corresponding xpidl data types applies. nsacstring may even hold data with embedded null bytes. thus, the length of the data contained in the nsacstring should be determined by calling the nsacstring::length() method. the methods defined on nsacstring are implemented as inline wrappers around the x
pcom string functions, prefixed with ns_cstring. see, for example, ns_cstringgetdata. see also nsacstring::length() ns_cstringgetdata nsembedcstring ...
nsACString_internal
methods constructors void nsacstring_internal(const nscsubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring. parameters nscsubstringtuple& tuple void nsacstring_internal(char*, pruint32, pruint32) - source parameters char* data pruint32 length pruint32...
...eeding the length of the string). @returns the length of the buffer in characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(char, print32) - source this method is used to remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsAString
this class is typically used to represent unicode character arrays. #include "nsstringapi.h" class nsastring { ... }; typedefs char_type [prunichar] storage unit for this class. self_type [nsastring] an alias for the type of this class. size_type [pruint32] type used to represent the number of double-byte units stored in the string. index_type [pruint32] type used to represent an offset into the string. methods beginreading the beginreading function returns a const pointer to the first element of the string's internal buffer. ...
...tance depends on the context in which it is used. if used with xpidl, then the character encodings of the corresponding xpidl data types applies. nsastring may even hold data with embedded null values. thus, the length of the data contained in the nsastring should be determined by calling the nsastring::length method. the methods defined on nsastring are implemented as inline wrappers around the x
pcom string functions, prefixed with ns_string. see, for example, ns_stringgetdata. see also nsastring::length, endreading, ns_stringgetdata, nsembedstring ...
nsAString_internal
methods constructors void nsastring_internal(const nssubstringtuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nstastring. parameters nssubstringtuple& tuple void nsastring_internal(prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 length pr...
...g the length of the string). @returns the length of the buffer in characters or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsDependentCSubstring
methods constructors void nsdependentcsubstring(const nsacstring_internal&, pruint32, pruint32) - source parameters nsacstring_internal& str pruint32 startpos pruint32 length void nsdependentcsubstring(const char*, const char*) - source parameters char* start char* end void nsdependentcsubstring(const ns...
...eeding the length of the string). @returns the length of the buffer in characters or 0 if unable to satisfy the request due to low-memory conditions. parameters char** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(char, print32) - source this method is used to remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsDependentSubstring
methods constructors void nsdependentsubstring(const nsastring_internal&, pruint32, pruint32) - source parameters nsastring_internal& str pruint32 startpos pruint32 length void nsdependentsubstring(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end void nsdependentsubs...
...g the length of the string). @returns the length of the buffer in characters or 0 if unable to satisfy the request due to low-memory conditions. parameters prunichar** data pruint32 newlen setisvoid void setisvoid(prbool) - source string data is never null, but can be marked void. if true, the string will be truncated. @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string. @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsEmbedCString
« x
pcom api reference summary the nsembedcstring concrete class provides a way to construct a nsacstring object that allocates null-terminated storage. #include "nsembedstring.h" class nsembedcstring : public nsacstring { ... }; typedefs self_type [nsembedcstring] an alias for the type of this class. abstract_string_type [nsacstring] an alias for the abstract string type this class specializes. methods nsembedcstring constructors for nsembedcstring. get the get function returns a const pointer to the string's null-terminated, internal buffer. operators operator= this operator is a shortcut for the inherited nsacstring::assign family of functions. ...
...bstract string type this class specializes. methods nsembedcstring constructors for nsembedcstring. get the get function returns a const pointer to the string's null-terminated, internal buffer. operators operator= this operator is a shortcut for the inherited nsacstring::assign family of functions. remarks the methods defined on nsembedcstring are implemented as inline wrappers around the x
pcom string functions, prefixed with ns_cstring. see, for example, ns_cstringcontainerinit. see also ns_cstringcontainerinit, nsacstring ...
nsEmbedString
#include "nsembedstring.h" // or: #include "nsstringglue.h" if inside gecko class nsembedstring : public nsastring { ... }; typedefs self_type [nsembedstring] an alias for the type of this class. abstract_string_type [nsastring] an alias for the abstract string type this class specializes. methods nsembedstring constructors for nsembedstring. get the get function returns a const pointer to the string's null-terminated, internal buffer. operators operator= this operator is a shortcut for the inherited nsastring::assign family of functions. ...
...the abstract string type this class specializes. methods nsembedstring constructors for nsembedstring. get the get function returns a const pointer to the string's null-terminated, internal buffer. operators operator= this operator is a shortcut for the inherited nsastring::assign family of functions. remarks the methods defined on nsembedstring are implemented as inline wrappers around the x
pcom string functions, prefixed with ns_string. see, for example, ns_stringcontainerinit. see also ns_stringcontainerinit, nsastring ...
nsSupportsWeakReference
example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... ...
...e. see weak reference for detailed description of weak references. #include "nsweakreference.h" class nssupportsweakreference { ... }; remarks in addition to inheriting from this class, you will need to ensure that your nsisupports::queryinterface implementation exposes nsisupportsweakreference as a supported interface. to use this class, you must link your component or application against the x
pcom glue library. example code // supporting weak references to a hypothetical implementation // of the nsifoo interface... #include "nsweakreference.h" #include "nsifoo.h" class myfoo : public nsifoo, public nssupportsweakreference { public: ns_decl_isupports ns_decl_nsifoo ... }; ns_impl_isupports2(myfoo, nsifoo, nsisupportsweakreference) ... see also nsisupports::queryin...
nsIChromeRegistry
converts a chrome url into a canonical representation...
...://package/provider/package.ext. the extension, ext, is one of: xul for a "content" package. css for a "skin" package. dtd for a "locale" package. nsiuri convertchromeurl( in nsiuri achromeurl ); parameters achromeurl the url that is to be converted. return value a new nsiuri object containing the loadable uri for the specified chrome url. violates the x
pcom interface guidelines wrappersenabled() returns whether x
pcnativewrappers are enabled for the specified uri. boolean wrappersenabled( in nsiuri auri ); parameters auri the uri for which to determine if x
pcnativewrappers are enabled. return value true if x
pcnativewrappers are enabled for the specified uri; otherwise false. see also chrome registration ...
nsICookieService
t a non-null value be provided to ensure that the cookie privacy preferences are honored. return value returns the resulting cookie string. getcookiestringfromhttp() get the complete cookie string associated with the uri. note: this function is redundant and will most likely be removed in a future revision of this interface. getcookiestring() will query the documenturi property off of nsihtt
pchannelinternal if supported, so getcookiestring() can be used in place of this method. string getcookiestringfromhttp( in nsiuri auri, in nsiuri afirsturi, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. afirsturi the uri that the user originally typed in or clicked on to initiate the load of the document referenced by auri...
...r may be null, but it is strongly recommended that a non-null value be provided to ensure that the cookie privacy preferences are honored. setcookiestringfromhttp() set the cookie string and expires associated with the uri. note: this function is redundant and will most likely be removed in a future revision of this interface. setcookiestring() will query the documenturi property off of nsihtt
pchannelinternal if supported, and setcookiestring() could also query the date header from the channel if achannel supports nsihtt
pchannel. void setcookiestringfromhttp( in nsiuri auri, in nsiuri afirsturi, in nsiprompt aprompt, in string acookie, in string aservertime, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. ...
nsIDNSService
target 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 onlooku
pcomplete should be called. if this parameter is null, then onlooku
pcomplete will be called on an unspecified thread (possibly recursively). return value an object that can be used to cancel the host lookup. init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) called to initialize the dns service. void init(); parameters none. resolve() called t...
...method. void shutdown(); parameters none. ...
nsIDOMGlobalPropertyInitializer
dom/interfaces/base/nsidomglobalpropertyinitializer.idlscriptable an initializer for global properties that lets them know about the window they're being attached to. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) an x
pcom component implementing this interface can be exposed to web content as a property on the window. see custom window properties are a snap in firefox blog post for details. an alternative way to expose an object to the web content is to add the property in response to the content-document-global-created notification. method overview jsval init(in nsidomwindow window); methods init() jsval init( in nsidomwindow window ); parameters window ...
... web content is to add the property in response to the content-document-global-created notification. method overview jsval init(in nsidomwindow window); methods init() jsval init( in nsidomwindow window ); parameters window the window to which the global property is being attached. return value the initialized global property. ensure that you never return any internal x
pcom objects to untrusted code. it is also recommended to use __exposedprops__ to control which members are exposed. ...
nsIDOMOfflineResourceList
flineresourcelist.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 method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long index); void mozremove(in domstring uri); void swa
pcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list. read only. mozlength unsigned long the number of entries in the dynamically managed offline resource list. read only. onchecking nsidomeventlistener an eve...
...tem whose uri should be returned. return value an domstring containing the uri of the specified resource. mozremove() removes an item from the list of dynamically managed entries. if this was the last reference to the given uri in the application cache, the cache entry is removed. void mozremove( in domstring uri ); parameters uri the uri of the item to remove from the list. swa
pcache() swaps in the newest version of the application cache. the newest version of resources are updated on first refresh. this means already loaded resources should only update after a page refresh. note: versioned application caches are not yet supported; this method will throw an exception. void swa
pcache(); parameters none. update() begins the application cache update process. this wi...
nsIDebug
x
pcom/base/nsidebug.idlscriptable provides debugging support for scripted languages, such as javascript, java, python, perl, and so forth. inherits from: nsisupports last changed in gecko 1.7 note: c/c++ consumers who are planning to use the nsidebug interface with the @mozilla.org/x
pcom;1 contract should use ns_debugbreak() from x
pcom glue instead, or alternatively the ns_abort, ns_assertion, ns_break, and ns_warning macros, which also call ns_debugbreak() if used in a debugging build. method overview void abort(in string afile, in long aline); void assertion(in string astr, in string aexpr, in string afile, in long aline); void break(in string afile, in long aline); void warning(in string astr, in string afile, in long aline); methods abort() requests the proces...
...ng aline); void break(in string afile, in long aline); void warning(in string astr, in string afile, in long aline); methods abort() requests the process to trigger a fatal abort. void abort( in string afile, in long aline ); parameters afile file containing abort request. aline line number of abort request. assertion() shows an assertion and triggers optional behavior based on the x
pcom_debug_break environment variable, defaulting to calling break() on windows and os/2 and warning on other platforms. void assertion( in string astr, in string aexpr, in string afile, in long aline ); parameters astr assertion message. aexpr expression that failed. afile file containing assertion. aline line number of assertion. break() requests the software break into a debugger. if n...
nsIDebug2
this often correlates to whether other code (for example, firefox, xulrunner) was compiled with debug defined. read only. ...
...this often correlates to whether other code (for example, firefox, xulrunner) was compiled with debug defined. read only. see also nsidebug ...
nsIDirectoryService
x
pcom/io/nsidirectoryservice.idlscriptable this interface provides methods to initialize and configure a directory service instance. the x
pcom directory service implements this interface to provide support for a variety of well-known file and directory locations. inherits from: nsisupports last changed in gecko 1.7 method overview void init(); void registerprovider(in nsidirectoryserviceprovider prov); void unregisterprovider(in nsidirectoryserviceprovider prov); init() initializes the nsidirectoryservice instance. this method must be called before an nsidirectoryservice instance can be used. in the case of the x
pcom directory service, this method is called as part of x
pcom initialization. ...
...ider(in nsidirectoryserviceprovider prov); void unregisterprovider(in nsidirectoryserviceprovider prov); init() initializes the nsidirectoryservice instance. this method must be called before an nsidirectoryservice instance can be used. in the case of the x
pcom directory service, this method is called as part of x
pcom initialization. must not be called by external code; called internally by x
pcom initialization. void init(); parameters none. registerprovider() register a provider with the service. the directory service will keep a strong reference to the nsidirectoryserviceprovider instances registered via registerprovider. the providers will be released when the service is destroyed at x
pcom shutdown. call unregisterprovider() to force the directory service to relinquish ownership o...
nsIEditor
« x
pcom api reference editor/nsieditor.idlscriptable provides methods and attributes used when editing page content. 66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes...
... nsieditorobserver observer obsolete since gecko 18); void addeditactionlistener(in nsieditactionlistener listener); void removeeditactionlistener(in nsieditactionlistener listener); void adddocumentstatelistener(in nsidocumentstatelistener listener); void removedocumentstatelistener(in nsidocumentstatelistener listener); debug methods void dum
pcontenttree(); void debugdum
pcontent() ; void debugunittests(out long outnumtests, out long outnumtestsfailed); [notx
pcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags constant value description enone 0 enext 1 eprevious 2 enextword 3 epreviouswo...
nsIEditorMailSupport
nsisupportsarray getembeddedobjects(); parameters none. return value an nsisupportsarray containing the img and object tags of the current document. insertascitedquotation() insert a string as quoted text (whose representation is dependent on the editor type), replacing the selected text (if any), i...
... a quotation (whose representation is dependent on the editor type), replacing the selected text (if any). void pasteasquotation( in long aselectiontype ); parameters aselectiontype text or html? rewrap() rewrap the selected part of the document, re-quoting if necessary. void rewrap( in boolean arespectnewlines ); parameters arespectnewlines try to maintain newlines in the original? stri
pcites() strip any citations in the selected part of the document. void stri
pcites(); parameters none. ...
nsIFilePicker
all files will pass through the filter. filterhtml 0x002 corresponds to the *.html, *.htm, *.shtml and *.xhtml filters for file extensions. filtertext 0x004 corresponds to the *.txt and *.text filter for file extensions. filterimages 0x008 corresponds to the *.jpe, *.jpg, *.jpeg, *.gif, *.png, *.bmp, *.ico, *.svg, *.svgz, *.tif, *.tiff, *.ai, *.drw, *.
pct, *.psp, *.xcf, *.psd and *.raw filters for file extensions. filterxml 0x010 corresponds to the *.xml filter for file extensions. filterxul 0x020 corresponds to the *.xul filter for file extensions. filterapps 0x040 corresponds to the platform specific application filter for file extensions. application files for the user's platform will pass through t...
...s to the *.xul filter for file extensions. filterapps 0x040 corresponds to the platform specific application filter for file extensions. application files for the user's platform will pass through the filter. filterallowurls 0x80 allow urls. filteraudio 0x100 corresponds to the *.aac, *.aif, *.flac, *.iff, *.m4a, *.m4b, *.mid, *.midi, *.mp3, *.mpa, *.m
pc, *.oga, *.ogg, *.ra, *.ram, *.snd, *.wav and *.wma filters for file extensions. filtervideo 0x200 corresponds to the *.avi, *.divx, *.flv, *.m4v, *.mkv, *.mov, *.mp4, *.mpeg, *.mpg, *.ogm, *.ogv, *.ogx, *.rm, *.rmvb, *.smil, *.webm, *.wmv and *.xvid filters for file extensions. methods appendfilter() appends a custom file extension filter to the dialog. the filter append...
nsIHttpActivityObserver
netwerk/protocol/http/nsihttpactivityobserver.idlscriptable this interface provides a way for http transport activities to be reported to observers. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void observeactivity(in nsisupports ahtt
pchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, 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...
... activity_subtype_response_complete 0x5005 the complete http response has been received. activity_subtype_transaction_close 0x5006 the http transaction has been closed. methods observeactivity() called when activity occurs on the http transport. you should implement this method to perform whatever tasks you wish to perform when http activity occurs. void observeactivity( in nsisupports ahtt
pchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata ); parameters ahtt
pchannel the nsihtt
pchannel 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 narro...
nsIHttpUpgradeListener
1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) this is used, for example, by websockets in order to upgrade an http channel to use the websocket protocol. ...
... void ontransportavailable(in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout); methods ontransportavailable() called when an http protocol upgrade attempt is completed, passing in the information needed by the protocol handler to take over the channel that is no longer being used by http. note: to begin a protocol upgrade, call nsihtt
pchannelinternal.httpupgrade(). void ontransportavailable( in nsisockettransport atransport, in nsiasyncinputstream asocketin, in nsiasyncoutputstream asocketout ); parameters atransport the nsisockettransport describing the socket connection between the browser and the server; this socket can now be used for the new protocol instead of http. asocketin the nsiasyncinputstream...
nsIINIParser
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) typically, you'll create an nsiiniparser object by calling nsiiniparserfactory.createiniparser(). also, if you need to write to an ini file, use nsiiniparserwriter. nsiutf8stringenumerator getkeys(in autf8string asection); nsiutf8stringenumerator getsections(); autf8string getstring(in autf8string asection, in autf8string akey); methods getkeys() returns an nsiutf8stringenumerator providing the keys available within the specified section of the ini file. ...
...tion in the ini file. ini sections are * defined by square brakets and look like this: [settings] * all entries below such a section definition belong to that * section (until the next section). * @param {string} prop * the name of the property to get. */ function getinivalue (inifile, section, prop) { var inifact = components.manager.getclassobjectbycontractid( "@mozilla.org/x
pcom/ini-parser-factory;1", components.interfaces.nsiiniparserfactory ); var iniparser = inifact.createiniparser(inifile); try { return iniparser.getstring(section,prop); } catch(e) { return undefined; } } // usage: var lang = getinivalue(file,"setting","language"); enumerating sections this example gets a list of all the sections in the ini file. // get all sections in the...
nsIINIParserFactory
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) see example for how to use this interface. method overview nsiiniparser createiniparser(in nsilocalfile ainifile); methods createiniparser() creates an ini parser, returning the nsiiniparser object that you can use to parse it. nsiiniparser createiniparser( in nsilocalfile ainifile ); parameters ainifile the ini file to parse. return value the nsiiniparser object you can use to parse the ini file. ...
...r instance for an ini file, you may use the following code: // create an nsilocalfile var cl = "@mozilla.org/file/local;1"; var interf = components.interfaces.nsilocalfile; var file = components.classes[cl].createinstance(interf); // init the file with the path to your ini file var path = "c:\\temp\\example.ini"; file.initwithpath(path); // create the nsiiniparserfactory var cl = "@mozilla.org/x
pcom/ini-parser-factory;1"; var interf = components.interfaces.nsiiniparserfactory; var inifact = components.manager.getclassobjectbycontractid(cl,interf); // get the iniparser for the ini file var iniparser = inifact.createiniparser(file); see also nsiiniparser nsilocalfile ...
nsIINIParserWriter
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10) this interface provides methods that allow writing to ini-format configuration files. ini files contain zero or more sections, denoted by a name in square brackets, followed by zero or more lines of text with a property name on the left, then an equals sign ("="), then the value of the property. ...
...enoted by a name in square brackets, followed by zero or more lines of text with a property name on the left, then an equals sign ("="), then the value of the property. to create an nsiiniparserwriter object, you use the nsiiniparserfactory interface to create a parser, then nsisupports.queryinterface() that to get an nsiiniparserwriter, like this: let writer = components.classes["@mozilla.org/x
pcom/ini-processor-factory;1"]. .getservice(components.interfaces.nsiiniparserfactory) .createiniparser(somelocalfile) .queryinterface(components.interfaces.nsiiniparserwriter); here, somelocalfile is an nsifile based object, such as an nsilocalfile. this indicates the file into which the ini data will be written. once the write...
nsIInProcessContentFrameMessageManager
return value the nsicontent object representing the owner's content. see also content process event handling nsicontentframemessagemanager ...
...return value the nsicontent object representing the owner's content. see also content process event handling nsicontentframemessagemanager ...
nsIModule
x
pcom/components/nsimodule.idlscriptable this interface must be implemented by each x
pcom component. it is the main entry point by which the system accesses an x
pcom component. inherits from: nsisupports last changed in gecko 0.9.9 method overview boolean canunload(in nsicomponentmanager acompmgr); void getclassobject(in nsicomponentmanager acompmgr, in nscidref aclass, in nsiidref aiid, [retval, iid_is(aiid)] out nsqiresult aresult); void registerself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr, in string atype); void unregisterself(in nsicomponentmanager acompmgr, in nsifile alocation, in string aloaderstr); methods canunload() this method may be queried to determine whether or not the component modul...
...boolean canunload( in nsicomponentmanager acompmgr ); parameters acompmgr the global component manager. return value indicates to the caller whether or not the component module can be unloaded. returning true is not a guarantee that the module will be unloaded. it constitues only willingness of the module to be unloaded. it is very important to ensure that no outstanding reference...
nsIObserver
these notifications are often, though not always, broadcast via the nsiobserverservice. inherits from: nsisupports last changed in gecko 0.9.6 method overview void observe(in nsisupports asubject, in string atopic, in wstring adata); methods observe() this method will be called when there is a notification for the topic that the observer has been registered for. if you expect multiple topics/subjects, the implementor is responsible for filtering. you should not modify, add, remove, or enumerate notifications in the implementation of this method. ...
...implementation can observe multiple types of notification, and is responsible for dispatching its own behavior on the basis of the parameters for a given callback. in general, atopic is the primary criterion for such dispatch; nsiobserver implementations should take care that they can handle being called with unknown values for atopic. the most common implementation of nsiobserverservice is the x
pcom observer service. with this implementation, it's safe (and common practice) for an implementation of nsiobserver to remove itself as an observer during the observe callback, or to add or remove other observers. be careful, though, because other uses of nsiobserver may not support these operations correctly within observe. example the following code is an implementation of nsiobserver that is ...
nsIParserUtils
this from within gecko--use nscontentutils, nstreesanitizer, and so on directly instead. implemented by: @mozilla.org/parserutils;1 as a service: var parserutils = components.classes["@mozilla.org/parserutils;1"] .getservice(components.interfaces.nsiparserutils); method overview astring converttoplaintext(in astring src, in unsigned long flags, in unsigned long wra
pcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value description sanitizerallowcomments (1 << 0) flag for sanitizer: allow comment nodes. sanitizerallo...
...media (1 << 5) flag for sanitizer: drops <img>, <video>, <audio>, and <source>, and flattens out svg. sanitizerlogremovals (1 << 6) flag for sanitizer: log messages to the console for everything that gets sanitized. methods converttoplaintext() converts html to plain text. astring converttoplaintext( in astring src, in unsigned long flags, in unsigned long wra
pcol ); parameters src the html source to parse (c++ callers are allowed but not required to use the same string for the return value.) flags conversion option flags defined in nsidocumentencoder. wra
pcol number of characters per line; 0 for no auto-wrapping. return value the plain text conversion of the html specified in src. parsefragment() parses markup into a sanitized document fr...
nsIScriptError
66 introduced gecko 1.0 inherits from: nsiconsolemessage last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/scripterror;1. to create an instance, use: var scripterror = components.classes["@mozilla.org/scripterror;1"] .createinstance(components.interfaces.nsiscripterror); note: the nsiscripterror2 interface was merged into this interface in gecko 12.0. prior to that release, if you wanted to associate an outer window with a script error, you had to use nsiscripterror2 instead. ...
...re in the code. this is an attempt to group them together for reference. note that these are strings. if you want to log an error at chrome level you should set a category from the first section (leaving it empty might log it as content error). as addon author i would recommend using "chrome javascript" for logging exceptions caused by addon code. ...
nsIScriptableIO
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. nsiscriptableio provides a convenient api for creating files and streams, as well as for...
... details about how to use this object, see the file and stream guide. network/base/public/nsiscriptableio.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports a scriptable io object can be used in an extension or chrome code by referring to the global io object. ...
nsISecurityCheckedComponent
caps/idl/nsisecuritycheckedcomponent.idlscriptable provides methods that let an x
pcom component define custom rules for accessing it from potentially unprivileged code. inherits from: nsisupports last changed in gecko 1.7 capability strings in gecko, a "capability" is a string identifying a set of actions that code is allowed to perform. two examples: code that has the "universalx
pconnect" capability is allowed to access all of x
pcom. this includes creating instances of arbitrary x
pcom objects and calling methods and setting properties on them. code that has the "universalbrowserread" capability is allowed to perform certain actions that allow it to read information from the local system. for example, this capability allows code to set the value of <input type="file"> and...
...es have no special capabilities. extensions can define their own capabilities and use this interface to only allow access to code trusted with that capability. the two special return values of '"allaccess" or "noaccess" unconditionally allow or deny access to the operation. all code has the "allaccess" capability, and no code has the "noaccess" capability. this interface is used in mozilla by x
pconnect and a handful of things that need special handing (xul controllers, the ui for the <video> tag, etc.). method overview string cancallmethod(in nsiidptr iid, in wstring methodname); string cancreatewrapper(in nsiidptr iid); string cangetproperty(in nsiidptr iid, in wstring propertyname); string cansetproperty(in nsiidptr iid, in wstring propertyname); methods cancallmethod() retu...
nsISelection
?. ...
...e given nsidomnode. when the selection is collapsed(), and the content is focused and editable, the caret will blink there. void collapse( in nsidomnode parentnode, in long offset ); parameters parentnode the given nsidomnode where the selection will be set. offset where in the given dom node to place the selection (the offset into the given node). collapsed() [noscript,notx
pcom,nostdcall] boolean collapsed(); native code only!collapsenative void collapsenative( in nsinode parentnode, in long offset ); parameters parentnode offset collapsetoend() collapses the whole selection to a single point at the end of the current selection (regardless of direction). if content is focused and editable, the caret will blink there. void collapsetoend(); parameters ...
nsISelectionPrivate
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 ...
...xtrangestyleref textrangestyle ); parameters range textrangestyle startbatchchanges() will stop user interface updates while multiple selection methods are called. call endbatchchanges() to resume user interface updates. void startbatchchanges(); parameters none. tostringwithformat() wstring tostringwithformat( in string formattype, in unsigned long flags, in print32 wra
pcolumn ); parameters formattype flags wra
pcolumn return value ...
nsISupportsWeakReference
this interface was frozen for gecko 0.9.9. see bug 48726 for details. ...
...nly be produced for objects that implement this interface. inherits from: nsisupports last changed in gecko 1.7 method overview nsiweakreference getweakreference(); methods getweakreference() produces an appropriate instance of nsiweakreference. nsiweakreference getweakreference(); parameters none. return value the resulting nsiweakreference instance. remarks the x
pcom glue library provides nssupportsweakreference, a canonical implementation of nsisupportsweakreference. this interface was frozen for gecko 0.9.9. see bug 48726 for details. from gecko 2.0 interfaces are no longer frozen. see also nsiweakreference nssupportsweakreference ...
nsIUTF8ConverterService
intl/uconv/idl/nsiutf8converterservice.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview autf8string convertstringtoutf8(in acstring astring, in string acharset, in boolean aski
pcheck); autf8string converturispectoutf8(in acstring aspec, in string acharset); methods convertstringtoutf8() ensure that astring is encoded in utf-8. if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8. autf8string convertstringtoutf8( in acstring astring, in string acharset, in boolean aski
pcheck, in boolean aallowsubstitution ); parameters astring a string to ensure its utf8ness. acharset the charset to convert from if astring is not i...
...8. if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8. autf8string convertstringtoutf8( in acstring astring, in string acharset, in boolean aski
pcheck, in boolean aallowsubstitution ); parameters astring a string to ensure its utf8ness. acharset the charset to convert from if astring is not in utf-8. aski
pcheck determines whether or not to skip 'asciiness' and 'utf8ness' check. set this to pr_true only if you suspect that astring can be mistaken for ascii / utf-8 but is actually not in ascii / utf-8 so that astring has to go through the conversion. skipping asciiness/utf8ness check. the most common case is the input is in 7bit non-ascii character sets like iso-2022-jp, hz or utf-7 (in its ori...
nsIWindowWatcher
level windows, and allows some operations on them. inherits from: nsisupports last changed in gecko 0.9.6 usage notes: this component has an activewindow property. clients may expect this property to be always current, so to properly integrate this component the application will need to keep it current by setting the property as the active window changes. this component should not keep a (x
pcom) reference to any windows; the implementation will claim no ownership. windows must notify this component when they are created or destroyed, so only a weak reference is kept. note that there is no interface for such notifications (not a public one, anyway). this is taken care of both in mozilla and by common embedding code. embedding clients need do nothing special about that requirement. thi...
...nd into multiple arguments (but not recursively!). can be null, in which case the window.arguments property will not be set on the new window. as of gecko 1.9 alpha 1, can also be an nsiarray instead. return value an nsidomwindow for the opened window. ...
nsIXULRuntime
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/xre/app-info;1. to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility service is running. 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. x
pcomabi autf8string a string tag identifying the binary abi of the current processor and compiler vtable. this is taken from the target_x
pcom_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 p
pc-gcc3. this value should almost always be...
NS_CStringContainerInit2
#include "nsstringapi.h" nsresult ns_cstringcontainerinit2( nscstringcontainer& acontainer, const char* adata = nsnull, pruint32 adatalength = pr_uint32_max, pruint32 aflags = 0 ); parameters acontainer [in] the nscstringcontainer instance to initialize. adata [in] an array of characters used to initialize the string object. this parameter may be null. adatalength [in] an optional parameter that specifies the length of the array pointed to by adata. pass pr_uint32_max to indicate that adata's length may be determined by scanning the string for a terminating null. if adata is null, then this parameter is ignored. ...
... passed in data pointer directly. the caller must ensure that the data is valid for the lifetime of the string container. this flag should not be combined with ns_cstring_container_init_adopt. ns_cstring_container_init_adopt data passed into ns_cstringcontainerinit2 is not copied. instead, the string takes ownership over the data pointer. the caller must have allocated the data array using the x
pcom memory allocator. this flag should not be combined with ns_cstring_container_init_depend. ns_cstring_container_init_substring data passed into ns_cstringcontainerinit2 is a substring that is not null-terminated. return values the ns_cstringcontainerinit function returns ns_ok if successful. otherwise, it returns an error code. remarks after a nscstringcontainer object has been initializ...
nsGetModuleProc
alocation [in] the location of the module if any. may be null. aresult [out] the nsimodule instance. ...
... alocation [in] the location of the module if any. may be null. aresult [out] the nsimodule instance. ...
The Thread Manager
application/extension javascript should consider using a chromeworker instead.") interfaces there are several interfaces that provide threading support: nsithreadmanager the thread manager itself lets you create threads. nsithread the nsithread interface encapsulates an operating system thread, providing easy cross-platform access to multithreading in your code. ...
...ds. nsithread the nsithread interface encapsulates an operating system thread, providing easy cross-platform access to multithreading in your code. nsithreadpool a thread pool provides a limited set of worker threads. when you dispatch an event to the pool, the pool selects an available worker thread to process the event. nsithreadinternal a subclass of nsithread that is implemented by the x
pcom thread object to add support for observing dispatch activity on a thread. nsithreadobserver provides the ability to monitor a thread, to receive notifications when events are dispatched to it and when they're finished being processed. nsithreadeventfilter this interface is used by the nsithreadinternal.pusheventqueue() method in nsithreadinternal to allow event filtering. nsirunnable this...
Status, Recent Changes, and Plans
w pointer (or a literal 0 or nsnull) work correctly on all compilers. see bug 65664. made getter_addrefs( nscomptr& ) apply the same type-safety check that the simple assignment forms do. added do_createinstance. added do_getservice. eliminated the need to cast getter_addrefs when an nsisupports** is needed. relaxed the invariant for nscomptr<nsisupports>, so that it is now a pointer to any x
pcom interface. added do_queryreferent to make using nsiweakreferences easier. plans for nscomptr bug 59212: as soon as we test on more compilers, start recommending already_addrefed as a function result. bug 59414: making operator& private may help prevent some leaks caused by casting move the factored nscomptr routines into their own library, to reduce nscomptr clients' dependency on the x...
...om interface. added do_queryreferent to make using nsiweakreferences easier. plans for nscomptr bug 59212: as soon as we test on more compilers, start recommending already_addrefed as a function result. bug 59414: making operator& private may help prevent some leaks caused by casting move the factored nscomptr routines into their own library, to reduce nscomptr clients' dependency on the x
pcom library. recent changes to this document removed the statement that == and != between an nscomptr and a raw pointer or literal 0 does not work on some compilers since it is no longer true. added an entire section to the getting started guide on nscomptrs in function signatures added references to recent bugs influencing the use of nscomptr machinery: bug 59212, and bug 59414 fixed compa...
Working with out parameters
to get at the out parameters, you have to pass in an object. ...
...avor, out nsisupports adata, out unsigned long adatalen ) ; ... } the gettransferdata method takes three parameters, aflavor, adata, and adatalen, and returns nothing. adata and adatalen are marked as out, meaning that they act as "return values" for this method, and are changed during the method call. these are so-called out parameters. usage in order to use such a method from javascript via x
pconnect, you have to follow a specific rule. to get at the out parameters, you have to pass in an object. after the call, this object will have a new property called value, which contains the out values. assuming you have an object called transferable, you would invoke gettransferdata() as follows: var adata = {}; var adatalen = {}; transferable.gettransferdata("text/unicode", adata, adatalen);...
xpidl
xpidl is a tool for generating x
pcom interface information, based on xpidl interface description files. it generates: c++ header files (.h), with a commented template for full c++ implementation of the interface x
pconnect typelib files (.xpt), with runtime type information to dynamically call x
pcom objects through x
pconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk. pyxpidl has been used for some time now, but now this older tool has been fully retired. xpidl is based on the libidl idl compiler from the gnome project. the libidl compiler depends on glib, also from the gnome project. the xpidl compiler is now part of the build process, allowing us to generate headers used by the x
pcom components. please check the build documentation fo...
...nyi) -t create a typelib of a specific version number -i add entry to start of include path for ``#include "nsithing.idl" -o use basename (e.g. ...
Building a Thunderbird extension 1: introduction
similar to firefox, thunderbird functionality can be enhanced and customized via extensions. warning: this content is for older versions of thunderbird. much of it may no longer be relevant. see developer.thunderbird.net for newer information. ...
...lso known as an integrated development environment). these provide features like syntax highlighting and code coloration, indentation, auto-complete, etc. file archive utility: any utility that is capable of creating archive files can be used. there are also a number of extension and applications that are useful for testing and debugging thunderbird extensions, such as javascript consoles and x
pcom inspectors. these are described on the page "setting up an extension development environment". documentation thunderbird extensions (documentation overview) firefox addons developer guide (many topics are applicable to thunderbird) mozilla cross-reference source code browser ("comm-central" contains the thunderbird code repository) community the thunderbird development community has a ...
Get Thunderbird version
on thunderbird version 3.0b3pre and later, you can use the following snippet to get the thunderbird version. ...
...var version; if ( "@mozilla.org/xre/app-info;1" in components.classes ) version = components.classes["@mozilla.org/xre/app-info; 1"].getservice(components.interfaces.nsixulappinfo).version; else version = components.classes["@mozilla.org/preferences-service; 1"].getservice(components.interfaces.nsiprefbranch).getcharpref ("app.version"); var versionchecker = components.classes["@mozilla.org/x
pcom/version- comparator;1"].getservice(components.interfaces.nsiversioncomparator); if ( versionchecker.compare( version, "3.0b3" ) >= 0 ) // code for >= 3.0b3 else // code for < 3.0b3 ...
js-ctypes
ion and extension code to call back and forth to native code written in c. c++ support is possible through vtable pointers see using com from js-ctypes. for a discussion on extended c++ support see bug 505907. other work made possible by js-ctypes is jni, this is elaborated on in the jni.jsm section and not the js-ctypes section due to the jsm abstracting away all of the js-ctypes. unlike binary x
pcom components, it allows developers to ship a single binary for use with multiple versions of firefox. note: js-ctypes is only available from chrome code; that is, ctypes is not available to websites, only application and extension code. documentation if you are brand new to js-ctypes, and have no idea about it, the pages you should read first is - ctypes.open followed by stan...
...eature in firefox. ...
Constants - Plugins
cription npvers_has_streamoutput 8 streaming data. npvers_has_notification 9 notification of completion. npvers_has_liveconnect 9 liveconnect. npvers_win16_has_liveconnect 9 liveconnect (win16). npvers_68k_has_liveconnect 11 liveconnect (68k). npvers_has_windowless 11 windowless plug-in. npvers_has_x
pconnect_scripting 13 plug-in is scriptable using x
pconnect. npvers_has_npruntime_scripting 14 plug-in is scriptable using npruntime. npvers_has_form_values 15 nppvformvalue nppvariables are supported. npvers_has_popups_enabled_state 16 the npn_pushpopupsenabledstate() and npn_poppopupsenabledstate() functions are supported. npvers_has_resp...
...n is scriptable using npruntime. npvers_has_form_values 15 nppvformvalue nppvariables are supported. npvers_has_popups_enabled_state 16 the npn_pushpopupsenabledstate() and npn_poppopupsenabledstate() functions are supported. npvers_has_response_headers 17 npstreams have response headers for http streams. npvers_has_npobject_enum 18 the n
pclass in question has an enumerate field, which lets you enumerate the properties of an npobject of that class. « previous ...
AudioTrack.enabled - Web APIs
led = true | false; value the enabled property is a boolean whose value is true if the track is enabled; enabled tracks produce audio while the media is playing. setting enabled to false effectively mutes the audio track, preventing it from contributing to the media's audio performance. example this example switches between the main and commentary audio tracks of a media element. ...
...these represent the primary audio track and the commentary track. note: this example assumes that there is only one of each kind of track in the video, but this is not necessarily the case. the element's audio tracks are then scanned t...
BaseAudioContext.decodeAudioData() - Web APIs
iocontext.decodeaudiodata(arraybuffer); parameters arraybuffer an arraybuffer containing the audio data to be decoded, usually grabbed from xmlhttprequest, windoworworkerglobalscope.fetch() or filereader. successcallback a callback function to be invoked when the decoding successfully finishes. the single argument to this callback is an audiobuffer representing the decodeddata (the decoded
pcm audio data). usually you'll want to put the decoded data into an audiobuffersourcenode, from which it can be played and manipulated how you want. errorcallback an optional error callback, to be invoked if an error occurs when the audio data is being decoded. return value void, or a promise object that fulfills with the decodeddata. example in this section we will first cover the older cal...
... then the newer promise-based syntax. older callback syntax in this example, the getdata() function uses xhr to load an audio track, setting the responsetype of the request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable . we then pass this buffer into a decodeaudiodata() function; the success callback takes the successfully decoded
pcm data, puts it into an audiobuffersourcenode created using audiocontext.createbuffersource(), connects the source to the audiocontext.destination and sets it to loop. the buttons in the example simply run getdata() to load the track and start it playing, and stop it playing, respectively. when the stop() method is called on the source, the source is cleared out. note: you can run the example l...
CSS numeric factory functions - Web APIs
ssunitvalue.cssunitvalue() constructor. ...
...number); css.vi(number); css.vb(number); css.vmin(number); css.vmax(number); css.cm(number); css.mm(number); css.q(number); css.in(number); css.pt(number); css.
pc(number); css.px(number); // <angle> css.deg(number); css.grad(number); css.rad(number); css.turn(number); // <time> css.s(number); css.ms(number); // <frequency> css.hz(number); css.khz(number); // <resolution> css.dpi(number); css.d
pcm(number); css.dppx(number); // <flex> css.fr(number); examples we use the css.vmax() numeric factory function to create a cssunitvalue: let height = css.vmax(50); console.log( height ); // cssunitvalue {value: 50, unit: "vmax"} console.log( height.value ) // 50 console.log( height.unit ) // vmax in this example, we set the margin on our element using the css.px() factory function: ...
console - Web APIs
specified object if possible or the javascript object view if it is not possible. console.error() outputs an error message. you may use string substitution and additional arguments with this method. console.exception() an alias for error(). console.group() creates a new inline group, indenting all following output by another level. to move back out a level, call groupend(). console.grou
pcollapsed() creates a new inline group, indenting all following output by another level. however, unlike group() this starts with the inline group collapsed requiring the use of a disclosure button to expand it. to move back out a level, call groupend(). console.groupend() exits the current inline group. console.info() informative logging of information. you may use string substitution and add...
...cing and word-break writing-mode note: the console message behaves like an inline element by default. to see the effects of padding, margin, etc. you should set it to for example display: inline-block. using groups in the console you can use nested groups to help organize your output by visually combining related material. to create a new nested block, call console.group(). the console.grou
pcollapsed() method is similar but creates the new block collapsed, requiring the use of a disclosure button to open it for reading. to exit the current group, simply call console.groupend(). for example, given this code: console.log("this is the outer level"); console.group("first group"); console.log("in the first group"); console.group("second group"); console.log("in the second group"); consol...
Introduction to the File and Directory Entries API - Web APIs
ge api that is already familiar to your users, who are used to working with file systems. for examples of features you can create with this app, see the sample use cases section. the file and directory entries api and other storage apis the file and directory entries api is an alternative to other storage apis like indexeddb, websql (which has been deprecated since november18, 2010), and ap
pcache. the api is a better choice for apps that deal with blobs for the following reasons: the file and directory entries api offers client-side storage for use cases that are not addressed by databases. if you want to have large mutable chunks of data, the file and directory entries api is a much more efficient storage solution than a database. while firefox supports blob storage for indexeddb...
...ata, the file and directory entries api is a much more efficient storage solution than a database. while firefox supports blob storage for indexeddb, chrome currently does not (chrome is still implementing support for blob storage in indexeddb). if you are targeting chrome for your app and you want to store blobs, the file and directory entries api and app cache are your only choices. however, ap
pcache storage isn't locally mutable, and doesn't allow for fine-grained client-side management. in chrome, you can use the file and directory entries api with the quota management api, which lets you ask for more storage and manage your storage quota. sample use cases the following are just a few examples of how you can use the file and directory entries api: apps with persistent uploader ...
HTMLTextAreaElement - Web APIs
forw = sval.substring(nbackward, nsels).search(new regexp("\\n(?!.{0," + string(ncols - 2) + "}\\n)")) + 1, nrowstart = nbackward + ndeltaforw, areturns = (sval.substring(0, nsels) + sval.substring(nsele, sval.length)).match(/\n/g), nrowend = nsele + nrowstart + ncols - nsels, srow = sval.substring(nrowstart, nsels) + sval.substring(nsele, nrowend > nlen ? ...
...(nrowstart, nsels) + sval.substring(nsele, nrowend > nlen ? nlen : nrowend), bkee
pcols = nkey === 13 || nlen + 1 < ncols || /\n/.test(srow) || ((nrowstart === 0 || ndeltaforw > 0 || nkey > 0) && (srow.length < ncols || (nkey > 0 && (nlen === nrowend || sval.charat(nrowend) === "\n")))); return (nkey !== 13 || (areturns ? ...
MediaRecorder - Web APIs
op.onclick = function() { mediarecorder.stop(); console.log(mediarecorder.state); console.log("recorder stopped"); record.style.background = ""; record.style.color = ""; } mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var clipname = prompt('enter a name for your sound clip'); var cli
pcontainer = document.createelement('article'); var cliplabel = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); cli
pcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; cli
pcontainer.appendc...
...eateelement('article'); var cliplabel = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); cli
pcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; cli
pcontainer.appendchild(audio); cli
pcontainer.appendchild(cliplabel); cli
pcontainer.appendchild(deletebutton); soundclips.appendchild(cli
pcontainer); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; var audiourl = url.createobjecturl(blob); audio.src = audiourl; console.log("recorder stopped"); deletebutton.onclick = functio...
Using the MediaStream Recording API - Web APIs
ing the blob when recording has stopped, the state property returns a value of "inactive", and a stop event is fired. ...
...ere from all the chunks we have received: mediarecorder.onstop = function(e) { console.log("recorder stopped"); const clipname = prompt('enter a name for your sound clip'); const cli
pcontainer = document.createelement('article'); const cliplabel = document.createelement('p'); const audio = document.createelement('audio'); const deletebutton = document.createelement('button'); cli
pcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; cli
pcontainer.appendchild(audio); cli
pcontainer.appendchild(cliplabel); cli
pcontainer.appendchild(deletebutton); soundclips.appendchild(cli
pcontainer); const blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; const au...
Navigator.oscpu - Web APIs
entifies the operating system on which the browser is running. ...
...ting system on which the browser is running. ...
NavigatorID - Web APIs
this property is kept only for compatibility purposes. navigatorid.appname read only always returns "netscape", in any browser. ...
...t any methods. navigatorid.taintenabled() always returns false. javascript taint/untaint functions were removed in javascript 1.2. this method is only kept for compatibility purposes. not available in workers. specifications specification status comment html living standardthe definition of 'navigatorid' in that specification. living standard added the ap
pcodename property and the taintenabled() method, for compatibility purpose. html5the definition of 'navigatorid' in that specification. recommendation initial specification. ...
RTCDataChannel.close() - Web APIs
y is set to "closed". if the transport was closed with an error, the rtcdatachannel is sent a networkerror event. a close event is sent to the channel. in firefox, the rtcdatachannel interface was implemented under the name datachannel until firefox 24, so this method was called datachannel.close(). syntax rtcdatachannel.close(); parameters none. return value undefined. ...
... was closed with an error, the rtcdatachannel is sent a networkerror event. a close event is sent to the channel. in firefox, the rtcdatachannel interface was implemented under the name datachannel until firefox 24, so this method was called datachannel.close(). syntax rtcdatachannel.close(); parameters none. return value undefined. example var
pc = new rtcpeerconnection(); var dc =
pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); dc.close(); // we decided to close after the first received message }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function ( console.log("datachannel close"); }; // now negotiate the connection and so forth... specifications specificati...
RTCDataChannel: error event - Web APIs
l. bubbles yes cancelable no interface rtcerrorevent event handler property onerror the rtcerrorevent object provides details about the error that occurred; see that article for details. ...
...r.message); // handle specific error detail types switch(err.errordetail) { case "sdp-syntax-error": console.error(" sdp syntax error in line ", err.sdplinenumber); break; case "idp-load-failure": console.error(" identity provider load failure: http error ", err.httprequeststatuscode); break; case "sctp-failure": if (err.sct
pcausecode < sct
pcausecodes.length) { console.error(" sctp failure: ", err.sct
pcausecode); } else { console.error(" unknown sctp error"); } break; case "dtls-failure": if (err.receivedalert) { console.error(" received dlts failure alert: ", err.receivedalert); } if (err.sentalert) { console.error(" sent dlts failure ...
RTCDataChannel.onclose - Web APIs
e event itself, as an object of type event. example in this sample from a hypothetical instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the state of the channel. this way, the message entry field and the send button are only enabled for use when the connection is actually open. ...
...ent. example in this sample from a hypothetical instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the state of the channel. this way, the message entry field and the send button are only enabled for use when the connection is actually open. let
pc = new rtcpeerconnection(); let dc =
pc.createdatachannel("messagechannel")}}; dc.onopen = function(event) { document.getelementbyid("messagebox").disabled = false; document.getelementbyid("sendbutton").disabled = false; }; dc.onclose = function(event) { document.getelementbyid("messagebox").disabled = true; document.getelementbyid("sendbutton").disabled = true; } /* now negotiate the connection, etc... */ specifications ...
RTCDataChannel.onmessage - Web APIs
to handle the message event. the function receives as its sole input parameter a messageevent object describing the event. example this code snippet creates a peer connection, adds a data channel to it, and starts creating new <p> (paragraph) elements each time a message arrives, with the message's contents displayed inside it. the new elements are then attached to the end of the document. ...
...on receives as its sole input parameter a messageevent object describing the event. example this code snippet creates a peer connection, adds a data channel to it, and starts creating new <p> (paragraph) elements each time a message arrives, with the message's contents displayed inside it. the new elements are then attached to the end of the document. ...
RTCDataChannel.protocol - Web APIs
ubprotocol lets your app, for example, use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format. syntax var subprotocol = adatachannel.protocol; value a string identifying the app-defined subprotocol being used for exchanging data on the channel. if none has been established, this is an empty string (""). ...
...use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format. syntax var subprotocol = adatachannel.protocol; value a string identifying the app-defined subprotocol being used for exchanging data on the channel. if none has been established, this is an empty string (""). ...
RTCDataChannel - Web APIs
ned, or when an existing data channel's underlying connection re-opens. data format the underlying data format is defined by the ieee draft specification draft-ietf-mmusic-sctp-sdp. the current format specifies its protocol as either "udp/dtls/sctp" (udp carrying dtls carrying sctp) or "tcp/dtls/sctp" (tcp carrying dtls carrying sctp). older browsers may only specify "dtls/sctp". ...
... underlying connection re-opens. data format the underlying data format is defined by the ieee draft specification draft-ietf-mmusic-sctp-sdp. the current format specifies its protocol as either "udp/dtls/sctp" (udp carrying dtls carrying sctp) or "tcp/dtls/sctp" (tcp carrying dtls carrying sctp). older browsers may only specify "dtls/sctp". ...
RTCIceCandidate.usernameFragment - Web APIs
minimize traffic. the function below, ssnewcandidate(), is called when a message, signalmsg, arrives from the signaling server that contains an ice candidate to be added to the rtcpeerconnection. ...
...if it does, ssnewcandidate() aborts. otherwise, after checking every receiver, it adds the new candidate to the connection. specifications specification ...
RTCIceCandidateInit.candidate - Web APIs
object that encapsulates it. this is done in the event handler for the icecandidate event. if your client-side signaling layer builds and transmits a json string including the candidate to the remote peer, the remote peer might handle receiving that json message like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate({ candidate: msg.candidate; });
pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in place of the rtcicecandidateinit dictionary. that usage would change the above sample to look like this: function goticecandidatemessage(m...
...; } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in place of the rtcicecandidateinit dictionary. that usage would change the above sample to look like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate(msg.candidate);
pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidateinit.candidate' in that specification. candidate recommendation initial specification. ...
RTCIceTransport: gatheringstatechange event - Web APIs
er and every rtcrtpreceiver on the entire connection. in contrast, gatheringstatechange represents changes to the candidate gathering state for a single transport. examples this example creates a handler for gatheringstatechange events on each rtcrtpsender associated with a given rtcpeerconnection. ...
...events:
pc.getsenders().foreach(sender => { sender.transport.icetransport.addeventlistener("gatheringstatechange", ev => { let transport = ev.target; if (transport.gatheringstate === "complete") { /* this transport has finished gathering candidates, but others may still be working on it */ } }, false); likewise, you can use the ongatheringstatechange event handler property:
pc.getsenders().foreach(sender => { sender.transport.icetransport.ongatheringstatechange = ev => { let transport = ev.target; if (transport.gatheringstate === "complete") { /* this transport has finished gathering candidates, but others may still be working on it */ } }; }); specifications specification status comment webrtc 1.0: real-time co...
RTCPeerConnection: addstream event - Web APIs
interface mediastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the track event. if it does, a track event listener is set up; otherwise, an addstream event listener is set up.
pc is an rtcpeerconnection. if (
pc.addtrack !== undefined) {
pc.ontrack = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else {
pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being added to the rtcpeerconnection, regardless of whether the browser sends addstream or track. you can also use the addeventl...
...== undefined) {
pc.ontrack = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else {
pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being added to the rtcpeerconnection, regardless of whether the browser sends addstream or track. ...
RTCPeerConnection.currentLocalDescription - Web APIs
f switching over to. syntax sessiondescription = rtcpeerconnection.currentlocaldescription; return value the current description of the local end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentlocaldescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...iption = rtcpeerconnection.currentlocaldescription; return value the current description of the local end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentlocaldescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. var
pc = new rtcpeerconnection(); … var sd =
pc.currentlocaldescription; if (sd) { alert("local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.currentlocaldescription' in that specification. cand...
RTCPeerConnection.currentRemoteDescription - Web APIs
witching over to. syntax sessiondescription = rtcpeerconnection.currentremotedescription; return value the current description of the remote end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentremotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...ion = rtcpeerconnection.currentremotedescription; return value the current description of the remote end of the connection, if one has been set. if none has been successfully set, this value is null. example this example looks at the currentremotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. var
pc = new rtcpeerconnection(); … var sd =
pc.currentremotedescription; if (sd) { alert("local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.currentremotedescription' in that specification. ca...
RTCPeerConnection: datachannel event - Web APIs
tes the channel. bubbles no cancelable no interface rtcdatachannelevent event handler property ondatachannel examples this example sets up a function that handles datachannel events by gathering the information needed to communicate with the newly added rtcdatachannel and by adding event handlers for the events that occur on that channel.
pc.addeventlistener("datachannel", ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the remote peer to the local one. this...
...; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the remote peer to the local one. this same code can also instead use the rtcpeerconnection interface's ondatachannel event handler property, like this:
pc.ondatachannel = ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'datachannel' in that specification. candidate recommendation basic...
RTCPeerConnection.getDefaultIceServers() - Web APIs
rvers at all. syntax var defaulticeservers = rtcpeerconnection.getdefaulticeservers(); return value an array of ice servers, specified as objects based on rtciceserver, which the browser will use if none are specified in the configuration of the rtcpeerconnection. ...
... rtcpeerconnection.getdefaulticeservers(); return value an array of ice servers, specified as objects based on rtciceserver, which the browser will use if none are specified in the configuration of the rtcpeerconnection. ...
RTCPeerConnection.getSenders() - Web APIs
return value an array of rtcrtpsender objects, one for each track on the connection. the array is empty if there are no rtp senders on the connection. the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. example in this example, a setmuting() function is shown. ...
...on, and may change from one call to getsenders() to the next. example in this example, a setmuting() function is shown. this function takes as input an rtcpeerconnection,
pc, and a boolean, muting. the function gets the list of the peer connection's senders and iterates over every sender, setting the corresponding media track's enabled to the inverse of the specified muting. function setmuting(
pc, muting) { let senderlist =
pc.getsenders(); senderlist.foreach(sender) { sender.track.enabled = !muting; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.getsenders()' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection: icegatheringstatechange event - Web APIs
ndidate gathering is complete by watching for icegatheringstatechange events and checking for the value of icegatheringstate to become complete, you can also simply have your handler for the icecandidate event look to see if its candidate property is null. this also indicates that collection of candidates is finished. examples this example creates a handler for icegatheringstatechange events. ...
...tatechange events. ...
RTCPeerConnection: icecandidateerror event - Web APIs
able to successfully make contact with the stun or turn server. the 701 error is fired only once per server url from the list of available stun or turn servers provided when creating the rtcpeerconnection. these errors occur only when the connection's ice gathering state is gathering. example the following example establishes a handler for icecandidateerrors that occur on the rtcpeerconnection
pc. ...
... is gathering. example the following example establishes a handler for icecandidateerrors that occur on the rtcpeerconnection
pc. this handler looks specifically for 701 errors that indicate that candidates couldn't reach the stun or turn server. when this happens, the server url and the error message are passed to a function called reportconnectfail() to log or output the connection failure.
pc.addeventlistener("icecandidateerror", (event) => { if (event.errorcode === 701) { reportconnectfail(event.url, event.errortext); } }); note that if multiple stun and/or turn servers are provided when creating the connection, this error may happen more than once, if more than one of those servers fails. each provided server is tried until a connection is established. specifications ...
RTCPeerConnection.localDescription - Web APIs
rconnection.pendinglocaldescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentlocaldescription is returned. see pending and current descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the localdescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
... property isn't null; otherwise, the value of rtcpeerconnection.currentlocaldescription is returned. see pending and current descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the localdescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. var
pc = new rtcpeerconnection(); … var sd =
pc.localdescription; if (sd) { alert("local session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no local session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.localdescription' in that specification. candidate recommen...
RTCPeerConnection.onconnectionstatechange - Web APIs
eventhandler; value a function which is called by the browser when the connectionstatechange event occurs on the rtcpeerconnection. the function receives as input a single parameter, which is an object of type event. the event object contains no special information of note; you can look at the value of the peer connection's connectionstate property to determine what the new state is. ...
... browser when the connectionstatechange event occurs on the rtcpeerconnection. the function receives as input a single parameter, which is an object of type event. the event object contains no special information of note; you can look at the value of the peer connection's connectionstate property to determine what the new state is. ...
RTCPeerConnection.onicegatheringstatechange - Web APIs
example this example updates status information presented to the user to let them know what's happening by examining the current value of the icegatheringstate property each time it changes and changing the contents of a status display based on the new information. ...
...hem know what's happening by examining the current value of the icegatheringstate property each time it changes and changing the contents of a status display based on the new information. ...
RTCPeerConnection.peerIdentity - Web APIs
dentity, setremotedescription() doesn't need to wait for validation to occur before it resolves. example in this example, a function, getidentityassertion(), is created which asynchronously waits for the peer's identity to be verified, then returns the identity to the caller. if an error occurs and the promise is rejected, this logs the error to the console and returns null to the caller. ...
...efore it resolves. example in this example, a function, getidentityassertion(), is created which asynchronously waits for the peer's identity to be verified, then returns the identity to the caller. if an error occurs and the promise is rejected, this logs the error to the console and returns null to the caller. let
pc = new rtcpeerconnection(); /* ... */ async function getidentityassertion(
pc) { try { const identity = await
pc.peeridentity; return identity; } catch(err) { console.log("error identifying remote peer: ", err); return null; } } specifications specification status comment identity for webrtc candidate recommendation initial specification. ...
RTCPeerConnection.remoteDescription - Web APIs
nnection.pendingremotedescription if that property isn't null; otherwise, the value of rtcpeerconnection.currentremotedescription is returned. see pending and current descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. ...
...roperty isn't null; otherwise, the value of rtcpeerconnection.currentremotedescription is returned. see pending and current descriptions in webrtc connectivity for details on this algorithm and why it's used. example this example looks at the remotedescription and displays an alert containing the rtcsessiondescription object's type and sdp fields. var
pc = new rtcpeerconnection(); … var sd =
pc.remotedescription; if (sd) { alert("remote session: type='" + sd.type + "'; sdp description='" + sd.sdp + "'"); } else { alert("no remote session yet."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.remotedescription' in that specification. candidate reco...
RTCPeerConnection.restartIce() - Web APIs
g new credentials. existing media transmissions continue uninterrupted during this process. for details about how ice restart works, see ice restart in lifetime of a webrtc session and rfc 5245, section 9.1.1.1: ice specification. example this example creates a handler for the iceconnectionstatechange event that handles a transition to the failed state by restarting ice in order to try again. ...
...upted during this process. for details about how ice restart works, see ice restart in lifetime of a webrtc session and rfc 5245, section 9.1.1.1: ice specification. example this example creates a handler for the iceconnectionstatechange event that handles a transition to the failed state by restarting ice in order to try again.
pc.addeventlistener("iceconnectionstatechange", event => { if (
pc.iceconnectionstate === "failed") { /* possibly reconfigure the connection in some way here */ /* then request ice restart */
pc.restartice(); } }); with this code in place, a transition to the failed state during ice negotiation will cause a negotiationneeded event to be fired, in response to which your code should renegotiate as usual. however, because you have called restartice(...
RTCPeerConnection.setIdentityProvider() - Web APIs
the rtcpeerconnection.setidentityprovider() method sets the identity provider (idp) to the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username. the idp will be used only when an assertion is needed. if the signalingstate is set to "closed", an invalidstateerror is raised. syntax
pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method. parameters domainname is a domstring is the domain name where the idp is. protocol optional is a domstring representing the protocol used to communicate with the idp. it defaults to "default" and is used to determine the url where the idp is listening. username optional is a domstring representing the username associated with the idp. ...
...re is no return value for this method. parameters domainname is a domstring is the domain name where the idp is. protocol optional is a domstring representing the protocol used to communicate with the idp. it defaults to "default" and is used to determine the url where the idp is listening. username optional is a domstring representing the username associated with the idp. example var
pc = new peerconnection();
pc.setidentityassertion("developer.mozilla.org"); specifications specification status comment identity for webrtcthe definition of 'rtcpeerconnection.setidentityprovider()' in that specification. candidate recommendation ...
RTCRtpParameters - Web APIs
the rtcrtpparameters dictionary is the basic object describing the parameters of an rtp transport. it is extended separately for senders and receivers in the form of the rtcrtpsendparameters and rtcrtpreceiveparameters dictionaries. to obtain the parameters of a sender or receiver, call its getparameters() method: getparameters() getparameters() properties codecs an array of rtcrt
pcodecparameters objects describing the set of codecs from which the sender or receiver will choose. this parameter cannot be changed once initially set. headerextensions an array of zero or more rtp header extensions, each identifying an extension supported by the sender or receiver. header extensions are described in rfc 3550: 5.3.1. this parameter cannot be changed once initially set. rtcp an rtcr...
... extensions are described in rfc 3550: 5.3.1. this parameter cannot be changed once initially set. rtcp an rtcrtcpparameters object providing the configuration parameters used for rtcp on the sender or receiver. this parameter cannot be changed once initially set. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpsender or rtcrtpreceiver. function getrt
pcname(rtpobject) { let parameters = rtpobject.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiveparameters' in that specification. candidate recommendation initial definition. ...
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the rtcrtptransceiver method setcodecpreferences() configures the transceiver's codecs given a list of rtcrt
pcodeccapability objects specifying the new preferences for each codec. the specified set of codecs and configurations will be used for all future connections including this transceiver until this method is called again. when preparing to open an rtcpeerconnection, you can change the codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer(). ...
...codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer(). a guide to codecs supported by webrtc—and each codec's positive and negative characteristics—can be found in codecs used by webrtc. syntax rtcrtptransceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrt
pcodeccapability objects, in order of preference, each providing the parameters for one of the transceiver's supported codecs. if codecs is empty, the codec configurations are all returned to the user agent's defaults. note: any codecs not included in codecs will not be considered during the process of negotiating a connection. this lets you prevent the use of codecs you don't wish to use. ret...
SVGLength - Web APIs
at 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) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and cm units console.log("value: " + val.value + ...
...s2. svg_lengthtype_cm 6 a value was specified using the cm units defined in css2. svg_lengthtype_mm 7 a value was specified using the mm units defined in css2. svg_lengthtype_in 8 a value was 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 valueinspeci...
Using WebRTC data channels - Web APIs
ll automatically trigger the rtcpeerconnection to handle the negotiations for you, causing the remote peer to create a data channel and linking the two together across the network. the rtcdatachannel object is returned immediately by createdatachannel(); you can tell when the connection has been made successfully by watching for the open event to be sent to the rtcdatachannel. let datachannel =
pc.createdatachannel("myapp channel"); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); manual negotiation to manually negotiate the data channel connection, you need to first create a new rtcdatachannel object using the createdatachannel() method on the rtcpeerconnection, specifying in the options a negotiated property set to true. this signals to the peer...
...nals to the peer connection to not attempt to negotiate the channel on your behalf. then negotiate the connection out-of-band, using a web server or other means. this process should signal to the remote peer that it should create its own rtcdatachannel with the negotiated property also set to true, using the same id. this will link the two objects across the rtcpeerconnection. ...
WebRTC Statistics API - Web APIs
call getstats() on an rtcpeerconnection to get statistics for the connection overall. in this example, a new rtcpeerconnection is created, and then setinterval() is used to set the function getconnectionstats() to be called every second. that function, in turn, uses getstats() to obtain statistics for the connection and to make use of that data. ...
... an rtcicetransport. rtccertificatestats rtcstats codec statistics about a specific codec being used by streams being sent or received by this connection. rtccodecstats rtcstats csrc statistics for a single contributing source (csrc) that contributed to one of the connection's inbound rtp streams. rtcrt
pcontributingsourcestats rtcstats data-channel statistics related to one rtcdatachannel on the connection. rtcdatachannelstats rtcstats ice-server statistics about the connection to an ice server (stun or turn. rtciceserverstats rtcstats ...
Rendering and the WebXR frame animation callback - Web APIs
hand, we can then begin to render the frame. the first step is to obtain access to the framebuffer into which the webxr device wants the frame drawn; this is done by getting the target webgl layer from the session's renderstate object's baselayer property, then getting the framebuffer from that xrwebgllayer object. we then call gl.bindframebuffer() to bind that framebuffer as the target for all u
pcoming drawing commands. the next step is to erase the framebuffer. while you can in theory skip this step—if and only if your rendering code is guaranteed to write every single pixel in the framebuffer—it's generally safest to just go ahead and clear it before you begin to draw, unless you need to eke out every ounce of performance you can and know you're touching all the pixels anyway. the b...
...put sources. updating object positions most (though not all) scenes include some form of animation, in which things move and react to one another in appropriate ways. for example, a virtual reality or augmented reality game might have enemy non-player characters being controlled by the computer and moving around the scene. not only are their locations in the world changing over time, but each n
pc likely has body parts or components that are moving in relation to one another. arms and legs swing as a creature walks, heads bob and turn, hair bounces and sways, torsos expand and contract as the character breathes. in addition, there may be objects and structures in motion. in a sports game, there may be a ball arcing through the air, its movement needing to be simulated. in racing games the...
window.dump() - Web APIs
rocess was started with the -console option. if the -console option was not specified then the output goes to stderr. output from dump() is not sent to the browser console. output can be sent to the browser console using console.log(). privileged code can also use components.utils.reporterror and nsiconsoleservice to log messages to the error console/browser console. dump() is also available to x
pcom components implemented in javascript, even though window is not the global object in components. it is also explicitly made available in sandboxes. however, this use of dump is not affected by the preference mentioned below -- it will always be shown. it is therefore advisable to either check this preference yourself or use a debugging preference of your own to make sure you don't send lots of ...
...licitly made available in sandboxes. however, this use of dump is not affected by the preference mentioned below -- it will always be shown. it is therefore advisable to either check this preference yourself or use a debugging preference of your own to make sure you don't send lots of debugging content to a user's console when they might not be interested in it at all. note that dump output from x
pcom components goes to stderr, while dump called elsewhere will output to stdout. in gecko dump() is disabled by default – it doesn't do anything but doesn't raise an error either. to see the dump output you have to enable it by setting the preference browser.dom.window.dump.enabled to true. you can set the preference in about:config or in a user.js file. note: this preference is not listed in a...
Web APIs
ions rtccertificate rtcconfiguration rtcdtmfsender rtcdtmftonechangeevent rtcdatachannel rtcdatachannelevent rtcdtlstransport rtcerror rtcerrorevent rtcicecandidate rtcicecandidateinit rtcicecandidatepair rtcicecandidatepairstats rtcicecandidatestats rtcicecandidatetype rtcicecomponent rtcicecredentialtype rtcicegathererstate rtciceparameters rtciceprotocol rtcicerole rtciceserver rtcicetc
pcandidatetype rtcicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtcremoteoutboundrtpstreamstats rtcrtcpparameters rtcrt
pcapabilities rtcrt
pcodeccapability rtcrt
pcodecp...
...cicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtcremoteoutboundrtpstreamstats rtcrtcpparameters rtcrt
pcapabilities rtcrt
pcodeccapability rtcrt
pcodecparameters rtcrt
pcontributingsource rtcrtpencodingparameters rtcrtpparameters rtcrtpreceiveparameters rtcrtpreceiver rtcrtpsendparameters rtcrtpsender rtcrtpstreamstats rtcrtpsynchronizationsource rtcrtptransceiver rtcrtptransceiverdirection rtcrtptransceiverinit rtcsctptransport rtcsessiondescription rtcsessiondescriptioncallback rtcstats rtcstatsicecandidatepairstate rtcstatsreport rtcstatstype rtctrackeven...
CSS values and units - CSS: Cascading Style Sheets
ul when the output is a fixed size media, such as print. for example, mm is a physical millimeter, 1/10th of a centimeter. absolute length units unit name equivalent to cm centimeters 1cm = 96px/2.54 mm millimeters 1mm = 1/10th of 1cm q quarter-millimeters 1q = 1/40th of 1cm in inches 1in = 2.54cm = 96px
pc picas 1
pc = 1/16th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in when including a length value, if the length is 0, the unit identifier is not required. otherwise, the unit identifier is required, is case insensitive, and must come immediately after the numeric part of the value, with no space in-between. angle units angle values a...
...written as 1hz or 1hz, is one cycle per second. resolution unit resolution units are represented by the type <resolution>. they represent the size of a single dot in a graphical representation, such as a screen, by indicating how many of these dots fit in a css inch, centimeter, or pixel. it accepts the following values: unit description dpi dots per inch. d
pcm dots per centimetre. dppx, x dots per px unit. percentages a <percentage> is a type that represents a fraction of some other value. percentage values are always relative to another quantity, for example a length. each property that allows percentages also defines the quantity to which the percentage refers. this quantity can be a value of another property of the same elem...
attr() - CSS: Cascading Style Sheets
is not valid, that is not a length or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. em, ex, px, rem, vw, vh, vmin, vmax, mm, cm, in, pt, or
pc <length> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as a <length> with the specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading and trailing spaces ...
...ribute is missing or contains an invalid value. if not set, css will use the default value defined for each <type-or-unit>. ...
<length> - CSS: Cascading Style Sheets
etting font-size. px one pixel. for screen displays, it traditionally represents one device pixel (dot). however, for printers and high-resolution screens, one css pixel implies multiple device pixels. 1px = 1/96th of 1in. cm one centimeter. 1cm = 96px/2.54. mm one millimeter. 1mm = 1/10th of 1cm. q one quarter of a millimeter. 1q = 1/40th of 1cm. in one inch. 1in = 2.54cm = 96px.
pc one pica. 1
pc = 12pt = 1/6th of 1in. pt one point. 1pt = 1/72nd of 1in. mozmm , removed in firefox 59 an experimental unit that attempts to render at exactly one millimeter regardless of the size or resolution of the display. this is rarely actually what you want, but may be useful in particular for mobile devices. interpolation when animated, values of the <length> data type are interpo...
...that specification. editor's draft adds the vi, vb, ic, lh, and rlh units. css values and units module level 3the definition of '<length>' in that specification. candidate recommendation adds the ch, rem, vw, vh, vmin, vmax, and q units. css level 2 (revision 1)the definition of '<length>' in that specification. recommendation explicit definition of the em, pt,
pc, and px units. css level 1the definition of '<length>' in that specification. recommendation initial definition. implicit definition of the em, pt,
pc, and px units. ...
<resolution> - CSS: Cascading Style Sheets
the <resolution> data type consists of a strictly positive <number> followed by one of the units listed below. as with all css dimensions, there is no space between the unit literal and the number. units dpi represents the number of dots per inch. screens typically contains 72 or 96 dots per inch, but the dpi for printed documents is usually much greater. as 1 inch is 2.54 cm, 1dpi ≈ 0.39d
pcm. d
pcm represents the number of dots per centimeter. as 1 inch is 2.54 cm, 1d
pcm ≈ 2.54dpi. dppx represents the number of dots per px unit. due to the 1:96 fixed ratio of css in to css px, 1dppx is equivalent to 96dpi, which corresponds to the default resolution of images displayed in css as defined by image-resolution. x alias for dppx. note: although the number 0 is always the same r...
...esents the number of dots per px unit. due to the 1:96 fixed ratio of css in to css px, 1dppx is equivalent to 96dpi, which corresponds to the default resolution of images displayed in css as defined by image-resolution. x alias for dppx. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0dpi, 0d
pcm, or 0dppx. examples use in a media query @media print and (min-resolution: 300dpi) { ... } valid resolutions 96dpi 50.82d
pcm 3dppx invalid resolutions 72 dpi spaces are not allowed between the number and the unit. ten dpi the number must use digits only. 0 the unit is required. specifications specification status comment css values and unit...
HTTP resources and specifications - HTTP
nt modes* defines x-ua-compatible note rfc 5689 http extensions for web distributed authoring and versioning (webdav) these extensions of the web, as well as carddav and caldav, are out-of-scope for http on the web. modern apis for application are defines using the restful pattern nowadays. ...
...g (webdav) these extensions of the web, as well as carddav and caldav, are out-of-scope for http on the web. modern apis for application are defines using the restful pattern nowadays. ...
418 I'm a teapot - HTTP
rmanently, a teapot. a combined coffee/tea pot that is temporarily out of coffee should instead return 503. ...
...control protocol defined in april fools' jokes in 1998 and 2014. ...
instanceof - JavaScript
d passing objects from one context to another via functions, this will be a valid and strong issue. for instance, you can securely check if a given object is, in fact, an array using array.isarray(myobj) for example, checking if a nodes is a svgelement in a different context, you can use mynode instanceof mynode.ownerdocument.defaultview.svgelement. ...
...ctions, this will be a valid and strong issue. for instance, you can securely check if a given object is, in fact, an array using array.isarray(myobj) for example, checking if a nodes is a svgelement in a different context, you can use mynode instanceof mynode.ownerdocument.defaultview.svgelement. note for mozilla developers: in code using x
pcom, instanceof has special effect: obj instanceof x
pcominterface (e.g. components.interfaces.nsifile) calls obj.queryinterface(x
pcominterface) and returns true if queryinterface succeeded. a side effect of such call is that you can use x
pcominterface's properties on obj after a successful instanceof test. unlike standard javascript globals, the test obj instanceof x
pcominterface works as expected, even if obj is from a different scope. examples ...
Content type - SVG: Scalable Vector Graphics
or <relativeiri>. for the full specification of iri references in svg, see svg 1.1 (2nd edition): iri references. length <length> a length is a distance measurement, given as a number along with a unit. lengths are specified in one of two ways. when used in a stylesheet, a <length> is defined as follows: length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"
pc")? see the css2 specification for the meanings of the unit identifiers. for properties defined in css2, a length unit identifier must be provided. for length values in svg-specific properties and their corresponding presentation attributes, the length unit identifier is optional. if not provided, the length value represents a distance in the current user coordinate system. in presentation att...
.... if not provided, the length value represents a distance in the current user coordinate system. in presentation attributes for all properties, whether defined in svg1.1 or in css2, the length identifier, if specified, must be in lower case. when lengths are used in an svg attribute, a <length> is instead defined as follows: length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "
pc" | "%")? the unit identifiers in such <length> values must be in lower case. note that the non-property <length> definition also allows a percentage unit identifier. the meaning of a percentage length value depends on the attribute for which the percentage length value has been specified. two common cases are: when a percentage length value represents a percentage of the viewport width o...
Modules - Archive of obsolete content
rms an access check to make sure that the calling script is actually allowed to access/call that property/function. if the script being loaded is less privileged than the loading script, the access is prevented, as the following example shows: // index.js: let a = loadscript("www.foo.com/a.js", { components: components }); // index.js has chrome privileges components.utils; // => [object nsx
pccomponents_utils] // a.js: // a.js has content privileges imports.components.utils; // => undefined modules in the add-on sdk the module system used by the sdk is based on what we learned so far: it follows the commonjs specification, which attempts to define a standardized module api. a commonjs module defines three global variables: require, which is a function that behaves like loadscript in...
Private Properties - Archive of obsolete content
if it has a reference to an instance of point and its internal namespace. keeping the namespace hidden from all functions, except members of point, effectively implements private properties. moreover, because members of point have a reference to the internal namespace, they can access private properties on other instances of point. namespaces in the add-on sdk the add-on sdk is built on top of x
pcom, the interface between javascript and c++ code. since x
pcom allows the user to do virtually anything, security is very important. among other things, add-ons should not be able to access variables that are supposed to be private. the sdk uses namespaces internally to ensure this. as always with code that is heavily reused, the sdk defines a helper function to create namespaces. it's defined in ...
io/file - Archive of obsolete content
users run it on unix-like systems. likewise, if your add-on uses literal unix-style path specifications, it won't work for users on windows. to ensure your add-on works for everyone, generate paths using the join function. unfortunately this api does not currently provide a way to obtain an absolute base path which you could then use with join. for now, you need to require("chrome") and use the x
pcom directory service as described in this article about file i/o. note that if you do decide to hardcode windows-style paths, be sure to escape backslashes in strings. for example, to specify the file at c:\users\myk, you need to use the string "c:\\users\\myk", not "c:\users\myk". read more about escaping characters in strings. globals functions basename(path) the path parameter must be an...
loader/sandbox - Archive of obsolete content
x"); let scope = sandbox('http://example.com'); the argument passed to the sandbox defines its privileges. the argument may be: a url string, in which case the sandbox will get the same privileges as a script loaded from that url a dom window object, to inherit privileges from the window being passed. omitted or null: then the sandbox will have chrome privileges giving it access to all the x
pcom components. optionally the sandbox function can be passed a second argument (see sandbox documentation on mdn for details). evaluate code module provides evaluate function that lets you execute code in the given sandbox: evaluate(scope, 'var a = 5;'); evaluate(scope, 'a + 2;'); //=> 7 more details about evaluated script may be passed via optional arguments that may improve exception repor...
system/events - Archive of obsolete content
tion observer service. usage the system/events module provides core (low level) api for working with the application observer service, also known as nsiobserverservice. you can find a list of events dispatched by the firefox codebase here. var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihtt
pchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type. event : object an optional object with data and subject attributes. data refers to a string that you would like to pass through this event. subject should...
system/runtime - Archive of obsolete content
hese 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. x
pcomabi a string identifying the abi of the current processor and compiler vtable. this string takes the form <processor>-<compilerabi>, for example: "x86-msvc" or "p
pc-gcc3". ...
Low-Level APIs - Archive of obsolete content
lefish the sdk's module loader. loader/sandbox create javascript sandboxes and execute scripts in them. net/url enables you to read content from a uri. net/xhr provides access to xmlhttprequest functionality. places/bookmarks create, modify, and retrieve bookmarks. places/favicon helper functions for working with favicons. places/history access the user's browsing history. platform/x
pcom implement x
pcom objects, factories, and services. preferences/event-target listen to changes to the preferences system in firefox. preferences/service access the preferences system in firefox. remote/child enables an sdk module loaded into a child process to access web content in the child process and communicate with modules in the main process. remote/parent enables you to lo...
package.json - Archive of obsolete content
; it's not available when using jpm. the full name of the package. it can contain spaces. if this key is present, its value will be used as the add-on's em:name element in its install.rdf. harnessclassid note: this is deprecated along with cfx; it's not available when using jpm. string in the guid format. this is used as a classid of the "harness service" x
pcom component. defaults to a random guid generated by cfx. hasembeddedwebextension new in jpm 1.2.0. boolean value: true if the add-on contains an embedded webextension. homepage the url of the add-on's website. this value will be used as the add-on's em:homepageurl element in its install.rdf. icon the path to an ima...
Chrome Authority - Archive of obsolete content
require entry, the manifest will not include that entry, and (once the implementation is complete) the runtime code will get an exception. for example, none of the following code will be matched by the manifest scanner, leading to exceptions at runtime, when the require() call is prohibited from importing the named modules: // all of these will fail! var xhr = require("x"+"hr"); var modname = "x
pcom"; var x
pcom = require(modname); var one = require("one"); var two = require("two"); the intention is that developers use require() statements for two purposes: to declare (to security reviewers) what sorts of powers the module wants to use, and to control how those powers are mapped into the module's local namespace. their statements must therefore be clear and easy to parse. a future manifes...
Developing for Firefox Mobile - Archive of obsolete content
supported io/text-streams supported lang/functional supported lang/type supported loader/cuddlefish supported loader/sandbox supported net/url supported net/xhr supported places/bookmarks not supported places/favicon not supported places/history not supported platform/x
pcom supported preferences/service supported stylesheet/style supported stylesheet/utils supported system/environment supported system/events supported system/runtime supported system/unload supported system/xul-app supported tabs/utils supported test/assert supported t...
Tutorials - Archive of obsolete content
ses. creating reusable modules structure your add-on in separate modules to make it easier to develop, debug, and maintain. create reusable packages containing your modules, so other add-on developers can use them too. unit testing writing and running unit tests using the sdk's test framework. chrome authority get access to the components object, enabling your add-on to load and use any x
pcom object. creating event targets enable the objects you define to emit their own events. listen for load and unload get notifications when your add-on is loaded or unloaded by firefox, and pass arguments into your add-on from the command line. using third-party modules (jpm) install and use additional modules which don't ship with the sdk itself. localization writing localizable c...
Dialogs and Prompts - Archive of obsolete content
d "open file"/"save file"/"select folder" dialogs nsifilepicker prompts and the prompt service now that you understand dialogs, let's examine prompts. prompts differ from dialogs in that they don't require custom xul. because of this, however, they are less customizable. most web developers are familiar with the alert() function: this is a prime example of a prompt. nsipromptservice is an x
pcom interface available to c++ and chrome javascript code (not to web pages' js), that provides methods for displaying a few simple types of dialogs. refer to the interface documentation for documentation and sample code. for file/folder picker dialogs, see nsifilepicker. original version the original version of this tutorial was written by "ihoss" (it was here). links nsipromptservice open...
Running applications - Archive of obsolete content
there are two ways to run programs. using nsiprocess the recommended way is to use the nsiprocess interface because it is crossplatform. using nsilocalfile.launch() this method is not implemented on all platforms, especially not on unix/linux! see nsilocalfile.launch() for details and make sure that all your target platforms support this method! this method has the same effect as if you double-clicked the file, so for executable files—it will just run the file without any parameters. for more information on nsifile/nsilocalfile, see file i/o. ...
Custom about: URLs - Archive of obsolete content
n navigate to about:myaboutpage'; // const aboutpage_uri = 'chrome://myaboutaddon/content/index.html'; class aboutpage { static get classid() { return components.id(`{${aboutpage_id}}`); } static get classdescription() { return aboutpage_description; } static get contractid() { return `@mozilla.org/network/protocol/about;1?what=${aboutpage_word}`; } static get queryinterface() { return x
pcomutils.generateqi([ci.nsiaboutmodule]); } constructor() { object.freeze(this); } geturiflags(auri) { return ci.nsiaboutmodule.allow_script; } newchannel(auri, asecurity_or_aloadinfo) { let channel; if (services.vc.compare(services.appinfo.version, '47.*') > 0) { const uri = services.io.newuri(aboutpage_uri, null, null); // greater than or equal to fire...
Inline options - Archive of obsolete content
don@my_domain") { var doc = asubject; var control = doc.getelementbyid("myaddon-pref-control"); control.value = "test"; } } }; services.obs.addobserver(observer, "addon-options-displayed", false); // don't forget to remove your observer when your add-on is shut down. this code should be in bootstrap.js (within the startup() function) for restartless extensions or in an x
pcom component or a javascript code module (not an overlay!) for traditional extensions. note: starting in gecko 13.0, you can also listen for the addon-options-hidden notification, which has the same subject and data as above, to find out when the ui is about to be removed. use this notification to remove event listeners, or any other references that might otherwise be leaked. locating the opti...
Jetpack Processes - Archive of obsolete content
process communicates with them via the nsijetpack interface. note: the jetpack service, provided by nsijetpackservice, is not included by default in firefox 4. prior to firefox 12, it could be included in custom builds by using enable_jetpack_service at compile time. however, the service has been removed entirely as of firefox 12. these processes are relatively lightweight, do not have access to x
pcom, and can innately do little other than compute. messaging facilities that allow them to communicate with their parent chrome process are the only means by which they can be endowed with any real power. note: the above statement is not currently true, as js-ctypes is now provided to jetpack processes as of bug 588563. a mechanism to optionally disable this feature has been proposed in bug 614351...
Add-ons - Archive of obsolete content
fic locales, which have been translated to french since non-latin characters are not well supported). hotfix extension this document has been moved to the add-ons wiki. how to convert an overlay extension to restartless first off, what kind of add-on are we talking about here? well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no x
pcom components of your own. some of that will have to be replaced and the rest will need to be loaded differently. inline options firefox 7 supports a new syntax for defining extensions' preferences for both bootstrapped and traditional extensions. the user interface for the preferences defined with this new syntax appears in the extension's detail view in the add-on manager. this functionality o...
updateready - Archive of obsolete content
general info specification offline interface event bubbles no cancelable no target applicationcache default action none properties property type description target eventtarget (dom element) the event target (the topmost target in the dom tree). read only. type string the type of event. read only. canbubble boolean does the event normally bubble? read only. ...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
ascript code can act as the mediator for information access. if the user clicks on a link item, the script will be responsible to load the information from the data source and to apply that into the current document. there are basically two steps in this process: data load: acquisition of information data acquisition can be implemented using javascript and remote procedure calls using soap-based r
pc mechanism or using interfaces like xmlhttprequest (currently offered in netscape 7 and internet explorer 6). data bind: mutation in the current document this step takes care of applying the changes into the current document, based on the data loaded, and uses dom interfaces. the mechanism can be as simple as copying new content to the current document, or as complex as performing dynamic transfor...
BlackConnect - Archive of obsolete content
blackconnect was a blackwood subproject, trying to build a java-to-x
pcom bridge to allow interoperability between java and x
pcom components. the goal was to be able to implement x
pcom components written in java instead of c++. blackconnect is now superseeded by javax
pcom. for the remainders of the blackconnect project, see here. ...
Blackwood - Archive of obsolete content
ineers at sun microsystems, is an attempt to better integrate the java platform with the mozilla browser. blackwood consists of a series of java-based extensions to mozilla. blackwood's mission is to put java support in mozilla on a par with javascript support. active subprojects webclient java dom api java pluglet api defunct subprojects blackconnect -- blackconnect was superseeded by javax
pcom ...
Building TransforMiiX standalone - Archive of obsolete content
this document is out of date. we support building a standalone version of transformiix on windows, unix and os x. read the build instructions for your platform to get the requirements, which are the same as for mozilla. you need to get the source from cvs. add tx_exe=1 mk_add_options build_modules="x
pcom transformiix" ac_add_options --enable-standalone-modules="x
pcom transformiix" to your .mozconfig, and use client.mk to pull as usual. this will pull the necessary subtree with mozilla/client.mk mozilla/build/unix/modules.mk mozilla/build mozilla/config mozilla/expat mozilla/extensions/transformiix mozilla/include mozilla/allmakefiles.sh mozilla/client.mk mozilla/aclocal.m4 mozilla/configure mozilla/configure.in mozilla/makefile.in plus nspr and x
pcom from the cvs repository. buildin...
Developing New Mozilla Features - Archive of obsolete content
warning: the content of this article may be out of date. it was last updated in 2004. tips for contributing new features to mozilla. learn the codebase and coding practices before you start your feature include learning time in your schedule. mozilla is a complex codebase. our portability requirements may be new to even seasoned developers. our cross-platform component model (“x
pcom”) is similar to com, but you’ll want to make sure you use it well before going too far with your project. and of course, we have a set of coding practices to help everyone live together. life will be much easier if your team has one or more members who are already familiar with and to the mozilla world. develop relationships with existing developers in the area of your feature if you want...
Drag and Drop - Archive of obsolete content
or an element when something is dropped on the element. at this point, the user has already released the mouse button. the element can simply ignore the event or can handle it some way, such as pasting the dragged object into itself. ondragend called when the drag operation is finished. there are two ways that drag and drop events can be handled. this first involves using the drag and drop x
pcom interfaces directly. the second is to use a javascript wrapper object that handles some of this for you. the code for this wrapper can be found in a file named toolkit/content/nsdraganddrop.js nsdraganddrop.js which is contained in the widget-toolkit (or global) package. x
pcom drag and drop interfaces two interfaces are used to support drag and drop. the first is a drag service, nsidragservic...
Exception logging in JavaScript - Archive of obsolete content
porting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those exceptions into the error console. any exceptions that are generated by x
pconnect -- that is, those exceptions whose result codes are defined in nsix
pconnect.idl -- are always logged into the error console. the ns_nointerface error is never reported when returned by a javascript object's queryinterface() method on the nsisupports interface. the ns_nointerface error is never reported when returned by a javascript object's getinterface() method on the nsiinterfacerequest...
Repackaging Firefox - Archive of obsolete content
authorization from mozilla to distribute a modified version of firefox. to do this, please contact trademarks@mozilla.com. getting started now, on to the technical details. the following diagram represents an overview of the process and the pieces involved: you will need the following to get started: a macintosh computer (even for repackaging windows or linux only); it may be either power
pc or intel based. the repackager tool. currently that page mentions only firefox 1.5.x, but it supports firefox 2. the pristine firefox 2 installer files (windows .exe, mac .dmg, or linux .tar.gz) for each of the locales you need. at the time of writing this document, the latest builds are here. a "distro" extension that makes the changes you desire. once you have all the ingredients, the cust...
Hidden prefs - Archive of obsolete content
pref ("mail.addr_book.mapit_url.format" ) the format for this pref is: @a1 == address, part 1 @a2 == address, part 2 @ci == city @st == state @zi == zip code @co == country if the pref is set to "", no "get map" button will appear in the addressbook card preview pane. the default (defined in mailnews.js) is: pref("mail.addr_book.mapit_url.format", "http://www.mapquest.com/maps/map.adp...st&zi
pcode=@zi"); addressbook quick search query pref ("mail.addr_book.quicksearchquery.format" ) the format for this pref is: @v == the escaped value typed in the quick search bar in the addressbook every occurance of @v will be replaced. note, the ui has "name or email contains:". this entity (searchnameoremail.label) is defined in messenger.dtd. so if you change the quick search query to match bas...
JavaScript crypto - Archive of obsolete content
several crypto object methods used in generating keys for certificates: generatecrmfrequest(), importusercertificates(). the generatecrmfrequest() function generates a key and creates a crmf request object. this object can be passed to a ca using a webform. the importusercertificates() function loads certificates into the nss database or smartcard if the corresponding key is found there. the po
pchallengeresponse() function is not implemented. overview of the new cert issuing process user fills out enrollment form user action initiates script script calls key generation method (generatecrmfrequest) signing and encryption keys are generated encryption private key is wrapped with public key of key recovery authority (kra) (passed in in the form of a certificate as part of the script,...
Modularization techniques - Archive of obsolete content
to make every effort to make our interfaces compatible with com on platforms that support it, so it may not matter. but no promises, yet. what are the major differences? instead of microsoft's midl compiler, we are using a corba-compliant idl compiler, xpidl. it outputs nspr types when generating c++ headers. it also generates typelibraries that are not compatible with microsoft's .tlb format. x
pcom uses these typelibraries to allow other languages, such as javascript, to implement and call x
pcom objects. we also do cross-thread proxying calls using the typelib and nspr's event queues. microsoft provides an extensive support infrastructure for com. this technology is built into windows, but not most other platforms. the technology can be licensed from microsoft, but for obvious reasons we...
Mozilla Application Framework - Archive of obsolete content
ck and painless. gecko a performant web content rendering/editing engine with world-leading support for standards that you can drop into your application with a single line of xul. necko a wicked-fast, extensible networking library with built-in support for many common protocols and a well-defined plug-in interface for custom protocol handling so you can add the protocols you need. x
pcom a simple, cross-platform component model with multiple language bindings and idl descriptions so you can plug your custom functionality into the framework and connect it with other components. web services built-in support for xmlhttprequest, xml-r
pc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web services. xpinstall our cro...
Build - Archive of obsolete content
rism create a file called .mozconfig make sure it is in the mozilla/ directory. the contents of the file should look something like this : mk_add_options moz_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/mozilla-obj ac_add_options --enable-application=xulrunner ac_add_options --disable-debug ac_add_options --enable-optimize ac_add_options --disable-tests ac_add_options --disable-javax
pcom build xulrunner : make -f client.mk build once the build is done, there will be a directory called mozilla-obj. go into the prism/ directory and create a .mozconfig file mk_add_options moz_objdir=@topsrcdir@/mozilla-obj/prism ac_add_options --with-libxul-sdk=../dist ac_add_options --enable-application=prism you need to define an environment variable to point the build to the new .mozconfig.
Scripting - Archive of obsolete content
tion. methods of the window.platform object can be called from webapp.js or from web content. the following code can be used by web content to determine whether it is running in prism: if ("platform" in window) { // prism-specific code goes here } see the nsiplatformglue idl definition file for details of the methods available to prism apps. currently, the webapp script also has access to full x
pcom functionality, just like a firefox extension. this level of functionality is commonly called chrome-level privileges. it means that the script has a higher level of privilege than scripts in the web content and has access to the file system, clipboard and other parts of the native os. note: in the future, the webapp script may have lower privileges. we are looking into the security aspects of t...
Static Analysis for Windows Code under Linux - Archive of obsolete content
ests ac_add_options --disable-embedding-tests ac_add_options --disable-installer ac_add_options --disable-accessibility ac_add_options --disable-vista-sdk-requirements ac_add_options --disable-updater #change this to where your libidl-config file locate. host_libidl_config=/usr/bin/libidl-config #config your moztools position glib_prefix=$home/moztools libidl_prefix=$home/moztools #disable x
pcom stdcall calling convention because of gcc 4.3.0 bug cppflags="-dmoz_disable_x
pcom_stdcall" #specify the cxx and static analysis #point cxx to the cross compile g++ with plugin support cxx=$home/mingw-install/bin/i686-mingw32-g++ ac_add_options --with-static-checking=$home/dehydra/dehydra-gcc/gcc_dehydra.so then, you can start building your mozilla. the static check will be done when compiling...
Tamarin Roadmap - Archive of obsolete content
encouraged via the tamarin-devel mailing list. tc jan '09 feature links status integrate the tt string class tamarin:string implementation tamarin:strings bug 465506 complete enhanced c++ profiler enhance memory profiler to work in release builds and be more performant in progress enable lir for arm targets bug 460764 complete amd64 nanojit bug 464476 in progress port nanojit to power
pc bug 458077 complete add mac-x64 and linux-x64 buildbots complete fail build on assertion in acceptance tests complete merge tracking bug bug 469836 in progress tc feb '09 spring backlog tbd. ...
Tamarin - Archive of obsolete content
ipt™ 3 (a superset of ecmascript edition 3) and is embedded within the adobe® flash® player versions 9 and later. tamarin's jit-compiler, nanojit, is also used in tracemonkey ergo spidermonkey, which is mozilla’s javascript engine in firefox. tamarin is available under the mpl/gpl/lgpl tri-license. releases release tracking information on current, past, and u
pcoming releases of tamarin. documentation adobe actionscript virtual machine 2 (avm2) overview (pdf, 400k) the instructions, architecture, and file format supported by the avm2. see also the possible errata. tamarin build documentation how to get, build, and use tamarin. tamarin build system documentation documentation on how the tamar...
The life of an HTML HTTP request - Archive of obsolete content
ll.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 (nshtt
pchannel). the channel represents the connection 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 nslayoutd...
URIs and URLs - Archive of obsolete content
only the mechanism responsible for generating or interpreting that component can determine whether or not escaping a character will change its semantics. likewise, a uri must be separated into its components before the escaped characters within those components can be safely decoded. this implies that the segments of urls are escaped differently. this is done by ns_escapeurl which is now part of x
pcom, but started as part of necko. the information how to escape each segment is stored in a matrix. also a string should not be escaped more than once. necko will not escape an already escaped character unless forced by a special mask that can be used if it is known that a string is not escaped. parsing urls rfc 2396 defines an url parser that can deal with the syntax that is common to most url sc...
Venkman Internals - Archive of obsolete content
object defined only inside venkman. as you pointed out, there is a 1:1 relationship between scriptwrappers and functions. scriptwrapper has-a jsdscript property, which is an object which supports the jsdiscript interface. jsdiscript is a lower level access to the function than the scriptwrapper. in order to set a breakpoint in a particular function, you'll want to call scriptwrapper.setbreakpoint(
pc[, parentbp]); where |
pc| is the program counter location to set the breakpoint, and |parentbp| is an optional "future breakpoint" object to use as the parent for this breakpoint. if you set the breakpoint right from the jsdscript instead, you wouldn't see it in the venkman ui, and you might confuse venkman when the actual breakpoint was hit and it couldn't find a matching breakpoint object. you c...
Venkman - Archive of obsolete content
s with a useful set of debugger functionality implemented in c. bandhauer then went on to reflect that api into java, and create his cross platform front end, eventually producing netscape javascript debugger 1.0 and 1.1. in april of 2001, robert ginda began work on a javascript debugger for mozilla, called venkman. venkman builds on the js/jsd portion of john's 1998 work, exposing it as an x
pcom component. this allows the user interface be written in javascript and xul, which allows venkman to be fully cross-platform. venkman is named after the character dr. peter venkman, played by bill murray in the movies ghostbusters and ghostbusters ii. getting venkman firefox and thunderbird the latest version of javascript debugger is available from f...
When To Use ifdefs - Archive of obsolete content
e of platform-specfic ifdefs, see nscrt.h. feature ifdefs the mozilla code has many features that can be enabled or disabled by configure flags. for instance, it is possible to disable most of the xul rendering engine by specifying --disable-xul when configuring the build. when adding ifdefs that implement these configure flags, care must be taken to obey the build dependencies. for instance, x
pcom, the spidermonkey javascript engine, and the networking engine do not know anything about xul and should not have any ifdefs based on --disable-xul. one special "feature ifdef" that deserves special attention is "moz_xul_app". this variable marks any application that is using the "toolkit". moz_xul_app ifdefs are not acceptable in tier 9, but are acceptable (even necessary) in later tiers. for ...
XML in Mozilla - Archive of obsolete content
w3c recommendation xslt xmlhttprequest w3c recommendation xml extras request api (no longer supported) mozilla add-on sdk domparser and xmlserializer mozilla xml extras sax sax soap (no longer supported) w3c note web services xml-r
pc (no longer supported) userland software xml-r
pc rdf w3c recommendations rdf svg w3c recommendation svg animation (smil) w3c recommendation mathml w3c recommendation mathml p3p (no longer supported) w3c recommendation p3p wsdl (...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
he three platform-specific versions of the stub installer follow the links below: unix stub installer mac stub installer windows stub installer what do we mean by xpistub? the xpinstall engine is not called directly by the stub installer. the stub installer calls some glue code: xpistub which resides at: < http://lxr.mozilla.org/seamonkey/sou...pinstall/stub/> this "glue" code initialized x
pcom and registers the xpinstall engine and requisite components to prepare for use by the stub installer. the stub installer hands off one-by-one a series of xpis to install. what do we mean by libxpnet? cross-platform functionality for making file transfers across a network is provide by the library libxpnet. complete details about this library is available at libxpnet: architecture and api ove...
menuactive - Archive of obsolete content
« xul reference home menuactive type: boolean this attribute is set on an item in a menu when it is being hovered over. ty
pcially, the theme will use this to highlight the item. a dommenuitemactive event will be sent to the item when the item is hovered over, and a dommenuiteminactive event will be sent to the item when the selection moves away. ...
popup.position - Archive of obsolete content
fined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, to
pcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, includin...
Working With Directories - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. a reference to a directory may be created in the same way as with a file by using nsiscr...
Getting File Information - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the nsifile object has a number of useful attributes which may be used to retrieve info...
Reading from Files - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. reading data from a file involves getting a reference to a file and then creating an inp...
Uploading and Downloading Files - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. the io object and stream objects can be used to upload files to servers in various ways...
Writing to Files - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. to write to a file, an output stream is used. an output stream is an object which can b...
IO - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. files and streams this section describes how to access and get information about files, ...
Moving, Copying and Deleting Files - Archive of obsolete content
tableio | accessing files | getting file information | reading from files | writing to files | moving, copying and deleting files | uploading and downloading files | working with directories ] important note: the pages from the file and stream guide use the io object (nsiscriptableio), which was not available in any released version of the platform (pending some fixes). there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome! other documentation on files and i/o not using the unavailable nsiscriptableio apis: code snippets: file i/o, open and save dialogs, reading textual data, writing textual data, list of file-related error codes. there are several methods of the nsifile object which may be used to move and copy file...
Node - Archive of obsolete content
constants the nsidomnode interface is the primary datatype for the entire document object model. it represents a single node in the document tree. ...
Positioning - Archive of obsolete content
t the popup will be aligned with the lower-left corner of the anchor. bottomright the popup will be aligned with the bottom-right corner of the anchor. leftcenter the popup will be aligned with the center of the left-hand edge of the anchor. rightcenter the popup will be aligned with the center of the right-hand edge of the anchor. to
pcenter the popup will be aligned with the center of the top edge the anchor. bottomcenter the popup will be aligned with the center of the bottom edge the anchor. valid values for the popup alignment (ie, the second word) are shown below popup alignment values topleft the top-left corner of the popup will be aligned with the specified...
appLocale - Archive of obsolete content
« xul reference applocale obsolete since gecko 1.9.1 type: nsilocale returns the x
pcom object which holds information about the user's locale. this is an object which implements nsilocale. gecko 1.9.1 note this property was removed in gecko 1.9.1. ...
builder - Archive of obsolete content
for scripts it is only necessary in case you want to force the template content to be regenerated. you may need to do this if you have adjusted the rules manually. to rebuild the content call the builder's rebuild method. ...
RDF Modifications - Archive of obsolete content
nts below the one we started at, in order to fill in any remaining variables. in this case, there are no other statements, so the builder accepts this result as a new match. since all the variables have been filled in, the action body can be processed and a new block of content generated and inserted into the output. we'll find out how the builder determines where to insert the new content is an u
pcoming section. however, this does show that the template builder can update the output upon changes without rebuilding the entire template. when an unassertion occurs, or data is removed from the datasource, a different process is used. in this case, the builder looks at the results and determines which ones to remove. when it had first generated the results, the builder stored extra information t...
Install Scripts - Archive of obsolete content
set of files and version information about the installed components. that way, it is easier to check if a version of your component is already present and only update it if necessary. the component registry works somewhat like the windows registry does. it consists of a hierarchy of keys and values. you don't need to know much about it to create xul applications unless you are creating your own x
pcom components. what you do need to know for an installation is that the registry stores a set of information about your application, such as the file list and versions. all of this information is stored in a key (and within subkeys) that you provide in the installation script (in step 1 mentioned above). this key is structured as directory-like path of the following form: /author/package name rep...
XUL Tutorial - Archive of obsolete content
tent panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scripts adding event handlers more event handlers keyboard shortcuts focus and selection commands updating commands broadcasters and observers document object model document object model modifying a xul interface manipulating lists box objects x
pcom interfaces x
pcom examples trees trees more tree features tree selection custom tree views tree view details tree box objects rdf and templates introduction to rdf templates trees and templates rdf datasources advanced rules persistent data skins and locales adding style sheets styling a tree modifying the default skin creating a skin skinning xul files by hand loc...
The Implementation of the Application Object Model - Archive of obsolete content
much smaller and easier to plug into than the 4-5 interfaces required if directly implementing the content tree interfaces. furthermore, should the content tree interfaces change, only this layer would need to be updated. the pluggable content, safe behind this layer, wouldn't have to change at all. one natural solution to try for implementing such a layer might be inheritance. however, in this x
pcom world, where each type of pluggable content is off in its own dll, there's no clean way to inherit functionality from some base class implementation, when that implementation must necessarily reside in a different dll, without introducing a code dependency between all pluggable content and the common base class. this inability to provide a cleanly inherited system argues for a different approac...
XML - Archive of obsolete content
fferent standards: css for styling or "skinning", dom for the object model and scriptable access, javascript for the linking and behavior, rdf for resources, xml for the structure, and html for the content and some little extras. in this way, it's more like a developmentplatform or framework than a user interface language, particularly when it's used with related cross-platform technologies like x
pcom, which also went into mozilla. gecko reads xul and makes interfaces just as our specially created memo is nothing but text unless there is an application for making use of the structure in some way, so too our xul widgets are just marked-up text unless there is software to interpret the structures and render the xul as actual widgets. all xml requires a parser or an engine of some kind at the...
XUL controls - Archive of obsolete content
his type of menu toolbarbutton element. toolbarbutton reference related elements: menupopup menuitem toolbar <tree> a tree displays a hierarchy of items in multiple columns. <tree> <treecols> <treecol label="name" flex="1"/> <treecol label="size" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="po
pcorn"/> <treecell label="large"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="root beer"/> <treecell label="small"/> </treerow> </treeitem> </treechildren> </tree> more information about the tree element. tree reference related elements: treecell treechildren treecol treecols treeitem treerow ...
menu - Archive of obsolete content
it may need to update additional state. label type: string the label that will appear on the element. if this is left out, no text appears. for an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. menuactive type: boolean this attribute is set on an item in a menu when it is being hovered over. ty
pcially, the theme will use this to highlight the item. a dommenuitemactive event will be sent to the item when the item is hovered over, and a dommenuiteminactive event will be sent to the item when the selection moves away. open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open. the open attribute is not present if the menu is closed. si...
menupopup - Archive of obsolete content
fined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, to
pcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, includin...
panel - Archive of obsolete content
fined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, to
pcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, includin...
scrollbox - Archive of obsolete content
want to programmatically scroll in addition to the automatic scroll bars. note: avoid nested scroll boxes; it's maddening for the experienced user and confusing for the less experienced user. instead, figure out some other way to lay things out. scrolling a child element into view see element.scrollintoview. prior to gecko 19, scrollintoview() didn't exist in xul. do this instead: var x
pcominterface =scrollbox_element.boxobject.queryinterface( components.interfaces.nsiscrollboxobject); x
pcominterface.ensureelementisvisible(child_element_to_make_visible); see the nsiscrollboxobject api for other scroll-related methods. attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containmen...
tooltip - Archive of obsolete content
fined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, to
pcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, includin...
XULRunner 2.0 Release Notes - Archive of obsolete content
. to register xulrunner with the system, open a command prompt and run xulrunner.exe --register-global (to register for all users) or xulrunner.exe --register-user (to register for one user only). mac os x open the .pkg file within the installer and follow the directions. xulrunner 2.0 is a universal binary containing i386 and x86_64 architectures. xulrunner 1.9.2 and earlier versions had power
pc (p
pc) and i386 architectures. linux (32-bit) unpack the tarball to a new directory using tar -xjf xulrunner-2.0.en-us.linux-i686.tar.bz2. the following directory is recommended: /opt/xulrunner/2.0 . register xulrunner with the system by running xulrunner --register-global (to install for all users, must be run as root) or xulrunner --register-user (to install for one user only). linux (64-bit)...
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
ble to be expanded). you will also need to include a branding/ subdirectory. follow the example in mccoy carefully since xulrunner is sensitive about having exactly the right files in exactly the right packages. the components/ subdirectory if you are reading this guide, you probably need to include c++ components in your application. if you've never done this before, you should consult creating x
pcom components or another x
pcom reference. the public/ and src/ directories that you put in the components/ directory will look the same as for an extension that includes c++ components, so you can use the relevant sections of creating custom firefox extensions with the mozilla build system as a reference. the makefiles, however, will be difference since you won't be defining things like xpi_name (...
Deploying XULRunner - Archive of obsolete content
ibrary/frameworks/xul.framework/versions/1.8/xulrunner.) libmozglue.dylib (the main xul library) ... other executables and libraries the core changes to xul and gecko that require this new file layout were implemented in gecko 34, except that the xulrunner application was not updated to know about the change, so it will report an error: "unable to load x
pcom." xulrunner was fixed in gecko 39. see this blog post for additional background about this change. xulrunner 38 and earlier in xulrunner 38 and earlier, xulrunner is provided in a mac os x framework bundle, which is placed in your application bundle's frameworks directory. the complete bundle structure is as follows: myapp.app/ contents/ info.plist pkginfo fram...
How to enable locale switching in a XULRunner application - Archive of obsolete content
localeswitchdemo content/ locale localeswitchdemo de-de locale/de-de/ locale localeswitchdemo en-gb locale/en-gb/ locale localeswitchdemo fr-fr locale/fr-fr/ how are you going to populate the xul listbox? you can hardwire the choices into the xul code using fixed list items, or could take the elegant approach and construct the list dynamically. the dynamic list population requires an x
pcom to query the currently selected locale as well as all locales available in the application package. here is a code snippet showing how this is done: the definition of the xul control: <listbox id="locale-listbox"> <!-- generated list items go in here --> </listbox> <button label="&switchlocale.button;" oncommand="changelocale()"/> the javascript code to populate the control: try { // query...
XULRunner tips - Archive of obsolete content
ry directory unzip the package copy the following files: chrome/inspector.jar to the chrome directory of your xulrunner application components/inspector-cmdline.js to your components directory defaults/preferences/inspector.js to your preferences directory open your chrome.manifest file and add these lines: content inspector jar:inspector.jar!/content/inspector/ x
pcnativewrappers=no locale inspector en-us jar:inspector.jar!/locale/inspector/ skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/ skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/dom/popupoverlay.xul overlay chrome://inspect...
XULRunner - Archive of obsolete content
it provides mechanisms for installing, upgrading, and uninstalling these applications. xulrunner also provides libxul, a solution which allows the embedding of mozilla technologies in other projects and products. releases until version 41, xulrunner could be downloaded from ftp.mozilla.org. ...
XUL Explorer - Archive of obsolete content
installs latest version: install (windows): xulexplorer-1.0a1pre.en-us.win32.exe 6.6mb install (mac): xulexplorer-1.0a1pre.en-us.mac.dmg 9.3mb install (linux): xulexplorer-1.0a1pre.en-us.linux-i686.tar.bz2 8.4mb contributing source code in svn bugzilla (for ...
mozilla.dev.platform FAQ - Archive of obsolete content
l-app q: can you build xulrunner with newer (>1.5) features, such as storage? a: xulrunner trunk and 1.8 (but not 1.8.0) build storage by default, and anything can be built with storage if you put in you <tt>mozconfig --enable-storage</tt> q: program received signal exc_bad_instruction, illegal instruction/operand. 0x00016b50 in xre_createappdata () a: when you <tt>--disable-libxul</tt>, the x
pcom glue doesn't have information about how to load all the dependent libraries like <tt>libgfx.dylib</tt>. in order to use xr successfully in <tt>--disable-libxul</tt> mode, you have to setup dyld_library_path to include <tt>/library/frameworks/xul.framework/versions/1.9a1</tt> - benjamin smedberg, fri, oct 20 2006 9:12 am q: when i try to build a completely standalone xul app on os x (10.4.8). ...
2006-10-20 - Archive of obsolete content
a commonly asked question in many newsgroups. jesper kristensen pointed the requester here change download action for .rdp files on windows and os x a question regarding enabling firefox to associate .rdp files with microsoft remote desktop client so that the correct application opens the files automatically. method shouldload in "content-policy" category problem ? a student learning x
pcom is having issues with the method shouldload in the interface nslcontentpolicy. when the method is executed firefox crashes. as of yet there are no responses. ie7 rss reader better - say reviewers a discussion revolving around the quality of rss readers in ie7, firefox and other assorted browsers. also a debate about which browser is "beating" which to a lesser extent further in the discuss...
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.apps.thunderbird - october 7-13, 2006 announcements updated: thunderbird developer documentation eric shepherd has put together a checklist for the u
pcoming thunderbird developer documentation and is looking for feedback as well as contributors. discussions shared training.dat & message filters jon-mikel is looking for suggestions on sharing spam filter data and message filters between machines easily. currently, the only recommendation is to use a server-side solution. meetings none for this week. ...
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.builds - september 30th to october 6th 2006 tb mozilla_1_8_branch build problem on mac os x (10.4.7, universal build) ludwig hügelschäfer stated that he has been encountering an error when he executes a "make export" operation on thunderbird (part of the mozilla_1_8_branch) since september 15th. ../../dist/host/bin/host_xpidl -m header -w -i~mozilla/x
pcom/base -i../../dist/idl -o _xpidlgen/nsiconsolelistener ~/mozilla/x
pcom/base/nsiconsolelistener.idl gmake[2]: *** [_xpidlgen/nsiconsolelistener.h] bus error gmake[2]: *** deleting file `_xpidlgen/nsiconsolelistener.h' gmake[1]: *** [export] error 2 make: *** [all] error 2:: on octorber 4th ludwig hügelschäfer responded to his original post with the solution to his own problem. he found out...
2006-11-03 - Archive of obsolete content
ipboot.a', needed by `minimo'. he has also created a bug entry on bugzilla with the bug id of opened bug #344854. problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-
pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1. on november 1st gavin sharp responded phil's question. he said that the problem that phil is experiencing is a known issue. he also mentioned that airbag doesn't build with msvc 7.1. (http://www.google.com/url?sa=d&q=htt...tail%3fid%3d64) gavin recommended that phil should add |ac_add_options --disable-airbag| to ...
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.l10n - october 13, 2006 announcements seamonkey 1.0.5 he-il seamonkey 1.0.5 in hebrew was released a while ago firefox 2 rc2 is out firefox 2 rc2 is out, to download click here sunbird_0_3_release tag being created sunbird_0_3_release tag being created seamonkey 1.1 localization freeze and beta u
pcoming there are no open blockers left. l10n freeze on seamonkey 1.1 code is imminent in the next days, as well as beta release. do early testing using code from this link. discussions mozillatranslator 5.13 rfes mozillatranslator 5.13 is ready to be released in a few weeks. author is declaring rfe (request for enhancement). a few bugs have been listed. meetings none for this week. authors paul yanchun gu (gpaul) aditya nanda kuswanto(vi...
2006-11-10 - Archive of obsolete content
vian pellcheck dictionary for ff2.0 newest openoffice dictionary files for ff 2.0 spell-checker is available. trunk / 1_8 for kurdish firefox the firefox translations of the kurdish are only in trunk translating the firefox privacy policy the final and approved en-us version of privacy policy is available here and ready for localization team to translate. seamonkey 1.0.6 and 1.1 beta u
pcoming seamonkey 1.0.6 and 1.1 beta are both available here. discussions help about firefox 3 a discussion on how to syncronise mozilla_1_8_branch with the trunk, which tag should be used to check-in files on trunk, and when files will be pulled from trunk to create another branch (mozilla_1_9_branch?) for firefox 3. meetings none for this week. authors paul yanchun gu (gpaul) adity...
2006-11-3 - Archive of obsolete content
ck thread for complete details. mozillatranslator 5.13 released mozillatranslator 5.13 is available here. opening l10n repository on mozilla_1_8_branch for approved check-ins mozilla_1_8_branch is opened for approved check-ins. check-ins are limited to bug fixes filed in bugzilla and should mention their bug, describe the change, and who approved the change. seamonkey 1.0.6 and 1.1 beta u
pcoming the seamonkey projet is planning a security release of the stable 1.0 series as well as a beta for the 1.1 version, all possibly in the next days or week. community is advised to perform tests on both builds to ensure they work flawlessly. 1.0.6 build is located here, and 1.1 beta build is located here. discussions last check-ins on sun-calendar-event-dialog.* files last check-ins on...
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.platform - october 21st to october 27th 2006 announcements no announcments this week. traffic status of x
pcom cycle collector graydon hoare provides the x
pcom patch which experiments with implementing a general-purpose garbage-cycle collector for x
pcom. meetings no meetings this week ...
2006-11-10 - Archive of obsolete content
benjamin smedberg crossposted a notice about unit testing for the mozilla toolkit, letting developers know about the importance of testing for the improvement of mozilla 2, and asks for complete coverage. several community members comment, backing up benjamin's post. ...
2006-10-20 - Archive of obsolete content
on friday october 13, 2006. help required designing new home for quality.mozilla.org - talented web designers and/or artists interested in helping the design for quality.mozilla.org please read this posting. if your theme is chosen you will be placed on the hall of fame and will receive a gift from mozilla. posted by jay patel on october 18th, 2006. discussions none for this week meetings u
pcoming firefox test day - testing will be emphasized on ajax/web 2.0, dhtml, and plugin heavy sites! meet in irc chat room #testday on friday october 20, 2006 7am-5pm pacific time. posted by jay patel on october 18th, 2006. authors mark d'souza (mdsouza) mohamed attar (mojo) ...
2006-10-27 - Archive of obsolete content
ity - october 20-october 27, 2006 announcements firefox & thunderbird 1.5.0.8 candidate builds available for testing! - with firefox 2.0 out the door, it's time to make sure that all 1.5.0.x users are updated with the latest and greatest in stability and security fixes! testers are needed. discussions need to unit test innerhtml - someone needs to unit test innerhtml. he recommends that a non-x
pcshell environment is needed really badly, but the big issue is that the x
pcshell doesn't have an event loop, so nothing asynchronous can be tested. cross-domain testing - someone is suggesting that there needs to be some way of running cross-domain tests (security, web compat, etc), and is wondering if it's possible with the current test http server? update welcome page - a bug has been discov...
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.quality - november 4-november 10, 2006 announcements qmo blog at quality.mozilla.org - the mozilla qa team has decided to go with joomla! as the cms for qmo. the blog will be hosted at quality.mozilla.org until qmo is ready for primetime. stay tuned! discussions xulrunner unit-tests like x
pcshell - allan hacked the x
pcshell-simple harness so it fits his needs. he thinks he found a bug and needs to confirm if it's filed already? meetings none authors mark d'souza (mdsouza) mohamed attar (mojo) ...
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.security - september 30, 2006 to october 6, 2006 return to mozilla-dev-tech-xul announcements none during this week. discussions protocol handlers boris zbarsky posed the question, should random webpages have access to the following protocols: feed,
pcast, moz-bookmark, webcal, swebcal. as well as any protocols that you have implemented and are not in the list of protocols nsscriptsecuritymanager::checkloaduri feed: consensus is that it should be allowed and treated as an ordinary link.
pcast: similar to feed: just differentiating between different types of feeds and should be allowed access. moz-bookmark: protocol is defunct, apparently ben goodger disabled it back in 12/2003, shortly after he added it. webcal: & swebcal: should also be ...
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.security - november 25, 2006 to december 1, 2006 return to mozilla-dev-security announcements none during this week. discussions protocol security daniele rizzo posted a question as to whether or not it is possible to enable/disable the privilege of universalx
pconnect in a 'entire' protocol (http://, file://). problem with downloading signed script components in a firefox extension andrew groom is having problems getting an extension to download a signed script and would appreciates some help with his problem. meetings none during this week. ...
2006-11-17 - Archive of obsolete content
reflow...ng#quick_links. users are asked to file bugs on encountered problems that are not present on the current trunk builds. if bugs are filed, "[reflow branch]" should be placed at the beginning of the summary. parsing html into a document object in fx3 discussion if gecko 1.9 will support parsing html into a document object. the possibility of turning the microsummaryresource object into a x
pcom component, which accomplishes this task in a "hacky" manner, was also discussed. meetings none this week. ...
2006-09-30 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - sept 30- oct 5, 2006 announcements build a x
pcom component on mac os x benjamin smedberg confirmed that this tutorial http://www.iosart.com/firefox/x
pcom/ is misleading as it uses the standalone glue (-dx
pcom_glue) for components, which is not recommended. developers should use this sample instead: http://developer.mozilla.org/en/docs/x
pcom_glue discussions dynamic load overlay a short discussion about the possibilities of loading and unloading xul overlay runtime reading binary data from file discusses about the code to read binary data from file how to build x
pcom component on mac os x discusses about the make file code used to build x
pcom components on mac os x successfully meetings none during this week. ...
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - oct 13-20, 2006 announcements none during this week. discussions wxmozilla and ff1.5 x
pcom problems updating wxmozilla to use it with firefox 1.5.7 browser elements, opening links in a new window using javascript to open window in new window. general x
pcom and nscomptr questions nscomptr basics regarding myicomponent usage. fedora security blocking x
pcom registration fedora core 5.0 security settings impeding x
pcom registration. meetings none during this week. ...
2006-10-27 - Archive of obsolete content
discussions evalinsandbox and xmlhttprequest a discussion about writing something that calls a function defined by the page that the user is currently on chrome files and last modified date ways to retrieve the last modified date of a chrome file that may be in a jar or on the file system. ...
2006-11-10 - Archive of obsolete content
discussions developing an extension like xmlhttprequest / nsidocument / mozilla_internal_api a discussion on how to develop an extension similar to xmlhttprequest but for a different protocol than http, emulating the asynchronous aspect. ...
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - nov 11-nov 17, 2006 announcements none during this week. discussions xpidl crashes imycomp.h problems: "xpidl.exe has encountered a problem and needs to close" meetings none during this week. ...
2006-11-3 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - oct 28-nov 3, 2006 announcements none during this week. discussions problem linking libraries to x
pcom component a discussion involving a problem with linking third party library to x
pcom component. meetings none during this week. ...
2006-12-01 - Archive of obsolete content
discussions nsicontentpolicy and user interaction the proper way to get user confirmation before trying to load certain file types. debugging firefox extesnion? a tip on how to debug firefox extensions using a debugger. segmentation fault while running the browser browser crashes after installation of subjects extension. ...
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.apps.calendar - november 10 - november 17, 2006 announcements no meeting for this week. discussions itip and imip new designs for sending invitations available for comment discussion about the new interface designs for itip. view performance discussion about tests on view performance. webdav server a discussion related to remote calendar modifications. calendar x
pcom component discussion about a debug error of additem function from calicalendar. meetings no meetings were scheduled this week. authors mark paruzel yi (eric) shen [back to weekly summaries ] ...
Newsgroup summaries - Archive of obsolete content
06-10-06mozilla.dev.apps.calendarmozilla.dev.tech.js-enginemozilla-dev-accessibilitymozilla-dev-apps-calendarmozilla-dev-apps-firefoxmozilla-dev-apps-thunderbirdmozilla-dev-buildsmozilla-dev-embeddingmozilla-dev-extensionsmozilla-dev-i18nmozilla-dev-l10nmozilla-dev-planningmozilla-dev-platformmozilla-dev-qualitymozilla-dev-securitymozilla-dev-tech-js-enginemozilla-dev-tech-layoutmozilla-dev-tech-x
pcommozilla-dev-tech-xul ...
NPN_CreateObject - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary allocates a new npobject. syntax #include <npruntime.h> npobject *npn_createobject(npp npp, n
pclass *aclass); parameters the function has the following parameters: <tt>npp</tt> the npp indicating which plugin wants to instantiate the object. <tt>aclass</tt> the class to instantiate an object of. returns the newly-allocated npobject. description if the given n
pclass provides an allocate function it is used to allocate the storage for the object and the npp argument passed to npn_createobject() is passed along to that function. if no allocate function is provided, malloc() is called to allocate enough memory to hold an npobject. the newly created npobject's reference count is initialized to 1 before it is returned. ...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
ld in the plugins directory. platform-specific files gecko 1.9.2 (firefox 3.6) and earlier prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), it was possible to package multiple plugin libraries for different operating systems into a single xpi bundle. in the xpi you can use the following structure: platform/ linux_x86-gcc3/ plugins/ libplugin.so darwin_p
pc-gcc3/ plugins/ libplugin.dylib more specific information can be found in the platform-specific subdirectories documentation. gecko 2.0 (firefox 4) and later gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) removed support for platform-specific subdirectories. instead, you need to place the different plugin libraries into the plugins directory. for example: plugins/ ...
Introduction to Public-Key Cryptography - Archive of obsolete content
ckzccazsgawibagibazanbgkqhkig9w0baqqfada3mqswcqydvqqgewjvuzer ma8ga1uechmitmv0c2nhcguxftatbgnvbastdfn1chjpewencybdqtaefw05nzew mtgwmtm2mjvafw05otewmtgwmtm2mjvamegxczajbgnvbaytalvtmrewdwydvqqk ewhozxrzy2fwztenmasga1uecxmeuhviczexmbuga1ueaxmou3vwcml5ysbtagv0 dhkwgz8wdqyjkozihvcnaqefbqadgy0amigjaogbamr6ezipgfjx3urjgejmkiqg 7sdatyazbcabu1avyd7chrkiq31fbxfogd3wnktbf6hro6eamm5/r1askzz8aw7l iqzbcrx
pc0k4du+2q6xju2mpm/8wkumontuvzpo+sgxelmhvcheqoocwfdizywyz nmmrjgaoma2ms6pukfqvagmbaagjnja0mbegcwcgsagg+eibaqqeawiagdafbgnv hsmegdawgbty8gzzkbhhufwjm1oxeuzc+zymytanbgkqhkig9w0baqqfaaobgqbt i6/z07z635dfzx4xbafpjlrl/aywqztsyx8gfcnaqcqcwasdkvsuj/vwbf91o3j3 ukdgy
pcd2cyrcgki4mwqdwyltpuhah18hhz5uvi00mjyw8w2wuosy0rc/a/idy84 hw3wwehbuqvk5sy4/zj4otjx7dwnmdgwbwfprqjd1a== -----end certificate----- how...
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin central, please see tamarin build documentation supported platforms operating system processor status windows xp x86 supported, acceptance and performance tests automated in buildbot mac os x 10.4 x86 supported, acceptance and performance tests automated in buildbot linux - ubuntu 8.0.4 x86 supported, acceptance and performance tests automated in buildbot windows mobile (pocket
pc 5.0) armv4t supported, acceptance and performance tests automated in buildbot raw image (no os) armv5 supported, acceptance and performance tests not done linux (nokia n810) armv5 supported, acceptance and performance tests not done current build status the current tamarin tracing build status can be found at tamarin tracing build status getting the tamarin source the tamarin tracing sourc...
ActiveXObject - Archive of obsolete content
object. typename the type or class of the object to create. location optional the name of the network server where the object is to be created. remarks automation servers provide at least one type of object. for example, a word-processing application may provide an application object, a document object, and a toolbar object. you may be able to identify servername.typename values on a host
pc in the hkey_classes_root registry key. for example, here are a few examples of values you may find there, depending on which programs are installed: excel.application excel.chart scripting.filesystemobject wscript.shell word.document important: activex objects may present security issues. to use the activexobject, you may need to adjust security settings in inte...
New in JavaScript 1.8 - Archive of obsolete content
a tracking development bug for javascript 1.8. using javascript 1.8 in order to use some of the new features of javascript 1.8 in html, use: <script type="application/javascript;version=1.8"> ... your code ... </script> another way (not recommended) to do this is to use the deprecated <script> language attribute and define it as "javascript1.8". when using the javascript shell, javascript x
pcom components, or xul <script> elements, the latest js version (js1.8 in mozilla 1.9) is used automatically (bug 381031, bug 385159). the features that require the use of the new keywords "yield" and "let" require you to specify version 1.7 or higher because existing code might use those keywords as variable or function names. the features that do not introduce new keywords (such as generator exp...
New in JavaScript - Archive of obsolete content
learn more about the ecmascript standards on which the javascript language is based on. ecmascript 5 support implementation status for the current standard ecma-262 edition 5.1 in mozilla-based engines and products. ecmascript 2015 support implementation status for the draft ecma-262 edition 6 (es2015) in mozilla-based engines and products. ecmascript next support implementation status for u
pcoming ecma-262 features as per the yearly (es2016/es2017/es2018/...) release schedule in mozilla-based engines and products. javascript versions deprecated ( ). the explicit versioning and opt-in of language features was mozilla-specific and are in process of being removed. firefox 4 was the last version which referred to a javascript version (1.8.5). with new ecma standards, javascript languag...
Reference - Archive of obsolete content
here (and link to it whenever we mention it). --nickolay 18:40, 16 july 2006 (pdt) js 1.2 and gecko 1.8 per the fix for bug 255895, "javascript1.2" values for the script's language attribute no longer work, e.g. <script language="javascript1.2"> will execute the script in the latest js version rather than js 1.2. so how should this be documented? in fx 1.0, js 1.2 is available, but not in the u
pcoming fx 1.5. there are 5 cases where "javascript1.2" is mentioned in this reference: special:search?search=javascript1.2&go=go. how should they be revised? --maian 23:43, 21 september 2005 (pdt) i think we need a new section in the reference that specifies the differences between versions, collecting this information into a single location rather than leaving it scattered haphazardly throughout...
Building Mozilla XForms - Archive of obsolete content
firefox 3.5 and up: get the source code if you want to build xforms for firefox up to 3.0, you already have the required source code, it's part of your cvs checkout. skip to the next section. starting with firefox 3.5, you need to do two more mercurial checkouts: cd extensions hg ...
RFE to the XForms API - Archive of obsolete content
to be queried from the xforms element that resides in the dom. for example, every visual xforms element exposes the nsixformsdelegate interface. if you need some additional functionality that shouldn't be exposed from the xforms element directly, then you should think which interface of the xforms element is more appropriate to expose it. mozilla xforms doens't offer any service you can get via x
pcom. as an example, the nsixformsaccessors interface which allows a user to get/set the value of an instance node and get the state of an instance node, is exposed by the nsixformsdelegate interface using the accessors property. xforms dom put here your requirements how to improve xforms dom api. reflect attributes to properties for the elements that can contain the incremental or selection a...
XForms Input Element - Archive of obsolete content
alse'. mozilla extensions labelposition - only for boolean types: show the label before or after the checkbox (see below) type restrictions the input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xforms input element can be represented by the following widgets for the s
pcified data types (or types derived from these data types): text field - the default widget when no type is specified or the data is of type xsd:string (xhtml/xul) checkbox - used for xsd:boolean instance data. (xhtml/xul) datepicker - used to represent data of type xsd:date (xhtml/xul) calendar - used to represent data of type xsd:date when appearance attribute also has the value 'full' (xhtml/xu...
XQuery - Archive of obsolete content
wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkeley db xml's java api (and via a java wrapper class which circumvents liveconnect's current inability to handle some types of java exceptions properly). however, use of the approach of the java firefox extension might be used to turn the above extension concept into an x
pcom component (giving it access to all open windows), and for berkeley db xml, possibly implementing it in c++ instead, which is that database's original language of development. however, the extension demonstrates a technique which does not depend on using x
pcom, while still giving full privileges. tutorials w3schools learn xquery in 10 minutes an introduction to xquery ...
Anatomy of a video game - Game development
g to do so effectively. building a more optimized main loop in javascript ultimately, in javascript, the browser is running its own main loop and your code exists in some of its stages. the above sections describe main loops which try not to wrestle away control from the browser. these main methods attach themselves to window.requestanimationframe(), which asks the browser for control over the u
pcoming frame. it is up to the browser how to relate these requests to their main loop. the w3c spec for requestanimationframe does not really define exactly when the browsers must perform the requestanimationframe callbacks. this can be a benefit because it leaves browser vendors free to experiment with the solutions that they feel are best and tweak it over time. modern versions of firefox and go...
Index - Game development
sts a number of impressive web technology demos for you to get inspiration from, and generally have fun with. a testament to what can be done with javascript, webgl, and related technologies. 4 index meta found 74 pages: 5 introduction to html5 game development (summary) firefox os, games, html5, mobile games built with html5 work on smartphones, tablets,
pcs and smart tvs.update your game whenever you want.players can play the game anywhere, anytime. 6 introduction to game development for the web firefox os, games, guide, mobile no summary! 7 publishing games games, html5, javascript, monetization, promotion, distribution, publishing this series of articles looks at the options you have when you want to publ...
Introduction to game development for the Web - Game development
ddb or the "cloud" web html, css, svg (and much more!) the business case as a game developer, whether you're an individual or a large game studio, you want to know why it makes sense to target the web with your next game project. let's look at how the web can help you. the reach of the web is enormous; it's everywhere. games built with html5 work on smartphones, tablets,
pcs and smart tvs. marketing and discoverability are improved. you're not limited to promoting your app on someone else's app store. instead, you can advertise and promote your game all over the web as well as other media, taking advantage of the web's inherent linkability and shareability to reach new customers. you have control where it matters: payments. you don't have to hand over 30% of you...
Building up a basic demo with PlayCanvas editor - Game development
nsidered an advanced thing to do, but all we want to do is to control a few properties of a given object — we can use a script component to do that. click on the plus button in the assets panel, select the script option, and name your new script file boxanimation.js. if you double click on it, you'll be moved to a code editor. ...
WebVR — Virtual Reality for the Web - Game development
ques the first webvr experiments and demos used three.js as it's probably the most popular 3d engine for the web. see the vreffect and vrcontrols functions available on the three.js github to help you implement and handle webvr with three.js. boris smus has written about the concept of responsive webvr, where a single web game can be played on various devices like laptops without vr hardware,
pcs with oculus rift, or smartphones inside google cardboard and still deliver a unique and valuable experience across all of them. it's like responsive design, but applied to the vr world — write once and run in any vr headset ... or without it. you can check the webvr boilerplate sources — it's a good example to start learning webvr from, and a starting point for any web-based vr experience. ...
Implementing controls using the Gamepad API - Game development
rticle looks at implementing an effective, cross-browser control system for web games using the gamepad api, allowing you to control your web games using console game controllers. it features a case study game — hungry fridge, created by enclave games. controls for web games historically playing games on a console connected to your tv was always a totally different experience to gaming on the
pc, mostly because of the unique controls. eventually, extra drivers and plugins allowed us to use console gamepads with desktop games — either native games or those running in the browser. now in the era of html5, we finally have the gamepad api, which gives us the ability to play browser-based games using gamepad controllers without any plugins. the gamepad api achieves this by providing an inte...
Plug-in Development Overview - Gecko Plugin API Reference
see the wikipedia article for historical information. both technologies are now obsolete for the purposes of plug-in scriptability, and the cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files to make your p...
Endianness - MDN Web Docs Glossary: Definitions of Web-related terms
, 31 december 2050). naturally, big-endian is the opposite order, comparable to an iso date (2050-12-31). big-endian is also often called "network byte order", because internet standards usually require data to be stored big-endian, starting at the standard unix socket level and going all the way up to standardized web binary data structures. also, older mac computers using 68000-series and power
pc microprocessors formerly used big-endian. examples with the number 0x12345678 (i.e. 305 419 896 in decimal): little-endian: 0x78 0x56 0x34 0x12 big-endian: 0x12 0x34 0x56 0x78 mixed-endian (historic and very rare): 0x34 0x12 0x78 0x56 ...
Index - MDN Web Docs Glossary: Definitions of Web-related terms
he start of a line and are immediately followed by a ':' and a value depending of the header itself. the value finish at the next crlf or at the end of the message. 198 http/2 glossary, http, infrastructure, reference, web performance, l10n:priority http/2 is a major revision of the http network protocol 199 http/3 http, intro, needscontent http/3 is the u
pcoming major revision of the http network protocol 200 https glossary, https, infrastructure, security https (hypertext transfer protocol secure) is an encrypted version of the http protocol. it uses ssl or tls to encrypt all communication between a client and a server. this secure connection allows clients to safely exchange sensitive data with a server, such as when performin...
Mozilla Firefox - MDN Web Docs Glossary: Definitions of Web-related terms
mozilla firefox is a free open-source browser whose development is overseen by the mozilla corporation. firefox runs on windows, os x, linux, and android. first released in november 2004, firefox is completely customizable with themes, plug-ins, and add-ons. firefox uses gecko to render webpages, and implements both current and u
pcoming web standards. learn more general knowledge mozilla firefox official website technical reference firefox developer documentations on mdn ...
Regular expression - MDN Web Docs Glossary: Definitions of Web-related terms
regular expressions (or regex) are rules that govern which sequences of characters come up in a search. regular expressions are implemented in various languages, but the best-known implementation is the perl implementation, which has given rise to its own ecosystem of implementations called
pcre (perl compatible regular expression). on the web, javascript provides another regex implementation through the regexp object. learn more general knowledge regular expressions on wikipedia interactive tutorial visualized regular expression technical reference writing regular expressions in javascript ...
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
sdp (session description protocol) is the standard describing a peer-to-peer connection. sdp contains the codec, source address, and timing information of audio and video. here is a typical sdp message: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0
pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 sdp is never used alone, but by protocols like rtp and rtsp. sdp is also as component of webrtc, which uses sdp as a way of describing a session. learn more general knowledge webrtc protocols session description protocol on wikipedia ...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
} } else if (href.match(/#$/, '') || href.match(/^#/, '')) { alert('fragment identifiers are disallowed in an xinclude "href" attribute'); return false; } var j; var xincludeparent = xinclude.parentnode; try { netscape.security.privilegemanager.enableprivilege('universalx
pconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); ...
Assessment: Accessibility troubleshooting - Learn web development
l free to put them in appropriate <style> / <script> elements. the finished assessment site should look like so: you will see some differences/issues with the display of the starting state of the assessment — this is mainly due to the differences in the markup, which in turn cause some styling issues as the css is not applied properly. don't worry — you'll be fixing these problems in the u
pcoming sections! note: if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. project brief for this project, you are presented with a fictional nature site displaying a "factual" article about bears. as it stands, it has a number of accessibility issues — your task is to explore the existing site and fix them to the best of your abi...
CSS values and units - Learn web development
nits the following are all absolute length units — they are not relative to anything else and are generally considered to always be the same size. unit name equivalent to cm centimeters 1cm = 96px/2.54 mm millimeters 1mm = 1/10th of 1cm q quarter-millimeters 1q = 1/40th of 1cm in inches 1in = 2.54cm = 96px
pc picas 1
pc = 1/6th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in most of these values are more useful when used for print, rather than screen output. for example we don't typically use cm (centimeters) on screen. the only value that you will commonly use is px (pixels). relative length units relative length units are relative to som...
Introduction to cross browser testing - Learn web development
edge javascript features in your site, they might not work in older browsers. if you need to support older browsers, you might have to not use those, or convert your code to old fashioned syntax using some kind of cross-compiler where needed. some devices may have constraints that cause a web site to run slowly, or display badly. for example, if a site has been designed to look nice on a desktop
pc, it will probably look tiny and be hard to read on a mobile device. if your site includes a load of big animations, it might be ok on a high spec tablet, but might be sluggish or jerky on a low end device. and more reasons besides. in later articles, we'll explore common cross browser problems, and look at solutions to those. workflows for cross browser testing all of this cross browser test...
omni.ja (formerly omni.jar)
contents the omni.ja file contains assorted application resources: chrome.manifest the chrome manifest file. /chrome/ user interface files for the application /chrome/localized.manifest manifest of localized content; referenced by the main chrome manifest file. /chrome/nonlocalized.manifest manifest of non-localized content; referenced by the main chrome manifest file. /components/ x
pcom components the application relies upon. /defaults/ default preference files. /modules javascript code modules. /res/ miscellaneous resource files. ...
Accessibility API cross-reference
api's. all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc. they also define a list of possible object states, such as focused, read-only, checked, etc. an interesting problem is that mozilla, safari/khtml, opera, staroffice and other apps are cross-platform, but there is currently no cross-platform accessibility api. the i
pc mechanisms used by current generation api's are also not cross-platform, although communication for some cross-platform accessibility api of the future could be done through sockets. these tables describe how various accessibility apis define possible roles of an object, and states. all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item...
CSUN Firefox Materials
firefox 1.5, beyond the status quo "...firefox is a great little browser. it's a quick download, occupies very little disk space, and has a clean, no-nonsense interface." -
pc magazine firefox 1.5 is a fast, free, standards compliant web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the web. in addition to winning major awards such as
pc world product of the year, firefox has attracted a huge following among savvy users who simply care enough about their web browsing experience to download a new piece of software. websites such as online magazines with sophisticated audiences are now reporting upwards of 25% firefox usage. why do the most discerning users switch to firefox? because firefox rethinks the web, and does away with many of...
Gecko info for Windows accessibility vendors
a variation on this method is get_attributesfornames, which lets turns the attribnames array into an [in] parameter, letting you specify only those attributes you're interested in. this helps minimize the cost of marshalling for those times in which you're interested in only a few attributes per node. hresult get_attributesfornames( /* [in] */ unsigned short numattribs, /* [in] */ bstr __r
pc_far *attribnames, /* [in] */ short __r
pc_far *namespaceid, /* [out] */ bstr __r
pc_far *attribvalues); the get_computedstyle method is used to find out the cumulative, computed results for all style rules applied to a node. the return value numstyleproperties specifies the number of style properties for this node, and the last 2 parameters return 2 arrays corresponding to style property name...
Links and Resources
as well as open source accessibility. guidelines & standards information and resources on section 508 - legal policy for us government purchases requiring software accessibility. wai - web accessibility initiative web content accessibility guidelines (wcag) 1.0 the first set of official guidelines from the w3c web accessibility initiative (wai). the european union is looking to base their u
pcoming accessibility regulations on these guidelines. wai interest group - discussion list for standards in web accessibility. web accessibility checklist from ibm. ibm's java accessibility checklist - guidelines to making java accessibility. accessibility information resource center for developers at adobe - flash mx accessibility, pdf document accessibility and actionscript accessibility.
Accessibility and Mozilla
re also used during the development of firevox, an at using iaccessible2.accessible toolkit checklistplease contact the mozilla accessibility community with questions or feedback.csun firefox materialsfirefox 1.5 is a fast, free, standards compliant web browser which is rapidly gaining recognition for its fresh, streamlined approach to browsing the web. in addition to winning major awards such as
pc world product of the year, firefox has attracted a huge following among savvy users who simply care enough about their web browsing experience to download a new piece of software. websites such as online magazines with sophisticated audiences are now reporting upwards of 25% firefox usage.embedding api for accessibilityevent process procedurethis diagram outlines how events are processed within g...
What to do and what not to do in Bugzilla
mary in order to morph the bug to describe a different issue. in this case the bug should be resolved and another bug should be opened. os/hardware make sure that the os or hardware fields correctly display the systems that are affected. if a bug is windows-only, change the field to the oldest affected operating system. if the bug is present on linux and windows, change the fields to hardware =
pc and os = all. if another hardware platform like mac or dec is also affected, change hardware to all. severity this field describes the impact of a bug. blocker blocks development and/or testing work critical crashes, loss of data, severe memory leak major major loss of function normal regular issue, some loss of functionality under specific circu...
Creating MozSearch plugins
wkio8ccroqu0dxqlwrdshuwzbaaigjmtnnpgya9j8uqhfelwpxf2mideirksn9fwsjorkaeeam0dd4dzmaypi%2fg%2bqky4hh5waxgf8pdq0fgwj22d27cjadaaiirlmjo%2bmxa9r2kahvgba2wwx6b8w7od6ceqcggkcmcel8bgwxycbuigtdvkhdbia%2bcuotgaccued3tdqn75d4xmavcok9armhbzaw0aecibhkalc0mdy7x9abna3obazxiaa6ikecglmvqhwwyjyul2d4v2cpg8vzswx7ghyaaak7aoif7saboqcmn4ha3ahfsidtgpq%2fvlz8p4mskj2w9h8ggbjevxvhdo4fquqg%2fkdypqcg4h8luiacnq%2fsobmyi8basajf
pcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczx
pcqxquzhaeccj4xgml493ug21zd%2badaxh0wlm4a9mzpxjkjiiawtar5pqmalacabquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg%3d%3d</image> <url type="text/html" method="get" template="http://developer.mozilla.org/en/docs/special:search?search={searchterms}"/> <searchform>http://developer.mozilla.org/en/docs/special:search</searchform> </searchplugin> not...
Gmake vs. Pymake
try to switch from gmake to pymake or pymake to gmake the build will fail unless you did a relative configure. a relative configure produces paths that look like "../../foo" which can be understood by gmake and pymake. to configure relatively, invoke configure or client.mk from your objdir. for example, if using the default objdir, you might type in the root of your source tree: mkdir obj-i686-
pc-mingw32; cd obj-i686-
pc-mingw32; python ../build/pymake/make.py -f ../client.mk. note that typing "python build/pymake/make.py -f client.mk" does not trigger a relative configure. the working directory must be your objdir when you invoke configure to get paths that will work in gmake and pymake. you should also make sure that the object directory path specified in your mozconfig matches the dire...
ESLint
loadsubscript? you'll need to include the following just above it: /* import-globals-from relative/path/to/file.js */ do_check_eq, add_task not defined in a test directory. ensure there is a .eslintrc.js file that extends one of: "plugin:mozilla/browser-test" "plugin:mozilla/chrome-test" "plugin:mozilla/mochitest-test" "plugin:mozilla/x
pcshell-test" see other test directories for how to do this. i need to test that something isn't defined. do something like: // eslint-disable-next-line no-undef it.does.not.exist(); need more help? join the #eslint channel on irc.mozilla.org and ask away. ...
Listening to events on all tabs
ted with the state change; this indicates whether or not the request was successful. this parameter should be ignored unless astateflags includes the state_stop bit. note: astatus may be a success code even for server generated errors, such as the http 404 file not found error. in such cases, the request itself should be queried for extended error information (e.g., for http requests see nsihtt
pchannel). onstatuschange notification that the status of a request has changed. the status message is intended to be displayed to the user (e.g., in the status bar of the browser). void onstatuschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, nsresult astatus, prunichar *amessage ); parameters abrowser the browser that fired the notification. ...
Reviewer Checklist
tch does not add duplicates of existing code ('almost duplicates' could mean a refactor is needed). commonly this results in "part 0" of a bug, which is "tidy things up to make the fix easier to write and review". if qa needs to verify the fix, you should provide steps to reproduce (str). quality if you can unit-test it, you should unit-test it. if it's js, try to design and build so that x
pcshell can exercise most functionality. it's quicker. make sure the patch doesn't create any unused code (e.g., remove strings when removing a feature) all caught exceptions should be logged at the appropriate level, bearing in mind personally identifiable information, but also considering the expense of computing and recording log output. [fennec: checking for log levels is expensive unless you'...
Working with Mozilla source code
is isn't a good way to download the code, but is a great way to search it. navigating the mozilla source code learn about the various folders in the mozilla source tree, and how to find what you're looking for. bugs for newcomers if you are new to the project and want something to work on, look here. interface development guide guidelines and documentation for how to create and update x
pcom interfaces. the firefox codebase: css guidelines this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers. svg cleanup guide guidelines and best practices for shipping new svgs. try servers mozilla products build on at least three platforms. if you don't have access to them all, you can use the...
mach
e the experience. for full help: $ ./mach help try building the tree: $ ./mach build if you get error messages, make sure that you have all of the build requisites for your system. if it works, you can look at compiler warnings: $ ./mach warnings-list try running the program: $ ./mach run try running your program in a debugger: $ ./mach run --debug try running some tests: $ ./mach x
pcshell-test services/common/tests/unit/ or run an individual test: $ ./mach mochitest browser/base/content/test/general/browser_pinnedtabs.js you run mach from the source directory, so you should be able to use your shell's tab completion to tab-complete paths to tests. mach figures out how to execute the tests for you! check out the linting and analysis tools: $ ./mach lint $ ./mach static-an...
Cross Process Object Wrappers
ous message it sent to the chrome process. the content process is blocked anyway waiting for the chrome process, so there's no chance, in this situation, that the cpow call will block on some long-running activity in the content process. the content process can respond immediately to the cpow call: there is still a performance cost to the cpow in this situation, because the cpow call is an i
pc call instead of a simple property access in the same process. however, the potential impact on responsiveness is much smaller. also, in this situation, the content process is in a known state. we know it's blocked waiting for the synchronous message to return, and we know that won't change during the cpow call. this makes the cpow call much safer than it would otherwise be. this situation is th...
Frame script environment
ab global. this means you don't have to worry about global variables you define conflicting with global variables defined by another frame script. you can still access the global directly via this. frame scripts run with system principals. if you want other principals, you can use a sandbox. frame scripts run with system privileges and have access to the components object, enabling them to use x
pcom objects and jsms. however, some apis that work in the chrome process will not work in a frame script. see limitations of frame scripts for more details. events besides the regular dom events being captured/bubbling up from content the current content object the following additional events get fired in a frame script environment: unload fires when the frame script environmen...
Limitations of frame scripts
many privileged apis will just work in a content process. anything that just manipulates data structures will just work. xhr and workers will work. however, some apis that work in the chrome process will not work in a frame script. this article lists the most important of these apis. this is one of a pair of articles: the other one lists limitations of chrome scripts. security restrictions on file access processes that host remote content are isolated from the local system through a content security sandbox. ...
Communicating with frame scripts
output somewhat like this, when the user clicks a <div>: "my-addon@me.org:my-e10s-extension-message" false object { details: "they clicked", tag: "div" } <xul:browser anonid="initialbrowser" ... > { target: <div#searchcontainer> } if your code requires access to a window (for example to run window.opendialog), and your message listener is run from somewhere without access to a window (e.g. an x
pcom component), you can access the window of the browser that sent the message with message.target.ownerdocument.defaultview. synchronous messaging to send a synchronous message, the frame script uses the global sendsyncmessage() function: // frame script sendsyncmessage("my-addon@me.org:my-e10s-extension-message"); when a chrome script receives a synchronous message, it should return a value f...
Frame script environment
lobal variables you define conflicting with global variables defined by another frame script. you can still access the global directly using this. frame scripts run with system principals. if you want other principals or when interacting with untrusted page scripts, you should use a sandbox. frame scripts run with system privileges and have access to the components object, enabling them to use x
pcom objects and jsms. however, some apis that work in the chrome process do not work in a frame script. see limitations of frame scripts for more details. events besides the regular dom events being captured/bubbling up from content the current content object the following additional events get fired in a frame script environment: unload bubbles no fires whe...
Limitations of frame scripts
many privileged apis will just work in a content process. anything that just manipulates data structures will just work. xhr and workers will work. however, some apis that work in the chrome process will not work in a frame script. this article lists the most important of these apis. file i/o you should not write to or read from the disk from a frame script, in particular, the profile directory. even if this is possible, you should not do it and may expect that it could stop working at any time. file i/o should all be done in the chrome process. ...
Performance
vide some middle ground for 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() { // ... ...
Performance best practices for Firefox front-end engineers
on an expectation that the from (0%) and the to (100%) values will be explicitly defined in the @keyframes definition. even though these values may be inferred through the use of initial values or the cascade, the offscreen animation optimizations are dependent on the explicit definition. see this comment and a few previous comments on that bug for more information. use indexeddb for storage ap
pcache and localstorage are synchronous storage apis that will block the main thread when you use them. avoid them at all costs! indexeddb is preferable, as the api is asynchronous (all disk operations occur off of the main thread), and can be accessed from web workers. indexeddb is also arguably better than storing and retrieving json from a file—particularly if the json encoding or decoding is...
mozbrowserscrollviewchange
non-standard this feature is non-standard and is not on a standards track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowserscrollviewchange event is fired when asynchronous scrolling (i.e. a
pcz) starts or stops. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the browser iframe type read only domstring the type of event. bubbles read only boolean whether the event normally bubbles o...
Embedding Mozilla
, some possible embedding scenarios that we need to deal with, and an embedding solution that will fulfil them. roll your own browser - an embedding howto a quick introduction to embedding mozilla. view all... community view mozilla forums... mailing list newsgroup rss feed #embedding irc channel related topics gecko, x
pcom ...
Hacking with Bonsai
engineers, it was very difficult to determine what happened in the tree that caused the instability. bonsai was created to solve these problems. the process everyone who checks into the tree, joins a group called "the hook" at 8:00 am pst every weekday morning, the source tree is closed. the build team will then pull the 8:00 am tree, and build it on a subset of the platforms, linux, win32 & macp
pc. at 10:00 am, everyone who is on the hook is available in case the build breaks eventually, the tree builds, and it is re-opened. there is a web page, which records if the tree is open or closed what the date stamp of the last known good tree is who is on the hook for the current tree before the tree is opened, the list of checkins that happened when the tree was closed is reviewed to insure t...
How Mozilla determines MIME Types
he specified mime type will be used. (i.e. the list in edit/preferences/helper applications) if that failed, a list of "extra" mime types is searched for an extension match. see line 507 for the complete list. if that also failed, the list of loaded plugins is checked for a plugin that can handle this extension, and is asked for the mime type if no plugin is registered, the ext-to-type-mapping x
pcom category is searched for the extension. this allows extensions to register additional mappings. the key of the category entry is the extension without leading dot, the value is the mime type. the extension must be lowercase. if no ext-to-type-mapping category is found, the externalhelperappservice returns application/x-extension-ext, where ext is the extension of the file. helper application...
IME handling guide
ly, it's not allowed to use syncronous communication from chrome process to a remote process. this means that chrome process (and also native ime and our native ime handler) cannot query the focused editor contents directly. for fixing this issue, we have contentcache classes around process boundary. mozilla::contentcache this is a base class of contentcacheinchild and contentcacheinparent and i
pc-aware. this has common members of them including all cache data: mtext whole text in focused editor. this may be too big but ime may request all text in the editor. if we can separate editor contents per paragraph, moving selection between paragraphs generates pseudo focus move, we can reduce this size and runtime cost of contenteventhandler. however, we've not had a plan to do that yet. not...
Implementing QueryInterface
assignments to *ainstanceptr, which compilers have trouble optimizing. it clears the result, *ainstanceptr, when returning an error. it generates less code than the typical implementation of queryinterface. it tests for bad input with an ns_assertion, to find logic errors immediately in debug builds. some alternatives the ns_impl_query_interface[012] macros the sample above implements two x
pcom interfaces in addition to nsisupports. the ns_impl_query_interface2 macro can write this function for you (though it pains me to recommend macros), e.g., ns_impl_query_interface2(nsmyimplementation, nsix, nsiy) // implements |nsmyimplementation::queryinterface| as above ns_impl_query_interface1(nsfoo, nsifoo) // |nsfoo::queryinterface| provides |n...
Assert.jsm
report() all of the aforementioned functions must throw an assertionerror when a corresponding condition is not met, with a message that may be undefined if not provided. all assertion methods provide both the actual and expected values to the assertion error for display purposes. this report method only throws errors on assertion failures, as per spec, but consumers of this module (think: x
pcshell-test, mochitest) may want to override this default implementation. undefined report( failed, actual, expected, message, operator ); parameters failed indicates if the assertion failed or not actual the result of evaluating the assertion expected expected result from the test author message short explanation of the expected result operator operation qualifier used by ...
JavaScript OS.Constants
input/output error eisdir is a directory eloop (not always available under windows) too many levels of symbolic links. emfile too many open files in the process enametoolong name too long enfile too many open files on the system enoent no such file or directory enomem cannot allocate memory enos
pc no space on device enotdir is not a directory enxio device no configured or does not support operation eopnotsupp (not always available under windows) operation not supported. eoverflow (not always available under windows) value too large to be stored in datatype. eperm operation not permitted erange result too large ...
OSFile.jsm
what are the relationships with the html5 file api? none, really. ...
PromiseWorker.jsm
mary a promiseworker is a chromeworker except instead of calling postmessage() to send a message, you call post(), which returns a promise. javascript files imported into the worker scope and main thread scope which allows posting to the worker and receiving in the form of a promise. like chromeworker objects, promiseworker is mostly used for js-ctypes but it is not limited to that. there is no x
pcom access, similar to chromeworker. this answers the question "when should i use a promiseworker?", and the answer is, whenever you would normally use a chromeworker, but want postmessage to return promises. the promiseworker object is used to deliver all of the os.file functionality to the main thread. here is the test case from firefox codebase: mozilla dxr :: test_promise.js. promiseworker mo...
Bootstrapping a new locale
io/localizer-documentation/ . to learn how to bootstrap a new locale for mozilla projects, please see those documents. in mozilla, we use the the mercurial version control system (hg) to help manage our localizations. when a localization team is registered and your hg repository is set up for a locale, you can then clone the existing mozilla release branch (i.e. where active development of the u
pcoming release of firefox occurs) and then begin the necessary work for translation. hg allows localizers to work locally on their machines and then "push" changes to their official mozilla repository. installing mercurial depending on your operating system, you will need to install the correct version of hg on your machine. this document will give you the basic information on how to do that. ...
Uplifting a localization from Central to Aurora
localizers who are working on l10n-central are responsible for getting their work onto the aurora repository. here some tips and tricks for syncing up both l10n-central and releases/l10n/mozilla-aurora at the same time en-us goes from central to aurora. you want to have a repo from which you can uplift to aurora shortly after the migration. the releases page on wikimo has the u
pcoming dates. you should be good doing it the day after. you don't need to work on making the synchronization happen in either of your copies of the aurora or central repositories, but you can create a third one for this work. we even suggest that you do. that makes it easier to throw away attempts that didn't work. so, here are the mercurial steps to reproduce. prerequisites: merge tool...
Updates
ation! june 11, 2010 stix fonts version 1.0 are now compatible with trunk. may 28, 2010 stix fonts version 1.0 released. april 2010 new web pages for the mozilla mathml project! documentation is now available on mdc and wiki.mozilla.org. feel free to complete and improve it! may 8, 2007 mozilla ceo speaks out on the future of firefox: the complete 8,000 word interview. interview to the a
pc magazine where mitchell baker mentions roger sidje's work on mathml. june 5, 2002 mozilla 1.0 released "by virtue of embedding gecko, mozilla 1.0 and products based on mozilla code support more web standards, more deeply, more consistently across more platforms than any others. mozilla 1.0 features full support for html 4.0, xml 1.0, resource description framework (rdf), cascading style sheets...
Mozilla Port Blocking
22 ssh 23 telnet 25 smtp 37 time 42 name 43 nicname 53 domain 77 priv-rjs 79 finger 87 ttylink 95 supdup 101 hostriame 102 iso-tsap 103 gppitnp 104 acr-nema 109 pop2 110 pop3 111 sunr
pc 113 auth 115 sftp 117 uucp-path 119 nntp 123 ntp 135 loc-srv / epmap 139 netbios 143 imap2 179 bgp 389 ldap 465 smtp+ssl 512 print / exec 513 login 514 shell 515 printer 526 tempo 530 courier ...
Mozilla Development Strategies
ours or a day to fix. in theory, fixes for these bugs will be quick to review. if you have problems finding smaller, easier bugs to work on, start by looking for crashers. maybe the problem can be turned into an assert, or fixed altogether. you can use talkback queries or bugzilla queries to find crashers. look for problems in existing code. find and fix string usage problems. find and fix bad x
pcom macro usage. switch some code over to nscomptrs. look for xxx or todo in the code, verify the code still needs fixing, and fix it. smaller patches get reviewed faster if you find that you spend a lot of time waiting for reviews, keep in mind that patch size is not linear to time to review. a twenty line patch doesn't take twice as long to review as a ten line patch, it usually takes much more...
JS::PerfMeasurement
ions, etc. each potentially-measurable event corresponds to a regular old instance variable, which you can read and even modify. all presently-measurable events are measured with counters, not timers; that is, there is no defined relation between the numbers you get from this interface, and wall-clock time. perfmeasurement* js::extractperfmeasurement(jsval wrapper) if you are the c++ side of an x
pcom interface, and you want to benchmark only part of your execution time but make the results available to javascript, you can declare a bare jsval argument in your .idl file and have javascript pass a perfmeasurement object that it created in that argument slot. the jsval you receive points to a javascript wrapper object. to extract the c++-level perfmeasurement object, call this function. it ...
Profiling with the Gecko Profiler and Local Symbols on Windows
ally reads symbols from the pdb files that are generated during the build process. you probably need a 64 bit build of firefox for this to work, though. it looks like we consume too much memory when creating the symbol table for this to work in 32 bit firefox builds. unfortunately, 32 bit is still the default when building firefox locally. you need to add the lines ac_add_options --target=x86_64-
pc-mingw32 and ac_add_options --host=x86_64-
pc-mingw32 to your mozconfig in order to build a 64 bit build of firefox. profiling local talos runs if you would like to use the gecko profiler with a local talos run of a local build of firefox for windows, you will need to point talos to a zipfile containing breakpad-style symbols for your build. follow the steps below: note: you only need to do this...
TimerFirings logging
com/scripts/12086/dy-min.js?v=12086:3:3389 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] https://ad.doubleclick.net/ddm/adi/n7921.1283839cadreon.com.au/b9038144.122190976;sz=300x600;click=http://pixel.mathtag.com/click/img?mt_aid=2744535504761193354&mt_id=1895890&mt_adid=148611&mt_sid=973379&mt_exid=9&mt_inapp=0&mt_uuid=353d5460-19f6-4400-9bbd-d0fcc3bcf595&mt_3
pck=http%3a//beacon-apac-hkg1.rubiconproject.com/beacon/t/d1f9921d-4e47-448f-b6ba-36cae1c31b65/&redirect=;ord=2744535504761193354?:83:0 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler 92 -495057024[7f74e105ba00]: [7108] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler the first column shows how many times the ...
TraceMalloc
ns(filename); </script> one can then use the script tools/trace-malloc/diffbloatdump.pl to compare trace-malloc dumps before and after doing an action that might leak. if there are significant differences, it might be worth examining the call stacks for the destructors of the objects in question to see what is extending their lifetime. (this can be done by examining the unprocessed output of an x
pcom_mem_refcnt_log, one of the nstracerefcnt logs.) you should use the --use-address argument to diffbloatdump.pl, and then the diff tree can be run through fix_linux_stack.py or fix_macosx_stack.py as needed. leaksoup leaksoup is a trace-malloc tool that analyzes the shutdown log. because this log includes the contents of heap blocks, leaksoup can analyze the graph of live objects and determine wh...
Preferences
lla preferences for uber-geeks a guide to preferences that only truly elite geeks should play with. examples code snippets preference-related code snippets. adding preferences to an extension how to add preferences to an existing extension. related topics xul, javascript, x
pcom, extensions, developing mozilla ...
Crash reporting
is located on crash-stats. if you want to find a specific crash that you submitted, you first need to find the crash id that the server has assigned your crash. type about:crashes into your location bar to get a page listing both submitted and unsubmitted crash reports. for more information, see how to get a stacktrace for a bug report. reports and queries crash-stats has built-in reports of "to
pcrashes" for each release grouped by signature. there is also a custom query tool which allows users to limit searches on more precise information. finally, a set of mozilla employees have access to directly query the underlying data in either sql summary or using mapreduce on the storage cluster. if you are interested in obtaining this advanced access, contact gabriele svelto. see also unders...
Emscripten
can be translated into llvm bytecode into javascript. compile the c/c++ runtimes of other languages into javascript, and then run code in those other languages in an indirect way (this has been done for python and lua)! emscripten makes native code immediately available on the web: a platform that is standards-based, has numerous independent compatible implementations, and runs everywhere from
pcs to ipads. with emscripten, c/c++ developers don’t have the high cost of porting code manually to javascript — or having to learn javascript at all. web developers also benefit, as they can use the many thousands of pre-existing native utilities and libraries in their sites. practically any portable c or c++ codebase can be compiled into javascript using emscripten, ranging from high perfor...
About NSPR
ings. linking support for linking (shared library loading and unloading) is part of nspr's feature set. in most cases this is simply a smoothing over of the facilities offered by the various platform providers. where it's headed nspr is applicable as a platform on which to write threaded applications that need to be ported to multiple platforms. the current implementation supports macintosh (p
pc), win-32 (winnt, win9x) and 20 versions of unix and is still expanding. the basic api is stable and expected to remain that way. nspr is functionally complete and has entered a mode of sustaining engineering. as operating system vendors issue new releases of their operating systems, nspr will be moved forward to these new releases by interested players. original document information author:...
NSPR build instructions
debug build by default. --disable-debug --enable-optimize specify these two options to generate an optimized (release) build. these two options can actually be used independently, but it's not recommended. --enable-64bit on a dual 32-bit/64-bit platform, nspr build generates a 32-bit build by default. to generate a 64-bit build, specify the --enable-64bit configure option. --target=x86_64-
pc-mingw32 for 64-bit builds on windows, when using the mozillabuild environment. --enable-win32-target=win95 this option is only used on windows. nspr build generates a "winnt" configuration by default on windows for historical reasons. we recommend most applications use the "win95" configuration. the "win95" configuration supports all versions of windows. the "win95" name is historical; it shou...
Hash Tables
pes and constants hash table functions hash table types and constants plhashentry plhashtable plhashnumber plhashfunction plhashcomparator plhashenumerator plhashallocops hash table functions pl_newhashtable pl_hashtabledestroy pl_hashtableadd pl_hashtableremove pl_hashtablelookup pl_hashtableenumerateentries pl_hashstring pl_comparestrings pl_comparevalues see also x
pcom hashtable guide ...
Named Shared Memory
ll pr_deletesharedmemory, any further use of the shared memory associated with the name may cause unpredictable results. filenames the name passed to pr_opensharedmemory should be a valid filename for a unix platform. pr_opensharedmemory creates file using the name passed in. some platforms may mangle the name before creating the file and the shared memory. the unix implementation may use sysv i
pc shared memory, posix shared memory, or memory mapped files; the filename may be used to define the namespace. on windows, the name is significant, but there is no file associated with the name. no assumptions about the persistence of data in the named file should be made. depending on platform, the shared memory may be mapped onto system paging space and be discarded at process termination. all...
PRUnichar
an unsigned 16-bit type, like char in java or the "characters" of a javascript string defined in /mozilla/x
pcom/base/nscore.h. syntax #if defined(ns_win32) typedef wchar_t prunichar; #else typedef pruint16 prunichar; #endif ...
PR_CloseSemaphore
closes a specified semaphore. syntax #include <pri
pcsem.h> nspr_api(prstatus) pr_closesemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore. returns prstatus ...
PR_DeleteSemaphore
removes a semaphore specified by name from the system. syntax #include <pri
pcsem.h> nspr_api(prstatus) pr_deletesemaphore(const char *name); parameter the function has the following parameter: name the name of a semaphore that was previously created via a call to pr_opensemaphore. returns prstatus ...
PR_OpenSemaphore
flags how to create or open the semaphore. mode unix style file mode to be used when creating the semaphore. value the initial value assigned to the semaphore. returns a pointer to a prsem structure or null/code> on error. ...
PR_PostSemaphore
increments the value of a specified semaphore. syntax #include <pri
pcsem.h> nspr_api(prstatus) pr_postsemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore. returns prstatus ...
PR_WaitSemaphore
returns prstatus description pr_waitsemaphore tests the value of the semaphore. if the value of the semaphore is > 0, the value of the semaphore is decremented and the function returns. if the value of the semaphore is 0, the function blocks until the value becomes > 0, then the semaphore is decremented and the function returns. ...
Threads
vironment that promotes the use of lightweight threads. each thread is an execution entity that is scheduled independently from other threads in the same process. this chapter describes the basic nspr threading api. threading types and constants threading functions a thread has a limited number of resources that it truly owns. 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. a thread is created by an explicit client request and remains a valid, independent execution entity until it returns from its root function or the process abnormally terminates. threads are critical resources and therefore require some management. to synchronize the termination of a thread, you can ...
NSPR API Reference
ng functions and macros pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log pr_assert pr_assert pr_not_reached use example instrumentation counters named shared memory shared memory protocol named shared memory functions anonymous shared memory anonymous memory protocol anonymous shared memory functions i
pc semaphores i
pc 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 ...
Cryptography functions
sec_deletepermcertificate mxr 3.2 and later sec_deletepermcrl mxr 3.2 and later sec_dersigndata mxr 3.2 and later sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_looku
pcrls mxr 3.2 and later sec_newcrl mxr 3.2 and later sec_quickderdecodeitem mxr 3.6 and later seckey_cachestaticflags mxr 3.10 and later seckey_converttopublickey mxr 3.2 and later seckey_copyprivatekey mxr 3.2 and later seckey_copypu...
JSS FAQ
jss/ssl/sslserver.java org/mozilla/jss/ssl/ssltest.java other test code that may prove useful: org/mozilla/jss/asn1/integer.java org/mozilla/jss/asn1/sequence.java org/mozilla/jss/asn1/set.java org/mozilla/jss/pkcs10/certificationrequest.java org/mozilla/jss/pkcs12/pfx.java org/mozilla/jss/pkix/cert/certificate.java org/mozilla/jss/pkix/cmmf/certre
pcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/provider/javax/crypto/jsssecretkeyfactoryspi.java org/mozilla/jss/util/utf8converter.java org/mozilla/jss/util/base64inputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java if i don't ...
NSS_3.12.2_release_notes.html
52751: slot leak in pk11_findslotsbynames bug 452865: remove obsolete linker flags needed when libnss3 was linked with libsoftokn3 bug 454961: fix the implementation and use of pr_fgets in signtool bug 455348: change hyphens to underscores in debug_$(shell whoami). bug 455424: nssilckt.h defines the enumeration constant 'lock' bug 456036: stubs for deprecated functions in lib/certdb/stan
pcertdb.c should set the pr_not_implemented_error error. bug 456854: cert_decodecertpackage does not set nspr error code upon error bug 457980: hundreds of kilobytes of useless strings in libpkix bug 457984: enable pkcs11 module logging in optimized builds bug 458905: memory leaks in pkix bridge certificates. bug 459231: memory leak in cert fetching - aia extension. bug 459248: support i...
NSS 3.12.5 release_notes
. nss_ssl_enable_renegotiation nss_ssl_require_safe_negotiation see ssl3 & tls renegotiation vulnerability. bugs fixed the following bugs have been fixed in nss 3.12.5. ...
NSS 3.14.2 release notes
types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing notable changes in nss 3.14.2 bug 805604 - support for aes-ni and avx accelerated aes-gcm was contributed by shay gueron of intel. if compiled on linux systems in 64-bit mode, nss will include runtime detection to check if the platform supports aes-ni and
pclmulqdq. if so, nss uses the optimized code path, reducing the cpu cycles per byte to 1/20 of what was required before the patch (https://bugzilla.mozilla.org/show_bug.cgi?id=805604 and https://crypto.stanford.edu/realworldcrypto/slides/gueron.pdf). support for other platforms, such as windows, will follow in a future nss release. (https://bugzilla.mozilla.org/show_bug.cgi?id=540986) sqlite has ...
NSS 3.14 release notes
server support has been added in nss 3.14. because the test coverage and interoperability testing is not yet at the same level as other nss code, this feature should be considered "experimental" and may contain bugs. the following functions have been added to the libssl library included in nss 3.14: dtls_importfd (in ssl.h) dtls_gethandshaketimeout (in ssl.h) ssl_getsrt
pcipher (in ssl.h) ssl_setrt
pciphers (in ssl.h) support for aes-gcm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30. warning: because of ambiguity in the current draft text, applications should only use gcm in single-part mode (c_encrypt/c_decrypt). they should not use multi-part apis (c_encryptupdate...
NSS 3.17.1 release notes
ff by default. in sslerr.h ssl_error_inappropriate_fallback_alert - a new ssl error code. in sslproto.h tls_fallback_scsv - a a signaling cipher suite value that indicates a handshake is the result of tls version fallback. notable changes in nss 3.17.1 signature algorithms now use sha-256 instead of sha-1 by default. added support for linux on little-endian power
pc64. bugs fixed in nss 3.17.1 this bugzilla query returns all the bugs fixed in nss 3.17.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.17.1 acknowledgements the nss development team would like to thank antoine delignat-lavaud, security researcher at inria paris in team prosecco, and the advanced thre...
NSS 3.23 release notes
uzleti (class b) tanusitvanykiado sha-256 fingerprint: 39:df:7b:68:2b:7b:93:8f:84:71:54:81:cc:de:8d:60:d8:f2:2e:c5:98:87:7d:0a:aa:c1:2b:59:18:2b:03:12 cn = netlock expressz (class c) tanusitvanykiado sha-256 fingerprint: 0b:5e:ed:4e:84:64:03:cf:55:e0:65:84:84:40:ed:2a:82:75:8b:f5:b9:aa:1f:25:3d:46:13:cf:a0:80:ff:3f friendly name: verisign class 1 public
pca – g2 sha-256 fingerprint: 34:1d:e9:8b:13:92:ab:f7:f4:ab:90:a9:60:cf:25:d4:bd:6e:c6:5b:9a:51:ce:6e:d0:67:d0:0e:c7:ce:9b:7f friendly name: verisign class 3 public
pca sha-256 fingerprint: a4:b6:b3:99:6f:c2:f3:06:b3:fd:86:81:bd:63:41:3d:8c:50:09:cc:4f:a3:29:c2:cc:f0:e2:fa:1b:14:03:05 friendly name: verisign class 3 public
pca – g2 sha-256 fi...
NSS 3.27 release notes
ag is nss_3_27_rtm. nss 3.27 requires netscape portable runtime (nspr) 4.13 or newer. nss 3.27 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_27_rtm/src/ new in nss 3.27 new functionality allow custom named group priorities for tls key exchange handshake (ssl_namedgrou
pconfig). added support for rsa-pss signatures in tls 1.2 and tls 1.3 new functions in ssl.h ssl_namedgrou
pconfig notable changes in nss 3.27 update 2016-10-02: the maximum tls version supported has been increased to tls 1.3 (draft). although the maximum tls version enabled by default is still tls 1.2, there are applications that query the list of tls protocol version...
NSS 3.28 release notes
port for additional elliptic curves (the nss_ecc_more_than_suite_b option, bug 1253912). this was previously possible by replacing certain nss source files. nss will now detect the presence of tokens that support additional elliptic curves and enable those curves for use in tls (bug 1303648). note that this detection has a one-off performance cost, which can be avoided by using the ssl_namedgrou
pconfig function, to limit supported groups to those that nss provides. pkcs#11 bypass for tls is no longer supported and has been removed (bug 1303224). support for "export" grade ssl/tls cipher suites has been removed (bug 1252849). nss now uses the signature schemes definition in tls 1.3 (bug 1309446). this also affects tls 1.2. nss will now only generate signatures with the combinations of h...
NSS 3.45 release notes
ng certificates, secfailure is returned and *results will be null. notable changes in nss 3.45 bug 1540403 - implement delegated credentials (draft-ietf-tls-subcerts) this adds a new experimental function: ssl_delegatecredential note: in 3.45, selfserv does not yet support delegated credentials. see bug 1548360. note: in 3.45 the sslchannelinfo is left unmodified, while an u
pcoming change in 3.46 will set sslchannelinfo.authkeybits to that of the delegated credential for better policy enforcement. see bug 1563078. bug 1550579 - replace arm32 curve25519 implementation with one from fiat-crypto bug 1551129 - support static linking on windows bug 1552262 - expose a function pk11_findrawcertswithsubject for finding certificates with a given subject on a given slot ...
NSS 3.48 release notes
e library's default, or nss_max_mp_pbe_iteration_count to request a lower iteration count for test environments. see bug 1562671 for details. certificate authority changes the following ca certificates were added: bug 1591178 - entrust root certification authority - g4 cert sha-256 fingerprint: db3517d1f6732a2d5ab97c533ec70779ee3270a62fb4ac4238372460e6f01e88 u
pcoming changes in nss 3.49 the legacy dbm database, libnssdbm, will no longer be built by default. see bug 1594933 for details. bugs fixed in nss 3.48 bug 1600775 - require nspr 4.24 for nss 3.48 bug 1593401 - fix race condition in self-encrypt functions bug 1599545 - fix assertion and add test for early key update bug 1597799 - fix a crash in nssckfwobject_getattributesize bug 1591178 ...
NSS 3.49 release notes
49_rtm/src/ other releases are available in nss releases. notable changes in nss 3.49 the legacy dbm database, libnssdbm, is no longer built by default when using gyp builds. see bug 1594933 for details. bugs fixed in nss 3.49 bug 1513586 - set downgrade sentinel for client tls versions lower than 1.2. ...
NSS 3.50 release notes
when clamping in windows assembly/mp_comba bug 1604596 - update wycheproof vectors and add support for cbc, p256-ecdh, and cmac tests bug 1608493 - use aes-ni for non-gcm aes ciphers on platforms with no assembly-optimized implementation, such as macos. bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/power
pc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdbm shared object is available anyway. this bugzilla query returns all the bugs fixed in nss 3.50: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_miles...
NSS 3.51 release notes
are available in nss releases. notable changes in nss 3.51 updated dtls 1.3 implementation to draft-34. see bug 1608892 for details. bugs fixed in nss 3.51 bug 1608892 - update dtls 1.3 implementation to draft-34. bug 1611209 - correct swapped pkcs11 values of ckm_aes_cmac and ckm_aes_cmac_general bug 1612259 - complete integration of wycheproof ecdh test cases bug 1614183 - check if p
pc __has_include(<sys/auxv.h>) bug 1614786 - fix a compilation error for ‘getfipsenv’ "defined but not used" bug 1615208 - send dtls version numbers in dtls 1.3 supported_versions extension to avoid an incompatibility. bug 1538980 - secu_readderfromfile calls strstr on a string that isn't guaranteed to be null-terminated bug 1561337 - correct a warning for comparison of integers of different...
NSS 3.52 release notes
ace for aes-gcm and chachapoly. bug 1612493 - integrate avx2 chacha20, poly1305, and chacha20poly1305 from hacl*. bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation. bug 1630721 - add softoken functions for fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files. bug 1629663 - add ikev1 quick mode kdf. bug 1629661 - m
pconfig calls in ssl initialize policy before nss is initialized. bug 1629655 - support temporary session objects in ckfw. bug 1629105 - add pkcs11 v3.0 functions to module debug logger. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit declaration of function 'getopt' error. bug 1624864 - allow building of gcm-arm32-neon on non-armv7 archite...
PKCS11 FAQ
ecuring, or does nss expect it to be added in its private key database to use it? while certificates may be read into the temporary database, private keys are never extracted from the pkcs #11 module unless the user is trying to back up the key. nss represents each private key and a pointer to its pkcs #11 slot as a ck_object_handle. when nss needs to do anything with a private key, it calls the
pcks #11 module that holds the key. if a pkcs #11 library reports that, for example, it does not support rsa signing operations, does nss expect to be able to pull an rsa private key off the token using the c_getattributevalue call and then do the operation in software? no. nss will never try to pull private keys out of tokens (except as wrapped objects for pkcs #12). operations the token does not...
sslintro.html
completion. functions used by callbacks an ssl application typically provides one or more callback functions that are called by the ssl or pkcs #11 library code under certain circumstances. ...
NSS Tools modutil
less an equivalentplatform attribute is specified. the platform string is in the following format: system name:os release:architecture. the installer obtains these values from nspr. os release is an empty string on non-unix operating systems. the following system names and platforms are currently defined by nspr: aix (rs6000) bsdi (x86) freebsd (x86) hpux (hppa1.1) irix (mips) linux (p
pc, alpha, x86) macos (power
pc) ncr (x86) nec (mips) os2 (x86) osf (alpha) reliantunix (mips) sco (x86) solaris (sparc) sony (mips) sunos (sparc) unixware (x86) win16 (x86) win95 (x86) winnt (x86) here are some examples of valid platform strings: irix:6.2:mipssunos:5.5.1:sparclinux:2.0.32:x86win95::x86. per-platform keys these keys have meaning only within the val...
NSS Tools pk12util-tasks
nss security tools: pk12util tasks newsgroup: mozilla.dev.tech.crypto task list need to migrate code to use an up-to-date version of nss. use nss functions in
pcertdb for handling older database ...
Necko FAQ
anted to know about the networking library in mozilla... and did ask. what is necko? a word rhyming with gecko and starting with the same letters as networking. that's all! any resemblance in flavor to the necco candy is purely coincidental. what do i need to build this library? see the code section on the main page. currently you'd need to get the mozilla tree and at least build nspr, and x
pcom. todo put links! how does psm fit into this picture? todo how does the proxy support work? todo what about proxy auto config? todo what about socks support? todo when is the next stable release of this library going to be available? todo i'd like to use this library for my project. what licences apply? todo - mpl what do the page load options mean in the preferences? todo ...
Installing Pork
test ${host_system} = sys_cygwin; then if you don't do this, mcpp will get the wrong set of automatic definitions and you'll end up with an unpleasant hybrid x86-64/i686 build system. $ export path=/builds/gcc-3.4.6-installed/bin:$path $ export cppflags=-m32 $ cc=gcc34 cxx=g++34 cppflags=-m32 ldflags=-m32 ../src/configure --enable-replace-cpp --prefix=/builds/gcc-3.4.6-installed --target=i686-
pc-linux $ make $ make install program_transform_name= ...
SpiderMonkey compartments
rbage collection we shortcut having to walk unrelated heap areas of a window or tab that triggered a garbage collection. see also js_newcompartmentandglobalobject() js_entercrosscompartmentcall() js_leavecrosscompartmentcall() jsautocompartment invariants spidermonkey internals: thread safety andreas gal blog post bobby holley blog post sfink/contexts_and_compartments x
pconnect security membranes ...
Index
c behavior of javascript values, a standard library implementing ecma 262-5.1 §15 with various extensions, and a few public apis. 528 64-bit compatibility spidermonkey the following types or typedefs are always 64-bit on 64-bit platforms, and 32-bit on 32-bit platforms: 529 bytecode descriptions spidermonkey this document is automatically generated from o
pcodes.h by make_o
pcode_doc.py. 530 bytecodes spidermonkey spidermonkey bytecodes are the canonical form of code representation that is used in the javascript engine. the javascript frontend constructs an ast from the source text, then emits stack-based bytecodes from that ast as a part of the jsscript data structure. bytecodes can reference atoms and objects (typically by array...
Bytecodes
en add, then push c, then add, which requires a maximum depth of two expression slots. there are also some slots reserved for dedicated functionality, holding values like this and the callee / return value. there is always a "top of stack" (tos) that corresponds to the latest value pushed onto the expression stack. all bytecodes implicitly operate in terms of this location. bytecode listing all o
pcodes are annotated with a [-po
pcount, +pushcount] to represent the overall stack-effects their execution. bytecode listing was moved to spidermonkey internals: bytecode descriptions page. ...
JS::AutoVectorRooter
bool appendall(const autovectorrooter<t> &other) appends all elements of other to the array. bool insert(t *p, const t &val) inserts an element val at the position specified by p. void infallibleappend(const t &v) appends an element v to the array. for use when space has already been reserved. void popback() pops an element from the array. t po
pcopy() pops an element from the array and returns it. bool growby(size_t inc) grows the array by inc. bool resize(size_t newlength) resizes the array to newlength. void clear() clears all elements. bool reserve(size_t newlength) reserves the array with newlength. js::mutablehandle<t> operator[](size_t i) returns to the i-th element as j...
JSClass.flags
jsclass_has_private this class uses private data. 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. the private field of each object of this class points to an x
pcom object (see nsisupports). this is only meaningful if spidermonkey is built with x
pconnect and the jsclass_has_private flag is also set. mxr id search for jsclass_private_is_nsisupports jsclass_is_domjsclass added in spidermonkey 17 objects are dom. mxr id search for jsclass_is_domjsclass jsclass_emulates_undefined added in spidermonke...
JS_SetOptions
e two scripts "x = 1" and "var x = 1", where no variable x is in scope, do two different things. the former creates a property on the global object. the latter creates a property on obj. with this flag, both create a global property. mxr id search for jsoption_varobjfix jsoption_private_is_nsisupports mozilla extension. the context's private data points to an x
pcom object (see nsisupports). this is only meaningful if spidermonkey is built with x
pconnect. mxr id search for jsoption_private_is_nsisupports jsoption_compile_n_go caller of js_compilescript et al promises to execute the compiled script once only, in the same scope object used for compilation. the caller may not modify objects on the scope chain between compila...
Shell global objects
l: don't depend upon them unless you're willing to update your code if these experimental apis change underneath you. functions available if --fuzzing-safe is not specified clone(fun[, scope]) clone function object. getselfhostedvalue() get a self-hosted value by its name. note that these values don't get cached, so repeatedly getting the same value creates multiple distinct clones. line2
pc([fun,] line) map line number to
pc.
pc2line(fun[,
pc]) map
pc to line number. nestedshell(shellargs...) execute the given code in a new js shell process, passing this nested shell the arguments passed to nestedshell. argv[0] of the nested shell will be argv[0] of the current shell (which is assumed to be the actual path to the shell. arguments[0] (of the call to nestedshell) will be argv[1],...
WebReplayRoadmap
parallelism without impacting users. the cloud should not be the only option by which people can use web replay, however. all features should be accessible to users operating locally. while cloud integration is not in placer, web replay's architecture has recently been redesigned in preparation for cloud support, and communicating with replaying processes over a network connection instead of i
pc should work pretty efficiently. recording firefox ui (partially implemented) right now only content tabs can be recorded and replayed. firefox's ui and privileged code is largely written in js, and it would be nice to be able to use web replay to help debug and develop firefox itself, for better dogfooding and gathering internal feedback. this is partially underway and is tracked in bug 15215...
Using the Places keywords API
the add keyword for this search contextual menu option in form text fields. note this is the same feature previously known as bookmark keywords, the key difference is that keywords are not bound to a specific bookmark, but to a specific url. using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/x
pcomutils.jsm"); x
pcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an url the insert() method accepts a keyword entry object describing the keyword to insert. it has the following properties: keyword: string representing the keyword url: either a url or spec represeting the url to associate to postdata: optional post data ...
Preferences API
, including support for default preferences, user overrides via user.js, and locking. you can also create a xul-based options window easily to allow user modify some preferences. many applications including firefox and thunderbird have an additional tool for power users, about:config, which can be used to tweak the preferences without ui. interfaces the preferences api is exposed as a set of x
pcom components and interfaces: nsiprefservice, nsiprefbranch. ... see also code snippets:preferences (more detailed discussion with multiple examples) ...
extIExtension
method overview fixme: attributes attribute type description id readonly attribute astring the id of the extension. ...
extIPreferenceBranch
branch. the root branch is set based on the context of the owner. for example, an extension's preferences has a root of "extensions.extensionid.", while the application-level preferences have an empty root. all preference "aname" parameters used in this interface are relative to the root branch. extipreferencebranch is defined in toolkit/components/exthelper/extiapplication.idl. implemented via x
pcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages. method overview boolean has(in astring aname) extipreference get(in astring aname) nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) void setvalue(in astring aname, in nsivariant avalue) void reset() attr...
extISessionStorage
method overview these methods are usually accessed via application.storage. ...
XML Extras
the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds. ...
Binary compatibility
new compiler without recompiling everything. effectively, it is a different platform. what does this mean to you? if you build a component and it works fine in version 1.0 of mozilla. if and when mozilla upgrades the compiler they use, your component will have to be rebuilt against the same compiler. when you see a @status frozen, note that this means it should work as long as the component and x
pcom are built with the same compiler abi. for more information on issues of componentization and binary compatibility, see http://mozilla.org/projects/x
pcom/gl...ent_reuse.html . comments and questions should be directed to the newsgroup, mozilla.dev.tech.x
pcom, or the mailing list, mozilla-x
pcom@mozilla.org. ...
mozilla::services namespace
to use it, you first need to include the header into your c++ file: #include "mozilla/services.h" then you can obtain references to services by simply accessing them from the mozilla::services namespace. ...
Components.classesByID
components.classesbyid is a read-only object whose properties are classes indexed by cid. introduction components.classesbyid is a read-only object whose properties implement the nsijscid interface. each property represents one of the classes of x
pcom components that can be constructed or accessed as an x
pcom service. components.classesbyid is exactly like components.classes except that the elements are indexed by the canonical form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid. usage in order to retrieve the object for a given cid, you can use that cid as an index with components.classesbyid as follows: var clazz = components.classesbyid["{ed13...
Components.interfaces
components.interfaces is a read-only object whose properties are interfaces indexed by their names. introduction components.interfaces is a read-only object whose properties implement the nsijsiid interface. each object represents one of the x
pcom interfaces -- that some component or another might or might not implement. it reflects only those interfaces which have been designated in their .idl description as scriptable, that is the interfaces which x
pconnect is capable of reflecting into javascript. properties of the components.interfaces object are used where x
pcom methods expect a parameter of type nsid. this includes nsisupports.queryinterface(), the optional parameter accepted by nsijscid.getservice(), nsijscid.createinstance() when called from javascript, and nsiclassinfo.ge...
Components.interfacesByID
components.interfacesbyid is a read-only array of classes indexed by iid. introduction components.interfacesbyid is a read-only array of objects which implement the nsijsiid interface. each object represents one of the x
pcom interfaces -- that some component or another might or might not implement. it reflects only those interfaces which have been designated in their .idl description as [scriptable], i.e. the interfaces which x
pconnect is capable of reflecting into javascript. components.interfacesbyid is exactly like components.interfaces except that the elements are indexed by the canonical form of their iid. usage you can retrieve an interface object using: var iface = components.interfacesbyid["{aa610f20-a889-11d3-8c81-000064657374}"]; ...
Components.isSuccessCode
summary determines whether a given x
pcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively. syntax var succeeded = components.issuccesscode(returncode); parameters returncode the return code (of type nsresult) to be checked. description components.issuccesscode() may be used to determine whether an x
pcom return code (an nsresult) indicates success or failure. an x
pcom return code indicates success if its high-order bit is 0, and it indicates failure if its high-order bit is 1. note: a non-zero x
pcom return code (that is, not ns_ok) does not necessarily indicate failure. components.issuccesscode() is functionally equivalent to the following javascript: function issuccesscode(returncode) { re...
Components.utils.Sandbox
vanilla" view of the other. the protection is bidirectional: the caller sees the bonafide dom objects without being confused by sneakily-redefined properties, and the target receives appropriate privacy from having its expandos inspected by untrusted callers. in situations where only unidirectional protection is needed, callers have the option to waive the x-ray behavior using wrappedjsobject or x
pcnativewrapper.unwrap(). in general, when accessing same-origin content, script gets a transparent wrapper rather than an xray wrapper. however, sandboxes are often used when chrome wants to run script as another origin, possibly to interact with the page. in this case, same-origin xrays are desirable, and wantxrays should be set to true. see safely accessing content dom from chrome for more de...
Other Resources
other resources embedding mozilla x
pconnect - javascript-x
pcom bridge blackconnect - java-x
pcom bridge (no longer supported) xpidl to java types - from blackconnect ...
Community
if you know of useful mailing lists, newsgroups, forums, or other communities related to pyx
pcom, please link to them here. activestate python x
pcom bindings mailing list discussion of the bindings between the python language and the x
pcom (cross-platform com) technology from the mozilla project. #pyx
pcom on irc.mozilla.org chat with other pyx
pcom developers on mozilla's irc network. ...
Architecture basics
x
pcom is like com, for windows. it lets you get pointers to components inside mozilla, and it lets you talk about their interfaces as well. x
pconnect is what lets javascript talk with mozilla guts, the x
pcom system. you can imagine it like a bridge between javascript code, and mozilla guts. x
pcshell is a command line interface to mozilla javascript. it's an interactive interpreter -- it gives you a shell that talks straight to mozilla, via javascript's x
pconnect bridge into it. ...
appShellService
quitting mozilla: var cc = components.classes; var ci = components.interfaces; shell = cc["@mozilla.org/appshell/appshellservice;1"]; shell = shell.getservice(ci.nsiappshellservice); shell.quit(3); // eforcequit bam! there goes mozilla. then again, there's a much easier way; one of the x
pcshell extensions is a quit function: quit(3) ...
Monitoring HTTP activity
yobserver interface within your code. this is very simple, requiring you to implement a single method, nsihttpactivityobserver.observeactivity(), which gets called each time an action of interest takes place on the http channel. ...
nsCategoryManager
« x
pcom api reference summary the x
pcom category manager. class id 16d222a6-1dd2-11b2-b693-f38b02c021b2 contractid @mozilla.org/categorymanager;1 supported interfaces nsicategorymanager remarks this component is a singleton and should therefore be accessed via the x
pcom service manager. ...
nsDirectoryService
« x
pcom api reference summary the x
pcom directory service. this service returns the locations of "well known" directories in an os-independent manner. for instance, it can give you the path of the system's temporary directory, desktop directory, current working directory, and so on. class id f00152d0-b40b-11d3-8c9c-000064657374 contractid @mozilla.org/file/directory_service;1 supported interfaces nsiproperties nsidirectoryservice remarks this component is a singleton and should therefore be accessed via the x
pcom service manager. example code #include "nsx
pcom.h" #include "nscomptr.h" #include "nsdirectoryservicedefs.h" #include "nsiservicemanager.h" #include "nsiproperties.h" /** * get the location of the system's "temp" directory. */ nsresult gettempd...
nsScriptableInputStream
« x
pcom api reference summary a component implementing nsiscriptableinputstream. class id 7225c040-a9bf-11d3-a197-0050041caf44 contractid @mozilla.org/scriptableinputstream;1 supported interfaces nsiscriptableinputstream, nsiinputstream remarks this component should be accessed via the x
pcom component manager. example code const nsiscriptableinputstream = components.interfaces.nsiscriptableinputstream; function consumestream(inputstream) { var factory = components.classes["@mozilla.org/scriptableinputstream;1"]; var sis = factory.createinstance(nsiscriptableinputstream); sis.init(inputstream); try { while (true) { var chunk = sis.read(512); if (chunk.length == 0) break; // ok, chunk now contains a portion of the stream's...
NS_GetMemoryManager
« x
pcom api reference summary the ns_getmemorymanager function returns a reference to the x
pcom memory manager. #include "nsx
pcom.h" #include "nsimemory.h" nsresult ns_getmemorymanager( nsimemory** aresult ); parameters aresult [out] a reference to the x
pcom memory manager. return values the ns_getmemorymanager function returns ns_ok if successful. otherwise, it returns an error code. remarks the object returned is a singleton that is valid until ns_shutdownx
pcom is called. the interface pointer should be release'd when it is no longer needed. any code, intended to be used exclusively with mozilla 1.8 and above, may use ns_alloc, ns_realloc, and ns_free instead to access the x
pcom memory manager's methods. history this function was finalized for mozilla 0.9.7.
NS_NewLocalFile
this path does not need to reference an existing file. it is an error to pass a relative filesystem path. afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically resolve symbolic links. this parameter has no effect on unix systems. ...
NS_NewNativeLocalFile
this string should be encoded using ascii or the multibyte character coding corresponding to the native filesystem. this path does not need to reference an existing file. it is an error to pass a relative filesystem path. afollowlinks [in] this attribute will determine if the nsilocalfile instance will automatically resolve symbolic links. ...
NS_Realloc
« x
pcom api reference summary reallocates a block of memory using the x
pcom memory manager. #include "nsx
pcom.h" void* ns_realloc( void* aptr, prsize asize ); parameters aptr [in] a pointer to the block of memory to reallocate. this pointer must have been previously allocated by the x
pcom memory manager, or this parameter may be null in which case this function behaves like ns_alloc. asize [in] the size in bytes of the block to allocate, or zero if the given block is to be freed. return values this function returns a pointer to the allocated block of memory, which is suitably aligned for any kind of variable, or null if the allocation failed. remarks this function provides a convenient way to access the x
pcom memory manager. it is equivalent to calling reall...
nsEmbedString
nsembedstring(); explicit nsembedstring( const self_type& astring ); parameters astring [in] a nsembedstring to copy into this string. nsembedstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsastring to copy into this string. explicit nsembedstring( const abstract_string_type& aabstractstring ); parameters aabstractstring [in] a nsastring to copy into this string. explicit nsembedstring( const char_type* adata, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. ...
operator=
self_type& operator=( const self_type& astring ); parameters astring [in] a nsembedstring to append to this string. return values this operator returns a reference back to the object being modified to allow operator chaining. self_type& operator=( const abstract_string_type& astring ); parameters astring [in] a nsastring to append to this string. return values this operator returns a reference back to the object being modified to allow operator chaining. self_type& operator=( const char_type* adata ); parameters adata [in] a raw character array to append to this string. ...
Alloc
static void* alloc( size_t asize ); parameters asize [in] specifies the size in bytes of the block of memory to allocate. return values this function is infallible, therefore guaranteed to return a pointer to the newly allocated buffer. the result must be freed with a call to nsmemory::free() when it is no longer needed. note: prior to gecko 13.0, this function returned nsnull if memory allocation failed. ...
Clone
static void* clone( const void* aptr, size_t asize ); parameters aptr [in] the address of the memory block to copy. this must be non-null. asize [in] specifies the new size in bytes of the block of memory to allocate. the buffer at aptr must be at least asize bytes in length. return values this function returns nsnull if the memory allocation fails. otherwise, it returns a pointer to the newly allocated buffer. the result must be freed with a call to nsmemory::free when it is no longer needed. ...
Free
static void free( void* aptr ); parameters aptr [in] the address of the memory block to free. this may be nsnull, in which case nothing happens. ...
GetGlobalMemoryService
static nsimemory* getglobalmemoryservice(); return values this function returns nsnull if the global memory manager does not exist or could not be initialized. remarks this function returns the same value as the ns_getmemorymanager function. ...
HeapMinimize
static nsresult heapminimize( prbool aimmediate ); parameters aimmediate [in] if true, heap minimization will occur immediately if the call was made on the main thread. if false, the flush will be scheduled to happen when the app is idle. return values this function return ns_ok if successful. otherwise, it returns an error code. ...
Realloc
static void* realloc( void* aptr, size_t asize ); parameters aptr [in] the address of the memory block to reallocate. this may be nsnull, in which case realloc behaves like nsmemory::alloc. asize [in] specifies the new size in bytes of the block of memory to allocate. this may be 0, in which case realloc behaves like nsmemory::free. return values this function returns nsnull if the memory allocation fails. otherwise, it returns a pointer to the newly allocated buffer. the result must be freed with a call to nsmemory::free when it is no longer needed. remarks if aptr is non-null, then its contents will be unchanged to the minimum of the old and new sizes. ...
IDispatch
js/src/x
pconnect/idl/x
pcidispatch.idlscriptable this interface is not to be used directly, it is to be used internally for x
pconnect's idispatch support. inherits from: nsisupports last changed in gecko 1.7 ...
jsdIStackFrame
isnative boolean true if stack frame represents a native frame. read only. obsolete since gecko 2.0 jsdcontext jsdcontext internal use only. read only. native code only! jsdstackframeinfo jsdstackframeinfo internal use only. read only. native code only! jsdthreadstate jsdthreadstate internal use only. read only. native code only! line unsigned long current line number (using the script's
pc to line map.) read only.
pc unsigned long current program counter in this stack frame. read only. scope jsdivalue top object in the scope chain. read only. script jsdiscript script running in this stack frame, null for native frames. read only. thisvalue jsdivalue |this| object for this stack frame. read only. methods eval() evaluate arbitrary javascript in this stack frame. boolean ev...
mozIJSSubScriptLoader
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 28 (firefox 28 / thunderbird 28 / seamonkey 2.25 / firefox os 1.3) implemented by: @mozilla.org/moz/jssubscript-loader;1. to get this service, use: var mozijssubscriptloader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code. ...
mozIStorageStatementWrapper
the mozistoragestatementwrapper interface is a storage statement wrapper. when you call the mozistorageconnection interface's createstatement() method, you get a mozistoragestatement which has just direct bindings to sqlite. you can then wrap that statement with a wrapper, which implements nsix
pcscriptable and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc. firefox 3.5 note firefox 3.5 adds support for these features directly into the mozistoragestatement interface, so this interface is essentially deprecated. storage/public/mozistoragestatementwrapper.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits f...
mozIThirdPartyUtil
oolean isthirdpartychannel(in nsichannel achannel, [optional] in nsiuri auri); boolean isthirdpartyuri(in nsiuri afirsturi, in nsiuri aseconduri); boolean isthirdpartywindow(in nsidomwindow awindow, [optional] in nsiuri auri); methods isthirdpartychannel() determine whether the given channel and its content window hierarchy is third party. this is done as follows: if achannel is an nsihtt
pchannel and has the 'forceallowthirdpartycookie' property set, then: if auri is null, return false. otherwise, find the uri of the channel, determine whether it is foreign with respect to auri, and return. find the uri of the channel and determine whether it is third party with respect to the uri of the channel. if so, return. obtain the bottommost nsidomwindow, and its same-type parent if it ex...
nsIAbCard
cellularnumber astring workphonetype astring homephonetype astring faxnumbertype astring pagernumbertype astring cellularnumbertype astring homeaddress astring homeaddress2 astring homecity astring homestate astring homezi
pcode astring homecountry astring workaddress astring workaddress2 astring workcity astring workstate astring workzi
pcode astring workcountry astring jobtitle astring department astring company astring aimscreenname...
nsIAccelerometerUpdate
method overview void accelerationchanged(in double x, in double y, in double z); methods accelerationchanged() void accelerationchanged( in double x, in double y, in double z ); parameters x y z the coordinates of the nsiacceleration data. ...
innerHTML
for the dom property, see element.innerhtml. for the x
pcom interface attribute, see nsiaccessnode.attributes. ...
nsIAccessibleEvent
.2, even though the constant existed. event_page_changed 0x005a 0x0056 a slide changed in a presentation document or a page boundary was crossed in a word processing document. event_last_entry 0x005d 0x0057 help make sure event map does not get out-of-line. ...
nsIAlertsService
ification id. dir optional bidi override for the title. valid values are "auto", "ltr" or "rtl". only available on supported platforms. lang optional language of title and text of the alert. only available on supported platforms. data optional the value of the cookie parameter passed to showalertnotification. principal optional the principal of the page that created the alert. used for i
pc security checks, and to determine whether the alert is actionable. inprivatebrowsing optional controls the image loading behavior. if true, the image url will be loaded in private browsing mode. exceptions thrown ns_error_not_available unable to display the notification; this may happen, for example, on mac os x if growl is not installed. example simple usage the following code was us...
nsIArray
inherits from: nsisupports last changed in gecko 1.7 an indexed collection of elements. provides basic functionality for retrieving elements at a specific position, searching for elements. indexes are zero-based, such that the last element in the array is stored at the index length-1. for an array which can be modified, see nsimutablearray. neither interface makes any attempt to protect the individual elements from modification. the convention is that the elements of the array should not be modified. documentation within a specific interface should describe variations from this convention. ...
nsIAsyncInputStream
inherits from: nsiinputstream last changed in gecko 1.7 if an input stream is non-blocking, it may return ns_base_stream_would_block when read. the caller must then wait for the stream to have some data to read. if the stream implements nsiasyncinputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes readable or closed (via the asyncwait() method). while this interface is almost exclusively used with non-blocking streams, it is not necessary that nsiinputstream.isnonblocking() return true. nor is it necessary that a non-blocking nsiinputstream implementation also implement nsiasyncinputstream. ...
nsIAsyncOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 if an output stream is non-blocking, it may return ns_base_stream_would_block when written to. the caller must then wait for the stream to become writable. if the stream implements nsiasyncoutputstream, then the caller can use this interface to request an asynchronous notification when the stream becomes writable or closed (via the asyncwait() method). while this interface is almost exclusively used with non-blocking streams, it is not necessary that nsioutputstream.isnonblocking() return true. nor is it necessary that a non-blocking nsioutputstream implementation also implement nsiasyncoutputstream. ...
nsIBinaryInputStream
this might be used, for example, to implement network protocols or to read from architecture-neutral disk files, that is ones that can be read and written by both big-endian and little-endian platforms. ...
nsIBinaryOutputStream
this might be used, for example, to implement network protocols or to produce architecture-neutral binary disk files, that is ones that can be read and written by both big-endian and little-endian platforms. output is written in big-endian order (high-order byte first), as this is traditional network order. ...
nsIBlocklistPrompt
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 void prompt([array, size_is(acount)] in nsivariant aaddons, [optional] in pruint32 acount); methods prompt() prompt the user about newly blocked addons. the prompt is then responsible for soft-blocking any addons that need to be afterwards. ...
nsIBlocklistService
x
pcom/system/nsiblocklistservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 29 (firefox 29 / thunderbird 29 / seamonkey 2.26) method overview unsigned long getaddonblockliststate(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); unsigned long getpluginblockliststate(in nsiplugintag plugin, [optional] in astring appversion, [optional] in astring toolkitversion); boolean isaddonblocklisted(in jsval addon, [optional] in astring appversion, [optional] in astring toolkitversion); constants constant value description state_not_blocked 0 state_softblocked 1 ...
nsICategoryManager
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/categorymanager;1. ...
nsIChannelEventSink
ldchannel, in nsichannel newchannel, in unsigned long flags ); parameters oldchannel the channel that's being redirected. newchannel the new channel. this channel is not opened yet. flags flags indicating the type of redirect. a bitmask consisting of flags from above. one of redirect_temporary and redirect_permanent will always be set. see also nsichannel nsihtt
pchannel ...
nsICollection
it provides basic operations on those items like: getting, setting, appending, removing, and so on. inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection. ...
nsIComponentManager
x
pcom/components/nsicomponentmanager.idlscriptable this interface provides methods to access factory objects and instantiate instances of classes. 66 introduced gecko 0.7 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) method overview void addbootstrappedmanifestlocation(in nsilocalfile alocation); void createinstance(in nscidref aclass, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void createinstancebycontractid(in string acontractid, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); void getclassobject(in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result)...
nsIConsoleListener
inherits from: nsisupports last changed in gecko 1.7 method overview void observe(in nsiconsolemessage amessage); methods observe() called by the nsiconsoleservice when a message is posted to the console. listeners must first be attached to the service using nsiconsoleservice.registerlistener() void observe( in nsiconsolemessage amessage ); parameters amessage the nsiconsolemessage being posted. ...
nsIConsoleMessage
inherits from: nsisupports last changed in gecko 1.7 implementations may provide an object that can be query interfaced, nsisupports.queryinterface(), to provide more specific message information. see nsiscripterror for an example. attributes attribute type description message wstring the message in a string format. [binaryname(messagemoz)] read only. ...
nsIConsoleService
it is used to log various messages, warnings, and errors and to obtain the logged messages. ...
nsIConverterInputStream
this allows reading unicode strings from a stream, automatically converting the bytes from a selected character encoding. 1.0 66 introduced gecko 1.8 inherits from: nsiunicharinputstream last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-input-stream;1. ...
nsIConverterOutputStream
1.0 66 introduced gecko 1.8 inherits from: nsiunicharoutputstream last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-output-stream;1. to create an instance, use: var converteroutputstream = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); method overview void init(in nsioutputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter); methods init() initialize this stream. ...
nsICookieConsent
to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void getconsent(); methods getconsent() gives a decision on what should be done with a cookie, based on a site's p3p policy and the user's preferences. the policy for the given uri and channel is also returned. nscookiestatus getconsent( in nsiuri uri, in nsihtt
pchannel htt
pchannel, in boolean isforeign, out nscookiepolicy policy ); parameters uri the uri to find the policy for. htt
pchannel the channel to extract the p3p headers from. isforeign true if the cookie originates from a third-party site. this is used to decide the cookie status based on user preferences. policy the policy for the given uri, or nsicookie::policy_unknown...
nsICrashReporter
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void annotatecrashreport(in acstring key, in acstring data); void appendappnotestocrashreport(in acstring data); void appendobjcexceptioninfotoappnotes(in voidptr aexception); native code only! void writeminidumpforexception(in voidptr aexceptioninfo); native code only! attributes attribute type description enabled boolean enable or disable the crashreporter at runtime. ...
nsICycleCollectorListener
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the order of calls will be call to begin(); then for every node in the graph a call to noteobject() and calls to noteedge() for every edge starting at that node; then a call to begindescriptions(); then for every black node in the cycle collector graph a call to either describerefcountedobject() or to describegcedobject(); and then a call to end(). if begin() returns an error none of the other functions will be called. ...
nsIDNSListener
netwerk/dns/nsidnslistener.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.7 method overview void onlooku
pcomplete(in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus); methods onlooku
pcomplete() called when an asynchronous host lookup completes. void onlooku
pcomplete( in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus ); parameters arequest the value returned from asyncresolve. arecord the dns record corresponding to the hostname that was resolved. this parameter is null if there was an error. astatus if the lookup failed, this parameter gives the reason. ...
nsIDeviceMotion
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 nsidevicemotion prior to gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3). ...
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). attributes attribute type description type unsigned long the type of motion data reported by 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. ...
nsIDeviceMotionListener
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void onmotionchange(in nsidevicemotiondata amotiondata); methods onmotionchange() called when new orientation or acceleration data is available. void onmotionchange( in nsidevicemotiondata amotiondata ); parameters aacceleration the nsidevicemotiondata object describing updated motion information. ...
nsIDictionary
objects can be located and managed by referencing them by key. 66 introduced gecko 1.0 obsolete gecko 1.9.1 inherits from: nsisummary last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this interface was removed in firefox 3.5; use dict.jsm instead. see bug 668424 for further information. ...
nsIDirectoryEnumerator
it is similar to nsisimpleenumerator except the retrieved entries are qi'ed to nsifile, and there is a mechanism for closing the directory when the enumeration is complete. 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 close(); attributes attribute type description nextfile nsifile the next file in the sequence. the nextfile attribute is the first element upon the first call. this attribute is null if there is no next element. read only. ...
nsIDirectoryIterator
the nsidirectoryiterator interface provides a way to iterate over the entries in a directory. x
pcom/obsolete/nsifilespec.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in nsifilespec parent, in boolean resolvesymlink); boolean exist(); void next(); attributes attribute type description currentspec nsifilespec init() void init( in nsifilespec parent, in boolean resolvesymlink ); parameters parent resolvesymlink exist() boolean exists(); next() void next(); ...
nsIDirectoryServiceProvider
inherits from: nsisupports last changed in gecko 1.7 nsidirectoryserviceprovider. method overview nsifile getfile(in string prop, out prbool persistent); methods getfile() the directory service calls this method when it gets the first request for a prop or on every request if the prop is not persistent. nsifile getfile( in string prop, out prbool persistent ); parameters prop the symbolic name of the file. persistent true if the returned file will be cached by directory service. subsequent requests for this prop will bypass the provider and use the cache. false if the provider will be asked for this prop each time it is requested. ...
getFiles
nsisimpleenumerator getfiles( in string aname ); parameters aname [in] the symbolic name for an enumeration of file or directory locations. return values the elements of the returned nsisimpleenumerator instance must support nsifile and may support nsilocalfile. ...
nsIDirectoryServiceProvider2
x
pcom/io/nsidirectoryservice.idlscriptable an extension of nsidirectoryserviceprovider which allows multiple files to be returned for the given key. inherits from: nsidirectoryserviceprovider last changed in gecko 0.9.6 method overview nsisimpleenumerator getfiles(in string prop); methods getfiles() the directory service calls this when it gets a request for a prop and the requested type is nsisimpleenumerator. nsisimpleenumerator getfiles( in string prop ); parameters prop the symbolic name of the file list. return value an enumerator for a list of file locations. the elements in the enumeration are nsifile. use an x
pcom return code of ns_success_aggregate_result if this result should be aggregated with other "lower" providers. if you are implementing this from js...
nsIDispatchSupport
inherits from: nsisupports last changed in gecko 1.7 method overview void comvariant2jsval(in comvariantptr comvar, out jsval val); unsigned long gethostingflags(in string acontext); boolean isclassmarkedsafeforscripting(in nscidref cid, out boolean classexists); boolean isclasssafetohost(in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists); boolean isobjectsafeforscripting(in voidptr theobject, in nsiidref id); void jsval2comvariant(in jsval var, out comvariant comvar); methods comvariant2jsval() converts a com variant to a jsval. ...
nsIEnvironment
inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/process/environment;1 as a service: var env = components.classes["@mozilla.org/process/environment;1"]. getservice(components.interfaces.nsienvironment); method overview void set(in astring aname, in astring avalue); astring get(in astring aname); boolean exists(in astring aname); methods set() set the value of an environment variable. void set( in astring aname, in astring avalue ); parameters aname the variable name to set. avalue the value to set. get() get the value of an environment variable. ...
nsIEventListenerService
introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/eventlistenerservice;1. to create an instance, use: var eventlistenerservice = components.classes["@mozilla.org/eventlistenerservice;1"] .getservice(components.interfaces.nsieventlistenerservice); universalx
pconnect privileges are required to use this service. method overview void geteventtargetchainfor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsidomeventtarget aoutarray); void getlistenerinfofor(in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out n...
nsIEventTarget
events may be sent to this target from any thread by calling the dispatch method. implement this interface in order to support receiving events from other threads. ...
nsIException
inherits from: nsisupports last changed in gecko 1.7 method overview string tostring(); attributes attribute type description columnnumber pruint32 valid column numbers begin at 0. there is no unambiguous indicator for unknown. read only. data nsisupports arbitary data for the implementation. read only. filename string 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. ...
nsIFTPEventSink
the nsiftpeventsink is an extension of nsisupports. it can be used as a notification callback on an ftp channel. netwerk/protocol/ftp/nsift
pchannel.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onft
pcontrollog(in boolean server, in string msg) methods onft
pcontrollog allows a consumer to receive a log of the ftp control connection conversation. void onft
pcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client. msg a string holding response of the last command which had been sent. ...
nsIFactory
inherits from: nsisupports last changed in gecko 0.9.5 method overview void createinstance(in nsisupports aouter, in nsiidref iid, [retval, iid_is(iid)] out nsqiresult result); void lockfactory(in prbool lock); methods createinstance() creates an instance of the class associated with this factory. unlike getservice, this returns a new instance each time it is called. ...
nsIFrameLoaderOwner
content/base/public/nsiframeloader.idlscriptable represents the owner of an nsiframeloader. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview [noscript, notx
pcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner. read only. methods getframeloader() returns the frame loader object owned by this object. [noscript, notx
pcom] alreadyaddrefed_nsframeloader getframeloader(); parameters none. return value the nsiframeloader owned by this ...
nsIGSettingsCollection
x
pcom/system/nsigsettingsservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview boolean getboolean(in autf8string key); long getint(in autf8string key); autf8string getstring(in autf8string key); void setboolean(in autf8string key, in boolean value); void setint(in autf8string key, in long value); void setstring(in autf8string key, in autf8string value); methods getboolean() boolean getboolean( in autf8string key ); parameters key return value getint() long getint( in autf8string key ); parameters key return value getstring() autf8string getstring( in autf8string key ); paramete...
nsIGSettingsService
x
pcom/system/nsigsettingsservice.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/gsettings-service;1 as a service: var gsettingsservice = components.classes["@mozilla.org/gsettings-service;1"] .createinstance(components.interfaces.nsigsettingsservice); method overview nsigsettingscollection getcollectionforschema(in autf8string schema); methods getcollectionforschema() nsigsettingscollection getcollectionforschema( in autf8string schema ); parameters schema return value ...
nsIGeolocationProvider
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) this must be called on the main thread interface provides location information to the nsgeolocator via the nsidomgeolocationcallback interface. after startup() is called, any geo location change should call callback.update(). the nsigeolocationprovider interface provides information about the current users location to interested parties via nsigeolocationupdate. after the provider has been initialized, any changes to location should call callback.onrequest(). ...
nsIGeolocationUpdate
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) interface provides a way for a geolocation provider to notify the system that a new location is available. method overview void update(in nsidomgeoposition position); methods update() notify the geolocation service that a new geolocation has been discovered. note: this must be called on the main thread. void update( in nsidomgeoposition position ); parameters position a nsidomgeoposition object describing the updated position information. ...
nsIHapticFeedback
x
pcom/system/nsihapticfeedback.idlscriptable implemented to provide support for haptic feedback (that is, vibration support). 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/widget/hapticfeedback;1 as a service: var hapticfeedback = components.classes["@mozilla.org/widget/hapticfeedback;1"] .getservice(components.interfaces.nsihapticfeedback); once you have the service, you can initiate haptic feedback (that is, cause the device to vibrate, if it's supported) by calling performsimpleaction(): hapticfeedback.performsimpleaction(components.interfaces.nsihapticfeedback.longpress); method overview void performsimpleaction(i...
nsIInputStream
inherits from: nsisupports last changed in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) an input stream may be "blocking" or "non-blocking" (see the isnonblocking() method). a blocking input stream may suspend the calling thread in order to satisfy a call to close(), available(), read(), or readsegments(). a non-blocking input stream, on the other hand, must not block the calling thread of execution. note: blocking input streams are often read on a background thread to avoid locking up the main application thread. for this reason, it is generally the case that a blocking input stream should be implemented using thread-safe addref and release. ...
nsIInputStreamCallback
inherits from: nsisupports last changed in gecko 1.7 method overview void oninputstreamready(in nsiasyncinputstream astream); methods oninputstreamready() called to indicate that the stream is either readable or closed. void oninputstreamready( in nsiasyncinputstream astream ); parameters astream the stream whose nsiasyncinputstream.asyncwait() method was called. ...
nsIInterfaceRequestor
inherits from: nsisupports last changed in gecko 0.9.5 this is similar to nsisupports.queryinterface(). the main difference is that interfaces returned are not required to provide a way back to the object implementing nsiinterfacerequestor. the semantics of nsisupports.queryinterface() dictate that given an interface a that you nsisupports.queryinterface() on to get to interface b, you must be able to nsisupports.queryinterface() on b to get back to a. nsiinterfacerequestor, however, allows you to obtain an interface c from a that may (or most likely) will not have the ability to get back to a. ...
nsIJSCID
inherits from: nsijsid last changed in gecko 1.7 method overview nsisupports createinstance(); nsisupports getservice(); methods createinstance() nsisupports createinstance(); parameters none. return value getservice() nsisupports getservice(); parameters none. return value see also see components.classes for usage patterns of the createinstance() and getservice() methods. ...
nsIJSIID
« x
pcom api reference summary [scriptable, uuid(e08dcda0-d651-11d2-9843-006008962422)] interface nsijsiid : nsijsid {}; ...
nsILocalFile
66 introduced gecko 1.0 deprecated gecko 14 inherits from: nsifile last changed in gecko 1.0 implemented by: @mozilla.org/file/local;1. ...
nsIMemory
x
pcom/base/nsimemory.idlscriptable this interface represents a generic memory allocator. inherits from: nsisupports last changed in gecko 0.9.6 nsimemory is used to allocate and deallocate memory segments from a heap. the implementation is free to define the heap. ns_getmemorymanager returns the global nsimemory instance. method overview voidptr alloc(in size_t size); violates the x
pcom interface guidelines void free(in voidptr ptr); violates the x
pcom interface guidelines void heapminimize(in boolean immediate); boolean islowmemory(); deprecated since gecko 2.0 voidptr realloc(in voidptr ptr, in size_t newsize); violates the x
pcom interface guidelines methods alloc allocates a block of memory of a particular size. voi...
nsIMemoryMultiReporter
1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9) if you want to gather multiple measurements in a single operation (such as a single traversal of a large data structure), you can use a multi-reporter to do so. the callback, which must implement the nsimemorymultireportercallback interface, receives values that match the fields in the nsimemoryreporter object. in order for a multi-reporter to gather and generate reports, you need to call collectreports(). ...
nsIMemoryMultiReporterCallback
1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview void callback(in acstring process, in autf8string path, in print32 kind, in print32 units, in print64 amount, in autf8string description, in nsisupports closure); methods callback() called to provide information from a multi-reporter. implement this method to handle the report information. ...
nsIMemoryReporter
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) any piece of code that wishes to allow its memory use to be monitored may create an nsimemoryreporter object and then register it by calling nsimemoryreportermanager.registerreporter(). once that has been done, the reporter will be found by any client accessing the enumerator returned by nsimemoryreportermanager.enumeratereporters(). this includes the about:memory page. note: this interface is undergoing heavy development, and is subject to rapid changes. ...
nsIMemoryReporterManager
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by @mozilla.org/memory-reporter-manager;1 as a service: var reportermanager = components.classes["@mozilla.org/memory-reporter-manager;1"] .getservice(components.interfaces.nsimemoryreportermanager); each memory reporter object, which implements nsimemoryreporter interface, provides information for a given code area. each code area is identified by a unique path string, which is displayed in about:memory. ...
nsIMimeConverter
converteroutputcallback output_fn, in void *closure); void encoderdestroy(in mimeencoderdata *data, in boolean abort_p); long encoderwrite(in mimeencoderdata *data, in string buffer, in long size); methods encodemimepartiistr() an variant of encodemimepartiistr_utf8() which treats the header as written in the given charset. this should only be used by native code, as x
pconnect translation causes it to not work properly. string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); parameters propertyname the name of the property to retrieve. return value the value...
nsIMsgAccountManagerExtension
the interface is basically a manifest and defines the properties of the new panel. a panel consists of a xul file with a page element as root element and the property file containing the localized name. note: the account manager relies on a very strong naming scheme to load and unload a panel. ...
nsIMsgCompFields
« x
pcom api reference summary the nsimsgcompfields interface provides properties for an composition of an outgoing message. properties attribute type description attachments char * obsolete attachments obsolete, do not use anymore attachmentsarray nsisupportsarray readonly attachvcard prbool bcc astring body astring bodyisasciionly prbool cc astring characterset char * defaultcharacterset char * readonly drafid char * dsn prbool fcc astring fcc2 astring followupto char * forcemsgencoding prbool forceplainte...
nsIMsgDBView
inherits from: nsisupports implemented by: @mozilla.org/messenger/msgdbview;1. to create an instance, use: var dbview = components.classes[@mozilla.org/messenger/msgdbview;1?type=] .createinstance(components.interfaces.nsimsgdbview); where type designates different types of view's available. ...
nsIMsgFilterCustomAction
*/ readonly attribute boolean isasync; /// does this action need the message body? readonly attribute boolean needsbody; }; ...
nsIMsgSearchSession
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 attribute for this term. op operator e.g. o
pcontains value value e.g. "dogbert" booleanand set to true if associated boolean operator is and. arbitraryheader user defined arbitrary header. ignored unless attrib = attribotherheader. createterm() nsimsgsearchterm createterm(); appendterm() void appendterm(in nsimsgsearchterm term); parameters term registerlistener() adds a listener to the search session. void registe...
nsIMsgWindow
ot the existing message pane and header should be cleared before the html is displayed. stopurls() this is equivalent to calling stop(nsiwebnavigation::stop_network) on the nsiwebnavigation object. void stopurls(); closewindow() when the msg window is being unloaded from the content window, this notification can be used to force a flush on anything the message window hangs on. for some reason x
pconnect is still hanging onto the message window even though all of our objects have let go of it. this forces a release. it clears out the content listener, the windowcommands, the statusfeedback and the docshell objects. void closewindow(); remarks see also ...
nsIMutableArray
inherits from: nsiarray last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) consumers of nsiarray should not queryinterface to nsimutablearray unless they own the array. as above, it is legal to add null elements to the array. note also that null elements can be created as a side effect of insertelementat(). conversely, if insertelementat() is never used, and null elements are never explicitly added to the array, then it is guaranteed that nsiarray.queryelementat() will never return a null value. ...
nsIObserverService
x
pcom/ds/nsiobserverservice.idlscriptable this interface provides methods to add, remove, notify, and enumerate observers of various notifications. inherits from: nsisupports last changed in gecko 0.9.6 the x
pcom nsobserverservice implements this interface to provide global notifications for a variety of subsystems. implemented by @mozilla.org/observer-service;1 as a service: var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); method overview void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak); nsisimpleenumerator enumerateobservers( in string atopic ); void notifyobservers( in nsisupports asubject, in string ato...
nsIOutputStream
inherits from: nsisupports last changed in gecko 1.0 an output stream may be "blocking" or "non-blocking" (see the isnonblocking() method). a blocking output stream may suspend the calling thread in order to satisfy a call to close(), flush(), write(), writefrom(), or writesegments(). a non-blocking output stream, on the other hand, must not block the calling thread of execution. note: blocking output streams are often written to on a background thread to avoid locking up the main application thread. for this reason, it is generally the case that a blocking output stream should be implemented using thread-safe addref and release. ...
nsIOutputStreamCallback
inherits from: nsisupports last changed in gecko 1.7 method overview void onoutputstreamready(in nsiasyncoutputstream astream); methods onoutputstreamready() called to indicate that the stream is either writable or closed. void onoutputstreamready( in nsiasyncoutputstream astream ); parameters astream the stream whose nsiasyncoutputstream.asyncwait() method was called. ...
nsIParentalControlsService
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 e
pclog_urivisit 1 this log entry type represents an access to web content. e
pclog_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...
nsIPipe
inherits from: nsisupports last changed in gecko 1.6 method overview void init(in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type description inputstream nsiasyncinputstream the pipe's input end, which also implements nsisearchableinputstream. read only. outputstream nsiasyncoutputstream the pipe's output end. read only. methods init() initialize this pipe. ...
nsIPrefBranch2
nch to hold a reference to the observer) and holds a reference to the branch object for the purpose of getting/setting preference values. there are 3 approaches which have been implemented in an attempt to avoid these situations: the nsprefbranch object supports nsisupportsweakreference. any consumer may hold a weak reference to it instead of a strong one. the nsprefbranch object listens for x
pcom-shutdown and frees all of the objects currently in its observer list. this ensures that long lived objects (services for example) will be freed correctly. the observer can request to be held as a weak reference when it is registered. this insures that shorter lived objects (say one tied to an open window) will not fall into the cyclical reference trap. the list of registered observers may be...
nsIProcess
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/process/util;1. ...
nsIProcess2
this expands upon the nsiprocess interface. 1.0 66 introduced gecko 1.9.1 obsolete gecko 1.9.2 inherits from: nsiprocess last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note this interface was removed in gecko 1.9.2 and its method added to nsiprocess. implemented by: @mozilla.org/process/util;1. ...
nsIProgrammingLanguage
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. ...
nsIProperty
inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description name astring get the name of the property. read only. value nsivariant get the value of the property. read only. ...
nsIThread
this interface provides a high-level abstraction for an operating system thread. threads have a built-in event queue, and a thread is an event target that can receive nsirunnable objects (events) to be processed on the thread. to create a thread, use the nsithreadmanager interface. x
pcom/threads/nsithread.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsieventtarget method overview void shutdown() boolean haspendingevents() boolean processnextevent(in boolean maywait) attributes attribute type description prthread prthread the nspr thread object corresponding to the nsithread. read only. methods shutdown() shuts down the thread. this causes event...
nsIThreadEventFilter
the nsithreadeventfilter interface may be implemented to determine whether or not an event may be accepted by a nested event queue; see nsithreadinternal.pusheventqueue() for more information. you should implement this interface and its acceptevent() method, then pass the object implementing it as the filter. x
pcom/threads/nsithreadinternal.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview boolean acceptevent(in nsirunnable event);violates the x
pcom interface guidelines methods violates the x
pcom interface guidelines acceptevent() this method is called to determine whether or not an event may be accepted by a nested event queue. (see nsithreadinternal.pusheventqueue()) ...
nsIThreadInternal
last changed in gecko 1.9 (firefox 3) inherits from: nsithread method overview void popeventqueue(); void pusheventqueue(in nsithreadeventfilter filter); attributes attribute type description observer nsithreadobserver get/set the current thread observer; set to null to disable observing. this attribute may be read from any thread but must only be set on the thread corresponding to this thread object. ...
nsIThreadManager
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsithread getthreadfromprthread(in prthread prthread); native code only! nsithread newthread(in unsigned long creationflags); attributes attribute type description currentthread nsithread the currently executing thread. ...
nsIThreadObserver
the nsithreadobserver interface may be implemented to let an observer implement a layered event queue. the implementation of this interface must be thread safe. x
pcom/threads/nsithreadinternal.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void afterprocessnextevent(in nsithreadinternal thread, in unsigned long recursiondepth); void ondispatchedevent(in nsithreadinternal thread); void onprocessnextevent(in nsithreadinternal thread, in boolean maywait, in unsigned long recursiondepth); methods afterprocessnextevent() called by the nsithread method nsithread.processnextevent() after an event is processed. this method is only called on the target thread. note...
nsIThreadPool
1.0 66 introduced gecko 1.9 inherits from: nsieventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) a thread pool provides a convenient way to process events off the main thread. when you send events to the thread pool, the pool creates a new thread to process the event, up to the number of threads specified by the threadlimit attribute. method overview void shutdown(); attributes attribute type description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive. ...
nsIThreadPoolListener
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void onthreadcreated(); void onthreadshuttingdown(); methods onthreadcreated() called when a new thread is created by the thread pool. the notification happens on the newly created thread. void onthreadcreated(); parameters none. onthreadshuttingdown() called when a new thread is about to be destroyed by the thread pool. ...
nsITimer
ed delay. note that the delay is approximate: the timer can be fired before the requested time has elapsed. nsitimer instances must be initialized by calling one of the initialization methods. you may also re-initialize (using one of the initialization methods) an existing instance to avoid the overhead of destroying and creating a timer. it is not necessary to cancel the timer in that case. x
pcom/threads/nsitimer.idlscriptable please add a summary to this article. last changed in gecko 5 (firefox 5 / thunderbird 5 / seamonkey 2.2) inherits from: nsisupports implemented by: @mozilla.org/timer;1. to create an instance, use: var timer = components.classes["@mozilla.org/timer;1"] .createinstance(components.interfaces.nsitimer); users of instances of nsitimer should ...
nsITimerCallback
inherits from: nsisupports last changed in gecko 1.7 method overview void notify(in nsitimer timer); methods notify() 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. ...
nsITraceableChannel
netwerk/base/public/nsitraceablechannel.idlscriptable this interface is used to allow intercepting of http traffic. it is implemented by nsihtt
pchannel. 1.0 66 introduced gecko 1.9.0.4 inherits from: nsisupports last changed in gecko 1.9.0.4 the typical way to use this interface is as follows: register for the "http-on-examine-response" notification to track all http responses; skip redirects (responsestatus = 3xx on nsihtt
pchannel), since otherwise you may end up with two listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistreamlistener (that passes the data to the original requester - e.g. to xmlhttprequest or to the browser tab that made the request) with your own implementat...
nsIURIFixupInfo
riginal input was broken as a url, e.g. "foo bar"!). read only. keywordprovidername astring the keyword search provider name expected to provide a keyword search; empty string if no keyword search is performed. read only. keywordassent astring the keyword used for the search (post trimming etc.); empty string if no keyword search is performed. read only. fixu
pchangedprotocol boolean if we changed the protocol; instead of using one raw from the input. read only. fixu
pcreatedalternateuri boolean if we created an alternative uri. potentially adding a prefix and/or suffix; set by the browser.fixup.alternate.prefix and .suffix prefs, their defaults "www." and ".com", respectively. read only. originalinput autf8string the o...
nsIUTF8StringEnumerator
inherits from: nsisupports last changed in gecko 1.7 method overview autf8string getnext(); boolean hasmore(); methods getnext() returns the next string in the enumerator. the "next" element is the first string upon the first call. must be preceded by a call to hasmore(), which returns pr_true. this method is generally called within a loop to iterate over the strings in the enumerator. autf8string getnext(); parameters none. return value the next string in the enumerator. throws an exception if there are no more strings. ...
nsIUUIDGenerator
x
pcom/base/nsiuuidgenerator.idlscriptable this interface can be used to generate an id that can be considered globally unique, often referred to as a uuid or guid. 1.0 66 introduced gecko 1.8.1 inherits from: nsisupports last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) implemented by @mozilla.org/uuid-generator; as a service: var uuidgenerator = components.classes["@mozilla.org/uuid-generator;1"] .getservice(components.interfaces.nsiuuidgenerator); method overview nsidptr generateuuid(); void generateuuidinplace(in nsnonconstidptr id); native code only! methods generateuuid() obtains a new uuid using appropriate platform-specific methods to obtain a nsid that can be considered to be globally unique. nsidptr...
nsIUpdateTimerManager
l the length of time, in seconds, until the timer should fire. remarks note that the timer is not precise, and that the default minimum interval is 2 minutes. ...
nsIWeakReference
inherits from: nsisupports last changed in gecko 0.9.9 an instance of nsiweakreference is a proxy object that cooperates with its referent to give clients a non-owning, non-dangling reference. clients own the nsiweakreference instance. ...
nsIWebNavigationInfo
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 as an image. plugin 2 returned by istypesupported() to indicate that a type is supported via an npapi ("netscape 4 api") plug-in. this is not the value returned for "x
pcom plug-ins". other 1 << 15 note: other return types may be added here in the future as they become relevant. returned by istypesupported() to indicate that a type is supported via some other means. methods istypesupported() determines whether or not the specified mime type is supported by the given nsiwebnavigation object. this lets you determine whether a mime type ...
nsIWinTaskbar
eatetaskbartabpreview( in nsidocshell shell, in nsitaskbarpreviewcontroller controller ); parameters shell an nsidocshell object representing the top-level window from which to create the preview. controller an nsitaskbarpreviewcontroller you implement. return value an nsitaskbartabpreview object for the new tab preview. ...
nsIWindowsRegKey
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) the interface represents a single key in the registry. this interface is highly win32 specific. ...
nsIWritablePropertyBag
1.0 66 introduced gecko 1.8 inherits from: nsipropertybag last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void deleteproperty(in astring name); void setproperty(in astring name, in nsivariant value); methods deleteproperty() delete a property with the given name. void deleteproperty( in astring name ); parameters name property to delete. exceptions thrown ns_error_failure if a property with that name doesn't exist. setproperty() set a property with the given name to the given value. if a property already exists with the given name, it is overwritten. ...
nsIWritablePropertyBag2
x
pcom/ds/nsiwritablepropertybag2.idlscriptable this interface extends nsipropertybag2 with methods for setting properties. 1.0 66 introduced gecko 1.8 inherits from: nsipropertybag2 last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setpropertyasacstring(in astring prop, in acstring value); void setpropertyasastring(in astring prop, in astring value); void setpropertyasautf8string(in astring prop, in autf8string value); void setpropertyasbool(in astring prop, in boolean value); void setpropertyasdouble(in astring prop, in double value); void setpropertyasint32(in astring prop, in print32 value); void setpropertyasint64(in astring prop, in print64 value)...
nsIXMLHttpRequest
a mozilla add-on developer, please refer to the xmlhttprequest documentation instead. this page contains documentation, specific 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 x
pcom 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 onlo...
nsIXULAppInfo
it can be used to distinguish between different mozilla-based applications. it provides application name, application version, gecko version and more. 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) in xulrunner applications nsixulappinfo obtains app-specific information from application.ini. implemented by: @mozilla.org/xre/app-info;1. to create an instance, use: var xulappinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); the nsixulruntime interface is also implemented by "xre/app-info". ...
nsIZipReader
eans path to file in zip, and it uses forward slashes remember) var entry = zr.getentry(entrypointer); // should return true on `entry instanceof ci.nsizipentry` console.log('entrypointer', entrypointer); /* console output * "entrypointer" "bootstrap.js" scratchpad/1:18 */ console.info('entry', entry); /* console output * "entry" x
pcwrappednative_nohelper { queryinterface: queryinterface(), compression: getter, size: getter, realsize: getter, crc32: getter, isdirectory: getter, lastmodifiedtime: getter, issynthetic: getter, permissions: getter, compression: 8 } scratchpad/1:19 */ if (!entry.isdirectory) { var inputstream = zr.getinputstream(entrypointer); reusablestreaminstance.init(in...
nsIZipWriter
it for (var i=0; i<dirarr.length; i++) { cu.reporterror('adding contents of dir['+i+']: ' + dirarr[i].leafname + ' path: ' + dirarr[i].path); var direntries = dirarr[i].directoryentries; while (direntries.hasmoreelements()) { var entry = direntries.getnext().queryinterface(ci.nsifile); //entry is instance of nsifile so here https://developer.mozilla.org/docs/x
pcom_interface_reference/nsifile if (entry.path == xpi.path) { cu.reporterror('skipping entry - will not add this entry to the zip file - as this is the zip itself: "' + xpi.path + '" leafname:"' + xpi.leafname + '"'); continue; } if (entry.isdirectory()) { dirarr.push(entry); } var relpath = entry.path.replace(dirarr[0]...
NS_ASSERTION
an assertion failure should be thrown on critical program errors only. a triggered assertion failure is equivalent to crashing in tinderbox tests. ...
NS_CStringAppendData
this is a low-level api. #include "nsstringapi.h" nsresult ns_cstringappenddata( nsacstring& astring, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null-terminated. return values the ns_cstringappenddata function returns ns_ok if successful. otherwise, it returns an error code. ...
NS_CStringCloneData
#include "nsstringapi.h" char* ns_cstringclonedata( const nsacstring& astring ); parameters astring [in] a nsacstring instance whose data is to be cloned. return values the ns_cstringcutdata function returns a pointer to a null-terminated, heap allocated buffer on success. on failure it returns nsnull. the resulting buffer may be freed by calling nsmemory::free. history this function was frozen for mozilla 1.7. see bug 239716 for details. ...
NS_CStringContainerFinish
#include "nsstringapi.h" void ns_cstringcontainerfinish( nscstringcontainer& astring ); parameters astring [in] a nscstringcontainer instance that is no longer needed. history this function was finalized for mozilla 1.7. see bug 239123 for details. ...
NS_CStringContainerInit
#include "nsstringapi.h" nsresult ns_cstringcontainerinit( nscstringcontainer& astring ); parameters astring [in] a nscstringcontainer instance to be initialized. return values the ns_cstringcontainerinit function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is equivalent to ns_cstringcontainerinit2(container, nsnull, 0, 0). the nscstringcontainer structure has private members that should not be accessed directly. after a nscstringcontainer object has been initialized via ns_cstringcontainerinit, it may be used as an ordinary nsacstring object. ...
NS_CStringCopy
this is a low-level api. #include "nsstringapi.h" nsresult ns_cstringcopy( nsacstring& adeststring, const nsacstring& asrcstring ); parameters adeststring [in] a nsacstring instance to be modified. asrcstring [in] a nsacstring instance containing the new string value. return values the ns_cstringcopy function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is designed to allow the implementation to efficiently assign the same value to two string objects. the implementation may employ reference counting techniques to optimize this operation. ...
NS_CStringCutData
this is a low-level api. #include "nsstringapi.h" nsresult ns_cstringcutdata( nsacstring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsacstring instance to be modified. acutstart [in] the starting index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. pass pr_uint32_max to specify the length from acutstart to the end of the string. return values the ns_cstringcutdata function returns ns_ok if successful. otherwise, it returns an error code. ...
NS_CStringGetData
#include "nsstringapi.h" pruint32 ns_cstringgetdata( const nsacstring& astring, const char** adata, prbool* aterminated = nsnull ); parameters astring [in] a nsacstring instance to inspect. adata [out] a const pointer to the string's internal buffer. aterminated [out] this optional result parameter indicates whether or not adata is null-terminated. it may be null if the caller is not interested in this information. return values the ns_cstringgetdata function returns the length of adata, measured in storage units (bytes). example code // count the number of times a particular character appears in a string. ...
NS_CStringGetMutableData
#include "nsstringapi.h" pruint32 ns_cstringgetmutabledata( nsacstring& astring, pruint32 adatalength, char** adata ); parameters astring [in] a nsacstring instance to modify. adatalength [in] the number of characters to resize the string's internal buffer to or pr_uint32_max to return the buffer as-is. adata [out] upon return, if the function was successful, then *adata references the string's internal buffer. return values this function returns the number of characters contained in the string's internal buffer (excluding any null-terminator). ...
NS_CStringInsertData
this is a low-level api. #include "nsstringapi.h" nsresult ns_cstringinsertdata( nsacstring& astring, pruint32 aoffset, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified. aoffset [in] an offset into the string's internal buffer specifying where to place the given characters. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. ...
NS_CStringSetData
this is a low-level api. #include "nsstringapi.h" nsresult ns_cstringsetdata( nsacstring& astring, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to modify. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null-terminated. return values the ns_cstringsetdata function returns ns_ok if successful. otherwise, it returns an error code. ...
NS_CStringSetDataRange
this is a low-level api. #include "nsstringapi.h" nsresult ns_cstringsetdatarange( nsacstring& astring, pruint32 acutstart, pruint32 acutlength, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to modify. acutstart [in] the starting index of the section to replace, measured in storage units. acutlength [in] the length of the section to replace, measured in storage units. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. ...
NS_CStringToUTF16
#include "nsstringapi.h" nsresult ns_cstringtoutf16( const nsacstring& asrc, nscstringencoding asrcencoding, nsastring& adest ); parameters asrc [in] a nsacstring instance containing the source string to be converted. asrcencoding [in] the character encoding of the source string. see nscstringencoding for the set of values that can be passed for this parameter. adest [out] a nsastring instance that will contain the result of the conversion. the result will be encoded using the host byte order. return values the ns_cstringtoutf16 function returns ns_ok if successful. ...
NS_StringAppendData
this is a low-level api. #include "nsstringapi.h" nsresult ns_stringappenddata( nsastring& astring, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to be modified. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. return values the ns_stringappenddata function returns ns_ok if successful. otherwise, it returns an error code. ...
NS_StringCloneData
#include "nsstringapi.h" prunichar* ns_stringclonedata( const nsastring& astring ); parameters astring [in] a nsastring instance whose data is to be cloned. return values the ns_stringcutdata function returns a pointer to a null-terminated, heap allocated buffer on success. on failure it returns nsnull. the resulting buffer may be freed by calling nsmemory::free. history this function was frozen for mozilla 1.7. see bug 239716 for details. ...
NS_StringContainerFinish
this is a low-level api. #include "nsstringapi.h" void ns_stringcontainerfinish( nsstringcontainer& astring ); parameters astring [in] a nsstringcontainer instance that is no longer needed. return values this function does not return a value. example code see ns_stringcontainerinit for an example. history this function was frozen for mozilla 1.7. see bug 239123 for details. ...
NS_StringContainerInit
this is a low-level api. #include "nsstringapi.h" nsresult ns_stringcontainerinit( nsstringcontainer& astring ); parameters astring [in] a nsstringcontainer instance to be initialized. return values the ns_stringcontainerinit function returns ns_ok if successful. otherwise, it returns an error code. remarks the nsstringcontainer structure has unspecified size and layout. its members may not be accessed directly. after a nsstringcontainer object has been initialized, it may be used as an ordinary nsastring object. the internal buffer allocated by a nsstringcontainer is always null-terminated. ...
NS_StringCopy
this is a low-level api. #include "nsstringapi.h" nsresult ns_stringcopy( nsastring& adeststring, const nsastring& asrcstring ); parameters adeststring [in] a nsastring instance to be modified. asrcstring [in] a nsastring instance containing the new string value. return values the ns_stringcopy function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is designed to allow the implementation to efficiently assign the same value to two string objects. the implementation may employ reference counting techniques to optimize this operation. ...
NS_StringCutData
this is a low-level api. #include "nsstringapi.h" nsresult ns_stringcutdata( nsastring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsastring instance to be modified. acutstart [in] the starting index of the section to remove, measured in storage units. acutlength [in] the length of the section to remove, measured in storage units. pass pr_uint32_max to specify the length from acutstart to the end of the string. return values the ns_stringcutdata function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is defined inline as a wrapper around ns_stringsetdatarange. ...
NS_StringGetData
this is a low-level api. #include "nsstringapi.h" pruint32 ns_stringgetdata( const nsastring& astring, const prunichar** adata, prbool* aterminated ); parameters astring [in] a nsastring instance to inspect. adata [out] a const pointer to the string's internal buffer. aterminated [out] this optional result parameter indicates whether or not adata is null-terminated. return values the ns_stringgetdata function returns the length of adata, measured in storage units (bytes). ...
NS_StringInsertData
this is a low-level api. #include "nsstringapi.h" nsresult ns_stringinsertdata( nsacstring& astring, pruint32 aoffset, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified. aoffset [in] an offset into the string's internal buffer specifying where to place the given characters. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. ...
NS_StringSetData
this is a low-level api. #include "nsstringapi.h" nsresult ns_stringsetdata( nsastring& astring, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to modify. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. return values the ns_stringsetdata function returns ns_ok if successful. otherwise, it returns an error code. ...
NS_StringSetDataRange
this is a low-level api. #include "nsstringapi.h" nsresult ns_stringsetdatarange( nsastring& astring, pruint32 acutstart, pruint32 acutlength, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to modify. acutstart [in] the starting index of the section to replace, measured in storage units. acutlength [in] the length of the section to replace, measured in storage units. adata [in] a raw character array to copy into this string. adatalength [in] the length of adata, measured in storage units. ...
NS_UTF16ToCString
#include "nsstringapi.h" nsresult ns_utf16tocstring( const nsastring& asrc, nscstringencoding adestencoding, nsacstring& adest ); parameters asrc [in] a nsastring instance containing the source utf-16 string to be converted. the source string should be encoded using the host byte order. adestencoding [in] the character encoding of the destination string. see nscstringencoding for the set of values that can be passed for this parameter. adest [out] a nsacstring instance that will contain the result of the conversion. ...
nsStaticModuleInfo
summary this data structure is used by ns_initx
pcom3 to specify static x
pcom modules. #include "nsx
pcom.h" struct nsstaticmoduleinfo { const char* name; nsgetmoduleproc getmodule; }; members name this member provides the name of the module as a null-terminated, ascii-valued character array. getmodule this member provides a function pointer of type nsgetmoduleproc that returns a nsimodule instance. ...
Storage
xtensions and firefox components only. the api is currently "unfrozen", which means it is subject to change at any time; in fact, it has changed somewhat with each release of firefox since it was introduced, and will likely continue to do so for a while. note: storage is not the same as the dom:storage feature which can be used by web pages to store persistent data or the session store api (an x
pcom storage utility for use by extensions). getting started this document covers the storage api and some peculiarities of sqlite. it does not cover sql or "regular" sqlite. you can find some very useful links in the see also section however. for storage api help, you can post to mozilla.dev.apps.platform on the news server news.mozilla.org. to report bugs, use bugzilla. the overall procedure fo...
Using nsCOMPtr
if you've never used nscomptr before, you're starting in the right place. just keep reading. you'll know when to stop. ...
Using nsIClassInfo
how do i use it? if you're writing javascript code which uses a c++ class implementing nsiclassinfo, you don't need to do anything to activate the auto-interface magic which makes calling queryinterface unnecessary. ...
already_AddRefed
you may want to use this as a return type from a function that has already produced an addrefed pointer as a result. in fact, it is preferred to use already_addrefed in this case over returning a raw pointer or nscomptr (see the nscomptr user manual). defined in: mfbt/alreadyaddrefed.h. example ... already_addrefed<nsifoo> getfoo() { nsifoo* foo = mfoo; ns_if_addref(foo); return foo; } // or already_addrefed<nsifoo> getfoo() { nscomptr<nsifoo> foo = mfoo; // ... return foo.forget(); } ... // the following assignment doesn't perform an additional addref, // as it would do if getfoo() returned a raw pointer. ...
nsCOMPtr versus RefPtr
lows: do_queryobject inherits from nscomptr_helper, so it can be assigned into both nscomptr and refptr. the downside of this inheritance is that do_queryobject requires an extra virtual call to operator() in the helper method. do_queryobject is templated on the argument type, so it's possible to pass in objects that multiply inherit from nsisupports. however, when the destination type is an x
pcom interface, it's probably better to static_cast to a class that unambiguously inherits from nsisupports and use do_queryinterface in such cases. ...
pyxpidl
the newer utility has the advantage of not needing any code to be compiled in order to use it, and let us remove a bunch of old code from the tree. pyxpidl has been in use for a while, but replaced xpidl in the gecko sdk starting in gecko 9.0. using pyxpidl pyxpidl is in the sdk in the sdkdir/sdk/bin/ directory. ...
XTF
for example, the mozilla xforms project uses xtf to add support for the xforms namespace. documentation xtf readme the xtf readme. xtf home the xtf home (outdated). xtf: when xbl just won't cut it more recent primer to xtf by alex vincent. extending gecko with xbl and xtf a presentation given at xtech 2005 comparing xbl and xtf, as well as discussing xtf basics. view all... ...
Creating a gloda message query
a glodafolder instance. conversation: the conversation the message belongs to, as represented by a glodaconversation instance. somewhat magic attributes: headermessageid: the contents of the message-id header of the message. you probably should not be using this. foldermessage: return the nsimsgdbhdr that corresponds to the message. an nsimsgdbhdr is the low-level, old-school, thunderbird x
pcom representation of a message. you should not need to use this unless you are dealing with other old-school code or you need to manipulate the state of a message. in the future, the steel layer should provide wrappers to make manipulation clean and fun. note that this message may return "null" if gloda is unable to locate the underlying message anymore. attributes provided by fundattr.js: fr...
LDAP Support
r facsimiletelephonenumber pagernumber pager pagernumber pagerphone cellularnumber mobile cellularnumber cellphone cellularnumber carphone workaddress postofficebox workaddress streetaddress workcity l workcity locality workstate st workstate region workzi
pcode postalcode workzi
pcode zip workcountry countryname jobtitle title department ou department orgunit department department department departmentnumber company o company company workcountry countryname _aimscreenname nscpaimscreenname webpage1 workurl ...
Mail composition back end
ress( pruint32 aprogress, - the progress so far pruint32 aprogressmax) = 0; - the maximum progress (aprogress should be used as a numerator and aprogressmax as a denominator for a message sent percentage) nsisupports *listenerdata) = 0; - the nsisupports pointer passed in to the original copy operation onsto
pcopy the onsto
pcopy interface is called when the copy operation has completed. this will be called in the case of both success and failure. ns_imethod onsto
pcopy( nsresult astatus, - the resulting status for the send operation nsisupports *listenerdata) = 0; - the nsisupports pointer passed in to the original copy operation ...
Mailnews and Mail code review requirements
he patch has identified a likely problem and fixes it; no commenting out tests/changing what a test tests/adding huge timeouts. (you could still ask a reviewer to approve such things, though.) the patch does not change public test frameworks, specifically, nothing in mailnews/test/resources/ or mail/test/mozmill/shared-modules/. for mozmill tests, the patch has passed on the try server. for x
pcshell tests, it has either passed on try or has been run locally on the appropriate platform(s). specifically, if the x
pcshell test will do different things on windows than it will do on os x or linux, it must be run on windows and one of os x / linux. the author of the patch is the module owner or a peer of the module to which the test corresponds. a bug is still required, even if it is immedi...
Message Interfaces
elated header information for a mail message. nsimsgdbhdr nsimsgdbhdr - this interface describes headers for mail messages. it is a child of nsimsghdr (see above). nsimsgthread nsimsgthread - this interface is used to interact with threads in thunderbird. nsimsgdbview nsimsgdbview - the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other x
pcom based mail cients. ...
Thunderbird extensions
d community / communications thunderbird specific : add-ons section on developer.thunderbird.net thunderbird communication channels add-on developers forum/mailing list #maildev irc channel more general : mozillazine extension development forum general developer channels related topics xul, javascript, x
pcom, themes, developing mozilla categori ...
libmime content type handlers
the components directory for the bin directory). sample content type handler plugin to see an example of a content type handler plugin, the source for the handler of the content type "text/calendar" can be viewed at the following link: calendar plugin note: this plugin simply creates a blue table in the output stream to identify the fact that it is operational, but the basic c...
Using Mozilla code in other projects
n in java. you can embed gecko, the layout engine used by firefox to process web pages, as a browser within your own application. building xul applications the joy of xul an introduction to xul; a must read for new developers. xul reference the complete reference to xul. xulrunner a mozilla runtime package that can be used to bootstrap xul and x
pcom applications with ease. mozilla toolkit information about the mozilla toolkit api. signing mozilla apps for mac os x how to code-sign applications based on mozilla code for mac os x's application security model. using mozilla components spidermonkey spidermonkey is the javascript runtime engine used by mozilla projects. nspr the net...
Using js-ctypes
the function how we knew how to declare the function was by going to msdn site and looking at the messagebox (messageboxw is just a unicode version of same function) function. also learn about the lib.declare function used here: lib.declare. learn about the data types used here: data types. we see that it needs to be defined like this: int winapi messagebox( _in_opt_ hwnd hwnd, _in_opt_ l
pctstr lptext, _in_opt_ l
pctstr l
pcaption, _in_ uint utype ); so we read this article here on defining types and replicate it: declaring types var lib = ctypes.open("user32.dll"); or even without the extension. var lib = ctypes.open("user32"); calling carbon routines on mac os x this example demonstrates how to use ctypes to call a carbon function on mac os x. note: this example w...
Drawing and Event Handling - Plugins
alue method. nperror npn_getvalue(npp instance, npnvariable variable, void *value); the instance parameter represents the current plug-in. unix and ms windows the queried information is returned in the variable parameter. this parameter is valid only for the unix and ms windows platforms. for unix, the values are either the current display (npnvxdisplay) or the application's context (npnvxtap
pcontext). for ms windows, the value is the native window on which the plug-in drawing occurs (npnvnetscapewindow). the value parameter contains the name of the plug-in. you can also use npn_getvalue to help create a menu or dialog box for a windowless plug-in. windowed plug-ins the browser gives each windowed plug-in its own native window, often a child window of the the browser window itself, ...
Initialization and Destruction - Plugins
lization, when the browser encounters data of a mime type registered for a plug-in (either embedded in an html page or in a separate file), it loads the plug-in code into memory (if it hasn't been loaded already) and creates a new instance of the plug-in. for more information, see registering plug-ins. plug-ins are native code libraries: .dll files on windows, .so or .dso files on unix, and power
pc shared library files or 68k code resources on mac os. to reduce memory overhead, plug-ins are usually loaded only when needed and released as soon as possible. in the initialization process, the browser passes the plug-in two tables of function pointers for all api calls: one table lists all api calls from the plug-in to the browser. this table is filled out by the browser before the initiali...
Plug-in Basics - Plugins
re media type driven and provide high performance by taking advantage of native code. plug-ins give you an opportunity to seamlessly integrate platform-dependent code and enhance the gecko core functionality by providing support for new data types. the plug-in file type depends on the platform: ms windows: .dll (dynamic link library) files unix: .so or .dso (shared objects) files mac os x: p
pc/x86/universal loadable mach-o bundle windowed and windowless plug-ins you can write plug-ins that are drawn in their own native windows or frames on a web page. alternatively, you can write plug-ins that do not require a window to draw into. using windowless plug-ins extends the possibilities for web page design and functionality. note, however, that plug-ins are windowed by default, because w...
Plug-in Development Overview - Plugins
see the wikipedia article for historical information. both technologies are now obsolete for the purposes of plug-in scriptability, and the cross-browser npruntime api should be used instead. see the scripting plugins section of this reference for the details. building plug-ins once you have added the special code and additional files to make your p...
Scripting plugins - Plugins
dentifierisstring npn_utf8fromidentifier npn_intfromidentifier npobject npn_construct (since firefox 3.0b1) npn_createobject npn_retainobject npn_releaseobject npn_invoke npn_invokedefault npn_enumerate (since mozilla 1.9a1) npn_evaluate npn_getproperty npn_setproperty npn_removeproperty npn_hasproperty npn_hasmethod npn_setexception n
pclass « previousnext » ...
Gecko Plugin API Reference - Plugins
npn_getintidentifier npn_identifierisstring npn_utf8fromidentifier npn_intfromidentifier npobject npn_createobject npn_retainobject npn_releaseobject npn_invoke npn_invokedefault npn_evaluate npn_getproperty npn_setproperty npn_removeproperty npn_hasproperty npn_hasmethod npn_setexception n
pclass 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...
Debugger.Script - Firefox Developer Tools
number for which offset is an entry point columnnumber: the column number for which offset is an entry point isentrypoint: true if the offset is a column entry point, as would be reported by getallcolumnoffsets(); otherwise false. getoffsetscoverage(): if the instance refers to a jsscript, return null or an array which contains informations about the coverage of all o
pcodes. the elements of the array are objects, each of which describes a single o
pcode, and contains the following properties: linenumber: the line number of the current o
pcode. columnnumber: the column number of the current o
pcode. offset: the bytecode instruction offset of the current o
pcode. count: the number of times the current o
pcode got executed. if ...
Debugger.Source - Firefox Developer Tools
ced into the system; the entire string is not a valid url. for function.prototype’s script, this is null. source may be loaded from a url in the following ways: the url may appear as the src attribute of a <script> element in markup text. the url may be passed to the worker web worker constructor, or the web worker importscripts function. the url may be the name of a x
pcom javascript module or subscript. (note that code passed to eval, the function constructor, or a similar function isnot considered to be loaded from a url; the url accessor on debugger.source instances for such sources should return undefined.) if the instance refers to webassembly code, the url of the script that called new webassembly.module with the string "> wasm" appended. source...
Debugger.Object - Firefox Developer Tools
notation objects have a string-valued "type" property that, taken together with the object's class, indicate what sort of thing the referent is. the host annotation object's other properties provide further details, as appropriate for the type. for example, in firefox, a metadata object for a javascript module's global object might look like this: { "type":"jsm", "uri":"resource:://gre/modules/x
pcomutils.jsm" } firefox provides [debuggerhostannotationsforfirefox annotations] for its host objects. function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects. the descriptions use "referent" to mean "the referent of this debugger.
Inspecting web sockets - Firefox Developer Tools
except control messages). control (available starting in firefox 76). displays messages for control frames (ping, pong, or close). this filter can be combined with the others, to display, for example, only messages for control frames sent by the browser. columns in the response pane in the response pane, you can choose to show the following information about each frame: data size time o
pcode maskbit finbit the data and time columns are visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header. expanding each message selecting a message in the list shows a preview of the data being sent in that message, at the bottom of the response pane. supported ...
Web Console remoting - Firefox Developer Tools
atetime": "2012-09-17t19:50:03.699z", "url": "http://localhost/~mihai/mozilla/test2.css", "method": "get" "isxhr": false, "private": false } } this packet is used to inform the web console of a new network event. for each request a new networkeventactor instance is created. the isxhr flag indicates if the request was initiated via an xmlhttprequest instance, that is: the nsihtt
pchannel's notification is of an nsixmlhttprequest interface. the private flag tells if the network request comes from a private window/tab (added in firefox 24). the networkeventactor the new network event actor stores further request and response information. the networkeventupdate packet the web console ui needs to be kept up-to-date when changes happen, when new stuff is added. the new netw...
AudioBuffer.duration - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.duration; value a double. ...
AudioBuffer.getChannelData() - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); var nowbuffering = myarraybuffer.getchanneldata(channel); parameters channel the channel property is an index representing the particular channel to get data for. an index value of 0 represents the first channel. if the channel index value is greater than of equal to audiobuffer.numberofchannels, an index_size_err exception will be thrown. return value a float32array. ...
AudioBuffer.length - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.length; value an integer. ...
AudioBuffer.sampleRate - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.samplerate; value a floating-point value indicating the current sample rate of the buffers data, in samples per second. ...
Background Tasks API - Web APIs
et statusrefreshscheduled = false; finally, we set up a couple of variables for other items: logfragment will be used to store a documentfragment that's generated by our logging functions to create content to append to the log when the next animation frame is rendered. statusrefreshscheduled is used to track whether or not we've already scheduled an update of the status display box for the u
pcoming frame, so that we only do it once per frame the shim to function even if idle callbacks aren't supported. already discussed above, so it's hidden here to save space in the article. window.requestidlecallback = window.requestidlecallback || function(handler) { let starttime = date.now(); return settimeout(function() { handler({ didtimeout: false, timeremaining: functi...
CSSPrimitiveValue.getFloatValue() - Web APIs
ency> in hertz. the value can be obtained by using the getfloatvalue method. css_in the value is a <length> in inches. css_khz the value is a <frequency> in kilohertz. css_mm the value is a <length> in millimeters. css_ms the value is a <time> in milliseconds. css_number the value is a simple <number>. css_
pc the value is a <length> in picas. css_percentage the value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. return value a float value in the specified unit. exce...
CSSPrimitiveValue.primitiveType - Web APIs
e getfloatvalue() method. css_mm the value is a <length> in millimeters. the value can be obtained by using the getfloatvalue() method. css_ms the value is a <time> in milliseconds. the value can be obtained by using the getfloatvalue() method. css_number the value is a simple <number>. the value can be obtained by using the getfloatvalue() method. css_
pc the value is a <length> in picas. the value can be obtained by using the getfloatvalue() method. css_percentage the value is a <percentage>. the value can be obtained by using the getfloatvalue() method. css_pt the value is a <length> in points. the value can be obtained by using the getfloatvalue() method. css_px the value is a <length> in pixels. the value...
CSSPrimitiveValue.setFloatValue() - Web APIs
ency> in hertz. the value can be obtained by using the getfloatvalue method. css_in the value is a <length> in inches. css_khz the value is a <frequency> in kilohertz. css_mm the value is a <length> in millimeters. css_ms the value is a <time> in milliseconds. css_number the value is a simple <number>. css_
pc the value is a <length> in picas. css_percentage the value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. floatvalue a float representing the new float value. r...
CSSPrimitiveValue - Web APIs
() method. css_mm the value is a <length> in millimeters. the value can be obtained by using the getfloatvalue() method. css_ms the value is a <time> in milliseconds. the value can be obtained by using the getfloatvalue() method. css_number the value is a simple <number>. the value can be obtained by using the getfloatvalue() method. css_
pc the value is a <length> in picas. the value can be obtained by using the getfloatvalue() method. css_percentage the value is a <percentage>. the value can be obtained by using the getfloatvalue() method. css_pt the value is a <length> in points. the value can be obtained by using the getfloatvalue() method. css_px the value is a <length> in pixe...
Drawing shapes with canvas - Web APIs
ctx.clearrect(45, 45, 60, 60); ctx.strokerect(50, 50, 50, 50); } } this example's output is shown below. screenshotlive sample the fillrect() function draws a large black square 100 pixels on each side. the clearrect() function then erases a 60x60 pixel square from the center, and then strokerect() is called to create a rectangular outline 50x50 pixels within the cleared square. in u
pcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes. unlike the path functions we'll see in the next section, all three rectangle functions draw immediately to the canvas. drawing paths now let's look at paths. a path is a list of points, connected by segments of lines that can be of different shapes, ...
Console.group() - Web APIs
group([label]); parameters label label for the group. optional. (chrome 59 tested) does not work with console.groupend(). using groups in the console requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) you can use nested groups to help organize your output by visually associating related messages. to create a new nested block, call console.group(). the console.grou
pcollapsed() method is similar, but the new block is collapsed and requires clicking a disclosure button to read it. note: from gecko 9 until gecko 51, the grou
pcollapsed() method was the same as group(). collapsed groups are fully supported starting in gecko 52. see bug 1088360. to exit the current group, call console.groupend(). for example, given this code: console.log("this is the outer level...
DOMHighResTimeStamp - Web APIs
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. ...
DOMTokenList.supports() - Web APIs
rue if a given token is in the associated attribute's supported tokens. this method is intended to support feature detection. syntax let trueorfalse = element.supports(token) parameters token a domstring containing the token to query for. returns a boolean indicating whether the token was found. ...
Document - Web APIs
rd extensions firefox notes mozilla defines a set of non-standard properties made only for xul content: document.currentscript returns the <script> element that is currently executing. document.documenturiobject (mozilla add-ons only!) returns the nsiuri object representing the uri of the document. this property only has special meaning in privileged javascript code (with universalx
pconnect privileges). document.popupnode returns the node upon which a popup was invoked. document.tooltipnode returns the node which is the target of the current tooltip. mozilla also define some non-standard methods: document.execcommandshowhelp()obsolete since gecko 14 this method never did anything and always threw an exception, so it was removed in gecko 14.0 (firefox 14.0 / thunderbi...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
ething like node.haschildnodes(), but again, if any target elements contain text nodes, you could end up with false results. whitespace helper functions the javascript code below defines several functions that make it easier to deal with whitespace in the dom: /** * throughout, whitespace is defined as one of the characters * "\t" tab \u0009 * "\n" lf \u000a * "\r" cr \u000d * " " s
pc \u0020 * * this does not use javascript's "\s" because that includes non-breaking * spaces (and also some other characters). */ /** * determine whether a node's text content is entirely whitespace. * * @param nod a node implementing the |characterdata| interface (i.e., * a |text|, |comment|, or |cdatasection| node * @return true if all of the text content of |nod| is w...
Using the Gamepad API - Web APIs
ntroller = controllers[j]; var d = document.getelementbyid("controller" + j); var buttons = d.getelementsbyclassname("button"); for (i = 0; i < controller.buttons.length; i++) { var b = buttons[i]; var val = controller.buttons[i]; var pressed = val == 1.0; if (typeof(val) == "object") { pressed = val.pressed; val = val.value; } var
pct = math.round(val * 100) + "%"; b.style.backgroundsize =
pct + " " +
pct; if (pressed) { b.classname = "button pressed"; } else { b.classname = "button"; } } var axes = d.getelementsbyclassname("axis"); for (i = 0; i < controller.axes.length; i++) { var a = axes[i]; a.innerhtml = i + ": " + controller.axes[i].tofixed(4); a.se...
HTMLCanvasElement.captureStream() - Web APIs
ect, which has a single canvascapturemediastreamtrack in it. exceptions notsupportederror the value of framerate is negative. example // find the canvas element to capture var canvaselt = document.queryselector('canvas'); // get the stream var stream = canvaselt.capturestream(25); // 25 fps // do things to the stream // e.g. send it to another computer using an rtcpeerconnection //
pc is an rtcpeerconnection created elsewhere
pc.addstream(stream); specifications specification status comment media capture from dom elementsthe definition of 'htmlcanvaselement.capturestream()' in that specification. working draft initial definition ...
HTMLElement.offsetTop - Web APIs
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. ...
HTMLImageElement.isMap - Web APIs
ard 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. ...
HTMLImageElement.useMap - Web APIs
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. ...
HTMLTableElement - Web APIs
center". htmltableelement.bgcolor is a domstring containing the background color of the cells. it reflects the obsolete bgcolor attribute. htmltableelement.border is a domstring containing the width in pixels of the border of the table. it reflects the obsolete border attribute. htmltableelement.cellpadding is a domstring containing the width in pixels of the horizontal and vertical sa
pce between cell content and cell borders. it reflects the obsolete cellpadding attribute. htmltableelement.cellspacing is a domstring containing the width in pixels of the horizontal and vertical separation between cells. it reflects the obsolete cellspacing attribute. htmltableelement.frame is a domstring containing the type of the external borders of the table. it reflects the obsolete fr...
IDBFactory.cmp() - Web APIs
ion 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. ...
IDBFactory - Web APIs
ra android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitcm
pchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
Browser storage limits and eviction criteria - Web APIs
orage is not supported. local storage data and cookies are still stored, but they are ephemeral — the data is deleted when you close the last private browsing window. the "last access time" of origins is updated when any of these are activated/deactivated — origin eviction will delete data for all these quota clients. in chrome/opera, the quota management api handles quota management for ap
pcache, indexeddb, websql, and file system api. different types of data storage even in the same browser, using the same storage method, there are different classes of data storage to understand. this section discusses the different ones you might find in different browsers. storage comes in two types: persistent: this is data that is intended to be kept around for a long time. this will only ...
Intersection Observer API - Web APIs
k, observeroptions); observers[i].observe(document.queryselector("#" + boxid)); } // scroll to the starting position document.scrollingelement.scrolltop = wrapper.firstelementchild.getboundingclientrect().top + window.scrolly; document.scrollingelement.scrollleft = 750; } intersectioncallback = (entries) => { entries.foreach((entry) => { let box = entry.target; let visible
pct = (math.floor(entry.intersectionratio * 100)) + "%"; box.queryselector(".topleft").innerhtml = visible
pct; box.queryselector(".topright").innerhtml = visible
pct; box.queryselector(".bottomleft").innerhtml = visible
pct; box.queryselector(".bottomright").innerhtml = visible
pct; }); } startup(); clipping and the intersection rectangle the browser computes the final interse...
KeyboardEvent.key - Web APIs
able representation of the key. if the pressed key is a control or special character, the returned value is one of the pre-defined key values. if the keyboardevent represents the press of a dead key, the key value must be "dead". some specialty keyboard keys (such as the extended keys for controlling media on multimedia keyboards) don't generate key codes on windows; instead, they trigger wm_ap
pcommand events. these events get mapped to dom keyboard events, and are listed among the "virtual key codes" for windows, even though they aren't actually key codes. if the key cannot be identified, the returned value is unidentified. keyboardevent sequence every keyboardevent is fired in a pre-determined sequence. for a given key press, the sequence of keyboardevents fired is as follows assumi...
KeyboardEvent - Web APIs
0x00 the key described by the event is not identified as being located in a particular area of the keyboard; it is not located on the numeric keypad (unless it's the numlock key), and for keys that are duplicated on the left and right sides of the keyboard, the key is, for whatever reason, not to be associated with that location. examples include alphanumeric keys on the standard
pc 101 us keyboard, the numlock key, and the space bar. dom_key_location_left 0x01 the key is one which may exist in multiple locations on the keyboard and, in this instance, is on the left side of the keyboard. examples include the left control key, the left command key on a macintosh keyboard, or the left shift key. dom_key_location_right 0x02 t...
Microsoft API extensions - Web APIs
.msaudiodevicetype htmlmediaelement.mscleareffects() htmlmediaelement.msinsertaudioeffect() mediaerror.msextendedcode msgraphicstrust msgraphicstruststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager mssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideoformatchanged onmsvideoframeste
pcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml navigator.mslaunchuri() mslaunchuric...
Navigator - Web APIs
o carry on some activities. a navigator object can be retrieved using the read-only window.navigator property. properties doesn't inherit any properties, but implements those defined in navigatorid, navigatorlanguage, navigatoronline, navigatorcontentutils, navigatorstorage, navigatorstorageutils, navigatorconcurrenthardware, navigatorplugins, and navigatorusermedia. standard navigatorid.ap
pcodename read only returns the internal "code" name of the current browser. do not rely on this property to return the correct value. navigatorid.appname read only returns a domstring with the official name of the browser. do not rely on this property to return the correct value. navigatorid.appversion read only returns the version of the browser as a domstring. do not rely on this prope...
NavigatorID.userAgent - Web APIs
er provides both in http headers and in response to this and other related methods on the navigator object. the user agent string is built on a formal structure which can be decomposed into several pieces of info. each of these pieces of info comes from other navigator properties which are also settable by the user. ...
Node.baseURIObject - Web APIs
the node.baseuriobject property returns the nsiuri representing the node's (typically a document or an element) base url. it's similar to node.baseuri, except it returns an nsiuri instead of a string. this property exists on all nodes (html, xul, svg, mathml, etc.), but only if the script trying to use it has universalx
pconnect privileges. see node.baseuri for details on what the base url is. syntax uriobj = node.baseuriobject value an nsiuri. this property is read-only; attempting to write to it will throw an exception. in addition, this property may only be accessed from privileged code. specification not in any specification. ...
Notification.timestamp - Web APIs
he notification interface returns a domtimestamp, as specified in the timestamp option of the notification() constructor. the notification's timestamp can represent the time, in milliseconds since 00:00:00 utc on 1 january 1970, of the event for which the notification was created, or it can be an arbitrary timestamp that you want associated with the notification. for example, a timestamp for an u
pcoming meeting could be set in the future, whereas a timestamp for a missed message could be set in the past. syntax var timestamp = notification.timestamp; value a domtimestamp. examples the following snippet fires a notification; a simple options object is created, then the notification is fired using the notification() constructor. var dts = math.floor(date.now()); var options = { body...
RTCConfiguration.bundlePolicy - Web APIs
ample creates a new rtcpeerconnection with a configuration setting the connection's bundlepolicy to max-compat to maximize compatibility while attempting to optimize network use. it also specifies stun:stun.example.com as the stun server for ice to use during negotiation. let config = { iceservers: [ { urls: [ "stun:stun.example.com" ] }, ], bundlepolicy: "max-compat" }; let
pc = new rtcpeerconnection(config); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration.bundlepolicy' in that specification. candidate recommendation initial definition. ...
RTCConfiguration.iceServers - Web APIs
n.example.com and stun:stun-1.example.com. var configuration = { iceservers: [{ urls: "stun:stun.services.mozilla.com", username: "louis@mozilla.com", credential: "webrtcdemo" }, { urls: ["stun:stun.example.com", "stun:stun-1.example.com"] }] }; var
pc = new rtcpeerconnection(configuration); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration.iceservers' in that specification. candidate recommendation initial definition. ...
RTCConfiguration.iceTransportPolicy - Web APIs
or example, in a video calling application, the app may want to prevent unknown callers from learning the callee's ip addresses until the callee has agreed to receive the call. examples in this example, a new connection is configured to only accept relay candidates. let config = { iceservers: [ { urls: [ "stun:stun.example.com" ] }, ], icetransportpolicy: "relay" }; let
pc = new rtcpeerconnection(config); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtccandidate.icetransportpolicy' in that specification. candidate recommendation initial definition. ...
RTCConfiguration - Web APIs
n.example.com and stun:stun-1.example.com. var configuration = { iceservers: [{ urls: "stun:stun.services.mozilla.com", username: "louis@mozilla.com", credential: "webrtcdemo" }, { urls: ["stun:stun.example.com", "stun:stun-1.example.com"] }] }; var
pc = new rtcpeerconnection(configuration); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcconfiguration' in that specification. candidate recommendation initial definition. ...
RTCDTMFSender.toneBuffer - Web APIs
syntax var tonebuffer = rtcdtmfsender.tonebuffer; value a domstring listing the tones to be played. if the string is empty, there are no tones pending. ...
RTCDataChannel.id - Web APIs
dentifies the data channel. while the label property doesn't have to be unique, this id number is guaranteed to be unique among all data channels. additionally, known implementations of webrtc use the same id on both peers. a unique id makes it easier for your code to do its own out-of-band data channel-related signaling. this can be also useful for logging and debugging purposes. example var
pc = new rtcpeerconnection(); var dc =
pc.createdatachannel("my channel"); console.log("channel id: " + dc.id); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.id' in that specification. candidate recommendation initial specification. ...
RTCDataChannel.label - Web APIs
fter that. syntax var name = adatachannel.label; value a string identifier assigned by the web site or app when the data channel was created, as specified when rtcpeerconnection.createdatachannel() was called to create the channel. example this sample creates a data channel on an rtcpeerconnection, then, some time later, sets the content of a ui element to display the channel's name. var
pc = new rtcpeerconnection(); var dc =
pc.createdatachannel("my channel"); /* ... */ document.getelementbyid("channel-name").innerhtml = "<span class='channelname'>" + dc.label + "</span>"; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.label' in that specification. candida...
RTCDataChannel.onbufferedamountlow - Web APIs
browser will call to handle the bufferedamountlow event. this function receives as its only input parameter a simple event object representing the event which has occurred. example this example responds to the bufferedamountlow event by fetching up to 64kb of a file represented by an object source and calling rtcdatachannel.send() to queue up the retrieved data for sending on the data channel.
pc = new rtcpeerconnection(); dc =
pc.createdatachannel("sendfile"); /* ... */ dc.onbufferedamountlow = function() { if (source.position <= source.length) { dc.send(source.readfile(65536)); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.onbufferedamountlow' in that specifica...
RTCDataChannel.onerror - Web APIs
unction receives as its only input an errorevent object describing the event which was received. that event object, in turn, describes the error that took place. example in the example below, a data channel is established, and an onerror handler is added to it. the error handler passes information about the error to a ui library's alert box function to present an error message to the user. let
pc = new rtcpeerconnection(); let dc =
pc.createdatachannel("playercontrol"); dc.onerror = function(event) { myuilibrary.doalertbox({ 'network error', // alert title 'the error "' + event.message + '" occurred while handling player control network messages.', event.filename, event.lineno, event.colno }); } /* ... */ specifications specification...
RTCDataChannel.ordered - Web APIs
t is true, which indicates that the data channel is indeed ordered. this is set when the rtcdatachannel is created, by setting the ordered property on the rtcdatachannelinit object passed as rtcpeerconnection.createdatachannel()'s options parameter. syntax var ordered = adatachannel.ordered; a boolean value which is true if in-order delivery is guaranteed and is otherwise false. example var
pc = new rtcpeerconnection(); var dc =
pc.createdatachannel("my channel"); if (!dc.ordered) { // handle unordered messaging } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.ordered' in that specification. candidate recommendation initial specification. ...
RTCDataChannel.send() - Web APIs
the last piece of a multi-part object sent using send(). for more information about message size restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is created; it accepts an object as input and sends to the remote peer, over the rtcdatachannel, a json string with the specified object and a time stamp. var
pc = new rtcpeerconnection(); var dc =
pc.createdatachannel("backchannel"); function sendmessage(msg) { let obj = { "message": msg, "timestamp": new date() } dc.send(json.stringify(obj)); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.send()' in that specification. ca...
RTCDataChannelEvent.channel - Web APIs
rtcdatachannel associated with the event. syntax var channel = rtcdatachannelevent.channel; value a rtcdatachannel object representing the data channel linking the receiving rtcpeerconnection to its remote peer. example the first line of code in the datachannel event handler shown below takes the channel from the event object and saves it locally for use by the code handling data traffic. ...
RTCDataChannelEvent - Web APIs
vent.channel returns the rtcdatachannel associated with the event.methodsthis interface has no methods, but inherits methods from: event examples in this example, the datachannel event handler is set up to save the data channel reference and set up handlers for the events which need to be monitored. the channel property provides the rtcdatachannel representing the connection to the other peer.
pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } see a simple rtcdatachannel sample for another, more complete, example of how to use data channels. specifications specification status comment ...
RTCError - Web APIs
ption, rtcerror includes the following properties: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred. receivedalert read only an unsigned long integer value indicating the fatal dtls error which was received from the network. only valid if the errordetail string is dtls-failure. if null, no dtls error was received. sct
pcausecode read only if errordetail is sctp-failure, this property is a long integer specifying the sctp cause code indicating the cause of the failed sctp negotiation. null if the error isn't an sctp error. sdplinenumber read only if errordetail is sdp-syntax-error, this property is a long integer identifying the line number of the sdp on which the syntax error occurred. null if the error isn'...
RTCErrorEvent.error - Web APIs
ies. additional properties defined by rtcerror are: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred. receivedalert read only an unsigned long integer value indicating the fatal dtls error which was received from the network. only valid if the errordetail string is dtls-failure. if null, no dtls error was received. sct
pcausecode read only if errordetail is sctp-failure, this property is a long integer specifying the sctp cause code indicating the cause of the failed sctp negotiation. null if the error isn't an sctp error. sdplinenumber read only if errordetail is sdp-syntax-error, this property is a long integer identifying the line number of the sdp on which the syntax error occurred. null if the error isn'...
RTCIceCandidate.component - Web APIs
component id. a value of "1" indicates rtp, which is recorded in the component property as "rtp". if this value were instead "2", the a-line would be describing an rtcp candidate, and compoment would be "rtcp". example this code snippet examines a candidate's component type and dispatches the candidate to different handlers depending on the value. if (candidate.component == "rtp") { handlert
pcandidate(candidate); } else if (candidate.component == "rtcp") { handlertc
pcandidate(candidate); } else { handleunknowncandidate(candidate); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.component' in that specification. candidate recommendation initial definition. ...
RTCIceCandidate.tcpType - Web APIs
didates to provide additional details about the candidate type. the tcptype field's value is set when the rtcicecandidate() constructor is used. you can't directly set its value; instead, its value is automatically extracted from the candidate a-line, if it's formatted properly. syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetc
pcandidatetype enumerated type. "active" the transport will try to open an outbound connection but won't receive inoming connection requests. "passive" the transport will receive incoming connection requests but won't try to open an outbound connection. "so" the transport will try to open a connection simultaneously with its peer. tcptype is null for udp candidates. example in this examp...
RTCIceCandidatePair.local - Web APIs
yntax localcandidate = rtcicecandidatepair.local; value an rtcicecandidate which describes the configuration of the local end of a viable pair of ice candidates. the rtcicecandidatepair is returned by the rtcicetransport method getselectedcandidatepair(). example this one-line example simply obtains the current candidate pair and then from that gets the local candidate. var candidatepair =
pc.getsenders()[0].transport.transport.getselectedcandidatepair(); var localcandidate = candidatepair.local; the rtcicetransport is found by getting the list of rtcrtpsender objects for the rtcpeerconnection
pc. in the first rtcrtpsender, we get the rtcdtlstransport over which the media data is being transmitted and finally, from that, the rtcicetransport. specifications specification ...
RTCIceCandidatePair.remote - Web APIs
x remotecandidate = rtcicecandidatepair.remote; value an rtcicecandidate which describes the configuration of the remote end of a viable pair of ice candidates. the rtcicecandidatepair is returned by the rtcicetransport method getselectedcandidatepair(). example this one-line example simply obtains the current candidate pair and then from that gets the remote candidate. var candidatepair =
pc.getsenders()[0].transport.transport.getselectedcandidatepair(); var remotecandidate = candidatepair.remote; the rtcicetransport is found by getting the list of rtcrtpsender objects for the rtcpeerconnection
pc. in the first rtcrtpsender, we get the rtcdtlstransport over which the media data is being transmitted and finally, from that, the rtcicetransport. specifications specification ...
RTCIceCandidatePair - Web APIs
ties local an rtcicecandidate describing the configuration of the local end of the connection. remote the rtcicecandidate describing the configuration of the remote end of the connection. example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair. ...
RTCPeerConnection.createAnswer() - Web APIs
il that's entirely up to you. in this case, a websocket connection is used to send a json message with a type field with the value "video-answer" to the other peer, carrying the answer to the device which sent the offer to connect. the contents of the object being passed to the sendtoserver() function, along with everything else in the promise fulfillment handler, depend entirely on your design
pc.createanswer().then(function(answer) { return
pc.setlocaldescription(answer); }) .then(function() { // send the answer to the remote peer through the signaling server. }) .catch(handlegetusermediaerror); this asks rtcpeerconnection to create and return a new answer. in our promise handler, the returned answer is set as the description of the local end of the connection by calling setlocalde...
RTCPeerConnection.generateCertificate() - Web APIs
ction.generatecertificate() is a static method, so it is always called on the rtcpeerconnection interface itself, not an instance thereof. return value a reference to an rtccertificate object. example rtcpeerconnection.generatecertificate({ name: 'rsassa-pkcs1-v1_5', hash: 'sha-256', moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]) }).then(function(cert) { var
pc = new rtcpeerconnection({certificates: [cert]}); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'generatecertificate()' in that specification. candidate recommendation initial definition. ...
RTCPeerConnection.getIdentityAssertion() - Web APIs
initiates the gathering of an identity assertion. this has an effect only if the signalingstate is not "closed". the method returns immediately. if the assertion cannot be generated, an idpassertionerror will be sent to the object. it is not expected for the application dealing with the rtcpeerconnection: this is automatically done; an explicit call only allows to anticipate the need. syntax
pc.getidentityassertion(); there is neither parameter nor return value for this method. example var
pc = new peerconnection();
pc.getidentityassertion(); // not mandatory, but we know that we will need it in the future. specifications specification status comment identity for webrtcthe definition of 'rtcpeerconnection.getidentityassertion()' in that specificati...
RTCPeerConnection.getStreamById() - Web APIs
astream with the given id that is associated with local or remote end of the connection. if no stream matches, it returns null. this property has been replaced with the rtcpeerconnection.getlocalstreams and rtcpeerconnection.getremotestreams properties. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var mediastream =
pc.getstream(id); parameters id is a domstring corresponding to the stream to return. example var stream =
pc.getstreambyid(mytrackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available. // from: https://bugs.chromium.org/p/chromium/i...
RTCPeerConnection.getTransceivers() - Web APIs
list = rtcpeerconnection.gettransceivers(); parameters none. return value an array of the rtcrtptransceiver objects representing the transceivers handling sending and receiving all media on the rtcpeerconnection. the list is in the order in which the transceivers were added to the connection. example the following snippet of code stops all transceivers associated with an rtcpeerconnection.
pc.gettransceivers().foreach(transceiver => { transceiver.stop(); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.gettransceivers()' in that specification. candidate recommendation ...
RTCPeerConnection.iceConnectionState - Web APIs
cpeerconnection. this is a less stringent test than "failed" 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. example var
pc = new rtcpeerconnection(); var state =
pc.iceconnectionstate; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.iceconnectionstate' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.iceGatheringState - Web APIs
ng yet. "gathering" the ice agent is in the process of gathering candidates for the connection. "complete" the ice agent has finished gathering candidates. if something happens that requires collecting new candidates, such as a new interface being added or the addition of a new ice server, the state will revert to "gathering" to gather those candidates. example var
pc = new rtcpeerconnection(); var state =
pc.icegatheringstate; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.icegatheringstate' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.onaddstream - Web APIs
rconnection.setremotedescription(); it doesn't wait for a particular stream to be accepted or rejected using sdp negotiation. example this code, based on an older version of our signaling and video calling sample, responds to addstream events by setting the video source for a <video> element to the stream specified in the event, and then enabling a "hang up" button in the app's user interface.
pc.onaddstream = function(event) { document.getelementbyid("received_video").srcobject = event.stream; document.getelementbyid("hangup-button").disabled = false; }; you can also use addeventlistener() to add a handler for addstream events to an rtcpeerconnection. ...
RTCPeerConnection.ondatachannel - Web APIs
indicates may not yet actually be open. be sure to wait for the "open" event to be fired on the new rtcdatachannel before using it. syntax rtcpeerconnection.ondatachannel = function; value set this property to be a function you provide which receives as input a single parameter: an rtcdatachannelevent which provides in its channel property the rtcdatachannel which has been created. example
pc.ondatachannel = function(ev) { console.log('data channel is created!'); ev.channel.onopen = function() { console.log('data channel is open and ready to be used.'); }; }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.ondatachannel' in that specification. candidate reco...
RTCPeerConnection.onicecandidate - Web APIs
to watch for this explicitly; instead, if you need to sense the end of signaling, you should watch for a icegatheringstatechange event indicating that the ice negotiation has transitioned to the complete state. example the example below, which is based on the code from the article signaling and video calling, sets up a handler for icecandidate events to send the candidates to the remote peer.
pc.onicecandidate = function(event) { if (event.candidate) { // send the candidate to the remote peer } else { // all ice candidates have been sent } } notice that the end of negotiation is detected here when the event's candidate property is null. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definiti...
RTCPeerConnection.onicecandidateerror - Web APIs
ired when an error occurs during the ice candidate gathering process. syntax rtcpeerconnection.onicecandidateerror = eventhandler; value this should be set to a function you provide which is passed a single parameter: an rtcpeerconnectioniceerrorevent object describing the icecandidateerror event. the event offers properties describing the error to help you handle it appropriately. example
pc.onicecandidateerror = function(event) { if (event.errorcode >= 300 && event.errorcode <= 699) { // stun errors are in the range 300-699. see rfc 5389, section 15.6 // for a list of codes. turn adds a few more error codes; see // rfc 5766, section 15 for details. } else if (event.errorcode >= 700 && event.errorcode <= 799) { // server could not be reached; a specific error numb...
RTCPeerConnection.oniceconnectionstatechange - Web APIs
ameter: an event object describing the iceconnectionstatechange event which occurred. your code can look at the value of rtcpeerconnection.iceconnectionstate to determine what the new state is. example the example below watches the state of the ice agent for a failure or unexpected closure and takes appropriate action, such as presenting an error message or attempting to restart the ice agent.
pc.oniceconnectionstatechange = function(event) { if (
pc.iceconnectionstate === "failed" ||
pc.iceconnectionstate === "disconnected" ||
pc.iceconnectionstate === "closed") { // handle the failure } }; of course, "disconnected" and "closed" don't necessarily indicate errors; these can be the result of normal ice negotiation, so be sure to handle these properly (if at all). spec...
RTCPeerConnection.onnegotiationneeded - Web APIs
d event. there's no additional information provided in the event; anything you need, you can get by examining the properties of the rtcpeerconnection. example this example, derived from the example in signaling and video calling, establishes a handler for negotiationneeded events to handle creating an offer, configuring the local end of the connection, and sending the offer to the remote peer.
pc.onnegotiationneeded = function() {
pc.createoffer().then(function(offer) { return
pc.setlocaldescription(offer); }) .then(function() { // send the offer to the remote peer through the signaling server }); }) .catch(reporterror); } first, it creates the offer by calling createoffer(). when that succeeds, the offer is passed into setlocaldescription() to set the local descr...
RTCPeerConnection.onsignalingstatechange - Web APIs
r); or, using an anonymous (inline) handler: myrtcpeerconnection.addeventlistener("signalingstatechange", event => { /* handle the event here */ }); example this snippet shows a handler for signalingstatechange that looks for the "have-local-pranswer" signaling state—indicating that a remote offer has been received and a local description of type "pranswer" has been applied in response.
pc.onsignalingstatechange = function(event) { if (
pc.signalingstate === "have-local-pranswer") { // setlocaldescription() has been called with an answer } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onsignalingstatechange' in that specification. candidate recommendati...
RTCPeerConnection.ontrack - Web APIs
tion includes the mediastreamtrack object representing the new track, the rtcrtpreceiver and rtcrtptransceiver, and a list of mediastream objects which indicates which stream or streams the track is part of.. example this example, taken from the code for the article signaling and video calling, connects the incoming track to the <video> element which will be used to display the incoming video.
pc.ontrack = function(event) { document.getelementbyid("received_video").srcobject = event.streams[0]; document.getelementbyid("hangup-button").disabled = false; }; the first line of our ontrack event handler takes the first stream in the incoming track and sets the srcobject attribute to that. this connects that stream of video to the element so that it begins to be presented to the user. the...
RTCPeerConnection.pendingLocalDescription - Web APIs
in webrtc connectivity. syntax sessiondescription = rtcpeerconnection.pendinglocaldescription; return value if a local description change is in progress, this is an rtcsessiondescription describing the proposed configuration. otherwise, this returns null. example this example looks at the pendinglocaldescription to determine whether or not there's a description change being processed. var
pc = new rtcpeerconnection(); … var sd =
pc.pendinglocaldescription; if (sd) { // there's a description change underway! } else { // no description change pending } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.pendinglocaldescription' in that specification. candidate recomm...
RTCPeerConnection.pendingRemoteDescription - Web APIs
webrtc connectivity. syntax sessiondescription = rtcpeerconnection.pendingremotedescription; return value if a remote description change is in progress, this is an rtcsessiondescription describing the proposed configuration. otherwise, this returns null. example this example looks at the pendingremotedescription to determine whether or not there's a description change being processed. var
pc = new rtcpeerconnection(); … var sd =
pc.pendingremotedescription; if (sd) { // there's a description change underway! } else { // no description change pending } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.pendingremotedescription' in that specification. candidate reco...
RTCPeerConnection.setConfiguration() - Web APIs
ed. syntaxerror one or more of the urls provided in the configuration.iceservers list is invalid. example in this example, it has already been determined that ice restart is needed, and that negotiation needs to be done using a different ice server. ...
RTCPeerConnection.setRemoteDescription() - Web APIs
te. deprecated syntax in older code and documentation, you may see a callback-based version of this function used. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-based version of setremotedescription() instead. the parameters for the older form of setremotedescription() are described below, to aid in updating existing code.
pc.setremotedescription(sessiondescription, successcallback, errorcallback); parameters successcallback a javascript function which accepts no input parameters to be be called once the description has been successfully set. at that time, the offer can be sent to a remote peer via the signaling server. errorcallback a function matching the signautre rtcpeerconnectionerrorcallback which get...
RTCPeerConnection.signalingState - Web APIs
ing setlocaldescription(). "closed" the connection is closed. note: this value moved into the rtcpeerconnectionstate enum in the may 13, 2016 draft of the specification, as it reflects the state of the rtcpeerconnection, not the signaling connection. you now detect a closed connection by checking for connectionstate to be "closed" instead. example var
pc = new rtcpeerconnection(configuration); var state =
pc.signalingstate; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.signalingstate' in that specification. candidate recommendation initial specification. ...
RTCPeerConnectionIceErrorEvent.address - Web APIs
d as part of a local candidate, the value of address is null. examples this example creates a handler for icecandidateerror events which creates human readable messages describing the local network interface for the connection as well as the ice server that was being used to try to open the connection, then calls a function to display those as well as the event's errortext property's contents. ...
RTCPeerConnectionIceEvent.candidate - Web APIs
the read-only candidate property of the rtcpeerconnectioniceevent interface returns the rtcicecandidate associated with the event. syntax var candidate = event.candidate; value an rtcicecandidate object representing the ice candidate that has been received, or null to indicate that there are no further candidates for this negotiation session. example
pc.onicecandidate = function( ev ) { alert("the ice candidate (transport address: '" + ev.candidate.candidate + "') has been added to this connection."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceevent.candidate' in that specification. candidate recommendation initial specification. ...
RTCPeerConnectionIceEvent - Web APIs
ructors rtcpeerconnectioniceevent() returns a new rtcpeerconnectioniceevent. it takes two parameters, the first being a domstring representing the type of the event; the second a dictionary containing the rtcicecandidate it refers to. methods a rtcpeerconnectioniceevent being an event, this event also implements these properties. there is no specific rtcdatachannelevent method. examples
pc.onicecandidate = function( ev ) { alert("the ice candidate (transport address: '" + ev.candidate.candidate + "') has been added to this connection."); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceevent' in that specification. candidate recommendation initial defin...
RTCRtcpParameters - Web APIs
dsize a boolean value indicating whether or not reduced size rtcp is configured. if this value is true, reduced size rtcp (described in rfc 5506) is in effect. if false, compund rtcp is in use, as found in rfc 3550. this property cannot be changed once initialized. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpsender or rtcrtpreceiver. function getrt
pcname(rtpobject) { let parameters = rtpobject.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtcpparameters' in that specification. candidate recommendation initial definition. ...
RTCRtpReceiveParameters - Web APIs
thod getparameters(). it describes the parameters being used by the receiver's rtp connection to the remote peer. properties this dictionary currently has no properties of its own; it exists for future expansion. it inherits all of the properties of its parent, rtcrtpparameters. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpreceiver. function getrtc
pcname(receiver) { let parameters = receiver.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiveparameters' in that specification. candidate recommendation initial definition. ...
RTCRtpReceiver.getCapabilities() static function - Web APIs
the static function rtcrtpreceiver.getcapabilities() returns an rtcrt
pcapabilities object describing the codecs and capabilities supported by rtcrtpreceivers on the current device. you can, similarly, obtain the capabilities of rtcrtpsenders by calling the static function rtcrtpsender.getcapabilities(). syntax let rt
pcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrt
pcapabilities object stating what capabilities the browser has for receiving the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value i...
RTCRtpReceiver.getParameters() - Web APIs
the current configuration for the encoding and transmission of media on the receiver's track. syntax let rtpreceiveparameters = rtpreceiver.getparameters(); parameters none. return value an rtcrtpreceiveparameters object indicating the current configuration of the receiver. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpreceiver. function getrtc
pcname(receiver) { let parameters = receiver.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiver.getparameters()' in that specification. candidate recommendation initial definition. ...
RTCRtpReceiver.getSynchronizationSources() - Web APIs
the getsynchronizationsources() method of the rtcrtpreceiver interface returns an array of rtcrt
pcontributingsource instances, each corresponding to one ssrc (synchronization source) identifier received by the current rtcrtpreceiver in the last ten seconds. syntax var rtcrt
pcontributingsources = rtcrtpreceiver.getcontributingsources() parameters none. return value an array of rtcrtpsynchronizationsource instances. each instance describes one of the synchronization sources that provided data to the incoming stream in the past ten seconds. as you'll see in the documentarion for rtcrtpsynchronizationsource, it inherits the properties of rtcrt
pcontributingsource, including timestamp, source, and audiolevel. the synchronization source objects add a voiceactivityflag property, which indic...
RTCRtpReceiver - Web APIs
e. rtcrtpreceiver.transport read only returns the rtcdtlstransport instance over which the media for the receiver's track is received. obsolete properties rtcptransport this property has been removed; the rtp and rtcp transports have been combined into a single transport. use the transport property instead. methods rtcrtpreceiver.getcontributingsources() returns an array of rtcrt
pcontributingsource instances for each unique csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds. rtcrtpreceiver.getparameters() returns an rtcrtpparameters object which contains information about how the rtc data is to be decoded. rtcrtpreceiver.getstats() returns a promise whose fulfillment handler receives a rtcstatsreport which contains stat...
RTCRtpSender.getCapabilities() static function - Web APIs
the static function rtcrtpsender.getcapabilities() returns an rtcrt
pcapabilities object describing the codecs and capabilities supported by the rtcrtpsender. you can, similarly, obtain the capabilities of rtcrtpreceivers by calling the static function rtcrtpreceiver.getcapabilities(). syntax let rt
pcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrt
pcapabilities object stating what capabilities the browser has for sending the specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description a...
RTCRtpSender.setStreams() - Web APIs
track already belongs, that stream is unaffected. once the track has been added to all of the streams, renegotiation of the connection will be triggered by the negotiationneeded event being dispatched to the rtcpeerconnection to which the sender belongs. example this example adds all of an rtcpeerconnection's tracks to the specified stream. function addtrackstostream(stream) { let senders =
pc.getsenders(); senders.foreach((sender) => { if (sender.track && (sender.transport.state === connected)) { sender.setstreams(stream); } }); } after calling the rtcpeerconnection method getsenders() to get the list of the connection's senders, the addtrackstostream() function iterates over the list. for each sender, if the sender's track is non-null and its transport's state is...
RTCRtpSender - Web APIs
diastream(s) associated with the track being transmitted by this sender. rtcrtpsender.replacetrack() attempts to replace the track currently being sent by the rtcrtpsender with another track, without performing renegotiation. this method can be used, for example, to toggle between the front- and rear-facing cameras on a device. static methods rtcrtpsender.getcapabilities() returns an rtcrt
pcapabilities object describing the system's capabilities for sending a specified kind of media data. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender' in that specification. candidate recommendation ...
RTCRtpSynchronizationSource - Web APIs
the rtcrtpsynchronizationsource dictionary of the the webrtc api is used by getsynchronizationsources() to describe a particular synchronization source (ssrc). a synchronization source is a single source that shares timing and sequence number space. since rtcrtpsynchronizationsource implements rtcrt
pcontributingsource, its properties are also available. the information provided is based on the last ten seconds of media received. while the published specification describes this as an interface, it has since been changed to a dictionary in follow-up drafts. properties also implements the properties of rtcrt
pcontributingsource. voiceactivityflag optional a boolean value indicating whether or not voice activity is included in the last rtp packet played from the source. if the peer has...
RTCRtpTransceiver - Web APIs
andles receiving and decoding incoming media. sender read only the rtcrtpsender object responsible for encoding and sending data to the remote peer. stopped indicates whether or not sending and receiving using the paired rtcrtpsender and rtcrtpreceiver has been permanently disabled, either due to sdp offer/answer, or due to a call to stop(). methods setcodecpreferences() a list of rtcrt
pcodecparameters objects which override the default preferences used by the user agent for the transceiver's codecs. stop() permanently stops the rtcrtptransceiver. the associated sender stops sending data, and the associated receiver likewise stops receiving and decoding incoming data. specifications specification status comment webrtc 1.0: real-time communication betwe...
RTCSessionDescription() - Web APIs
to convert an sdp offer into an rtcsessiondescription object. this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. navigator.getusermedia({video: true}, function(stream) {
pc.onaddstream({stream: stream}); // adding a local stream won't trigger the onaddstream callback
pc.addstream(stream);
pc.createoffer(function(offer) {
pc.setlocaldescription(new rtcsessiondescription(offer), function() { // send the offer to a server to be forwarded to the friend you're calling. }, error); }, error); } specifications specification status com...
RTCSessionDescription.type - Web APIs
is the initial proposal in an offer/answer exchange. "answer", the description is the definitive choice in an offer/answer exchange. "pranswer", the description is a provisional answer and may be changed when the definitive choice will be given. "rollback", the description rolls back to offer/answer state to the last stable state. example // the remote description has been set previously on
pc, a rtcpeerconnection alert(
pc.remotedescription.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.type' in that specification. candidate recommendation initial specification. ...
RTCSessionDescriptionCallback - Web APIs
syntax rtcsessiondescriptioncallback(description); parameters description an rtcsessiondescriptioninit (or rtcsessiondescription) object describing the session being offered or being accepted. this object contains the type and sdp properties which are part of rtcsessiondescription. return value the callback doesn't need to return anything, so the return value is undefined. example var
pc = new rtcpeerconnection(); var descriptioncallback = function(offer) {
pc.setlocaldescription(offer); }
pc.createoffer(descriptioncallback); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescriptioncallback' in that specification. candidate recommendation initial definition. ...
Service Worker API - Web APIs
xhr and localstorage can't be used inside a service worker. service workers only run over https, for security reasons. having modified network requests, wide open to man in the middle attacks would be really bad. in firefox, service worker apis are also hidden and cannot be used when the user is in private browsing mode. note: service workers win over previous attempts in this area such as; ap
pcache because they don't make assumptions about what you are trying to do, and then break when those assumptions are not exactly right; you have granular control over everything. note: service workers make heavy use of promises, as generally they will wait for responses to come through, after which they will respond with a success or failure action. the promises architecture is ideal for this. ...
SharedWorkerGlobalScope.applicationCache - Web APIs
4175, currently nightly/beta only). don't use it to make offline websites — consider using service workers instead. the applicationcache read-only property of the sharedworkerglobalscope interface returns the applicationcache object for the worker (see using the application cache). syntax var nameobj = self.applicationcache; value an applicationcache. example if a shared worker has an ap
pcache associated with it, you can return a reference to the cache using self.applicationcache from inside the shared worker. browser compatibility the compatibility table in 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. desktopmobilechromeedgefirefoxinternet explorero...
WebRTC API - Web APIs
port and also provides a way to access the underlying datagram transport layer security (dtls) transport over which sctp packets for all of an rtcpeerconnection's data channels are sent and received. dictionaries rtcconfiguration used to provide configuration options for an rtcpeerconnection. rtciceserver defines how to connect to a single ice server (such as a stun or turn server). rtcrt
pcontributingsource contains information about a given contributing source (csrc) including the most recent time a packet that the source contributed was played out. events bufferedamountlow the amount of data currently buffered by the data channel—as indicated by its bufferedamount property—has decreased to be at or below the channel's minimum buffered data size, as specified by buffered...
Writing a WebSocket server in Java - Web APIs
etbytes("utf-8"); out.write(response, 0, response.length); decoding messages after a successful handshake, client can send messages to the server, but now these are encoded. if we send "abcdef", we get these bytes: 129 134 167 225 225 210 198 131 130 182 194 135 - 129: fin (is this the whole message?) rsv1 rsv2 rsv3 o
pcode 1 0 0 0 0x1=0001 fin: you can send your message in frames, but now keep things simple. o
pcode 0x1 means this is a text. full list of o
pcodes - 134: if the second byte minus 128 is between 0 and 125, this is the length of the message. if it is 126, the following 2 bytes (16-bit unsigned integer), if 127, the following 8 bytes (64-bit unsigned integer, the most...
The WebSocket API (WebSockets) - Web APIs
connections) for node.js server and client. signalr: signalr will use websockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same. caddy: a web server capable of proxying arbitrary commands (stdin/stdout) as a websocket. ws: a popular websocket client & server library for node.js. jsonr
pc-bidirectional: asynchronous r
pc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client). cowboy: cowboy is a small, fast and modern http server for erlang/otp with websocket support. related topics ajax javascript specifications specification status comments ...
Basic concepts behind Web Audio API - Web APIs
referred to as subwoofers. each input or output is composed of one or more audio channels, which together represent a specific audio layout. any discrete channel structure is supported, including mono, stereo, quad, 5.1, and so on. audio sources can be obtained in a number of ways: sound can be generated directly in javascript by an audio node (such as an oscillator). created from raw
pcm data (the audio context has methods to decode supported audio formats). taken from html media elements (such as <video> or <audio>). taken directly from a webrtc mediastream (such as a webcam or microphone). audio data: what's in a sample when an audio signal is processed, sampling means the conversion of a continuous signal to a discrete signal; or put another way, a continuous sound wave,...
Web Storage API - Web APIs
rowser crashes/restarts, the amount of data saved per origin is limited to 10mb. this has been done to avoid memory issues caused by excessive usage of web storage. note: access to web storage from third-party iframes is denied if the user has disabled third-party cookies (firefox implements this behaviour from version 43 onwards.) note: web storage is not the same as mozstorage (mozilla's x
pcom interfaces to sqlite) or the session store api (an x
pcom storage utility for use by extensions). web storage interfaces storage allows you to set, retrieve and remove data for a specific domain and storage type (session or local.) window the web storage api extends the window object with two new properties — window.sessionstorage and window.localstorage — which provide access to the...
Functions and classes available to Web Workers - Web APIs
upport workerglobalscope the global scope of workers. this objects defines worker-specific functions. (yes) 10.0 (yes) (yes) workerlocation the subset of the location interface available to workers. 3.6 (1.9.2) 10.0 (yes) (yes) workernavigator the subset of the navigator interface available to workers. basic implementation (yes) ap
pcodename, product, taintenabled(): 28 (28) online: 29 (29) navigatorlanguage: (yes) appname, appversion, online, platform, useragent: 10.0 other: no support (yes) (yes) xmlhttprequest creates and returns a new xmlhttprequest object; this mimics the behavior of the standard xmlhttprequest() constructor. note that the responsexml and channel attributes on xmlhttprequ...
Window.stop() - Web APIs
ion browser compatibility the compatibility table in 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. ...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
1.5 seconds the myarray.mymethod function is passed to settimeout, then when it's called, its this is not set so it defaults to the window object. there's also no option to pass a thisarg to settimeout as there is in array methods like foreach, reduce, etc. and as shown below, using call to set this doesn't work either. ...
WorkerGlobalScope.navigator - Web APIs
u will get a workernavigator object written to the console — something like the following: object {online: true, useragent: "mozilla/5.0 (macintosh; intel mac os x 10_10_1) ap…ml, like gecko) chrome/40.0.2214.93 safari/537.36", product: "gecko", platform: "macintel", appversion: "5.0 (macintosh; intel mac os x 10_10_1) applewebki…ml, like gecko) chrome/40.0.2214.93 safari/537.36"…} ap
pcodename: "mozilla" appname: "netscape" appversion: "5.0 (macintosh; intel mac os x 10_10_1) applewebkit/537.36 (khtml, like gecko) chrome/40.0.2214.93 safari/537.36" hardwareconcurrency: 4 online: true platform: "macintel" product: "gecko" useragent: "mozilla/5.0 (macintosh; intel mac os x 10_10_1) applewebkit/537.36 (khtml, like gecko) chrome/40.0.2214.93 safari/537.36...
WorkerNavigator - Web APIs
w lock object and querying for an existing lock object. workernavigator.permissions read only returns a permissions object that can be used to query and update permission status of apis covered by the permissions api. navigator.storageread only returns a storagemanager interface for managing persistance permissions and estimating available storage. inherited properties navigatorid.ap
pcodename read only always returns 'mozilla', in any browser. this property is kept only for compatibility purposes. navigatorid.appname read only returns the official name of the browser. do not rely on this property to return the correct value. navigatorid.appversion read only returns the version of the browser as a string. do not rely on this property to return the correct value. navi...
Accessibility Information for Web Authors - Accessibility
guidelines and regulations section 508 guidelines for web authors these guidelines must be followed by u.s. websites. other organizations such as schools are starting to follow these guidelines as well. web content accessibility guidelines (wcag) 1.0 another important set of guidelines from the w3c web accessibility initiative (wai). the european union is looking to base their u
pcoming accessibility regulations on these guidelines. these guidelines are discussed on the wai interest group discussion list. how-to's key-navigable custom dhtml widgets in mozilla & ie this document discusses how to use tabindex, element.focus() and onkeypress to make custom dhtml widgets such as menus or tree views keyboard accessible. accessible web page authoring ibm has put to...
CSS Properties Reference - CSS: Cascading Style Sheets
borderleftcolor border-left-style borderleftstyle border-left-width borderleftwidth border-right borderright border-right-color borderrightcolor border-right-style borderrightstyle border-right-width borderrightwidth border-style borderstyle border-top bordertop border-top-color borderto
pcolor border-top-style bordertopstyle border-top-width bordertopwidth border-width borderwidth clear clear clip clip color color cursor cursor display display filter filter float cssfloat font font font-family fontfamily font-size fontsize ...
border-top - CSS: Cascading Style Sheets
on browser compatibility the compatibility table in 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. ...
font-variant-caps - CSS: Cascading Style Sheets
use of alternate glyphs. small-caps enables display of small capitals (opentype feature: smcp). small-caps glyphs typically use the form of uppercase letters but are reduced to the size of lowercase letters. all-small-caps enables display of small capitals for both upper and lowercase letters (opentype features: c2sc, smcp). petite-caps enables display of petite capitals (opentype feature:
pcap). all-petite-caps enables display of petite capitals for both upper and lowercase letters (opentype features: c2
pc,
pcap). unicase enables display of mixture of small capitals for uppercase letters with normal lowercase letters (opentype feature: unic). titling-caps enables display of titling capitals (opentype feature: titl). uppercase letter glyphs are often designed for use with lowerc...
image-set() - CSS: Cascading Style Sheets
ption># ) where <image-set-option> = [ <image> | <string> ] <resolution> and <string> is an <url> values most commonly you'll see an url() <string> value, but the <image> can be any image type except for an image set. the image-set() function can not be nested inside another image-set() function. <resolution> units include x or dppx, for dots per pixel unit, dpi, for dots per inch, and d
pcm for dots per centimeter. every image within an image-set() must have a unique resolution. examples background-image: image-set( "cat.png" 1x, "cat-2x.png" 2x, "cat-print.png" 600dpi); this example shows how to use image-set() to provide two alternative background-image options, chosen depending on the resolution needed: a normal versio...
transform-box - CSS: Cascading Style Sheets
s the center of the svg canvas, and so you get a very different effect. svg{ width:80vh; border:1px solid #d9d9d9; position:absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; } #box{ transform-origin:50% 50%; /*+++++++++++++++++++++++++++*/ /* if i remove this rule the pen won't work properly on chrome for mac, ff, safari will still work properly on chrome for
pc & opera*/ transform-box: fill-box; /*alternatively i can use transform-origin:15px 15px;*/ /*+++++++++++++++++++++++++++*/ animation: rotatebox 3s linear infinite; } @keyframes rotatebox { to { transform: rotate(360deg); } full credit for this example goes to pogany; see this codepen for a live version. specifications specification status comment c...
Event reference
nt when the browser <iframe> content scrolls. mozbrowserscrollareachanged firefox os browser api-specific sent when the available scrolling area in the browser <iframe> changes. this can occur on resize and when the page size changes (while loading for example.) mozbrowserscrollviewchange firefox os browser api-specific sent when asynchronous scrolling (i.e. a
pcz) starts or stops. mozbrowsersecuritychange firefox os browser api-specific sent when the ssl state changes within a browser <iframe>. mozbrowserselectionstatechanged firefox os browser api-specific sent when the text selected inside the browser <iframe> content changes. note that this is deprecated, and newer implementations use mozbrowsercaretstatechanged...
Cross-browser audio basics - Developer guides
ternet explorer 9+ opera 10.5+ safari 4+ mobile mobile browser version chrome (android) 32+ firefox (android) 26+ ie mobile 10+ opera mobile 11+ safari (ios) 4+ android browser 2.3+ blackberry 7+ audio codec support browser ogg mp3 aac
pcm opus firefox 3.5+ ✓ ✓ *26+ ✓ ✓ *14+ safari 5+ ✓ ✓ chrome 6+ ✓ ✓ ✓ ✓ *9+ opera 10.5+ ✓ internet explorer 9+ ✓ ✓ firefox mobile ✓ ✓ ✓ ✓ ✓ safari ios3+ ✓ ✓ ✓ *4.2+ ...
Live streaming web audio and video - Developer guides
ird-party services. gstreamer gstreamer is an open source cross-platform multimedia framework that allows you to create a variety of media-handling components, including streaming components. through its plugin system, gstreamer provides support for more than a hundred codecs (including mpeg-1, mpeg-2, mpeg-4, h.261, h.263, h.264, realvideo, mp3, wmv, and flv.) gstreamer plugins such as souphtt
pclientsink and shout2send exist to stream media over http. you can also integrate with python's twisted framework or use something like flumotion (open source streaming software). for rtmp transfer you can use the nginx rtmp module. shoutcast shoutcast is a cross-platform proprietary technology for streaming media. developed by nullsoft, it allows digital audio content in mp3 or aac format to be...
Separate sites for mobile and desktop - Developer guides
this factor aside, there is one case where this strategy really shines over other methods. if the functionality you would like to provide to your users on mobile devices is extremely different from that on a desktop, then using separate sites is simply likely to be the most practical choice. this is because you have the option of sending completely separate html, javascript, and css to phones and
pcs. another case where you may be forced to use this approach is if you cannot, for whatever reason, modify your existing desktop site, and need to have a 100% separate mobile site. though it’s not ideal, at least you have this option. examples most of the major web applications you see in the wild have chosen this path, including facebook, youtube, digg, and flickr. in fact, mozilla picked this ...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
"> </figure> <!-- image with a caption --> <figure> <img src="https://udn.realityripple.com/samples/6c/98485e5d8a.png" alt="the beautiful mdn logo."> <figcaption>mdn logo</figcaption> </figure> code snippets <figure> <figcaption>get browser details using <code>navigator</code>.</figcaption> <pre> function navigatorexample() { var txt; txt = "browser codename: " + navigator.ap
pcodename + "; "; txt+= "browser name: " + navigator.appname + "; "; txt+= "browser version: " + navigator.appversion + "; "; txt+= "cookies enabled: " + navigator.cookieenabled + "; "; txt+= "platform: " + navigator.platform + "; "; txt+= "user-agent header: " + navigator.useragent + "; "; console.log("navigatorexample", txt); } </pre> </figure> quotations <figure> <figcapti...
<template>: The Content Template element - HTML: Hypertext Markup Language
htmltemplateelement has a content property, which is a read-only documentfragment containing the dom subtree which the template represents. note that directly using the value of the content could lead to unexpected behavior, see avoiding documentfragment pitfall section below. examples first we start with the html portion of the example. <table id="producttable"> <thead> <tr> <td>u
pc_code</td> <td>product_name</td> </tr> </thead> <tbody> <!-- existing data could optionally be included here --> </tbody> </table> <template id="productrow"> <tr> <td class="record"></td> <td></td> </tr> </template> first, we have a table into which we will later insert content using javascript code. then comes the template, which describes the structure of an ht...
<textarea> - HTML: Hypertext Markup Language
yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeswra
pchrome full support yesedge full support 12firefox full support yesie full support yesopera full support yessafari full support yes...
HTML documentation index - HTML: Hypertext Markup Language
r netscape navigator, and one for microsoft internet explorer. when the web standards were made at w3c, browsers could not just start using them, as doing so would break most existing sites on the web. browsers therefore introduced two modes to treat new standards compliant sites differently from old legacy sites. 237 using the application cache advanced, app, cache, guide, html, ap
pcache, application cache, web cache html5 provides an application caching mechanism that lets web applications run offline. this application cache (ap
pcache) interface lists resources that browsers should cache to be available offline. applications that are cached load and work correctly offline, even if users press the refresh button. a comprehensive index list of all the available html...
MIME types (IANA media types) - HTTP
level, or other such information. the most commonly used mime types used for web content are listed below. this isn't a complete list of all the types that may be available, however. see the media container formats guide for that. mime type audio or video type audio/wave audio/wav audio/x-wav audio/x-pn-wav an audio file in the wave container format. the
pcm audio codec (wave codec "1") is often supported, but other codecs have limited support (if any). audio/webm an audio file in the webm container format. vorbis and opus are the codecs officially supported by the webm specification. video/webm a video file, possibly with audio, in the webm container format. vp8 and vp9 are the most common video codecs; vorbis and opus the m...
Browser detection using the user agent - HTTP
kotrail). os the operating system is given in most user agent strings (although not web-focused platforms like firefox os), but the format varies a lot. it is a fixed string between two semi-colons, in the comment part of the user agent. these strings are specific for each browser. they indicate the os, but also often its version and information on the relying hardware (32 or 64 bits, or intel/p
pc for mac). like in all cases, these strings may change in the future, one should use them only in conjunction with the detection of already released browsers. a technological survey must be in place to adapt the script when new browser versions are coming out. mobile, tablet or desktop the most common reason to perform user agent sniffing is to determine which type of device the browser runs on...
Compression in HTTP - HTTP
this header in the response; that way, caches will be able to cache the different representations of the resource. as compression brings significant performance improvements, it is recommended to activate it for all files, but already compressed ones like images, audio files and videos. apache supports compression and uses mod_deflate; for nginx there is ngx_http_gzip_module; for iis, the <htt
pcompression> element. hop-by-hop compression hop-by-hop compression, though similar to end-to-end compression, differs by one fundamental element: the compression doesn't happen on the resource in the server, creating a specific representation that is then transmitted, but on the body of the message between any two nodes on the path between the client and the server. connections between successiv...
Clear-Site-Data - HTTP
er wishes to remove all dom storage for the origin of the response url. this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), ap
pcache, websql databases, filesystem api data, plugin data (flash via npp_clearsitedata). "executioncontexts" indicates that the server wishes to reload all browsing contexts for the origin of the response (location.reload). "*" (wildcard) indicates that the server wishes to clear all types of data for the origin of the response. if more data types are added in future versions of this ...
Public-Key-Pins-Report-Only - HTTP
d by user agents and the header will not be cached. includesubdomains optional if this optional parameter is specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" pin validation failures are reported to the given url. this directive should be used with this header, otherwise this header will be a no-op. example public-key-pins-report-only: pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production. the second pin declaration pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe=" also pins the ...
Public-Key-Pins - HTTP
ecified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" optional if this optional parameter is specified, pin validation failures are reported to the given url. example hpkp has the potential to lock out users for a long time if used incorrectly! the use of backup certificates and/or pinning the ca certificate is recommended. public-key-pins: pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production. the second pin declaration pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe...
Firefox user agent string reference - HTTP
windows nt on x64 cpu mozilla/5.0 (windows nt x.y; win64; x64; rv:10.0) gecko/20100101 firefox/10.0 macintosh here, x.y is the version of mac os x (for instance, mac os x 10.6). mac os x version gecko user agent string mac os x on intel x86 or x86_64 mozilla/5.0 (macintosh; intel mac os x x.y; rv:10.0) gecko/20100101 firefox/10.0 mac os x on power
pc mozilla/5.0 (macintosh; p
pc mac os x x.y; rv:10.0) gecko/20100101 firefox/10.0 linux linux is a more diverse platform. your distribution of linux might include an extension that changes your user-agent. a few common examples are given below. linux version gecko user agent string linux desktop on i686 cpu mozilla/5.0 (x11; linux i686; rv:10.0) gecko/20100101...
HTTP Public Key Pinning (HPKP) - HTTP
bin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 the following command will extract the base64 encoded information for a website. openssl s_client -servername www.example.com -connect www.example.com:443 | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64 example hpkp header public-key-pins: pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production. the second pin declaration pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe...
Enumerability and ownership of properties - JavaScript
return obj.propertyisenumerable(prop); }, _notenumerable: function(obj, prop) { return !obj.propertyisenumerable(prop); }, _enumerableandnotenumerable: function(obj, prop) { return true; }, // inspired by http://stackoverflow.com/a/8024294/271577 _getpropertynames: function getallpropertynames(obj, iterateselfbool, iterateprototypebool, includepro
pcb) { var props = []; do { if (iterateselfbool) { object.getownpropertynames(obj).foreach(function(prop) { if (props.indexof(prop) === -1 && includepro
pcb(obj, prop)) { props.push(prop); } }); } if (!iterateprototypebool) { break; ...
getter - JavaScript
avior. in the following example, the object has a getter as its own property. on getting the property, the property is removed from the object and re-added, but implicitly as a data property this time. finally, the value gets returned. get notifier() { delete this.notifier; return this.notifier = document.getelementbyid('bookmarked-notification-anchor'); }, for firefox code, see also the x
pcomutils.jsm code module, which defines the definelazygetter() function. get vs. defineproperty while using the get keyword and object.defineproperty() have similar results, there is a subtle difference between the two when used on classes. when using get the property will be defined on the instance's prototype, while using object.defineproperty() the property will be defined on the instance it ...
Intl.Locale.prototype.numberingSystem - JavaScript
n japanese financial numerals — algorithmic jpanyear japanese first-year gannen numbering for japanese calendar kali kayah li digits khmr khmer digits knda kannada digits lana tai tham hora (secular) digits lanatham tai tham tham (ecclesiastical) digits laoo lao digits latn latin digits le
pc le
pcha digits limb limbu digits mathbold mathematical bold digits mathdbl mathematical double-struck digits mathmono mathematical monospace digits mathsanb mathematical sans-serif bold digits mathsans mathematical sans-serif digits mlym malayalam digits modi modi digits mong mongolian di...
Intl.NumberFormat() constructor - JavaScript
f the locales argument, see the intl page. the following unicode extension key is allowed: nu the numbering system to be used. possible values include: "adlm", "ahom", "arab", "arabext", "bali", "beng", "bhks", "brah", "cakm", "cham", "deva", "diak", "fullwide", "gong", "gonm", "gujr", "guru", "hanidec", "hmng", "hmnp", "java", "kali", "khmr", "knda", "lana", "lanatham", "laoo", "latn", "le
pc", "limb", "mathbold", "mathdbl", "mathmono", "mathsanb", "mathsans", "mlym", "modi", "mong", "mroo", "mtei", "mymr", "mymrshan", "mymrtlng", "newa", "nkoo", "olck", "orya", "osma", "rohg", "saur", "segment", "shrd", "sind", "sinh", "sora", "sund", "takr", "talu", "tamldec", "telu", "thai", "tibt", "tirh", "vaii", "wara", "wcho". options optional an object with some or all of the following...
JavaScript shells - JavaScript
se integration, gtk2 for gui apps, posix for system programming, etc. the best of cpan now for javascript programmers. shelljs - portable unix shell commands for node.js list of javascript shells the following javascript shells work with mozilla. firefox has a built-in javascript console, which support multi-line editing. javascript shell (js) - a command line interpreter for javascript x
pcshell is an x
pconnect - enabled shell, sometimes useful for mozilla development. babel repl - a browser-based repl for experimenting with future javascript. es6console.com - an open-source javascript console to test ecmascript 2015 code inside the browser. jsconsole.com -- an open-source javascript console with the ability to easily link to particular expressions javascript shell (web page) - ...
Values - MathML
erent 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.16666666666666666em mediummathspace => 0.2222222222222222em thickmathspace => 0.2777777777777778em verythickm...
The "codecs" parameter in common media types - Web media technologies
the media more precisely and a is the one-digit audio oti. the possible values for the oti can be found on the mp4 registration authority web site's object types page. for example, opus audio in an mp4 file is mp4a.ad. for further details, see mpeg-4 audio. mp4v.oo[.v] (mpeg-4 video) here, oo is again the oti describing the contents more precisely, while v is the one-digit video oti. avc1.oo[.p
pccll] (avc video) oo is the oti describing the contents, while p
pccll is six hexadecimal digits specifying the profile number (pp), constraint set flags (cc), and level (ll). see avc profiles for the possible values of pp. the constraint set flags byte is comprised of one-bit boolean flags, with the most significant bit being referred to as flag 0 (or constraint_set0_flag, in some resources), ...
Progressive web app structure - Progressive web apps (PWAs)
tween pages is smooth because the client can re-render the page with only the parts that have changed. pwas can be built using any approach you like, but some will work better than the others. the most popular approach is the "app shell" concept, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in u
pcoming articles and use in our example application. there is also a new approach involving the streams api, which we'll mention briefly. app shell the app shell concept is concerned with loading a minimal user interface as soon as possible and then caching it so it is available offline for subsequent visits before then loading all the contents of the app. that way, the next time someone visits th...
Structural overview of progressive web apps - Progressive web apps (PWAs)
between pages is smooth because the client can re-render the page with only the parts that have changed. pwas can be built using any approach you like, but some will work better than the others. the most popular approach is the app shell concept, which mixes ssr and csr in exactly the way described above, and in addition follows the "offline first" methodology which we will explain in detail in u
pcoming articles and use in our example application. there is also a new approach involving the streams api, which we'll mention briefly. the app shell concept the app shell concept is concerned with loading a minimal user interface and content as soon as possible, caching it so it's available offline for subsequent visits before then loading the remainder of the app's contents. that way, the next...
stroke-linecap - SVG: Scalable Vector Graphics
> 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. ...