Search completed in 1.32 seconds.
1266 results for "pc":
Your results are loading. Please wait...
nsIXPConnect
js/src/xpconnect/idl/nsixpconnect.idlnot scriptable provides the xpconnect service.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to access the xpconnect service, use code like this: nsresult rv; nscomptr<nsixpconnect> xpconnect = do_getservice(nsixpconnect::getcid(), &rv); if (ns_succeeded(rv)) { /* use the object */ } method overview void addjsholder(in voidptr aholder, in nsscriptobjecttracerptr atracer); native code only!
... void clearallwrappednativesecuritypolicies(); nsixpconnectjsobjectholder createsandbox(in jscontextptr cx, in nsiprincipal principal); native code only!
...And 57 more matches
An Overview of XPCOM
« previousnext » this is a book about xpcom.
... the book is presented as a tutorial about creating xpcom components, but it covers all major aspects, concepts, and terminology of the xpcom component model along the way.
... this chapter provides a quick tour of xpcom - an introduction to the basic concepts and technologies in xpcom and component development.
...And 50 more matches
Using XPCOM Components
« previousnext » one of the best ways to begin working with xpcom - especially when you are designing the interface to a component that will be used by others, as we do in starting weblock - is to look at how clients are already using xpcom components.
... applications like the mozilla browser are sophisticated, modularized clients of xpcom 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 xpcom components and accessed by means of those component interfaces.
...And 40 more matches
XPCOM
xpcom is a cross platform component object model, similar to microsoft com.
... it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++.
... interfaces in xpcom are defined in a dialect of idl called xpidl.
...And 31 more matches
platform/xpcom - Archive of obsolete content
implement xpcom objects, factories, and services.
... usage the xpcom module makes it simpler to perform three main tasks: implement xpcom object interfaces implement and register xpcom factories implement and register xpcom services if all you need to do is use xpcom 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 xpcom objects from there.
...And 28 more matches
XPCOM Objects - Archive of obsolete content
« previousnext » xpcom xpcom is a cross platform component object model, similar to microsoft com.
... taken from the xpcom page.
... xpcom is the way in which the two layers (xulrunner and chrome) communicate.
...And 23 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
this chapter explains how to use xpcom to implement advanced processes using only javascript.
...internet explorer handles this using activex; in firefox, we use the cross-platform component object model, or xpcom.
... about xpcom xpcom is a framework for developing platform-independent components.
...And 22 more matches
XPCOM glue
MozillaTechXPCOMGlue
the xpcom glue is a static library which component developers and embedders can link against.
... it allows developers to link only against the frozen xpcom method symbols and maintain compatibility with multiple versions of xpcom.
... compiling or linking against xpcom headers there are three ways to compile/link against xpcom headers/libraries: frozen linkage: dependent glue (dependent on xpcom.dll) xpcom modules, i.e.
...And 22 more matches
How to build an XPCOM component in JavaScript
if you are looking for add-on sdk solution for xpcom javascript components then check out platform/xpcom module first.
... this is a "hello world" tutorial for creating an xpcom component in javascript.
... this tutorial does not describe how and why xpcom works the way it does, or what every bit of the example code does.
...And 20 more matches
XPCOM changes in Gecko 2.0
several changes that affect xpcom component compatibility are taking place in gecko 2.
...documentation will be updated as time allows to remove references to interfaces being "frozen" or "unfrozen." component registration the way xpcom components are registered changed in gecko 2.
...if you used xpcomutils.jsm, some of this was hidden from you, but it was still there.
...And 20 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 xpcom 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 xpcom and gecko.
... xpcom macros the xpcom framework includes a number of macros for making c++ development easier.
...And 17 more matches
Introduction to XPCOM for the DOM
this document is an introduction to the use of xpcom in the context of the dom code.
... the use of xpcom 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 xpcom page.
...And 14 more matches
nsIXPCScriptable
note: this is not really an xpcom interface.
... js/src/xpconnect/idl/nsixpcscriptable.idlnot scriptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void precreate(in nsisupports nativeobj, in jscontextptr cx, in jsobjectptr globalobj, out jsobjectptr parentobj); void create(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool addproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool delproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool getproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id...
...And 13 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
xulrunner ships with the javaxpcom component, which allows java code to interact with xpcom objects.
... as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++.
...this library provides the interfaces necessary to bootstrap mozilla and call xpcom methods.
...And 12 more matches
XPCOMUtils.jsm
the xpcomutils.jsm javascript code module offers utility routines for javascript components loaded by the javascript component loader.
... to use this, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/xpcomutils.jsm"); using xpcomutils exposing a javascript class as a component using these utility methods requires four key steps: import xpcomutils.jsm, as explained previously.
... mycomponent.prototype = { // properties required for xpcom registration: classdescription: "unique text description", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@example.com/xxx;1", // [optional] custom factory (an object implementing nsifactory).
...And 12 more matches
Avoiding leaks in JavaScript XPCOM components
using xpcom in javascript (also known as xpconnect) is an environment where memory management issues are not obvious.
... programmers writing and reviewing javascript code in mozilla should understand how code using xpcom in javascript can leak so that they can avoid leaks.
... this is the strategy used by xpcom, partly because it can be used through a very simple api, addref and release.
...And 12 more matches
How to build a binary XPCOM component using Visual Studio
this is a simple tutorial for building xpcom objects in c++ using visual studio.
... xpcom is mozilla’s cross platform component object model, similar to microsoft’s com technology.
... xpcom components can be implemented in c, c++, and javascript, and can be used from c, c++, and javascript.
...And 12 more matches
Standalone XPCOM - Archive of obsolete content
standalone xpcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of xpcom.
... the contents of this standalone xpcom in general are: nspr : mozilla/nsprpub xpcom : mozilla/xpcom note 1: xpcom apis are not frozen yet.
... by xpcom 1.0 release they will be.
...And 11 more matches
Creating a Python XPCOM component
here is how to make the same component in python using pyxpcom.
... (note that some details may be missing.) preparation if a binary of pyxpcom is not available, you will need to build it - see building pyxpcom.
... tip: you can achieve a copy of binary of pyxpcom from pythonext; simply unpack xpi and take everything you need.
...And 11 more matches
xpcshell
xpcshell is an xpconnect-enabled javascript shell.
...unlike the ordinary js shell (js), xpcshell lets the scripts running in it access xpcom functionality.
... prerequisites you need your own build of mozilla to use xpcshell.
...And 11 more matches
XPCOM ABI
xpcom abi is the binary interface of xpcom components.
... while xpcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) require recompilation when moving to a different platform.
... often, compiled xpcom components are called 'binary' or 'native'.
...And 11 more matches
JS XPCOM - Archive of obsolete content
here are a few useful snippets of code for dealing with xpcom components in javascript.
... contract ids a contract id is a unique name for an xpcom object.
... they are used to create or access well-known objects in xpcom.
...And 10 more matches
PyXPCOM
pyxpcom allows for communication between python and xpcom, such that a python application can access xpcom objects, and xpcom can access any python class that implements an xpcom interface.
... pyxpcom is actively used in activestate komodo products, for example.
... with pyxpcom, a developer can talk to xpcom or embed gecko from a python application.
...And 10 more matches
XPConnect wrappers
this document is a high-level overview of xpconnect wrapper objects (for the more technical description see xpconnect security membranes).
... developers in the know understand that wrappers play a large role in xpconnect, and that we have a lot of them.
... basic xpconnect objects xpcwrappednative these objects are created when any natively implemented xpcom object (that is, any object implemented in c++) needs to be reflected into javascript.
...And 10 more matches
NS_InitXPCOM3
« xpcom api reference summary the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules.
... #include "nsxpcom.h" nsresult ns_initxpcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, nsstaticmoduleinfo const* astaticmodules, pruint32 astaticmodulecount ); parameters aresult [out] the resulting xpcom service manager.
...the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownxpcom when the application is finished with xpcom.
...And 10 more matches
XPCOM tasks
the role of xpcom the xpcom module roughly parallels the c/c++ standard libraries.
...xpcom sits above the standard libraries.
... its role is to extend them with facilities tailored to xpcom development in general, and specifically the needs of mozilla.
...And 10 more matches
XPCOM reference
this reference describes the interfaces and functions provided by the xpcom library.
... in addition, it details the various helper classes and functions, as well as the components, provided by the xpcom glue library.
... the contents herein are oriented primarily toward extension developers and people embedding xpcom in other projects.
...And 9 more matches
NS_InitXPCOM2
« xpcom api reference summary the ns_initxpcom2 function initiates use of xpcom in the calling process.
... #include "nsxpcom.h" nsresult ns_initxpcom2( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider ); parameters aresult [out] the resulting xpcom service manager.
...the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownxpcom when the application is finished with xpcom.
...And 8 more matches
XPCOM array guide
MozillaTechXPCOMGuideArrays
the standard array classes are: nsiarray - a scriptable container for scriptable xpcom objects.
... nsimutablearray - a scriptable container for scriptable xpcom objects, which allows addition and removal of member objects.
... ownership nsiarray xpcom object yes no no no reference counted, weak/strong nsimutablearray xpcom object yes no yes no reference counted, weak/strong nscomarray<t> xpcom 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...
...And 7 more matches
JavaXPCOM
javaxpcom allows for communication between java and xpcom, such that a java application can access xpcom objects, and xpcom can access any java class that implements an xpcom interface.
... javaxpcom is not actively maintained.
... with javaxpcom, a developer can talk to xpcom or embed gecko from a java application.
...And 7 more matches
XPCOM Interfaces - Archive of obsolete content
« previousnext » in this section, we'll take a brief look at xpcom (cross-platform component object model), which is the object system that mozilla uses.
...mozilla provides such a method which involves using xpcom (cross-platform component object model).
... mozilla provides many xpcom components and interfaces.
...And 6 more matches
Creating XPCOM components
next » this guide is about gecko, and about creating xpcom 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 xpcom.
... accordingly, the book is arranged so that you can follow along and create your own components or learn about different xpcom topics individually, as in a reference work.
...And 6 more matches
XPCShell Reference
the command line the command-line syntax for xpcshell is: xpcshell [-s] [-w] [-w] [-v version] [-f scriptfile] [scriptfile] [scriptarg...] -c this option turns on the "compile-only" mode.
...xpcshell terminates upon script completion.
... furthermore, xpcshell looks for xpcshell.js in the current directory.
...And 5 more matches
Fun With XBL and XPConnect
introduction this article describes an application of xbl in which a simple xpcom interface is made accessible to a xul widget.
... the interface definition feature of xbl is used to define an interface through xpconnect to a c++ object that does auto completion.
...the basic model of interaction is as follows: binding to the xpcom object the widget holds onto an xpcom object that is the auto complete engine that will perform our auto complete lookups.
...And 4 more matches
Detailed XPCOM hashtable guide
this is the long version of xpcom hashtable guide.
... any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else.
...a basic guide is included here, but you should read most of xpcom/glue/pldhash.h if you intend to use pldhash.
...And 4 more matches
XPCOM guide
MozillaTechXPCOMGuide
these articles provide tutorials and usage documentation for xpcom, including how to use it in your own projects and how to build xpcom components for your firefox add-ons and the like.
... avoiding leaks in javascript xpcom componentsprogrammers writing and reviewing javascript code in mozilla should understand how code using xpcom 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.creating xpcom componentsthis guide is about gecko, and about creating xpcom components for gecko-based applications.how to build an xpcom component in javascriptif you are looking for add-on sdk solution for xpcom javascript components then check out platform/xpcom module first.inheriting from implementation classesgiven that idl interfaces map to abstract classes in c++, a common problem when dealing with idl is when you have an idl inheritance hierarchy, and a corresponding c++ implementation hierarchy, you run into multiple inheritance.
...And 4 more matches
XPConnect
xpconnect is a bridge between javascript and xpcom.
... with xpconnect, you can use xpcom components from javascript code, and interact with javascript objects from within xpcom components.
... xpconnect is part of firefox and is actively used in xul applications.
...And 4 more matches
nsIXmlRpcClient
extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable please add a summary to this article.
... thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly nsiurl the url of the xml-rpc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlrpcfault the most recent xml-rpc fault from returned from this server.
... null if the last call didn't return an xml-rpc fault.
...And 4 more matches
XPCOM Glue without mozalloc
starting with xulrunner 2.0, the frozen linkage dependent glue (xpcomglue_s.lib on windows, libxpcomglue_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, xpcom 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 xpcomglue_s_nomozalloc instead (xpcomglue_s_nomozalloc.lib on windows, libxpcomglue_s_nomozalloc.a on linux and mac).
...And 3 more matches
Profiling XPCShell
introduction sometimes, you might want to get a performance profile of a certain piece of javascript (like an xpcom module), to see which part takes the most time.
...in those cases, an xpcshell script can help.
...xpctools there is profiler in the tree that can profile xpcshell scripts.
...And 3 more matches
NS_ShutdownXPCOM
« xpcom api reference summary the ns_shutdownxpcom function terminates use of xpcom in the calling process.
... #include "nsxpcom.h" nsresult ns_shutdownxpcom( nsiservicemanager* asvcmanager ); parameters asvcmanager [in] the nsiservicemanager instance that was returned by ns_initxpcom2 (or ns_initxpcom3) or null.
... return values the ns_shutdownxpcom function returns ns_ok if successful.
...And 3 more matches
Using XPCOM without chrome - Archive of obsolete content
using sdk xpcom with the low-level module sdk/platform/xpcom , it's possible to exclude chrome and xpcomutils in some cases.
... below is an example for the xpcom bookmark observer.
... examples bookmarks observer normally, a bookmark observer would require chrome components and xpcomutils as described in the following links: (observing changes to bookmarks and tags) , (creating event targets).
...And 2 more matches
Using LDAP XPCOM with XULRunner - Archive of obsolete content
by default, xulrunner is built without ldap xpcom support.
... if you want to use ldap components in your xul application, you have two options : compile xulrunner with ldap support enabled, or add ldap xpcom directly to your xul app (in the components directory).
... in any case, you will have to build ldap xpcom, by adding --enable-ldap build option.
...And 2 more matches
XPCOM glue classes
these "glue" classes are provided to make it easier to use xpcom from c++ code.
... when these classes are used by a component, you may need to link the component against the xpcom glue library.
... 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 xpcom 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 ...
...And 2 more matches
nsIXPCException
js/src/xpconnect/idl/xpcexception.idlscriptable these exception objects are the preferred types of exceptions when implementing xpcom 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); xpcexjsval stealjsval(); native code only!
... void stowjsval(in xpcexjscontextptr cx, in xpcexjsval val); native code only!
...And 2 more matches
RTCRtpCapabilities - Web APIs
the rtcrtpcapabilities dictionary is a data type used to describe the capabilities of an rtcrtpsender or rtcrtpreceiver in response to a call to the rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities() static functions, both of which return an array of rtcrtpcapabilities objects.
... an rtcrtpcapabilities object contains an array of objects conforming to rtcrtpcodeccapability (each describing the capabilities of one codec) and an array of the supported rtp header extensions for that codec.
... properties codecs an array of rtcrtpcodeccapability objects, each describing one of the codecs supported by the rtcrtpsender or rtcrtpreceiver.
...And 2 more matches
NPClass - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e.
... syntax struct npclass { 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; npconstructfunctionptr construct; }; warning: don't call these routines directly.
... function pointer syntax typedef npobject *(*npallocatefunctionptr)(npp npp, npclass *aclass); typedef void (*npdeallocatefunctionptr)(npobject *npobj); typedef void (*npinvalidatefunctionptr)(npobject *npobj); typedef bool (*nphasmethodfunctionptr)(npobject *npobj, npidentifier name); typedef bool (*npinvokefunctionptr)(npobject *npobj, npidentifier name, const npvariant *args, uint32_t argcount, npvaria...
...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 (*npconstructfunctionptr)(npobject *npobj, const npvariant *args, uint32_t argcount, npvariant *result); see also npobject ...
XPCOM Interface Reference
this is a reference to the xpcom interfaces provided by the mozilla platform.
...amiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsierrorservicensieventlistenerinfonsieventlistenerservicensieventsourcensieventtargetnsiexceptionnsiextensionmanagernsiexternalhelperappservicensiexternalprotocolservicensiexternalurlhandlerservicensiftpchannelnsiftpeventsinknsifactorynsifavicondatacallbacknsifaviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifileurlnsifileutilitiesnsifileviewnsifocusmanage...
...rnsiformhistory2nsiframeloadernsiframeloaderownernsiframemessagelistenernsiframemessagemanagernsiframescriptloadernsigsettingscollectionnsigsettingsservicensigeolocationprovidernsigeolocationupdatensiglobalhistorynsiglobalhistory2nsiglobalhistory3nsihtmleditornsihttpheaderlistenernsihapticfeedbacknsihttpactivitydistributornsihttpactivityobservernsihttpchannelnsihttpchannelinternalnsihttpheadervisitornsihttpservernsihttpupgradelistenernsiidnservicensiiframeboxobjectnsiiniparsernsiiniparserfactorynsiiniparserwriternsiioservicensiidleservicensiinprocesscontentframemessagemanagernsiinputstreamnsiinputstreamcallbacknsiinstalllocationnsiinterfacerequestornsijscidnsijsidnsijsiidnsijsonnsijetpacknsijetpackservicensijumplistbuildernsijumplistitemnsilivemarkservicensiloadgroupnsilocalfilensilocalfilem...
...iwinapphelpernsiwintaskbarnsiwindowcreatornsiwindowmediatornsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobalscopensiworkermessageeventnsiworkermessageportnsiworkerscopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsixmlhttprequestnsixmlhttprequesteventtargetnsixmlhttprequestuploadnsixpcexceptionnsixpcscriptablensixpconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlrpcclientnsixmlrpcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusns...
RTCRtpCodecCapability - Web APIs
the webrtc api's rtcrtpcodeccapability dictionary provides information describing the capabilities of a single media codec.
... description rtcrtpcodeccapabilities 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 rtcrtpcapabilities 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 'rtcrtpcodeccapability' in that specification.
RTCRtpContributingSource.audioLevel - Web APIs
the read-only audiolevel property of the rtcrtpcontributingsource interface indicates the audio level contained in the last rtp packet played from the described source.
... syntax var audiolevel = rtcrtpcontributingsource.audiolevel value a double-precision floating-point number which indicates the volume level of the audio in the most recently received rtp packet from the source described by the rtcrtpcontributingsource.
... for both rtcrtpcontributingsource 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 rtcrtpcontributingsource objects, which indicates that no volume level was provided by the source; however, it is required and always available on all rtcrtpsynchronizationsource objects.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
the new mozilla xpcom architecture allows xpcom components be scriptable via a different mechanism called xpconnect.
...l code will do the job:</p> this should be changed, we shouldn't advocate embed <embed type="application/plugin-mimetype"> <script language="javascript"> var embed = document.embeds[0]; embed.nativemethod(); </script> how to build and install having the built mozilla tree is probably not necessary, but building the plugin with a scriptable instance interface will require mozilla headers and the xpcom compatible idl compiler -- xpidl.exe.
... 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 xpcom.
XPCOM hashtable guide
this is the simplified version of the detailed xpcom hashtable guide.
...it is a lot faster than the xpcom hashtables due to more inlining and templating, and the api is arguably better.
... any type: almost any datatype can be used as key, including strings, integers, xpcom interface pointers, iids, and almost anything else.
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 xpcom object from a xul window's code, you can do so if you pass the xpcom object as one of the arguments to the window creation method.
... 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 xpcom object (or any other value, for that matter) in this way.
... to access the xpcom 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 "[xpconnect wrapped nsimyxpcomobject]".
Interfacing with the XPCOM cycle collector
this is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection.
... what the cycle collector does the cycle collector spends most of its time accumulating (and forgetting about) pointers to xpcom objects that might be involved in garbage cycles.
... how to make your classes participate the interface between the cycle collector and your classes can be accessed directly using the contents of xpcom/base/nscyclecollector.h, but there are convenience macros for annotating your classes in xpcom/glue/nscyclecollectionparticipant.h that are much easier to use.
Standard XPCOM components
there are a number of components provided in the standard implementation of xpcom; these are as follows.
... nscategorymanagerthe xpcom category manager.nsdirectoryservicethe xpcom directory service.
... nsobserverservicethe xpcom observer service.nsscriptableinputstreama component implementing nsiscriptableinputstream.
Core XPCOM functions
xpcom provides a number of global functions which are used to initialize and shut down the xpcom library, as well as to allocate memory, get access to services, and to instantiate interfaces.
... ns_allocinfallibly allocates a block of memory using the xpcom memory manager.ns_freefrees a block of memory using the xpcom memory manager.ns_getcomponentmanagerthe ns_getcomponentmanager function returns a reference to the xpcom component manager.ns_getcomponentregistrarthe ns_getcomponentregistrar function returns a reference to the xpcom component registrar.ns_getmemorymanagerthe ns_getmemorymanager function returns a reference to the xpcom memory manager.ns_getservicemanagerthe ns_getservicemanager function returns a reference to the xpcom service manager.ns_initxpcom2the ns_initxpcom2 function initiates use of xpcom in the calling process.ns_initxpcom3the ns_initxpcom3 function initiates use of xpcom in the calling process with support for statically defined xpcom modules.
... ns_newlocalfilethe ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.ns_newnativelocalfilethe ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.ns_reallocreallocates a block of memory using the xpcom memory manager.ns_shutdownxpcomthe ns_shutdownxpcom function terminates use of xpcom in the calling process.nsresultthe nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes.
XPCOM primitive
an xpcom primitive is an xpcom object that "boxes" a value of a primitive type.
... all xpcom primitives are scriptable, and they all implement an xpcom interface from the table below.
...the main use case is to store primitive values in a data structure that can only store xpcom objects, such as nsiarray.
XPCOM Interface Reference by grouping
01, 2010) list of mozilla interfaces as listed on the xpcom interface reference page where that page lists items by alphabetical sorting, this page attempts to group them by function.
...nsisupportsprint16 nsisupportsprint32 nsisupportsprint64 nsisupportspriority nsisupportsprtime nsisupportspruint16 nsisupportspruint32 nsisupportspruint64 nsisupportspruint8 nsisupportsstring nsisupportsvoid nsisupportsweakreference nsivariant do not use nsienumerator nsiinprocesscontentframemessagemanager nsiscriptableio nsixpcscriptable future nsixmlhttprequestupload obsolete nsixmlrpcclient nsixmlrpcfault security auth nsiauthmodule nsiauthprompt nsiauthpromptprovider nsiauthpromptwrapper nsiasyncverifyredirectcallback content nsicontentpolicy credentials nsilogininfo ...
... nsifilestreams nsifileutilities nsifileview memory nsimemory network channel nsichannel nsichanneleventsink nsirequest nsirequestobserver nsiresumablechannel nsidnsservice nsiftpchannel nsiftpeventsink nsihttpchannel nsihttpchannelinternal nsihttpheadervisitor nsiidnservice nsiprotocolhandler nsiprotocolproxycallback nsiprotocolproxyfilter nsiprotocolproxyservice nsiproxyinfo preferences nsiiniparser nsiiniparserfactory nsiprefbranch nsiprefbr...
NavigatorID.appCodeName - Web APIs
the value of the navigatorid.appcodename property is always "mozilla", in any browser.
... syntax codename = navigator.appcodename value the string "mozilla".
... specifications specification status comment html living standardthe definition of 'navigatorid.appcodename' in that specification.
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetcpcandidatetype enumerated type provides a set of domstring values representing the types of tcp candidates.
... usage notes the rtcicetcpcandidatetype type is used by the tcptype property of rtcicecandidate objects.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetcpcandidatetype' in that specification.
RTCRtpContributingSource.source - Web APIs
the read-only source property of the rtcrtpcontributingsource 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 rtcrtpcontributingsource or rtcrtpsynchronizationsource, which is based on the former.
... syntax var sourceid = rtcrtpcontributingsource.source value an unsigned, 32-bit integer value which uniquely identifies the source of rtp packets described by this rtcrtpcontributingsource (in which case the value is a csrc identifier) or rtcrtpsynchronizationsource (the value is an ssrc identifier).
popChallengeResponse - Archive of obsolete content
resultstring = crypto.popchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message.
... the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value.
XPCOM Examples - Archive of obsolete content
« previousnext » this section provides some examples of using xpcom along with some additional interfaces.
... code snippets http://kb.mozillazine.org/category:xpcom_example_code next, we'll look at how to create trees.
Accessing the Windows Registry Using XPCOM
to this end, there exist xpcom interfaces to read and write registry data.
... the examples in this document are all written in javascript using xpcom.
PlXPCOM
plxpcom (perl xpcom) provides language bindings letting you use xpcom from perl code.
... project page (mozdev) perl object definition (mozdev) developer's guide to perl xpcom (mozdev) newsgroup (mozdev) mailing list (mozdev) ...
nsIFTPChannel
the nsiftpchannel is an extension of nsisupports used to determine if a channel is an ftp channel, and offering additional information about the ftp channel.
... netwerk/protocol/ftp/nsiftpchannel.idlscriptable please add a summary to this article.
nsIHttpChannel
netwerk/protocol/http/nsihttpchannel.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.
...if the new channel supports nsihttpchannel, then it will be assigned a value to its redirectionlimit attribute one less than the value of the redirected channel's redirectionlimit attribute.
nsIHttpChannelInternal
netwerk/protocol/http/nsihttpchannelinternal.idlscriptable an internal interface for http channels.
... see also nsihttpchannel nsichannel nsihttpupgradelistener ...
nsIXmlRpcFault
extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable an xml-rpc exception.
... xml-rpc server fault codes are returned wrapped in this; access it using nsixpconnect.getpendingexception->data.
Troubleshooting XPCOM components registration
often the first time you create an xpcom component, it may fail to register correctly.
...see xpcom 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.
XPCOM category image-sniffing-services
in firefox 3, a new xpcom category was added in bug 391667 to allow "third-party" xpcom components to identify images based on their content.
... if mozilla's built-in image code cannot identify an image, then any xpcom components implementing the nsicontentsniffer interface may register under the "image-sniffing-services" category, and will be queried to determine the mime type of the image being downloaded.
Console.groupCollapsed() - Web APIs
syntax console.groupcollapsed([label]); parameters label label for the group.
... specifications specification status comment console apithe definition of 'console.groupcollapsed()' in that specification.
onMSVideoFrameStepCompleted - Web APIs
onmsvideoframestepcompleted is an event which occurs when the video frame has been stepped forward or backward one frame.
... syntax value description event property object.onmsvideoframestepcompleted = handler; attachevent method object.attachevent("onmsvideoframestepcompleted", handler) addeventlistener method object.addeventlistener("", handler, usecapture) event handler parameters val[in], type=function see also htmlvideoelement microsoft api extensions ...
RTCRtpContributingSource.rtpTimestamp - Web APIs
the read-only rtptimestamp property of the rtcrtpcontributingsource interface returns a domhighrestimestamp indicating the source-generated time at which the media contained int he packet was first sampled or obtained.
... syntax let rtptimestamp = rtcrtpcontributingsource.rtptimestamp value an integer value specifiying a source-generated timestamp indicating the time at which the media in this packet, scheduled for play out at the time indicated by timestamp, was initially sampled or generated.
RTCRtpContributingSource.timestamp - Web APIs
the read-only timestamp property of the rtcrtpcontributingsource interface returns a domhighrestimestamp indicating the most recent time of playout of an rtp packet from the source.
... syntax var domhighrestimestamp = rtcrtpcontributingsource.timestamp value a domhighrestimestamp which indicates the time at which the most recent rtp packet from the corresponding source was played out.
RTCRtpContributingSource - Web APIs
the rtcrtpcontributingsource dictionary of the the webrtc api is used by getcontributingsources() to provide information about a given contributing source (csrc), including the most recent time a packet that the source contributed was played out.
... 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 'rtcrtpcontributingsource' in that specification.
IPC Protocol Definition Language (IPDL)
ipdl, short for "ipc (inter-process communication) protocol definition language", is a mozilla-specific language allowing c++ code to pass messages between processes or threads in an organized and secure way.
IPC Semaphores
note: see also named shared memory ipc semaphore functions ipc semaphore functions pr_opensemaphore pr_waitsemaphore pr_postsemaphore pr_closesemaphore pr_deletesemaphore ...
RbXPCOM
rbxpcom (ruby cross-platform com) provides bindings between the popular ruby programming language and xpcom.
XPCshell Test Manifest Expressions
xpcshell unit tests are run by specifying them in a manifest file.
XPCOM string functions
xpcom provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions.
XPCOM Thread Synchronization
xpcom thread synchronization primitives have the same semantics as those in nspr, and each method of these synchronization objects (e.g.
RTCRtpCodecParameters - Web APIs
the rtcrtpcodecparameters dictionary, part of the webrtc api, is used to describe the configuration parameters for a single media codec.
Index
MozillaTechXPCOMIndex
found 1275 pages: # page tags and summary 1 xpcom add-ons, extensions, landing, mozilla, xpcom xpcom is a cross platform component object model, similar to microsoft com.
... it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++.
... 2 accessing the windows registry using xpcom add-ons, code snippets, extensions, needsclassification, windows registry when implementing windows-specific functionality, it is often useful to access the windows registry for information about the environment or other installed programs.
...And 881 more matches
Component Internals
« previousnext » where the previous chapter described components from the perspective of a client of xpcom components, this chapter discusses components from the perspective of the software developer.
... read on to see how components are generally implemented in xpcom, 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 xpcom components are written in c++.
...And 85 more matches
Mozilla DOM Hacking Guide
seriously hacking on it requires excellent knowledge of c++ and xpcom, mozilla's own component model.
...prior knowledge of c++ and xpcom is assumed.
... if you don't know xpcom yet, and would like to be able to read this document quickly, you can read the introduction to xpcom for the dom.
...And 57 more matches
Key Values - Web APIs
appcommand_copy gdk_key_copy (0x1008ff57) qt::key_copy (0x010000cf) "crsel" [3] the cursor select key, crsel.
... appcommand_cut gdk_key_cut (0x1008ff58) qt::key_cut (0x010000d0) "delete" [2] the delete key, del.
... appcommand_paste gdk_key_paste (0x1008ff6d) qt::key_paste (0x010000e2) "redo" redo the last action.
...And 55 more matches
Creating the Component Code
« previousnext » this chapter goes over the basic code required to handle the relationship between your component and xpcom.
... 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 xpcom.
... an xpcom component needs to implement at least three interfaces that xpcom requires, and often others as well.
...And 53 more matches
Starting WebLock
for example, an object may be created and have its observe method called at startup, or it may register to be notified prior to xpcom shutdown.
...for example, in the case of the xpcom shutdown observation, asubject and adata are not defined, and atopic is defined as the string "xpcom-shutdown".
...the nsiobserver is a generic interface for passing messages between two or more objects without defining a specific frozen interface, and it's one of the ways in which extensibility is built into xpcom.
...And 44 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 getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccountscriptcontents(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...
...te(); void leavemodalstate(); void loadsheet(in nsiuri sheeturi, in unsigned long type); nsidomnodelist nodesfromrect(in float ax, in float ay, in float atopsize, in float arightsize, in float abottomsize, in float aleftsize, in boolean aignorerootscrollframe, in boolean aflushlayout); void processupdates(); obsolete since gecko 13.0 void purgepccounts(); unsigned long redraw([optional] in unsigned long acount); void renderdocument(in nsconstrect arect, in pruint32 aflags, in nscolor abackgroundcolor, in gfxcontext athebescontext); native code only!
...gles, [array, size_is(count)] in float aforces, in pruint32 count, in long amodifiers, [optional] in boolean aignorerootscrollframe); void setcssviewport(in float awidthpx, in float aheightpx); void setdisplayport(in float axpx, in float aypx, in float awidthpx, in float aheightpx); void setresolution(in float axresolution, in float ayresolution); void startpccountprofiling(); void stoppccountprofiling(); void suppresseventhandling(in boolean asuppress); void suspendtimeouts(); nsidomfile wrapdomfile(nsifile afile); attributes attribute type description currentinnerwindowid unsigned long long the id of the window's current inner window.
...And 42 more matches
Index - Archive of obsolete content
99 platform/xpcom implement xpcom objects, factories, and services.
... 168 using xpcom without chrome bookmarks, chrome, sdk, xpcom no summary!
... 186 finding window handles add-ons, code snippets, extensions, xpcom, js-ctypes no summary!
...And 37 more matches
Getting Started Guide
nscomptr is smart in that, unlike a raw c++ pointer to an xpcom object, nscomptr manages addref, release, and queryinterface for you.
... nscomptr is defined in the source files: xpcom/base/nscomptr.h xpcom/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 xpcom interface pointers.
...And 33 more matches
Reference Manual
the basics design an nscomptr is designed to be a complete replacement for raw xpcom interface pointers where they are used as owning references.
... almost any place you could use a raw xpcom interface pointer, you should be able to use an nscomptr.
... an nscomptr is the exact same size and shape as a raw xpcom interface pointer.
...And 31 more matches
IPDL Tutorial
the parent actor is typically the more permanent side of the conversation: parent/child actors parent child ipc tabs chrome process content process ipc plugins content process plugin process each protocol is declared in a separate file.
... generated c++ code when pplugin.ipdl is compiled, the headers ppluginparent.h, and ppluginchild.h will be generated in the ipc/ipdl/_ipdlheaders/ directory of the build tree.
...by a c++ implementor in the plugin process: class pluginchild : public ppluginchild { protected: void recvinit(const nscstring& pluginpath) { mpluginlibrary = pr_loadlibrary(pluginpath.get()); sendready(); } void recvshutdown() { pr_unloadlibrary(mpluginlibrary); } private: prlibrary* mpluginlibrary; }; launching the subprocess and hooking these protocol actors into our ipc "transport layer" is beyond the scope of this document.
...And 21 more matches
Using DTMF with WebRTC - Web APIs
let dialstring = "12024561111"; let callerpc = null; let receiverpc = null; let dtmfsender = null; let hasaddtrack = false; let mediaconstraints = { audio: true, video: false }; let offeroptions = { offertoreceiveaudio: 1, offertoreceivevideo: 0 }; let dialbutton = null; let logelement = null; these are, in order: dialstring the dtmf string the caller will send when the "dial" button is clicked.
... callerpc and receiverpc the rtcpeerconnection objects representing the caller and the receiver, respectively.
... function connectanddial() { callerpc = new rtcpeerconnection(); hasaddtrack = (callerpc.addtrack !== undefined); callerpc.onicecandidate = handlecallericeevent; callerpc.onnegotiationneeded = handlecallernegotiationneeded; callerpc.oniceconnectionstatechange = handlecallericeconnectionstatechange; callerpc.onsignalingstatechange = handlecallersignalingstatechangeevent; callerpc.onicegatheringstatechange = handlecallerg...
...And 20 more matches
Language bindings
an xpcom language binding is a bridge between a particular language and xpcom to provide access to xpcom objects from that language, and to let modules written in that language be used as xpcom objects by all other languages for which there are xpcom bindings.
... more specifically, an xpcom language binding: enables access to xpcom objects from that language (where access means reading/writing/creating xpcom objects as well as calling methods on them).
... exposes modules written in the bound language as xpcom objects, thereby enabling all other languages for which xpcom bindings exist to access these modules.
...And 18 more matches
Preface
next » this is a book about gecko, and about creating xpcom 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 xpcom.
... accordingly, the book is arranged so that you can follow along and create your own components or learn about different xpcom topics individually, as in a reference work.
...And 16 more matches
A bird's-eye view of the Mozilla framework
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 xpcom (cross-platform com) objects.
... xpcom object model before getting into the details of the ui example, it's helpful to have a basic understanding of the xpcom object model.
... mozilla architectural modules are comprised of groups of related xpcom objects that provide services to and access services from each other through dynamically queryable interfaces.
...And 15 more matches
Extending a Protocol
creating the protocol pecho.ipdl let's start by saving the following file to ./dom/ipc/pecho.ipdl.
... 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/ipc/moz.build" file and add 'pecho.ipdl', to the ipdl_sources array.
... updating pwindowglobal.ipdl open up ./dom/ipc/pwindowglobal.ipdl.
...And 15 more matches
Necko walkthrough
nsdocshell as an example client of the nsihttpchannel 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 nsihttpchannel nsdocshell::dochannelload nsuriloader::openuri passes an nsistreamlistener pointer, 'loader' to nsuriloader::openchannel - it creates an nsdocumentopeninfo object, which implements nsistreamlistener, i.e.
... nshttpchannel::asyncopen called from openuri; openchannel isn't named the best, since the opening happens in the context of openuri, its calling function.
...And 15 more matches
Working with windows in chrome code
from xpcom components and modules if the window object is unavailable (for example, when opening a window from xpcom component code), you might want to use nsiwindowwatcher interface.
... you should be aware of xpcnativewrappers when working with untrusted content.
... with xpcnativewrappers 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.
...And 15 more matches
Overview of Mozilla embedding APIs
introduction the mozilla public api consists of a collection of services and components which are accessed via xpcom interfaces.
... mozilla's xpcom layer consists of a component model (called xpcom) and the infrastructure necessary to support dynamic registration, instantiation and manipulation of xpcom components.
... at the heart of xpcom's implementation is the service manager and the component manager.
...And 14 more matches
Web Replay
ipc integration allows a replaying process to communicate with the chrome process using ipdl and shared memory.
... the ipc and debugger integration components may behave differently between recording and replaying, or between different replays.
... allowed non-determinism there is some slop in this design: the replaying process must be non-deterministic enough that the ipc and debugger components work, but not so non-deterministic that observable behaviors are affected.
...And 13 more matches
Setting up the Gecko SDK
downloading and setting the sdk the gecko sdk provides all of the tools, headers, and libraries that you need to build xpcom components.
...for example, the headers for networking are all located in the necko directory, and the headers that xpcom requires are in the xpcom directory.
... xpcom exports a number of binaries that should be mentioned at this point.
...And 13 more matches
Index - Web APIs
WebAPIIndex
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.
... 1964 onmsvideoframestepcompleted onmsvideoframestepcompleted onmsvideoframestepcompleted is an event which occurs when the video frame has been stepped forward or backward one frame.
...And 13 more matches
Setting HTTP request headers
http channels when you deal with http requests and responses, typically you are doing this with an nsihttpchannel.
... the nsihttpchannel interface has a number of properties and methods, but the method that is of interest to us is setrequestheader.
...// adds "x-hello: world" header to the request httpchannel.setrequestheader("x-hello", "world", false); in the example code above we have a variable named httpchannel which points to an object implementing nsihttpchannel.
...And 12 more matches
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
use of mozilla interfaces that are not exposed via xpcom (e.g.
...if you are just looking to create an xpcom component or two, this is probably overkill, and you might want to take a look at this guide instead.
...it has thus been necessary to solve all of the issues involved in creating and registering xpcom components, building jar files and manifests, installing the lot into the firefox extensions/ directory and so forth.
...And 11 more matches
Refcount tracing and balancing
you almost certainly want xpcom_mem_refcnt_log.
... xpcom_mem_refcnt_log setting this environment variable enables refcount tracing.
... warning: you should never use this without xpcom_mem_log_classes and/or xpcom_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.
...And 11 more matches
xptcall FAQ
xptcall is a small low level xpcom method call library.
... xptcall exists for two reasons: to support invoking arbitrary methods on xpcom interfaces.
... to support dynamically impersonating any xpcom interface.
...And 11 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
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.
... 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.
... pc.ontrack = ({track, streams}) => { track.onunmute = () => { if (remotevideo.srcobject) { return; } remotevideo.srcobject = streams[0]; }; }; when the track event occurs, this handler executes.
...And 11 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
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.
...gecko is implemented as a collection of xpcom components that can be easily added or removed.
... xpcom, the cross platform component object model the cross platform component object model (xpcom) is one of the main things that makes the mozilla application environment an actual framework.
...And 10 more matches
The Joy of XUL - Archive of obsolete content
xpcom/xpconnect xpcom and xpconnect are complementary technologies that enable the integration of external libraries with xul applications.
... xpcom, which stands for cross platform component object model, is a framework for writing cross-platform, modular software.
... xpcom components can be written in c, c++, and javascript, and they can be used from c, c++, javascript, python, java, and perl.
...And 10 more matches
JavaScript-DOM Prototypes in Mozilla
prototype setup on an xpconnect wrapped dom node in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is exposed to javascript as the javascript representation of the dom node.
... when xpconnect wraps a c++ object it will create a jsobject that is unique to this c++ object.
...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 nsixpcscriptable::dont_share_prototype set, but lets assume that's not the case here).
...And 10 more matches
Mozilla internal string guide
the headers and implementation are in the xpcom/string directory.
... helper classes and functions converting cocoa strings use mozilla::copycocoastringtoxpcomstring() in mozilla/macstringhelpers.h to convert cocoa strings to xpcom strings.
... these methods return a buffer allocated using xpcom's allocator instead of the traditional allocator (malloc, etc.).
...And 10 more matches
wrappedJSObject
wrappedjsobject is a property sometimes available on xpconnect wrappers.
... there are two kinds of xpconnect wrappers that support the wrappedjsobject property: xpcnativewrappers which are used to protect the chrome code working with content objects.
... see xpcnativewrapper for detailed documentation.
...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/xpcom 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 xpcom 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...
... 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 xpcom javascript debugger service javascript timers javascript daemons management label and description lookupnamespaceuri lookupprefix miscellaneous modules on page load page loading post data to window p...
...And 9 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_newtempcertificate (see cert.h) cert_setocsptimeout (see certhigh/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11p...
...ub.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_getregisteredhttpclient (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_camellia_cbc camellia_block_size new macros for rsa (see blapit.h): rsa_max_modulus_bits rsa_max_ex...
...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_newtempcertificate.
...And 9 more matches
WebIDL bindings
} } external interfaces external interfaces are represented in c++ as objects that xpconnect knows how to unwrap to.
... this can mean xpcom interfaces (whether declared in xpidl or not) or it can mean some type that there's a castable native unwrapping function for.
...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 xpconnect or a webidl interface type.
...And 9 more matches
GRE - Archive of obsolete content
finding and using a gre from application code avoid linking directly against xpcom.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 xpcom.dll/libxpcom.so (xpcom.lib import lib), your application will not launch unless xpcom.dll is in your path.
... to find a compatible gre, you should use the function gre_getgrepathwithproperties() (declared in xpcom/glue/standalone/nsxpcomglue.h).
...And 8 more matches
Leak-hunting strategies and tips
seeing a leaked globalwindowimpl, nsxulpdglobalobject, nsxbldocglobalobject, or nsxpcwrappedjs 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.
...(but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through xpconnect many large object graphs that leak go through xpconnect.
... this can mean there will be xpconnect wrapper objects showing up as owning the leaked objects, but it doesn't mean it's xpconnect's fault (although that has been known to happen, it's rare).
...And 8 more matches
Writing WebSocket servers - Web APIs
format each data frame (from the client to the server or vice-versa) follows this same format: frame format: ​​ 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |f|r|r|r| opcode|m| payload len | extended payload length | |i|s|s|s| (4) |a| (7) | (16/64) | |n|v|v|v| |s| | (if payload len==126/127) | | |1|2|3| |k| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | extended payload length continued, if payload len ==...
... the opcode 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.
... message fragmentation the fin and opcode fields work together to send a message split up into separate frames.
...And 8 more matches
Using the application cache - HTML: Hypertext Markup Language
as of firefox 44+, when appcache is used to provide offline support for a page, a warning message displays in the console advising developers to use service workers instead (bug 1204581).
...this application cache (appcache) interface lists resources that browsers should cache to be available offline.
... 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.appcache"> … </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.
...And 8 more matches
Building up a basic demo with the PlayCanvas engine - Game development
add the following 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.
... 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.
... var camera = new pc.entity(); camera.addcomponent("camera", { clearcolor: new pc.color(0.8, 0.8, 0.8) }); app.root.addchild(camera); camera.setposition(0, 0, 7); the code above will create a new entity.
...And 7 more matches
Tracing JIT
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.
...And 7 more matches
SpiderMonkey Internals
the debugger will have to consult jsopcode.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.
... 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.
...And 7 more matches
Observer Notifications
[nsobserverservice.cpp] topic description xpcom-startup note: an extension can no longer be registered to receive this notification in firefox 4 and later.
... see xpcom changes in gecko 2.0 for details.
... called when xpcom is initialized.
...And 7 more matches
mozIRegistry
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 xpcom components that together form the mozilla browser.
...we are proposing a new "moziregistry" xpcom interface that provides the same level of function as is currently provided by the "netscape registry" implemented in libreg.
...those other components presumably implement particular xpcom interfaces.
...And 7 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
the chapters so far have each focused on technologies in isolation—xul, javascript, css, and xpcom.
...source files represented through chrome urls run with universalxpconnect privileges; even if they haven’t been granted “use xpconnect as local file” privileges, as discussed in chapter 4, they will be able to use xpcom functions (figure 1).
...firefox lets you read and write preference values using handy xpcom services and create preference panels with interface widgets.
...And 6 more matches
Intercepting Page Loads - Archive of obsolete content
they are window-independent, so it is better to keep your observer code in non-chrome objects (your xpcom service or jsm module).
... the subject argument on the observe method is the nsihttpchannel 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.nsihttpchannel); url = asubject.uri.spec; if (re_url_to_modify.test(url)) { // re_url_to_modify is a regular expression.
...And 6 more matches
Setting Up a Development Environment - Archive of obsolete content
building idl files some extensions require developing xpcom components to add certain advanced functions.
... there's a section dedicated to xpcom 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 xpcom in your project.
...And 6 more matches
Source code directories overview - Archive of obsolete content
mac contains source code for macos: both the powerpc and 68000 versions.
...it has not been updated to support xpcom yet.
... ipc contains jpeg contains c code for reading/writing jpeg images.
...And 6 more matches
XPJS Components Proposal - Archive of obsolete content
xpjs components is a (cheesy) name for a system to support xpcom components written in javascript.
... now, you might ask: "isn't that what xpconnect does?" and i would answer that xpconnect is necessary, but not sufficient to the task.
... xpconnect provides the mechanisms for communication between native and js xpcom components, but it does not provide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window.
...And 6 more matches
The Basics of Web Services - Archive of obsolete content
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-rpc or soap are also used to communicate between a server and a client.
... introducing xml-rpc xml-rpc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used.
... xml-rpc was developed by useful inc, along with microsoft.
...And 6 more matches
Multiprocess on Windows
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 xpcom).
... as you should already know from the prerequisite reading, single threaded apartments receive remote procedure calls (rpcs) from com, via the windows message queue.
...on the other hand, com's multithreaded apartment (mta) uses a much faster ipc mechanism that does not suffer from the same problems as the message queue.
...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_clearocspcache 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_createocspcertid 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_destroyocspcertid 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_dupcertificate mxr 3.2 and later cert_dupcertlist mxr ...
...And 6 more matches
Property cache
the opcodes 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 opcodes do not use it.
... property cache entries each entry in the property cache hash table is either populated or not; unpopulated entries have .kpc == null.
...And 6 more matches
Introduction to the JavaScript shell
line2pc([function, ] line) returns the program counter value corresponding to the specified line of code.
... pc2line(function, [pc]) returns the line number of the javascript code that corresponds to the first line of the specified function.
... trap([function, [pc,]] expression) sets a trap at the specific point in the javascript code.
...And 6 more matches
Finishing the Component
the component will be recognized by xpcom and registered with the category manager so that it starts up when xpcom initializes.
...grab the right headers, use the component or service manager to access the interface you want, and the xpcom object(s) that implement that interface will do your bidding.
... weblock interfaces interface name defined by status summary nsisupports xpcom frozen provides interface discovery, and object reference counting nsiobserver xpcom frozen allows messaging passing between objects nsicontentpolicy content not frozen interface for policy control mechanism iweblock web lock not frozen enables and disables weblock.
...And 6 more matches
Mozilla
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 nshttpchannel::opencacheentry().
... creating javascript callbacks in components xpcom components use idl to create interfaces.
...this article will cover the basics of doing http connections from xpcom javascript, and should easily translate to c++ xpcom.
...And 6 more matches
Writing a WebSocket server in C# - Web APIs
methods: start() system.net.sockets.tcpclient accepttcpclient() waits for a tcp connection, accepts it and returns it as a tcpclient 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); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); } } tcpclient methods: system.net.sockets.networkstream getstream() gets the stream which is the communication channel.
... tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); networkstream stream = client.getstream(); //enter to an infinite cycle to be able to handle every change in stream while (true) { while (!stream.dataavailable); byte[] bytes = new byte[client.available]; stream.read(bytes, 0, bytes.length); } handshaking when a client connects to a server, it sen...
...And 6 more matches
XUL Migration Guide - Archive of obsolete content
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 xpcom finally, we'll walk through a simple example.
... if your add-on needs a lot of help from third party packages, low-level apis, or xpcom, then the cost of migrating is high, and may not be worth it at this point.
... content scripts in a xul-based add-on, code that uses xpcom objects, code that manipulates the browser chrome, and code that interacts with web pages all runs in the same context.
...And 5 more matches
JavaScript Object Management - Archive of obsolete content
for instance, there are frequently used xpcom services such as the observer service that can be included as members in the namespace: /** * 〈namespace〉 namespace.
...in case you're using javascript code modules or xpcom objects, where a window object is not readily available, use an nsitimer instead.
...two other ways are javascript code modules (firefox 3 and above), and xpcom.
...And 5 more matches
List of Mozilla-Based Applications - Archive of obsolete content
abstract accounting tool adobe acrobat and adobe reader portable document format (pdf) software uses mozilla spidermonkey adobe flash player popular browser plug-in uses nss in linux version adwatch content management system uses xul and xpcom aicpcu/iia exam app exam delivery software aliwal geocoder geocoding & data on a map amarok xul remote remote control for amarok music player ample sdk javascript gui-framework aol instant messenger im client uses nss apache web server doesn't use nss by default, but can be configured to use nss with m...
...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 upcoming 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 ...
...spidermonkey and formerly called wxjavascript gnome operating system gnome 3 will use spidermonkey through gjs google adwords editor editor google gadgets for linux google’s desktop widget engine uses xulrunner according to the build instructions grani grain sizing assessment tool according to this wiki page grani is based on xul and xpcom daim gwt-mosaic-xul xul builder for google web tools hachette's multimedia encyclopedia electronic encyclopedia this product was using mozilla in 2004 but i’m not sure if new version still does hacketyhack little coders helma web application framework uses mozilla rhino holt mcdougal cd-roms educational cd-roms activ...
...And 5 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_xpcom= +moz_ldap_xpcom=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...
...moz_ldap_xpcom=1 and moz_extensions_default="wallet spellcheck xmlextras pref webservices universalcharset auth" are now present in the default configure script.
...moz_ldap_xpcom=1).
...And 5 more matches
RDF Datasource How-To - Archive of obsolete content
the xpcom registration parts and the "as of this writing, it is not currently possible to implement javascript xpcom components" comment seem outdated didn't check the whole article.
...this is an extreme case of delegation, where you use xpcom aggregation to implement the nsirdfdatasource interface.
... [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 xpcom component.
...And 5 more matches
A XUL Bestiary - Archive of obsolete content
the chrome url this concept of a chrome as an integrated, dynamic thing in some way divorced from the "appcore" is realized in the use of the chrome url to point to chunks of xul and their related files.
...the mozilla xparchitecture section below describes xpcom, xpidl, and xpconnect, three somewhat related technologies for getting access to application code from the interface.
...xpcom is not a programming language but an approach to programming (in c++, say) that provides for a truly cross-platform component object model, whence the technology gets its name.
...And 5 more matches
How to implement a custom XUL query processor component - Archive of obsolete content
custom query processors are xpcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component.
... in this example, we will create a simple javascript xpcom component.
...it is used to create an instance of our xpcom object.
...And 5 more matches
Extentsions FAQ - Archive of obsolete content
return to mozilla-dev-extensions faq friday, september 22 - 29, 2006 (↑ top) how to write an xpcom component in c++ that can communicate to a com component?
... write an xpcom component in c++ - it will talk to the com component and will be accessible to js code via xpconnect.
...are there any fundamental rules related to threading in xpcom, and if so, where are these defined?
...And 5 more matches
How to implement a custom autocomplete search component
to do so you need the following: create an xpcom component that implements the nsiautocompletesearch interface.
... make sure the contract id of your xpcom component follows the following form: "@mozilla.org/autocomplete/search;1?name=xxx", where "xxx" is the name of your autocomplete source.
... the simplest way to make an xpcom component is to build an xpcom javascript component (this cannot be done with a javascript module).
...And 5 more matches
AddonManager
startup change types these constants represent the lists of types of changes that can occur to add-ons during startup; they're used with the getstartupchanges(), addstartupchange(), and removestartupchange() methods.
... methods addstartupchange() 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 getstartupchanges() method.
...And 5 more matches
BloatView
xpcom_mem_bloat_log if set, this causes a bloat log to be printed on program exit, and each time nstracerefcnt::dumpstatistics is called.
... xpcom_mem_leak_log this is similar to xpcom_mem_bloat_log, but restricts the log to only show data on leaks.
...actiontrackersholder | 40 40| 10594 1| 78 |compositorchild | 472 472| 1 1| 79 |condvar | 24 48| 3086 2| 279 |messagepump | 8 8| 30 1| 285 |mutex | 20 60| 89987 3| 302 |pcompositorchild | 412 412| 1 1| 308 |pimagebridgechild | 416 416| 1 1| the first line tells you the pid of the leaking process, along with the type of process.
...And 5 more matches
64-bit Compatibility
lir safety it is not immediately clear from reading lir which opcodes should be used for 64-bit safety.
...luckily there is an alias that will choose the right opcode for you - lir_ldp: struct object { void *data; }; lir->insload(lir_ldp, objins, ins->insimm(offsetof(object, data))); when you use lirwriter::insstore, the correct size is chosen for you automatically, based on the size of the input operands.
...to help form well-typed lir, there is a special opcode called lir_float which specifies that the associated constant value is definitely floating-point.
...And 5 more matches
Components.Constructor
summary creates a javascript function which can be used to create or construct new instances of xpcom components.
...me 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 xpcom components.
...it also gives creation of xpcom objects more javascript-like syntax.
...And 5 more matches
RefPtr
it is similar to nscomptr, but does not require that the type be an xpcom interface.
... the rules are simple: use nscomptr to hold pointers to xpcom interfaces, and use refptr to hold pointers to concrete class, even if the concrete class implements one or more xpcom interfaces.
... so for xpcom interfaces: nscomptr<nsisupports> a; nscomptr<nsifoo> foo; and for concrete classes: refptr<nsfoo> foo; // class that implements nsifoo; refptr<bar> bar; // some random class that i want ref-counted but has nothing to do with xpcom: // just implement addref() and release() and it will work with refptr it is important that nscomptr is not used to hold a pointer to a concrete class since this can cause compile time errors or runtime errors.
...And 5 more matches
nsISupportsArray
xpcom/ds/nsisupportsarray.idlscriptable please add a summary to this article.
... inherits from: nsicollection last changed in gecko 1.7 method overview boolean appendelements(in nsisupportsarray aelements); violates the xpcom interface guidelines nsisupportsarray clone(); void compact(); void deleteelementat(in unsigned long aindex); void deletelastelement(in nsisupports aelement); nsisupports elementat(in unsigned long aindex); violates the xpcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other); violates the xpcom interface guidelines long getindexof(in nsisupports apossibleelement); ...
... long getindexofstartingat(in nsisupports apossibleelement, in unsigned long astartindex); long getlastindexof(in nsisupports apossibleelement); long indexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines long indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astartindex); violates the xpcom interface guidelines boolean insertelementat(in nsisupports aelement, in unsigned long aindex); violates the xpcom interface guidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long aindex); violates the xpcom interface guidelines long lastindexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines boolean moveelement(in long afrom, in long ato); violates the xpcom interface gu...
...And 5 more matches
Using nsIDirectoryService
content formerly at http://www.mozilla.org/projects/xpcom/nsdirectoryservice.html general nsdirectoryservice information: nsdirectoryservice implements the nsiproperties interface.
...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/xpco...locations.html background the way in which mozilla components locate special files and directories has changed.
...os and xpcom level nsdirectoryservicedefs.h these locations are provided by xpcom, are constant with the system, and and should not need customization.
...And 5 more matches
Xptcall Porting Guide
overview xptcall is a library that supports both invoking methods on arbitrary xpcom objects and implementing classes whose objects can impersonate any xpcom interface.
...the tree mozilla/xpcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac ppc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform.
...the platform specific code then builds a call frame and invokes the method indicated by the index methodindex on the xpcom interface that.
...And 5 more matches
Xptcall Porting Status
bert's details <font color="white">done</font> mac ppc 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.
...notice the last 2 files (the change to mozilla\xpcom\build\makefile.win and mozilla\xpcom\build) are needed because i was unable to figure how to do a "declspecexport" from the assembler asaxp ...
... <font color="white">done</font> linux ppc patrick beard <beard@netscape.com> chris waterson <waterson@netscape.com> franz sirl <franz.sirl-kernel@lauterbach.com> <font color="red">?</font> jason y.
...And 5 more matches
SubtleCrypto.wrapKey() - Web APIs
*/ async function wrapcryptokey(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.generatekey( { name: "aes-gcm", length: 256, }, true, ["encrypt", "decrypt"] ) .then((secretkey) => { return wrapcryptokey(secretkey); }) .then((wrappedkey) => { console.log(wrappedkey); }); pkcs #8 wrap this example wraps an rsa private signing key.
...*/ async function wrapcryptokey(keytowrap) { // get the key encryption key const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new uint8array(16)); const wrappingkey = await getkey(keymaterial, salt); iv = window.crypto.getrandomvalues(new uint8array(12)); return window.crypto.subtle.wrapkey( "pkcs8", keytowrap, wrappingkey, { name: "aes-gcm", iv: iv ...
...And 5 more matches
Tabbed browser - Archive of obsolete content
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/xpcomutils.jsm"); xpcomutils.definelazyservicegetter(this, "gsessionstore", "@mozilla.org/browser/sessionstore;1", "nsisessionstore"); // create new tab, but don't load the content.
... note that some http requests aren't associated with a tab; for example, rss feed updates, extension manager requests, xhr requests from xpcom components, etc.
...updated example is in section below this observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { subject.queryinterface(components.interfaces.nsihttpchannel); var url = subject.uri.spec; /* url being requested.
...And 4 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
custom query processors are xpcom 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, xpcom, 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.
... 595 node this is a scriptable interface corresponding to the nsidomnode xpcom interface.
...And 4 more matches
Building XULRunner with Python - Archive of obsolete content
or, if you are interested in working with xulrunner with python on linux, see mark lise's post with the python extensions enabled xulrunner provides python script access to the dom and xpcom in addition to the usual java script.
... this gives access to python features and modules and builds on mark hammond's pyxpcom work from active state.
... xpcom components can also be created in python.
...And 4 more matches
Chrome registration
component component {00000000-0000-0000-0000-000000000000} components/mycomponent.js [flags] informs mozilla about a component cid implemented by an xpcom component implemented in javascript (or another scripting language, if applicable).
...the value is taken from the nsixulruntime os and xpcomabi 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 xpcom abi for more details.
...And 4 more matches
Creating Sandboxed HTTP Connections
this article will cover the basics of doing http connections from xpcom javascript, and should easily translate to c++ xpcom.
...nsiuri is an xpcom representation of an uri, with useful methods to query and manipulate the uri.
...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 xpcom 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) || ...
...And 4 more matches
Error codes returned by Mozilla APIs
ns_error_dom_invalid_expression_err (0x805b0033) ns_error_dom_type_err (0x805b0034) ns_error_dom_security_err (0x805303e8) ns_error_dom_secman_err (0x805303e9) ns_error_dom_wrong_type_err (0x805303ea) ns_error_dom_not_object_err (0x805303eb) ns_error_dom_not_xpc_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_xpconnect_access_denied (0x805303f3) ns_error_dom_bad_uri (0x805...
... javascript errors these errors typically occur when interfacing between javascript and native code, or to xpcom components.
... ns_error_xpc_not_enough_args (0x80570001) ns_error_xpc_need_out_object (0x80570002) ns_error_xpc_cant_set_out_val (0x80570003) ns_error_xpc_native_returned_failure (0x80570004) ns_error_xpc_cant_get_interface_info (0x80570005) ns_error_xpc_cant_get_param_iface_info (0x80570006) ns_error_xpc_cant_get_method_info (0x80570007) ns_error_xpc_unexpected (0x80570008) ns_error_xpc_bad_convert_js (0x80570009) ns_error_xpc_bad_convert_native (0x8057000a) ns_error_xpc_bad_convert_js_null_ref (0x8057000b) ns_error_xpc_bad_op_on_wn_proto (0x8057000c) ns_error_xpc_cant_convert_wn_to_fun (0x8057000d) ns_error_xpc_cant_define_prop_on_wn (0x8057000e) ns_error_xpc_cant_watch_wn_static (0x8057000f) ns_error_xpc_cant_export_wn_static (0x80570010) ...
...And 4 more matches
JavaScript Tips
var uniquename = { _privatemember: 3, publicmember: "a string", init: function() { this.dosomething(this.anothermember); }, dosomething: function(aparam) { alert(aparam); } }; xpconnect don't use object methods and properties more than you have to.
...xpconnect 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 xpcom method it is helpful if the object you pass is an xpcom object, so that the c++ method access a c++ object.
...And 4 more matches
HOWTO
async network requests problem you want to make network requests or do other asynchronous work in xpcshell.
...put the following at the end of your script: // do async processing // from <https://developer.mozilla.org/en/xpconnect/xpcshell/howto> print("doing async work"); gscriptdone = false; var gthreadmanager = cc["@mozilla.org/thread-manager;1"] .getservice(ci.nsithreadmanager); var mainthread = gthreadmanager.currentthread; while (!gscriptdone) mainthread.processnextevent(true); while (mainthread.haspendingevents()) mainthread.processnextevent(true); 2.
...this is of course a massive, ugly hack prone to error, but this is what the xpcshell test harness does.
...And 4 more matches
imgIContainer
nsiframe getrootlayoutframe(); violates the xpcom interface guidelines pruint16 gettype(); violates the xpcom interface guidelines void init(in print32 awidth, in print32 aheight, in imgicontainerobserver aobserver); obsolete since gecko 2.0 void lockimage(); void removeframe(in gfxiimageframe item); obsolete since gecko 1.9.2 void requestdecode(); void requestdiscard(); void ...
...requestrefresh([const] in timestamp atime); violates the xpcom interface guidelines void resetanimation(); void restoredatadone(); native code only!
... loopcount long number of times to loop the image.
...And 4 more matches
Component; nsIPrefBranch
a complex preference is a preference which represents an xpcom object that can not be easily represented using a standard boolean, integer or string value.
... atype the xpcom interface that this complex preference represents.
... interfaces currently supported are: nsilocalfile nsisupportsstring (unichar) (removed as of gecko 58 in favor of getstringpref) nsipreflocalizedstring (localized unichar) nsifilespec (deprecated - to be removed eventually) avalue the xpcom object into which to the complex preference value should be retrieved.
...And 4 more matches
XPIDL
xpidl is an interface description language used to specify xpcom interface classes.
...some examples are in the xpcom/base and xpcom/ds directories of the mozilla tree.
...a method or attribute is scriptable if it is declared in a scriptable interface and it lacks a noscript or notxpcom property.
...And 4 more matches
ARIA Test Cases - Accessibility
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 upcoming releases.
... 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.
... 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.
...And 4 more matches
Creating Event Targets - Archive of obsolete content
then open "index.js" and add the following code: var {cc, ci} = require("chrome"); var { xpcomutils } = require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, aindex) { console.log("added ", bookmarkservice.getbookmarkuri(aitemid).spec); }, onitemvisited: function(aitemid, avisitid...
..., time) { console.log("visited ", bookmarkservice.getbookmarkuri(aitemid).spec); }, queryinterface: xpcomutils.generateqi([ci.nsinavbookmarkobserver]) }; exports.main = function() { bookmarkservice.addobserver(bookmarkobserver, false); }; exports.onunload = function() { bookmarkservice.removeobserver(bookmarkobserver); } try running this add-on, adding and visiting bookmarks, and observing the output in the console.
... create a new file in "lib" called "bookmarks.js", and add the following code: var { emit, on, once, off } = require("sdk/event/core"); var {cc, ci} = require("chrome"); var { xpcomutils }= require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, aindex) { emit(exports, "added", bookmarkservice.getbookmarkuri(aitemid).spec); }, onitemvisited: function(aitemid, avisitid, time) { emit(exports, "visited", bookmarkservic...
...And 3 more matches
Observer Notifications - Archive of obsolete content
you could do that by calling all those functions directly, but xpcom offers you a better and cleaner way to achieve that using observers and the observer service.
...the first parameter (subject) can be any xpcom object, the second parameter is a notification topic, and the final parameter is a string that further describes the notification.
...the first parameter can be any xpcom 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).
...And 3 more matches
RDF in Mozilla FAQ - Archive of obsolete content
if the uri argument refers to a built-in datasource, the rdf service will use the xpcom 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>.
...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 xpcom component manager, as the following code fragment illustrates: // create an rdf/xml datasource using the xpcom 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.
... since a built-in datasource is just an xpcom component, you can instantiate it directly using the xpconnect component manager.
...And 3 more matches
Choosing the right memory allocator
allocating memory in xpcom 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 xpcom or xpcom glue; this includes extensions with binary components.
... see the xpcom string guide for additional information.
...And 3 more matches
IPDL Type Serialization
types are serialized and deserialized from an ipc::message type declared in ipc_message.h.
... each type specializes ipc::paramtraits as follows: namespace ipc { 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 ipc the standard ipdl types (integers, floats, and xpcom strings) already have serializers.
...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_clearocspcache 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_createocspcertid 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_destroyocspcertid 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_dupcertificate mxr 3.2 and later cert_dupcertlist mxr ...
...And 3 more matches
sslcrt.html
validating certificates manipulating certificates getting certificate information comparing secitem objects validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames cert_verifycertnow checks that the current date is within the certificate's validity period and that the ca signature on the certificate is valid.
... returns the function returns an enumerator of type seccerttimevalidity: typedef enum { seccerttimevalid, seccerttimeexpired, seccerttimenotvalidyet } seccerttimevalidity; nss_cmpcertchainwcanames 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_cmpcertchainwcanames( 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.
...And 3 more matches
Hacking Tips
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 jsopcode.cpp, a function named js::disassembleatpc can print the bytecode of a script.
... 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) x /5i $pc - 1 0x7ffff7fb1659: int3 => 0x7ffff7fb165a: mov 0x28(%rsp),%rax 0x7ffff7fb165f: mov %eax,%ecx 0x7ffff7fb1661: mov 0x30(%rsp),%rdx 0x7ffff7fb1666: mov %edx,%ebx (gdb) # replace the int3 by a nop (gdb) set *(unsigned char *) ($pc - 1) = 0x90 (gdb) x /1i $pc - 1 0x7ffff7fb1659: nop (gdb) # set a breakpoint at the previous location (gdb) b *0...
...And 3 more matches
Bytecode Descriptions
bytecode listing this document is automatically generated from opcodes.h by make_opcode_doc.py.
...this opcode is not used for normal js.
...all direct evals use one of the jsop::*eval instructions here and these opcodes are only used when the syntactic conditions for a direct eval are met.
...And 3 more matches
Receiving startup notifications
sometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example.
... receiving startup notifications in gecko 2.0 (firefox 4) and later in order to improve startup times, changes were made to the xpcom startup process.
...your add-on will not receive xpcom-startup or app-startup notifications.
...And 3 more matches
Components.lastResult
components.lastresult returns the numeric nsresult code that was the result code of the last xpcom method called via xpconnect.
... introduction generally, components.lastresult is only useful for testing the result of xpcom methods that can return interesting 'success' codes.
... this is because failure result codes get converted by xpconnect into exceptions that are thrown into the calling javascript method.
...And 3 more matches
nsMemory
« xpcom api reference summary the nsmemory class provides static helper routines to manage memory.
... these routines allow easy access to xpcom's global nsimemory implementation without having to go through the service manager to get it.
... free the free function frees a block of memory that was allocated by xpcom's memory manager.
...And 3 more matches
nsIContentViewer
to create an instance, use: var contentviewer = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsicontentviewer); method overview void clearhistoryentry(); void close(in nsishentry historyentry); void destroy(); [noscript,notxpcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only!
... [noscript,notxpcom] nsidocumentptr getdocument(); void hide(); void init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only!
... [noscript,notxpcom,nostdcall] void setnavigationtiming(in nsdomnavigationtimingptr atiming); void setpagemode(in boolean apagemode, in nsiprintsettings aprintsettings); void show(); void stop(); void unload(); obsolete since gecko 1.8 attributes attribute type description container nsisupports domdocument nsidomdocument ...
...And 3 more matches
nsIDOMEvent
method overview boolean deserialize(in constipcmessageptr amsg, out voidptr aiter); violates the xpcom interface guidelines void duplicateprivatedata(); native code only!
... nseventptr getinternalnsevent(); violates the xpcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidelines void settarget(in nsidomeventtarget atarget); native code only!
... 0x01000000 move 0x02000000 resize 0x04000000 forward 0x08000000 help 0x10000000 back 0x20000000 text 0x40000000 alt_mask 0x00000001 control_mask 0x00000002 shift_mask 0x00000004 meta_mask 0x00000008 methods violates the xpcom interface guidelines deserialize() boolean deserialize( in constipcmessageptr amsg, out voidptr aiter ); parameters amsg aiter return value native code only!duplicateprivatedata void duplicateprivatedata(); parameters none.
...And 3 more matches
getFile
« xpcom api reference called by the directory service to obtain an nsifile object corresponding for a given standard path location.
... xpcom file system aliases apersistent [out] this output parameter indicates to the caller whether or not the returned location is persistent.
... symbolic names the list of symbolic names is subject to change, so be sure to take a look at the xpcom/io/nsdirectoryservicedefs.h file for the version of gecko you're working with for the latest list.
...And 3 more matches
nsIServiceManager
xpcom/components/nsiservicemanager.idlscriptable this interface provides a means to obtain global services in an application.
...] out nsqiresult result); void getservicebycontractid(in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result); boolean isserviceinstantiated(in nscidref aclass, in nsiidref aiid); boolean isserviceinstantiatedbycontractid(in string acontractid, in nsiidref aiid); methods getservice() this method returns a reference to a particular xpcom service given the classid of the service.
... getservicebycontractid() this method returns a reference to a particular xpcom service given the contractid of the service.
...And 3 more matches
nsIVariant
xpcom/ds/nsivariant.idlscriptable xpconnect has magic to transparently convert between nsivariant and js types.
... nsresult getasarray(out pruint16 type, out nsiid iid, out pruint32 count, out voidptr ptr); violates the xpcom interface guidelines astring getasastring(); native code only!
... nsresult getasid(out nsid retval); violates the xpcom interface guidelines print16 getasint16(); native code only!
...And 3 more matches
Using the Gecko SDK
this guide explains how to build xpcom components in c++ using the gecko sdk.
... introduction it is assumed that you already know something about xpcom component development.
... (more information on xpcom is available at the xpcom project page.) the intent of this guide is to help you build your components "the right way" such that they will remain compatible with future versions of mozilla.
...And 3 more matches
AudioBuffer - Web APIs
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.
... 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.
...And 3 more matches
Element.classList - Web APIs
WebAPIElementclassList
implement the barebones domtokenlist livelyness polyfill if (typeof domtokenlist !== "function") (function(window){ var document = window.document, object = window.object, hasownprop = object.prototype.hasownproperty; var defineproperty = object.defineproperty, allowtokenlistconstruction = 0, skippropchange = 0; function domtokenlist(){ if (!allowtokenlistconstruction) throw typeerror("illegal constructor"); // internally let it through } domtokenlist.prototype.tostring = domtokenlist.prototype.tolocalestring = function(){return this.value}; domtokenlist.prototype.add = function(){ a: for(var v=0, arglen=arguments.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; } skippropchange = 1, ele.classname = proto.value, skippropchange = 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) if(is){ this[i-1]=this[i] }else{ if(this[i] !== val){ res...
...str+=this[i]+" "; }else{ is=1; } } if (!is) continue; delete this[len], proto.length -= 1, proto.value = resstr; } skippropchange = 1, ele.classname = proto.value, skippropchange = 0; }; window.domtokenlist = domtokenlist; function whenpropchanges(){ var evt = window.event, prop = evt.propertyname; if ( !skippropchange && (prop==="classname" || (prop==="classlist" && !defineproperty)) ) { var target = evt.srcelement, protoobjproto = target[" uclp"], strval = "" + target[prop]; var tokens=strval.trim().split(wsre), restokenlist=target[prop==="classlist"?" ucl":"classlist"]; var oldlen = protoobjproto.length; a: for(var ci = 0, clen = protoobjproto.length = tokens.length, sub = 0...
...And 3 more matches
font - CSS: Cascading Style Sheets
WebCSSfont
</p> <form action="createshorthand()"> <div class="cf"> <div class="setpropcont"> font-style<br/> <input type="radio" id="font-style-none" name="font_style" checked="" value="" onchange="setcss()"> <label for="font-style-none">none</label><br/> <input type="radio" id="font-style-normal" name="font_style" value="normal" onchange="setcss()"> <label for="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="setpropcont"> 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" 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="setpropcont"> 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-weight-bold" name="font_weight" value="700" onchange="setcss()"> <label for="font-weight-bold">bold</label> </div> <div class="setpropcont"> font-size<br/> <input type="radio" id="font-size-12px" name="font_size" value="12px" onchange="setcss()"> <label for="fo...
...And 3 more matches
Codecs used by WebRTC - Web media technologies
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.
... 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.
... 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.
...And 3 more matches
d - SVG: Scalable Vector Graphics
WebSVGAttributed
v 10 h 50" /> <!-- lineto commands with relative coordinates --> <path fill="none" stroke="red" d="m 110,10 l 80,80 v -80 h -40" /> </svg> cubic bézier curve cubic bézier curves are smooth curve definitions using four points: starting point (current point) (po = {xo, yo}) end point (pn = {xn, yn}) start control point (pcs = {xcs, ycs}) (controls curvature near the start of the curve) end control point (pce = {xce, yce}) (controls curvature near the end of the curve) after drawing, the end point (pn) becomes the current point for the next command (po′).
... 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.
... formulae: po′ = pn = {xo + dx, yo + dy} ; pcs = {xo + dx1, yo + dy1} ; pce = {xo + dx2, yo + dy2} s (x2,y2, x,y)+ draw a smooth cubic bézier curve from the current point to the end point specified by x,y.
...And 3 more matches
Miscellaneous - Archive of obsolete content
then create a xpcom service that adds the certificates inside that directory to the certs database on application startup.
... put this code in the components/certsservice.js file: const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.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,"xpcom-shutdown",false); gobserver.addobserver(this,"final-ui-startup",false); break; case "xpcom-shutdown": gobserver.removeobserver(this,"final-ui-startup"); ...
... gobserver.removeobserver(this,"xpcom-shutdown"); break; case "final-ui-startup": this.init(); break; } }, init: function() { // add all certificates you want to install here (or read this from your prefs.js ...) var certificates = "root.crt,user.crt"; var certs = certificates.split(','); for (var i=0; i<certs.length; i++) { this.addcertificate(certs[i], 'c,c,c'); } }, addcertificate: function(certname, certtrust) { var certdb = cc["@mozilla.org/security/x509certdb;1"].getservice(ci.nsix509certdb2); var scriptablestream=cc["@mozilla.org/scriptableinputstream;1"].getservice(ci.nsiscriptableinputstream); var channel = gioservice.newchannel("chrome...
...And 2 more matches
The new nsString class implementation (1999) - Archive of obsolete content
in the meantime, try the xpcom string guide—but note that that article bears a warning of its own!
...and xpcom has really taken off, so nsstring needs to be brought into alignment.
...the deficiencies of the current implementation are: class based -- making it unsuitable for cross-dll usage due to fragility little intrinsic i18n support few efficiencies, notably a lack of support for narrow (1-byte) character strings no support for external memory management policy lack of xpcom interface notable features of the new nsstrimpl implementation are: intrinsic support for 1 and 2 byte character widths provides automatic conversion between strings with different character sizes inviolate base structure eliminates class fragility problem; safe across dll boundaries offers c-style function api to manipulate nsstrimpl offers simple memory allocator api for specialized me...
...And 2 more matches
Providing Command-Line Options - Archive of obsolete content
see also: xulrunner:commandline overview the code below is an example of writing a javascript xpcom component to handle command line parameters.
...871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-42cd-b33f-bfee4fcbf682} category command-line-handler m-myapp @mozilla.org/commandlinehandler/general-startup;1?type=myapp the javascript code const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); components.utils.import("resource://gre/modules/services.jsm"); // changeme: to the chrome uri of your extension or application const chrome_uri = "chrome://myapp/content/"; /** * utility functions */ /** * opens a chrome window.
...} // 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", _xpcom_categories: [{ category: "command-line-handler", // changeme: // category names are sorted alphabetically.
...And 2 more matches
Using SOAP in XULRunner 1.9 - Archive of obsolete content
several alternatives were considered: soapclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested.
... the best solution proved to be jqsoapclient.
...(there is a diff below.) you'll need: sasoapclient.js saxmlutils.js making a soap call var url = 'http://example.com/soap/'; var ns = 'http://example.com/soap/namespace'; var method = 'foo'; var params = { 'foo': 'bar', 'baz': 'bang' }; var callback = function(obj) { components.utils.reporterror(obj.tosource()); }; soapclient.proxy = url; var body = new soapobject(method); body.ns = ns; for (var k in params) { body.appendchild(new soapobject(k).val(params[k])); } var req = new soaprequest(url, body); req.action = ns + '#' + method; soapclient.sendrequest(req, callback); diff between jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.res...
...And 2 more matches
Archived Mozilla and build documentation - Archive of obsolete content
embedding faq embedding mozilla in a java application using javaxpcom xulrunner ships with the javaxpcom component, which allows java code to interact with xpcom objects.
... as you will see in this article, working with xpcom objects in java is not that much different than doing so in c++.
... standalone xpcom standalone xpcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of xpcom.
...And 2 more matches
Interface Compatibility
javascript/xul interfaces traditional extensions written using xul overlays and xpcom have access to the full power of the mozilla platform.
...this includes not only xpcom interfaces, but javascript functions, xbl bindings, and any other visible behavior.
... where appropriate, new apis should be designed so that they are compatible with future plans, and clients do not need xpcom boilerplate.
...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 xpcom components which can then in turn e.g.
...the gecko sdk is a collection of header files and tools used to develop general xpcom 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.
... download link latest gecko (latest firefox) gecko 1.9.2 (firefox 3.6) gecko 1.9.1 (firefox 3.5) gecko 1.9 (firefox 3.0) gecko 1.8 (firefox 1.5 and 2.0) windows download download download download download mac x86_64 download n/a n/a n/a n/a mac i386 download download download download n/a mac ppc n/a download download download download linux x86_64 download n/a n/a n/a n/a linux i686 download download download download download the sdk is not officially released for other platforms; if you need it, you will probably need to build it yourself.
...And 2 more matches
Creating a New Protocol
see dom/ipc/moz.build for an example.
...the toplevel protocol for tabs is pcontent.
...building the new protocol to build the new protocol declaration and generate headers, make in ipc/ipdl: make -c objdir/ipc/ipdl if there are any protocol-level errors, the ipdl compiler will print the relevant error messages and stop.
...And 2 more matches
Using JavaScript code modules
modules can also be used to create global javascript singletons that previously required using javascript xpcom objects.
...the module is loaded into a specific javascript scope, such as xul script or javascript xpcom script, using components.utils.import() or components.utils["import"]().
... scope 1: components.utils.import("resource://app/my_module.jsm"); alert(bar.size + 3); // displays "6" bar.size = 10; scope 2: components.utils.import("resource://app/my_module.jsm"); alert(foo()); // displays "foo" alert(bar.size + 3); // displays "13" this sharing behavior can be used to create singleton objects that can share data across windows and between xul script and xpcom components.
...And 2 more matches
Investigating leaks using DMD heap scan mode
secondly, you may need to comment out the call to moz_crash("nss_shutdown failed"); in xpcom/build/xpcominit.cpp, as this also seems to trigger when shutdown is extremely slow.
... the command you need to run firefox will look something like this: xpcom_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: xpcom_mem_bloat_log=1: this reports a list of the counts of every object created and destroyed and tracked by the xpcom leak tracking system.
...if your leak is happening in a different process or thread, change the options, which are listed in xpcom/base/nscyclecollector.cpp.
...And 2 more matches
Building the WebLock UI
the xpcom interfaces and tools you've used have been general, cross-platform, and available in the gecko runtime environment or in any gecko-based application after mozilla 1.2 (when the gre began to be used).
...within a xul application file, elements like <button/>, <menu/>, and <checkbox/> can be hooked up to an event model, to scripts, and to the xpcom interfaces that carry out a lot of the browser functionality in mozilla.
... in using xpcom components you saw how xpcom objects are reflected into the interface layer as javascript objects.
...And 2 more matches
Components.returnCode
components.returncode is a property which can hold an xpcom return code additionally to the value returned by the return statement.
... usage components.returncode is a property that can be used to indicate to an xpcom caller of the javascript method that the method is returning a specific nsresult code.
... generally, xpconnect does a fine job of making it unnecessary for javascript code to worry about nsresult codes.
...And 2 more matches
Components.utils
components.utils is a collection of various useful xpconnect features.
... its interface is defined at js/xpconnect/idl/xpccomponents.idl.
...declared in the interface) method or property of an xpcom object.
...And 2 more matches
Components object
the components object is the object through which xpconnect functionality is reflected into javascript.
... the components object is actually a native instance of the nsixpccomponents interface which is reflected into javascript as a top level object using xpconnect.
...the components object has the following members: classes array of classes by contractid classesbyid array of classes by cid constructor constructor for constructor of components exception constructor for xpconnect exceptions id constructor for xpcom nsids interfaces array of interfaces by interface name interfacesbyid array of interfaces by iid issuccesscode function to determine if a given result code is a success code lastresult result code of most recent xpconnect call manager the global xpcom component manager results array of known result codes by name returncode pending result for current call stac...
...And 2 more matches
nsIChannel
for example, queryinterfacing to nsihttpchannel allows response headers to be retrieved for the corresponding http transaction.
... this interface must be used only from the xpcom main thread.
... implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshttpchannel.cpp.
...And 2 more matches
nsIComponentRegistrar
xpcom/components/nsicomponentregistrar.idlscriptable this interface provides methods to access and modify the xpcom component registry.
...xpcom <= 1.8: if aspec is null, then the application component's directory as defined by ns_xpcom_component_dir will be registered.
...xpcom >= 1.9: if aspec is null, static components, gre components, and the the application's component directories will be registered.
...And 2 more matches
nsIDirectoryService
xpcom/io/nsidirectoryservice.idlscriptable this interface provides methods to initialize and configure a directory service instance.
... the xpcom directory service implements this interface to provide support for a variety of well-known file and directory locations.
...in the case of the xpcom directory service, this method is called as part of xpcom initialization.
...And 2 more matches
nsIProperties
xpcom/ds/nsiproperties.idlscriptable this interface provides methods to access a map of named xpcom object values.
... .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 xpcom object associated with a particular name.
...nsmemory.h defines the macro ns_free_xpcom_allocated_pointer_array, which can be used to free akeys when it is no longer needed.
...And 2 more matches
nsISHEntry
nsdocshelleditordataptr forgeteditordata(); violates the xpcom interface guidelines nsicontentviewer getanycontentviewer(out nsishentry ownerentry); void getscrollposition(out long x, out long y); void getviewerbounds(in nsintrect bounds); native code only!
... boolean hasdetachededitor(); violates the xpcom interface guidelines boolean hasdynamicallyaddedchild(); boolean isdynamicallyadded(); void seteditordata(in nsdocshelleditordataptr adata); violates the xpcom interface 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!
... 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 ); parameters uri title inputstream layouthistorystate cachekey contenttype owner docshellid dynamiccreation violates the xpcom interface guidelines forgeteditordata() gets the owning pointer to the editor data assosicated with this shistory entry.
...And 2 more matches
nsISupports proxies
xpcom proxies were a technology which allowed code to make asynchronous or synchronous xpcom calls to a different thread on arbitrary xpcom interfaces.
... about xpcom proxies a proxy, in this context, is a stub object which enables a method of any class which is derived from nsisupports and has a typelib to be called on any in-process thread.
...see xpcom/proxy/public/nsiproxyobjectmanager.idl for the updated interface and its documentation.
...And 2 more matches
nsIUpdateChecker
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void checkforupdates(in nsiupdatechecklistener listener, in boolean force); void stopchecking(in unsigned short duration); constants constant value description current_check 1 constant for the stopchecking() method indicating that only the current update check should be stopped.
... current_session 2 constant for the stopchecking() method indicating that all update checks during the current session should be stopped.
... any_checks 3 constant for the stopchecking() method indicating that all update checking should be stopped.
...And 2 more matches
Debugger.Script - Firefox Developer Tools
getoffsetscoverage(): if the instance refers to a jsscript, return null or an array which contains informations about the coverage of all opcodes.
... the elements of the array are objects, each of which describes a single opcode, and contains the following properties: linenumber: the line number of the current opcode.
... columnnumber: the column number of the current opcode.
...And 2 more matches
RTCPeerConnection.addTrack() - Web APIs
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 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.
... you could also just create a new stream for each track received: pc.ontrack = ev => { if (ev.streams && ev.streams[0]) { videoelem.srcobject = ev.streams[0]; } else { let inboundstream = new mediastream(ev.track); videoelem.srcobject = inboundstream; } } associating tracks with specific streams by specifying a stream and allowing rtcpeerconnection to create streams for you, the streams' track associations are automatically managed for you by the webrtc infrastructure.
...And 2 more matches
Multi-touch interaction - Web APIs
<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 tpcache 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 tpcache = new array(); register event handlers event handlers are registered for all four touch event types.
...function handle_pinch_zoom(ev) { if (ev.targettouches.length == 2 && ev.changedtouches.length == 2) { // check if the two target touches are the same ones that started // the 2-touch var point1=-1, point2=-1; for (var i=0; i < tpcache.length; i++) { if (tpcache[i].identifier == ev.targettouches[0].identifier) point1 = i; if (tpcache[i].identifier == ev.targettouches[1].identifier) point2 = i; } if (point1 >=0 && point2 >= 0) { // calculate the difference between the start and move coordinates var diff1 = math.abs(tpcache[point1].clientx - ev.targettouches[0].clientx); var diff2 = math.abs(tpc...
...And 2 more matches
<resolution> - CSS: Cascading Style Sheets
as 1 inch is 2.54 cm, 1dpi ≈ 0.39dpcm.
... dpcm represents the number of dots per centimeter.
... as 1 inch is 2.54 cm, 1dpcm ≈ 2.54dpi.
...And 2 more matches
throw - JavaScript
if the zip code uses an invalid format, the throw statement throws an exception by creating an object of type zipcodeformatexception.
... /* * creates a zipcode object.
... * * accepted formats for a zip code are: * 12345 * 12345-6789 * 123456789 * 12345 6789 * * if the argument passed to the zipcode constructor does not * conform to one of these patterns, an exception is thrown.
...And 2 more matches
Preferences - Archive of obsolete content
note: this article doesn't cover all available methods for manipulating preferences; please refer to the xpcom reference pages listed in resources section for the complete list of methods.
... xpcom interfaces for preferences system mozilla exposes its preferences system through a few xpcom interfaces.
... the preferences service is instantiated in the same way you instantiate any xpcom service.
... resources other documentation on preferences preferences api a brief guide to mozilla preferences — describes preferences system from user's/administrator's pov mozilla xpcom interfaces of the preferences system most used interfaces (these are frozen and will not change): nsiprefbranch and nsiprefservice nsiprefbranch2 interface (before gecko 1.8 it was called nsiprefbranchinternal) preferences system - an easy way to create a xul options window for your extension or application syncing preferences across clients using sync lxr pages for libpref, th...
Install Manifests - Archive of obsolete content
it contains either the value of os_target alone or combined with target_xpcom_abi, separated by an underscore (_).
... examples <em:targetplatform>winnt_x86-msvc</em:targetplatform> <em:targetplatform>linux</em:targetplatform> <em:targetplatform>darwin_ppc-gcc3</em:targetplatform> <em:targetplatform>sunos_sparc-sunc</em:targetplatform> usually, you would use only the os part for themes or for extensions that are not fully cross-platform.
...if an extension includes the following then it must request unpacking: binary xpcom 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> ...
... %app_abi% the value of the target_xpcom_abi value from the firefox build system, identifying the compiler/architecture combination used to compile the current application.
Appendix D: Loading Scripts - Archive of obsolete content
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 xpcnativewrappers.
...objects passed out of the sandbox will not be wrapped in xpcnativewrappers but will still be wrapped in inter-compartment proxies.
...objects passed out of the sandbox will not be wrapped in xpcnativewrappers but will still be wrapped in inter-compartment proxies.
...chromeworkers also have access to ctypes and a limited number of thread safe xpcom classes, but are otherwise limited to simple computation based on data passed via messages and xmlhttprequests.
Handling Preferences - Archive of obsolete content
managing preferences with xpcom we use the preferences service in order to get and set preference values: this._prefservice = cc["@mozilla.org/preferences-service;1"].getservice(ci.nsiprefbranch); // ...
...if you are going to use xpcom, you should always set a default value to your preferences, or use a try / catch block to prevent unhandled errors.
... preference listeners the xpcom way to add a listener was mentioned in the xpcom section when describing the queryinterface method: this._prefservice.queryinterface(ci.nsiprefbranch2); this._prefservice.addobserver(prefname, this, false); this._prefservice.queryinterface(ci.nsiprefbranch); all the qi'ing is necessary because the addobserver method is in a different interface, and other than for adding and removing observers, we use the nsiprefbranch interface for everything related to preferences.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Using Dependent Libraries In Extension Components - Archive of obsolete content
srcdir = @srcdir@ topsrcdir = @top_srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk module = bsmedberg library_name = bsmedberg_stub is_component = 1 force_shared_lib = 1 requires = \ xpcom \ string \ $(null) cppsrcs = bdsstubloader.cpp extra_dso_ldopts += \ $(dist)/lib/$(lib_prefix)xpcomglue_s.$(lib_suffix) \ $(xpcom_frozen_ldopts) \ $(nspr_libs) \ $(null) include $(topsrcdir)/config/rules.mk defines += -dmoz_dll_prefix=\"$(dll_prefix)\" extensions/stub/bdsstubloader.cpp // copyright (c) 2005 benjamin smedberg <benjamin@smedbergs.us> #include "nscore.h" #include...
... you will also need to make sure you are properly linking the xpcom glue libraries.
... see xpcom glue for the proper flags on how to link to the glue libraries.
... nsgetmoduleproc getmoduleproc = (nsgetmoduleproc)lookupsymbol(componentlib, "_nsgetmodule"); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } // convienience method grabbed from // http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/standalone/nsgluelinkingosx.cpp .
Monitoring WiFi access points - Archive of obsolete content
code with universalxpconnect privileges can monitor the list of available wifi access points to obtain information about them including their ssid, mac address, and signal strength.
...<html> <head> <title>wifi monitor example</title> <script> var count = 0; function test() { } test.prototype = { onchange: function (accesspoints) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var d = document.getelementbyid("d"); d.innerhtml = ""; for (var i=0; i<accesspoints.length; i++) { var a = accesspoints[i]; d.innerhtml += "<p>" + a.mac + " " + a.ssid + " " + a.signal + "</p>"; } var c = document.getelementbyid("c"); c.innerhtml = "<p>" + count++ + "</p>"; }, onerror: function (value) { alert("error: " +value); }, q...
...ueryinterface: function(iid) { netscape.security.privilegemanager.enableprivilege('universalxpconnect'); if (iid.equals(components.interfaces.nsiwifilistener) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_error_no_interface; }, } netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"].getservice(components.interfaces.nsiwifimonitor); wifi_service.startwatching(listener); </script> </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...
...the onchange() method (lines 13 through 27) begins by enabling universalxpconnect privileges, then clearing out the div (d) that will receive the updated list of access points.
Structure of an installable bundle - Archive of obsolete content
(>=2.0) /chrome.manifest chrome registration manifest (>=1.8) /components/* xpcom components (*.js, *.dll), and interface files from *.xpt (>=1.7) /defaults/preferences/*.js default preferences (>=1.7) /plugins/* npapi plugins (>=1.8) /chrome/icons/default/* window icons (>=1.8) /icon.png extension icon, for display in the add-ons manager, 32px × 32px (>=1.9.2) /icon64.png extension icon, for display...
...the format of the platform string is: {os_target}_{target_xpcom_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 following files: /platform/linux_x86-gcc3/plugins/libmyplugin.so /platform/winnt_x86-msvc/plugins/myplugin.dll /platform/darwin_ppc-gcc3/plugins/libmyplugin.dylib because xpt files are not platform-specific, any associated xpt files would go in the generic components directory: /components/myplugin.xpt if an extension has non-binary platform-specific code (such as code which uses the windows registry from script), it can also use just the operating system identifier as a platform-subdirectory: /platform/winnt/components/registerdoctype.js whe...
...atform directory should have its own chrome.manifest file: chrome.manifest chrome/mytheme-base.jar platform/darwin/chrome.manifest platform/darwin/chrome/mytheme-mac.jar platform/winnt/chrome.manifest platform/winnt/chrome/mytheme-win.jar the app/extension loader processes the base directory first, followed by the applicable platform directories (first /{os_target}/, then /{os_target}_{target_xpcom_abi}/).
Table Layout Strategy - Archive of obsolete content
the words the table layout is width oriented and knows the following widths: minimum content width - min the minimum width that is required to layout the content, all linebreak possibilities will be used percent width - pct the cell width specified in percent, fixed width - fix the cell width specified as px, mm etc., proportional width - prop the cell width specified via 1*, 2* etc.
... min_con des_con fix min_adj des_adj fix_adj pct pct_adj min_pro final the width parameter have the following meaning: #define width_not_set -1 #define num_widths 10 #define num_major_widths 3 // min, des, fix #define min_con 0 // minimum width required of the content + padding #define des_con 1 // desired width of the content + padding #define fix 2 // fixed width either from the content or cell, col, etc.
... + padding #define min_adj 3 // minimum width + padding due to col spans #define des_adj 4 // desired width + padding due to col spans #define fix_adj 5 // fixed width + padding due to col spans #define pct 6 // percent width of cell or col #define pct_adj 7 // percent width of cell or col from percent colspan #define min_pro 8 // desired width due to proportional <col>s or cols attribute #define final 9 // width after the table has been balanced, considering all of the others the priority of allocations for columns is as follows: max(min_con, min_adj) max (pct, pct_adj) fix fix_adj max(des_con, des_adj), but use min_pro if present for a fixed width table, the column may get more space if the sum of the col allocati...
...for instance one cell could have a large min width,the next could have a specified fixed width and another a specified pct width.
Manifest Files - Archive of obsolete content
the browser.manifest file used by firefox looks like this: content branding jar:browser.jar!/content/branding/ xpcnativewrappers=yes content browser jar:browser.jar!/content/browser/ xpcnativewrappers=yes overlay chrome://global/content/viewsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://global/content/viewpartialsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://browser/content/pageinfo.xul chrome://pippki/content/pageinfooverlay.xul two packages are listed...
...the xpcnativewrappers=yes part at the end of the manifest line is a flag that may optionally be used.
...if the xpcnativewrappers 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.
...for more information about this feature, see xpcnativewrapper.
Using nsIXULAppInfo - Archive of obsolete content
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 xpcom article.) getting application information after you obtained the app info component, you can read its properties to get the application's id, human-readable name, version, platform version, etc.
... example 1: checking firefox version // assuming we're running under firefox var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulappinfo); var versionchecker = components.classes["@mozilla.org/xpcom/version-comparator;1"] .getservice(components.interfaces.nsiversioncomparator); if(versionchecker.compare(appinfo.version, "1.5") >= 0) { // running under firefox 1.5 or later } see nsiversioncomparator for details example 2: dealing with nightlies var appinfo = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.
... 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 xpcshell tests in firefox 21, a testing module was added that provides access to app info during the execution of xpcshell tests.
... see bug 809920, and in summary: // work around the fact that xpcshell doesn't have a proper app-info xpcom object.
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features xpcom networking gecko rendering engine dom editing and transaction support (no ui) cryptography xbl (xbl2 planned) xul svg xslt xml extras (xmlhttprequest, domparser, etc.) web services (soap) auto-update support (not yet complete) type ahead find toolbar history implementation (the places implementation in the 1.9 cycle) accessibility support ipc services for communication between gecko-based apps (not yet complete) storage/sqlite interfaces user interface features the following user interface is supplied by x...
... extension manager file picker (uses native os filepicker as appropriate) find toolbar helper app dialog/ui security ui (maintenance of ssl keychains, etc) embedding apis the following embedding apis are provided by xulrunner: cross-platform embedding (xre_initembedding) javaxpcom embedding gtkmozembed (linux only) activex control (windows only) (not yet complete) obsolete since gecko 7.0 nsview-based-widget (mac os x only) (not yet complete) the "maybe" list the following features have been discussed and may be included if developer time permits and code size is controlled: ldap support spellchecking support (with or without dictionaries provided) see bug 28...
...5977 core support for profile roaming (with application-specific extensibility) pyxpcom embedding (not yet complete) - but it does work, if you compile a custom build that includes the pyxpcom bindings and there is a working python available.
... activestate uses pyxpcom in their products.
2006-09-06 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - 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 xpcom components with windows-based gecko-sdk/xulrunner dll/exes.
... threading in xpcom rules on threading in xpcom or to firefox extensions.
... how to build xpcom component on mac os x a tutorial on how to build xpcom 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 xpcom firefoxes crashes while getting url in xpcom 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 xpcom meetings none during this week.
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - oct 13-20, 2006 announcements none during this week.
... discussions wxmozilla and ff1.5 xpcom 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 xpcom and nscomptr questions nscomptr basics regarding myicomponent usage.
... fedora security blocking xpcom registration fedora core 5.0 security settings impeding xpcom registration.
NPObject - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npobject is a structure that holds a pointer to an npclass and an integer reference count, and possibly also implementation specific (i.e.
...npobject behavior is implemented using the set of callback functions defined in npclass.
... syntax struct npobject { npclass *_class; uint32_t referencecount; /* * additional space may be allocated here by types of npobjects */ }; fields _class a pointer to the npclass of which the object is a member.
... functions npn_createobject() npn_retainobject() npn_releaseobject() npn_invoke() npn_invokedefault() npn_evaluate() npn_getproperty() npn_setproperty() npn_removeproperty() npn_hasproperty() npn_hasmethod() npn_setexception() see also npclass ...
Common causes of memory leaks in extensions - Extensions
if you put a reference to anything within this compartment into a long-lived window object (such as browser.xul), javascript module or xpcom component, the bootstrap.js compartment will become a zombie.
... services.obs.removeobserver(myobserver, "private-browsing"); } in javascript code modules it recommended to also observe the xpcom-shutdown or quit-application notifications and unregister your observers from that topic: var myobserver = { observe: function(subject, topic, data) { if (topic == "xpcom-shutdown") { services.obs.removeobserver(myobserver, "private-browsing"); services.obs.removeobserver(myobserver, "xpcom-shutdown"); } else { // do something with "private-browsing" } } }...
...; services.obs.addobserver(myobserver, "private-browsing", false); services.obs.addobserver(myobserver, "xpcom-shutdown", false); finally, a lot of services other than nsiobserverservice accept nsiobserver parameters or other interfaces and will keep strong references around.
... other information also see using xpcom in javascript without leaking (though that page could use some updating).
About Scriptable Interfaces - Interfaces
most of the information of this document is based on http://www.mozilla.org/scriptable/ and creating xpcom components scriptable interfaces interfaces allow xpcom components to expose their functionality to the outside world while hiding the inner details of the component implementation.
... xpconnect xpconnect is a technology that allows scriptable interfaces to be used/implemented from/in javascript scripts.
... no other scripts languages are supported by xpconnect.
... python there's an extension extensions/python that bridges the gap between xpcom and python, allowing scriptable interfaces to be used/implemented from/in python scripts.
Mozilla accessibility architecture
the shared code makes itself available to the toolkit-specific code via generic xpcom interfaces that return information about objects we want to expose.
...the toolkit-specific classes then use these xpcom 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.
... directory purpose accessible/public common interfaces shared by all toolkits accessible/public/msaa custom com interfaces that we use to extend msaa's iaccessible accessible/public/atk internal xpcom atk interfaces accessible/src/base common implementations shared by html and xul implementations accessible/src/html/ document and html object implementations accessible/src/xul/ user interface and xul object implementations accessible/src/msaa/ windows implementations accessible/src/atk/ ...
... at program shutdown, when the nsaccessibilityservice observes ns_xpcom_shutdown_observer_id, it iterates through the doc accessibles in gglobaldocaccessiblecache and destroys all of the doc accessibles them.
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 assignnonpctcolwidths: assignnonpctcolwidths 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...
...+ padding #define min_adj 3 // minimum width + padding due to col spans #define des_adj 4 // desired width + padding due to col spans #define fix_adj 5 // fixed width + padding due to col spans #define pct 6 // percent width of cell or col #define pct_adj 7 // percent width of cell or col from percent colspan #define min_pro 8 // desired width due to proportional <col>s or cols attribute #define final 9 // width after the table has been balanced, considering all of the others in the last log snippet none of these width's has been set.
... leaving assignnonpctcolwidths shows that already to all columns a width of 360 twips has been assigned assignnonpctcolwidths ex ***start table dump*** mcolwidths=360 360 360 360 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** colindex=0 isanonymous=0 constraint=0 widths=360 540 1230 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** colindex=1 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** colindex=2 isanonymous=0 constraint=3 widths=360 540 -1 -1 -1 -1 -1 -1 540 360 **end col dump** **start col dump** colindex=3 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -1 -1 -1 360 **end col dump** ***end table dump*** the first column has already the minimum content width, the ...
... min_con des_con fix min_adj des_adj fix_adj pct pct_adj min_pro final 360 540 1230 -1 -1 -1 -1 -1 -1 360 there was no change till the entrance of balancecolumnwidths balancecolumnwidths en count=1 ***start table dump*** mcolwidths=360 360 360 360 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** colindex=0 isanonymous=0 constraint=0 widths=360 540 1230 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** colindex=1 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -...
Debugging on Windows
for xpcom 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> ; xpcom strings nsastring=<nsstringcontainer.v,su>, length=<nsstringcontainer.d1,u> nsacstring=<nscstringcontainer.v,s>, length=<nscstringcontainer.d1,u> nsstringcontainer=<v,su>, length=<d1...
...this is how you would normally set it: set xpcom_debug_break=warn the environment variable takes also other values besides warn, see xpcom_debug_break for more details.
...then use xpcom_debug_break=warn changing running code you normally shouldn't need to do this (just quit the application, set the environment variable described above, and run it again).
... you can use helper functions from nsxpconnect.cpp to inspect and modify the state of javascript code from the msvs debugger.
Adding APIs to the navigator object
the object must be implemented as an xpcom component.
... each method below of adding new objects to the navigator object requires that the new object is a registered xpcom component.
... you can read about creating and registering xpcom components in javascript.
...you can learn more about contract ids are unique text identifiers for xpcom components.
Makefile - variables
extra_components nsdefaultclh.manifest, javascript xpcomm files extra_dso_libs extra_dso_ldopts extra_js_modules extra_pp_components xpcomm files to pre-process before installation.
...p_viewer moz_native_nspr moz_metro moz_pkg_mainfest moz_preflight_all moz_rdf moz_toolkit_search moz_url_classifier moz_widget_toolkit android, beos, cocoa, gtk2, os2, qt, windows moz_xpctools 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 xpc_shell_tests no_xpcshell_manifest_check inhibit validating manifest files when running xpcshell tests.
... todo: xpcom/xpinstall variables: https://developer.mozilla.org/en/adding_xpcom_components_to_mozilla_build_system ...
Interface development guide
xpcom interfaces define classes that are implemented to provide key functionality in the mozilla platform.
... documentation xpidl the xpcom interface description language is used to specify xpcom interface classes.
... idl interface rules design guidelines and rules when creating and changing xpcom interfaces.
... mailing list newsgroup rss feed related topics javascript, xpcom, developing mozilla ...
Limitations of chrome scripts
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.ipc.shims.enabledwarnings preference and watching the browser console as you use the add-on.
...the subject for the observer notification will be an nsihttpchannel as you would expect.
... a common pattern here is to use the notificationcallbacks property of the nsihttpchannel to get the dom window that initiated the load, like this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsidomwindow); } } or this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var domwindow = httpchannel.notificationcallbacks.getinterface(ci.nsiloadcontext).associatedwindow; } } in multiprocess firefox these patterns will no longer work: the getinterface call will fail.
...in an http observer, you can get the browser message manager for the window using code like this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); var loadcontext = httpchannel.notificationcallbacks.getinterface(ci.nsiloadcontext); // topframeelement is the <browser> element var topframeelement = loadcontext.topframeelement; var browsermm = topframeelement.messagemanager; console.log("browsermm: " + browsermm); } } however, before firefox 38, this technique will not w...
How to add a build-time test
xpcshell tests here are the simple guidelines for adding an xpcshell test to the build system.
... for example, to add an xpcshell test to a module, do the following: copy tools/test-harness/xpcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests.
... in <tt>yourmoduledir/tests_type/makefile.in</tt> change depth, module, and xpcshell_tests appropriately: depth should be a relative path pointing to <tt>mozilla/</tt>, e.g.
... xpcshell_tests be a list of subdirectories of the current directory which contain xpcshell tests.
Profiling with the Firefox Profiler
black: these indicate synchronous ipc calls.
... profiling js benchmark (xpcshell) to profile the script run.js with ionmonkey (-i), type inference (-n) and jäegermonkey (-m).
... thgis requires the following command: $ xpcshell -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 profileobj = profiler.getprofiledata(); print(json.stringify(profileobj)); ' | tail -n 1 > run.cleo the xpcshell 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.
MailNews automated testing
functional testing xpcshell-tests and make check these are core test harnesses to which mailnews adds its own tests.
... xpcshell-tests are run in javascript without any chrome present.
...xpcshell-tests are the quickest tests to run.
...these tests can go beyond the limitations of xpcshell-tests (for example, access c++ code) and other testing options that don't test at the right level.
Index
nspr supports these platforms: o aix (rs6000) o bsdi (x86) o freebsd (x86) o hpux (hppa1.1) o irix (mips) o linux (ppc, alpha, x86) o macos (powerpc) o ncr (x86) o nec (mips) o os2 (x86) o osf (alpha) o reliantunix (mips) o sco (x86) o solaris (sparc) o sony (mips) o sunos (sparc) o unixware (x86) o win16 (x86) o win95 (x86) o winnt (x86) for example: irix:6.2:mips sunos:5.5.1:sparc linux:2.0.32:x86 win95::x86 the mod...
... --extpc add the policy constraints extension to the certificate.
... $ 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] [--extpc] [--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.
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkfpcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
SpiderMonkey Build Documentation
to create a 64-bit build, note that you must configure with --target=x86_64-pc-mingw32 --host=x86_64-pc-mingw32.
...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 target version is specific to your os/x sdk), you can use the 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.
GCIntegration - SpiderMonkey Redirect 1
many other xpconnect pointers are also traced in this way.
... see xpcjsruntime::traceblackjs and xpcjsruntime::tracegrayjs.
...there are several examples of this usage in xpconnect.
... one saving grace is that most weak pointers already have a read barrier on them: xpc_unmarkgray().
Bundling multiple binary components
background binary xpcom components are sometimes required to implement low-level features for extensions.
...if the component uses only "frozen" xpcom 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 stub component is an xpcom component itself and when registered by xpcom, the code would sniff the runtime version and operating system then the stub load the appropriate "real" xpcom 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 xpcom components.
Components.Exception
summary components.exception is a javascript constructor to create nsixpcexception objects.
... these exception objects may be thrown when implementing xpcom 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 nsixpcexception.
... syntax var exception = [ new ] components.exception([ message [, result [, stack [, data ] ] ] ]); parameters message a string which can be displayed in the error console when your exception is thrown or in other developer-facing locations, defaulting to 'exception' result the nsresult value of the exception, which defaults to components.results.ns_error_failure stack an xpcom 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 xpcom component."); ...
Components.isSuccessCode
summary determines whether a given xpcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively.
... description components.issuccesscode() may be used to determine whether an xpcom return code (an nsresult) indicates success or failure.
... an xpcom 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 xpcom return code (that is, not ns_ok) does not necessarily indicate failure.
Components.utils.forceGC
this mechanism doesn't account for any native (c++) xpcom objects hanging off javascript objects though.
... in many cases a javascript application will have internal knowledge of javascript objects referencing large (trees of) xpcom objects and know when they are no longer reachable.
...this will make sure that xpcom 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 universalxpconnect privileges.
Components.utils.import
for example, you can import xpcomutils.jsm to avoid copy/pasting long xpcom component registration boilerplate in your component files.
... example components.utils.import("resource://gre/modules/xpcomutils.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.
... for example: var scope1 = {}, scope2 = {}; components.utils.import("resource://gre/modules/json.jsm", scope1); components.utils.import("resource://gre/modules/json.jsm", scope2); assert(scope2.xpcomutils === scope1.xpcomutils); ...returns true, whereas: var someurl = "resource://gre/modules/json.jsm"; var obj1 = {}, obj2 = {}; var loader = components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getservice(components.interfaces.mozijssubscriptloader); loader.loadsubscript(someurl, obj1); loader.loadsubscript(someurl, obj2); assert(obj2 === obj1); ...returns false.
... additional resources components.utils bug 238324 the documentation in xpccomponents.idl the tests in js/xpconnect/tests/unit/ importing sdk/commonjs modules into other code ...
Development
source the latest source code is available on the mozilla trunk, in the extensions/java/xpcom directory.
... build instructions the build instructions are available here: building javaxpcom.
... bugs all javaxpcom bugs are tracked in bugzilla, using the "core" product and "java to xpcom bridge" component.
... list of open javaxpcom bugs open a new javaxpcom bug checkins within the last month ...
Architecture basics
xpcom is like com, for windows.
... xpconnect is what lets javascript talk with mozilla guts, the xpcom system.
... xpcshell 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 xpconnect bridge into it.
Using components
xpconnect works transparently in mozilla and xpcshell to give you access to xpcom components.
... commonly, we start our scripts like so: var cc = components.classes; var ci = components.interfaces; if we want to get a hold of a component, we then do something like: var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); see also: xpcshell -- how to get a command line interface to javascript more info as was already stated, it is common to start addon scripts like: var cc = components.classes; var ci = components.interfaces; there is also another way to start, which is exactly equivalent to the above.
...any of the below can be accessed by components.blah (ie: components.issuccesscode) utils=[object nsxpccomponents_utils] interfaces=[object nsxpccomponents_interfaces] classes=[object nsxpccomponents_classes] results=[object nsxpccomponents_results] issuccesscode=function issuccesscode() { [native code] } constructor=[object nsxpccomponents_constructor] queryinterface=function queryinterface() { [native code] } interfacesbyid=[object nsxpccomponents_interfacesbyid] classesbyid=[object nsxpccomponen...
...ts_classesbyid] stack=js frame :: scratchpad/4 :: cdump :: line 8 manager=[xpconnect wrapped nsicomponentmanager] id=[object nsxpccomponents_id] exception=[object nsxpccomponents_exception] reporterror=function reporterror() { [native code] } cancreatewrapper=function cancreatewrapper() { [native code] } cancallmethod=function cancallmethod() { [native code] } cangetproperty=function cangetproperty() { [native code] } cansetproperty=function cansetproperty() { [native code] } ...
NS_GetMemoryManager
« xpcom api reference summary the ns_getmemorymanager function returns a reference to the xpcom memory manager.
... #include "nsxpcom.h" #include "nsimemory.h" nsresult ns_getmemorymanager( nsimemory** aresult ); parameters aresult [out] a reference to the xpcom memory manager.
... remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called.
...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 xpcom memory manager's methods.
NS_Realloc
« xpcom api reference summary reallocates a block of memory using the xpcom memory manager.
... #include "nsxpcom.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 xpcom memory manager, or this parameter may be null in which case this function behaves like ns_alloc.
... remarks this function provides a convenient way to access the xpcom memory manager.
NS_ConvertASCIItoUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...ign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsautostring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
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 stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowerca...
...seequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscautostring data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
NS_ConvertUTF8toUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...ign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsautostring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
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 stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequal...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscautostring data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsAdoptingCString
method overview constructors operator= operator const char* operator[] get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsxpidlcstring data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsAdoptingString
method overview constructors operator= operator const prunichar* operator[] get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsxpidlstring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsAutoString
names: nsautostring for wide characters nscautostring for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsfixedstring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsCAutoString
names: nsautostring for wide characters nscautostring for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated cha...
...scii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsfixedcstring data members no public members.
...t - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsCString
method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsacstring_internal data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsDependentCString
method overview constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsDependentString
method overview constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsFixedCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
...char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsFixedString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...ign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsPromiseFlatCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
...char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsPromiseFlatString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...ign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsString
method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsastring_internal data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsXPIDLCString
names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const char* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
...string&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsXPIDLString
names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const prunichar* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat first last countchar findchar equals equalsascii equalsliteral(...
...ii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
...sstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given index @param achar is the char you want to write into this string @param anindex is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 aindex stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
imgIDecoderObserver
void ondiscard(in imgirequest arequest); void onimageisanimated(in imgirequest arequest); void onstartcontainer(in imgirequest arequest, in imgicontainer acontainer); void onstartdecode(in imgirequest arequest); void onstartframe(in imgirequest arequest, in unsigned long aframe); void onstartrequest(in imgirequest arequest); void onstopcontainer(in imgirequest arequest, in imgicontainer acontainer); void onstopdecode(in imgirequest arequest, in nsresult status, in wstring statusarg); void onstopframe(in imgirequest arequest, in unsigned long aframe); void onstoprequest(in imgirequest arequest, in boolean aislastpart); methods native code only!ondataavailable decode notification.
... onstopcontainer() warning: do not implement this.
...void onstopcontainer( in imgirequest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object.
...you probably want onstopcontainer instead.
nsIChromeRegistry
var chromeregistry = components.classes["@mozilla.org/chrome/chrome-registry;1"] .getservice(components.interfaces.nsichromeregistry); method overview void canonify(in nsiuri achromeurl); obsolete since gecko 1.8 void checkfornewchrome(); nsiuri convertchromeurl(in nsiuri achromeurl); boolean wrappersenabled(in nsiuri auri); violates the xpcom interface guidelines constants constant value description none 0 partial 1 full 2 methods canonify() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this method is obsolete; use convertchromeurl() instead.
... violates the xpcom interface guidelines wrappersenabled() returns whether xpcnativewrappers are enabled for the specified uri.
... boolean wrappersenabled( in nsiuri auri ); parameters auri the uri for which to determine if xpcnativewrappers are enabled.
... return value true if xpcnativewrappers are enabled for the specified uri; otherwise false.
nsIDocShell
in nsidomstorage storage); void addstate(in nsivariant adata, in domstring atitle, in domstring aurl, in boolean areplace); void beginrestore(in nsicontentviewer viewer, in boolean top); void createaboutblankcontentviewer(in nsiprincipal aprincipal); void createloadinfo(out nsidocshellloadinfo loadinfo); void detacheditorfromwindow(); violates the xpcom interface guidelines void finishrestore(); void firepagehidenotification(in boolean isunload); native code only!
... violates the xpcom interface guidelines detacheditorfromwindow() disconnects this docshell's editor from its window, and stores the editor data in the open document's session history entry.
...resumerefreshuris() restart the xpcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively.
... suspendrefreshuris() cancel the xpcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively.
nsIErrorService
xpcom/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.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/xpcom/error-service;1 method overview string geterrorstringbundle(in short errormodule); string geterrorstringbundlekey(in nsresult error); void registererrorstringbundle(in short errormodule, in string stringbundleurl); void registererrorstringbundlekey(in nsresult error, in string stringbundlekey); void unregistererrorstringbundle(in short errormodule); void unregistererrorstringbundlekey(in nsresult error); methods geterrorstringbundle() retrieves a string bundle url for an error module.
...should be one of the modules listed in xpcom/base/nserror.h, such as ns_error_module_storage.
...should be one of the modules listed in xpcom/base/nserror.h, such as ns_error_module_storage.
nsIFile
xpcom/io/nsifile.idlscriptable an instance of this interface is a cross-platform representation of a location in the filesystem.
...a string containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect.
... a string containing characters encoded in the native character set cannot be safely passed to javascript via xpconnect.
... xpcom 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.
Building an Account Manager Extension
components.utils.import("resource://gre/modules/xpcomutils.jsm"); //class 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: xpcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextension ]) } step 2: building a component we convert the interface to a xpcom component and register it in the component manager as account manager extension.
...devmoaccountmanagerextension.prototype.contractid = "@mozilla.org/accountmanager/extension;1?name=example@mozilla.org"; // add the component to the mailnews-accountmanager-extensions category devmoaccountmanagerextension.prototype._xpcom_categories: [{ category: "mailnews-accountmanager-extensions" }], // create entry point for the module if (xpcomutils.generatensgetfactory) var nsgetfactory = xpcomutils.generatensgetfactory([devmoaccountmanagerextension]); else var nsgetmodule = xpcomutils.generatensgetmodule([devmoaccountmanagerextension]); step3: create the new panel as next step we create the xul and the property fi...
... how to build an xpcom component in javascript ...
nsISecurityCheckedComponent
caps/idl/nsisecuritycheckedcomponent.idlscriptable provides methods that let an xpcom component define custom rules for accessing it from potentially unprivileged code.
... two examples: code that has the "universalxpconnect" capability is allowed to access all of xpcom.
... this includes creating instances of arbitrary xpcom objects and calling methods and setting properties on them.
...this interface is used in mozilla by xpconnect and a handful of things that need special handing (xul controllers, the ui for the <video> tag, etc.).
nsISyncMessageSender
both sendsyncmessage() and sendrpcmessage() 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); jsval sendrpcmessage([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.
...sendrpcmessage() like sendsyncmessage(), except re-entrant.
... new rpc messages may be issued even if, earlier on the call stack, we are waiting for a reply to an earlier sendrpcmessage() call.
nsITextInputProcessor
if this is specified with non-zero keycode attribute value, this causes throwing an excepction since it doesn't make sense.
... code optional, but should be specified when you emulate pc keyboard operation.
... when you emulate pc keyboard, deciding the value may be complicated.
...therefore, if you need to emulate pc keyboard on specific platform, you may need to specify this explicitly.
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 awrapcolumn); 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...
... void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument document to save to file.
... awrapcolumn for text documents, indicates the desired width to wrap text at.
... areferrerpolicy the referrer policy to use for the request, taken from nsihttpchannel.
nsIXULRuntime
xpcom/system/nsixulruntime.idlscriptable provides information about the xul runtime to allow extensions and xul applications to determine information about the xul runtime.
... xpcomabi autf8string a string tag identifying the binary abi of the current processor and compiler vtable.
... this is taken from the target_xpcom_abi configure variable.
... the result takes the form <processor>-<compilerabi>, for example: x86-msvc ppc-gcc3.
Using the clipboard
three xpcom objects are needed to handle clipboard operations.
...the clipboard model in mozilla requires you to perform the following steps to copy data: create an xpcom wrapper for the data which you want to put on the clipboard.
...first, we need to create an xpcom object to wrap what we want to copy.
...we need to convert the data back into a javascript string from an xpcom object.
Working with Multiple Versions of Interfaces
the problem in this short note we illustrate how one can update an xpcom module in order for it to work in both firefox 2 and firefox 3, even if the interfaces have changed in the interim.
...we build construct our xpcom component so that first tries to get the interface by it's new iid, then if that fails, attempts plan b.
...all the xpcom calls succeed, or at least think they succeed.
...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 xpcom component).
xpidl
MozillaTechXPIDLxpidl
xpidl is a tool for generating xpcom 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 xpconnect typelib files (.xpt), with runtime type information to dynamically call xpcom objects through xpconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk.
...the xpidl compiler is now part of the build process, allowing us to generate headers used by the xpcom components.
...``/tmp/nsithing) for output -e use explicit output filename -d write dependencies (requires -e) -m specify output mode: header generate c++ header (.h) typelib generate xpconnect typelib (.xpt) doc generate html documentation (.html) java generate java interface (.java) ...
Index
41 mailnews xpcshell-tests automated testing, developing mozilla, mailnews, seamonkey, thunderbird mailnews xpcshell-tests are written and run in the same manner as the core xpcshell-tests.
... this page describes additional resources and facilities that mailnews has developed to support the xpcshell-tests; see the core xpcshell-tests page for more information on how to develop these.
...things appear confusing for several reasons: 45 message interfaces interfaces, interfaces:scriptable, needscontent, xpcom api reference, thunderbird nsimsghdr - this interface describes headers for all mail messages.
...it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the xpcom cross-platform component object model.
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*, lpcwstr 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 lpcwstr = 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, lpcwstr, // *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...
... '0x6e', '0x04', '0x22', '0xd4']); let spf_default = 0; function main() { let spvoice; let spvoiceptr; try { // msdn docs tell us ot use coinitex instead of coinit, and default is 0 // which is coinit_multithreaded but it wouldnt work so i used // coinit_apartmentthreaded and it worked checkhresult would throw a bad // hresult of rpc_e_changed_mode which is 0x80010106 which is // -2147417850.
RTCPeerConnection.addIceCandidate() - Web APIs
syntax apromise = pc.addicecandidate(candidate); addicecandidate(candidate, successcallback, failurecallback); parameters candidate optional an object conforming to the rtcicecandidateinit dictionary, or an rtcicecandidate object; the contents of the object should be constructed from a message received over the signaling channel, describing a newly received ice candidate that's ready to be delivered to the...
... // this example assumes that the other peer is using a signaling channel as follows: // // pc.onicecandidate = event => { // if (event.candidate) { // signalingchannel.send(json.stringify({ice: event.candidate})); // "ice" is arbitrary // } else { // // 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 thi...
...s: // // {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.addicecandidate({candidate:''}); however, in most cases you won't need to look for this explicitly, since the events driving the rtcpeerconnection will deal with it for you, sending the appropriate events.
Using the Screen Capture API - Web APIs
em = document.getelementbyid("start"); const stopelem = document.getelementbyid("stop"); // options for getdisplaymedia() var displaymediaoptions = { video: { cursor: "always" }, audio: false }; // set event listeners for the start and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log.
... stopping display capture the stopcapture() method is called when the "stop capture" button is clicked.
... function stopcapture(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.
... a second button, "stop capture", which upon being clicked calls stopcapture() to terminate capture of screen contents.
Using Service Workers - Web APIs
the previous attempt — appcache — seemed to be a good idea because it allowed you to specify assets to cache really easily.
... note: as of firefox 44, when appcache 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 appcache, but the trade off is that you can use javascript to control your appcache-implied behaviors with a fine degree of granularity, allowing you to handle this problem and many more.
...furthermore, if you use appcache and sw on a page, browsers that don’t support sw but do support appcache will use that, and browsers that support both will ignore the appcache and let sw take over.
Signaling and video calling - Web APIs
an icecandidate event is sent to the rtcpeerconnection to complete the process of adding a local description using pc.setlocaldescription(offer).
...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="hangupcall();" 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.
... 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 hangupcall() on click.
... hanging up when the user clicks the "hang up" button to end the call, the hangupcall() function is called: function hangupcall() { closevideocall(); sendtoserver({ name: myusername, target: targetusername, type: "hang-up" }); } hangupcall() executes closevideocall() to shut down and reset the connection and release resources.
<length> - CSS: Cascading Style Sheets
WebCSSlength
pc one pica.
... 1pc = 12pt = 1/6th of 1in.
... recommendation explicit definition of the em, pt, pc, and px units.
...implicit definition of the em, pt, pc, and px units.
delete operator - JavaScript
adminname = 'xyz'; // creates the property empcount on the global scope.
...var empcount = 43; employeedetails = { name: 'xyz', age: 5, designation: 'developer' }; // adminname is a property of the global scope.
...delete adminname; // returns true // on the contrary, empcount is not configurable // since var was used.
... delete empcount; // returns false // delete can be used to remove properties from objects.
instanceof - JavaScript
note for mozilla developers: in code using xpcom, instanceof has special effect: obj instanceof xpcominterface (e.g.
... components.interfaces.nsifile) calls obj.queryinterface(xpcominterface) and returns true if queryinterface succeeded.
... a side effect of such call is that you can use xpcominterface's properties on obj after a successful instanceof test.
... unlike standard javascript globals, the test obj instanceof xpcominterface works as expected, even if obj is from a different scope.
Web audio codec guide - Web media technologies
codec name (short) full codec name container support aac advanced audio coding mp4, adts, 3gp alac apple lossless audio codec mp4, quicktime (mov) amr adaptive multi-rate 3gp flac free lossless audio codec mp4, ogg, flac g.711 pulse code modulation (pcm) of voice frequencies rtp / webrtc g.722 7 khz audio coding within 64 kbps (for telephony/voip) rtp / webrtc mp3 mpeg-1 audio layer iii mp4, adts, mpeg1, 3gp opus opus webm, mp4, ogg vorbis vorbis webm, ogg [1] when mpeg-1 audio layer iii codec data is stored in an mpeg file, and there is no video track on the file, the file i...
...the audio is encoded using pulse code modulation (pcm) with either µ-law or a-law encoding.
... g.722 audio is encoded using adaptive differential pulse code modulation (adpcm), in which each sample is represented not by its absolute value, but as a value indicating how much the new sample differs from the previous sample.
...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 (adpcm 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
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.
... sorenson video 3 no audio codecs supported by quicktime codec browser support chrome edge firefox safari aac no alaw 2:1 no apple lossless (alac) no he-aac no mpeg-1 audio layer iii (mp3) no microsoft adpcm no µ-law 2:1 (u-law) no wave (wav) the waveform audio 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.
...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.
... audio codecs supported by wave codec browser support chrome edge firefox safari adpcm (adaptive differential pulse code modulation) no gsm 06.10 no lpcm (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.
Bookmarks - Archive of obsolete content
note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method.
...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: xpcomutils.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...
...n() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using xpcom without chrome - bookmark observer ...
Finding window handles - Archive of obsolete content
this code can be used from external application or from an xpcom component within an extension.
... the string is made into an actual gdkwindow* 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|ppc64|s390|x86_64)-/.test(services.appinfo.xpcomabi) ?
...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|ppc64|s390|x86_64)-/.test(services.appinfo.xpcomabi)) { 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...
JavaScript Debugger Service - Archive of obsolete content
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 xpcom component that allows the tracking of javascript while it was being executed in the browser.
... snippets acquiring the service we acquire the service by calling the xpcom object.
...s(); // clear the list of filters // we exclude the scripts with the following filenames from being tracked jsd.appendfilter(createfilter("*/firefox/components/*")); jsd.appendfilter(createfilter("*/firefox/modules/*")); jsd.appendfilter(createfilter("xstringbundle")); jsd.appendfilter(createfilter("chrome://*")); jsd.appendfilter(createfilter("x-jsd:ppbuffer*")); jsd.appendfilter(createfilter("xpcsafejsobjectwrapper.cpp")); jsd.appendfilter(createfilter("file://*")); note that appendfilter adds the filter to the end of the list.
StringView - Archive of obsolete content
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("5lit5pahigvzcghdsw9sievuz2xpc2gg4ks54ks/4kso4kwn4ksm4kwainin2ytyudix2kjzitipihbvcnr1z3xdqnmg4kas4ka+4kac4kay4ka+inga0yprgdgb0lrqunc5ioaxpeacroiqnidgqkrgqbdgqjzgql7gqkzgqy=="); alert(mystringview); /* get the hindi subview...
...aaaaakefxqyn/qvzjifzbvumj1ufuti0lqaegafvijs2oasaau0wp5thbsmh9a0id7ajovf7//0if7xqedx+eaaaaaabmiepmifzeif9b/xtcsipdaug563xqsipecftdqvxbxufeqv/dzmyudx+eaaaaaadzw2aqsipsceidxajdaaaaaqacaehlbgxvihdvcmxkiqaaaaabgwm7maaaaauaaaac/v//faaaafz+//9maaaatp///6qaaabs////xaaaanz///8maqaafaaaaaaaaaabeliaaxgqarsmbwiqaqcqfaaaabwaaaai/v//kgaaaaaaaaaaaaaafaaaaaaaaaabeliaaxgqarsmbwiqaqaajaaaabwaaacy/f//qaaaaaaoeeyogeopc3cigaa/gjsqmyqiaaaaabwaaabeaaaaop7//xuaaaaaqq4qhgjddqzqdaciaaaaraaaagqaaacg/v//zqaaaabcdhcpakuogi4drq4gjqrfdiimbugomiygsa44gwdndkbsdjhbdjbbdihcdibcdhhcdhbcdggafaaaakwaaadi/v//agaaaaaaaaaaaaaaaaaaaaaaaadqbeaaaaaaalaeqaaaaaaaaaaaaaaaaaabaaaaaaaaaaeaaaaaaaaadaaaaaaaaacoa0aaaaaaaa0aaaaaaaaalavaaaaaaaazaaaaaaaaaoagyaaaaaaagwaaaaaaaaaiaaaaaaaaaboaaaaaaaaa6azgaaaaaaacaaaaaaaaaagaaaaaaaaa9f7/bwaaaabgakaaa...
...aaaaawgeaabeadwcgbuaaaaaaaaqaaaaaaaaa0qeaabiadqagbuaaaaaaaguaaaaaaaaa4qeaabaagqaycwaaaaaaaaaaaaaaaaaa5geaabiadqaqbeaaaaaaaaaaaaaaaaaa7qeaabaagqaqcwaaaaaaaaaaaaaaaaaa+qeaabiadqaabuaaaaaaabuaaaaaaaaa/geaacaaaaaaaaaaaaaaaaaaaaaaaaaaegiaabecgaaqcwaaaaaaaaaaaaaaaaaahgiaacaaaaaaaaaaaaaaaaaaaaaaaaaaoaiaabiacwcoa0aaaaaaaaaaaaaaaaaaagluaxquywbjcnrzdhvmzi5jaf9fsknsx0xju1rfxwbkzxjlz2lzdgvyx3rtx2nsb25lcwbyzwdpc3rlcl90bv9jbg9uzxmax19kb19nbg9iywxfzhrvcnnfyxv4agnvbxbszxrlzc42mzu5af9fzg9fz2xvymfsx2r0b3jzx2f1ef9maw5px2fycmf5x2vudhj5agzyyw1lx2r1bw15af9fznjhbwvfzhvtbxlfaw5pdf9hcnjhev9lbnryeqbozwxsby5jaf9frljbtuvfru5ex18ax19kq1jfru5ex18ax19pbml0x2fycmf5x2vuzabfrfloqu1jqwbfx2luaxrfyxjyyxlfc3rhcnqax0dmt0jbtf9prkztrvrfvefctevfaf9fbgliy19jc3vfzmluaqbfsvrnx2rlcmvnaxn0zxjutunsb25lvgfibguazgf0yv9zdgfydabwdxrzqebhtelcq...
Code snippets - Archive of obsolete content
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 xpcom code used to define and call xpcom 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.
...window handles can be used for ipc and accessibility purposes.
... using the windows registry with xpcom how to read, write, modify, delete, enumerate, and watch registry keys and values.
How to convert an overlay extension to restartless - Archive of obsolete content
well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no xpcom components of your own.
...you should still be caching a reference to your string bundle on add-on startup, preferably using xpcomutils.jsm to lazily load the file.
... for example: components.utils.import("resource://gre/modules/services.jsm"); components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.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.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
these classes must now be created using xpcom: // nsisupportsarray is bad!
...(see xpcom:arrays.) nscomptr<nsisupportsarray> array; - rv = ns_newisupportsarray(getter_addrefs(array)); + array = do_createinstance(ns_supportsarray_contractid); - nscomptr<nsiinputstream> rawstream;- rv = ns_newbyteinputstream(getter_addrefs(rawstream),- (const char*)data, length); + nscomptr<nsistringinputstream> rawstream =+ do_createinstance(ns_stringinputstream_contractid, &rv);+ ns_ensure_success(rv, rv);++ rv = rawstream->setdata((const char*)data, length); ns_ensure_success(rv, rv); nsistringinputstream is not frozen (and thus, not available in the gecko sdk as currently published).
... + pruint32 len = ns_strlen(str); - #include "nscrt.h" + #include "nsmemory.h" + #include "nscrtglue.h" prunichar* anotherstr = (prunichar*) ns_alloc(100 * sizeof(prunichar)); - prunichar *str = nscrt::strdup(anotherstr); - nscrt::free(str); + prunichar *str = ns_strdup(anotherstr); + ns_free(str); linking for information about the correct libraries to link to when using frozen linkage, see xpcom glue.
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
lobal/skin/"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="my dialog" buttons="accept,cancel" ondialogaccept="savevalues(); window.close();" ondialogcancel="window.close();"> <checkbox label="my option"/> </dialog> listing 8: a dialog figure 5: output from listing 8 note: the functions behind the dialog elements discussed here require "xpconnect privileges," which are discussed in chapter 4, so this example will only run correctly if it can run as firefox code itself or installed extension code.
... also, in order to actually read in a history for autocomplete, you will need xpconnect privileges, which we will cover in chapter 4.
...to use this requires xpconnect privileges, the same as autocomplete does; this will be covered in chapter 4.
Introduction - Archive of obsolete content
xul school was created by appcoast (formerly glaxstar), one of the few companies dedicated to building high-quality firefox extensions.
...even this project, called xul school, covers several other technologies such as javascript, css, xbl and xpcom.
... next » this tutorial was kindly donated to mozilla by appcoast.
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
you also have the components value and value-data pair; this is for xpcom components.
...however, for netscape 6.1 and netscape 6.2, xpt files, as well as xpcom 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 xpcom components.
BlackConnect - Archive of obsolete content
blackconnect was a blackwood subproject, trying to build a java-to-xpcom bridge to allow interoperability between java and xpcom components.
... the goal was to be able to implement xpcom components written in java instead of c++.
... blackconnect is now superseeded by javaxpcom.
Drag and Drop JavaScript Wrapper - Archive of obsolete content
the javascript drag and drop wrapper the javascript wrapper to drag and drop simplifies the process by handling all of the xpcom interfaces for you.
...they handle the event, handle the xpcom interfaces and pass a simpler data structure to functions of the observer object.
...in some cases, you must provide the xpcom interface as well.
Embedding FAQ - Archive of obsolete content
here is the code : import org.eclipse.swt.swt; import org.eclipse.swt.browser.mozillabrowser; import org.eclipse.swt.browser.progressevent; import org.eclipse.swt.browser.progresslistener; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.shell; import org.mozilla.xpcom.nsidomdocument; public class test { public static void main(string args[]) { display display = new display(); shell shell = new shell(display); final mozillabrowser browser = new mozillabrowser(shell,wt.border); browser.seturl("http://www.google.com"); browser.addprogresslistener(new progresslistener() { ...
... = browser.getdocument(); system.out.println(doc); } }); while (!shell.isdisposed()) { if (!display.readanddispatch()) { display.sleep(); } } } how to map a javascript function to a c++ function define an xpcom class defining the function you'll be doing in javascript.
... then pass the object to your xpcom coded object and call it from c++.
Java in Firefox Extensions - Archive of obsolete content
if you wish to call java code from within javascript code that implements some xpcom 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 xpcom component rather than from xul is to maintain a singleton (some singular java object) across all firefox windows.
...the following approach is taken from the extension xquseme (note you must use the latest version, currently still in the sandbox, as prior versions only worked with liveconnect before java 6 update 11) which borrows some of the code of the java firefox extension in order to grant full privileges to java within a firefox extension, but it is easier to understand and doesn't require creation of a xpcom component.
Table Layout Regression Tests - Archive of obsolete content
avoid the nasty assertions to pop up by set xpcom_debug_break=warn, the world would be a much better place if we could first fix those assertions.
...ty data="0 1 1.000000" /> <table data="0 0 4 -1 1 " /> <tableborder data="1 null null 0 2 " /> <content data="0 0 0 null " /> <quotes data="0 " /> <ui data="3 0 0 1 " /> <uireset data="7 0 4" /> <xul data="0 0 0 0 0 1 <svg data="0 1.000000 1.000000 0 1.000000" /> </stylecontext> the baseline log will look like: type manifest file: e:\moz_src\mozilla\obj-i586-pc-msvc\dist\bin\components\xpti.dat +++ javascript debugging hooks installed.
...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.
Elements - Archive of obsolete content
getter <!element getter pcdata> <!attlist getter id id #implied > the getter element contains script that gets executed when a specific property gets called.
... setter <!element setter pcdata> <!attlist setter id id #implied > the setter element contains script that gets executed when a specific property is being set.
... handler <!entity % handler-content "pcdata"> <!element handler %handler-content;> <!attlist handler id id #implied event nmref #required action cdata #implied phase (capturing|bubbling|target) #implied button (1|2|3) #implied modifiers...
Styling a Tree - Archive of obsolete content
(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 xpcom object that implements nsisupportsarray.
... it is really just an xpcom version of an array.
...we create them using the xpcom interface nsiatomservice and add them to the array using the appendelement() function.
Building XULRunner - Archive of obsolete content
by default, xulrunner is built with javaxpcom support; the build system must be able to find an appropriate jdk on the system; see the instructions on building javaxpcom for more details.
... if you do not want to build javaxpcom support, specify --disable-javaxpcom in your configuration.
... 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 javaxpcom: #ac_add_options --disable-javaxpcom 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.
Getting started with XULRunner - Archive of obsolete content
since we are not creating any binary xpcom components, we only need to download and install the xulrunner runtime package, not the sdk.
...ytime you want to install a new version: firefox_version=`grep -po "\d{2}\.\d+" /usr/lib/firefox/platform.ini` arch=`uname -p` xurl=https://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/$firefox_version/runtimes/xulrunner-$firefox_version.en-us.linux-$arch.tar.bz2 cd /opt sudo sh -c "wget -o- $xurl | tar -xj" sudo ln -s /opt/xulrunner/xulrunner /usr/bin/xulrunner sudo ln -s /opt/xulrunner/xpcshell /usr/bin/xpcshell you could also save this script to a file for convenience.
... note: in xulrunner 2.0, the chrome.manifest is now used to register xpcom components in addition to its previous uses.
JS-Engine FAQ - Archive of obsolete content
domparser is not part of js but part of mozilla browser which makes it available to script in the browser using xpconnect.
... to write wrappers in pure javascript to interface with any c library on the system there are mechanisms such as xpcshell, 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.
...see xpcnativewrapper.
XUL Parser in Python - Archive of obsolete content
but mozilla's upcoming 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 xpcom objects.
... extending on the approach in this script, then, you could imagine a kind of introspective xul chrome that could modify and replicate itself by calling services from the xulparser and xulwriter xpcom objects.
Adding a new event
make new event class ipc 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 nsguieventipc.h.
... create xpcom interface for the dom event if your event class should be accessible via xpcom interface, you should create a new nsidomfooevent interface in dom/interfaces/events/.
Application cache implementation overview
loading a top level document from offline cache this happens in nshttpchannel::opencacheentry().
...nshttpchannel::onofflinecacheentryavailable is then invoked.
...until steps described further the document doesn't know anything about its appcache.
Creating a Login Manager storage module
see how_to_build_an_xpcom_component_in_javascript for more details about javascript components.
... const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.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: xpcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the built-in nsiloginmanagerstorage _xpcom_categories: [ { category: "login-manager-storage", entry: "nsiloginmanagerstorage" } ], // console logging service, used for debugging.
...ments); }, setloginsavingenabled: function slms_setloginsavingenabled(hostname, enabled) { this.stub(arguments); }, findlogins: function slms_findlogins(count, hostname, formsubmiturl, httprealm) { this.stub(arguments); }, countlogins: function slms_countlogins(ahostname, aformsubmiturl, ahttprealm) { this.stub(arguments); } }; function nsgetmodule(compmgr, filespec) xpcomutils.generatemodule([sampleloginmanagerstorage]); sample c++ implementation bug 309807 contains a complete example.
Creating reftest-based unit tests
running ipc reftests reftests can also be run in a separate process, which can differ from same-process rendering in significant ways.
... currently, ipc reftests are only being run on linux.
... to run: moz_layers_force_shmem_surfaces=1 make -c $(objdir) reftest-ipc note: right now, automation currently only runs layout/reftests/reftest-sanity/reftest.list!
IPDL Best Practices
using ipdl generated structs as data structures outside of ipc serialization/deserialization ipdl generated structures are meant to facilitate serialization/deserialization and message passing.
... use a flag and the generated actordestroy function to control when ipdl functions can be called; see phttpchannelparent/child for an example.
...minimize overall use of messages reducing ipc traffic is a righteous goal.
SourceMap.jsm
get a reference to the module: let sourcemap = {}; components.utils.import('resource:///modules/devtools/sourcemap.jsm', sourcemap); sourcemapconsumer a sourcemapconsumer instance represents a parsed source map which we can query for information about the original file positions by giving it a file position in the generated source.
... new sourcemapconsumer(rawsourcemap) the only parameter is the raw source map (either as a string which can be json.parse'd, or an object).
... sourcemapconsumer.prototype.originalpositionfor(generatedposition) returns the original source, line, and column information for the generated source's line and column positions provided.
HTTP delegation
look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http.
...look at sec_httpclientfcn, which is a (versioned) table of function pointers.
...finally register your http client implementation with a call to sec_registerdefaulthttpclient.
HTTP delegation
look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http.
...look at sec_httpclientfcn, which is a (versioned) table of function pointers.
...finally register your http client implementation with a call to sec_registerdefaulthttpclient.
NSS 3.12.4 release notes
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_regexpcasesearch these functions will match a string with a shell expression.
...port bug 431958: improve des and sha512 for x86_64 platform bug 433791: win16 support should be deleted from nss bug 449332: secu_parsecommandline does not validate its inputs bug 453735: when using cert9 (sqlite3) db, set or change master password fails bug 463544: warning: passing enum* for an int* argument in pkix_validate.c bug 469588: coverity errors reported for softoken bug 470055: pkix_httpcertstore_findsocketconnection reuses closed socket bug 470070: multiple object leaks reported by tinderbox bug 470479: io timeout during cert fetching makes libpkix abort validation.
...e optimized builds for mozilla on macosx bug 498511: produce debuggable optimized nss builds for mozilla on linux bug 499385: drbg reseed function needs to be tested on post bug 499825: utilrename.h is missing from solaris packages bug 502961: allocator mismatch in pk11mode bug 502965: allocator mismatch in sdrtest bug 502972: another allocator mismatch in sdrtest bug 504398: pkix_pl_aiamgr_gethttpcerts could crash if sec_getregisteredhttpclient fails bug 504405: pkix_pl_crldp_create will fail on alloc success because of a missing !
NSS tools : certutil
--extpc add the policy constraints extension to the certificate.
... $ 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] [ --extpc] [--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.
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkfpcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
certutil
--extpc add the policy constraints extension to the certificate.
... $ 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] [--extpc] [--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.
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkfpcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
Rebranding SpiderMonkey (1.8.5)
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.
...search for this text: mozjs185.pc "scroll down" a few lines until you see this line: > $@ && chmod 644 $@ that line should be modified to read back: > $brand.pc && chmod 644 $brand.pc "scroll down" a few lines until you see these lines: install:: $(pkg_config_files) @echo pkg_config_file: $(pkg_config_files) those two lines should be modified to read back: install:: $brand.pc @echo pkg_config_file: $brand.pc note: while it is possible to automate the manual editing process, this has been discouraged due to the fact that these files are automatically generated and very little constant data can be depended upon.
...a pkgconfig file has also been installed for your library at libdir/pkgconfig/$brand.pc.
Manipulating bookmarks using Places
note that this example takes advantage of xpcomutils to generate the nsisupports.queryinterface() method.
...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: xpcomutils.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...
...n() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using xpcom without chrome - bookmark observer ...
FUEL
fuel is about making it easier for extension developers to be productive, by minimizing some of the xpcom formality and adding some "modern" javascript ideas.
... objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage fueliapplication objects fueliannotations fueliapplication fuelibookmark fuelibookmarkfolder fuelibookmarkroots fuelibrowsertab fueliwindow xpcom although the fuel application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
... the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplication); ...
SMILE
smile is about making it easier for extension developers to be productive, by minimizing some of the xpcom formality and adding some "modern" javascript ideas.
... objects extiapplication objects exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage smileiapplication objects smileibookmarkroots smileiwindow smileibrowsertab smileiapplication xpcom although the extiapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
... the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/smile/application;1"].getservice(components.interfaces.smileiapplication); ...
STEEL
consider using the functions found in appconstants.jsm or services.jsm instead steel is the scriptable thunderbird easy extension library.
... objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage steeliapplication objects steeliapplication xpcom although the steel steeliapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
... the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/steel/application;1"].getservice(components.interfaces.steeliapplication); other resources steel development plan.
extIApplication
implemented via xpcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
... xpcom although the application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
... the object needs to be accessed like any other xpcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplication); see also fuel (firefox), steel (thunderbird) and smile (seamonkey) ...
Binary compatibility
when you see a @status frozen, note that this means it should work as long as the component and xpcom are built with the same compiler abi.
... for more information on issues of componentization and binary compatibility, see http://mozilla.org/projects/xpcom/gl...ent_reuse.html .
... comments and questions should be directed to the newsgroup, mozilla.dev.tech.xpcom, or the mailing list, mozilla-xpcom@mozilla.org.
Generic factory
in xpcom, a generic factory is a factory created using the facilities in xpcom/glue/nsigenericfactory.h.
... summary most xpcom factories can be very simple.
...factory* newcomponentfactory(nsirepository* repository) { nsigenericfactory* factory = null; nscid kgenericfactorycid = ns_genericfactory_cid; nsresult res = repository->createinstance(kgenericfactorycid, null, nsigenericfactory::iid(), &factory); if (res == ns_ok) { factory->setconstructor(&mycomponent::create); } return factory; } this example assumes that the xpcom repository is available as an interface (which it soon will be).
Components.classes
each object represents one of the classes of xpcom components that can be constructed or accessed as an xpcom service.
... a new xpcom component instance can be created from the returned class object as follows: var obj = components.classes["@mozilla.org/supports-array;1"] .createinstance(components.interfaces.nsisupportsarray); which is a shortcut to var obj = components.classes["@mozilla.org/supports-array;1"] .createinstance(); obj.queryinterface(components.interfaces.nsisupportsa...
...rray); if you don't provide a specific interface to createinstance(), it will return an xpconnect wrapper for the component, which only exposes the methods of the nsisupports interface (and under certain circumstances the special wrappedjsobject property).
Components.interfaces
each object represents one of the xpcom 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 xpconnect is capable of reflecting into javascript.
... properties of the components.interfaces object are used where xpcom methods expect a parameter of type nsid.
Community
if you know of useful mailing lists, newsgroups, forums, or other communities related to pyxpcom, please link to them here.
... activestate python xpcom bindings mailing list discussion of the bindings between the python language and the xpcom (cross-platform com) technology from the mozilla project.
... #pyxpcom on irc.mozilla.org chat with other pyxpcom developers on mozilla's irc network.
nsDirectoryService
« xpcom api reference summary the xpcom directory service.
... 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 xpcom service manager.
... example code #include "nsxpcom.h" #include "nscomptr.h" #include "nsdirectoryservicedefs.h" #include "nsiservicemanager.h" #include "nsiproperties.h" /** * get the location of the system's "temp" directory.
NS_Alloc
« xpcom api reference summary infallibly allocates a block of memory using the xpcom memory manager.
... #include "nsxpcom.h" void* ns_alloc( prsize asize ); parameters asize [in] the size in bytes of the block to allocate.
...remarks this function provides a convenient way to access the xpcom memory manager.
NS_Free
« xpcom api reference summary frees a block of memory using the xpcom memory manager.
... #include "nsxpcom.h" void ns_free( void* aptr ); parameters aptr [in] a pointer to the block of memory to free.
... remarks this function provides a convenient way to access the xpcom memory manager.
NS_GetComponentManager
« xpcom api reference summary the ns_getcomponentmanager function returns a reference to the xpcom component manager.
... #include "nsxpcom.h" #include "nsicomponentmanager.h" nsresult ns_getcomponentmanager( nsicomponentmanager** aresult ); parameters aresult [out] a reference to the xpcom component manager.
... remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called.
NS_GetComponentRegistrar
« xpcom api reference summary the ns_getcomponentregistrar function returns a reference to the xpcom component registrar.
... #include "nsxpcom.h" #include "nsicomponentregistrar.h" nsresult ns_getcomponentregistrar( nsicomponentmanager** aresult ); parameters aresult [out] a reference to the xpcom component registrar.
...remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called.
NS_GetServiceManager
« xpcom api reference summary the ns_getservicemanager function returns a reference to the xpcom service manager.
... #include "nsxpcom.h" #include "nsiservicemanager.h" nsresult ns_getservicemanager( nsiservicemanager** aresult ); parameters aresult [out] a reference to the xpcom service manager.
... remarks the object returned is a singleton that is valid until ns_shutdownxpcom is called.
nsCOMPtr
« xpcom api reference summary this utility class simplifies managing xpcom interface references from c++ code.
...to use this class, you must link your component or application against the xpcom glue library.
... the class itself and the supporting functions that are used with it are not frozen, but they are available as part of the xpcom glue library for easy reuse.
nsIClassInfo
xpcom/components/nsiclassinfo.idlscriptable provides information about a specific implementation class.
...violates the xpcom 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.
... for example, if asked for the helper for nsiprogramminglanguage::javascript this might return an object that can be nsisupports.queryinterface()'d into the nsixpcscriptable interface to assist xpconnect in supplying javascript specific behavior to callers of the instance object.
nsIContentSecurityPolicy
content/base/public/nsicontentsecuritypolicy.idlscriptable describes an xpcom component used to model and enforce content security policies.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean permitsancestry(in nsidocshell docshell); void refinepolicy(in astring policystring, in nsiuri selfuri); void scanrequestdata(in nsihttpchannel achannel); void sendreports(in astring blockeduri, in astring violateddirective); short shouldload(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra); attributes attribute type ...
...void scanrequestdata( in nsihttpchannel achannel ); parameters achannel sendreports() manually triggers violation report sending given a uri and reason.
nsIDNSService
if not null, this parameter specifies the nsieventtarget of the thread on which the listener's onlookupcomplete should be called.
... if this parameter is null, then onlookupcomplete will be called on an unspecified thread (possibly recursively).
...example let dnsservice = components.classes["@mozilla.org/network/dns-service;1"] .createinstance(components.interfaces.nsidnsservice); let thread = components.classes["@mozilla.org/thread-manager;1"] .getservice(components.interfaces.nsithreadmanager).currentthread; let host = "www.mozilla.org"; let listener = { onlookupcomplete: function(request, record, status) { if (!components.issuccesscode(status)) { // handle error here return; } let address = record.getnextaddrasstring(); console.log(host + " = " + address); } }; dnsservice.asyncresolve(host, 0, listener, thread); ...
nsIDOMOfflineResourceList
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 swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
... swapcache() swaps in the newest version of the application cache.
... void swapcache(); parameters none.
nsIDOMParser
to create a domparser when the constructor is not available (e.g., from a js xpcom component, a js module, or an xpcshell 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.
...if the caller has universalxpconnect privileges, it can pass parameters to new domparser().
...examples within the context of a window: var parser = new domparser(); var doc = parser.parsefromstring(astr, "application/xml"); outside of a window (e.g., a js xpcom component, a js module, or an xpcshell test): var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); var doc = parser.parsefromstring(astr, "application/xml"); using components.constructor(): const domparser = new components.constructor("@mozilla.org/xmlextras/domparser;1", "nsidomparser"); var parser = new dompar...
nsIDebug
xpcom/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/xpcom;1 contract should use ns_debugbreak() from xpcom 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.
... assertion() shows an assertion and triggers optional behavior based on the xpcom_debug_break environment variable, defaulting to calling break() on windows and os/2 and warning on other platforms.
nsIEditorMailSupport
omnode insertascitedquotation(in astring aquotedtext, in astring acitation, in boolean ainserthtml); nsidomnode insertasquotation(in astring aquotedtext); void inserttextwithquotations(in domstring astringtoinsert); void pasteascitedquotation(in astring acitation, in long aselectiontype); void pasteasquotation(in long aselectiontype); void rewrap(in boolean arespectnewlines); void stripcites(); methods getembeddedobjects() get a list of img and object tags in the current document.
... stripcites() strip any citations in the selected part of the document.
... void stripcites(); parameters none.
nsIFTPEventSink
netwerk/protocol/ftp/nsiftpchannel.idlscriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onftpcontrollog(in boolean server, in string msg) methods onftpcontrollog allows a consumer to receive a log of the ftp control connection conversation.
... void onftpcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client.
nsIHttpHeaderVisitor
inherits from: nsisupports last changed in gecko 1.7 method overview void visitheader(in acstring aheader, in acstring avalue); methods visitheader() called by the nsihttpchannel implementation when visiting request and response headers.
...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.nsihttpchannel = components.interfaces.nsihttpchannel; this.nsichannel = components.interfaces.nsichannel; this.nsirequest = components.interfaces.nsirequest; }; myhttprequestobserver.prototype.observe = function ( subject, topic, data ) { var uri, avisitor; if ( subject instanceof this.nsihttpchannel ) { 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 nsihttpchannel ...
nsIJSID
js/src/xpconnect/idl/xpcjsid.idlscriptable this interface provides information about a contract or interface.
...method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
... violates the xpcom interface guidelines getid() const nsid* getid(); parameters none.
nsILocalFileMac
xpcom/io/nsilocalfilemac.idlscriptable please add a summary to this article.
... void inittoappwithcreatorcode(in ostype aappcreator); native code only!
...void inittoappwithcreatorcode( in ostype aappcreator ); parameters aappcreator the signature of the app.
nsIModule
xpcom/components/nsimodule.idlscriptable this interface must be implemented by each xpcom component.
... it is the main entry point by which the system accesses an xpcom component.
... [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 module can be unloaded by xpcom.
nsIParserUtils
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 wrapcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value description sanitizerallowcomments (1 << 0) flag for sanitizer: allow comment nodes.
... astring converttoplaintext( in astring src, in unsigned long flags, in unsigned long wrapcol ); 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.
... wrapcol number of characters per line; 0 for no auto-wrapping.
nsIPropertyBag
xpcom/ds/nsipropertybag.idlscriptable this interface is used to store a set of properties.
...goodies obtained from window.navigator are: appcodename:"mozilla" appname:"netscape" appversion:"5.0 (windows)" battery:batterymanager buildid:"20140529161749" cookieenabled:true donottrack:"yes" geolocation:geolocation language:"en-us" mimetypes:mimetypearray mozalarms:null mozapps:xpcwrappednative_nohelper mozcameras:cameramanager mozconnection:mozconnection mozcontacts:contactmanager mozid:null mozkeyboard:xpcwrappednative_nohelper mozpay:nu...
...to do this use nsipropertybag: services.sysinfo.getproperty("version"); //output 5.1 services.sysinfo.getproperty("name"); //output windows_nt services.sysinfo.getproperty("arch"); //output x86 services.sysinfo.getproperty("haswindowstouchinterface"); //outputs false or true if windows touch is there consult the uxp repo (//github.com/realityripple/uxp/blob/master/xpcom/base/nssysteminfo.cpp) for the properties supported.
nsISupports
xpcom/base/nsisupports.idlscriptable all xpcom interfaces inherit this interface.
... last changed in gecko 1.0 method overview nsrefcnt addref();violates the xpcom interface guidelines void queryinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); nsrefcnt release();violates the xpcom interface guidelines methods violates the xpcom interface guidelines addref() notifies the object that an interface pointer has been duplicated.
... violates the xpcom interface guidelines release() notifies the object that an interface pointer has been destroyed and any resources the object held on behalf of the client can be released.
nsITaskbarTabPreview
method overview void ensureregistration(); violates the xpcom interface guidelines nativewindow gethwnd(); violates the xpcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview.
... methods violates the xpcom interface guidelines ensureregistration() used internally to ensure that the taskbar knows about this preview.
... violates the xpcom interface guidelines gethwnd() used internally to obtain the handle to the proxy window for the preview.
nsIUTF8ConverterService
inherits from: nsisupports last changed in gecko 1.7 method overview autf8string convertstringtoutf8(in acstring astring, in string acharset, in boolean askipcheck); autf8string converturispectoutf8(in acstring aspec, in string acharset); methods convertstringtoutf8() ensure that astring is encoded in utf-8.
...autf8string convertstringtoutf8( in acstring astring, in string acharset, in boolean askipcheck, in boolean aallowsubstitution ); parameters astring a string to ensure its utf8ness.
... askipcheck determines whether or not to skip 'asciiness' and 'utf8ness' check.
nsIVersionComparator
xpcom/base/nsiversioncomparator.idlscriptable this interface is used to compare version strings.
...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/xpcom/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/xpcom/version-comparator;1"] .getservice(components.interfaces.nsiversioncomparator); method overview long compare(in acstring a, in acstring b); methods compare() compare two version strings.
nsIAbCard/Thunderbird3
properties currently supported on the card: names: firstname, lastname phoneticfirstname, phoneticlastname displayname, nickname spousename, familyname primaryemail, secondemail home contact: homeaddress, homeaddress2, homecity, homestate, homezipcode, homecountry homephone, homephonetype work contact.
... these functions are marked <code>[noscript] since xpcconnect performs automatic type conversion on nsivariant such that they are not needed for scripts, only for c++ callers.
... the non-variant functions are marked [noscript] since xpconnect uses magic with nsivariant such that the other functions are not needed, although c++ does need them.
Frequently Asked Questions
comparing an nscomptr to a raw xpcom interface pointer declaring an nscomptr to a forward-declared class not linking to xpcom 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...
... call a getter that uses a raw xpcom interface pointer as an `in/out' parameter?
... any xpcom function that returns an interface pointer, i.e., a `getter', must have already addrefed that pointer.
Weak reference
in xpcom, a weak reference is a special object that contains a pointer to an xpcom object, but doesnot keep that object alive.
... in javascript, just make sure that your queryinterface method returns your object for the nsisupportsweakreference interface, and you're set; xpconnect does all the work for you.
... see also the source xpcom/base/nsiweakreference.idl xpcom/glue/nsweakreference.h xpcom/glue/nsweakreference.cpp xpcom ownership guidelines using nscomptr original document information author: scott collins last updated date: september 23, 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license ...
Mozilla technologies
the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/xpcom 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.xpcomxpcom is a cross platform component object model, similar to microsoft com.
... it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++.xpidlxpidl is an interface description language used to specify xpcom interface classes.xray visiongecko runs javascript from a variety of different sources and at a variety of different privilege levels.xslt 2.0although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascript) to perform xslt 2.0.xtfthe extensible tag framework (xtf) allows adding support for new namespaces using xpcom components to mozilla (written in javascript or c++).
MailNews fakeserver
using fakeserver in xpcshell 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 server provides the following api to xpcshell tests: <caption> nsmailserver xpcshell api </caption> name arguments returns description performtest none nothing runs until the test is forcibly aborted or stopped normally isstopped none if the server is stopped helper for performtest istestfinished none if the test is finished helper for performtest playtransaction none the transaction the transaction is an object with two prop...
...for xpcshell tests in mailnews/news, all files in mailnews/news/test/postings/auto-add are automatically added based on the newsgroups header.
RTCDtlsTransport - Web APIs
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.
... let pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ...
... */ function tallysenders(pc) { let results = { transportmissing: 0, connectionpending: 0, connected: 0, closed: 0, failed: 0, unknown: 0 }; let senderlist = pc.getsenders(); senderlist.foreach(sender => { let transport = sender.transport; if (!transport) { results.transportmissing++; } else { switch(transport.state) { case "new": case "connecting": results.connectionpending++; break; case "connected": results.connected++; break; case "closed": results.closed++; break; case "failed": results.failed++; break; default: results.unknown++; break; } } }); return results; } note tha...
RTCIceTransport: selectedcandidatepairchange event - Web APIs
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.
... let icetransport = pc.getsenders[0].transport.icetransport; let localprotoelem = document.getelementbyid("local-protocol"); let remoteprotoelem = document.getelementbyid("remote-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.
... let icetransport = pc.getsenders[0].transport.icetransport; let localprotoelem = document.getelementbyid("local-protocol"); let remoteprotoelem = document.getelementbyid("remote-protocol"); icetransport.onselectedcandidatepairchange = ev => { let pair = icetransport.getselectedcandidatepair(); localprotoelem.innertext = pair.local.protocol.touppercase(); remoteprotoelem.innertext = pair.remote.protocol.touppercase(); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'selectedcandidatepairchange' in that specification.
RTCPeerConnection.addStream() - Web APIs
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 c...
...you can write web compatible code using feature detection instead: // add a track to a stream and the peer connection said stream was added to: stream.addtrack(track); if (pc.addtrack) { pc.addtrack(track, stream); } else { // if you have code listening for negotiationneeded events: settimeout(() => pc.dispatchevent(new event('negotiationneeded'))); } // remove a track from a stream and the peer connection said stream was added to: stream.removetrack(track); if (pc.removetrack) { pc.removetrack(pc.getsenders().find(sender => sender.track == track)); } else {...
... // if you have code listening for negotiationneeded events: settimeout(() => pc.dispatchevent(new event('negotiationneeded'))); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.addstream()' in that specification.
RTCPeerConnection: addstream event - Web APIs
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 addeventlistener() method to set an event listener: pc.addeventlistener("addstream", ev => doaddstream(ev.stream), false); ...
RTCPeerConnection.setLocalDescription() - Web APIs
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.
... pc.addeventlistener("negotiationneeded", async (event) => { await pc.setlocaldescription(); signalremotepeer({ description: pc.localdescription }); }); other than error handling, that's about 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().
RTCRtpReceiver.getCapabilities() static function - Web APIs
the static function rtcrtpreceiver.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by rtcrtpreceivers on the current device.
... syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive.
... return value an rtcrtpcapabilities object stating what capabilities the browser has for receiving the specified media kind over an rtcpeerconnection.
RTCRtpReceiver.getContributingSources() - Web APIs
the getcontributingsources() method of the rtcrtpreceiver interface returns an array of rtcrtpcontributingsource instances, each corresponding to one csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds.
... syntax var rtcrtpcontributingsources = rtcrtpreceiver.getcontributingsources() parameters none.
... return value an array of rtcrtpcontributingsource instances.
RTCRtpReceiver.getSynchronizationSources() - Web APIs
the getsynchronizationsources() method of the rtcrtpreceiver interface returns an array of rtcrtpcontributingsource instances, each corresponding to one ssrc (synchronization source) identifier received by the current rtcrtpreceiver in the last ten seconds.
... syntax var rtcrtpcontributingsources = rtcrtpreceiver.getcontributingsources() parameters none.
... as you'll see in the documentarion for rtcrtpsynchronizationsource, it inherits the properties of rtcrtpcontributingsource, including timestamp, source, and audiolevel.
RTCRtpSender.getCapabilities() static function - Web APIs
the static function rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the codecs and capabilities supported by the rtcrtpsender.
... syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive.
... return value an rtcrtpcapabilities object stating what capabilities the browser has for sending the specified media kind over an rtcpeerconnection.
SubtleCrypto.importKey() - Web APIs
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": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqygpcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; examples note: you can try the working examples on github.
...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/tolwr4cg8khdlburcby6gpclo3dpu09sw+6ctx2cx4mkxx6o/0mmdtmacr/vu50kdrmlefezyowpaehhmfywybtuzbipvizvp8wfcsknmbfi1s9a9pdbqnebwwhhx3/hsebt2bagmbaaecggeabei1p6nf6zs7mjlybdv+pfl5rjl2coqly6tovvzvblmkcppjyfunipdk2tk2i897zaxfhpdbikmllm2hq6jzqkb110oantpdg0jxzmiihps32s1d/kilhjgff4hjd4nxp1l1dp8bupollorr2tym2x6dccgfw9lhtr8o03qp4hjn84vjgiwadyck83mgs4nrsnhkdiqynwx1ajkly51yek6rcrdmi0th2rxrrinoc35svv+apt2rkomgi52rwtesea1kzgfrxjq61rejif6p2...
... const jwkeckey = { "crv": "p-384", "d": "wouctu7nw4e8_7n5c1-xbjb4xqsb_lizhymsy8mggxuny6q8ncoh9xsiviwlffk_", "ext": true, "key_ops": ["sign"], "kty": "ec", "x": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqygpcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; /* import a pem encoded rsa private key, to use for rsa-pss signing.
Writing a WebSocket server in Java - Web APIs
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 opcode 1 0 0 0 0x1=0001 fin: you can send your message in frames, but now keep things simple.
... opcode 0x1 means this is a text.
... full list of opcodes - 134: if the second byte minus 128 is between 0 and 125, this is the length of the message.
Using the Web Animations API - Web APIs
let’s take a look 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 cupcake.
... pausing and playing animations we’ll talk more about alice’s animation later, but for now, let’s look closer at the cupcake’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 had the chance to click on it, we call animation.pause() on it immediately after it is defined, like so: nommingcake.pause(); we can now use the animation.play() method to run it whenever we’re ready: nommingcake.play(); specifically, we want to link it to alice’s animation, so she gets bigger as the cupcake gets eaten.
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
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()clearclipclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-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...
...><display-inside><display-internal><display-legacy><display-listitem><display-outside>dpcmdpidppxdrop-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 (@font-face)@font-feature-valuesfont-kerningfont-language-overridefont-optical-sizingfont-sizefont-size-adjustfont-stretchfont-stretch (@font-face)font-stylefont-style (@font-face)font-synthesisfont-variantfont-variant (@font-face)font-variant-alternatesfont-variant-capsfont-variant-east-asianfont-variant-ligatur...
...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+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8...
...a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8ycmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwupc+6cktlxz/sddp2uu9uxlmyxz6qm8v4tz8lhf1h+zdqxt7s8olmxtbf4e8qafhjj3kbp2mzkkthpitjp9vh6ihia+whtasx5brpwuemgdondf/2a4m7ukds1jw662+xkqtkeuoqjktojm2h53yfl15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwagd7fg5tnnyntp8/fzvgwjofmgg7gox0sakkgqgdmgkbi0njgmeimpgdk5+wacewed0ywblhguz4hw5oduekrblt7dtgdegxacsiznx8zpmwh7k4rkpjcuhdxcul6mdsmmbxdlwch2+xozsgbn...
...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,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/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+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8...
...a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8ycmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwupc+6cktlxz/sddp2uu9uxlmyxz6qm8v4tz8lhf1h+zdqxt7s8olmxtbf4e8qafhjj3kbp2mzkkthpitjp9vh6ihia+whtasx5brpwuemgdondf/2a4m7ukds1jw662+xkqtkeuoqjktojm2h53yfl15psj04zc94wdtibr26fxlc2mzrvbccebz2kirfd414tkmlezbvgt33+qcohgha81swysew0r1uzfnylmtpx80pngqq91lwvk2jgvgnfvzg6ycyrat16gftw5kkkfo1eqltfh5q2ett0biwf+aitq4fdbk+imyo1oxvgf03wafjqvbckvdffryetxqiffygazths0zwagd7fg5tnnyntp8/fzvgwjofmgg7gox0sakkgqgdmgkbi0njgmeimpgdk5+wacewed0ywblhguz4hw5oduekrblt7dtgdegxacsiznx8zpmwh7k4rkpjcuhdxcul6mdsmmbxdlwch2+xozsgbn...
...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,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8fpj2icml8z92dlbtmzdeig3fco7j08foh1kurkm3e9iw54yvkwutuom+lpt/bgbwf3//sf37/1/c02ccg1lb8f//f95dzx74mtmzshhosm6szrq/a6ir/z2rkfejbxulyfpdidi6af///...
Closures - JavaScript
one solution in this case is to use more closures: in particular, to use a function factory as described earlier: function showhelp(help) { document.getelementbyid('help').innerhtml = help; } function makehelpcallback(help) { return function() { showhelp(help); }; } function setuphelp() { var helptext = [ {'id': 'email', 'help': 'your e-mail address'}, {'id': 'name', 'help': 'your 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 =...
... makehelpcallback(item.help); } } setuphelp(); run the code using this jsfiddle link.
...rather than the callbacks all sharing a single lexical environment, the makehelpcallback function creates a new lexical environment for each callback, in which help refers to the corresponding string from the helptext array.
Private Properties - Archive of obsolete content
namespaces in the add-on sdk the add-on sdk is built on top of xpcom, the interface between javascript and c++ code.
... since xpcom allows the user to do virtually anything, security is very important.
SDK and XUL Comparison - Archive of obsolete content
xpcom traditional add-ons have access to a vast amount of firefox functionality via xpcom.
...if you need more flexibility than the sdk's high-level apis provide, you can use its low-level apis to load xpcom objects directly or to manipulate the dom directly as in a traditional bootstrapped extension.
clipboard - Archive of obsolete content
var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d"); if the clipboard contains an image, open it in a new tab.
... var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahgpcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d", "text"); globals functions set(data, datatype) replace the contents of the user's clipboard with the provided data.
system/runtime - Archive of obsolete content
xpcomabi a string identifying the abi of the current processor and compiler vtable.
... this string takes the form <processor>-<compilerabi>, for example: "x86-msvc" or "ppc-gcc3".
Creating Reusable Modules - Archive of obsolete content
for both these operations we'll use xpcom interfaces.
... } return path; } hash function firefox has built-in support for hash functions, exposed via the nsicryptohash xpcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path.
Downloading Files - Archive of obsolete content
var privacy = privatebrowsingutils.privacycontextfromwindow(urlsourcewindow); var hardcodedusername = "ericjung"; var hardcodedpassword = "foobar"; persist.progresslistener = { queryinterface: xpcomutils.generateqi(["nsiauthprompt"]), // implements nsiauthprompt prompt: function(dialogtitle, text, passwordrealm, savepassword, defaulttext, result) { result.value = hardcodedpassword; return true; }, promptpassword: function(dialogtitle, text, passwordrealm, savepassword, pwd) { pwd.value = hardcodedpassword; return true; }, promptusernameandpassword: function(dia...
... function getimagefromurl(url) { var ioserv = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var channel = ioserv.newchannel(url, 0, null); var stream = channel.open(); if (channel instanceof components.interfaces.nsihttpchannel && channel.responsestatus != 200) { return ""; } var bstream = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bstream.setinputstream(stream); var size = 0; var file_data = ""; while(size = bstream.available()) { file_data += bstream.readbytes(size); } return file_data; } see als...
File I/O - Archive of obsolete content
you access the file system using mozilla xpcom components.
... look in the source for other strings available: xpcom/io/nsappdirectoryservicedefs.h, xpcom/io/nsdirectoryservicedefs.h.
Forms related code snippets - Archive of obsolete content
mes[this.current.getmonth()] + " " + this.current.getfullyear(); this.container.appendchild(this.otbody); }; function ondocclick (opssevt) { const oevt = opssevt || /* ie */ window.event; var boutside = true; for (var onode = oevt.target || /* ie */ oevt.srcelement; onode; onode = onode.parentnode) { if (onode.classname === sprefs + "-calendar" || onode.classname === sdpclass) { boutside = false; break; } } if (boutside) { return; } ainstances[onode.id.replace(rbgnnan, "")].container.style.zindex = nzindex++; } function onheadclick () { const bismonth = rmonth.test(this.id), ndelta = rdecrease.test(this.id) ?
...{ 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(sdpclass), nlen = afields.length; for (var nitem = 0; nitem < nlen; new datepicker(afields[nitem++])); } const /* customizable by user */ sprefs = "zdp"; sdpclass = "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...
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 appcontent 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 appcontent = document.getelementbyid("appcontent"); // browser if(appcontent){ appcontent.addeventlistener("dom...
...to attach to the unload event in above example you can use the "pagehide" event like this: appcontent.addeventlistener("pagehide", myextension.onpageunload, false); for appcontent and similarly for messagepane messagepane.addeventlistener("pagehide", myextension.onpageunload, false); and add your code to onpageunload method.
Progress Listeners - Archive of obsolete content
example create an object which implements nsiwebprogresslistener: const state_start = ci.nsiwebprogresslistener.state_start; const state_stop = ci.nsiwebprogresslistener.state_stop; var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { // if you use mylistener for more than one tab/window, use // awebprogress.domwindow to obtain the tab/window which triggers the state change if (aflag & state_start) { // th...
... alert(auri.spec); this.oldurl = auri.spec; }, // nsiwebprogresslistener queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onlocationchange: function(aprogress, arequest, auri) { this.processnewurl(auri); }, onstatechange: function() {}, onprogresschange: function() {}, onstatuschange: function() {}, onsecuritychange: function() {} }; window.addeventlistener("load", ...
Enhanced Extension Installation - Archive of obsolete content
finalization for themes, the item is immediately installed fully, rather than awaiting the next restart, since themes do not supply xpcom components, preferences defaults etc.
... the startup process receives this "needsrestart" bit when the extension manager's startup completes, shuts down xpcom and relaunches the application.
Extension Versioning, Update and Compatibility - Archive of obsolete content
--> <em:signature>migtma0gcsqgsib3dqebbquaa4gbamo1o2gwsccth1gwymgscfanakpn40pjfowt ub2hvdg8+oxmcif8d/9evwm8eh/ixuxyzlmrzts3o5tv9eway5ubctqdf1wgtsgk jrgzow1fitkzi7w0//c8ekdmlatguegfns2iltd5p/0kh/hf1rpc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> </rdf:rdf> some people prefer this alternate format (note that much of the information has been trimmed from this example for brevity in order to show the basic structure): <?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2...
...: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/hf1rpc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> <!-- this represents the same description within the li from the previous example --> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org:2.2"> <em:version>2.2</em:version> <!-- trimmed the rest of the contents here --> </rdf:description> <rdf:description about="urn:mozilla:extens...
Extension Etiquette - Archive of obsolete content
xpcom contract ids, which are often registered in chrome.manifest files.
...xpcom 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.
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 xpcom and xul.
... next » introduction to extensions technologies used in developing extensions introduction to xul—how to build a more intuitive ui using xpcom—implementing advanced processes let's build a firefox extension firefox extensions and xul applications license and authors next » ...
Connecting to Remote Content - Archive of obsolete content
we create this instance using xpcom instead of the usual way (new xmlhttprequest()) because this way works both in chrome and non-chrome code.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Custom XUL Elements with XBL - Archive of obsolete content
you can do almost anything from xbl code, including using xpcom components, js code modules and available chrome scripts.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
Mozilla Documentation Roadmap - Archive of obsolete content
and finally, what we mentioned in our xpcom section: almost no documentation on xpcom components.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
The Essentials of an Extension - Archive of obsolete content
<em:name>xul school hello world</em:name> <em:description>welcome to xul school!</em:description> <em:version>0.1</em:version> <em:creator>appcoast</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.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
User Notifications and Alerts - Archive of obsolete content
another advantage is that you use an xpcom service to do this (nsialertsservice), so you can easily trigger alerts from chrome and non-chrome code.
... « previousnext » this tutorial was kindly donated to mozilla by appcoast.
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 xpcom 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...
... school project was developed by appcoast (formerly glaxstar).
Building TransforMiiX standalone - Archive of obsolete content
add tx_exe=1 mk_add_options build_modules="xpcom transformiix" ac_add_options --enable-standalone-modules="xpcom 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 xpcom from the cvs repository.
Drag and Drop - Archive of obsolete content
this first involves using the drag and drop xpcom interfaces directly.
... xpcom drag and drop interfaces two interfaces are used to support drag and drop.
Documentation for BiDi Mozilla - Archive of obsolete content
this is determined in nstextfragment::setto the page includes a element with the attribute dir=rtl, either explicitly (nsgenerichtmlelement::mapcommonattributesinto), or as a consequence of a style rule (mapdeclarationtextinto in nscssstylerule.cpp) all these cases use nsdocument::enablebidi to set the flag mbidienabled.
...improvements to lists with hebrew and arabic list-style-type summary of new classes class name xpcom interface (if applicable) implementation comments nsibidi intl\unicharutil\public\nsibidi.h intl\unicharutil\src\nsbidiimp.cpp implementation of the unicode bidi algorithm nsiubidiutils intl\unicharutil\public\nsiubidiutils.h intl\unicharutil\src\nsbidiutilsimp.cpp utilities for bidi processing, including: character classification symmetric swapping reordering shaping numeric translation ...
HTTP Class Overview - Archive of obsolete content
nshttphandler implements nsiprotocolhandler manages preferences owns the authentication cache holds references to frequently used services nshttpchannel implements nsihttpchannel talks to the cache initiates http transactions processes http response codes intercepts progress notifications nshttpconnection implements nsistreamlistener & nsistreamprovider talks to the socket transport service feeds data to its transaction object routes progress notifications nshttpconnectioninfo identifies a connection nshttptransaction ...
... implements nsirequest encapsulates a http request and response parses incoming data nshttpchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines performs common header manipulations/calculations nshttpheaderarray stores http "<header>:<value>" pairs nshttpauthcache stores authentication credentials for http auth domains nshttpbasicauth implements nsihttpauthenticator generates basic auth credentials from user:pass nshttpdigestauth implements nsihttpauthenticator generates digest auth credentials from user:pass original document information author(s): darin fisher last up...
Mozilla Application Framework - Archive of obsolete content
xpcom 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-rpc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web services.
LIR - Archive of obsolete content
the lir instruction set is best learnt by reading nanojit/liropcode.tbl.
...nd operand is an int 98 rshuq quad 64 bit right shift unsigned quad; 2nd operand is an int 99 negd double negate double 100 addd double add double 101 subd double subtract double 102 muld double multiply double 103 divd double divide double 104 modd double modulo double lir_modd is just a place-holder opcode, ie.
New Skin Notes - Archive of obsolete content
for an example of this, see creating xpcom components.
...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/ppcs), 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...
PyDOM - Archive of obsolete content
globals and namespaces this is taken from a mail to the pyxpcom list - it should be expanded, but a copy-paste will do for now normal module semantics don't exist here.
...related topics pyxpcom: create and use xpcom components with python python-spidermonkey pydom samples: sample applications that use pydom pythonext: a firefox/xulrunner extension that can be used to install pydom ...
Tamarin build documentation - Archive of obsolete content
windows 32 and 64 bit mac osx 10.4, 10.5 on ppc 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.
... the command to build from the terminal is: $ cd tamarin-redux $ xcodebuild archs=ppc -project platform/mac/avmshell/avmshell.xcodeproj for a debug build, add '-configuration debug' (note the capital d and no "=").
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
testing summary acceptance tests have passed on the following supported platforms: * windows, 32 & 64 bit * mac ox x ppc & intel, 32 bit * linux, 32 bit * windows mobile arm version asc-4200 of the actionscript compiler was used for all tests.
... recursive pcre testcases kills the stack on pocketpc builds ...
Mac stub installer - Archive of obsolete content
to do this, in addition to the above steps to set up the mac installer to debug you will need to do the following: create a file named xpcom.xpi with the shared libraries in the structure described under the [xpcom] section in: <http://lxr.mozilla.org/seamonkey/sou...ackages-mac#33> note that if you are using the debug target of the installer binary all shared libraries are expected to have the name format <libname>debug.shlb now set a break point at xpi_init() in the mac installer code and step into xpistub and eventually the xpi...
...for example, see the xpcom section that lists all the shared libraries as seen in dist.
Unix stub installer - Archive of obsolete content
now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/installer/raw.
...for example, see the xpcom section that lists all the shared libraries as seen in dist.
Windows stub installer - Archive of obsolete content
now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/dist/win32_d.obj/install.
...for example, see the xpcom section that lists all the shared libraries as seen in dist.
Accessing Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
... components the components directory where xpcom components are installed.
Template and Tree Listeners - Archive of obsolete content
these each implement a different xpcom interface, as listed below: nsixulbuilderlistener - used to listen to template rebuilds.
...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); // ppchenhui@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.
stringbundle - Archive of obsolete content
ight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties applocale obsolete since gecko 1.9.1 type: nsilocale returns the xpcom object which holds information about the user's locale.
... stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle.
Dialogs in XULRunner - Archive of obsolete content
the xul filepickers are xpcom components and must be instantiated before using, like this: function dofileopen() { /* see: http://developer.mozilla.org/en/docs/xul_tutorial:open_and_save_dialogs */ var nsifilepicker = components.interfaces.nsifilepicker; var fp = components.classes["@mozilla.org/filepicker;1"].createinstance(nsifilepicker); fp.init(window, "open file", nsifilepicker.modeopen); fp.appendfilters(...
... future articles in this series will look at input controls, printing, the clipboard, and xpcom.
XULRunner Hall of Fame - Archive of obsolete content
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.
...python-hulahop is required python-hulahop from the olpc sugarlabs a python gtk widget with xulrunner embedded, providing full access to nsi dom and all other xulrunner interfaces, in a gtk window.
Make your xulrunner app match the system locale - Archive of obsolete content
this article is going to assume a lot of knowledge of xpcom and will be written for someone using python, but the ideas should be adaptable.
... from xpcom import components ps_cls = components.classes["@mozilla.org/preferences-service;1"] ps = ps_cls.getservice(components.interfaces.nsiprefservice) branch = ps.getbranch("general.useragent.") branch.setcharpref("locale", lang) i also set the language environment variable to match the system locale so that python's gettext functionality will work (it pulls straight from language instead of using s...
nsIContentPolicy - Archive of obsolete content
[javascript implementations only] access properties of any sort on any object without using xpcnativewrapper (either explicitly or implicitly).
... char* previous = nsnull; nscomptr<nsicategorymanager> catman; servman->getservicebycontractid(ns_categorymanager_contractid, ns_get_iid(nsicategorymanager), getter_addrefs(catman)); rv = catman->addcategoryentry("content-policy", component_classname, component_contractid, pr_true, pr_true, &previous); javascript developers can also implement an xpcom component that extends nsicontentpolicy.
2006-11-24 - Archive of obsolete content
building xpcom components with msvs 2005 november 21st: buffaloaf is having trouble getting a personal xpcom component to work under xulrunner when compiled with msvs 2005.
..."component returned failure code: 0x80570016 (ns_error_xpc_gs_returned_failure) [nsijscid.getservice]" nsresult: "0x80570016 (ns_error_xpc_gs_returned_failure)" location: "js frame :: chrome://modzilla/content/js/pkg_zillacom.js :: <top_level> :: line 1202" data: no] he is running xulrunner v1.8.0.4.
2006-10-06 - Archive of obsolete content
discussions protocol handlers boris zbarsky posed the question, should random webpages have access to the following protocols: feed, pcast, moz-bookmark, webcal, swebcal.
... pcast: similar to feed: just differentiating between different types of feeds and should be allowed access.
2006-09-22 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - sept 22-29, 2006 announcements none during this week.
...xpcom discussion of the limitation and merits of java in place of xpcom.
2006-09-30 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - sept 30- oct 5, 2006 announcements build a xpcom component on mac os x benjamin smedberg confirmed that this tutorial http://www.iosart.com/firefox/xpcom/ is misleading as it uses the standalone glue (-dxpcom_glue) for components, which is not recommended.
... developers should use this sample instead: http://developer.mozilla.org/en/docs/xpcom_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 xpcom component on mac os x discusses about the make file code used to build xpcom components on mac os x successfully meetings none during this week.
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - nov 18-nov 24, 2006 announcements none during this week.
... discussions tutorials: non c++ bindings for xpcom tutorials on how to interface with firefox using xpcom on a similar basis to how a developer can with internet explorer through it's com interface tutorals and references related to extension development tutorials on developing extensions which use the third party libraries for firefox references to mozilla api exposed javascript component + xmldocument not accessible a discussion on error: uncaught exception: permission denied to get property xmldocument.textcontent creating xpcom components a good discussion about "components.classes[cid] has no properties" error firefox http explanation about how firefox handles the http aspect meetings none during this week.
2006-11-3 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - oct 28-nov 3, 2006 announcements none during this week.
... discussions problem linking libraries to xpcom component a discussion involving a problem with linking third party library to xpcom component.
2006-12-08 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - dec 02- dec 08, 2006 announcements none during this week.
... discussions xpcom cpp to js callback engaging discussion on a problem with trying to call back from c++ to a javascript object using an interface the developer created with an idl.
Logging Multi-Process Plugins - Archive of obsolete content
from within a command prompt: c:\> set nspr_log_modules=ipcplugins:5 c:\> set nspr_log_file=c:\plugins.log c:\> cd c:\program files\mozilla firefox c:\> firefox.exe the log file will be saved to c:\plugins.log (or wherever nspr_log_file is set).
...from within a bash shell: $ export nspr_log_modules=ipcplugins:5 $ export nspr_log_file=~/plugins.log $ /usr/bin/firefox the file will be saved to ~/plugins.log (or wherever nspr_log_file is set).
NPN_CreateObject - Archive of obsolete content
syntax #include <npruntime.h> npobject *npn_createobject(npp npp, npclass *aclass); parameters the function has the following parameters: <tt>npp</tt> the npp indicating which plugin wants to instantiate the object.
... description if the given npclass 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.
NPN_GetValue - Archive of obsolete content
values for npnvariable: npnvxdisplay =1: unix only: returns the current display npnvxtappcontext: unix only: returns the application's xtappcontext npnvnetscapewindow: ms windows and unix/x11 only: ms windows: gets the native window on which plug-in drawing occurs; returns hwnd unix/x11: gets the browser toplevel window in which the plug-in is displayed; returns window npnvjavascriptenabledbool: tells whether javascript is enabled; true=javascript enabled,...
...unix the platform-specific values for this parameter are npnvxdisplay (the current display), npnvxtappcontext (the browser's xtappcontext), and npnvnetscapewindow (the browser toplevel window in which the plugin is displayed).
NPAPI plugin reference - Archive of obsolete content
npclass npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e.
... npobject npobject is a structure that holds a pointer to an npclass and an integer reference count, and possibly also implementation specific (i.e.
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 bordertopcolor 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: 'bordertopcolor', '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
xpcom knowledge will certainly not hurt.
...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 xpcom interfaces we are exposing for your use.
XQuery - Archive of obsolete content
however, use of the approach of the java firefox extension might be used to turn the above extension concept into an xpcom 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 xpcom, while still giving full privileges.
Archive of obsolete content
newsgroup summaries obsolete: xpcom-based scripting for npapi plugins plugins that used to take advantage of being scriptable via liveconnect in 4.x netscape browsers lost this possibility in the new world.
...the new mozilla xpcom architecture allows xpcom components be scriptable via a different mechanism called xpconnect.
Gecko FAQ - Gecko Redirect 1
gecko is reusable on all platforms thanks to xpcom, a subset of com that works across platforms.
... additionally, on the windows platform, gecko's xpcom 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).
UI pseudo-classes - Learn web development
<form> <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-labe...
...l">name: </label> <input id="name" name="name" type="text" disabled required> </div> <div> <label for="address2" class="billing-label disabled-label">address: </label> <input id="address2" name="address2" type="text" disabled required> </div> <div> <label for="pcode2" class="billing-label disabled-label">zip/postal code: </label> <input id="pcode2" name="pcode2" type="text" disabled required> </div> </fieldset> <div><button>submit</button></div> </form> now onto the css.
Client-Server Overview - Learn web development
) applewebkit/537.36 (khtml, like gecko) chrome/52.0.2743.116 safari/537.36 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 referer: https://developer.mozilla.org/ accept-encoding: gzip, deflate, sdch, br accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7 accept-language: en-us,en;q=0.8,es;q=0.6 cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; csrftoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _gat=1; _ga=ga1.2.1688886003.1471911953; ffo=true the first and second lines contain most of the information we talked about above: the type of request (get).
...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=zipujsazv6pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _ga=ga1.2.1688886003.1471911953; ffo=true csrfmiddlewaretoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat&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
a windows pc, with the browsers installed that you need to test — this can include edge (or ie), chrome, firefox, and opera.
... 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.
CSUN Firefox Materials
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.
Creating JavaScript callbacks in components
callback patterns in idl xpcom components use idl to create interfaces.
...the function attribute tells the xpconnect machinery to treat the javascript function as if it was an implementation of the callback interface.
How Mozilla's build system works
non-component shared libraries include libraries such as libxpcom and libmozjs.
... 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 xpcom is not appropriate or not possible.
Browser API
mozbrowserasyncscroll sent when the browser <iframe> content scrolls (the apcz version.) see also mozbrowserscroll.
...apcz) starts or stops.
Embedding Tips
a service is a singleton object implementing one or more xpcom interfaces and registered with gecko during startup.
...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 fornsihttpchanne and call methods on that to determine response codes and other information from the server.
Roll your own browser: An embedding how-to
somewhere during the start of your application, you must initialize xpcom.
...the apath parameter will be passed to ns_initxpcom.
HTTP Cache
there is no ipc support.
...return an nsicachestorage object: memory-only (memorycachestorage): stores data only in a memory cache, data in this storage are never put to disk disk (diskcachestorage): stores data on disk, but for existing entries also looks into the memory-only storage; when instructed via a special argument also primarily looks into application caches application cache (appcachestorage): when a consumer has a specific nsiapplicationcache (i.e.
PBackground
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.
...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.
Add-on Manager
the getstartupchanges() 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.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "navigator:browser" type.
Sqlite.jsm
sqlite.jsm offers some compelling advantages over the low-level storage xpcom interfaces: automatic statement management.
...the complexities of xpcom are mostly hidden from view.
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) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: 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) popcontentaction: 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
ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an xpcom component.
... xpcomutils.jsm contains utilities for javascript components loaded by the js component loader.
DMD
for example: reported at { #01: mozilla::dmd::report(void const*) (/home/njn/moz/mi2/memory/replace/dmd/dmd.cpp:1740) 0x7f68652581ca #02: cyclecollectormallocsizeof(void const*) (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:3008) 0x7f6860fdfe02 #03: nspurplebuffer::sizeofexcludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi2/xpcom/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/xpcom/base/nscyc...
...lecollector.cpp:3029) 0x7f6860fdb6b1 #05: cyclecollectormultireporter::collectreports(nsimemorymultireportercallback*, nsisupports*) (/home/njn/moz/mi2/xpcom/base/nscyclecollector.cpp:3075) 0x7f6860fde432 #06: nsmemoryinfodumper::dumpmemoryreportstofileimpl(nsastring_internal const&) (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:626) 0x7f6860fece79 #07: nsmemoryinfodumper::dumpmemoryreportstofile(nsastring_internal const&, bool, bool) (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:344) 0x7f6860febaf9 #08: mozilla::(anonymous namespace)::dumpmemoryreportsrunnable::run() (/home/njn/moz/mi2/xpcom/base/nsmemoryinfodumper.cpp:58) 0x7f6860fefe03 } you can tell which memory reporter made the report by the name of the mallocsizeof function near the top of the stack trace.
about:memory
3.84%) ++ js-non-window ├───33.73 mb (17.58%) ── heap-unclassified ├───22.51 mb (11.73%) ++ heap-overhead ├────6.62 mb (03.45%) ++ images ├────5.82 mb (03.03%) ++ workers/workers(chrome) ├────5.36 mb (02.80%) ++ (16 tiny) ├────4.07 mb (02.12%) ++ storage ├────2.74 mb (01.43%) ++ startup-cache └────2.16 mb (01.12%) ++ xpconnect some expertise is required to understand the full details here, but there are various things worth pointing out.
... there are measurements for other content such as images and workers, and for browser subsystems such as the startup cache and xpconnect.
turbostat
invocation turbostat must be invoked as the super-user: sudo turbostat if you get an error saying "turbostat: no /dev/cpu/0/msr", you need to run the following command: sudo modprobe msr the output is as follows: core cpu avg_mhz %busy bzy_mhz tsc_mhz smi cpu%c1 cpu%c3 cpu%c6 cpu%c7 coretmp pkgtmp pkg%pc2 pkg%pc3 pkg%pc6 pkg%pc7 pkgwatt corwatt gfxwatt - - 799 21.63 3694 3398 0 12.02 3.16 1.71 61.48 49 49 0.00 0.00 0.00 0.00 22.68 15.13 1.13 0 0 821 22.44 3657 3398 0 9.92 2.43 2.25 62.96 39 49 0.00 0.00 0.00 0.00 22.68 15.13 1.13 0 4 708 1...
... if you run with the -s option you get a smaller range of measurements that fit on a single line, like the following: avg_mhz %busy bzy_mhz tsc_mhz smi cpu%c1 cpu%c3 cpu%c6 cpu%c7 coretmp pkgtmp pkg%pc2 pkg%pc3 pkg%pc6 pkg%pc7 pkgwatt corwatt gfxwatt 3614 97.83 3694 3399 0 2.17 0.00 0.00 0.00 77 77 0.00 0.00 0.00 0.00 67.50 57.77 0.46 ...
AsyncTestUtils extended framework
xpcomhdrarray [getter] return an nsimutablearray of the message headers that have been injected into folders.
... folderswithxpcomhdrarrays [getter] same as folderswithmsghdrs but the second element in each sub-list is an nsimutablearray instead of a js list.
Leak And Bloat Tests
method current method: measure leaks and bloats, in a similar way to firefox (using xpcom_mem_leak_log and --trace-malloc).
...loat/bloatcomposeoverlay.xul bloat/bloatmainoverlay.xul javascript files (used to drive the tests): bloat/bloataddroverlay.js bloat/bloatcomposeoverlay.js bloat/bloatmainoverlay.js preference settings (used to provide a defined profile, see below): common/mailnewstestprefs.js python scripts (used to set up the profile and run the test): bloat/setupbloattest.py bloat/runtest.py common/setupcommonmailnews.py pre-defined profile initial setup: one pop3 account (mails tbd) one identity one smtp server defined (not used) future requirements/possibilities: one address book where pab has ~1000 entries large message folders imap nntp server and subscribed newsgroup.
Introduction to NSPR
the current implementation of nspr allows developers to compile a single source code base on macintosh (ppc), win32 (nt 3.51, nt 4.0, win'95), and over twenty versions of unix.
...these resources include the thread stack and the cpu register set (including pc).
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_ocspchecker_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: ...
... bug 430916: add sustaining asserts bug 431805: leak in nssarena_destroy() bug 431929: memory leaks on error paths in devutil.c bug 432303: replace pkix_pl_memcpy with memcpy bug 433177: fix the gcc compiler warnings in lib/util and lib/freebl bug 433437: vfychain ignores the -a option bug 433594: crash destroying ocsp cert id [[@ cert_destroyocspcertid ] bug 434099: nss relies on unchecked pkcs#11 object attribute values bug 434187: fix the gcc compiler warnings in nss/lib bug 434398: libpkix cannot find issuer cert immediately after checking it with ocsp bug 434808: certutil -b deadlock when importing two or more roots bug 434860: coverity 1150 - dead code in ocsp_createcertid bug 436428: remove unneeded assert from sec_pkcs7e...
NSS 3.27 release notes
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_namedgroupconfig).
... added support for rsa-pss signatures in tls 1.2 and tls 1.3 new functions in ssl.h ssl_namedgroupconfig notable changes in nss 3.27 update 2016-10-02: the maximum tls version supported has been increased to tls 1.3 (draft).
NSS 3.46 release notes
a8f1fc2444565a367ae60eddc27a412531ae bug 1574670 - remove expired deutsche telekom root ca 2 root certificate sha-256 fingerprint: b6191a50d0c3977f7da99bcdaac86a227daeb9679ec70ba3b0c9d92271c170d3 bug 1566569 - remove swisscom root ca 2 root certificate sha-256 fingerprint: f09b122c7114f4a09bd4ea4f4a99d558b46e4c25cd81140d29c05613914c3841 upcoming changes to default tls configuration the next nss team plans to make two changes to the default tls configuration in nss 3.47, which will be released in october: tls 1.3 will be the default maximum tls version.
...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 ppc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized warning in p7env.c bug 1561548 - remove -wmaybe-uninitialized warning in pkix_pl_ldapdefaultclient.c bug 1512605 - incorrect alert description after unencrypted finished msg bug 1564715 - read /proc/cpuinfo when at_hwcap2 returns 0 bug 1532194 - remove or fix -ddebug_$user from make builds bug 1565577 - visual studio's ...
NSS 3.47 release notes
upcoming 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.
...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 stanpcertdb 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
bugs fixed in nss 3.53 bug 1640260 - initialize pbe params (asan fix) bug 1618404 - set cka_nss_server_distrust_after for symantec root certs bug 1621159 - set cka_nss_server_distrust_after for consorci aoc, grca, and sk id root certs bug 1629414 - ppc64: correct compilation error between vmx vs.
... vsx vector instructions bug 1639033 - fix various compile warnings in nss bug 1640041 - fix a null pointer in security/nss/lib/ssl/sslencode.c:67 bug 1640042 - fix a null pointer in security/nss/lib/ssl/sslsock.c:4460 bug 1638289 - avoid multiple definitions of sha{256,384,512}_* symbols when linking libfreeblpriv3.so in firefox on ppc64le bug 1636389 - relocate deprecated seed algorithm bug 1637083 - lib/ckfw: no such file or directory.
NSS API Guidelines
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.
...for instance, cert_dupcertifiate() will remain the same, but pk11_referenceslot() will become pk11_dupslot(), and pk11_clonecontext() will become pk11_dupcontext().
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_dupcrl mxr 3.9 and later sec_getsignaturealgorithmoidtag mxr 3.10 and later sec_getregisteredhttpclient 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_pkcs5isalgorithmpbealg mxr 3.2 and later sec_pkcs5isalgorithmpbealgtag mxr 3.12 and later sec_registerdefaulthttpclient 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 3.2 and later secitem_dupitem mxr 3.2 and later secitem_freeitem mxr 3.2 and later secitem_itemsareequal mxr 3.8 and late...
Invariants
however, there is another internal api, js::switchtocompartment, that lets you break this invariant, and of course in xpconnect 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.
... background: the fastest instructions for nameexpressions are fat opcodes that combine a load with additional operations, as in jsop_inclocal or jsop_getlocalprop.
JSClass.flags
the private field of each object of this class points to an xpcom object (see nsisupports).
... this is only meaningful if spidermonkey is built with xpconnect and the jsclass_has_private flag is also set.
JS_SetOptions
the context's private data points to an xpcom object (see nsisupports).
... this is only meaningful if spidermonkey is built with xpconnect.
JSDBGAPI
breakpoints js_settrap js_gettrapopcode js_cleartrap js_clearscripttraps js_clearalltraps js_handletrap js_setinterrupt js_clearinterrupt watchpoints js_setwatchpoint js_clearwatchpoint js_clearwatchpointsforobject js_clearallwatchpoints inspecting the stack js_pctolinenumber js_linenumbertopc js_getfunctionscript js_getfunctionnative js_getfunctionfastnative js_getscriptprincipals typedef jsstackframe js_frameiterator js_getframescript js_getframepc js_getscriptedcaller js_stackframeprincipals js_evalframeprincipals js_getframeannotation js_setframeannotation js_getframeprincipalarray js_isnativeframe js_getframeobject js_getframescopechain js_getframecallob...
... js_connectshark js_disconnectshark js_startchudremote js_stopchudremote the following jsnative functions can be used to expose the above four apis to scripts.
Profiling SpiderMonkey
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 [xpcshell], since the host environments differ.
...if you're looking to investigate that, build a standalone copy of spidermonkey and compare it with xpcshell.
Shell global objects
line2pc([fun,] line) map line number to pc.
... pc2line(fun[, pc]) map pc to line number.
Aggregating the In-Memory Datasource
introduction you can use xpcom aggregation1 with the in-memory datasource.
... notes describing all of the vagaries of xpcom aggregation is beyond the scope of this document.
Generating GUIDs
guids are used in mozilla programming for identifying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5.
... com/xpcom 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.
Packaging WebLock
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 xpcom for more information on registration).
...have to register component here or with regxpcom?
Making cross-thread calls using runnables
typically, thread activities are triggered and managed using an xpcom event-passing framework that uses the nsirunnable interface.
...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 "nsxpcomcidinternal.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.interfacesByID
each object represents one of the xpcom interfaces -- that some component or another might or might not implement.
...the interfaces which xpconnect is capable of reflecting into javascript.
Components.results
components.results is a read-only object whose properties are the names listed as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of errors), with the value of each corresponding to that constant's value.
... introduction components.results is an object whose properties are the names of well-known xpcom result codes, with each value being that of the corresponding result code.
Components.utils.importGlobalProperties
the following strings are supported: string/object xpcom component atob blob btoa crypto css fetch file nsidomfile indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentityprovider textdecoder textencoder url urlsearchparams ...
... var domfile = services.appshell.hiddendomwindow.file('/path/to/file'); xpcom components some objects have an xpcom alternative, which typically allows more flexibility then the dom version here is an example of how to use the dom xmlhttprequest through xpcom interface of nsixmlhttprequest: var oreq = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); ...
Examples
there are several java test applications checked in to the tree that give examples on how to embed gecko or init xpcom from within java.
... the test apps can be found at mozilla/extensions/java/xpcom/tests.
nsCategoryManager
« xpcom api reference summary the xpcom 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 xpcom service manager.
nsLocalFile
« xpcom api reference summary a component implementing nsilocalfile.
... class id 2e23e220-60be-11d3-8c4a-000064657374 contractid @mozilla.org/file/local;1 supported interfaces nsilocalfile, nsifile remarks this component should be accessed via the xpcom component manager.
nsObserverService
« xpcom api reference the xpcom observer service.
... class id d07f5195-e3d1-11d2-8acd-00105a1b8860 contractid @mozilla.org/observer-service;1 supported interfaces nsiobserverservice remarks this component is a singleton and should therefore be accessed via the xpcom service manager.
nsScriptableInputStream
« xpcom 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 xpcom component manager.
NS_NewLocalFile
« xpcom api reference summary the ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.
... #include "nsxpcom.h" #include "nsilocalfile.h" nsresult ns_newlocalfile( const nsastring& apath, prbool afollowlinks, nsilocalfile** aresult ); parameters apath [in] a utf-16 string object that specifies an absolute filesystem path.
NS_NewNativeLocalFile
« xpcom api reference summary the ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.
... #include "nsxpcom.h" #include "nsilocalfile.h" nsresult ns_newnativelocalfile( const nsacstring& apath, prbool afollowlinks, nsilocalfile** aresult ); parameters apath [in] a string object that specifies an absolute filesystem path.
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 stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
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 stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
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 stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
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 stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
PromiseFlatCString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
PromiseFlatString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsACString
« xpcom api reference summary the nsacstring abstract class represents a character string composed of single-byte storage units.
... the methods defined on nsacstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_cstring.
nsACString (External)
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger data members no public members.
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsACString_internal
seequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsAString
« xpcom api reference summary the nsastring abstract class represents a character string composed of double-byte storage units.
...the methods defined on nsastring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_string.
nsAString (External)
,342" href="http://developer.mozilla.org/en/nsliteralstring_(external)" shape="rect" title="nsliteralstring_(external)"> </map> method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger data members no public members.
... parameters prunichar c pruint32 pos void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurences of characters in aset from the string.
nsAString_internal
seequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsAutoString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsCAutoString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsCStringContainer (External)
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral f...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsCString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsDependentCString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsDependentCSubstring
seequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsacstring_internal data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsDependentCSubstring external
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsDependentString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsDependentSubstring
seequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsastring_internal data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stripchar void stripchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsDependentSubstring external
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const prunichar*, print32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsEmbedCString
« xpcom api reference summary the nsembedcstring concrete class provides a way to construct a nsacstring object that allocates null-terminated storage.
... remarks the methods defined on nsembedcstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_cstring.
nsEmbedString
« xpcom api reference summary the nsembedstring concrete class provides a way to construct a nsastring object that allocates null-terminated storage.
... remarks the methods defined on nsembedstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_string.
nsLiteralCString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsLiteralString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsStringContainer (External)
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsString external
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsSupportsWeakReference
« xpcom api reference summary inherit from this c++ class to add canonical support for nsisupportsweakreference.
...to use this class, you must link your component or application against the xpcom glue library.
jsdIStackFrame
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.
nsICookieConsent
nscookiestatus getconsent( in nsiuri uri, in nsihttpchannel httpchannel, in boolean isforeign, out nscookiepolicy policy ); parameters uri the uri to find the policy for.
... httpchannel the channel to extract the p3p headers from.
nsICookieService
getcookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, so getcookiestring() can be used in place of this method.
...setcookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, and setcookiestring() could also query the date header from the channel if achannel supports nsihttpchannel.
nsIDNSListener
inherits from: nsisupports last changed in gecko 1.7 method overview void onlookupcomplete(in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus); methods onlookupcomplete() called when an asynchronous host lookup completes.
... void onlookupcomplete( in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus ); parameters arequest the value returned from asyncresolve.
nsIDOMGlobalPropertyInitializer
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 xpcom component implementing this interface can be exposed to web content as a property on the window.
...ensure that you never return any internal xpcom objects to untrusted code.
nsIDebug2
xpcom/base/nsidebug2.idlscriptable adds access to additional information in debug builds of mozilla code by expanding upon the features in nsidebug 1.0 66 introduced gecko 1.9.2 inherits from: nsidebug last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description assertioncount long the number of assertions since process start.
... isdebugbuild boolean whether xpcom was compiled with debug defined.
nsIDirectoryServiceProvider2
xpcom/io/nsidirectoryservice.idlscriptable an extension of nsidirectoryserviceprovider which allows multiple files to be returned for the given key.
...use an xpcom return code of ns_success_aggregate_result if this result should be aggregated with other "lower" providers.
nsIEditor
« xpcom api reference editor/nsieditor.idlscriptable provides methods and attributes used when editing page content.
... 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 dumpcontenttree(); void debugdumpcontent() ; void debugunittests(out long outnumtests, out long outnumtestsfailed); [notxpcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags constant value description enone 0 enext 1 eprevious 2 enextword 3 epreviouswo...
nsIFilePicker
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.
... filteraudio 0x100 corresponds to the *.aac, *.aif, *.flac, *.iff, *.m4a, *.m4b, *.mid, *.midi, *.mp3, *.mpa, *.mpc, *.oga, *.ogg, *.ra, *.ram, *.snd, *.wav and *.wma filters for file extensions.
nsIFrameLoaderOwner
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview [noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
...[noscript, notxpcom] alreadyaddrefed_nsframeloader getframeloader(); parameters none.
nsIHttpActivityObserver
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 ahttpchannel, 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.
...void observeactivity( in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata ); parameters ahttpchannel the nsihttpchannel on which the activity occurred.
nsIHttpUpgradeListener
netwerk/protocol/http/nsihttpchannelinternal.idlscriptable the callback interface for nsihttpchannelinternal.httpupgrade; this is called when an http protocol upgrade is finished.
... note: to begin a protocol upgrade, call nsihttpchannelinternal.httpupgrade().
nsIINIParser
xpcom/ds/nsiiniparser.idlscriptable an instance of nsiiniparser can be used to read values from an ini file.
... */ function getinivalue (inifile, section, prop) { var inifact = components.manager.getclassobjectbycontractid( "@mozilla.org/xpcom/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.
nsIINIParserFactory
xpcom/ds/nsiiniparser.idlscriptable this interface is used to create nsiiniparser objects for use in parsing ini files.
...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/xpcom/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
nsiiniparserwriter xpcom/ds/nsiiniparser.idlscriptable allows writing to an ini-format configuration file.
... 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/xpcom/ini-processor-factory;1"].
nsIMemory
xpcom/base/nsimemory.idlscriptable this interface represents a generic memory allocator.
... method overview voidptr alloc(in size_t size); violates the xpcom interface guidelines void free(in voidptr ptr); violates the xpcom interface guidelines void heapminimize(in boolean immediate); boolean islowmemory(); deprecated since gecko 2.0 voidptr realloc(in voidptr ptr, in size_t newsize); violates the xpcom interface guidelines methods alloc allocates a block of memory of a particular size.
nsIObserver
xpcom/ds/nsiobserver.idlscriptable this interface is implemented by an object that wishes to observe notifications.
... the most common implementation of nsiobserverservice is the xpcom observer service.
nsIObserverService
xpcom/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 xpcom nsobserverservice implements this interface to provide global notifications for a variety of subsystems.
nsIParentalControlsService
constants constant value description epclog_urivisit 1 this log entry type represents an access to web content.
... epclog_filedownload 2 this log entry type represents a file download.
nsIScriptError
js/xpconnect/idl/nsiscripterror.idlscriptable represents javascript errors and warnings for use by the console service.
... categories the web console does not display "xpconnect javascript" "component javascript" "chrome javascript" "chrome registration" "xbl" "xbl prototype handler" "xbl content sink" "xbl javascript" "frameconstructor" categories the web console displays "hudconsole" "css parser" "css loader" "content javascript" "dom events" "dom:html" "dom window" "svg" "imagemap" "html" "canvas" "dom3 load" "dom" "malformed-xml" "dom...
nsIScriptableIO
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
...for example: io.getfile("profile", "cookies.txt"); from an xpcom component, however, you will need to get a reference as with other components: var scriptableio = components.classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath...
nsISelection
as a service: var selection = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiselection); method overview void addrange(in nsidomrange range); void collapse(in nsidomnode parentnode, in long offset); [noscript,notxpcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in long offset); native code only!
... collapsed() [noscript,notxpcom,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).
nsISelectionPrivate
void startbatchchanges(); wstring tostringwithformat(in string formattype, in unsigned long flags, in print32 wrapcolumn); attributes attribute type description cancacheframeoffset boolean frame offset cache can be used just during calling nseditor::endplaceholdertransaction.
... tostringwithformat() wstring tostringwithformat( in string formattype, in unsigned long flags, in print32 wrapcolumn ); parameters formattype flags wrapcolumn return value ...
nsISupportsWeakReference
xpcom/base/nsiweakreference.idlscriptable this interface is a factory interface, which produces appropriate instances of nsiweakreference.
... remarks the xpcom glue library provides nssupportsweakreference, a canonical implementation of nsisupportsweakreference.
nsIThreadEventFilter
xpcom/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 xpcom interface guidelines methods violates the xpcom interface guidelines acceptevent() this method is called to determine whether or not an event may be accepted by a nested event queue.
nsIThreadInternal
the nsithreadinternal interface is implemented by the xpcom thread object to let consumers observe dispatch activity on a thread.
... xpcom/threads/nsithreadinternal.idlscriptable please add a summary to this article.
nsITraceableChannel
it is implemented by nsihttpchannel.
... 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 nsihttpchannel), 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.
nsIURIFixupInfo
fixupchangedprotocol boolean if we changed the protocol; instead of using one raw from the input.
... fixupcreatedalternateuri boolean if we created an alternative uri.
nsIWeakReference
xpcom/base/nsiweakreference.idlscriptable this interface represents a proxy for an xpcom object.
... it allows a consumer to hold an indirect, non-owning reference to an xpcom object.
nsIWebProgressListener
in such cases, the request itself should be queried for extended error information (for example for http requests see nsihttpchannel.
... cu.reporterror("saw: " + data.name + " -- passing: " + json.stringify(data)); }); /** * below is the contents of example-framescript.js */ const {classes: cc, interfaces: ci, utils: cu} = components; cu.import("resource://gre/modules/xpcomutils.jsm"); var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { let win = awebprogress.domwindow; let outerwindowid = win.queryinterface(ci.nsiinterfacerequestor) .getin...
nsIWindowWatcher
this component should not keep a (xpcom) reference to any windows; the implementation will claim no ownership.
... example for example, in a xul application or mozilla extension, if the window object is unavailable (for example, when opening a window from xpcom component code), you might want to use this interface for opening a new window: var ww = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen", null); note: versions of gec...
NS_CStringContainerInit2
« xpcom api reference summary the ns_cstringcontainerinit2 function initializes a nscstringcontainer instance for use as a nsacstring.
...the caller must have allocated the data array using the xpcom memory allocator.
nsGetModuleProc
summary this function prototype provides the xpcom entry-point into a module.
... #include "nsxpcom.h" typedef nsresult (pr_callback *nsgetmoduleproc)( nsicomponentmanager *acompmgr, nsifile* alocation, nsimodule** aresult ); parameters acompmgr [in] the xpcom component manager.
nsStaticModuleInfo
summary this data structure is used by ns_initxpcom3 to specify static xpcom modules.
... #include "nsxpcom.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.
The Thread Manager
only c++ code may use the thread manager and xpcom thread.
... nsithreadinternal a subclass of nsithread that is implemented by the xpcom thread object to add support for observing dispatch activity on a thread.
Status, Recent Changes, and Plans
relaxed the invariant for nscomptr<nsisupports>, so that it is now a pointer to any xpcom interface.
... bug 59414: making operator& private may help prevent some leaks caused by casting move the factored nscomptr routines into their own library, to reduce nscomptr clients' dependency on the xpcom library.
Working with out parameters
when working with xpcom components, you might come across method declarations like the following one: [scriptable, uuid(8b5314bc-db01-11d2-96ce-0060b0fb9956)] interface nsitransferable : nsisupports { ...
...usage in order to use such a method from javascript via xpconnect, you have to follow a specific rule.
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 onstopcopy the onstopcopy interface is called when the copy operation has completed.
... ns_imethod onstopcopy( nsresult astatus, - the resulting status for the send operation nsisupports *listenerdata) = 0; - the nsisupports pointer passed in to the original copy operation copy operations there are various copy operations that can result as a part of message creation and delivery.
Mailnews and Mail code review requirements
for xpcshell tests, it has either passed on try or has been run locally on the appropriate platform(s).
... specifically, if the xpcshell 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.
Building a Thunderbird extension 1: introduction
it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the xpcom cross-platform component object model.
... there are also a number of extension and applications that are useful for testing and debugging thunderbird extensions, such as javascript consoles and xpcom inspectors.
Get Thunderbird version
(version 3.0b3pre was the first build to include steel.) var versionchecker = components.classes["@mozilla.org/xpcom/version-comparator;1"].getservice(components.interfaces.nsiversioncomparator); if (versionchecker.compare(application.version, "3.0b4") >= 0) // code for >= 3.0b4 else // code for < 3.0b4 for versions prior to 3.0b3pre, you can use something like this: var version; if ( "@mozilla.org/xre/app-info;1" in components.classes ) version = components.classes["@mozilla.org/xre/app-info; 1"].getservice(components.interfaces.nsixulappinfo).version; else version = components.classes["@mozilla.org/preferences-service; 1"].getservice(components.interfaces.nsiprefbranc...
...h).getcharpref ("app.version"); var versionchecker = components.classes["@mozilla.org/xpcom/version- comparator;1"].getservice(components.interfaces.nsiversioncomparator); if ( versionchecker.compare( version, "3.0b3" ) >= 0 ) // code for >= 3.0b3 else // code for < 3.0b3 ...
ctypes
credit for this example is to nmaier (stackoverflow :: 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 lpctstr = ctypes.jschar.ptr; var lpcstr = ctypes.char.ptr; var loadlibrary = kernel.declare("loadlibraryw", ctypes.winapi_abi, hmodule, lpctstr); var getprocaddress = kernel.declare("getprocaddress", ctypes.winapi_abi, ctypes.void_t.ptr, hmodule, lpcstr); var huser = loadlibrary("user32"); var funcptr = getprocaddress(huser, "messageboxw"); // now we have a pointer to a function, let's cast it to t...
...he right type var messageboxtype = ctypes.functiontype(ctypes.winapi_abi, ctypes.int32_t, [hwnd, lpctstr, lpctstr, ctypes.uint32_t]); funcptr = ctypes.cast(funcptr, messageboxtype.ptr); funcptr(0, "test1", "test2", 0); credit for this example is to wladimir palant (stackoverflow :: how to call a function using pointer in js-ctypes) ...
js-ctypes
unlike binary xpcom components, it allows developers to ship a single binary for use with multiple versions of firefox.
... mailing list newsgroup rss feed stackoverflow - jsctypes related topics xpcom in gecko 2 - binary components ...
Constants - Plugins
npvers_has_xpconnect_scripting 13 plug-in is scriptable using xpconnect.
... npvers_has_npobject_enum 18 the npclass in question has an enumerate field, which lets you enumerate the properties of an npobject of that class.
Animation.pause() - Web APIs
WebAPIAnimationpause
example animation.pause() is used many times in the alice in web animations api land growing/shrinking alice game, largely because animations created with the element.animate() method immediately start playing and must be paused manually if you want to avoid that: // animation of the cupcake slowly getting eaten up 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 }); // doesn't actually need to be eaten until a click event, so pause it initially: nommingcake.pause(); additionally, whe...
...n resetting : // an all-purpose function to pause the animations on alice, the cupcake, and the bottle that reads "drink me." var stopplayingalice = function() { alicechange.pause(); nommingcake.pause(); drinking.pause(); }; // when the user releases the cupcake or the bottle, pause the animations.
AudioTrack.enabled - Web APIs
function swapcommentarymain() { var videoelem = document.getelementbyid("main-video"); var audiotrackmain; var audiotrackcommentary; videoelem.audiotracks.foreach(track) { if (track.kind === "main") { audiotrackmain = track; } else if (track.kind === "commentary") { audiotrackcommentary = track; } } if (audiotrackmain && audiotrackcommentary) { var commentaryenabled = a...
...udiotrackcommentary.enabled; audiotrackcommentary.enabled = audiotrackmain.enabled; audiotrackmain.enabled = commentaryenabled; } } the swapcommentarymain() function above finds within the audio tracks of the <video> element "main-video" the audio tracks whose kind values are "main" and "commentary".
BaseAudioContext.decodeAudioData() - Web APIs
the single argument to this callback is an audiobuffer representing the decodeddata (the decoded pcm audio data).
...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.
Console.group() - Web APIs
WebAPIConsolegroup
the console.groupcollapsed() 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 groupcollapsed() method was the same as group().
console - Web APIs
WebAPIConsole
console.groupcollapsed() creates a new inline group, indenting all following output by another level.
...the console.groupcollapsed() method is similar but creates the new block collapsed, requiring the use of a disclosure button to open it for reading.
Document.documentURIObject - Web APIs
this only works for privileged (universalxpconnect) scripts, including extension code.
... privileged code must be careful not to try getting or setting this property on a non-wrapped content object (e.g., on a wrappedjsobject of an xpcnativewrapper).
Introduction to the File and Directory Entries API - Web APIs
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 appcache.
...however, appcache storage isn't locally mutable, and doesn't allow for fine-grained client-side management.
HTMLTextAreaElement - Web APIs
nlen : nrowend), bkeepcols = 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 ?
... areturns.length + 1 : 1) < nrows) && ((nkey > 32 && nkey < 41) || bkeepcols); } in the html we just need to hook our function to the `onkeypress` event and specify that our textarea does not accept pasting: <form> <p>textarea with fixed number of characters per line:<br /> <textarea cols="50" rows="10" onkeypress="return checkrows(this, event);" onpaste="return false;"></textarea> </p> </form> specifications specification status comment html living standardthe definition of 'htmltextareaelement' in that specification.
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 clipcontainer = document.createelement('article'); var cliplabel = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); clipcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendc...
...hild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); 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 = function(e) { evttgt = e.target; evttgt.parentnode.parentnode.removechild(evttgt.parentnode); } } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } }) .catch(function(err) { console.log('the following error occurred: ' + err); }) } this code sample is inspired by the web dictaphone demo.
Using the MediaStream Recording API - Web APIs
we register an event handler for this using mediarecorder.onstop, and finalize our blob there 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 clipcontainer = document.createelement('article'); const cliplabel = document.createelement('p'); const audio = document.createelement('audio'); const deletebutton = document.createelement('button'); clipcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontain...
...er.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); const blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; const audiourl = window.url.createobjecturl(blob); audio.src = audiourl; deletebutton.onclick = function(e) { let evttgt = e.target; evttgt.parentnode.parentnode.removechild(evttgt.parentnode); } } let's go through the above code and look at what's happening.
NavigatorID - Web APIs
navigatorid.appcodename read only always returns "mozilla", in any browser.
... living standard added the appcodename property and the taintenabled() method, for compatibility purpose.
RTCDataChannel: bufferedamountlow event - Web APIs
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...
... 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.
RTCDataChannel: error event - Web APIs
examples // strings for each of the sctp cause codes found in rfc // 4960, section 3.3.10: // https://tools.ietf.org/html/rfc4960#section-3.3.10 const sctpcausecodes = [ "no sctp error", "invalid stream identifier", "missing mandatory parameter", "stale cookie error", "sender is out of resource (i.e., memory)", "unable to resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unrecognized parameters", "no user data (sctp data chunk has no data)", "cookie received while shutting down", "resta...
...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.sctpcausecode < sctpcausecodes.length) { console.error(" sctp failure: ", err.sctpcausecode); } 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 ...
RTCDtlsTransport.state - Web APIs
let pc = new rtcpeerconnection({ bundlepolicy: "max-bundle" }); /* ...
... */ function tallysenders(pc) { let results = { transportmissing: 0, connectionpending: 0, connected: 0, closed: 0, failed: 0, unknown: 0 }; let senderlist = pc.getsenders(); senderlist.foreach(sender => { let transport = sender.transport; if (!transport) { results.transportmissing++; } else { switch(transport.state) { case "new": case "connecting": results.connectionpending++; break; case "connected": results.connected++; break; case "closed": results.closed++; break; case "failed": results.failed++; break; default: results.unknown++; break; } } }); return results; } note tha...
RTCIceCandidateInit.candidate - Web APIs
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(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.
RTCIceTransport: statechange event - Web APIs
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.
... 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.
RTCPeerConnection.canTrickleIceCandidates - Web APIs
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.
... pc.setremotedescription(remoteoffer) .then(_ => pc.createanswer()) .then(answer => pc.setlocaldescription(answer)) .then(_ => if (pc.cantrickleicecandidates) { return pc.localdescription; } return new promise(r => { pc.addeventlistener('icegatheringstatechange', e => { if (e.target.icegatheringstate === 'complete') { r(pc.localdescription); } }); }); }) .then(answer => sendanswertopeer(answer)) // signaling message .catch(e => handleerror(e)); pc.addeventlistener('icecandidate', e => { if (pc.cantrickleicecandidates) { sendcandidatetopeer(e.candidate); // signaling message } }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def...
RTCPeerConnection.connectionState - Web APIs
example var pc = new rtcpeerconnection(configuration); /* ...
... */ var connectionstate = pc.connectionstate; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.connectionstate' in that specification.
RTCPeerConnection: connectionstatechange event - Web APIs
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.
... pc.onconnectionstatechange = ev => { switch(pc.connectionstate) { case "new": case "checking": setonlinestatus("connecting..."); break; case "connected": setonlinestatus("online"); break; case "disconnected": setonlinestatus("disconnecting..."); break; case "closed": setonlinestatus("offline"); break; case "failed": setonlinestatus("error"); break; default: setonlinestatus("unknown"); break; } } you can also create a handler for connectionstatechange by using addeventlistener(): pc.addeventlistener("connectionstatechange", ev => { switch(pc.connectionstate) { /* ...
RTCPeerConnection.createDataChannel() - Web APIs
// offerer side var pc = new rtcpeerconnection(options); var channel = pc.createdatachannel("chat"); channel.onopen = function(event) { channel.send('hi you!'); } channel.onmessage = function(event) { console.log(event.data); } // answerer side var pc = new rtcpeerconnection(options); pc.ondatachannel = function(event) { var channel = event.channel;  channel.onopen = function(event) { channel.send('hi b...
...ack!'); } channel.onmessage = function(event) { console.log(event.data); } } alternatively, more symmetrical out-of-band negotiation can be used, using an agreed-upon id (0 here): // both sides var pc = new rtcpeerconnection(options); var channel = pc.createdatachannel("chat", {negotiated: true, id: 0}); channel.onopen = function(event) { channel.send('hi!'); } channel.onmessage = function(event) { console.log(event.data); } for a more thorough example showing how the connection and channel are established, see a simple rtcdatachannel sample.
RTCPeerConnection: datachannel event - Web APIs
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 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.
RTCPeerConnection.getIdentityAssertion() - Web APIs
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.
RTCPeerConnection.getSenders() - Web APIs
this function takes as input an rtcpeerconnection, pc, and a boolean, 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.
RTCPeerConnection.getStreamById() - Web APIs
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.
RTCPeerConnection: icecandidate event - Web APIs
if you need to perform any special actions when there are no further candidates expected, you're much better off watching the ice gathering state by watching for icegatheringstatechange events: pc.addeventlistener("icegatheringstatechange", ev => { switch(pc.icegatheringstate) { case "new": /* gathering is either just starting or has been reset */ break; case "gathering": /* gathering has begun or is ongoing */ break; case "complete": /* gathering has ended */ break; } }); as you can see in this example, the icegatheringstatechange even...
... 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 }); } }; specif...
RTCPeerConnection: icecandidateerror event - Web APIs
example the following example establishes a handler for icecandidateerrors that occur on the rtcpeerconnection pc.
... 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.
RTCPeerConnection: negotiationneeded event - Web APIs
pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling ...
... you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling.
RTCPeerConnection.peerIdentity - Web APIs
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.removeTrack() - Web APIs
syntax pc.removetrack(sender); parameters mediatrack a rtcrtpsender specifying the sender to remove from the connection.
... 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.
RTCPeerConnection.setIdentityProvider() - Web APIs
syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method.
... example var pc = new peerconnection(); pc.setidentityassertion("developer.mozilla.org"); specifications specification status comment identity for webrtcthe definition of 'rtcpeerconnection.setidentityprovider()' in that specification.
RTCPeerConnection: signalingstatechange event - Web APIs
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.
... 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.
RTCPeerConnection: track event - Web APIs
pc = new rtcpeerconnection({ iceservers: [ { urls: "turn:fake.turnserver.url", username: "someusername", credential: "somepassword" } ] }); pc.addeventlistener("track", e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new track's first stream to an existing <video> element, identified using the v...
... 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.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
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().
... async function networkteststop(pc) { if (pc) { let statsbox = document.queryselector(".stats-box"); let endreport = await pc.getstats(); for (let endremoteoutbound of endreport.values()) { if (endremoteoutbound.type === "remote-outbound-rtp") { let startremoteoutbound = startreport.get(endremoteoutbound.id); if (startremoteoutbound) { let startinboundstats = findreportentry(startrep...
RTCRtpParameters - Web APIs
to obtain the parameters of a sender or receiver, call its getparameters() method: getparameters() getparameters() properties codecs an array of rtcrtpcodecparameters objects describing the set of codecs from which the sender or receiver will choose.
... function getrtpcname(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.
RTCRtpSynchronizationSource - Web APIs
since rtcrtpsynchronizationsource implements rtcrtpcontributingsource, its properties are also available.
... properties also implements the properties of rtcrtpcontributingsource.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the rtcrtptransceiver method setcodecpreferences() configures the transceiver's codecs given a list of rtcrtpcodeccapability objects specifying the new preferences for each codec.
... syntax rtcrtptransceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrtpcodeccapability objects, in order of preference, each providing the parameters for one of the transceiver's supported codecs.
SVGLength - Web APIs
WebAPISVGLength
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 + ...
... svg_lengthtype_pc 10 a value was specified using the pc units defined in css2.
Using WebRTC data channels - Web APIs
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.
... let datachannel = pc.createdatachannel("myapp channel", { negotiated: true }); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); requestremotechannel(datachannel.id); in this code snippet, the channel is created with negotiated set to true, then a function called requestremotechannel() is used to trigger negotiation, to create a remote channel with the same id as the local c...
WebRTC Statistics API - Web APIs
try { mypeerconnection = new rtcpeerconnection(pcoptions); statsinterval = window.setinterval(getconnectionstats, 1000); /* add event handlers, etc */ } catch(err) { console.error("error creating rtcpeerconnection: " + err); } function getconnectionstats() { mypeerconnection.getstats(null).then(stats => { var statsoutput = ""; stats.foreach(report => { if (report.type === "inbound-rtp" && report.kind === "video") { ...
... rtcrtpcontributingsourcestats rtcstats data-channel statistics related to one rtcdatachannel on the connection.
Rendering and the WebXR frame animation callback - Web APIs
we then call gl.bindframebuffer() to bind that framebuffer as the target for all upcoming drawing commands.
...not only are their locations in the world changing over time, but each npc likely has body parts or components that are moving in relation to one another.
window.dump() - Web APIs
WebAPIWindowdump
dump() is also available to xpcom components implemented in javascript, even though window is not the global object in components.
...note that dump output from xpcom components goes to stderr, while dump called elsewhere will output to stdout.
Web APIs
WebAPI
ions rtccertificate rtcconfiguration rtcdtmfsender rtcdtmftonechangeevent rtcdatachannel rtcdatachannelevent rtcdtlstransport rtcerror rtcerrorevent rtcicecandidate rtcicecandidateinit rtcicecandidatepair rtcicecandidatepairstats rtcicecandidatestats rtcicecandidatetype rtcicecomponent rtcicecredentialtype rtcicegathererstate rtciceparameters rtciceprotocol rtcicerole rtciceserver rtcicetcpcandidatetype rtcicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtcremoteoutboundrtpstreamstats rtcrtcpparameters rtcrtpcapabilities rtcrtpcodeccapability rtcrtpcodecp...
...arameters rtcrtpcontributingsource rtcrtpencodingparameters rtcrtpparameters rtcrtpreceiveparameters rtcrtpreceiver rtcrtpsendparameters rtcrtpsender rtcrtpstreamstats rtcrtpsynchronizationsource rtcrtptransceiver rtcrtptransceiverdirection rtcrtptransceiverinit rtcsctptransport rtcsessiondescription rtcsessiondescriptioncallback rtcstats rtcstatsicecandidatepairstate rtcstatsreport rtcstatstype rtctrackevent rtctrackeventinit radionodelist range readablebytestreamcontroller readablestream readablestreambyobreader readablestreambyobrequest readablestreamdefaultcontroller readablestreamdefaultreader relativeorientationsensor renderingcontext report reportingobserver reportingobserveroptions request requestdestination resizeobserver resizeobserverentry response rsahashedi...
ARIA: textbox role - Accessibility
<!-- simple text input field --> <div id="txtboxlabel">enter your five-digit zipcode</div> <div role="textbox" contenteditable="true" aria-placeholder="5-digit zipcode" 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 ...
... <label for="txtbox">enter your five-digit zipcode</label> <input type="text" placeholder="5-digit zipcode" 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.
CSS values and units - CSS: Cascading Style Sheets
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 1pc = 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.
... dpcm dots per centimetre.
attr() - CSS: Cascading Style Sheets
WebCSSattr
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.
...)where <type-or-unit> = string | color | url | integer | number | length | angle | time | frequency | cap | ch | em | ex | ic | lh | rlh | rem | vb | vi | vw | vh | vmin | vmax | mm | q | cm | in | pt | pc | px | deg | grad | rad | turn | ms | s | hz | khz | % examples content property html <p data-foo="hello">world</p> css [data-foo]::before { content: attr(data-foo) " "; } result <color> value html <div class="background" data-background="lime">background expected to be red if your browser does not support advanced usage of attr()</div> css .background { height: 100vh; } ...
font-variant-caps - CSS: Cascading Style Sheets
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: c2pc, pcap).
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
237 using the application cache advanced, app, cache, guide, html, appcache, application cache, web cache html5 provides an application caching mechanism that lets web applications run offline.
... this application cache (appcache) interface lists resources that browsers should cache to be available offline.
Content type - SVG: Scalable Vector Graphics
when used in a stylesheet, a <length> is defined as follows: length ::= number (~"em" | ~"ex" | ~"px" | ~"in" | ~"cm" | ~"mm" | ~"pt" | ~"pc")?
... 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" | "%")?
Modules - Archive of obsolete content
if the script being loaded is less privileged than the loading script, the access is prevented, as the following example shows: // index.js: let a = loadscript("www.foo.com/a.js", { components: components }); // index.js has chrome privileges components.utils; // => [object nsxpccomponents_utils] // a.js: // a.js has content privileges imports.components.utils; // => undefined modules in the add-on sdk the module system used by the sdk is based on what we learned so far: it follows the commonjs specification, which attempts to define a standardized module api.
io/file - Archive of obsolete content
for now, you need to require("chrome") and use the xpcom directory service as described in this article about file i/o.
loader/sandbox - Archive of obsolete content
omitted or null: then the sandbox will have chrome privileges giving it access to all the xpcom components.
places/bookmarks - Archive of obsolete content
see also using xpcom without chrome - bookmark observer ...
system/events - Archive of obsolete content
var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type.
Low-Level APIs - Archive of obsolete content
platform/xpcom implement xpcom objects, factories, and services.
package.json - Archive of obsolete content
this is used as a classid of the "harness service" xpcom component.
Chrome Authority - Archive of obsolete content
var xhr = require("x"+"hr"); var modname = "xpcom"; var xpcom = 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.
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/xpcom 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
chrome authority get access to the components object, enabling your add-on to load and use any xpcom object.
Dialogs and Prompts - Archive of obsolete content
nsipromptservice is an xpcom interface available to c++ and chrome javascript code (not to web pages' js), that provides methods for displaying a few simple types of dialogs.
Running applications - Archive of obsolete content
this page describes how to run other programs from your chrome javascript code, using mozilla xpcom interfaces.
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 xpcomutils.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
this code should be in bootstrap.js (within the startup() function) for restartless extensions or in an xpcom component or a javascript code module (not an overlay!) for traditional extensions.
Jetpack Processes - Archive of obsolete content
these processes are relatively lightweight, do not have access to xpcom, and can innately do little other than compute.
Chapter 1: Introduction to Extensions - Archive of obsolete content
in addition to css and javascript, extensions can take advantage of xul and xpcom technologies for more sophisticated features.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
the role of each technology firefox is largely built using four technologies: xul, css, javascript, and xpcom.
Adding Events and Commands - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
Adding menus and submenus - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
Adding sidebars - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
Adding windows and dialogs - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
failure to do so can lead to execution or remote scripts, and in the worst cases to privilege escalation which can leave a user's pc open to remote attack.
Getting Started with Firefox Extensions - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
Local Storage - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
The Box Model - Archive of obsolete content
« previousnext » this tutorial was kindly donated to mozilla by appcoast.
Useful Mozilla Community Sites - Archive of obsolete content
« previous this tutorial was kindly donated to mozilla by appcoast.
Performance best practices in extensions - Archive of obsolete content
lazily load services the xpcomutils javascript module provides two methods for lazily loading things: definelazygetter() defines a function on a specified object that acts as a getter which will be created the first time it's used.
Setting up an extension development environment - Archive of obsolete content
chromebug combines elements of a javascript debugger and dom (firefox, "kinda works for thunderbird") mozrepl explore and modify firefox and other mozilla apps while they run (firefox, thunderbird version is not working) executejs an enhanced javascript console (firefox version, thunderbird version is not working) xpcomviewer an xpcom inspector (firefox and thunderbird) javascript shells to test snippets of javascript (firefox and thunderbird) sqlite manager to manage the sqlite database (firefox and thunderbird) viewabout enables access to various about: dialogs from the view menu (firefox version, thunderbird version ) crash me now!
Promises - Archive of obsolete content
this interface replaces the previous, complicated xpcom nsifile and streams apis, and their related javascript helper modules.
Using the Stylesheet Service - Archive of obsolete content
the examples in this document are all written in javascript using xpcom.
Add-ons - Archive of obsolete content
well, xul overlays and windows, jsm files, chrome & resource mappings with localization, default preferences, but no xpcom components of your own.
updateready - Archive of obsolete content
the updateready event is fired when the resources listed in the application cache manifest have been newly redownloaded, and the script can use swapcache() to switch to the new cache.
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
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 rpc mechanism or using interfaces like xmlhttprequest (currently offered in netscape 7 and internet explorer 6).
Blackwood - Archive of obsolete content
active subprojects webclient java dom api java pluglet api defunct subprojects blackconnect -- blackconnect was superseeded by javaxpcom ...
Developing New Mozilla Features - Archive of obsolete content
our cross-platform component model (“xpcom”) is similar to com, but you’ll want to make sure you use it well before going too far with your project.
Exception logging in JavaScript - Archive of obsolete content
any exceptions that are generated by xpconnect -- that is, those exceptions whose result codes are defined in nsixpconnect.idl -- are always logged into the error console.
Repackaging Firefox - Archive of obsolete content
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 powerpc or intel based.
Hidden prefs - Archive of obsolete content
the default (defined in mailnews.js) is: pref("mail.addr_book.mapit_url.format", "http://www.mapquest.com/maps/map.adp...st&zipcode=@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.
IO Guide/Directory Keys - Archive of obsolete content
the actual keys are: os and xpcom level xulrunner and co level ...
JavaScript crypto - Archive of obsolete content
the popchallengeresponse() function is not implemented.
Modularization techniques - Archive of obsolete content
xpcom uses these typelibraries to allow other languages, such as javascript, to implement and call xpcom objects.
Build - Archive of obsolete content
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-javaxpcom build xulrunner : make -f client.mk build once the build is done, there will be a directory called mozilla-obj.
Scripting - Archive of obsolete content
currently, the webapp script also has access to full xpcom functionality, just like a firefox extension.
Static Analysis for Windows Code under Linux - Archive of obsolete content
host_libidl_config=/usr/bin/libidl-config #config your moztools position glib_prefix=$home/moztools libidl_prefix=$home/moztools #disable xpcom stdcall calling convention because of gcc 4.3.0 bug cppflags="-dmoz_disable_xpcom_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.
Tamarin Releases - Archive of obsolete content
upcoming release name(s)release datelinks tc next~ april 2009roadmap current release namerelease datelinks tc "mar 2009" a5c9ed928c9603/27/09tamarin-devel announcement prior release name(s)release datelinks tc "feb 2009" a5c9ed928c9602/19/09tamarin-devel announcement tamarin-central rev 703:2cee46be9ce0 12/02/08tamarin-devel announcement ...
Tamarin Roadmap - Archive of obsolete content
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 powerpc 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
releases release tracking information on current, past, and upcoming releases of tamarin.
The life of an HTML HTTP request - Archive of obsolete content
necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsiprotocolhandler (in this case nshttphandler) and asks it for a nsichannel (nshttpchannel).
URIs and URLs - Archive of obsolete content
this is done by ns_escapeurl which is now part of xpcom, but started as part of necko.
Venkman Internals - Archive of obsolete content
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.
Venkman - Archive of obsolete content
venkman builds on the js/jsd portion of john's 1998 work, exposing it as an xpcom component.
When To Use ifdefs - Archive of obsolete content
for instance, xpcom, the spidermonkey javascript engine, and the networking engine do not know anything about xul and should not have any ifdefs based on --disable-xul.
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-rpc (no longer supported) userland software xml-rpc rdf w3c recommendations rdf svg w3c recommendation svg animation (smil) w3c recommendation mathml w3c recommendation mathml p3p (no longer supported) w3c recommendation p3p wsdl (...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
the stub installer calls some glue code: xpistub which resides at: < http://lxr.mozilla.org/seamonkey/sou...pinstall/stub/> this "glue" code initialized xpcom and registers the xpinstall engine and requisite components to prepare for use by the stub installer.
menuactive - Archive of obsolete content
typcially, the theme will use this to highlight the item.
popup.position - Archive of obsolete content
the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter.
Working With Directories - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Getting File Information - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Reading from Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Uploading and Downloading Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Writing to Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
IO - Archive of obsolete content
ArchiveMozillaXULFileGuideIO
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Moving, Copying and Deleting Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
TOC - Archive of obsolete content
ArchiveMozillaXULFileGuideTOC
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Node - Archive of obsolete content
ArchiveMozillaXULNode
summary this is a scriptable interface corresponding to the nsidomnode xpcom interface.
Positioning - Archive of obsolete content
topcenter the popup will be aligned with the center of the top edge the anchor.
appLocale - Archive of obsolete content
« xul reference applocale obsolete since gecko 1.9.1 type: nsilocale returns the xpcom object which holds information about the user's locale.
builder - Archive of obsolete content
« xul reference builder type: nsixultemplatebuilder for content generated from a template, this is the xpcom object that is responsible for generating the content.
stringBundle - Archive of obsolete content
« xul reference stringbundle type: nsistringbundle returns the xpcom string bundle object which implements nsistringbundle.
Notes - Archive of obsolete content
deleting the "(default)" values in the following registry keys will fix this: hkey_classes_root\http\shell\open\ddeexec hkey_classes_root\https\shell\open\ddeexec you can also do this from within your xpcom component using windows registry interface.
RDF Modifications - Archive of obsolete content
we'll find out how the builder determines where to insert the new content is an upcoming section.
Box Objects - Archive of obsolete content
next, we'll find out how to use xpcom objects from xul and scripts.
Install Scripts - Archive of obsolete content
you don't need to know much about it to create xul applications unless you are creating your own xpcom components.
Open and Save Dialogs - Archive of obsolete content
the xpcom interface nsifilepicker is used to implement a file picker.
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 xpcom interfaces xpcom 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
however, in this xpcom 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.
XML - Archive of obsolete content
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 xpcom, which also went into mozilla.
XUL controls - Archive of obsolete content
<tree> <treecols> <treecol label="name" flex="1"/> <treecol label="size" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="popcorn"/> <treecell label="large"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="root beer"/> <treecell label="small"/> </treerow> </treeitem> </treechildren> </tree> more information about the tree element.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
typcially, the theme will use this to highlight the item.
menupopup - Archive of obsolete content
the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter.
panel - Archive of obsolete content
ArchiveMozillaXULpanel
the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter.
scrollbox - Archive of obsolete content
do this instead: var xpcominterface =scrollbox_element.boxobject.queryinterface( components.interfaces.nsiscrollboxobject); xpcominterface.ensureelementisvisible(child_element_to_make_visible); see the nsiscrollboxobject api for other scroll-related methods.
tooltip - Archive of obsolete content
the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter.
XULRunner 2.0 Release Notes - Archive of obsolete content
xulrunner 1.9.2 and earlier versions had powerpc (ppc) and i386 architectures.
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
if you've never done this before, you should consult creating xpcom components or another xpcom reference.
Deploying XULRunner - Archive of obsolete content
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 xpcom." xulrunner was fixed in gecko 39.
How to enable locale switching in a XULRunner application - Archive of obsolete content
the dynamic list population requires an xpcom to query the currently selected locale as well as all locales available in the application package.
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/ xpcnativewrappers=no locale inspector en-us jar:inspector.jar!/locale/inspector/ skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/ skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/dom/popupoverlay.xul overlay chrome://inspect...
XULRunner - Archive of obsolete content
xulrunner is a mozilla runtime package that can be used to bootstrap xul+xpcom applications that are as rich as firefox and thunderbird.
XUL Explorer - Archive of obsolete content
support extension testing using firefox extension test mode venkman support dom inspector support future: support more “best practice” checks such as: more a11y checks, strings in dtds and so on - xul checker allow users to add snippets on the fly add sidebars for more functionality - property sidebar and project sidebar support wizards to generate common projects - xul files, js xpcom, and xulrunner applications for more detailed information, see the xul_explorer:planning#feature_planning_for_xul_explorer.
mozilla.dev.platform FAQ - Archive of obsolete content
0x00016b50 in xre_createappdata () a: when you <tt>--disable-libxul</tt>, the xpcom glue doesn't have information about how to load all the dependent libraries like <tt>libgfx.dylib</tt>.
2006-10-20 - Archive of obsolete content
a student learning xpcom is having issues with the method shouldload in the interface nslcontentpolicy.
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 upcoming thunderbird developer documentation and is looking for feedback as well as contributors.
2006-10-06 - Archive of obsolete content
../../dist/host/bin/host_xpidl -m header -w -i~mozilla/xpcom/base -i../../dist/idl -o _xpidlgen/nsiconsolelistener ~/mozilla/xpcom/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.
2006-11-03 - Archive of obsolete content
problem compiling with vs 2003 .net phil is trying to compile firefox for the first time and is getting an error when doing so: building deps for /cygdrive/c/mozilla/toolkit/airbag/airbag/src/common/windows/guid_string.cc make[1]: leaving directory `/cygdrive/c/mozilla/obj-i686-pc-cygwin' make: *** [build] error 2 he also noted that he is using make 3.80-1.
2006-11-10 - Archive of obsolete content
sions=default,spatialnavigation then he tried running "make" and received the following error: /usr/bin/ld: testtarray.o(.text+0x2237): unresolvable relocation against symbol `nstarray_base::semptyhdr' /usr/bin/ld: final link failed: nonrepresentable section on output collect2: ld returned 1 exit status gmake[3]: *** [testtarray] error 1 gmake[3]: leaving directory `/usr/mozilla2/src/mozilla/xpcom/tests' gmake[2]: *** [libs] error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla/xpcom' gmake[1]: *** [tier_2] error 2 gmake[1]: leaving directory `/usr/mozilla2/src/mozilla' make: *** [default] error 2 he is not sure what is wrong with his build, and is asking for help on how to resolve the build error.
2006-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 upcoming there are no open blockers left.
2006-11-10 - Archive of obsolete content
seamonkey 1.0.6 and 1.1 beta upcoming seamonkey 1.0.6 and 1.1 beta are both available here.
2006-11-3 - Archive of obsolete content
seamonkey 1.0.6 and 1.1 beta upcoming 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.
2006-10-27 - Archive of obsolete content
traffic status of xpcom cycle collector graydon hoare provides the xpcom patch which experiments with implementing a general-purpose garbage-cycle collector for xpcom.
2006-11-03 - Archive of obsolete content
john gaunt discusses a proposed xulrunner unit-tests like xpcshell.
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.platform - november 4th - november 10th, 2006 announcements no announcements this week traffic beaufour moves the discussion about xulrunner unit-tests like xpcshell from mozilla.dev.platform to mozilla.dev.quality.
2006-10-20 - Archive of obsolete content
discussions none for this week meetings upcoming firefox test day - testing will be emphasized on ajax/web 2.0, dhtml, and plugin heavy sites!
2006-10-27 - Archive of obsolete content
he recommends that a non-xpcshell environment is needed really badly, but the big issue is that the xpcshell doesn't have an event loop, so nothing asynchronous can be tested.
2006-11-10 - Archive of obsolete content
discussions xulrunner unit-tests like xpcshell - allan hacked the xpcshell-simple harness so it fits his needs.
2006-12-01 - Archive of obsolete content
discussions protocol security daniele rizzo posted a question as to whether or not it is possible to enable/disable the privilege of universalxpconnect in a 'entire' protocol (http://, file://).
2006-11-17 - Archive of obsolete content
the possibility of turning the microsummaryresource object into a xpcom component, which accomplishes this task in a "hacky" manner, was also discussed.
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - oct 21-27, 2006 announcements none during this week.
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - oct 04-nov 10, 2006 announcements xptcall changes in process - ports owners needed if you maintain an xptcall port, you are needed to submit a patch to that bug 349002 with xptcall updates.
2006-11-17 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - nov 11-nov 17, 2006 announcements none during this week.
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.tech.xpcom - nov 25- dec 01, 2006 announcements none during this week.
2006-11-17 - Archive of obsolete content
calendar xpcom component discussion about a debug error of additem function from calicalendar.
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-xpcommozilla-dev-tech-xul ...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
in the xpi you can use the following structure: platform/ linux_x86-gcc3/ plugins/ libplugin.so darwin_ppc-gcc3/ plugins/ libplugin.dylib more specific information can be found in the platform-specific subdirectories documentation.
Introduction to Public-Key Cryptography - Archive of obsolete content
ckzccazsgawibagibazanbgkqhkig9w0baqqfada3mqswcqydvqqgewjvuzer ma8ga1uechmitmv0c2nhcguxftatbgnvbastdfn1chjpewencybdqtaefw05nzew mtgwmtm2mjvafw05otewmtgwmtm2mjvamegxczajbgnvbaytalvtmrewdwydvqqk ewhozxrzy2fwztenmasga1uecxmeuhviczexmbuga1ueaxmou3vwcml5ysbtagv0 dhkwgz8wdqyjkozihvcnaqefbqadgy0amigjaogbamr6ezipgfjx3urjgejmkiqg 7sdatyazbcabu1avyd7chrkiq31fbxfogd3wnktbf6hro6eamm5/r1askzz8aw7l iqzbcrxpc0k4du+2q6xju2mpm/8wkumontuvzpo+sgxelmhvcheqoocwfdizywyz nmmrjgaoma2ms6pukfqvagmbaagjnja0mbegcwcgsagg+eibaqqeawiagdafbgnv hsmegdawgbty8gzzkbhhufwjm1oxeuzc+zymytanbgkqhkig9w0baqqfaaobgqbt i6/z07z635dfzx4xbafpjlrl/aywqztsyx8gfcnaqcqcwasdkvsuj/vwbf91o3j3 ukdgypcd2cyrcgki4mwqdwyltpuhah18hhz5uvi00mjyw8w2wuosy0rc/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...
Browser Detection and Cross Browser Support - Archive of obsolete content
ie5up, is_ie5_5, is_ie5_5up, is_ie6, is_ie6up, is_hotjava3, is_hotjava3up, is_opera2, is_opera3, is_opera4, is_opera5, is_opera5up javascript version number is_js (float indicating full javascript version number: 1, 1.1, 1.2 ...) os platform and version is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98, is_winme, is_win2k, is_os2, is_mac, is_mac68k, is_macppc, is_unix, is_sun, is_sun4, is_sun5, is_suni86, is_irix, is_irix5, is_irix6, is_hpux, is_hpux9, is_hpux10, is_aix, is_aix1, is_aix2, is_aix3, is_aix4, is_linux, is_sco, is_unixware, is_mpras, is_reliant, is_dec, is_sinix, is_freebsd, is_bsd, is_vms detecting browsers using this level of detail is unworkable, unmaintainable and violates the basic principles of web authoring!
ActiveXObject - Archive of obsolete content
you may be able to identify servername.typename values on a host pc in the hkey_classes_root registry key.
New in JavaScript 1.8 - Archive of obsolete content
when using the javascript shell, javascript xpcom components, or xul <script> elements, the latest js version (js1.8 in mozilla 1.9) is used automatically (bug 381031, bug 385159).
New in JavaScript - Archive of obsolete content
ecmascript next support implementation status for upcoming ecma-262 features as per the yearly (es2016/es2017/es2018/...) release schedule in mozilla-based engines and products.
Reference - Archive of obsolete content
in fx 1.0, js 1.2 is available, but not in the upcoming fx 1.5.
Building Mozilla XForms - Archive of obsolete content
ot developed any more last release: 0.8.5ff3 firefox 3.5 gecko 1.9.1 xforms/schema-validation code does not build with firefox 3.5 any more not supported firefox 3.6 gecko 1.9.2 xforms/schema-validation code does not build with firefox 3.6 any more not developed any more last release: 0.8.6 firefox 4 gecko 2.0 mercurial, repositories mozilla-central xforms schema-validation mostly works upcoming 0.8.7 release if you have your first working firefox build, you can go on with building the xforms extension.
RFE to the XForms API - Archive of obsolete content
ArchiveWebXFormsRFEXForms API
mozilla xforms doens't offer any service you can get via xpcom.
XForms Input Element - Archive of obsolete content
representations the xforms input element can be represented by the following widgets for the spcified 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.
Anatomy of a video game - Game development
these main methods attach themselves to window.requestanimationframe(), which asks the browser for control over the upcoming frame.
Index - Game development
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.
Introduction to game development for the Web - Game development
games built with html5 work on smartphones, tablets, pcs and smart tvs.
Building up a basic demo with PlayCanvas editor - Game development
as you can see, the file contains some boilerplate code already: pc.script.create('boxanimation', function (app) { // creates a new boxanimation instance var boxanimation = function (entity) { this.entity = entity; }; boxanimation.prototype = { // called once after all resources are loaded and before the first update initialize: function () { }, // called every frame, dt is time in seconds since last updat...
WebVR — Virtual Reality for the Web - Game development
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.
Implementing controls using the Gamepad API - Game development
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.
Plug-in Development Overview - Gecko Plugin API Reference
g() method called inside the script element: <object id="myplugin" type="audio/wav" data="music.wav"> </object> <script type="application/javascript"> var theplugin = document.getelementbyid('myplugin'); if (theplugin && theplugin.advancetonextsong) theplugin.advancetonextsong(); else alert("plugin not installed correctly"); </script> in the past, liveconnect and later xpconnect were used to make plug-ins scriptable.
Endianness - MDN Web Docs Glossary: Definitions of Web-related terms
also, older mac computers using 68000-series and powerpc microprocessors formerly used big-endian.
HTTP/3 - MDN Web Docs Glossary: Definitions of Web-related terms
http/3 is the upcoming major revision of the http network protocol, succeeding http/2.
Index - MDN Web Docs Glossary: Definitions of Web-related terms
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 upcoming 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.
Mozilla Firefox - MDN Web Docs Glossary: Definitions of Web-related terms
firefox uses gecko to render webpages, and implements both current and upcoming web standards.
Regular expression - MDN Web Docs Glossary: Definitions of Web-related terms
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).
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
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.
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('universalxpconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); ...
Assessment: Accessibility troubleshooting - Learn web development
don't worry — you'll be fixing these problems in the upcoming sections!
CSS values and units - Learn web development
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 1pc = 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.
Introduction to cross browser testing - Learn web development
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.
omni.ja (formerly omni.jar)
/components/ xpcom components the application relies upon.
Accessibility API cross-reference
the ipc 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.
Gecko info for Windows accessibility vendors
hresult get_attributesfornames( /* [in] */ unsigned short numattribs, /* [in] */ bstr __rpc_far *attribnames, /* [in] */ short __rpc_far *namespaceid, /* [out] */ bstr __rpc_far *attribvalues); the get_computedstyle method is used to find out the cumulative, computed results for all style rules applied to a node.
Links and Resources
the european union is looking to base their upcoming accessibility regulations on these guidelines.
Accessibility and Mozilla
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.
What to do and what not to do in Bugzilla
if the bug is present on linux and windows, change the fields to hardware = pc and os = all.
Command line options
other options need to be documented -print-xpcom-dir -print-xpcom-dirlist -kill -killall -f -ftimeout -fwait -unsetdefaultmail gtk options -no-deelevate (running windows as administrator with launcher process enabled causes drag and drop errors - how to fix) references chrome: command line test documentation for command-line features (mozilla.org) toolkit/xre/nsapprunner.cpp browser/components/nsbrowsercontenthandler.js suit...
Creating MozSearch plugins
wkio8ccroqu0dxqlwrdshuwzbaaigjmtnnpgya9j8uqhfelwpxf2mideirksn9fwsjorkaeeam0dd4dzmaypi%2fg%2bqky4hh5waxgf8pdq0fgwj22d27cjadaaiirlmjo%2bmxa9r2kahvgba2wwx6b8w7od6ceqcggkcmcel8bgwxycbuigtdvkhdbia%2bcuotgaccued3tdqn75d4xmavcok9armhbzaw0aecibhkalc0mdy7x9abna3obazxiaa6ikecglmvqhwwyjyul2d4v2cpg8vzswx7ghyaaak7aoif7saboqcmn4ha3ahfsidtgpq%2fvlz8p4mskj2w9h8ggbjevxvhdo4fquqg%2fkdypqcg4h8luiacnq%2fsobmyi8basajfpcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczxpcqxquzhaeccj4xgml493ug21zd%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
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.
Simple Instantbird build
building purplexpcom and libpurple first download the purplexpcom 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 .mozconfi...
ESLint
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/xpcshell-test" see other test directories for how to do this.
Listening to events on all tabs
in such cases, the request itself should be queried for extended error information (e.g., for http requests see nsihttpchannel).
Reviewer Checklist
if it's js, try to design and build so that xpcshell can exercise most functionality.
Working with Mozilla source code
interface development guide guidelines and documentation for how to create and update xpcom interfaces.
mach
if it works, you can look at compiler warnings: $ ./mach warnings-list try running the program: $ ./mach run try running your program in a debugger: $ ./mach run --debug try running some tests: $ ./mach xpcshell-test 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.
Cross Process Object Wrappers
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 ipc call instead of a simple property access in the same process.
Frame script environment
frame scripts run with system privileges and have access to the components object, enabling them to use xpcom objects and jsms.
Limitations of frame scripts
frame scripts run with system privileges and have access to the components object, enabling them to use xpcom objects and jsms.
Communicating with frame scripts
an xpcom component), you can access the window of the browser that sent the message with message.target.ownerdocument.defaultview.
Frame script environment
frame scripts run with system privileges and have access to the components object, enabling them to use xpcom objects and jsms.
Limitations of frame scripts
frame scripts run with system privileges and have access to the components object, enabling them to use xpcom objects and jsms.
Performance
} object.assign(contentypolicy.prototype, { classdescription: ..., classid: ..., contractid: ..., queryinterface: xpcomutils.generateqi([ci.nsicontentpolicy]), shouldload: function(type, location, origin, context) { let resultlist = services.cpmm.sendsyncmessage("my-addon:check-load", {destination: location, source: origin}) // <=== sync message!
Performance best practices for Firefox front-end engineers
use indexeddb for storage appcache and localstorage are synchronous storage apis that will block the main thread when you use them.
Firefox and the "about" protocol
ist of urls in the about: pseudo protocol: about: page description about:about provides an overview of all about: pages available for your current firefox version about:addons add-ons manager about:buildconfig displays the configuration and platform used to build firefox about:cache displays information about the memory, disk, and appcache about:checkerboard switches to the checkerboarding measurement page, which allows to detect checkerboarding issues about:config provides a way to inspect and change firefox preferences and settings about:compat lists overriding site compatability fixes, linked to specific bug issues.
mozbrowserscrollviewchange
apcz) starts or stops.
Embedding Mozilla
mailing list newsgroup rss feed #embedding irc channel related topics gecko, xpcom ...
Hacking with Bonsai
the build team will then pull the 8:00 am tree, and build it on a subset of the platforms, linux, win32 & macppc.
How Mozilla determines MIME Types
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 xpcom category is searched for the extension.
IME handling guide
mozilla::contentcache this is a base class of contentcacheinchild and contentcacheinparent and ipc-aware.
Implementing QueryInterface
some alternatives the ns_impl_query_interface[012] macros the sample above implements two xpcom interfaces in addition to nsisupports.
Assert.jsm
this report method only throws errors on assertion failures, as per spec, but consumers of this module (think: xpcshell-test, mochitest) may want to override this default implementation.
JavaScript OS.Constants
emfile too many open files in the process enametoolong name too long enfile too many open files on the system enoent no such file or directory enomem cannot allocate memory enospc no space on device enotdir is not a directory enxio device no configured or does not support operation eopnotsupp (not always available under windows) operation not supported.
OSFile.jsm
this api is intended to replace, in time, most xpcom-based manipulation of files (nsifile, subsets of nsiioservice, etc.) by javascript code.
PromiseWorker.jsm
there is no xpcom access, similar to chromeworker.
Bootstrapping a new locale
where active development of the upcoming release of firefox occurs) and then begin the necessary work for translation.
Uplifting a localization from Central to Aurora
the releases page on wikimo has the upcoming dates.
Updates
interview to the apc magazine where mitchell baker mentions roger sidje's work on mathml.
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 sunrpc 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
find and fix bad xpcom macro usage.
Mozilla external string guide
the only remaining string classes are the "internal" ones, which are documented xpcom guide internal strings.
JS::PerfMeasurement
perfmeasurement* js::extractperfmeasurement(jsval wrapper) if you are the c++ side of an xpcom 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.
Profiling with the Gecko Profiler and Local Symbols on Windows
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.
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_3pck=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
(this can be done by examining the unprocessed output of an xpcom_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.
Performance
related topics javascript, xpcom, developing mozilla, extensions, addons ...
Preferences
related topics xul, javascript, xpcom, extensions, developing mozilla ...
Crash reporting
reports and queries crash-stats has built-in reports of "topcrashes" for each release grouped by signature.
Emscripten
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.
About NSPR
the current implementation supports macintosh (ppc), win-32 (winnt, win9x) and 20 versions of unix and is still expanding.
NSPR build instructions
--target=x86_64-pc-mingw32 for 64-bit builds on windows, when using the mozillabuild environment.
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 xpcom hashtable guide ...
Named Shared Memory
the unix implementation may use sysv ipc shared memory, posix shared memory, or memory mapped files; the filename may be used to define the namespace.
PRUint64
notes note: prior to gecko 12.0, pruint64 was actually treated as a signed 64-bit integer by xpconnect.
PRUnichar
an unsigned 16-bit type, like char in java or the "characters" of a javascript string defined in /mozilla/xpcom/base/nscore.h.
PR_CloseSemaphore
syntax #include <pripcsem.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.
PR_DeleteSemaphore
syntax #include <pripcsem.h> nspr_api(prstatus) pr_deletesemaphore(const char *name); parameter the function has the following parameter: name the name of a semaphore that was previously created via a call to pr_opensemaphore.
PR_OpenSemaphore
syntax #include <pripcsem.h> #define pr_sem_create 0x1 /* create if not exist */ #define pr_sem_excl 0x2 /* fail if already exists */ nspr_api(prsem *) pr_opensemaphore( const char *name, printn flags, printn mode, pruintn value ); parameters the function has the following parameters: name the name to be given the semaphore.
PR_PostSemaphore
syntax #include <pripcsem.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.
PR_WaitSemaphore
syntax #include <pripcsem.h> nspr_api(prstatus) pr_waitsemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore.
Threads
these resources include a stack and the cpu registers (including pc).
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 ipc semaphores ipc semaphore functions thread pools thread pool types thread pool functions random number generator random number generator function hash tables hash tables and type constants hash table functions nspr error handling error type error functions error codes ...
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_lookupcrls 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
MozillaProjectsNSSJSSJSS 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/certrepcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/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
bug 455424: nssilckt.h defines the enumeration constant 'lock' bug 456036: stubs for deprecated functions in lib/certdb/stanpcertdb.c should set the pr_not_implemented_error error.
NSS 3.12.5 release_notes
bug 510435: remove unused make variable dso_ldflags bug 510436: add macros for build numbers (4th component of version number) to nssutil.h bug 511227: firefox 3.0.13 fails to compile on freebsd/powerpc bug 511312: nss fails to load softoken, looking for sqlite3.dll bug 511781: add new tls 1.2 cipher suites implemented in windows 7 to ssltap bug 516101: if pk11_importcert fails, it leaves the certificate undiscoverable by cert_pkixverifycert bug 518443: pk11_importandreturnprivatekey leaks an arena bug 518446: pk11_derencodepublickey leaks a certsubjectpublickeyinfo bug 518457: seckey_enco...
NSS 3.14.2 release notes
if compiled on linux systems in 64-bit mode, nss will include runtime detection to check if the platform supports aes-ni and pclmulqdq.
NSS 3.14 release notes
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_getsrtpcipher (in ssl.h) ssl_setrtpciphers (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.
NSS 3.17.1 release notes
added support for linux on little-endian powerpc64.
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.28 release notes
note that this detection has a one-off performance cost, which can be avoided by using the ssl_namedgroupconfig function, to limit supported groups to those that nss provides.
NSS 3.45 release notes
note: in 3.45 the sslchannelinfo is left unmodified, while an upcoming change in 3.46 will set sslchannelinfo.authkeybits to that of the delegated credential for better policy enforcement.
NSS 3.48 release notes
certificate authority changes the following ca certificates were added: bug 1591178 - entrust root certification authority - g4 cert sha-256 fingerprint: db3517d1f6732a2d5ab97c533ec70779ee3270a62fb4ac4238372460e6f01e88 upcoming changes in nss 3.49 the legacy dbm database, libnssdbm, will no longer be built by default.
NSS 3.49 release notes
bug 1606025 - remove -wmaybe-uninitialized warning in sslsnce.c bug 1606119 - fix ppc hw crypto build failure bug 1605545 - memory leak in pk11install_platform_generate bug 1602288 - fix build failure due to missing posix signal.h bug 1588714 - implement checkarmsupport for win64/aarch64 bug 1585189 - nss database uses 3des instead of aes to encrypt db entries bug 1603257 - fix ubsan issue in softoken ckm_nss_chacha20_ctr initialization bug 1590001 - additional hrr tests (cv...
NSS 3.50 release notes
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/powerpc* 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.
NSS 3.51 release notes
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 ppc __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.
NSS 3.52 release notes
bug 1629661 - mpconfig calls in ssl initialize policy before nss is initialized.
NSS Sample Code sample5
*/ #include "nss.h" #include "pk11pub.h" #define base64_encoded_subjectpublickeyinfo "mfwwdqyjkozihvcnaqebbqadswawsajbal3f6tic3jeysugo+a2fpu3w+epv/feix21dc86wynpftw4srftz2onuzyluzdhzdb+k//8dct3iaozuui3r2emcaweaaq==" #define base64_encoded_privatekeyinfo "miibvqibadanbgkqhkig9w0baqefaascat8wgge7ageaakeavcxpmhzckriy6cj5rz89tdb4sm/8v4hfbumlzpziekw1biysw3pag1tpittmmdl1v6t//x1xpcga7nrsldhz4widaqabakeajh8+4qncwcmgivnm6ytbpqt+k/jeoexg2bqhjojvnxn3fazgcefxvpuibcjvfaijs9ybcmozzrato0+k2hwnoqihaoc4nvbo8fqhzs4yxm1m86kml47fa9ui//oufbhladw1aiea2dbmixnsbokb+ohver69p0gnewlvcjc9bjdvfdlvslcciqcptv3vgyjv2vdwxqzqahc+yb4gigaqoqbcbmjd3lyflqiga+vtydunoqwtzwve4grf7izk2v5ccnhg3gr5rgwxn58cigccaforruksm66isg0iti04g9v/w+wmx91wjeeb+qbz" int main(int argc, char **argv) { secstatus rv;...
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
when nss needs to do anything with a private key, it calls the pcks #11 module that holds the key.
NSS tools : modutil
nspr supports these platforms: o aix (rs6000) o bsdi (x86) o freebsd (x86) o hpux (hppa1.1) o irix (mips) o linux (ppc, alpha, x86) o macos (powerpc) o ncr (x86) o nec (mips) o os2 (x86) o osf (alpha) o reliantunix (mips) o sco (x86) o solaris (sparc) o sony (mips) o sunos (sparc) o unixware (x86) o win16 (x86) o win95 (x86) o winnt (x86) for example: irix:6.2:mips sunos:5.5.1:sparc linux:2.0.32:x86 win95::x86 the module information is defined independently for each platform in the modulename...
NSS reference
validating certificates cert_verifycertnow cert_verifycert cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames manipulating certificates cert_dupcertificate cert_destroycertificate sec_deletepermcertificate __cert_closepermcertdb getting certificate information cert_findcertbyname cert_getcertnicknames cert_freenicknames cert_getdefaultcertdb nss_findcertkeatype comparing secitem objects secitem_compareitem key functions key ...
OLD SSL Reference
validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cmpcertchainwcanames manipulating certificates cert_dupcertificate cert_destroycertificate getting certificate information cert_findcertbyname cert_getcertnicknames cert_freenicknames cert_getdefaultcertdb ...
gtstd.html
in addition, you must use the following compiler flags: solaris flags: -c -o -kpic -dsvr4 -dsysv -d__svr4 -d__svr4__ -dsolaris -d_reentrant -dsolaris2_5 -d_svid_gettod -dxp_unix -udebug -dndebug windows nt flags: -c -o2 -md -w3 -nologo -d_x86_ -gt -dwinnt -dxp_pc -udebug -u_debug -dndebug -dwin32 -d_windows ...
sslintro.html
numerous functions provided by the nss libraries are useful for such application callback functions, including these: cert_checkcertvalidtimes cert_getdefaultcertdb cert_destroycertificate cert_dupcertificate cert_findcertbyname cert_freenicknames cert_getcertnicknames cert_verifycertname cert_verifycertnow pk11_findcertfromnickname pk11_findkeybyanycert pk11_setpasswordfunc pl_strcpy pl_strdup pl_strfree pl_strlen ssl_peercertificate ssl_revealurl ssl_revealpinarg cleanup this portion of an ssl-enabled application consists primarily of closing the socket ...
NSS Tools modutil
the following system names and platforms are currently defined by nspr: aix (rs6000) bsdi (x86) freebsd (x86) hpux (hppa1.1) irix (mips) linux (ppc, alpha, x86) macos (powerpc) 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.
NSS Tools pk12util-tasks
use nss functions in pcertdb for handling older database ...
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
nspr supports these platforms: o aix (rs6000) o bsdi (x86) o freebsd (x86) o hpux (hppa1.1) o irix (mips) o linux (ppc, alpha, x86) o macos (powerpc) o ncr (x86) o nec (mips) o os2 (x86) o osf (alpha) o reliantunix (mips) o sco (x86) o solaris (sparc) o sony (mips) o sunos (sparc) o unixware (x86) o win16 (x86) o win95 (x86) o winnt (x86) for example: irix:6.2:mips sunos:5.5.1:sparc linux:2.0.32:x86 win95::x86 the mod...
Necko Architecture
dependencies necko requires the following libraries for linking: nspr xpcom original document information author(s): jud valeski last updated date: november 8, 1999 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Necko FAQ
currently you'd need to get the mozilla tree and at least build nspr, and xpcom.
Installing Pork
$ 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
​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 xpconnect security membranes ...
Index
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 opcodes.h by make_opcode_doc.py.
Bytecodes
bytecode listing all opcodes are annotated with a [-popcount, +pushcount] to represent the overall stack-effects their execution.
JS::AutoVectorRooter
t popcopy() pops an element from the array and returns it.
SpiderMonkey 45
newfunctionbyid js_bindcallable js_decompilefunctionbody js_getlatin1internedstringchars js_gettwobyteinternedstringchars js_newdateobjectmsec js_cleardatecaches changed apis js_init has moved from jsapi.h to js/initialization.h js_shutdown has moved from jsapi.h to js/initialization.h js_initreflect is now implicit js_addweakpointercallback is replaced with js_addweakpointerzonegroupcallback and js_addweakpointercompartmentcallback js_removeweakpointercallback is replaced with js_removeweakpointerzonegroupcallback and js_removeweakpointercompartmentcallback api changes javascript shell changes detail added/removed methods here...
WebReplayRoadmap
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 ipc should work pretty efficiently.
Using the Places keywords API
using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.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.
Preferences API
interfaces the preferences api is exposed as a set of xpcom components and interfaces: nsiprefservice, nsiprefbranch.
extIExtension
implemented via xpcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
extIPreferenceBranch
implemented via xpcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
extISessionStorage
implemented via xpcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
XML Extras
the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/xpcom users.
Resources
weblock resources weblock installer and information the sdk download linux: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-i686-pc-linux-gnu-1.4a.tar.gz windows: http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-win32-1.4a.zip other mozilla downloads gecko resources internal string guide external string guide the gecko networking library ("necko") the netscape portable runtime environment embedding mozilla current module owners xpinstall xul xpcom resources the xpcom project page xulplanet's online xpcom reference information on xpconnect and script...
mozilla::services namespace
the services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.
Components.classesByID
each property represents one of the classes of xpcom components that can be constructed or accessed as an xpcom service.
Components.utils.Sandbox
in situations where only unidirectional protection is needed, callers have the option to waive the x-ray behavior using wrappedjsobject or xpcnativewrapper.unwrap().
Components.utils.unload
see bug 769253 see also bug 481603 the documentation in xpccomponents.idl the tests in js/xpconnect/tests/unit/ ...
Other Resources
other resources embedding mozilla xpconnect - javascript-xpcom bridge blackconnect - java-xpcom bridge (no longer supported) xpidl to java types - from blackconnect ...
appShellService
then again, there's a much easier way; one of the xpcshell extensions is a quit function: quit(3) ...
nsIRegistry
perhaps if we quit with the xpconnect:appshellservice, it will work.
Monitoring HTTP activity
// define a reference to the interfacevar nsihttpactivityobserver = components.interfaces.nsihttpactivityobserver; var httpobserver = { observeactivity: function(ahttpchannel, aactivitytype, aactivitysubtype, atimestamp, aextrasizedata, aextrastringdata) { if (aactivitytype == nsihttpactivityobserver.activity_type_http_transaction) { switch(aactivitysubtype) { case nsihttpactivityobserver.activity_subtype_response_header: // received response header break; case nsihttpactivityobserver.activity_subtype...
nsresult
« xpcom api reference the nsresult data type is a strongly-typed enum used to represent a value returned by an xpcom function; these are typically error or status codes.
Append
« xpcom api reference summary the append family of functions appends a value to the end of a string's internal buffer.
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
BeginReading
« xpcom api reference summary the beginreading function returns a const pointer to the first element of the string's internal buffer.
Cut
« xpcom api reference summary the cut function removes a section of the string's internal buffer.
EndReading
« xpcom api reference summary the endreading function returns a const char_type pointer to the element just beyond the last element of the string's internal buffer.
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer.
Length
« xpcom api reference summary the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
operator=
« xpcom api reference summary this operator is a shortcut for the assign family of functions.
operator+=
« xpcom api reference summary this operator+= is a shortcut for the append family of functions.
Append
« xpcom api reference summary the append family of functions appends a value to the end of a string's internal buffer.
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
BeginReading
« xpcom api reference summary the beginreading function returns a const pointer to the first element of the string's internal buffer.
Cut
« xpcom api reference summary the cut function removes a section of the string's internal buffer.
EndReading
« xpcom api reference summary the endreading function returns a const char_type pointer to the element just beyond the last element of the string's internal buffer.
Insert
« xpcom api reference summary the insert family of functions inserts a value into a string's internal buffer.
Length
« xpcom api reference summary the length function returns the number of storage units in the string's internal buffer (not including the null-terminator if present).
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
operator=
« xpcom api reference summary this operator= is a shortcut for the append family of functions.
operator+=
« xpcom api reference summary this operator+= is a shortcut for the append family of functions.
nsAutoRef
nsautoref is defined in xpcom/base/nsautoref.h.
nsAutoRefTraits
terreftraits<prfiledesc> { public: static void release(prfiledesc *ptr) { pr_close(ptr); } }; or ns_specialize_template class nsautoreftraits<fcpattern> : public nspointerreftraits<fcpattern> { public: static void release(fcpattern *ptr) { fcpatterndestroy(ptr); } static void addref(fcpattern *ptr) { fcpatternreference(ptr); } }; nsautoreftraits is described in xpcom/base/nsautoref.h.
nsCStringEncoding
« xpcom api reference summary the nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.
nsCountedRef
nscountedref<t> is defined in xpcom/base/nsautoref.h.
get
« xpcom api reference summary the get function returns a const pointer to the string's null-terminated, internal buffer.
nsEmbedCString
« xpcom api reference summary constructors for nsembedcstring.
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsacstring::assign family of functions.
get
« xpcom api reference summary the get function returns a const pointer to the string's null-terminated, internal buffer.
nsEmbedString
« xpcom api reference summary constructors for nsembedstring.
operator=
« xpcom api reference summary this operator is a shortcut for the inherited nsastring::assign family of functions.
Alloc
« xpcom api reference summary the alloc function allocates a block of memory of a particular size.
Clone
« xpcom api reference summary the clone function creates a copy of an existing memory block up to the size specified.
Free
« xpcom api reference summary the free function frees a block of memory that was allocated by xpcom's memory manager.
GetGlobalMemoryService
« xpcom api reference summary the getglobalmemoryservice function returns a reference to xpcom's global nsimemory object.
HeapMinimize
« xpcom api reference summary the heapminimize function attempts to shrink the size of the heap.
Realloc
« xpcom api reference summary the realloc function reallocates a block of memory to a new size.
IDispatch
js/src/xpconnect/idl/xpcidispatch.idlscriptable this interface is not to be used directly, it is to be used internally for xpconnect's idispatch support.
mozIJSSubScriptLoader
js/xpconnect/idl/mozijssubscriptloader.idlscriptable this interface can be used from privileged javascript to load and run javascript code from the given url at runtime.
mozIStorageStatementWrapper
you can then wrap that statement with a wrapper, which implements nsixpcscriptable and provides scriptable helpers letting you execute the statement as a function, access bind variables by name as properties, etc.
mozIThirdPartyUtil
this is done as follows: if achannel is an nsihttpchannel and has the 'forceallowthirdpartycookie' property set, then: if auri is null, return false.
nsIAbCard
cellularnumber astring workphonetype astring homephonetype astring faxnumbertype astring pagernumbertype astring cellularnumbertype astring homeaddress astring homeaddress2 astring homecity astring homestate astring homezipcode astring homecountry astring workaddress astring workaddress2 astring workcity astring workstate astring workzipcode astring workcountry astring jobtitle astring department astring company astring aimscreenname...
nsIAccelerometerUpdate
xpcom/system/nsiaccelerometer.idlnot scriptable replaced by nsidevicemotionupdate 1.0 66 introduced gecko 2.0 obsolete gecko 6.0 inherits from: nsiaccelerometer last changed in gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2) this method is only used in content tabs to receive nsiacceleration data from the chrome process.
innerHTML
for the xpcom interface attribute, see nsiaccessnode.attributes.
nsIAccessibleEvent
event_create 0x8000 event_destroy 0x8001 event_descriptionchange 0x800d event_parentchange 0x800f event_helpchange 0x8010 event_defactionchange 0x8011 event_acceleratorchange 0x8012 event_menustart 0x0004 event_menuend 0x0005 event_menupopupstart 0x0006 event_menupopupend 0x0007 event_capturestart 0x0008 event_captureend 0x0009 event_movesizestart 0x000a event_movesizeend 0x000b event_contexthelpstart 0x000c event_contexthelpend 0x00...
nsIAlertsService
used for ipc security checks, and to determine whether the alert is actionable.
nsIArray
xpcom/ds/nsiarray.idlscriptable this interface implements an array object.
nsIAsyncInputStream
xpcom/io/nsiasyncinputstream.idlscriptable please add a summary to this article.
nsIAsyncOutputStream
xpcom/io/nsiasyncoutputstream.idlscriptable please add a summary to this article.
nsIBinaryInputStream
xpcom/io/nsibinaryinputstream.idlscriptable this interface allows consumption of primitive data types from a "binary stream" containing untagged, big-endian binary data, that is as produced by an implementation of nsibinaryoutputstream.
nsIBinaryOutputStream
xpcom/io/nsibinaryoutputstream.idlscriptable this interface allows writing of primitive data types (integers, floating-point values, booleans, and so on.) to a stream in a binary, untagged, fixed-endianness format.
nsIBlocklistPrompt
xpcom/system/nsiblocklistservice.idlscriptable this interface is used, if available, by the default implementation of nsiblocklistservice to display a confirmation user interface to the user before blocking extensions or plugins.
nsIBlocklistService
xpcom/system/nsiblocklistservice.idlscriptable please add a summary to this article.
nsICategoryManager
xpcom/components/nsicategorymanager.idlscriptable this interface provides access to a data structure that holds a list of name-value pairs, called categories, where each value is a list of strings.
nsIChannelEventSink
see also nsichannel nsihttpchannel ...
nsICollection
xpcom/ds/nsicollection.idlscriptable this interface represents a list of nsisupports items.
nsIComponentManager
xpcom/components/nsicomponentmanager.idlscriptable this interface provides methods to access factory objects and instantiate instances of classes.
nsIConsoleListener
xpcom/base/nsiconsolelistener.idlscriptable this interface allows you to listen for messages sent to the console.
nsIConsoleMessage
xpcom/base/nsiconsolemessage.idlscriptable this interface is a base interface for messages passed to or from the nsiconsoleservice.
nsIConsoleService
xpcom/base/nsiconsoleservice.idlscriptable the console service is the back-end for the error console, bundled with every mozilla application, and for firefox's web console and browser console.
nsIConverterInputStream
xpcom/io/nsiconverterinputstream.idlscriptable a unichar input stream that wraps an input stream.
nsIConverterOutputStream
xpcom/io/nsiconverteroutputstream.idlscriptable this interface allows writing strings to a stream, doing automatic character encoding conversion.
nsICrashReporter
xpcom/system/nsicrashreporter.idlscriptable provides access to crash reporting functionality.
nsICycleCollectorListener
xpcom/base/nsicyclecollectorlistener.idlscriptable interface to pass to the cycle collector to get information about the cycle collector graph while it is being built.
nsIDeviceMotion
xpcom/system/nsidevicemotion.idlscriptable this interface is used to implement accelerometer support.
nsIDeviceMotionData
xpcom/system/nsidevicemotion.idlscriptable this interface provides information about device motion.
nsIDeviceMotionListener
xpcom/system/nsidevicemotion.idlscriptable this interface can be implemented by clients that want to be notified orientation or acceleration changes on supported devices.
nsIDictionary
extensions/xml-rpc/idl/nsidictionary.idlscriptable a simple mutable table of objects, maintained as key/value pairs.
nsIDirectoryEnumerator
xpcom/io/nsidirectoryenumerator.idlscriptable this interface provides a means for enumerating the contents of a directory.
nsIDirectoryIterator
xpcom/obsolete/nsifilespec.idlscriptable please add a summary to this article.
nsIDirectoryServiceProvider
xpcom/io/nsidirectoryservice.idlscriptable this interface is used by the directory service to get file locations.
getFiles
« xpcom api reference summary this method is called by the directory service to query an enumeration of file or directory locations.
nsIDispatchSupport
js/src/xpconnect/idl/nsidispatchsupport.idlnot scriptable please add a summary to this article.
nsIEnvironment
xpcom/threads/nsienvironment.idlscriptable scriptable access to the current process environment.
nsIEventListenerService
to create an instance, use: var eventlistenerservice = components.classes["@mozilla.org/eventlistenerservice;1"] .getservice(components.interfaces.nsieventlistenerservice); universalxpconnect privileges are required to use this service.
nsIEventTarget
xpcom/threads/nsieventtarget.idlscriptable a target for events.
nsIException
xpcom/base/nsiexception.idlscriptable please add a summary to this article.
nsIFactory
xpcom/components/nsifactory.idlscriptable this interface is a class factory that allows for the creation of nsisupports derived classes without specifying a concrete class type.
nsIFileSpec
declared in xpcom/obsolete/nsifilespec.idl don't use this interface.
nsIGSettingsCollection
xpcom/system/nsigsettingsservice.idlscriptable please add a summary to this article.
nsIGSettingsService
xpcom/system/nsigsettingsservice.idlscriptable please add a summary to this article.
nsIGeolocationProvider
xpcom/system/nsigeolocationprovider.idlscriptable notify the geolocation service that a new geolocation has been discovered.
nsIGeolocationUpdate
xpcom/system/nsigeolocationprovider.idlscriptable provides a way for a geolocation provider to notify the system that a new location is available.
nsIHapticFeedback
xpcom/system/nsihapticfeedback.idlscriptable implemented to provide support for haptic feedback (that is, vibration support).
nsIInProcessContentFrameMessageManager
1.0 66 introduced gecko 2.0 inherits from: nsicontentframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsicontent getownercontent(); violates the xpcom interface guidelines methods violates the xpcom interface guidelines getownercontent() nsicontent getownercontent(); parameters none.
nsIInputStream
xpcom/io/nsiinputstream.idlscriptable this interface represents a readable stream of data.
nsIInputStreamCallback
xpcom/io/nsiasyncinputstream.idlscriptable this is a companion interface for nsiasyncinputstream.asyncwait().
nsIInterfaceRequestor
xpcom/base/nsiinterfacerequestor.idlscriptable this interface defines a generic interface for requesting interfaces that a given object might provide access to.
nsIJSCID
js/src/xpconnect/idl/xpcjsid.idlscriptable this interface provides methods to instantiate a component and access service components.
nsIJSIID
« xpcom api reference summary [scriptable, uuid(e08dcda0-d651-11d2-9843-006008962422)] interface nsijsiid : nsijsid {}; ...
nsILocalFile
xpcom/io/nsilocalfile.idlscriptable this interface adds methods to nsifile that are particular to a file that is accessible via the local file system.
nsIMemoryMultiReporter
xpcom/base/nsimemoryreporter.idlscriptable reports multiple memory measurements using a callback function that gets called once for each measurement.
nsIMemoryMultiReporterCallback
xpcom/base/nsimemoryreporter.idlscriptable implement this interface to handle callbacks from nsimemorymultireporter instances.
nsIMemoryReporter
xpcom/base/nsimemoryreporter.idlscriptable reports memory usage information for a single area of the software.
nsIMemoryReporterManager
xpcom/base/nsimemoryreporter.idlscriptable a service that provides methods for managing nsimemoryreporter objects.
nsIMimeConverter
this should only be used by native code, as xpconnect translation causes it to not work properly.
nsIMsgAccountManagerExtension
an account manager extension is a xpcom compontent implementing this interface.
nsIMsgCompFields
« xpcom api reference summary the nsimsgcompfields interface provides properties for an composition of an outgoing message.
nsIMsgDBView
the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other xpcom based mail cients.
nsIMsgFilterCustomAction
call onstopcopy when done * using the copylistener to continue.
nsIMsgSearchSession
opcontains value value e.g.
nsIMsgWindow
for some reason xpconnect is still hanging onto the message window even though all of our objects have let go of it.
nsIMutableArray
xpcom/ds/nsimutablearray.idlscriptable this interface is a subclass of nsiarray that provides arrays that are mutable; that is, they can be altered programmatically.
nsIOutputStream
xpcom/io/nsioutputstream.idlscriptable an interface describing a writable stream of data.
nsIOutputStreamCallback
xpcom/io/nsiasyncoutputstream.idlscriptable this is a companion interface for nsiasyncoutputstream.asyncwait.
nsIPipe
xpcom/io/nsipipe.idlscriptable this interface represents an in-process buffer that can be read using nsiinputstream and written using nsioutputstream.
nsIPrefBranch2
the nsprefbranch object listens for xpcom-shutdown and frees all of the objects currently in its observer list.
nsIProcess
xpcom/threads/nsiprocess.idlscriptable this interface represents an executable process.
nsIProcess2
xpcom/threads/nsiprocess.idlscriptable this interface represents an executable process.
nsIProgrammingLanguage
xpcom/base/nsiprogramminglanguage.idlscriptable this interface provides an enumeration of programming language identifiers.
nsIProperty
xpcom/ds/nsiproperty.idlscriptable please add a summary to this article.
nsIPropertyBag2
xpcom/ds/nsipropertybag2.idlscriptable this interface extends nsipropertybag with some methods for getting properties in specific formats.
nsIPropertyElement
xpcom/ds/nsipersistentproperties2.idlscriptable this interface provides access to individual entries within a stringbundle.
nsIProtocolProxyService
all filters will be automatically unregistered at xpcom shutdown.
nsIPushService
} ); receiving push messages subscriptions created from privileged code use xpcom observer notifications instead of service worker events.
nsIScriptError2
js/src/xpconnect/idl/nsiscripterror.idlscriptable represents javascript errors and warnings for use by the console service; augments nsiscripterror by adding a way to initialize the error with the window id of the outer window with which the error is associated.
nsIScriptableInputStream
xpcom/io/nsiscriptableinputstream.idlscriptable this interface provides scriptable access to a nsiinputstream instance.
nsISeekableStream
xpcom/io/nsiseekablestream.idlscriptable provides seeking support in data streams.
nsISimpleEnumerator
xpcom/ds/nsisimpleenumerator.idlscriptable this interface represents an enumeration of xpcom objects and provides methods to access elements sequentially.
nsISocketTransport
nsitransporteventsink status codes note: although these constants look like xpcom error codes and are passed in an nsresult variable, they are not error codes.
nsIStackFrame
xpcom/base/nsiexception.idlscriptable please add a summary to this article.
nsIStringEnumerator
xpcom/ds/nsistringenumerator.idlscriptable please add a summary to this article.
nsISupportsCString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for ascii character strings.
nsISupportsChar
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for single character values (often used to store an ascii character).
nsISupportsDouble
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for double-precision floating-point values.
nsISupportsFloat
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for single-precision floating-point values.
nsISupportsID
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for boolean values.
nsISupportsInterfacePointer
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for xpcom objects.
nsISupportsPRBool
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for boolean values.
nsISupportsPRInt16
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 16-bit signed integers.
nsISupportsPRInt32
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 32-bit signed integers.
nsISupportsPRInt64
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 64-bit signed integers.
nsISupportsPRTime
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for prtime values.
nsISupportsPRUint16
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 16-bit unsigned integers.
nsISupportsPRUint32
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 32-bit unsigned integers.
nsISupportsPRUint64
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 64-bit unsigned integers.
nsISupportsPRUint8
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for 8-bit unsigned integers.
nsISupportsPrimitive
xpcom/ds/nsisupportsprimitives.idlscriptable this interface serves as a base interface for all of the nsisupports* family of interfaces.
nsISupportsPriority
xpcom/threads/nsisupportspriority.idlscriptable this interface exposes the general notion of a scheduled object with an integral priority value.
nsISupportsString
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for unicode character strings.
nsISupportsVoid
xpcom/ds/nsisupportsprimitives.idlscriptable this interface provides scriptable access for generic pointers.
nsIThread
xpcom/threads/nsithread.idlscriptable please add a summary to this article.
nsIThreadManager
xpcom/threads/nsithreadmanager.idlscriptable please add a summary to this article.
nsIThreadObserver
xpcom/threads/nsithreadinternal.idlscriptable please add a summary to this article.
nsIThreadPool
xpcom/threads/nsithreadpool.idlscriptable the nsithreadpool interface provides support for thread pools.
nsIThreadPoolListener
xpcom/threads/nsithreadpool.idlscriptable please add a summary to this article.
nsITimer
xpcom/threads/nsitimer.idlscriptable please add a summary to this article.
nsITimerCallback
xpcom/threads/nsitimer.idlscriptable defines the callback interface for nsitimer events.
nsIUTF8StringEnumerator
xpcom/ds/nsistringenumerator.idlscriptable an object can implement this interface to allow a client to iterate over a set of strings provided by the object.
nsIUUIDGenerator
xpcom/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.
nsIUpdateTimerManager
in order to avoid having to instantiate a component to call the registertimer() method, the component can instead register an update-timer category with comma-separated values as a single string representing the timer, like this: _xpcom_categories: [{ category: "update-timer", value: "contractid," + "method," + "id," + "preference," + "interval" }], this allows you to schedule the timer without actually having to instantiate the component; instead, the component is instantiated when th...
nsIWebNavigationInfo
this is not the value returned for "xpcom plug-ins".
nsIWinTaskbar
example netscape.security.privilegemanager.enableprivilege("universalxpconnect"); var taskbar = components.classes["@mozilla.org/windows-taskbar;1"].getservice(components.interfaces.nsiwintaskbar); // get the docshell for the browser var navigator2 = top.queryinterface(components.interfaces.nsiinterfacerequestor).getinterface(components.interfaces.nsiwebnavigation); var docshell = navigator2.queryinterface(components.interfaces.nsidocshell); // get the parent docsh...
nsIWindowsRegKey
xpcom/ds/nsiwindowsregkey.idlscriptable this interface is designed to provide scriptable access to the windows registry system.
nsIWritablePropertyBag
xpcom/ds/nsiwritablepropertybag.idlscriptable please add a summary to this article.
nsIWritablePropertyBag2
xpcom/ds/nsiwritablepropertybag2.idlscriptable this interface extends nsipropertybag2 with methods for setting properties.
nsIXMLHttpRequest
when using the xpcom interface, as seen below in example 2, we can get access to this.
nsIXULAppInfo
xpcom/system/nsixulappinfo.idlscriptable this interface provides information about the host application.
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" xpcwrappednative_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/xpcom_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
the behavior of an assertion failure can be controlled using the xpcom_debug_break environment variable.
NS_ENSURE_ARG_POINTER
refer to xpcom/glue/nsdebug.h for details.
NS_CStringAppendData
« xpcom api reference summary the ns_cstringappenddata function appends data to the existing value of a nsacstring instance.
NS_CStringCloneData
« xpcom api reference summary the ns_cstringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.
NS_CStringContainerFinish
« xpcom api reference summary the ns_cstringcontainerfinish function releases any memory allocated by a nscstringcontainer instance.
NS_CStringContainerInit
« xpcom api reference summary the ns_cstringcontainerinit function initializes a nscstringcontainer instance for use as a nsacstring.
NS_CStringCopy
« xpcom api reference summary the ns_cstringcopy function copies the value from one nsacstring instance to another.
NS_CStringCutData
« xpcom api reference summary the ns_cstringcutdata function removes a section of the string's internal buffer.
NS_CStringGetData
« xpcom api reference summary the ns_cstringgetdata function gives the caller read access to the string's internal buffer.
NS_CStringGetMutableData
« xpcom api reference summary the ns_cstringgetmutabledata function gives the caller write access to the string's internal buffer.
NS_CStringInsertData
« xpcom api reference summary the ns_cstringinsertdata function appends data to the existing value of a nsacstring instance.
NS_CStringSetData
« xpcom api reference summary the ns_cstringsetdata function copies data into the string's internal buffer.
NS_CStringSetDataRange
« xpcom api reference summary the ns_cstringsetdatarange function copies data into a section of the string's internal buffer.
NS_CStringToUTF16
« xpcom api reference summary the ns_cstringtoutf16 function converts the value of a nsacstring instance to utf-16 and stores the result in a nsastring instance.
NS_StringAppendData
« xpcom api reference summary the ns_stringappenddata function appends data to the existing value of a nsastring instance.
NS_StringCloneData
« xpcom api reference summary the ns_stringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.
NS_StringContainerFinish
« xpcom api reference summary the ns_stringcontainerfinish function releases any memory allocated by a nsstringcontainer instance.
NS_StringContainerInit
« xpcom api reference summary the ns_stringcontainerinit function initializes a nsstringcontainer instance for use as a nsastring.
NS_StringCopy
removed by bug 1332639 « xpcom api reference summary the ns_stringcopy function copies the value from one nsastring instance to another.
NS_StringCutData
« xpcom api reference summary the ns_stringcutdata function removes a section of the string's internal buffer.
NS_StringGetData
« xpcom api reference summary the ns_stringgetdata function gives the caller access to the string's internal buffer.
NS_StringInsertData
« xpcom api reference summary the ns_stringinsertdata function appends data to the existing value of a nsacstring instance.
NS_StringSetData
« xpcom api reference summary the ns_stringsetdata function copies data into the string's internal buffer.
NS_StringSetDataRange
« xpcom api reference summary the ns_stringsetdatarange function copies data into a section of the string's internal buffer.
NS_UTF16ToCString
« xpcom api reference summary the ns_utf16tocstring function converts the value of a nsastring instance from utf-16 to the specified multi-byte encoding and stores the result in a nsacstring instance.
Storage
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 xpcom storage utility for use by extensions).
Using nsCOMPtr
you'll have to turn to the xpcom newsgroup or another experienced nscomptr user, or find the answer by experimentation.
Using nsIClassInfo
nsiclassinfo is good for other things too, but they're dark xpcom magic.
already_AddRefed
« xpcom api reference already_addrefed in association with nscomptr allows you to assign in a pointer without addrefing it.
nsCOMPtr versus RefPtr
however, when the destination type is an xpcom 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 pyxpidl tool suite has been built to replace the older xpidl tool which, in the past, was used to turn xpidl files into c++ headers and xpcom typelibs (xpt files).
XTF
MozillaTechXTF
the extensible tag framework (xtf) allows adding support for new namespaces using xpcom components to mozilla (written in javascript or c++).
Creating a gloda message query
an nsimsgdbhdr is the low-level, old-school, thunderbird xpcom representation of a message.
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 workzipcode postalcode workzipcode zip workcountry countryname jobtitle title department ou department orgunit department department department departmentnumber company o company company workcountry countryname _aimscreenname nscpaimscreenname webpage1 workurl ...
Message Interfaces
nsimsgdbview nsimsgdbview - the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other xpcom based mail cients.
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, xpcom, themes, developing mozilla categori ...
libmime content type handlers
ype) = 0; ns_imethod createcontenttypehandlerclass(const char *content_type, contenttypehandlerinitstruct *initstruct, mimeobjectclass **objclass) = 0; }; #endif /* nsimimecontenttypehandler_h_ */ plugin installation/location the installation of these modules will be similar to the that of any xpcom component (i.e.
Using Mozilla code in other projects
xulrunner a mozilla runtime package that can be used to bootstrap xul and xpcom applications with ease.
Using js-ctypes
we see that it needs to be defined like this: int winapi messagebox( _in_opt_ hwnd hwnd, _in_opt_ lpctstr lptext, _in_opt_ lpctstr lpcaption, _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.
Drawing and Event Handling - Plugins
for unix, the values are either the current display (npnvxdisplay) or the application's context (npnvxtappcontext).
Initialization and Destruction - Plugins
plug-ins are native code libraries: .dll files on windows, .so or .dso files on unix, and powerpc shared library files or 68k code resources on mac os.
Plug-in Basics - Plugins
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: ppc/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.
Plug-in Development Overview - Plugins
g() method called inside the script element: <object id="myplugin" type="audio/wav" data="music.wav"> </object> <script type="application/javascript"> var theplugin = document.getelementbyid('myplugin'); if (theplugin && theplugin.advancetonextsong) theplugin.advancetonextsong(); else alert("plugin not installed correctly"); </script> in the past, liveconnect and later xpconnect were used to make plug-ins scriptable.
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 npclass « 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 npclass structures npanycallbackstruct npbyterange npembedprint npevent npfullprint npp np_port npprint npprintcallbackstruct nprect npregion npsaveddata npsetwindowcallbackstruct npstream npwindow constants error codes result codes plug-in version constants version feature constants external resources external projects and articles for plugin creation original...
Debugger.Memory - Firefox Developer Tools
sery” “evict_nursery” “full_store_buffer” “shared_memory_limit” “periodic_full_gc” “incremental_too_slow” “dom_window_utils” “component_utils” “mem_pressure” “cc_waiting” “cc_forced” “load_end” “page_hide” “nsjscontext_destroy” “set_new_document” “set_doc_shell” “dom_utils” “dom_ipc” “dom_worker” “inter_slice_gc” “refresh_frame” “full_gc_timer” “shutdown_cc” “user_inactive” nonincrementalreason if spidermonkey’s collector determined it could not incrementally collect garbage, and had to do a full gc all at once, this is a short string describing the reason it determined the full gc was necessary.
Debugger.Source - Firefox Developer Tools
the url may be the name of a xpcom javascript module or subscript.
Debugger.Object - Firefox Developer Tools
for example, in firefox, a metadata object for a javascript module's global object might look like this: { "type":"jsm", "uri":"resource:://gre/modules/xpcomutils.jsm" } firefox provides [debuggerhostannotationsforfirefox annotations] for its host objects.
Inspecting web sockets - Firefox Developer Tools
columns in the response pane in the response pane, you can choose to show the following information about each frame: data size time opcode maskbit finbit the data and time columns are visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header.
Web Console remoting - Firefox Developer Tools
the isxhr flag indicates if the request was initiated via an xmlhttprequest instance, that is: the nsihttpchannel's notification is of an nsixmlhttprequest interface.
AudioBuffer.duration - Web APIs
the duration property of the audiobuffer interface returns a double representing the duration, in seconds, of the pcm data stored in the buffer.
AudioBuffer.getChannelData() - Web APIs
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).
AudioBuffer.length - Web APIs
the length property of the audiobuffer interface returns an integer representing the length, in sample-frames, of the pcm data stored in the buffer.
AudioBuffer.numberOfChannels - Web APIs
the numberofchannels property of the audiobuffer interface returns an integer representing the number of discrete audio channels described by the pcm data stored in the buffer.
AudioBuffer.sampleRate - Web APIs
the samplerate property of the audiobuffer interface returns a float representing the sample rate, in samples per second, of the pcm data stored in the buffer.
Background Tasks API - Web APIs
statusrefreshscheduled is used to track whether or not we've already scheduled an update of the status display box for the upcoming frame, so that we only do it once per frame the shim to function even if idle callbacks aren't supported.
CSS numeric factory functions - Web APIs
syntax css.number(number); css.percent(number); // <length> css.em(number); css.ex(number); css.ch(number); css.ic(number); css.rem(number); css.lh(number); css.rlh(number); css.vw(number); css.vh(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.dpcm(number); css.dppx(number); // <flex> css.fr(number); examples we use the css.vmax() numeric factory function to create a cssunitvalue: let height = css.vm...
CSSPrimitiveValue.getFloatValue() - Web APIs
css_pc the value is a <length> in picas.
CSSPrimitiveValue.primitiveType - Web APIs
css_pc the value is a <length> in picas.
CSSPrimitiveValue.setFloatValue() - Web APIs
css_pc the value is a <length> in picas.
CSSPrimitiveValue - Web APIs
css_pc the value is a <length> in picas.
Drawing shapes with canvas - Web APIs
in upcoming 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.
DOMHighResTimeStamp - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdomhighrestimestampchrome full support 6edge full support 12firefox full support 7ie full support 9opera full support 15safari full support 8webview a...
DOMTokenList.supports() - Web APIs
example let iframe = document.getelementbyid('display'); if (iframe.sandbox.supports('an-upcoming-feature')) { // support code for mystery future feature } else { // fallback code } if (iframe.sandbox.supports('allow-scripts')) { // instruct frame to run javascript // // (note: this feature is well-supported; this is just an example!) // } specifications specification status comment credential management level 1 working draft initial defin...
Document - Web APIs
WebAPIDocument
this property only has special meaning in privileged javascript code (with universalxpconnect privileges).
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
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 * " " spc \u0020 * * this does not use javascript's "\s" because that includes non-breaking * spaces (and also some other characters).
File.mozFullPath - Web APIs
WebAPIFilemozFullPath
this property is only available from within browser code or old-style xpcom-based firefox extensions.
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
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.
HTMLElement.offsetTop - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoffsettopchrome full support 1edge full support 12firefox full support 1ie full support 8opera full support 8safari full support 3webview an...
HTMLImageElement.isMap - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetismapchrome full support 1edge full support 12firefox full support yesie ?
HTMLImageElement.useMap - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetusemapchrome full support 1edge full support 12firefox full support yesie ?
HTMLTableElement - Web APIs
htmltableelement.cellpadding is a domstring containing the width in pixels of the horizontal and vertical sapce between cell content and cell borders.
IDBFactory.cmp() - Web APIs
WebAPIIDBFactorycmp
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcmpchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
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: webkitcmpchrome 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
in chrome/opera, the quota management api handles quota management for appcache, indexeddb, websql, and file system api.
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 visiblepct = (math.floor(entry.intersectionratio * 100)) + "%"; box.queryselector(".topleft").innerhtml = visiblepct; box.queryselector(".topright").innerhtml = visiblepct; box.queryselector(".bottomleft").innerhtml = visiblepct; box.queryselector(".bottomright").innerhtml = visiblepct; }); } startup(); clipping and the intersection rectangle the browser computes the final interse...
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
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_appcommand events.
KeyboardEvent - Web APIs
examples include alphanumeric keys on the standard pc 101 us keyboard, the numlock key, and the space bar.
MediaStreamEvent.stream - Web APIs
syntax var stream = event.stream; example pc.onaddstream = function( ev ) { alert("a stream (id: '" + ev.stream.id + "') has been added to this connection."); }; ...
MediaStreamEvent - Web APIs
examples pc.onaddstream = function( ev ) { alert("a stream (id: '" + ev.stream.id + "') has been added to this connection."); }; ...
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 onmsvideoframestepcompleted 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.oscpu - Web APIs
WebAPINavigatoroscpu
operating system oscpuinfo string format os/2 os/2 warp x (either 3, 4 or 4.5) windows ce windowsce x.y1 windows 64-bit (64-bit build) windows nt x.y; win64; x64 windows 64-bit (32-bit build) windows nt x.y; wow64 windows 32-bit windows nt x.y mac os x (ppc build) powerpc mac os x version x.y mac os x (i386/x64 build) intel mac os x or macos version x.y linux 64-bit (32-bit build) output of uname -s plus "i686 on x86_64" linux output of uname -sm x.y refers to the version of the operating system example function osinfo() { alert(window.navigator.oscpu); } osinfo(); // alerts "windows nt 6.0" for ...
Navigator - Web APIs
WebAPINavigator
standard navigatorid.appcodename read only returns the internal "code" name of the current browser.
NavigatorID.userAgent - Web APIs
gecko-based browsers comply with the following general structure: useragent = appcodename/appversion number (platform; security; os-or-cpu; localization; rv: revision-version-number) product/productsub application-name application-name-version example alert(window.navigator.useragent) // alerts "mozilla/5.0 (windows; u; win98; en-us; rv:0.9.2) gecko/20010725 netscape6/6.1" specifications specification status comment html living standardthe d...
Node.baseURIObject - Web APIs
this property exists on all nodes (html, xul, svg, mathml, etc.), but only if the script trying to use it has universalxpconnect privileges.
Notification.timestamp - Web APIs
for example, a timestamp for an upcoming meeting could be set in the future, whereas a timestamp for a missed message could be set in the past.
RTCConfiguration.bundlePolicy - Web APIs
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.
RTCConfiguration.iceServers - Web APIs
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.
RTCConfiguration.iceTransportPolicy - Web APIs
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.
RTCConfiguration - Web APIs
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.
RTCDTMFSender.toneBuffer - Web APIs
tones are removed from the string as they're played, so only upcoming tones are listed.
RTCDataChannel.close() - Web APIs
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...
RTCDataChannel.id - Web APIs
WebAPIRTCDataChannelid
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.
RTCDataChannel.label - Web APIs
var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); /* ...
RTCDataChannel.onbufferedamountlow - Web APIs
pc = new rtcpeerconnection(); dc = pc.createdatachannel("sendfile"); /* ...
RTCDataChannel.onclose - Web APIs
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 c...
RTCDataChannel.onerror - Web APIs
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 }); } /* ...
RTCDataChannel.onmessage - Web APIs
let pc = new rtcpeerconnection(); let dc = pc.createdatachannel(); dc.onmessage = function(event) { var el = document.createelement("p"); var txtnode = document.createtextnode(event.data); el.appendchild(txtnode); receivebox.appendchild(el); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdat...
RTCDataChannel.ordered - Web APIs
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.
RTCDataChannel.protocol - Web APIs
example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel", { protocol: "json" }); function handlechannelmessage(datachannel, msg) { switch(datachannel.protocol) { case "json": /* process json data */ break; case "raw": /* process raw binary data */ break; } } specifications specification status comment webrt...
RTCDataChannel.send() - Web APIs
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.
RTCDataChannel.stream - Web APIs
example var datachannel = pc.createdatachannel("samplechannel"); console.log("data channel stream id: " + datachannel.stream); ...
RTCDataChannel - Web APIs
example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function () { console.log("datachannel close"); }; specifications specification status comment webrtc 1.0: real-time communication betw...
RTCDataChannelEvent.channel - Web APIs
pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannelevent.cha...
RTCDataChannelEvent - Web APIs
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.
RTCError - Web APIs
WebAPIRTCError
sctpcausecode 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.
RTCErrorEvent.error - Web APIs
sctpcausecode 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.
RTCIceCandidate.component - Web APIs
if (candidate.component == "rtp") { handlertpcandidate(candidate); } else if (candidate.component == "rtcp") { handlertcpcandidate(candidate); } else { handleunknowncandidate(candidate); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.component' in that specification.
RTCIceCandidate.tcpType - Web APIs
syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetcpcandidatetype enumerated type.
RTCIceCandidate.usernameFragment - Web APIs
to avoid including candidates obsoleted by an ice restart, we can use code like this: const ssnewcandidate = signalmsg => { let candidate = new rtcicecandidate(signalmsg.candidate); let receivers = pc.getreceivers(); receivers.foreach(receiver => { let parameters = receiver.transport.getparameters(); if (parameters.usernamefragment === candidate.usernamefragment) { return; } }); pc.addicecandidate(candidate) .catch(reporterror); } this walks through the list of the rtcrtpreceiver objects being used to receive ice data, and looks to see if the usernamefragment i...
RTCIceCandidatePair.local - Web APIs
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.
RTCIceCandidatePair.remote - Web APIs
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.
RTCIceCandidatePair - Web APIs
var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); var remoteproto = document.getelementbyid("remote-protocol"); icetransport.onselectedcandidatepairchange = function(event) { var pair = icetransport.getselectedcandidatepair(); localprotocol.innertext = pair.local.protocol.touppercase(); remoteprotocol.innertext = pair.remote.protocol.touppe...
RTCIceServer - Web APIs
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); once the configuration object has been created, it is passed into the rtcpeerconnection() constructor to use it as the configuration for the new peer connection.
RTCIceTransport: gatheringstatechange event - Web APIs
here, the addeventlistener() method is called to add a listener for gatheringstatechange 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.getsende...
RTCIceTransport.getLocalCandidates() - Web APIs
var localcandidates = pc.getsenders()[0].transport.transport.getlocalcandidates(); localcandidates.foreach(function(candidate, index)) { console.log("candidate " + index + ": " + candidate.candidate); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.getlocalcandidates()' in that specification.
RTCIceTransport.getRemoteCandidates() - Web APIs
var remotecandidates = pc.getsenders()[0].transport.transport.getremotecandidates(); remotecandidates.foreach(function(candidate, index)) { console.log("candidate " + index + ": " + candidate.candidate); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.getremotecandidates()' in that specification.
RTCIceTransport.getSelectedCandidatePair() - Web APIs
var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); var remoteproto = document.getelementbyid("remote-protocol"); icetransport.onselectedcandidatepairchange = function(event) { var pair = icetransport.getselectedcandidatepair(); localprotocol.innertext = pair.local.protocol.touppercase(); remoteprotocol.innertext = pair.remote.protocol.touppe...
RTCIceTransport.ongatheringstatechange - Web APIs
var icetransport = pc.getsenders()[0].transport.transport; icetransport.ongatheringstatechange = function(event) { if (icetransport.gatheringstate == "complete") { allcandidatesreceived(pc); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetransport.ongatheringstatechange' in that specification.
RTCIceTransport.onselectedcandidatepairchange - Web APIs
var icetransport = pc.getsenders()[0].transport.icetransport; var localproto = document.getelementbyid("local-protocol"); var remoteproto = document.getelementbyid("remote-protocol"); icetransport.onselectedcandidatepairchange = function(event) { var pair = icetransport.getselectedcandidatepair(); localprotocol.innertext = pair.local.protocol.touppercase(); remoteprotocol.innertext = pair.remote.protocol.touppe...
RTCIceTransport.onstatechange - Web APIs
var icetransport = pc.getsenders()[0].transport.icetransport; icetransport.onstatechange = function(event) { if (icetransport.state == "failed") { handlefailure(pc); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetransport.onstatechange' in that specification.
RTCIdentityErrorEvent.idp - Web APIs
syntax var idp = event.idp; event.idp = "developer.mozilla.org"; example pc.onidpassertionerror = function( ev ) { alert("the idp named '" + ev.idp + "' encountered an error " + "while generating an assertion."); } ...
RTCIdentityErrorEvent.loginUrl - Web APIs
syntax var loginurl = event.loginurl; event.loginurl = "https://developer.mozilla.org/fakeurl"; example pc.onidpassertionerror = function( ev ) { alert("the idp requested an authentication" + " to be performed at th3 url '" + ev.url + "'."); } ...
RTCIdentityErrorEvent.protocol - Web APIs
syntax var protocol = event.protocol; event.protocol = "idp.html"; example pc.onidpassertionerror = function( ev ) { alert("the idp uses the following protocol '" + ev.protocol + "."); } ...
RTCIdentityErrorEvent - Web APIs
examples pc.onidpassertionerror = function( ev ) { alert("the idp named '" + ev.idp + "' encountered an error " + "while generating an assertion."); } ...
RTCIdentityEvent.assertion - Web APIs
syntax var blob = event.assertion; example pc.onidentityresult = function( ev ) { alert("a new identity assertion (blob: '" + ev.assertion + "') has been generated."); } ...
RTCIdentityEvent - Web APIs
examples pc.onidentityresult = function( ev ) { alert("a new identity assertion (blob: '" + ev.assertion + "') has been generated."); } ...
RTCOfferOptions.iceRestart - Web APIs
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() met...
RTCPeerConnection() - Web APIs
syntax pc = new rtcpeerconnection([configuration]); parameters configuration optional an rtcconfiguration dictionary providing options to configure the new connection.
RTCPeerConnection.close() - Web APIs
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 st...
RTCPeerConnection.createAnswer() - Web APIs
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.
RTCPeerConnection.currentLocalDescription - Web APIs
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.currentlocal...
RTCPeerConnection.currentRemoteDescription - Web APIs
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.currentremo...
RTCPeerConnection.generateCertificate() - Web APIs
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.
RTCPeerConnection.getDefaultIceServers() - Web APIs
example var pc = new rtcpeerconnection(); var iceservers = pc.getdefaulticeservers(); if (iceservers.length === 0) { // deal with the lack of default ice servers, possibly by using our own defaults } specifications specification status comment webrtc extensions ...
RTCPeerConnection.getTransceivers() - Web APIs
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.
RTCPeerConnection.iceConnectionState - Web APIs
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.
RTCPeerConnection: iceconnectionstatechange event - Web APIs
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 spec...
RTCPeerConnection.iceGatheringState - Web APIs
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.
RTCPeerConnection: icegatheringstatechange event - Web APIs
pc.onicegatheringstatechange = ev => { let connection = ev.target; switch(connection.icegatheringstate) { case "gathering": /* collection of candidates has begun */ break; case "complete": /* collection of candidates is finished */ break; } } likewise, you can use addeventlistener() to add a listener for icegatheringstatechange events: pc.addeventlistener("i...
RTCPeerConnection.localDescription - Web APIs
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' i...
RTCPeerConnection.onaddstream - Web APIs
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.onconnectionstatechange - Web APIs
example pc.onconnectionstatechange = function(event) { switch(pc.connectionstate) { case "connected": // the connection has become fully connected break; case "disconnected": case "failed": // one or more transports has terminated unexpectedly or in an error break; case "closed": // the connection has been closed break; } } specifications sp...
RTCPeerConnection.ondatachannel - Web APIs
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.
RTCPeerConnection.onicecandidate - Web APIs
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.
RTCPeerConnection.onicecandidateerror - Web APIs
example pc.onicecandidateerror = function(event) { if (event.errorcode >= 300 && event.errorcode <= 699) { // stun errors are in the range 300-699.
RTCPeerConnection.oniceconnectionstatechange - Web APIs
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).
RTCPeerConnection.onicegatheringstatechange - Web APIs
the status is simply presented as text in a <div> element: <div id="icestatus"></div> the actual event handler looks like this: pc.onicegatheringstatechange = function() { let label = "unknown"; switch(pc.icegatheringstate) { case "new": case "complete": label = "idle"; break; case "gathering": label = "determining route"; break; } document.getelementbyid("icestatus").innerhtml = label; } specifications specification status comment webrtc 1.0: real-t...
RTCPeerConnection.onidentityresult - Web APIs
example pc.onidentityresult = function(ev) { alert("onidentityresult event detected!"); }; ...
RTCPeerConnection.onidpassertionerror - Web APIs
example pc.onidpassertionerror = function(ev) { alert("onidpassertionerror event detected!"); }; ...
RTCPeerConnection.onidpvalidationerror - Web APIs
example pc.onidpvalidationerror = function(ev) { alert("onidpvalidationerror event detected!"); }; ...
RTCPeerConnection.onnegotiationneeded - Web APIs
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().
RTCPeerConnection.onpeeridentity - Web APIs
example pc.onpeeridentity = function(ev) { alert("onpeeridentity event detected!"); }; ...
RTCPeerConnection.onremovestream - Web APIs
example pc.onremovestream = function(ev) { alert("onremovestream event detected!"); }; ...
RTCPeerConnection.onsignalingstatechange - Web APIs
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.
RTCPeerConnection.ontrack - Web APIs
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.
RTCPeerConnection.pendingLocalDescription - Web APIs
var pc = new rtcpeerconnection(); … var sd = pc.pendinglocaldescription; if (sd) { // there's a description change underway!
RTCPeerConnection.pendingRemoteDescription - Web APIs
var pc = new rtcpeerconnection(); … var sd = pc.pendingremotedescription; if (sd) { // there's a description change underway!
RTCPeerConnection.remoteDescription - Web APIs
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.remotedescriptio...
RTCPeerConnection.removeStream() - Web APIs
example var pc, videostream; navigator.getusermedia({video: true}, function(stream) { pc = new rtcpeerconnection(); videostream = stream; pc.addstream(stream); } document.getelementbyid("closebutton").addeventlistener("click", function(event) { pc.removestream(videostream); pc.close(); }, false); ...
RTCPeerConnection.restartIce() - Web APIs
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 r...
RTCPeerConnection.sctp - Web APIs
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 ...
RTCPeerConnection.setConfiguration() - Web APIs
var restartconfig = { iceservers: [{ urls: "turn:asia.myturnserver.net", username: "allie@oopcode.com", credential: "topsecretpassword" }] }; mypeerconnection.setconfiguration(restartconfig); mypeerconnection.createoffer({"icerestart": true}).then(function(offer) { return mypeerconnection.setlocaldescription(offer); }) .then(function() { // send the offer to the other peer using the signaling server }) .catch(reporterror); first, a new...
RTCPeerConnection.setRemoteDescription() - Web APIs
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.
RTCPeerConnection.signalingState - Web APIs
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.
RTCPeerConnectionIceErrorEvent.address - Web APIs
pc.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.url}`; showmessage(errortext, iceserverinfo, networkinfo); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerror...
RTCPeerConnectionIceEvent.candidate - Web APIs
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.
RTCPeerConnectionIceEvent - Web APIs
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.
RTCRtcpParameters - Web APIs
function getrtpcname(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.
RTCRtpReceiveParameters - Web APIs
function getrtcpcname(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.
RTCRtpReceiver.getParameters() - Web APIs
function getrtcpcname(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.
RTCRtpReceiver - Web APIs
methods rtcrtpreceiver.getcontributingsources() returns an array of rtcrtpcontributingsource instances for each unique csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds.
RTCRtpSender.replaceTrack() - Web APIs
examples switching video cameras // example to change video camera, suppose selected value saved into window.selectedcamera navigator.mediadevices .getusermedia({ video: { deviceid: { exact: window.selectedcamera } } }) .then(function(stream) { let videotrack = stream.getvideotracks()[0]; pcs.foreach(function(pc) { var sender = pc.getsenders().find(function(s) { return s.track.kind == videotrack.kind; }); console.log('found sender:', sender); sender.replacetrack(videotrack); }); }) .catch(function(err) { console.error('error happens:', err); }); specifications specification status comment webrtc 1.0: real-time c...
RTCRtpSender.setStreams() - Web APIs
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.
RTCRtpSender - Web APIs
static methods rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the system's capabilities for sending a specified kind of media data.
RTCRtpTransceiver - Web APIs
methods setcodecpreferences() a list of rtcrtpcodecparameters objects which override the default preferences used by the user agent for the transceiver's codecs.
RTCSessionDescription() - Web APIs
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.
RTCSessionDescription.sdp - Web APIs
syntax var value = sessiondescription.sdp; sessiondescription.sdp = value; value the value is a domstring containing an sdp message like this one: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 example // the remote description has been set previously on pc, an rtcpeerconnection alert(pc.remotedescription.sdp); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.sdp...
RTCSessionDescription.type - Web APIs
example // the remote description has been set previously on pc, a rtcpeerconnection alert(pc.remotedescription.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.type' in that specification.
RTCSessionDescription - Web APIs
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(n...
RTCSessionDescriptionCallback - Web APIs
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.
Service Worker API - Web APIs
note: service workers win over previous attempts in this area such as; appcache because they don't make assumptions about what you are trying to do, and then break when those assumptions are not exactly right; you have granular control over everything.
SharedWorkerGlobalScope.applicationCache - Web APIs
example if a shared worker has an appcache associated with it, you can return a reference to the cache using self.applicationcache from inside the shared worker.
WebRTC API - Web APIs
rtcrtpcontributingsource contains information about a given contributing source (csrc) including the most recent time a packet that the source contributed was played out.
The WebSocket API (WebSockets) - Web APIs
jsonrpc-bidirectional: asynchronous rpc 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).
Basic concepts behind Web Audio API - Web APIs
created from raw pcm data (the audio context has methods to decode supported audio formats).
Web Storage API - Web APIs
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 xpcom interfaces to sqlite) or the session store api (an xpcom storage utility for use by extensions).
Functions and classes available to Web Workers - Web APIs
basic implementation (yes) appcodename, 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.
Window.content - Web APIs
WebAPIWindowcontent
see also working with windows in chrome code when accessing content documents from privileged code, be aware of xpcnativewrappers.
Window.controllers - Web APIs
each missing removal can cause bug 415775: assertion: xpconnect is being called on a scope without a 'components' property!
Window.stop() - Web APIs
WebAPIWindowstop
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstopchrome full support yesedge full support 14firefox full support yesie no support noopera full support yessafari full support yesweb...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
"); // prints "undefined" after 1,5 seconds // passing the 'this' object with .call won't work // because this will change the value of this inside settimeout itself // while we want to change the value of this inside myarray.mymethod // in fact, it will be an error because settimeout code expects this to be the window object: settimeout.call(myarray, myarray.mymethod, 2000); // error: "ns_error_xpc_bad_op_on_wn_proto: illegal operation on wrappednative prototype object" settimeout.call(myarray, myarray.mymethod, 2500, 2); // same error as you can see there are no ways to pass the this object to the callback function in the legacy javascript.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
settimeout.call(myarray, myarray.mymethod, 2.0*1000); // error: "ns_error_xpc_bad_op_on_wn_proto: illegal operation on wrappednative prototype object" settimeout.call(myarray, myarray.mymethod, 2.5*1000, 2); // same error possible solutions a common way to solve the problem is to use a wrapper function that sets this to the required value: settimeout(function(){myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(function(){myarray.mymeth...
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"…} appcodename: "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
inherited properties navigatorid.appcodename read only always returns 'mozilla', in any browser.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
move [important for multiple selection] event_object_selectionwithin [important for multiple selection] event_object_statechange [important for checkboxes and radio buttons] event_object_locationchange event_object_namechange event_object_descriptionchange event_object_valuechange [important for sliders and progress meters] event_object_parentchange event_object_helpchange event_object_defactionchange event_object_acceleratorchange msaa states cheat sheet for information on what each state does, see the msdn state constants page.
Accessibility Information for Web Authors - Accessibility
the european union is looking to base their upcoming accessibility regulations on these guidelines.
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 bordertopcolor 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
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-topchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support 3.5safari full support 1webview ...
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
<resolution> units include x or dppx, for dots per pixel unit, dpi, for dots per inch, and dpcm for dots per centimeter.
transform-box - CSS: Cascading Style Sheets
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.
Event reference
apcz) starts or stops.
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
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 souphttpclientsink and shout2send exist to stream media over http.
Separate sites for mobile and desktop - Developer guides
this is because you have the option of sending completely separate html, javascript, and css to phones and pcs.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
WebHTMLElementfigure
"> </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.appcodename + "; "; 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
WebHTMLElementtemplate
<table id="producttable"> <thead> <tr> <td>upc_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.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeswrapchrome full support yesedge full support 12firefox full support yesie full support yesopera full support yessafari full support yes...
MIME types (IANA media types) - HTTP
the pcm audio codec (wave codec "1") is often supported, but other codecs have limited support (if any).
Browser detection using the user agent - HTTP
they indicate the os, but also often its version and information on the relying hardware (32 or 64 bits, or intel/ppc for mac).
Compression in HTTP - HTTP
apache supports compression and uses mod_deflate; for nginx there is ngx_http_gzip_module; for iis, the <httpcompression> element.
Clear-Site-Data - HTTP
this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear), indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flash via npp_clearsitedata).
Public-Key-Pins-Report-Only - HTTP
example public-key-pins-report-only: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
Public-Key-Pins - HTTP
public-key-pins: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
Firefox user agent string reference - HTTP
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 powerpc mozilla/5.0 (macintosh; ppc mac os x x.y; rv:10.0) gecko/20100101 firefox/10.0 linux linux is a more diverse platform.
HTTP Public Key Pinning (HPKP) - HTTP
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="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
HTTP resources and specifications - HTTP
proposed standard rfc 2324 hyper text coffee pot control protocol (htcpcp/1.0) april 1st joke spec rfc 7168 the hyper text coffee pot control protocol for tea efflux appliances (htcpcp-tea) april 1st joke spec html living standard html defines extensions of http for server-sent events living standard tracking preference expression dnt header editor's draft / candidate recommendation reporting api report-t...
418 I'm a teapot - HTTP
WebHTTPStatus418
status 418 i'm a teapot specifications specification title rfc 2324, section 2.3.2: 418 i'm a teapot hyper text coffee pot control protocol (htcpcp/1.0): semantics and content rfc 7168, section 2.3.3: 418 i'm a teapot the hyper text coffee pot control protocol for tea efflux appliances (htcpcp-tea): response codes ...
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, includepropcb) { var props = []; do { if (iterateselfbool) { object.getownpropertynames(obj).foreach(function(prop) { if (props.indexof(prop) === -1 && includepropcb(obj, prop)) { props.push(prop); } }); } if (!iterateprototypebool) { break; ...
getter - JavaScript
get notifier() { delete this.notifier; return this.notifier = document.getelementbyid('bookmarked-notification-anchor'); }, for firefox code, see also the xpcomutils.jsm code module, which defines the definelazygetter() function.
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 lepc lepcha 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
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", "lepc", "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".
JavaScript shells - JavaScript
javascript shell (js) - a command line interpreter for javascript xpcshell is an xpconnect - enabled shell, sometimes useful for mozilla development.
Values - MathML
(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.
The "codecs" parameter in common media types - Web media technologies
avc1.oo[.ppccll] (avc video) oo is the oti describing the contents, while ppccll is six hexadecimal digits specifying the profile number (pp), constraint set flags (cc), and level (ll).
Progressive web app structure - Progressive web apps (PWAs)
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 upcoming articles and use in our example application.
Structural overview of progressive web apps - Progressive web apps (PWAs)
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 upcoming articles and use in our example application.
stroke-linecap - SVG: Scalable Vector Graphics
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetstroke-linecapchrome ?
<metadata> - SVG: Scalable Vector Graphics
WebSVGElementmetadata
</g> <g id="socket4" transform="translate(160 20)"> <title>socket 4</title> <use xlink:href="#hubplug"/> </g> <g id="socket5" transform="translate(205 20)"> <title>socket 5</title> <use xlink:href="#hubplug"/> </g> </g> </symbol> <!-- computer symbol --> <symbol id="computer"> <desc>a common desktop pc</desc> <g id="monitorstand" transform="translate(40 121)"> <title>monitor stand</title> <desc>one of those cool swivelling monitor stands that sit under the monitor</desc> <path d="m0,0 s 10 10 40 12"/> <path d="m80,0 s 70 10 40 12"/> <path d="m0,20 l 10 10 s 40 12 70 10 l 80 20z"/> </g> <g id="monitor"> <title>monitor</title> ...
Introduction - SVG: Scalable Vector Graphics
it was dropped for the upcoming svg 2.0, which is under heavy development right now and follows a similar approach to css 3 in that it splits components into several loosely coupled specifications.
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtext
it may contain #pcdata, literal text, and entity references.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
it may contain #pcdata, literal text, and entity references.
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
resources the following reflect the interface of the xsltprocessor object: nsixsltprocessor.idl xsltprocessor.webidl using xsltprocessor from xpcom components instantiating an xsltprocessor from an xpcom component requires a different syntax as the constructor is not defined inside components.
Understanding WebAssembly text format - WebAssembly
for a full list of the available opcodes, consult the webassembly.org semantics reference.