Search completed in 1.32 seconds.
nsIXPConnect
js/src/x
pconnect/idl/nsix
pconnect.idlnot scriptable provides the x
pconnect service.
... inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to access the x
pconnect service, use code like this: nsresult rv; nscomptr<nsix
pconnect> x
pconnect = do_getservice(nsix
pconnect::getcid(), &rv); if (ns_succeeded(rv)) { /* use the object */ } method overview void addjsholder(in voidptr aholder, in nsscriptobjecttracerptr atracer); native code only!
... void clearallwrappednativesecuritypolicies(); nsix
pconnectjsobjectholder createsandbox(in jscontextptr cx, in nsiprincipal principal); native code only!
...And 57 more matches
An Overview of XPCOM
« previousnext » this is a book about x
pcom.
... the book is presented as a tutorial about creating x
pcom components, but it covers all major aspects, concepts, and terminology of the x
pcom component model along the way.
... this chapter provides a quick tour of x
pcom - an introduction to the basic concepts and technologies in x
pcom and component development.
...And 50 more matches
Using XPCOM Components
« previousnext » one of the best ways to begin working with x
pcom - especially when you are designing the interface to a component that will be used by others, as we do in starting weblock - is to look at how clients are already using x
pcom components.
... applications like the mozilla browser are sophisticated, modularized clients of x
pcom components.
... in fact, virtually all of the functionality that you associate with a browser - navigation, window management, managing cookies, bookmarks, security, searching, rendering, and other features - is defined in x
pcom components and accessed by means of those component interfaces.
...And 40 more matches
XPCOM
x
pcom is a cross platform component object model, similar to microsoft com.
... it has multiple language bindings, allowing x
pcom components to be used and implemented in javascript, java, and python in addition to c++.
... interfaces in x
pcom are defined in a dialect of idl called xpidl.
...And 31 more matches
platform/xpcom - Archive of obsolete content
implement x
pcom objects, factories, and services.
... usage the x
pcom module makes it simpler to perform three main tasks: implement x
pcom object interfaces implement and register x
pcom factories implement and register x
pcom services if all you need to do is use x
pcom objects that someone else has implemented, then you don't need to use this module.
... you can just use require("chrome") to get direct access to the components object, and access x
pcom objects from there.
...And 28 more matches
XPCOM Objects - Archive of obsolete content
« previousnext » x
pcom x
pcom is a cross platform component object model, similar to microsoft com.
... taken from the x
pcom page.
... x
pcom is the way in which the two layers (xulrunner and chrome) communicate.
...And 23 more matches
XPCOM glue
the x
pcom glue is a static library which component developers and embedders can link against.
... it allows developers to link only against the frozen x
pcom method symbols and maintain compatibility with multiple versions of x
pcom.
... compiling or linking against x
pcom headers there are three ways to compile/link against x
pcom headers/libraries: frozen linkage: dependent glue (dependent on x
pcom.dll) x
pcom modules, i.e.
...And 22 more matches
How to build an XPCOM component in JavaScript
if you are looking for add-on sdk solution for x
pcom javascript components then check out platform/x
pcom module first.
... this is a "hello world" tutorial for creating an x
pcom component in javascript.
... this tutorial does not describe how and why x
pcom works the way it does, or what every bit of the example code does.
...And 20 more matches
XPCOM changes in Gecko 2.0
several changes that affect x
pcom 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 x
pcom components are registered changed in gecko 2.
...if you used x
pcomutils.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 x
pcom tools that make coding a lot easier and more efficient.
... it also introduces a basic string type that is used with many of the apis in both x
pcom and gecko.
... x
pcom macros the x
pcom 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 x
pcom in the context of the dom code.
... the use of x
pcom and nscomptr's described in this document covers about 80% of what you need to know to read the dom code, and even write some.
... for more advanced topics, please see the x
pcom page.
...And 14 more matches
nsIXPCScriptable
note: this is not really an x
pcom interface.
... js/src/x
pconnect/idl/nsix
pcscriptable.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 nsix
pconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreate(in nsix
pconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool addproperty(in nsix
pconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool delproperty(in nsix
pconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool getproperty(in nsix
pconnectwrappednative 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 javax
pcom component, which allows java code to interact with x
pcom objects.
... as you will see in this article, working with x
pcom objects in java is not that much different than doing so in c++.
...this library provides the interfaces necessary to bootstrap mozilla and call x
pcom methods.
...And 12 more matches
XPCOMUtils.jsm
the x
pcomutils.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/x
pcomutils.jsm"); using x
pcomutils exposing a javascript class as a component using these utility methods requires four key steps: import x
pcomutils.jsm, as explained previously.
... mycomponent.prototype = { // properties required for x
pcom 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 x
pcom in javascript (also known as x
pconnect) is an environment where memory management issues are not obvious.
... programmers writing and reviewing javascript code in mozilla should understand how code using x
pcom in javascript can leak so that they can avoid leaks.
... this is the strategy used by x
pcom, 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 x
pcom objects in c++ using visual studio.
... x
pcom is mozilla’s cross platform component object model, similar to microsoft’s com technology.
... x
pcom 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 x
pcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of x
pcom.
... the contents of this standalone x
pcom in general are: nspr : mozilla/nsprpub x
pcom : mozilla/x
pcom note 1: x
pcom apis are not frozen yet.
... by x
pcom 1.0 release they will be.
...And 11 more matches
Creating a Python XPCOM component
here is how to make the same component in python using pyx
pcom.
... (note that some details may be missing.) preparation if a binary of pyx
pcom is not available, you will need to build it - see building pyx
pcom.
... tip: you can achieve a copy of binary of pyx
pcom from pythonext; simply unpack xpi and take everything you need.
...And 11 more matches
xpcshell
x
pcshell is an x
pconnect-enabled javascript shell.
...unlike the ordinary js shell (js), x
pcshell lets the scripts running in it access x
pcom functionality.
... prerequisites you need your own build of mozilla to use x
pcshell.
...And 11 more matches
XPCOM ABI
x
pcom abi is the binary interface of x
pcom components.
... while x
pcom components written in a scripting language (such as javascript) can be moved across platforms (such as windows and os x) without adaptation, those written in a compiled language (such as c++) require recompilation when moving to a different platform.
... often, compiled x
pcom components are called 'binary' or 'native'.
...And 11 more matches
JS XPCOM - Archive of obsolete content
here are a few useful snippets of code for dealing with x
pcom components in javascript.
... contract ids a contract id is a unique name for an x
pcom object.
... they are used to create or access well-known objects in x
pcom.
...And 10 more matches
PyXPCOM
pyx
pcom allows for communication between python and x
pcom, such that a python application can access x
pcom objects, and x
pcom can access any python class that implements an x
pcom interface.
... pyx
pcom is actively used in activestate komodo products, for example.
... with pyx
pcom, a developer can talk to x
pcom or embed gecko from a python application.
...And 10 more matches
XPConnect wrappers
this document is a high-level overview of x
pconnect wrapper objects (for the more technical description see x
pconnect security membranes).
... developers in the know understand that wrappers play a large role in x
pconnect, and that we have a lot of them.
... basic x
pconnect objects x
pcwrappednative these objects are created when any natively implemented x
pcom object (that is, any object implemented in c++) needs to be reflected into javascript.
...And 10 more matches
NS_InitXPCOM3
« x
pcom api reference summary the ns_initx
pcom3 function initiates use of x
pcom in the calling process with support for statically defined x
pcom modules.
... #include "nsx
pcom.h" nsresult ns_initx
pcom3( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider, nsstaticmoduleinfo const* astaticmodules, pruint32 astaticmodulecount ); parameters aresult [out] the resulting x
pcom service manager.
...the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownx
pcom when the application is finished with x
pcom.
...And 10 more matches
XPCOM tasks
the role of x
pcom the x
pcom module roughly parallels the c/c++ standard libraries.
...x
pcom sits above the standard libraries.
... its role is to extend them with facilities tailored to x
pcom development in general, and specifically the needs of mozilla.
...And 10 more matches
XPCOM reference
this reference describes the interfaces and functions provided by the x
pcom library.
... in addition, it details the various helper classes and functions, as well as the components, provided by the x
pcom glue library.
... the contents herein are oriented primarily toward extension developers and people embedding x
pcom in other projects.
...And 9 more matches
NS_InitXPCOM2
« x
pcom api reference summary the ns_initx
pcom2 function initiates use of x
pcom in the calling process.
... #include "nsx
pcom.h" nsresult ns_initx
pcom2( nsiservicemanager** aresult, nsifile* abindirectory, nsidirectoryserviceprovider* aappfilelocationprovider ); parameters aresult [out] the resulting x
pcom service manager.
...the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownx
pcom when the application is finished with x
pcom.
...And 8 more matches
XPCOM array guide
the standard array classes are: nsiarray - a scriptable container for scriptable x
pcom objects.
... nsimutablearray - a scriptable container for scriptable x
pcom objects, which allows addition and removal of member objects.
... ownership nsiarray x
pcom object yes no no no reference counted, weak/strong nsimutablearray x
pcom object yes no yes no reference counted, weak/strong nscomarray<t> x
pcom object no yes yes* no reference counted, strong nstarray<t> any that has a default constructor and copy constructor no yes yes* no can hold objects directly...
...And 7 more matches
JavaXPCOM
javax
pcom allows for communication between java and x
pcom, such that a java application can access x
pcom objects, and x
pcom can access any java class that implements an x
pcom interface.
... javax
pcom is not actively maintained.
... with javax
pcom, a developer can talk to x
pcom or embed gecko from a java application.
...And 7 more matches
XPCOM Interfaces - Archive of obsolete content
« previousnext » in this section, we'll take a brief look at x
pcom (cross-platform component object model), which is the object system that mozilla uses.
...mozilla provides such a method which involves using x
pcom (cross-platform component object model).
... mozilla provides many x
pcom components and interfaces.
...And 6 more matches
Creating XPCOM components
next » this guide is about gecko, and about creating x
pcom components for gecko-based applications.
... though the emphasis is on the practical steps you take to make your c++ code into a component that can be used in gecko, we hope that these steps will also give us an occasion to discuss all of the tools, techniques, and technologies that make up x
pcom.
... accordingly, the book is arranged so that you can follow along and create your own components or learn about different x
pcom topics individually, as in a reference work.
...And 6 more matches
XPCShell Reference
the command line the command-line syntax for x
pcshell is: x
pcshell [-s] [-w] [-w] [-v version] [-f scriptfile] [scriptfile] [scriptarg...] -c this option turns on the "compile-only" mode.
...x
pcshell terminates upon script completion.
... furthermore, x
pcshell looks for x
pcshell.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 x
pcom interface is made accessible to a xul widget.
... the interface definition feature of xbl is used to define an interface through x
pconnect to a c++ object that does auto completion.
...the basic model of interaction is as follows: binding to the x
pcom object the widget holds onto an x
pcom object that is the auto complete engine that will perform our auto complete lookups.
...And 4 more matches
Detailed XPCOM hashtable guide
this is the long version of x
pcom hashtable guide.
... any type: almost any datatype can be used as key, including strings, integers, x
pcom interface pointers, iids, and almost anything else.
...a basic guide is included here, but you should read most of x
pcom/glue/pldhash.h if you intend to use pldhash.
...And 4 more matches
XPCOM guide
these articles provide tutorials and usage documentation for x
pcom, including how to use it in your own projects and how to build x
pcom components for your firefox add-ons and the like.
... avoiding leaks in javascript x
pcom componentsprogrammers writing and reviewing javascript code in mozilla should understand how code using x
pcom in javascript can leak so that they can avoid leaks.
... 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 x
pcom componentsthis guide is about gecko, and about creating x
pcom components for gecko-based applications.how to build an x
pcom component in javascriptif you are looking for add-on sdk solution for x
pcom javascript components then check out platform/x
pcom 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
x
pconnect is a bridge between javascript and x
pcom.
... with x
pconnect, you can use x
pcom components from javascript code, and interact with javascript objects from within x
pcom components.
... x
pconnect is part of firefox and is actively used in xul applications.
...And 4 more matches
nsIXmlRpcClient
extensions/xml-r
pc/idl/nsixmlr
pcclient.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 nsixmlr
pcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly nsiurl the url of the xml-r
pc server inprogress readonly boolean whether or not a call is in progress fault readonly nsixmlr
pcfault the most recent xml-r
pc fault from returned from this server.
... null if the last call didn't return an xml-r
pc fault.
...And 4 more matches
XPCOM Glue without mozalloc
starting with xulrunner 2.0, the frozen linkage dependent glue (x
pcomglue_s.lib on windows, libx
pcomglue_s.a on linux and mac) is dependent on the new infallible memory allocation routines (mozalloc).
... since these routines didn't exist prior to xulrunner 2.0, x
pcom components that link against the frozen linkage dependent glue will not be compatible with xulrunner applications prior to 2.0.
... the solution is to link against x
pcomglue_s_nomozalloc instead (x
pcomglue_s_nomozalloc.lib on windows, libx
pcomglue_s_nomozalloc.a on linux and mac).
...And 3 more matches
Profiling XPCShell
introduction sometimes, you might want to get a performance profile of a certain piece of javascript (like an x
pcom module), to see which part takes the most time.
...in those cases, an x
pcshell script can help.
...x
pctools there is profiler in the tree that can profile x
pcshell scripts.
...And 3 more matches
NS_ShutdownXPCOM
« x
pcom api reference summary the ns_shutdownx
pcom function terminates use of x
pcom in the calling process.
... #include "nsx
pcom.h" nsresult ns_shutdownx
pcom( nsiservicemanager* asvcmanager ); parameters asvcmanager [in] the nsiservicemanager instance that was returned by ns_initx
pcom2 (or ns_initx
pcom3) or null.
... return values the ns_shutdownx
pcom function returns ns_ok if successful.
...And 3 more matches
Using XPCOM without chrome - Archive of obsolete content
using sdk x
pcom with the low-level module sdk/platform/x
pcom , it's possible to exclude chrome and x
pcomutils in some cases.
... below is an example for the x
pcom bookmark observer.
... examples bookmarks observer normally, a bookmark observer would require chrome components and x
pcomutils as described in the following links: (observing changes to bookmarks and tags) , (creating event targets).
...And 2 more matches
Using LDAP XPCOM with XULRunner - Archive of obsolete content
by default, xulrunner is built without ldap x
pcom 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 x
pcom directly to your xul app (in the components directory).
... in any case, you will have to build ldap x
pcom, by adding --enable-ldap build option.
...And 2 more matches
XPCOM glue classes
these "glue" classes are provided to make it easier to use x
pcom from c++ code.
... when these classes are used by a component, you may need to link the component against the x
pcom 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 x
pcom interface references from c++ code.nscountedrefnscountedref<t> is a template class implementing an object that takes a strong reference to a reference-counted resource that must be released, typically on destruction of the object.</t>nscstringclass declarationnscstring externalclass declarationnscstringcontainer (external)class declaration nscstringencodingthe nscstringencoding enumeration ...
...And 2 more matches
nsIXPCException
js/src/x
pconnect/idl/x
pcexception.idlscriptable these exception objects are the preferred types of exceptions when implementing x
pcom interfaces in javascript.
... inherits from: nsiexception last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void initialize(in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); x
pcexjsval stealjsval(); native code only!
... void stowjsval(in x
pcexjscontextptr cx, in x
pcexjsval val); native code only!
...And 2 more matches
RTCRtpCapabilities - Web APIs
the rtcrt
pcapabilities 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 rtcrt
pcapabilities objects.
... an rtcrt
pcapabilities object contains an array of objects conforming to rtcrt
pcodeccapability (each describing the capabilities of one codec) and an array of the supported rtp header extensions for that codec.
... properties codecs an array of rtcrt
pcodeccapability 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 n
pclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an n
pclass (i.e.
... syntax struct n
pclass { uint32_t structversion; npallocatefunctionptr allocate; npdeallocatefunctionptr deallocate; npinvalidatefunctionptr invalidate; nphasmethodfunctionptr hasmethod; npinvokefunctionptr invoke; npinvokedefaultfunctionptr invokedefault; nphaspropertyfunctionptr hasproperty; npgetpropertyfunctionptr getproperty; npsetpropertyfunctionptr setproperty; npremovepropertyfunctionptr removeproperty; npenumerationfunctionptr enumerate; n
pconstructfunctionptr construct; }; warning: don't call these routines directly.
... function pointer syntax typedef npobject *(*npallocatefunctionptr)(npp npp, n
pclass *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 (*n
pconstructfunctionptr)(npobject *npobj, const npvariant *args, uint32_t argcount, npvariant *result); see also npobject ...
XPCOM Interface Reference
this is a reference to the x
pcom interfaces provided by the mozilla platform.
...amiccontainernsieditornsieditorboxobjectnsieditordocshellnsieditorimesupportnsieditorloggingnsieditormailsupportnsieditorobservernsieditorspellchecknsieffectivetldservicensienumeratornsienvironmentnsierrorservicensieventlistenerinfonsieventlistenerservicensieventsourcensieventtargetnsiexceptionnsiextensionmanagernsiexternalhelperappservicensiexternalprotocolservicensiexternalurlhandlerservicensift
pchannelnsiftpeventsinknsifactorynsifavicondatacallbacknsifaviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifileurlnsifileutilitiesnsifileviewnsifocusmanage...
...rnsiformhistory2nsiframeloadernsiframeloaderownernsiframemessagelistenernsiframemessagemanagernsiframescriptloadernsigsettingscollectionnsigsettingsservicensigeolocationprovidernsigeolocationupdatensiglobalhistorynsiglobalhistory2nsiglobalhistory3nsihtmleditornsihttpheaderlistenernsihapticfeedbacknsihttpactivitydistributornsihttpactivityobservernsihtt
pchannelnsihtt
pchannelinternalnsihttpheadervisitornsihttpservernsihttpupgradelistenernsiidnservicensiiframeboxobjectnsiiniparsernsiiniparserfactorynsiiniparserwriternsiioservicensiidleservicensiinprocesscontentframemessagemanagernsiinputstreamnsiinputstreamcallbacknsiinstalllocationnsiinterfacerequestornsijscidnsijsidnsijsiidnsijsonnsijetpacknsijetpackservicensijumplistbuildernsijumplistitemnsilivemarkservicensiloadgroupnsilocalfilensilocalfilem...
...iwinapphelpernsiwintaskbarnsiwindowcreatornsiwindowmediatornsiwindowwatchernsiwindowsregkeynsiwindowsshellservicensiworkernsiworkerfactorynsiworkerglobalscopensiworkermessageeventnsiworkermessageportnsiworkerscopensiwritablepropertybagnsiwritablepropertybag2nsixformsmodelelementnsixformsnsinstanceelementnsixformsnsmodelelementnsixmlhttprequestnsixmlhttprequesteventtargetnsixmlhttprequestuploadnsix
pcexceptionnsix
pcscriptablensix
pconnectnsixsltexceptionnsixsltprocessornsixsltprocessorobsoletensixulappinfonsixulbrowserwindownsixulbuilderlistenernsixulruntimensixulsortservicensixultemplatebuildernsixultemplatequeryprocessornsixultemplateresultnsixulwindownsixmlr
pcclientnsixmlr
pcfaultnsizipentrynsizipreadernsizipreadercachensizipwriternsmsgfilterfileattribvaluensmsgfolderflagtypensmsgjunkstatusns...
RTCRtpCodecCapability - Web APIs
the webrtc api's rtcrt
pcodeccapability dictionary provides information describing the capabilities of a single media codec.
... description rtcrt
pcodeccapabilities describes the basic parameters for a single codec supported by the user's device.
... an array of objects of this type is returned in the codecs property of the rtcrt
pcapabilities object returned in response to a call to either of the static functions rtcrtpsender.getcapabilities() or rtcrtpreceiver.getcapabilities().
... examples tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrt
pcodeccapability' in that specification.
RTCRtpContributingSource.audioLevel - Web APIs
the read-only audiolevel property of the rtcrt
pcontributingsource interface indicates the audio level contained in the last rtp packet played from the described source.
... syntax var audiolevel = rtcrt
pcontributingsource.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 rtcrt
pcontributingsource.
... for both rtcrt
pcontributingsource and rtcrtpsynchronizationsource, the audio level is converted to this form from the values defined in the specifications corresponding to each type of source.
... audiolevel may be absent from rtcrt
pcontributingsource objects, which indicates that no volume level was provided by the source; however, it is required and always available on all rtcrtpsynchronizationsource objects.
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
the new mozilla x
pcom architecture allows x
pcom components be scriptable via a different mechanism called x
pconnect.
...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 x
pcom 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 x
pcom.
XPCOM hashtable guide
this is the simplified version of the detailed x
pcom hashtable guide.
...it is a lot faster than the x
pcom 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, x
pcom 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 x
pcom object from a xul window's code, you can do so if you pass the x
pcom object as one of the arguments to the window creation method.
... getservice(components.interfaces.nsiwindowwatcher); var win = ww.openwindow(null, "chrome://myextension/content/debug.xul", "debug history", "chrome,centerscreen,resizable", myobject); note in this example that myobject is passed to the openwindow() method; you can pass any x
pcom object (or any other value, for that matter) in this way.
... to access the x
pcom object from the window's code, you can access the window.arguments[] array, as shown in the example below: components.utils.reporterror(string(window.arguments[0])); this will produce output similar to "[x
pconnect wrapped nsimyx
pcomobject]".
Interfacing with the XPCOM cycle collector
this is a quick overview of the cycle collector introduced into x
pcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in x
pcom cycle collection.
... what the cycle collector does the cycle collector spends most of its time accumulating (and forgetting about) pointers to x
pcom objects that might be involved in garbage cycles.
... how to make your classes participate the interface between the cycle collector and your classes can be accessed directly using the contents of x
pcom/base/nscyclecollector.h, but there are convenience macros for annotating your classes in x
pcom/glue/nscyclecollectionparticipant.h that are much easier to use.
Standard XPCOM components
there are a number of components provided in the standard implementation of x
pcom; these are as follows.
... nscategorymanagerthe x
pcom category manager.nsdirectoryservicethe x
pcom directory service.
... nsobserverservicethe x
pcom observer service.nsscriptableinputstreama component implementing nsiscriptableinputstream.
Core XPCOM functions
x
pcom provides a number of global functions which are used to initialize and shut down the x
pcom library, as well as to allocate memory, get access to services, and to instantiate interfaces.
... ns_allocinfallibly allocates a block of memory using the x
pcom memory manager.ns_freefrees a block of memory using the x
pcom memory manager.ns_getcomponentmanagerthe ns_getcomponentmanager function returns a reference to the x
pcom component manager.ns_getcomponentregistrarthe ns_getcomponentregistrar function returns a reference to the x
pcom component registrar.ns_getmemorymanagerthe ns_getmemorymanager function returns a reference to the x
pcom memory manager.ns_getservicemanagerthe ns_getservicemanager function returns a reference to the x
pcom service manager.ns_initx
pcom2the ns_initx
pcom2 function initiates use of x
pcom in the calling process.ns_initx
pcom3the ns_initx
pcom3 function initiates use of x
pcom in the calling process with support for statically defined x
pcom 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 x
pcom memory manager.ns_shutdownx
pcomthe ns_shutdownx
pcom function terminates use of x
pcom in the calling process.nsresultthe nsresult data type is a strongly-typed enum used to represent a value returned by an x
pcom function; these are typically error or status codes.
XPCOM primitive
an x
pcom primitive is an x
pcom object that "boxes" a value of a primitive type.
... all x
pcom primitives are scriptable, and they all implement an x
pcom interface from the table below.
...the main use case is to store primitive values in a data structure that can only store x
pcom objects, such as nsiarray.
XPCOM Interface Reference by grouping
01, 2010) list of mozilla interfaces as listed on the x
pcom 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 nsix
pcscriptable future nsixmlhttprequestupload obsolete nsixmlr
pcclient nsixmlr
pcfault security auth nsiauthmodule nsiauthprompt nsiauthpromptprovider nsiauthpromptwrapper nsiasyncverifyredirectcallback content nsicontentpolicy credentials nsilogininfo ...
... nsifilestreams nsifileutilities nsifileview memory nsimemory network channel nsichannel nsichanneleventsink nsirequest nsirequestobserver nsiresumablechannel nsidnsservice nsift
pchannel nsiftpeventsink nsihtt
pchannel nsihtt
pchannelinternal nsihttpheadervisitor nsiidnservice nsiprotocolhandler nsiprotocolproxycallback nsiprotocolproxyfilter nsiprotocolproxyservice nsiproxyinfo preferences nsiiniparser nsiiniparserfactory nsiprefbranch nsiprefbr...
NavigatorID.appCodeName - Web APIs
the value of the navigatorid.ap
pcodename property is always "mozilla", in any browser.
... syntax codename = navigator.ap
pcodename value the string "mozilla".
... specifications specification status comment html living standardthe definition of 'navigatorid.ap
pcodename' in that specification.
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetc
pcandidatetype enumerated type provides a set of domstring values representing the types of tcp candidates.
... usage notes the rtcicetc
pcandidatetype type is used by the tcptype property of rtcicecandidate objects.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicetc
pcandidatetype' in that specification.
RTCRtpContributingSource.source - Web APIs
the read-only source property of the rtcrt
pcontributingsource interface returns the source identifier of a particular stream of rtp packets.
... the value is the contributing source (csrc) or synchronization source (ssrc) identifier, depending on whether the object is an rtcrt
pcontributingsource or rtcrtpsynchronizationsource, which is based on the former.
... syntax var sourceid = rtcrt
pcontributingsource.source value an unsigned, 32-bit integer value which uniquely identifies the source of rtp packets described by this rtcrt
pcontributingsource (in which case the value is a csrc identifier) or rtcrtpsynchronizationsource (the value is an ssrc identifier).
popChallengeResponse - Archive of obsolete content
resultstring = crypto.po
pchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message.
... the resultstring will either be a base-64 encoded popodeckeyres
pcontent message, or one of the following error strings: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value.
XPCOM Examples - Archive of obsolete content
« previousnext » this section provides some examples of using x
pcom along with some additional interfaces.
... code snippets http://kb.mozillazine.org/category:x
pcom_example_code next, we'll look at how to create trees.
PlXPCOM
plx
pcom (perl x
pcom) provides language bindings letting you use x
pcom from perl code.
... project page (mozdev) perl object definition (mozdev) developer's guide to perl x
pcom (mozdev) newsgroup (mozdev) mailing list (mozdev) ...
nsIFTPChannel
the nsift
pchannel is an extension of nsisupports used to determine if a channel is an ftp channel, and offering additional information about the ftp channel.
... netwerk/protocol/ftp/nsift
pchannel.idlscriptable please add a summary to this article.
nsIHttpChannel
netwerk/protocol/http/nsihtt
pchannel.idlscriptable this interface allows for the modification of http request parameters and the inspection of the resulting http response status and headers when they become available.
...if the new channel supports nsihtt
pchannel, then it will be assigned a value to its redirectionlimit attribute one less than the value of the redirected channel's redirectionlimit attribute.
nsIHttpChannelInternal
netwerk/protocol/http/nsihtt
pchannelinternal.idlscriptable an internal interface for http channels.
... see also nsihtt
pchannel nsichannel nsihttpupgradelistener ...
nsIXmlRpcFault
extensions/xml-r
pc/idl/nsixmlr
pcclient.idlscriptable an xml-r
pc exception.
... xml-r
pc server fault codes are returned wrapped in this; access it using nsix
pconnect.getpendingexception->data.
Troubleshooting XPCOM components registration
often the first time you create an x
pcom component, it may fail to register correctly.
...see x
pcom changes in gecko 2.0 parsing errors in javascript components the most common reason for components written in javascript to fail is that there are parsing errors.
XPCOM category image-sniffing-services
in firefox 3, a new x
pcom category was added in bug 391667 to allow "third-party" x
pcom components to identify images based on their content.
... if mozilla's built-in image code cannot identify an image, then any x
pcom components implementing the nsicontentsniffer interface may register under the "image-sniffing-services" category, and will be queried to determine the mime type of the image being downloaded.
Console.groupCollapsed() - Web APIs
syntax console.grou
pcollapsed([label]); parameters label label for the group.
... specifications specification status comment console apithe definition of 'console.grou
pcollapsed()' in that specification.
onMSVideoFrameStepCompleted - Web APIs
onmsvideoframeste
pcompleted is an event which occurs when the video frame has been stepped forward or backward one frame.
... syntax value description event property object.onmsvideoframeste
pcompleted = handler; attachevent method object.attachevent("onmsvideoframeste
pcompleted", 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 rtcrt
pcontributingsource 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 = rtcrt
pcontributingsource.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 rtcrt
pcontributingsource interface returns a domhighrestimestamp indicating the most recent time of playout of an rtp packet from the source.
... syntax var domhighrestimestamp = rtcrt
pcontributingsource.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 rtcrt
pcontributingsource 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 'rtcrt
pcontributingsource' in that specification.
IPC Protocol Definition Language (IPDL)
ipdl, short for "i
pc (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 i
pc semaphore functions i
pc semaphore functions pr_opensemaphore pr_waitsemaphore pr_postsemaphore pr_closesemaphore pr_deletesemaphore ...
RbXPCOM
rbx
pcom (ruby cross-platform com) provides bindings between the popular ruby programming language and x
pcom.
XPCOM string functions
x
pcom 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
x
pcom thread synchronization primitives have the same semantics as those in nspr, and each method of these synchronization objects (e.g.
RTCRtpCodecParameters - Web APIs
the rtcrt
pcodecparameters dictionary, part of the webrtc api, is used to describe the configuration parameters for a single media codec.
Index
found 1275 pages: # page tags and summary 1 x
pcom add-ons, extensions, landing, mozilla, x
pcom x
pcom is a cross platform component object model, similar to microsoft com.
... it has multiple language bindings, allowing x
pcom components to be used and implemented in javascript, java, and python in addition to c++.
... 2 accessing the windows registry using x
pcom add-ons, code snippets, extensions, needsclassification, windows registry when implementing windows-specific functionality, it is often useful to access the windows registry for information about the environment or other installed programs.
...And 881 more matches
Component Internals
« previousnext » where the previous chapter described components from the perspective of a client of x
pcom components, this chapter discusses components from the perspective of the software developer.
... read on to see how components are generally implemented in x
pcom, or you can skip to the next chapter, where the weblock component tutorial takes you step by step through the component creation process.
... xxx mediawiki...xxx sucks creating components in c++ let's start by examining how x
pcom components are written in c++.
...And 85 more matches
Mozilla DOM Hacking Guide
seriously hacking on it requires excellent knowledge of c++ and x
pcom, mozilla's own component model.
...prior knowledge of c++ and x
pcom is assumed.
... if you don't know x
pcom yet, and would like to be able to read this document quickly, you can read the introduction to x
pcom for the dom.
...And 57 more matches
Key Values - Web APIs
ap
pcommand_copy gdk_key_copy (0x1008ff57) qt::key_copy (0x010000cf) "crsel" [3] the cursor select key, crsel.
... ap
pcommand_cut gdk_key_cut (0x1008ff58) qt::key_cut (0x010000d0) "delete" [2] the delete key, del.
... ap
pcommand_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 x
pcom.
... use the calculator (after learning long division) you have to write a fair amount of code to create a component library that gets loaded into x
pcom.
... an x
pcom component needs to implement at least three interfaces that x
pcom requires, and often others as well.
...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 x
pcom shutdown.
...for example, in the case of the x
pcom shutdown observation, asubject and adata are not defined, and atopic is defined as the string "x
pcom-shutdown".
...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 x
pcom.
...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 get
pccountscriptcount(); astring get
pccountscriptsummary(in long ascript); astring get
pccountscriptcontents(in long ascript); void getscrollxy(in boolean aflushlayout, out long ascrollx, out long ascrolly); astring getvisiteddependentcomputedstyle(in nsidomelement aelement, in astring apseudoelement, in astring apropertyname); boolean isinmodalsta...
...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 purge
pccounts(); 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 start
pccountprofiling(); void stop
pccountprofiling(); 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/x
pcom implement x
pcom objects, factories, and services.
... 168 using x
pcom without chrome bookmarks, chrome, sdk, x
pcom no summary!
... 186 finding window handles add-ons, code snippets, extensions, x
pcom, js-ctypes no summary!
...And 37 more matches
Getting Started Guide
nscomptr is smart in that, unlike a raw c++ pointer to an x
pcom object, nscomptr manages addref, release, and queryinterface for you.
... nscomptr is defined in the source files: x
pcom/base/nscomptr.h x
pcom/base/nscomptr.cpp ...though you probably don't want to look in there, just yet.
... with nscomptr, you can write code that is shorter, cleaner, clearer, and safer, than you can with raw x
pcom interface pointers.
...And 33 more matches
Reference Manual
the basics design an nscomptr is designed to be a complete replacement for raw x
pcom interface pointers where they are used as owning references.
... almost any place you could use a raw x
pcom interface pointer, you should be able to use an nscomptr.
... an nscomptr is the exact same size and shape as a raw x
pcom interface pointer.
...And 31 more matches
IPDL Tutorial
the parent actor is typically the more permanent side of the conversation: parent/child actors parent child i
pc tabs chrome process content process i
pc plugins content process plugin process each protocol is declared in a separate file.
... generated c++ code when pplugin.ipdl is compiled, the headers ppluginparent.h, and ppluginchild.h will be generated in the i
pc/ipdl/_ipdlheaders/ directory of the build tree.
...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 i
pc "transport layer" is beyond the scope of this document.
...And 21 more matches
Using DTMF with WebRTC - Web APIs
let dialstring = "12024561111"; let caller
pc = null; let receiver
pc = 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.
... caller
pc and receiver
pc the rtcpeerconnection objects representing the caller and the receiver, respectively.
... function connectanddial() { caller
pc = new rtcpeerconnection(); hasaddtrack = (caller
pc.addtrack !== undefined); caller
pc.onicecandidate = handlecallericeevent; caller
pc.onnegotiationneeded = handlecallernegotiationneeded; caller
pc.oniceconnectionstatechange = handlecallericeconnectionstatechange; caller
pc.onsignalingstatechange = handlecallersignalingstatechangeevent; caller
pc.onicegatheringstatechange = handlecallerg...
...And 20 more matches
Language bindings
an x
pcom language binding is a bridge between a particular language and x
pcom to provide access to x
pcom objects from that language, and to let modules written in that language be used as x
pcom objects by all other languages for which there are x
pcom bindings.
... more specifically, an x
pcom language binding: enables access to x
pcom objects from that language (where access means reading/writing/creating x
pcom objects as well as calling methods on them).
... exposes modules written in the bound language as x
pcom objects, thereby enabling all other languages for which x
pcom bindings exist to access these modules.
...And 18 more matches
Preface
next » this is a book about gecko, and about creating x
pcom components for gecko-based applications.
... though the emphasis is on the practical steps you take to make your c++ code into a component that can be used in gecko, we hope that these steps will also give us an occasion to discuss all of the tools, techniques, and technologies that make up x
pcom.
... accordingly, the book is arranged so that you can follow along and create your own components or learn about different x
pcom topics individually, as in a reference work.
...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 x
pcom (cross-platform com) objects.
... x
pcom object model before getting into the details of the ui example, it's helpful to have a basic understanding of the x
pcom object model.
... mozilla architectural modules are comprised of groups of related x
pcom objects that provide services to and access services from each other through dynamically queryable interfaces.
...And 15 more matches
Extending a Protocol
creating the protocol pecho.ipdl let's start by saving the following file to ./dom/i
pc/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/i
pc/moz.build" file and add 'pecho.ipdl', to the ipdl_sources array.
... updating pwindowglobal.ipdl open up ./dom/i
pc/pwindowglobal.ipdl.
...And 15 more matches
Necko walkthrough
nsdocshell as an example client of the nsihtt
pchannel api nsdocshell::loaduri(string) create nsiuri from string nsdocshell::loaduri(nsiuri) creates 2 nsiinputstream for read response from; passes them with uri to ...
... nsdocshell::internalload nsdocshell::douriload opens the nsichannel for the uri (ns_newchannel) if "http:", it will be an nsihtt
pchannel nsdocshell::dochannelload nsuriloader::openuri passes an nsistreamlistener pointer, 'loader' to nsuriloader::openchannel - it creates an nsdocumentopeninfo object, which implements nsistreamlistener, i.e.
... nshtt
pchannel::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 x
pcom components and modules if the window object is unavailable (for example, when opening a window from x
pcom component code), you might want to use nsiwindowwatcher interface.
... you should be aware of x
pcnativewrappers when working with untrusted content.
... with x
pcnativewrappers turned on (which is the default in firefox 1.5+), your extension can safely access the dom of the content document, but not the content javascript.
...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 x
pcom interfaces.
... mozilla's x
pcom layer consists of a component model (called x
pcom) and the infrastructure necessary to support dynamic registration, instantiation and manipulation of x
pcom components.
... at the heart of x
pcom's implementation is the service manager and the component manager.
...And 14 more matches
Web Replay
i
pc integration allows a replaying process to communicate with the chrome process using ipdl and shared memory.
... the i
pc 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 i
pc 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 x
pcom components.
...for example, the headers for networking are all located in the necko directory, and the headers that x
pcom requires are in the x
pcom directory.
... x
pcom exports a number of binaries that should be mentioned at this point.
...And 13 more matches
Index - Web APIs
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 onmsvideoframeste
pcompleted onmsvideoframeste
pcompleted onmsvideoframeste
pcompleted 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 nsihtt
pchannel.
... the nsihtt
pchannel 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 htt
pchannel.setrequestheader("x-hello", "world", false); in the example code above we have a variable named htt
pchannel which points to an object implementing nsihtt
pchannel.
...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 x
pcom (e.g.
...if you are just looking to create an x
pcom component or two, this is probably overkill, and you might want to take a look at this guide instead.
...it has thus been necessary to solve all of the issues involved in creating and registering x
pcom components, building jar files and manifests, installing the lot into the firefox extensions/ directory and so forth.
...And 11 more matches
Refcount tracing and balancing
you almost certainly want x
pcom_mem_refcnt_log.
... x
pcom_mem_refcnt_log setting this environment variable enables refcount tracing.
... warning: you should never use this without x
pcom_mem_log_classes and/or x
pcom_mem_log_objects, because without some filtering the logging will be completely useless due to how slow the browser will run and how large the logs it produces will be.
...And 11 more matches
xptcall FAQ
xptcall is a small low level x
pcom method call library.
... xptcall exists for two reasons: to support invoking arbitrary methods on x
pcom interfaces.
... to support dynamically impersonating any x
pcom 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 x
pcom components that can be easily added or removed.
... x
pcom, the cross platform component object model the cross platform component object model (x
pcom) is one of the main things that makes the mozilla application environment an actual framework.
...And 10 more matches
The Joy of XUL - Archive of obsolete content
x
pcom/x
pconnect x
pcom and x
pconnect are complementary technologies that enable the integration of external libraries with xul applications.
... x
pcom, which stands for cross platform component object model, is a framework for writing cross-platform, modular software.
... x
pcom components can be written in c, c++, and javascript, and they can be used from c, c++, javascript, python, java, and perl.
...And 10 more matches
JavaScript-DOM Prototypes in Mozilla
prototype setup on an x
pconnect wrapped dom node in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using x
pconnect and the wrapper is exposed to javascript as the javascript representation of the dom node.
... when x
pconnect wraps a c++ object it will create a jsobject that is unique to this c++ object.
...all the methods that are supposed to show up on this jsobject are actually not properties of the object itself, but rather properties of the prototype of the jsobject for the wrapper (unless the c++ object's class info has the flag nsix
pcscriptable::dont_share_prototype set, but lets assume that's not the case here).
...And 10 more matches
Mozilla internal string guide
the headers and implementation are in the x
pcom/string directory.
... helper classes and functions converting cocoa strings use mozilla::copycocoastringtox
pcomstring() in mozilla/macstringhelpers.h to convert cocoa strings to x
pcom strings.
... these methods return a buffer allocated using x
pcom's allocator instead of the traditional allocator (malloc, etc.).
...And 10 more matches
wrappedJSObject
wrappedjsobject is a property sometimes available on x
pconnect wrappers.
... there are two kinds of x
pconnect wrappers that support the wrappedjsobject property: x
pcnativewrappers which are used to protect the chrome code working with content objects.
... see x
pcnativewrapper for detailed documentation.
...And 10 more matches
Index of archived content - Archive of obsolete content
frame/utils fs/path io/byte-streams io/file io/text-streams lang/functional lang/type loader/cuddlefish loader/sandbox net/url net/xhr places/bookmarks places/favicon places/history platform/x
pcom preferences/event-target preferences/service remote/child remote/parent stylesheet/style stylesheet/utils system/child_process system/environment system/events system/runtime system/unload system/xul-app tabs/utils ...
...m) getting started (cfx) list open tabs listen for page load listening for load and unload localization logging modifying web pages based on url modifying the page hosted by a tab open a web page troubleshooting unit testing using x
pcom without chrome using third-party modules (jpm) bootstrapped extensions code snippets alerts and notifications autocomplete bookmarks boxes canvas code snippets cookies customizing the download progress bar...
... delayed execution dialogs and prompts downloading files drag & drop embedding svg examples and demos from articles file i/o finding window handles forms related code snippets html in xul for rich tooltips html to dom isdefaultnamespace js x
pcom javascript debugger service javascript timers javascript daemons management label and description lookupnamespaceuri lookupprefix miscellaneous modules on page load page loading post data to window 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_newtem
pcertificate (see cert.h) cert_setocsptimeout (see certhigh/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11p...
...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_getregisteredhtt
pclient (see ocsp.h) sec_pkcs5isalgorithmpbealgtag (see secpkcs5.h) vfy_createcontextdirect (see cryptohi.h) vfy_createcontextwithalgorithmid (see cryptohi.h) vfy_verifydatadirect (see cryptohi.h) vfy_verifydatawithalgorithmid (see cryptohi.h) vfy_verifydigestdirect (see cryptohi.h) vfy_verifydigestwithalgorithmid (see cryptohi.h) new macros for camellia support (see blapit.h): nss_camellia nss_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_newtem
pcertificate.
...And 9 more matches
WebIDL bindings
} } external interfaces external interfaces are represented in c++ as objects that x
pconnect knows how to unwrap to.
... this can mean x
pcom interfaces (whether declared in xpidl or not) or it can mean some type that there's a castable native unwrapping function for.
...this second call method is a template on the type of the first argument, so the this value can be passed in in whatever form is most convenient, as long as it's either a type that can be wrapped by x
pconnect or a webidl interface type.
...And 9 more matches
GRE - Archive of obsolete content
finding and using a gre from application code avoid linking directly against x
pcom.dll if an application wishes to use the gre, it must take careful steps to ensure that it links against the proper libraries.
... if you link directly against x
pcom.dll/libx
pcom.so (x
pcom.lib import lib), your application will not launch unless x
pcom.dll is in your path.
... to find a compatible gre, you should use the function gre_getgrepathwithproperties() (declared in x
pcom/glue/standalone/nsx
pcomglue.h).
...And 8 more matches
Leak-hunting strategies and tips
seeing a leaked globalwindowimpl, nsxulpdglobalobject, nsxbldocglobalobject, or nsx
pcwrappedjs is a sign that there could be significant numbers of js objects leaked.) for example, start with bringing up the mail window and closing the window without doing anything.
...(but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through x
pconnect many large object graphs that leak go through x
pconnect.
... this can mean there will be x
pconnect wrapper objects showing up as owning the leaked objects, but it doesn't mean it's x
pconnect'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| o
pcode|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 o
pcode field defines how to interpret the payload data: 0x0 for continuation, 0x1 for text (which is always encoded in utf-8), 0x2 for binary, and other so-called "control codes" that will be discussed later.
... message fragmentation the fin and o
pcode 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 ap
pcache 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 (ap
pcache) 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.ap
pcache"> … </html> the manifest attribute references a url for a cache manifest file: a text file that lists urls that browsers should cache for your application.
...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 jso
pcode.def on its own to figure out where to plant trap instructions to implement functions like step out, but a future jsdbgapi.h will provide convenience interfaces to do these things.
... 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 x
pcom-startup note: an extension can no longer be registered to receive this notification in firefox 4 and later.
... see x
pcom changes in gecko 2.0 for details.
... called when x
pcom is initialized.
...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 x
pcom components that together form the mozilla browser.
...we are proposing a new "moziregistry" x
pcom interface that provides the same level of function as is currently provided by the "netscape registry" implemented in libreg.
...those other components presumably implement particular x
pcom 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 x
pcom.
...source files represented through chrome urls run with universalx
pconnect privileges; even if they haven’t been granted “use x
pconnect as local file” privileges, as discussed in chapter 4, they will be able to use x
pcom functions (figure 1).
...firefox lets you read and write preference values using handy x
pcom 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 x
pcom service or jsm module).
... the subject argument on the observe method is the nsihtt
pchannel object that corresponds to the http channel being opened or already opened, depending on the topic.
... observe : function(asubject, atopic, adata) { if (topic_modify_request == atopic) { let url; asubject.queryinterface(components.interfaces.nsihtt
pchannel); url = asubject.uri.spec; if (re_url_to_modify.test(url)) { // re_url_to_modify is a regular expression.
...And 6 more matches
Setting Up a Development Environment - Archive of obsolete content
building idl files some extensions require developing x
pcom components to add certain advanced functions.
... there's a section dedicated to x
pcom in this tutorial, but we'll briefly discuss the impact it has on building the extension.
... you can skip this section and keep it present as a reference in case you do need to use x
pcom in your project.
...And 6 more matches
XPJS Components Proposal - Archive of obsolete content
xpjs components is a (cheesy) name for a system to support x
pcom components written in javascript.
... now, you might ask: "isn't that what x
pconnect does?" and i would answer that x
pconnect is necessary, but not sufficient to the task.
... x
pconnect provides the mechanisms for communication between native and js x
pcom components, but it does not provide all of the infrastructure to register and instantiate js components outside of the limitations of the browser window.
...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-r
pc or soap are also used to communicate between a server and a client.
... introducing xml-r
pc xml-r
pc is a type of web service and has been around since 1998, though not an official w3c standard, it is widely used.
... xml-r
pc was developed by useful inc, along with microsoft.
...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 x
pcom).
... as you should already know from the prerequisite reading, single threaded apartments receive remote procedure calls (r
pcs) from com, via the windows message queue.
...on the other hand, com's multithreaded apartment (mta) uses a much faster i
pc mechanism that does not suffer from the same problems as the message queue.
...And 6 more matches
NSS functions
rsions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and later cert_addocspacceptableresponses mxr 3.6 and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 and later cert_cachecrl mxr 3.10 and later cert_clearocs
pcache mxr 3.11.7 and later cert_certchainfromcert mxr 3.2 and later cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr ...
... cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificaterequest mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocs
pcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoa...
... 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificaterequest mxr 3.2 and later cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocs
pcertid mxr 3.6 and later cert_destroyocsprequest mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_du
pcertificate mxr 3.2 and later cert_du
pcertlist mxr ...
...And 6 more matches
Property cache
the o
pcodes that take advantage of the property cache, as of june 2009, are: getprop, get{x,this,arg,local}prop, and length; name; setprop, bindname, and setname; callprop and callname; and {inc,dec}name and name{inc,dec}.
... elem o
pcodes do not use it.
... property cache entries each entry in the property cache hash table is either populated or not; unpopulated entries have .k
pc == null.
...And 6 more matches
Introduction to the JavaScript shell
line2
pc([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 x
pcom and registered with the category manager so that it starts up when x
pcom initializes.
...grab the right headers, use the component or service manager to access the interface you want, and the x
pcom object(s) that implement that interface will do your bidding.
... weblock interfaces interface name defined by status summary nsisupports x
pcom frozen provides interface discovery, and object reference counting nsiobserver x
pcom frozen allows messaging passing between objects nsicontentpolicy content not frozen interface for policy control mechanism iweblock web lock not frozen enables and disables weblock.
...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 nshtt
pchannel::opencacheentry().
... creating javascript callbacks in components x
pcom components use idl to create interfaces.
...this article will cover the basics of doing http connections from x
pcom javascript, and should easily translate to c++ x
pcom.
...And 6 more matches
Writing a WebSocket server in C# - Web APIs
methods: start() system.net.sockets.tc
pclient accepttc
pclient() waits for a tcp connection, accepts it and returns it as a tc
pclient object.
... here's a barebones server implementation: using system.net.sockets; using system.net; using system; class server { public static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has started on 127.0.0.1:80.{0}waiting for a connection...", environment.newline); tc
pclient client = server.accepttc
pclient(); console.writeline("a client connected."); } } tc
pclient methods: system.net.sockets.networkstream getstream() gets the stream which is the communication channel.
... tc
pclient client = server.accepttc
pclient(); 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 x
pcom 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 x
pcom, 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 x
pcom 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 x
pcom 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 x
pcom 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 x
pcom.
...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 x
pcom aic
pcu/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 u
pcoming version 8 will be based on thunderbird evergreen library automation system evolution email client uses nss exe elearning xhtml editor seems to be using xul for some of their webui facebook open platform facebook open platform the fbml parser used in the platform is based on mozilla code fennec browser for mobiles as ...
...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 x
pcom 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_x
pcom= +moz_ldap_x
pcom=1 moz_mail_news= moz_mork=1 moz_morkreader= and set --enable-extensions=pref in mozconfig file, in fedora source rpm it is: [root@b008-02 sources]# grep enable-extensions /root/rpmbuild/sources/thunderbird-mozconfig ac_add_options --enable-extensions=pref it seems worse this time , as even after applying those compilation options mentioned above, i now get the following...
...moz_ldap_x
pcom=1 and moz_extensions_default="wallet spellcheck xmlextras pref webservices universalcharset auth" are now present in the default configure script.
...moz_ldap_x
pcom=1).
...And 5 more matches
RDF Datasource How-To - Archive of obsolete content
the x
pcom registration parts and the "as of this writing, it is not currently possible to implement javascript x
pcom components" comment seem outdated didn't check the whole article.
...this is an extreme case of delegation, where you use x
pcom 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 x
pcom 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 "ap
pcore" 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 x
pcom, xpidl, and x
pconnect, three somewhat related technologies for getting access to application code from the interface.
...x
pcom 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
Extentsions FAQ - Archive of obsolete content
return to mozilla-dev-extensions faq friday, september 22 - 29, 2006 (↑ top) how to write an x
pcom component in c++ that can communicate to a com component?
... write an x
pcom component in c++ - it will talk to the com component and will be accessible to js code via x
pconnect.
...are there any fundamental rules related to threading in x
pcom, 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 x
pcom component that implements the nsiautocompletesearch interface.
... make sure the contract id of your x
pcom component follows the following form: "@mozilla.org/autocomplete/search;1?name=xxx", where "xxx" is the name of your autocomplete source.
... the simplest way to make an x
pcom component is to build an x
pcom javascript component (this cannot be done with a javascript module).
...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 getstartu
pchanges(), addstartu
pchange(), and removestartu
pchange() methods.
... methods addstartu
pchange() adds an add-on change from the add-on changes list.
... this is used to build the lists of changed add-ons reported by the getstartu
pchanges() method.
...And 5 more matches
BloatView
x
pcom_mem_bloat_log if set, this causes a bloat log to be printed on program exit, and each time nstracerefcnt::dumpstatistics is called.
... x
pcom_mem_leak_log this is similar to x
pcom_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 o
pcodes should be used for 64-bit safety.
...luckily there is an alias that will choose the right o
pcode for you - lir_ldp: struct object { void *data; }; lir->insload(lir_ldp, objins, ins->insimm(offsetof(object, data))); when you use lirwriter::insstore, the correct size is chosen for you automatically, based on the size of the input operands.
...to help form well-typed lir, there is a special o
pcode 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 x
pcom 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 x
pcom components.
...it also gives creation of x
pcom objects more javascript-like syntax.
...And 5 more matches
RefPtr
it is similar to nscomptr, but does not require that the type be an x
pcom interface.
... the rules are simple: use nscomptr to hold pointers to x
pcom interfaces, and use refptr to hold pointers to concrete class, even if the concrete class implements one or more x
pcom interfaces.
... so for x
pcom 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 x
pcom: // 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
x
pcom/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 x
pcom 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 x
pcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the x
pcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the x
pcom interface guidelines boolean equals([const] in nsisupportsarray other); violates the x
pcom 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 x
pcom interface guidelines long indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astartindex); violates the x
pcom interface guidelines boolean insertelementat(in nsisupports aelement, in unsigned long aindex); violates the x
pcom interface guidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long aindex); violates the x
pcom interface guidelines long lastindexof([const] in nsisupports apossibleelement); violates the x
pcom interface guidelines boolean moveelement(in long afrom, in long ato); violates the x
pcom interface gu...
...And 5 more matches
Using nsIDirectoryService
content formerly at http://www.mozilla.org/projects/x
pcom/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/x
pco...locations.html background the way in which mozilla components locate special files and directories has changed.
...os and x
pcom level nsdirectoryservicedefs.h these locations are provided by x
pcom, are constant with the system, and and should not need customization.
...And 5 more matches
Xptcall Porting Guide
overview xptcall is a library that supports both invoking methods on arbitrary x
pcom objects and implementing classes whose objects can impersonate any x
pcom interface.
...the tree mozilla/x
pcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac p
pc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform.
...the platform specific code then builds a call frame and invokes the method indicated by the index methodindex on the x
pcom interface that.
...And 5 more matches
Xptcall Porting Status
bert's details <font color="white">done</font> mac p
pc roger lawrence <rogerl@netscape.com>, patrick beard <beard@netscape.com> mac (passing tests and checked in) <font color="white">done</font> solaris sparc roger lawrence <rogerl@netscape.com>, chris mcafee <mcafee@netscape.com> unix this is checked in and working.
...notice the last 2 files (the change to mozilla\x
pcom\build\makefile.win and mozilla\x
pcom\build) are needed because i was unable to figure how to do a "declspecexport" from the assembler asaxp ...
... <font color="white">done</font> linux p
pc 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 wra
pcryptokey(keytowrap) { // get the key encryption key const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new uint8array(16)); const wrappingkey = await getkey(keymaterial, salt); return window.crypto.subtle.wrapkey( "raw", keytowrap, wrappingkey, "aes-kw" ); } /* generate an encrypt/decrypt secret key, then wrap it.
... */ window.crypto.subtle.generatekey( { name: "aes-gcm", length: 256, }, true, ["encrypt", "decrypt"] ) .then((secretkey) => { return wra
pcryptokey(secretkey); }) .then((wrappedkey) => { console.log(wrappedkey); }); pkcs #8 wrap this example wraps an rsa private signing key.
...*/ async function wra
pcryptokey(keytowrap) { // get the key encryption key const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new uint8array(16)); const wrappingkey = await getkey(keymaterial, salt); 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/x
pcomutils.jsm"); x
pcomutils.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 x
pcom components, etc.
...updated example is in section below this observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { subject.queryinterface(components.interfaces.nsihtt
pchannel); var url = subject.uri.spec; /* url being requested.
...And 4 more matches
Index - Archive of obsolete content
custom query processors are x
pcom components, must implement the nsixultemplatequeryprocessor interface and follow some conventions for when registering the component.
... 436 index found 1218 pages: 437 international characters in xul javascript firefox, gecko, guide, internationalization, javascript, mozilla, x
pcom, xul gecko 1.8, as used in firefox 1.5 and other applications, added support for non-ascii characters in javascript files loaded from xul files.
... 595 node this is a scriptable interface corresponding to the nsidomnode x
pcom 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 x
pcom in addition to the usual java script.
... this gives access to python features and modules and builds on mark hammond's pyx
pcom work from active state.
... x
pcom components can also be created in python.
...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 x
pcom component implemented in javascript (or another scripting language, if applicable).
...the value is taken from the nsixulruntime os and x
pcomabi values (concatenated with an underscore).
... for example: binary-component component/mylib.dll abi=winnt_x86-msvc binary-component component/mylib.so abi=linux_x86-gcc3 see x
pcom abi for more details.
...And 4 more matches
Creating Sandboxed HTTP Connections
this article will cover the basics of doing http connections from x
pcom javascript, and should easily translate to c++ x
pcom.
...nsiuri is an x
pcom 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 x
pcom interface, so we need to implement qi queryinterface : function(aiid) { if (aiid.equals(components.interfaces.nsisupports) || aiid.equals(components.interfaces.nsiinterfacerequestor) || aiid.equals(components.interfaces.nsichanneleventsink) || aiid.equals(components.interfaces.nsiprogresseventsink) || aiid.equals(components.interfaces.nsihttpeventsink) || ...
...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_x
pc_object_err (0x805303ec) ns_error_dom_not_number_err (0x805303ed) ns_error_dom_not_boolean_err (0x805303ee) ns_error_dom_not_function_err (0x805303ef) ns_error_dom_too_few_parameters_err (0x805303f0) ns_error_dom_bad_document_domain (0x805303f1) ns_error_dom_prop_access_denied (0x805303f2) ns_error_dom_x
pconnect_access_denied (0x805303f3) ns_error_dom_bad_uri (0x805...
... javascript errors these errors typically occur when interfacing between javascript and native code, or to x
pcom components.
... ns_error_x
pc_not_enough_args (0x80570001) ns_error_x
pc_need_out_object (0x80570002) ns_error_x
pc_cant_set_out_val (0x80570003) ns_error_x
pc_native_returned_failure (0x80570004) ns_error_x
pc_cant_get_interface_info (0x80570005) ns_error_x
pc_cant_get_param_iface_info (0x80570006) ns_error_x
pc_cant_get_method_info (0x80570007) ns_error_x
pc_unexpected (0x80570008) ns_error_x
pc_bad_convert_js (0x80570009) ns_error_x
pc_bad_convert_native (0x8057000a) ns_error_x
pc_bad_convert_js_null_ref (0x8057000b) ns_error_x
pc_bad_op_on_wn_proto (0x8057000c) ns_error_x
pc_cant_convert_wn_to_fun (0x8057000d) ns_error_x
pc_cant_define_prop_on_wn (0x8057000e) ns_error_x
pc_cant_watch_wn_static (0x8057000f) ns_error_x
pc_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); } }; x
pconnect don't use object methods and properties more than you have to.
...x
pconnect knows all about tearoffs and modifies the object that you queryinterface or instanceof to cache all its known interfaces.
... when passing an object to an x
pcom method it is helpful if the object you pass is an x
pcom object, so that the c++ method access a c++ object.
...And 4 more matches
HOWTO
async network requests problem you want to make network requests or do other asynchronous work in x
pcshell.
...put the following at the end of your script: // do async processing // from <https://developer.mozilla.org/en/x
pconnect/x
pcshell/howto> print("doing async work"); gscriptdone = false; var gthreadmanager = cc["@mozilla.org/thread-manager;1"] .getservice(ci.nsithreadmanager); var mainthread = gthreadmanager.currentthread; while (!gscriptdone) mainthread.processnextevent(true); while (mainthread.haspendingevents()) mainthread.processnextevent(true); 2.
...this is of course a massive, ugly hack prone to error, but this is what the x
pcshell test harness does.
...And 4 more matches
imgIContainer
nsiframe getrootlayoutframe(); violates the x
pcom interface guidelines pruint16 gettype(); violates the x
pcom 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 x
pcom interface guidelines void resetanimation(); void restoredatadone(); native code only!
... loo
pcount long number of times to loop the image.
...And 4 more matches
Component; nsIPrefBranch
a complex preference is a preference which represents an x
pcom object that can not be easily represented using a standard boolean, integer or string value.
... atype the x
pcom 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 x
pcom 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 x
pcom interface classes.
...some examples are in the x
pcom/base and x
pcom/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 notx
pcom 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 u
pcoming 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 { x
pcomutils } = require("resource://gre/modules/x
pcomutils.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: x
pcomutils.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 { x
pcomutils }= require("resource://gre/modules/x
pcomutils.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 x
pcom offers you a better and cleaner way to achieve that using observers and the observer service.
...the first parameter (subject) can be any x
pcom object, the second parameter is a notification topic, and the final parameter is a string that further describes the notification.
...the first parameter can be any x
pcom object to pass to those observers (can be null), the second parameter is the notification topic and the last parameter is an additional string to pass to those observers (can be null).
...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 x
pcom component manager to load a component whose contractid is constructed using the "special" uri and the well-known prefix@mozilla.org/rdf/datasource;1?name=</code>.
...var ds = rdf.getdatasource("http://www.mozilla.org/some-rdf-file.rdf"); // note that ds will load asynchronously, so assertions will not // be immediately available alternatively, you can create one directly using the x
pcom component manager, as the following code fragment illustrates: // create an rdf/xml datasource using the x
pcom component manager var ds = components .classes["@mozilla.org/rdf/datasource;1?name=xml-datasource"] .createinstance(components.interfaces.nsirdfdatasource); // the nsirdfremotedatasource interface has the interfaces // that we need to setup the datasource.
... since a built-in datasource is just an x
pcom component, you can instantiate it directly using the x
pconnect component manager.
...And 3 more matches
Choosing the right memory allocator
allocating memory in x
pcom these are general purpose memory-management routines that you should use unless your code falls into one of the other categories below.
... use these if you link against x
pcom or x
pcom glue; this includes extensions with binary components.
... see the x
pcom string guide for additional information.
...And 3 more matches
IPDL Type Serialization
types are serialized and deserialized from an i
pc::message type declared in i
pc_message.h.
... each type specializes i
pc::paramtraits as follows: namespace i
pc { template <> struct paramtraits<mytype> { typedef mytype paramtype; static void write(message* amsg, const paramtype& aparam) { // implement serialization here } static bool read(const message* amsg, void** aiter, paramtype* aresult) { // implement deserialization here.
... return false if deserialization failed } }; } // namespace i
pc the standard ipdl types (integers, floats, and x
pcom strings) already have serializers.
...And 3 more matches
Certificate functions
rsions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and later cert_addocspacceptableresponses mxr 3.6 and later cert_addokdomainname mxr 3.4 and later cert_addrdn mxr 3.2.1 and later cert_asciitoname mxr 3.2 and later cert_cachecrl mxr 3.10 and later cert_clearocs
pcache mxr 3.11.7 and later cert_certchainfromcert mxr 3.2 and later cert_certlistfromcert mxr 3.2 and later cert_certtimesvalid mxr 3.2 and later cert_changecerttrust mxr 3.2 and later cert_checkcertvalidtimes mxr 3.2 and later cert_checknamespace mxr 3.12 and later cert_checkcertusage mxr ...
... cert_convertanddecodecertificate mxr 3.9.3 and later cert_copyname mxr 3.4 and later cert_copyrdn mxr 3.5 and later cert_createava mxr 3.2.1 and later cert_createcertificate mxr 3.5 and later cert_createcertificaterequest mxr 3.2 and later cert_createname mxr 3.2.1 and later cert_createocs
pcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoa...
... 3.2 and later cert_destroycertificate mxr 3.2 and later cert_destroycertificatelist mxr 3.2 and later cert_destroycertificatepoliciesextension mxr 3.2 and later cert_destroycertificaterequest mxr 3.2 and later cert_destroycertlist mxr 3.2 and later cert_destroyname mxr 3.2 and later cert_destroyocs
pcertid mxr 3.6 and later cert_destroyocsprequest mxr 3.6 and later cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_du
pcertificate mxr 3.2 and later cert_du
pcertlist mxr ...
...And 3 more matches
sslcrt.html
validating certificates manipulating certificates getting certificate information comparing secitem objects validating certificates cert_verifycertnow cert_verifycertname cert_checkcertvalidtimes nss_cm
pcertchainwcanames cert_verifycertnow checks that the current date is within the certificate's validity period and that the ca signature on the certificate is valid.
... returns the function returns an enumerator of type seccerttimevalidity: typedef enum { seccerttimevalid, seccerttimeexpired, seccerttimenotvalidyet } seccerttimevalidity; nss_cm
pcertchainwcanames determines whether any of the signers in the certificate chain for a specified certificate are on a specified list of ca names.
... syntax #include <nss.h> secstatus nss_cm
pcertchainwcanames( certcertificate *cert, certdistnames *canames); parameters this function has the following parameters: cert a pointer to the certificate structure for the certificate whose certificate chain is to be checked.
...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 jso
pcode.cpp, a function named js::disassembleat
pc 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 o
pcodes.h by make_o
pcode_doc.py.
...this o
pcode is not used for normal js.
...all direct evals use one of the jsop::*eval instructions here and these o
pcodes are only used when the syntactic conditions for a direct eval are met.
...And 3 more matches
Receiving startup notifications
sometimes it's necessary for x
pcom 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 x
pcom startup process.
...your add-on will not receive x
pcom-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 x
pcom method called via x
pconnect.
... introduction generally, components.lastresult is only useful for testing the result of x
pcom methods that can return interesting 'success' codes.
... this is because failure result codes get converted by x
pconnect into exceptions that are thrown into the calling javascript method.
...And 3 more matches
nsMemory
« x
pcom api reference summary the nsmemory class provides static helper routines to manage memory.
... these routines allow easy access to x
pcom's global nsimemory implementation without having to go through the service manager to get it.
... free the free function frees a block of memory that was allocated by x
pcom'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,notx
pcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only!
... [noscript,notx
pcom] nsidocumentptr getdocument(); void hide(); void init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only!
... [noscript,notx
pcom,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 consti
pcmessageptr amsg, out voidptr aiter); violates the x
pcom interface guidelines void duplicateprivatedata(); native code only!
... nseventptr getinternalnsevent(); violates the x
pcom interface guidelines boolean getpreventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the x
pcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in i
pcmessageptr amsg, in boolean aserializeinterfacetype); violates the x
pcom 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 x
pcom interface guidelines deserialize() boolean deserialize( in consti
pcmessageptr amsg, out voidptr aiter ); parameters amsg aiter return value native code only!duplicateprivatedata void duplicateprivatedata(); parameters none.
...And 3 more matches
getFile
« x
pcom api reference called by the directory service to obtain an nsifile object corresponding for a given standard path location.
... x
pcom 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 x
pcom/io/nsdirectoryservicedefs.h file for the version of gecko you're working with for the latest list.
...And 3 more matches
nsIServiceManager
x
pcom/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 x
pcom service given the classid of the service.
... getservicebycontractid() this method returns a reference to a particular x
pcom service given the contractid of the service.
...And 3 more matches
nsIVariant
x
pcom/ds/nsivariant.idlscriptable x
pconnect 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 x
pcom interface guidelines astring getasastring(); native code only!
... nsresult getasid(out nsid retval); violates the x
pcom interface guidelines print16 getasint16(); native code only!
...And 3 more matches
Using the Gecko SDK
this guide explains how to build x
pcom components in c++ using the gecko sdk.
... introduction it is assumed that you already know something about x
pcom component development.
... (more information on x
pcom is available at the x
pcom 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
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, skippro
pchange = 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; } skippro
pchange = 1, ele.classname = proto.value, skippro
pchange = 0; }; domtokenlist.prototype.remove = function(){ for (var v=0, arglen=arguments.length,val="",ele=this[" ucl"],proto=ele[" uclp"]; v !== arglen; ++v) { val = arguments[v] + "", checkifvalidclasslistentry("remove", val); for (var i=0, len=proto.length, resstr="", is=0; i !== len; ++i) 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; } skippro
pchange = 1, ele.classname = proto.value, skippro
pchange = 0; }; window.domtokenlist = domtokenlist; function whenpro
pchanges(){ var evt = window.event, prop = evt.propertyname; if ( !skippro
pchange && (prop==="classname" || (prop==="classlist" && !defineproperty)) ) { var target = evt.srcelement, protoobjproto = target[" uclp"], strval = "" + target[prop]; 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
</p> <form action="createshorthand()"> <div class="cf"> <div class="setpro
pcont"> 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="setpro
pcont"> font-variant<br> <input type="radio" id="font-variant-none" name="font_variant" checked="" value=" " onchange="setcss()"> <label for="font-variant-none">none</label><br/> <input type="radio" id="font-variant-normal" name="font_variant" value="normal" onchange="setcss()"> <label for="font-variant-normal">normal</label><br/> <input type="radio" id="font-variant-small-caps" name="font_variant" value="small-caps" onchange="setcss()"...
...> <label for="font-variant-small-caps">small-caps</label> </div> <div class="setpro
pcont"> font-weight<br/> <input type="radio" id="font-weight-none" name="font_weight" value="" onchange="setcss()"> <label for="font-weight-none">none</label><br/> <input type="radio" id="font-weight-normal" checked="" name="font_weight" value="400" onchange="setcss()"> <label for="font-weight-normal">normal</label><br/> <input type="radio" id="font-weight-bold" name="font_weight" value="700" onchange="setcss()"> <label for="font-weight-bold">bold</label> </div> <div class="setpro
pcont"> 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
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 x
pcom 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/x
pcomutils.jsm"); const gobserver = cc['@mozilla.org/observer-service;1'].getservice(ci.nsiobserverservice); const gioservice = cc["@mozilla.org/network/io-service;1"].getservice(ci.nsiioservice); function certsservice() {} certsservice.prototype = { observe: function(asubject, atopic, adata) { switch(atopic) { case "app-startup": gobserver.addobserver(this,"x
pcom-shutdown",false); gobserver.addobserver(this,"final-ui-startup",false); break; case "x
pcom-shutdown": gobserver.removeobserver(this,"final-ui-startup"); ...
... gobserver.removeobserver(this,"x
pcom-shutdown"); break; case "final-ui-startup": this.init(); break; } }, 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 x
pcom string guide—but note that that article bears a warning of its own!
...and x
pcom 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 x
pcom 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 x
pcom 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/x
pcomutils.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", _x
pcom_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: soa
pclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested.
... the best solution proved to be jqsoa
pclient.
...(there is a diff below.) you'll need: sasoa
pclient.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()); }; soa
pclient.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; soa
pclient.sendrequest(req, callback); diff between jqsoa
pclient.js and sasoa
pclient.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 javax
pcom xulrunner ships with the javax
pcom component, which allows java code to interact with x
pcom objects.
... as you will see in this article, working with x
pcom objects in java is not that much different than doing so in c++.
... standalone x
pcom standalone x
pcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of x
pcom.
...And 2 more matches
Interface Compatibility
javascript/xul interfaces traditional extensions written using xul overlays and x
pcom have access to the full power of the mozilla platform.
...this includes not only x
pcom 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 x
pcom 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 x
pcom components which can then in turn e.g.
...the gecko sdk is a collection of header files and tools used to develop general x
pcom components which add functionality to the existing platform, whereas xulrunner is a framework which can be used to run standalone or embedded applications based on the mozilla framework.
... 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 p
pc 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/i
pc/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 i
pc/ipdl: make -c objdir/i
pc/ipdl if there are any protocol-level errors, the ipdl compiler will print the relevant error messages and stop.
...And 2 more matches
Using JavaScript code modules
modules can also be used to create global javascript singletons that previously required using javascript x
pcom objects.
...the module is loaded into a specific javascript scope, such as xul script or javascript x
pcom script, using components.utils.import() or components.utils["import"]().
... 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 x
pcom 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 x
pcom/build/x
pcominit.cpp, as this also seems to trigger when shutdown is extremely slow.
... the command you need to run firefox will look something like this: x
pcom_mem_bloat_log=1 moz_cc_log_shutdown=1 moz_disable_content_sandbox=t moz_cc_log_directory=$logdir moz_cc_log_process=content moz_cc_log_thread=main moz_dmd_shutdown_log=$logdir moz_dmd_log_process=tab ./mach run --dmd --mode=scan breaking this down: x
pcom_mem_bloat_log=1: this reports a list of the counts of every object created and destroyed and tracked by the x
pcom leak tracking system.
...if your leak is happening in a different process or thread, change the options, which are listed in x
pcom/base/nscyclecollector.cpp.
...And 2 more matches
Building the WebLock UI
the x
pcom 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 x
pcom interfaces that carry out a lot of the browser functionality in mozilla.
... in using x
pcom components you saw how x
pcom objects are reflected into the interface layer as javascript objects.
...And 2 more matches
Components.returnCode
components.returncode is a property which can hold an x
pcom 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 x
pcom caller of the javascript method that the method is returning a specific nsresult code.
... generally, x
pconnect does a fine job of making it unnecessary for javascript code to worry about nsresult codes.
...And 2 more matches
Components.utils
components.utils is a collection of various useful x
pconnect features.
... its interface is defined at js/x
pconnect/idl/x
pccomponents.idl.
...declared in the interface) method or property of an x
pcom object.
...And 2 more matches
Components object
the components object is the object through which x
pconnect functionality is reflected into javascript.
... the components object is actually a native instance of the nsix
pccomponents interface which is reflected into javascript as a top level object using x
pconnect.
...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 x
pconnect exceptions id constructor for x
pcom 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 x
pconnect call manager the global x
pcom 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 nsihtt
pchannel allows response headers to be retrieved for the corresponding http transaction.
... this interface must be used only from the x
pcom main thread.
... implemented by netwerk/base/src/nsbasechannel.cpp and netwerk/protocol/http/src/nshtt
pchannel.cpp.
...And 2 more matches
nsIComponentRegistrar
x
pcom/components/nsicomponentregistrar.idlscriptable this interface provides methods to access and modify the x
pcom component registry.
...x
pcom <= 1.8: if aspec is null, then the application component's directory as defined by ns_x
pcom_component_dir will be registered.
...x
pcom >= 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
x
pcom/io/nsidirectoryservice.idlscriptable this interface provides methods to initialize and configure a directory service instance.
... the x
pcom directory service implements this interface to provide support for a variety of well-known file and directory locations.
...in the case of the x
pcom directory service, this method is called as part of x
pcom initialization.
...And 2 more matches
nsIProperties
x
pcom/ds/nsiproperties.idlscriptable this interface provides methods to access a map of named x
pcom 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 x
pcom object associated with a particular name.
...nsmemory.h defines the macro ns_free_x
pcom_allocated_pointer_array, which can be used to free akeys when it is no longer needed.
...And 2 more matches
nsISHEntry
nsdocshelleditordataptr forgeteditordata(); violates the x
pcom interface guidelines nsicontentviewer getanycontentviewer(out nsishentry ownerentry); void getscrollposition(out long x, out long y); void getviewerbounds(in nsintrect bounds); native code only!
... boolean hasdetachededitor(); violates the x
pcom interface guidelines boolean hasdynamicallyaddedchild(); boolean isdynamicallyadded(); void seteditordata(in nsdocshelleditordataptr adata); violates the x
pcom interface guidelines void setissubframe(in boolean aflag); void setscrollposition(in long x, in long y); void settitle(in astring atitle); void setuniquedocidentifier(); void seturi(in nsiuri auri); void setviewerbounds(in nsintrect bounds); native code only!
... 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 x
pcom interface guidelines forgeteditordata() gets the owning pointer to the editor data assosicated with this shistory entry.
...And 2 more matches
nsISupports proxies
x
pcom proxies were a technology which allowed code to make asynchronous or synchronous x
pcom calls to a different thread on arbitrary x
pcom interfaces.
... about x
pcom 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 x
pcom/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 sto
pchecking(in unsigned short duration); constants constant value description current_check 1 constant for the sto
pchecking() method indicating that only the current update check should be stopped.
... current_session 2 constant for the sto
pchecking() method indicating that all update checks during the current session should be stopped.
... any_checks 3 constant for the sto
pchecking() method indicating that all update checking should be stopped.
...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 o
pcodes.
... the elements of the array are objects, each of which describes a single o
pcode, and contains the following properties: linenumber: the line number of the current o
pcode.
... columnnumber: the column number of the current o
pcode.
...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 t
pcache is used to cache touch points for processing outside of the event where they were fired.
... // log events flag var logevents = false; // touch point cache var t
pcache = new array(); register event handlers event handlers are registered for all four touch event types.
...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 < t
pcache.length; i++) { if (t
pcache[i].identifier == ev.targettouches[0].identifier) point1 = i; if (t
pcache[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(t
pcache[point1].clientx - ev.targettouches[0].clientx); var diff2 = math.abs(t
pc...
...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 zi
pcodeformatexception.
... /* * creates a zi
pcode object.
... * * accepted formats for a zip code are: * 12345 * 12345-6789 * 123456789 * 12345 6789 * * if the argument passed to the zi
pcode constructor does not * conform to one of these patterns, an exception is thrown.
...And 2 more matches
Preferences - Archive of obsolete content
note: this article doesn't cover all available methods for manipulating preferences; please refer to the x
pcom reference pages listed in resources section for the complete list of methods.
... x
pcom interfaces for preferences system mozilla exposes its preferences system through a few x
pcom interfaces.
... the preferences service is instantiated in the same way you instantiate any x
pcom service.
... resources other documentation on preferences preferences api a brief guide to mozilla preferences — describes preferences system from user's/administrator's pov mozilla x
pcom 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_x
pcom_abi, separated by an underscore (_).
... examples <em:targetplatform>winnt_x86-msvc</em:targetplatform> <em:targetplatform>linux</em:targetplatform> <em:targetplatform>darwin_p
pc-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 x
pcom components plugins search plugins dlls loaded with ctypes dictionaries window icons examples <description about="urn:mozilla:install-manifest"> <em:id>extension@mysite.com</em:id> <em:unpack>true</em:unpack> ...
... %app_abi% the value of the target_x
pcom_abi value from the firefox build system, identifying the compiler/architecture combination used to compile the current application.
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 x
pcnativewrappers.
...objects passed out of the sandbox will not be wrapped in x
pcnativewrappers but will still be wrapped in inter-compartment proxies.
...objects passed out of the sandbox will not be wrapped in x
pcnativewrappers but will still be wrapped in inter-compartment proxies.
...chromeworkers also have access to ctypes and a limited number of thread safe x
pcom classes, but are otherwise limited to simple computation based on data passed via messages and xmlhttprequests.
Handling Preferences - Archive of obsolete content
managing preferences with x
pcom we use the preferences service in order to get and set preference values: this._prefservice = cc["@mozilla.org/preferences-service;1"].getservice(ci.nsiprefbranch); // ...
...if you are going to use x
pcom, you should always set a default value to your preferences, or use a try / catch block to prevent unhandled errors.
... preference listeners the x
pcom way to add a listener was mentioned in the x
pcom 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 ap
pcoast.
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 = \ x
pcom \ string \ $(null) cppsrcs = bdsstubloader.cpp extra_dso_ldopts += \ $(dist)/lib/$(lib_prefix)x
pcomglue_s.$(lib_suffix) \ $(x
pcom_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 x
pcom glue libraries.
... see x
pcom 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/x
pcom/glue/standalone/nsgluelinkingosx.cpp .
Monitoring WiFi access points - Archive of obsolete content
code with universalx
pconnect privileges can monitor the list of available wifi access points to obtain information about them including their ssid, mac address, and signal strength.
...<html> <head> <title>wifi monitor example</title> <script> var count = 0; function test() { } test.prototype = { onchange: function (accesspoints) { netscape.security.privilegemanager.enableprivilege('universalx
pconnect'); 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('universalx
pconnect'); if (iid.equals(components.interfaces.nsiwifilistener) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_error_no_interface; }, } netscape.security.privilegemanager.enableprivilege('universalx
pconnect'); var listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"].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 universalx
pconnect 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/* x
pcom 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_x
pcom_abi} all of the files which are loaded from the main extension directory are loaded from the subdirectory /platform/{platform string} if it exists.
... for example, if a plugin vendor wanted to make a plugin available for consumer computers running linux(of the form: /platform/linux*/), macintosh(of the form: /platform/darwin*/), and windows(of the form: /platform/win*/), it would provide the following files: /platform/linux_x86-gcc3/plugins/libmyplugin.so /platform/winnt_x86-msvc/plugins/myplugin.dll /platform/darwin_p
pc-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_x
pcom_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/ x
pcnativewrappers=yes content browser jar:browser.jar!/content/browser/ x
pcnativewrappers=yes overlay chrome://global/content/viewsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://global/content/viewpartialsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://browser/content/pageinfo.xul chrome://pippki/content/pageinfooverlay.xul two packages are listed...
...the x
pcnativewrappers=yes part at the end of the manifest line is a flag that may optionally be used.
...if the x
pcnativewrappers flag is specified, it indicates that scripts running in a privileged context don't call these overridden versions, but the original built-in versions instead.
...for more information about this feature, see x
pcnativewrapper.
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 x
pcom article.) getting application information after you obtained the app info component, you can read its properties to get the application's id, human-readable name, version, platform version, etc.
... 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/x
pcom/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 x
pcshell tests in firefox 21, a testing module was added that provides access to app info during the execution of x
pcshell tests.
... see bug 809920, and in summary: // work around the fact that x
pcshell doesn't have a proper app-info x
pcom object.
What XULRunner Provides - Archive of obsolete content
the following features are either already implemented or planned: gecko features x
pcom 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 i
pc 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) javax
pcom 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) pyx
pcom embedding (not yet complete) - but it does work, if you compile a custom build that includes the pyx
pcom bindings and there is a working python available.
... activestate uses pyx
pcom in their products.
2006-09-06 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - oct 06-13, 2006 announcements none during this week.
... discussions windows gecko-sdk and g++ components discussion on the problems and possible solutions running cygwin/g++ compiled x
pcom components with windows-based gecko-sdk/xulrunner dll/exes.
... threading in x
pcom rules on threading in x
pcom or to firefox extensions.
... how to build x
pcom component on mac os x a tutorial on how to build x
pcom component on mac os x firefox crashes when calling a function provided by a .so library a solution to the problem loading a shared library when using x
pcom firefoxes crashes while getting url in x
pcom solutions to resolve the problem of the firefox crash when trying to get the path and the prepath of the url of the current page in x
pcom meetings none during this week.
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - oct 13-20, 2006 announcements none during this week.
... discussions wxmozilla and ff1.5 x
pcom problems updating wxmozilla to use it with firefox 1.5.7 browser elements, opening links in a new window using javascript to open window in new window.
... general x
pcom and nscomptr questions nscomptr basics regarding myicomponent usage.
... fedora security blocking x
pcom registration fedora core 5.0 security settings impeding x
pcom registration.
NPObject - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npobject is a structure that holds a pointer to an n
pclass and an integer reference count, and possibly also implementation specific (i.e.
...npobject behavior is implemented using the set of callback functions defined in n
pclass.
... syntax struct npobject { n
pclass *_class; uint32_t referencecount; /* * additional space may be allocated here by types of npobjects */ }; fields _class a pointer to the n
pclass of which the object is a member.
... 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 n
pclass ...
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 x
pcom 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 x
pcom-shutdown or quit-application notifications and unregister your observers from that topic: var myobserver = { observe: function(subject, topic, data) { if (topic == "x
pcom-shutdown") { services.obs.removeobserver(myobserver, "private-browsing"); services.obs.removeobserver(myobserver, "x
pcom-shutdown"); } else { // do something with "private-browsing" } } }...
...; services.obs.addobserver(myobserver, "private-browsing", false); services.obs.addobserver(myobserver, "x
pcom-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 x
pcom 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 x
pcom components scriptable interfaces interfaces allow x
pcom components to expose their functionality to the outside world while hiding the inner details of the component implementation.
... x
pconnect x
pconnect is a technology that allows scriptable interfaces to be used/implemented from/in javascript scripts.
... no other scripts languages are supported by x
pconnect.
... python there's an extension extensions/python that bridges the gap between x
pcom and python, allowing scriptable interfaces to be used/implemented from/in python scripts.
Mozilla accessibility architecture
the shared code makes itself available to the toolkit-specific code via generic x
pcom interfaces that return information about objects we want to expose.
...the toolkit-specific classes then use these x
pcom interfaces to gather information about the objects they want to expose, make any necessary changes, and then expose the information using microsoft com on windows, or through gtk2's atk api's on linux and unix.
... 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 x
pcom 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_x
pcom_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 assignnon
pctcolwidths: assignnon
pctcolwidths en max=4500 count=0 ***start table dump*** mcolwidths=-1 -1 -1 -1 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** colindex=0 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** colindex=1 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **s...
...+ 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 assignnon
pctcolwidths shows that already to all columns a width of 360 twips has been assigned assignnon
pctcolwidths 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 x
pcom strings (the "external" string api) you can use the following values: ;; mozilla (1.9) ; internal strings nsastring_internal=<mdata,su>, length=<mlength,u> nsacstring_internal=<mdata,s>, length=<mlength,u> ; x
pcom strings nsastring=<nsstringcontainer.v,su>, length=<nsstringcontainer.d1,u> nsacstring=<nscstringcontainer.v,s>, length=<nscstringcontainer.d1,u> nsstringcontainer=<v,su>, length=<d1...
...this is how you would normally set it: set x
pcom_debug_break=warn the environment variable takes also other values besides warn, see x
pcom_debug_break for more details.
...then use x
pcom_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 nsx
pconnect.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 x
pcom component.
... each method below of adding new objects to the navigator object requires that the new object is a registered x
pcom component.
... you can read about creating and registering x
pcom components in javascript.
...you can learn more about contract ids are unique text identifiers for x
pcom components.
Makefile - variables
extra_components nsdefaultclh.manifest, javascript x
pcomm files extra_dso_libs extra_dso_ldopts extra_js_modules extra_pp_components x
pcomm files to pre-process before installation.
...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_x
pctools moz_xul moz_x11 test variable description enable_tests boolean value that should wrapper all unit tests to allow disabling on demand[1].
... python_unit_tests list of python scripts to check exit status for make check x
pc_shell_tests no_x
pcshell_manifest_check inhibit validating manifest files when running x
pcshell tests.
... todo: x
pcom/xpinstall variables: https://developer.mozilla.org/en/adding_x
pcom_components_to_mozilla_build_system ...
Interface development guide
x
pcom interfaces define classes that are implemented to provide key functionality in the mozilla platform.
... documentation xpidl the x
pcom interface description language is used to specify x
pcom interface classes.
... idl interface rules design guidelines and rules when creating and changing x
pcom interfaces.
... mailing list newsgroup rss feed related topics javascript, x
pcom, 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.i
pc.shims.enabledwarnings preference and watching the browser console as you use the add-on.
...the subject for the observer notification will be an nsihtt
pchannel as you would expect.
... a common pattern here is to use the notificationcallbacks property of the nsihtt
pchannel to get the dom window that initiated the load, like this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var htt
pchannel = subject.queryinterface(ci.nsihtt
pchannel); var domwindow = htt
pchannel.notificationcallbacks.getinterface(ci.nsidomwindow); } } or this: observe: function (subject, topic, data) { if (topic == "http-on-modify-request") { var htt
pchannel = subject.queryinterface(ci.nsihtt
pchannel); var domwindow = htt
pchannel.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 htt
pchannel = subject.queryinterface(ci.nsihtt
pchannel); var loadcontext = htt
pchannel.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
x
pcshell tests here are the simple guidelines for adding an x
pcshell test to the build system.
... for example, to add an x
pcshell test to a module, do the following: copy tools/test-harness/x
pcshell-simple/example to yourmoduledir/tests_type, wheretests_type is something that describes your tests.
... in <tt>yourmoduledir/tests_type/makefile.in</tt> change depth, module, and x
pcshell_tests appropriately: depth should be a relative path pointing to <tt>mozilla/</tt>, e.g.
... x
pcshell_tests be a list of subdirectories of the current directory which contain x
pcshell tests.
Profiling with the Firefox Profiler
black: these indicate synchronous i
pc calls.
... profiling js benchmark (x
pcshell) to profile the script run.js with ionmonkey (-i), type inference (-n) and jäegermonkey (-m).
... thgis requires the following command: $ x
pcshell -m -i -n -e ' const ci = components.interfaces; const cc = components.classes; var profiler = cc["@mozilla.org/tools/profiler;1"].getservice(ci.nsiprofiler); profiler.startprofiler( 10000000 /* = profiler memory */, 1 /* = sample rate: 100µs with patch, 1ms without */, ["stackwalk", "js"], 2 /* = features, and number of features.
... */ ); ' -f ./run.js -e ' var profileobj = profiler.getprofiledata(); print(json.stringify(profileobj)); ' | tail -n 1 > run.cleo the x
pcshell output all benchmark information and on its last line it output the result of the profiling, you can filter it with tail -n 1 and redirect it to a file to prevent printing it in your shell.
MailNews automated testing
functional testing x
pcshell-tests and make check these are core test harnesses to which mailnews adds its own tests.
... x
pcshell-tests are run in javascript without any chrome present.
...x
pcshell-tests are the quickest tests to run.
...these tests can go beyond the limitations of x
pcshell-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 (p
pc, alpha, x86) o macos (power
pc) 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...
... --ext
pc 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] [--ext
pc] [--extia] [--extskid] the series of numbers and --ext* options set certificate extensions that can be added to the certificate when it is generated by the ca.
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkf
pcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
SpiderMonkey Build Documentation
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 x
pconnect pointers are also traced in this way.
... see x
pcjsruntime::traceblackjs and x
pcjsruntime::tracegrayjs.
...there are several examples of this usage in x
pconnect.
... one saving grace is that most weak pointers already have a read barrier on them: x
pc_unmarkgray().
Bundling multiple binary components
background binary x
pcom components are sometimes required to implement low-level features for extensions.
...if the component uses only "frozen" x
pcom interfaces, there is a good chance the same binary component will work with different versions of gecko (version 1.8 and 1.9, for example).
...the stub component is an x
pcom component itself and when registered by x
pcom, the code would sniff the runtime version and operating system then the stub load the appropriate "real" x
pcom component for the current configuration.
... it's pretty simple to do and the concept can be used to load third-party shared libraries (dll, so, dylib) used in x
pcom components.
Components.Exception
summary components.exception is a javascript constructor to create nsix
pcexception objects.
... these exception objects may be thrown when implementing x
pcom interfaces in javascript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.
... see also nsix
pcexception.
... 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 x
pcom stack to be set on the exception (defaulting to the current stack chain) data any additional data you might want to store, defaulting to null example throw components.exception("i am throwing an exception from a javascript x
pcom component."); ...
Components.isSuccessCode
summary determines whether a given x
pcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively.
... description components.issuccesscode() may be used to determine whether an x
pcom return code (an nsresult) indicates success or failure.
... an x
pcom return code indicates success if its high-order bit is 0, and it indicates failure if its high-order bit is 1.
... note: a non-zero x
pcom return code (that is, not ns_ok) does not necessarily indicate failure.
Components.utils.forceGC
this mechanism doesn't account for any native (c++) x
pcom objects hanging off javascript objects though.
... in many cases a javascript application will have internal knowledge of javascript objects referencing large (trees of) x
pcom objects and know when they are no longer reachable.
...this will make sure that x
pcom components that build cycles with javascript objects also get collected which might be important, for example for testcases that depend on the garbage collector.
... requires universalx
pconnect privileges.
Components.utils.import
for example, you can import x
pcomutils.jsm to avoid copy/pasting long x
pcom component registration boilerplate in your component files.
... example components.utils.import("resource://gre/modules/x
pcomutils.jsm", this); difference from mozijssubscriptloader the differences from mozijssubscriptloader: the behavior when importing/loading the same code from different locations: the subscript loader evaluates the specified code each time it is invoked, with the caller's global object.
... 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.x
pcomutils === scope1.x
pcomutils); ...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 x
pccomponents.idl the tests in js/x
pconnect/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/x
pcom directory.
... build instructions the build instructions are available here: building javax
pcom.
... bugs all javax
pcom bugs are tracked in bugzilla, using the "core" product and "java to x
pcom bridge" component.
... list of open javax
pcom bugs open a new javax
pcom bug checkins within the last month ...
Architecture basics
x
pcom is like com, for windows.
... x
pconnect is what lets javascript talk with mozilla guts, the x
pcom system.
... x
pcshell is a command line interface to mozilla javascript.
... it's an interactive interpreter -- it gives you a shell that talks straight to mozilla, via javascript's x
pconnect bridge into it.
Using components
x
pconnect works transparently in mozilla and x
pcshell to give you access to x
pcom 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: x
pcshell -- 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 nsx
pccomponents_utils] interfaces=[object nsx
pccomponents_interfaces] classes=[object nsx
pccomponents_classes] results=[object nsx
pccomponents_results] issuccesscode=function issuccesscode() { [native code] } constructor=[object nsx
pccomponents_constructor] queryinterface=function queryinterface() { [native code] } interfacesbyid=[object nsx
pccomponents_interfacesbyid] classesbyid=[object nsx
pccomponen...
...ts_classesbyid] stack=js frame :: scratchpad/4 :: cdump :: line 8 manager=[x
pconnect wrapped nsicomponentmanager] id=[object nsx
pccomponents_id] exception=[object nsx
pccomponents_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
« x
pcom api reference summary the ns_getmemorymanager function returns a reference to the x
pcom memory manager.
... #include "nsx
pcom.h" #include "nsimemory.h" nsresult ns_getmemorymanager( nsimemory** aresult ); parameters aresult [out] a reference to the x
pcom memory manager.
... remarks the object returned is a singleton that is valid until ns_shutdownx
pcom 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 x
pcom memory manager's methods.
NS_Realloc
« x
pcom api reference summary reallocates a block of memory using the x
pcom memory manager.
... #include "nsx
pcom.h" void* ns_realloc( void* aptr, prsize asize ); parameters aptr [in] a pointer to the block of memory to reallocate.
... this pointer must have been previously allocated by the x
pcom memory manager, or this parameter may be null in which case this function behaves like ns_alloc.
... remarks this function provides a convenient way to access the x
pcom memory manager.
NS_ConvertASCIItoUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowerca...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequal...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars 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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars 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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars 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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
...char 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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(...
...char 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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char ass...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii ...
...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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars 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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 stri
pchars 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 stri
pchar 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 stri
pchars void stri
pchars(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> stri
pchar void stri
pchar(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 onsto
pcontainer(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.
... onsto
pcontainer() warning: do not implement this.
...void onsto
pcontainer( in imgirequest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object.
...you probably want onsto
pcontainer 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 x
pcom 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 x
pcom interface guidelines wrappersenabled() returns whether x
pcnativewrappers are enabled for the specified uri.
... boolean wrappersenabled( in nsiuri auri ); parameters auri the uri for which to determine if x
pcnativewrappers are enabled.
... return value true if x
pcnativewrappers are enabled for the specified uri; otherwise false.
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 x
pcom interface guidelines void finishrestore(); void firepagehidenotification(in boolean isunload); native code only!
... violates the x
pcom interface guidelines detacheditorfromwindow() disconnects this docshell's editor from its window, and stores the editor data in the open document's session history entry.
...resumerefreshuris() restart the x
pcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively.
... suspendrefreshuris() cancel the x
pcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively.
nsIErrorService
x
pcom/base/nsierrorservice.idlscriptable this is a service that allows nsresult codes to be mapped to string bundles that can be used to look up error messages.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/x
pcom/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 x
pcom/base/nserror.h, such as ns_error_module_storage.
...should be one of the modules listed in x
pcom/base/nserror.h, such as ns_error_module_storage.
nsIFile
x
pcom/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 x
pconnect.
... a string containing characters encoded in the native character set cannot be safely passed to javascript via x
pconnect.
... x
pcom provides the string conversion functions ns_cstringtoutf16 and ns_utf16tocstring, which can be used to convert a string between utf-16 and the native character encoding.
Building an Account Manager Extension
components.utils.import("resource://gre/modules/x
pcomutils.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: x
pcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextension ]) } step 2: building a component we convert the interface to a x
pcom component and register it in the component manager as account manager extension.
...devmoaccountmanagerextension.prototype.contractid = "@mozilla.org/accountmanager/extension;1?name=example@mozilla.org"; // add the component to the mailnews-accountmanager-extensions category devmoaccountmanagerextension.prototype._x
pcom_categories: [{ category: "mailnews-accountmanager-extensions" }], // create entry point for the module if (x
pcomutils.generatensgetfactory) var nsgetfactory = x
pcomutils.generatensgetfactory([devmoaccountmanagerextension]); else var nsgetmodule = x
pcomutils.generatensgetmodule([devmoaccountmanagerextension]); step3: create the new panel as next step we create the xul and the property fi...
... how to build an x
pcom component in javascript ...
nsISecurityCheckedComponent
caps/idl/nsisecuritycheckedcomponent.idlscriptable provides methods that let an x
pcom component define custom rules for accessing it from potentially unprivileged code.
... two examples: code that has the "universalx
pconnect" capability is allowed to access all of x
pcom.
... this includes creating instances of arbitrary x
pcom objects and calling methods and setting properties on them.
...this interface is used in mozilla by x
pconnect and a handful of things that need special handing (xul controllers, the ui for the <video> tag, etc.).
nsISyncMessageSender
both sendsyncmessage() and sendr
pcmessage() will block until a reply is received, but they may be temporarily interrupted to process an urgent incoming message (such as a cpow request).
... methods jsval sendsyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); jsval sendr
pcmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsiprincipal principal); sendsyncmessage() like sendasyncmessage(), except blocks the sender until all listeners of the message have been invoked.
...sendr
pcmessage() like sendsyncmessage(), except re-entrant.
... new r
pc messages may be issued even if, earlier on the call stack, we are waiting for a reply to an earlier sendr
pcmessage() call.
nsITextInputProcessor
if this is specified with non-zero keycode attribute value, this causes throwing an exce
pction 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 awra
pcolumn); void saveuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextraheaders, in nsisupports afile, in nsiloadcontext aprivacycontext); void saveprivacyawareuri(in nsiuri auri, in nsisupports acachekey, in nsiuri areferrer, in long areferrerpolicy, in nsiinputstream apostdata, in string aextrahea...
... void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awra
pcolumn ); parameters adocument document to save to file.
... awra
pcolumn for text documents, indicates the desired width to wrap text at.
... areferrerpolicy the referrer policy to use for the request, taken from nsihtt
pchannel.
nsIXULRuntime
x
pcom/system/nsixulruntime.idlscriptable provides information about the xul runtime to allow extensions and xul applications to determine information about the xul runtime.
... x
pcomabi autf8string a string tag identifying the binary abi of the current processor and compiler vtable.
... this is taken from the target_x
pcom_abi configure variable.
... the result takes the form <processor>-<compilerabi>, for example: x86-msvc p
pc-gcc3.
Using the clipboard
three x
pcom objects are needed to handle clipboard operations.
...the clipboard model in mozilla requires you to perform the following steps to copy data: create an x
pcom wrapper for the data which you want to put on the clipboard.
...first, we need to create an x
pcom object to wrap what we want to copy.
...we need to convert the data back into a javascript string from an x
pcom object.
Working with Multiple Versions of Interfaces
the problem in this short note we illustrate how one can update an x
pcom 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 x
pcom component so that first tries to get the interface by it's new iid, then if that fails, attempts plan b.
...all the x
pcom 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 x
pcom component).
xpidl
xpidl is a tool for generating x
pcom interface information, based on xpidl interface description files.
... it generates: c++ header files (.h), with a commented template for full c++ implementation of the interface x
pconnect typelib files (.xpt), with runtime type information to dynamically call x
pcom objects through x
pconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk.
...the xpidl compiler is now part of the build process, allowing us to generate headers used by the x
pcom 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 x
pconnect typelib (.xpt) doc generate html documentation (.html) java generate java interface (.java) ...
Index
41 mailnews x
pcshell-tests automated testing, developing mozilla, mailnews, seamonkey, thunderbird mailnews x
pcshell-tests are written and run in the same manner as the core x
pcshell-tests.
... this page describes additional resources and facilities that mailnews has developed to support the x
pcshell-tests; see the core x
pcshell-tests page for more information on how to develop these.
...things appear confusing for several reasons: 45 message interfaces interfaces, interfaces:scriptable, needscontent, x
pcom api reference, thunderbird nsimsghdr - this interface describes headers for all mail messages.
...it shares many of the technologies used by mozilla firefox, including javascript, the gecko layout engine, the xul xml user interface language and the x
pcom cross-platform component object model.
Using COM from js-ctypes
ispnotifysource */ /* start inherit from ispeventsource */ void* setinterest; void* getevents; void* getinfo; /* end inherit from ispeventsource */ /* start ispvoice */ void* setoutput; void* getoutputobjecttoken; void* getoutputstream; void* pause; void* resume; void* setvoice; void* getvoice; hresult (__stdcall *speak)(struct myispvoice*, l
pcwstr pwcs, dword dwflags, ulong* pulstreamnumber); void* speakstream; void* getstatus; void* skip; void* setpriority; void* getpriority; void* setalertboundary; void* getalertboundary; void* setrate; void* getrate; void* setvolume; void* getvolume; void* waituntildone; void* setsyncspeaktimeout; void* getsyncspe...
...dcall_abi; // libraries let lib = ctypes.open('ole32.dll'); // types // simple types let byte = ctypes.unsigned_char; let dword = ctypes.unsigned_long; let long = ctypes.long; let lpvoid = ctypes.voidptr_t; let void = ctypes.void_t; let ulong = ctypes.unsigned_long; let ushort = ctypes.unsigned_short; let wchar = ctypes.jschar; // advanced types - based on simple types let hresult = long; let l
pcwstr = wchar.ptr; // guess types - these just work i couldnt find a proper defintion for it let lpunknown = ctypes.voidptr_t; // structures // simple structures let guid = ctypes.structtype('guid', [ { 'data1': ulong }, { 'data2': ushort }, { 'data3': ushort }, { 'data4': byte.array(8) } ]); // advanced structures let clsid = guid; let iid = guid; // super advanced structures let refii...
...: ctypes.voidptr_t }, { 'getoutputobjecttoken': ctypes.voidptr_t }, { 'getoutputstream': ctypes.voidptr_t }, { 'pause': ctypes.voidptr_t }, { 'resume': ctypes.voidptr_t }, { 'setvoice': ctypes.voidptr_t }, { 'getvoice': ctypes.voidptr_t }, { 'speak': ctypes.functiontype(callback_abi, hresult, // return [ ispvoice.ptr, l
pcwstr, // *pwcs dword, // dwflags ulong // *pulstreamnumber ]).ptr }, { 'speakstream': ctypes.voidptr_t }, { 'getstatus': ctypes.voidptr_t }, { 'skip': ctypes.voidptr_t }, { 'setpriority': ctypes.voidptr_t }, { 'getpriority': ctypes.voidptr_t }, { 'setalertboundary': ctypes.voidptr_t }, { 'getalertboundary': c...
... '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 r
pc_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) { sto
pcapture(); }, 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 sto
pcapture() method is called when the "stop capture" button is clicked.
... function sto
pcapture(evt) { let tracks = videoelem.srcobject.gettracks(); tracks.foreach(track => track.stop()); videoelem.srcobject = null; } dumping configuration information for informational purposes, the startcapture() method shown above calls a method named dumpoptions(), which outputs the current track settings as well as the constraints that were placed upon the stream when it was created.
... a second button, "stop capture", which upon being clicked calls sto
pcapture() to terminate capture of screen contents.
Using Service Workers - Web APIs
the previous attempt — ap
pcache — seemed to be a good idea because it allowed you to specify assets to cache really easily.
... note: as of firefox 44, when ap
pcache is used to provide offline support for a page a warning message is now displayed in the console advising developers to use service workers instead (bug 1204581.) service workers should finally fix these issues.
... service worker syntax is more complex than that of ap
pcache, but the trade off is that you can use javascript to control your ap
pcache-implied behaviors with a fine degree of granularity, allowing you to handle this problem and many more.
...furthermore, if you use ap
pcache and sw on a page, browsers that don’t support sw but do support ap
pcache will use that, and browsers that support both will ignore the ap
pcache and let sw take over.
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="hangu
pcall();" disabled> hang up </button> </div> </div> the page structure defined here is using <div> elements, giving us full control over the page layout by enabling the use of css.
... finally, the "hangup-button" <button>, to disconnect from a call, is defined and configured to start disabled (setting this as our default for when no call is connected) and apply the function hangu
pcall() on click.
... hanging up when the user clicks the "hang up" button to end the call, the hangu
pcall() function is called: function hangu
pcall() { closevideocall(); sendtoserver({ name: myusername, target: targetusername, type: "hang-up" }); } hangu
pcall() executes closevideocall() to shut down and reset the connection and release resources.
<length> - CSS: Cascading Style Sheets
pc one pica.
... 1
pc = 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 em
pcount on the global scope.
...var em
pcount = 43; employeedetails = { name: 'xyz', age: 5, designation: 'developer' }; // adminname is a property of the global scope.
...delete adminname; // returns true // on the contrary, em
pcount is not configurable // since var was used.
... delete em
pcount; // returns false // delete can be used to remove properties from objects.
instanceof - JavaScript
note for mozilla developers: in code using x
pcom, instanceof has special effect: obj instanceof x
pcominterface (e.g.
... components.interfaces.nsifile) calls obj.queryinterface(x
pcominterface) and returns true if queryinterface succeeded.
... a side effect of such call is that you can use x
pcominterface's properties on obj after a successful instanceof test.
... unlike standard javascript globals, the test obj instanceof x
pcominterface works as expected, even if obj is from a different scope.
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 (ad
pcm), in which each sample is represented not by its absolute value, but as a value indicating how much the new sample differs from the previous sample.
...4 kbps; however, in practice 64 kbps is always used g.722 annex b super wide-band: 64 kbps, 80 kbps, and 96 kbps g.722 annex d stereo wide-band: 64 kbps and 80 kbps g.722 annex d stereo super wide-band: 80 kbps, 96 kbps, 112 kbps, and 128 kbps variable bit rate (vbr) support no supported sample formats 14-bit integer supported sample rates 16 khz (ad
pcm is specified to allow 8 khz, 11.025 khz, 22.05 khz, 44.1 khz, but g.722 uses 16 khz) recommended minimum bit rate for stereo sound 128 kbps at 44.1 khz sample rate compression lossy maximum audio channels 2 audio frequency bandwidth 50 hz - 7 khz latency 4 ms browser compatibility feature chr...
Media container formats (file types) - Web media technologies
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 ad
pcm 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 ad
pcm (adaptive differential pulse code modulation) no gsm 06.10 no l
pcm (linear pulse code modulation) yes mpeg-1 audio layer iii (mp3) no µ-law (u-law) no webm webm (web media) is a format based on matroska which is designed specifically for use in modern web environments.
Bookmarks - Archive of obsolete content
note that this example takes advantage of x
pcomutils 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: x
pcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmarklistener); }, dosomething: functio...
...n() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using x
pcom without chrome - bookmark observer ...
Finding window handles - Archive of obsolete content
this code can be used from external application or from an x
pcom 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|p
pc64|s390|x86_64)-/.test(services.appinfo.x
pcomabi) ?
...face(ci.nsibasewindow); var gdkwindowptrstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var gdk = ctypes.open('libgdk-x11-2.0.so.0'); var x11 = ctypes.open('libx11.so.6'); // types let guint32 = ctypes.uint32_t; let gdkwindow = ctypes.structtype('gdkwindow'); let gdkdrawable = ctypes.structtype('gdkdrawable'); let card32; if (/^(alpha|hppa|ia64|p
pc64|s390|x86_64)-/.test(services.appinfo.x
pcomabi)) { card32 = ctypes.unsigned_int; } else { card32 = ctypes.unsigned_long; } let xid = card32; //https://developer.gnome.org/gdk2/stable/gdk2-x-window-system-interaction.html#gdk-x11-drawable-get-xid var gdk_x11_drawable_get_xid = gdk.declare('gdk_x11_drawable_get_xid', ctypes.default_abi, xid, gdkdrawable.ptr); var browserwindow_madeinto...
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 x
pcom 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 x
pcom 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("x
pcsafejsobjectwrapper.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("5lit5pahigvzcghdsw9sievuz2x
pc2gg4ks54ks/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//qaaaaaaoeeyogeo
pc3cigaa/gjsqmyqiaaaaabwaaabeaaaaop7//xuaaaaaqq4qhgjddqzqdaciaaaaraaaagqaaacg/v//zqaaaabcdhcpakuogi4drq4gjqrfdiimbugomiygsa44gwdndkbsdjhbdjbbdihcdibcdhhcdhbcdggafaaaakwaaadi/v//agaaaaaaaaaaaaaaaaaaaaaaaadqbeaaaaaaalaeqaaaaaaaaaaaaaaaaaabaaaaaaaaaaeaaaaaaaaadaaaaaaaaacoa0aaaaaaaa0aaaaaaaaalavaaaaaaaazaaaaaaaaaoagyaaaaaaagwaaaaaaaaaiaaaaaaaaaboaaaaaaaaa6azgaaaaaaacaaaaaaaaaagaaaaaaaaa9f7/bwaaaabgakaaa...
...aaaaawgeaabeadwcgbuaaaaaaaaqaaaaaaaaa0qeaabiadqagbuaaaaaaaguaaaaaaaaa4qeaabaagqaycwaaaaaaaaaaaaaaaaaa5geaabiadqaqbeaaaaaaaaaaaaaaaaaa7qeaabaagqaqcwaaaaaaaaaaaaaaaaaa+qeaabiadqaabuaaaaaaabuaaaaaaaaa/geaacaaaaaaaaaaaaaaaaaaaaaaaaaaegiaabecgaaqcwaaaaaaaaaaaaaaaaaahgiaacaaaaaaaaaaaaaaaaaaaaaaaaaaoaiaabiacwcoa0aaaaaaaaaaaaaaaaaaagluaxquywbjcnrzdhvmzi5jaf9fsknsx0xju1rfxwbkzxjlz2lzdgvyx3rtx2nsb25lcwbyzwd
pc3rlcl90bv9jbg9uzxmax19kb19nbg9iywxfzhrvcnnfyxv4agnvbxbszxrlzc42mzu5af9fzg9fz2xvymfsx2r0b3jzx2f1ef9maw5px2fycmf5x2vudhj5agzyyw1lx2r1bw15af9fznjhbwvfzhvtbxlfaw5pdf9hcnjhev9lbnryeqbozwxsby5jaf9frljbtuvfru5ex18ax19kq1jfru5ex18ax19pbml0x2fycmf5x2vuzabfrfloqu1jqwbfx2luaxrfyxjyyxlfc3rhcnqax0dmt0jbtf9prkztrvrfvefctevfaf9fbgliy19jc3vfzmluaqbfsvrnx2rlcmvnaxn0zxjutunsb25lvgfibguazgf0yv9zdgfydabwdxrzqebhtelcq...
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 x
pcom code used to define and call x
pcom components in javascript running applications code used to run other applications <canvas> related what wg canvas-related code signing a xpi how to sign an xpi with pki delayed execution performing background operations.
...window handles can be used for i
pc and accessibility purposes.
... using the windows registry with x
pcom how to read, write, modify, delete, enumerate, and watch registry keys and values.
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 x
pcom components of your own.
...you should still be caching a reference to your string bundle on add-on startup, preferably using x
pcomutils.jsm to lazily load the file.
... for example: components.utils.import("resource://gre/modules/services.jsm"); components.utils.import("resource://gre/modules/x
pcomutils.jsm"); x
pcomutils.definelazygetter(this, "strings", function() { return loadpropertiesfile("chrome://myaddon/locale/mystrings.properties"); }); function loadpropertiesfile(path) { /* hack: the string bundle cache is cleared on addon shutdown, however it doesn't appear to do so reliably.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
these classes must now be created using x
pcom: // nsisupportsarray is bad!
...(see x
pcom: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 x
pcom 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 "x
pconnect 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 x
pconnect privileges, which we will cover in chapter 4.
...to use this requires x
pconnect privileges, the same as autocomplete does; this will be covered in chapter 4.
Introduction - Archive of obsolete content
xul school was created by ap
pcoast (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 x
pcom.
... next » this tutorial was kindly donated to mozilla by ap
pcoast.
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 x
pcom components.
...however, for netscape 6.1 and netscape 6.2, xpt files, as well as x
pcom plugins, ought to go in the components directory.
... on these browsers, this is the only directory that can "pick up" an xpt file, as well the only directory that can recognize x
pcom components.
BlackConnect - Archive of obsolete content
blackconnect was a blackwood subproject, trying to build a java-to-x
pcom bridge to allow interoperability between java and x
pcom components.
... the goal was to be able to implement x
pcom components written in java instead of c++.
... blackconnect is now superseeded by javax
pcom.
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 x
pcom interfaces for you.
...they handle the event, handle the x
pcom interfaces and pass a simpler data structure to functions of the observer object.
...in some cases, you must provide the x
pcom 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.x
pcom.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 x
pcom class defining the function you'll be doing in javascript.
... then pass the object to your x
pcom 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 x
pcom components, at this time, you need a different technique (refer to the complete java firefox extension).
... a good reason for calling java from within an x
pcom component rather than from xul is to maintain a singleton (some singular java object) across all firefox windows.
...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 x
pcom component.
Table Layout Regression Tests - Archive of obsolete content
avoid the nasty assertions to pop up by set x
pcom_debug_break=warn, the world would be a much better place if we could first fix those assertions.
...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 x
pcom object that implements nsisupportsarray.
... it is really just an x
pcom version of an array.
...we create them using the x
pcom interface nsiatomservice and add them to the array using the appendelement() function.
Building XULRunner - Archive of obsolete content
by default, xulrunner is built with javax
pcom support; the build system must be able to find an appropriate jdk on the system; see the instructions on building javax
pcom for more details.
... if you do not want to build javax
pcom support, specify --disable-javax
pcom in your configuration.
... a basic minimal mozconfig which will build a release configuration of xulrunner is: mk_add_options moz_co_project=xulrunner mk_add_options moz_objdir=@topsrcdir@/obj-xulrunner ac_add_options --enable-application=xulrunner #uncomment the following line if you don't want to build javax
pcom: #ac_add_options --disable-javax
pcom cvs tags and xulrunner versions older xulrunner releases where tagged in cvs with (for instance xulrunner_1_8_0_5_release ) up to version 1.8.0.5 the cvs repository does not have specific tags for xulrunner anymore.
Getting started with XULRunner - Archive of obsolete content
since we are not creating any binary x
pcom 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/x
pcshell /usr/bin/x
pcshell you could also save this script to a file for convenience.
... note: in xulrunner 2.0, the chrome.manifest is now used to register x
pcom 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 x
pconnect.
... to write wrappers in pure javascript to interface with any c library on the system there are mechanisms such as x
pcshell, wxjs, jsdb, jsni coding spidermonkey in c check out this tutorial how to compile tamarin on linux/x86 there is a patch that allows you to compile it.
...see x
pcnativewrapper.
XUL Parser in Python - Archive of obsolete content
but mozilla's u
pcoming support for languages like perl and python will really open up the mozilla platform to tools and approaches of this kind--and make now a good time to start thinking about how these various technologies will be put together.
... the first level of support for python in mozilla will apparently be for python modules made available as x
pcom objects.
... extending on the approach in this script, then, you could imagine a kind of introspective xul chrome that could modify and replicate itself by calling services from the xulparser and xulwriter x
pcom objects.
Adding a new event
make new event class i
pc aware for example, new class is caused by native user input event and needed to be dispatch to content, the class should be able to cross process boundary.
... in such cases, you may need to add new paramtraits for the new event class in nsguieventi
pc.h.
... create x
pcom interface for the dom event if your event class should be accessible via x
pcom interface, you should create a new nsidomfooevent interface in dom/interfaces/events/.
Application cache implementation overview
loading a top level document from offline cache this happens in nshtt
pchannel::opencacheentry().
...nshtt
pchannel::onofflinecacheentryavailable is then invoked.
...until steps described further the document doesn't know anything about its ap
pcache.
Creating a Login Manager storage module
see how_to_build_an_x
pcom_component_in_javascript for more details about javascript components.
... const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/x
pcomutils.jsm"); function sampleloginmanagerstorage() {} sampleloginmanagerstorage.prototype = { classdescription: "sample nsiloginmanagerstorage implementation", contractid: "@example.com/login-manager/storage/sample;1", classid: components.id("{364a118c-747a-4f6d-ac63-2d2998e5a5c1}"), queryinterface: x
pcomutils.generateqi([ci.nsiloginmanagerstorage]), // this registers the category for overriding the built-in nsiloginmanagerstorage _x
pcom_categories: [ { category: "login-manager-storage", entry: "nsiloginmanagerstorage" } ], // console logging service, used for debugging.
...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) x
pcomutils.generatemodule([sampleloginmanagerstorage]); sample c++ implementation bug 309807 contains a complete example.
Creating reftest-based unit tests
running i
pc reftests reftests can also be run in a separate process, which can differ from same-process rendering in significant ways.
... currently, i
pc reftests are only being run on linux.
... to run: moz_layers_force_shmem_surfaces=1 make -c $(objdir) reftest-i
pc note: right now, automation currently only runs layout/reftests/reftest-sanity/reftest.list!
IPDL Best Practices
using ipdl generated structs as data structures outside of i
pc serialization/deserialization ipdl generated structures are meant to facilitate serialization/deserialization and message passing.
... use a flag and the generated actordestroy function to control when ipdl functions can be called; see phtt
pchannelparent/child for an example.
...minimize overall use of messages reducing i
pc traffic is a righteous goal.
SourceMap.jsm
get a reference to the module: let sourcemap = {}; components.utils.import('resource:///modules/devtools/sourcemap.jsm', sourcemap); sourcema
pconsumer a sourcema
pconsumer 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 sourcema
pconsumer(rawsourcemap) the only parameter is the raw source map (either as a string which can be json.parse'd, or an object).
... sourcema
pconsumer.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_registerdefaulthtt
pclient and all functions having names that start with sec_http.
...look at sec_htt
pclientfcn, which is a (versioned) table of function pointers.
...finally register your http client implementation with a call to sec_registerdefaulthtt
pclient.
HTTP delegation
look for function sec_registerdefaulthtt
pclient and all functions having names that start with sec_http.
...look at sec_htt
pclientfcn, which is a (versioned) table of function pointers.
...finally register your http client implementation with a call to sec_registerdefaulthtt
pclient.
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_regex
pcasesearch 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_htt
pcertstore_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_gethtt
pcerts could crash if sec_getregisteredhtt
pclient fails bug 504405: pkix_pl_crldp_create will fail on alloc success because of a missing !
NSS tools : certutil
--ext
pc 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] [ --ext
pc] [--extia] [--extskid] the series of numbers and --ext* options set certificate extensions that can be added to the certificate when it is generated by the ca.
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkf
pcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
certutil
--ext
pc 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] [--ext
pc] [--extia] [--extskid] the series of numbers and --ext* options set certificate extensions that can be added to the certificate when it is generated by the ca.
...yxrlief1dghvcml0etccasiwdqyjkozi hvcnaqebbqadggepadccaqocggebao/bquli2kwqxfkmmmg93kn1sanzntxa/vlf tmrih3hqgjvr1ktiy9ag6cb7dskwmthp/+p4pucmql4zrsgt901qxkepyz2dymm2 rnelk+seuipiutozadhndiyse/yude8vqwj0vhcvl0w72qfucsq/wzt7fcrnuiui udewnopsun70glhcj/lvxl7k9bhyd4sq5czktwytfwliiwv+zy/fl6jgbgaqyqb2 bp4irmflogqsxgub1evwvdf1hagpfdspgmnepslg3/3dxn+hdjbz29eu8/xkzqeb 3v0ahkbu80zglllet2zx/wdirgjen9ymfgkf
pcml+bvirsmh0vscaweaaaobqzcb qdafbgnvhsmegdawgbqatgxhqyrufkiztdp55bzlfr+tfzapbgnvhrmbaf8ebtad aqh/ma4ga1uddweb/wqeawibxjadbgnvhq4efgquae4mr0mkvhyigbxaeew2zra/ rrcwrqyikwybbquhaqeeota3mdugccsgaqufbzabhilodhrwoi8vbg9jywxob3n0 lmxvy2fszg9tywluojkxodavy2evb2nzcdanbgkqhkig9w0baqufaaocaqeai8gk l3xo43u7/tdoeeswpmq+jzsdz3gz85ajt3krolwekvzzza2e2hnsvf2uxbk5amke lrxdserh9g85pv4ky7z8xz71nri3+k3uwmnqkc6t0h...
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 x
pcomutils 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: x
pcomutils.generateqi([components.interfaces.nsinavbookmarkobserver]) }; // an extension var myextension = { // this function is called when my add-on is loaded onload: function() { bmsvc.addobserver(myext_bookmarklistener, false); }, // this function is called when my add-on is unloaded onunload: function() { bmsvc.removeobserver(myext_bookmarklistener); }, dosomething: functio...
...n() { alert("did something."); } }; see also nsinavbookmarksservice nsinavbookmarkobserver places using x
pcom without chrome - bookmark observer ...
FUEL
fuel is about making it easier for extension developers to be productive, by minimizing some of the x
pcom formality and adding some "modern" javascript ideas.
... objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage fueliapplication objects fueliannotations fueliapplication fuelibookmark fuelibookmarkfolder fuelibookmarkroots fuelibrowsertab fueliwindow x
pcom although the fuel application object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code.
... the object needs to be accessed like any other x
pcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplication); ...
SMILE
smile is about making it easier for extension developers to be productive, by minimizing some of the x
pcom formality and adding some "modern" javascript ideas.
... objects extiapplication objects exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage smileiapplication objects smileibookmarkroots smileiwindow smileibrowsertab smileiapplication x
pcom although the extiapplication object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code.
... the object needs to be accessed like any other x
pcom service: var application = components.classes["@mozilla.org/smile/application;1"].getservice(components.interfaces.smileiapplication); ...
STEEL
consider using the functions found in ap
pconstants.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 x
pcom although the steel steeliapplication object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code.
... the object needs to be accessed like any other x
pcom service: var application = components.classes["@mozilla.org/steel/application;1"].getservice(components.interfaces.steeliapplication); other resources steel development plan.
extIApplication
implemented via x
pcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
... x
pcom although the application object is preloaded into xul scripts, it is not preloaded into javascript x
pcom code.
... the object needs to be accessed like any other x
pcom service: var application = components.classes["@mozilla.org/fuel/application;1"].getservice(components.interfaces.fueliapplication); 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 x
pcom are built with the same compiler abi.
... for more information on issues of componentization and binary compatibility, see http://mozilla.org/projects/x
pcom/gl...ent_reuse.html .
... comments and questions should be directed to the newsgroup, mozilla.dev.tech.x
pcom, or the mailing list, mozilla-x
pcom@mozilla.org.
Generic factory
in x
pcom, a generic factory is a factory created using the facilities in x
pcom/glue/nsigenericfactory.h.
... summary most x
pcom 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 x
pcom repository is available as an interface (which it soon will be).
Components.classes
each object represents one of the classes of x
pcom components that can be constructed or accessed as an x
pcom service.
... a new x
pcom 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 x
pconnect 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 x
pcom interfaces -- that some component or another might or might not implement.
... it reflects only those interfaces which have been designated in their .idl description as scriptable, that is the interfaces which x
pconnect is capable of reflecting into javascript.
... properties of the components.interfaces object are used where x
pcom methods expect a parameter of type nsid.
Community
if you know of useful mailing lists, newsgroups, forums, or other communities related to pyx
pcom, please link to them here.
... activestate python x
pcom bindings mailing list discussion of the bindings between the python language and the x
pcom (cross-platform com) technology from the mozilla project.
... #pyx
pcom on irc.mozilla.org chat with other pyx
pcom developers on mozilla's irc network.
nsDirectoryService
« x
pcom api reference summary the x
pcom 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 x
pcom service manager.
... example code #include "nsx
pcom.h" #include "nscomptr.h" #include "nsdirectoryservicedefs.h" #include "nsiservicemanager.h" #include "nsiproperties.h" /** * get the location of the system's "temp" directory.
NS_Alloc
« x
pcom api reference summary infallibly allocates a block of memory using the x
pcom memory manager.
... #include "nsx
pcom.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 x
pcom memory manager.
NS_Free
« x
pcom api reference summary frees a block of memory using the x
pcom memory manager.
... #include "nsx
pcom.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 x
pcom memory manager.
NS_GetComponentManager
« x
pcom api reference summary the ns_getcomponentmanager function returns a reference to the x
pcom component manager.
... #include "nsx
pcom.h" #include "nsicomponentmanager.h" nsresult ns_getcomponentmanager( nsicomponentmanager** aresult ); parameters aresult [out] a reference to the x
pcom component manager.
... remarks the object returned is a singleton that is valid until ns_shutdownx
pcom is called.
NS_GetComponentRegistrar
« x
pcom api reference summary the ns_getcomponentregistrar function returns a reference to the x
pcom component registrar.
... #include "nsx
pcom.h" #include "nsicomponentregistrar.h" nsresult ns_getcomponentregistrar( nsicomponentmanager** aresult ); parameters aresult [out] a reference to the x
pcom component registrar.
...remarks the object returned is a singleton that is valid until ns_shutdownx
pcom is called.
NS_GetServiceManager
« x
pcom api reference summary the ns_getservicemanager function returns a reference to the x
pcom service manager.
... #include "nsx
pcom.h" #include "nsiservicemanager.h" nsresult ns_getservicemanager( nsiservicemanager** aresult ); parameters aresult [out] a reference to the x
pcom service manager.
... remarks the object returned is a singleton that is valid until ns_shutdownx
pcom is called.
nsCOMPtr
« x
pcom api reference summary this utility class simplifies managing x
pcom interface references from c++ code.
...to use this class, you must link your component or application against the x
pcom 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 x
pcom glue library for easy reuse.
nsIClassInfo
x
pcom/components/nsiclassinfo.idlscriptable provides information about a specific implementation class.
...violates the x
pcom interface guidelines exceptions thrown ns_error_not_available if the class does not have a classid contractid string a contractid through which an instance of this class can be created, or null.
... for example, if asked for the helper for nsiprogramminglanguage::javascript this might return an object that can be nsisupports.queryinterface()'d into the nsix
pcscriptable interface to assist x
pconnect in supplying javascript specific behavior to callers of the instance object.
nsIContentSecurityPolicy
content/base/public/nsicontentsecuritypolicy.idlscriptable describes an x
pcom 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 nsihtt
pchannel 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 nsihtt
pchannel 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 onlooku
pcomplete should be called.
... if this parameter is null, then onlooku
pcomplete 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 = { onlooku
pcomplete: 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 swa
pcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
... swa
pcache() swaps in the newest version of the application cache.
... void swa
pcache(); parameters none.
nsIDOMParser
to create a domparser when the constructor is not available (e.g., from a js x
pcom component, a js module, or an x
pcshell test), use: var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); // optionally, call parser.init(principal, documenturi, baseuri); principals, document and base uri note: this section covers changes introduced to domparser in gecko 1.9.
...if the caller has universalx
pconnect 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 x
pcom component, a js module, or an x
pcshell 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
x
pcom/base/nsidebug.idlscriptable provides debugging support for scripted languages, such as javascript, java, python, perl, and so forth.
... inherits from: nsisupports last changed in gecko 1.7 note: c/c++ consumers who are planning to use the nsidebug interface with the @mozilla.org/x
pcom;1 contract should use ns_debugbreak() from x
pcom glue instead, or alternatively the ns_abort, ns_assertion, ns_break, and ns_warning macros, which also call ns_debugbreak() if used in a debugging build.
... assertion() shows an assertion and triggers optional behavior based on the x
pcom_debug_break environment variable, defaulting to calling break() on windows and os/2 and warning on other platforms.
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 stri
pcites(); methods getembeddedobjects() get a list of img and object tags in the current document.
... stri
pcites() strip any citations in the selected part of the document.
... void stri
pcites(); parameters none.
nsIFTPEventSink
netwerk/protocol/ftp/nsift
pchannel.idlscriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void onft
pcontrollog(in boolean server, in string msg) methods onft
pcontrollog allows a consumer to receive a log of the ftp control connection conversation.
... void onft
pcontrollog ( in boolean server, in string msg); parameters server a boolean value specifying whether you are a server or a client.
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 nsihtt
pchannel 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.nsihtt
pchannel = components.interfaces.nsihtt
pchannel; this.nsichannel = components.interfaces.nsichannel; this.nsirequest = components.interfaces.nsirequest; }; myhttprequestobserver.prototype.observe = function ( subject, topic, data ) { var uri, avisitor; if ( subject instanceof this.nsihtt
pchannel ) { avisitor = new mynsihttpheadervisitor( ); ...
...nse", false); }; myhttprequestobserver.prototype.unregister = function ( ) { var observerservice = components.classes[ "@mozilla.org/observer-service;1" ].getservice( components.interfaces.nsiobserverservice ); observerservice.removeobserver( this, "http-on-examine-response" ); observerservice.removeobserver(this, "http-on-examine-cached-response"); }; see also nsihtt
pchannel ...
nsIJSID
js/src/x
pconnect/idl/x
pcjsid.idlscriptable this interface provides information about a contract or interface.
...method overview boolean equals(in nsijsid other); const nsid* getid(); violates the x
pcom interface guidelines void initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only.
... violates the x
pcom interface guidelines getid() const nsid* getid(); parameters none.
nsILocalFileMac
x
pcom/io/nsilocalfilemac.idlscriptable please add a summary to this article.
... void inittoappwithcreatorcode(in ostype aap
pcreator); native code only!
...void inittoappwithcreatorcode( in ostype aap
pcreator ); parameters aap
pcreator the signature of the app.
nsIModule
x
pcom/components/nsimodule.idlscriptable this interface must be implemented by each x
pcom component.
... it is the main entry point by which the system accesses an x
pcom component.
... [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 x
pcom.
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 wra
pcol); nsidomdocumentfragment parsefragment(in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element); astring sanitize(in astring src, in unsigned long flags); constants constant value description sanitizerallowcomments (1 << 0) flag for sanitizer: allow comment nodes.
... astring converttoplaintext( in astring src, in unsigned long flags, in unsigned long wra
pcol ); parameters src the html source to parse (c++ callers are allowed but not required to use the same string for the return value.) flags conversion option flags defined in nsidocumentencoder.
... wra
pcol number of characters per line; 0 for no auto-wrapping.
nsIPropertyBag
x
pcom/ds/nsipropertybag.idlscriptable this interface is used to store a set of properties.
...goodies obtained from window.navigator are: ap
pcodename:"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:x
pcwrappednative_nohelper mozcameras:cameramanager mozconnection:mozconnection mozcontacts:contactmanager mozid:null mozkeyboard:x
pcwrappednative_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/x
pcom/base/nssysteminfo.cpp) for the properties supported.
nsISupports
x
pcom/base/nsisupports.idlscriptable all x
pcom interfaces inherit this interface.
... last changed in gecko 1.0 method overview nsrefcnt addref();violates the x
pcom interface guidelines void queryinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); nsrefcnt release();violates the x
pcom interface guidelines methods violates the x
pcom interface guidelines addref() notifies the object that an interface pointer has been duplicated.
... violates the x
pcom 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 x
pcom interface guidelines nativewindow gethwnd(); violates the x
pcom interface guidelines void move(in nsitaskbartabpreview anext); attributes attribute type description icon imgicontainer the icon displayed next to the title in the preview.
... methods violates the x
pcom interface guidelines ensureregistration() used internally to ensure that the taskbar knows about this preview.
... violates the x
pcom 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 aski
pcheck); 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 aski
pcheck, in boolean aallowsubstitution ); parameters astring a string to ensure its utf8ness.
... aski
pcheck determines whether or not to skip 'asciiness' and 'utf8ness' check.
nsIVersionComparator
x
pcom/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/x
pcom/version-comparator;1.
... the service can be accessed directly via services.vc after loading services.jsm or with the following code: var versioncomparator = components.classes["@mozilla.org/x
pcom/version-comparator;1"] .getservice(components.interfaces.nsiversioncomparator); method overview long compare(in acstring a, in acstring b); methods compare() compare two version strings.
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, homezi
pcode, homecountry homephone, homephonetype work contact.
... these functions are marked <code>[noscript] since x
pcconnect performs automatic type conversion on nsivariant such that they are not needed for scripts, only for c++ callers.
... the non-variant functions are marked [noscript] since x
pconnect uses magic with nsivariant such that the other functions are not needed, although c++ does need them.
Frequently Asked Questions
comparing an nscomptr to a raw x
pcom interface pointer declaring an nscomptr to a forward-declared class not linking to x
pcom not including nscomptr.h different settings of nscap_feature_debug_ptr_types runtime errors ns_assertion "queryinterface needed" may be caused by a class that derives from a given interface, when you forgetting to also specify the interface name in the ns_impl_isupports / ns_impl_threadsafe_isupports...
... call a getter that uses a raw x
pcom interface pointer as an `in/out' parameter?
... any x
pcom function that returns an interface pointer, i.e., a `getter', must have already addrefed that pointer.
Weak reference
in x
pcom, a weak reference is a special object that contains a pointer to an x
pcom 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; x
pconnect does all the work for you.
... see also the source x
pcom/base/nsiweakreference.idl x
pcom/glue/nsweakreference.h x
pcom/glue/nsweakreference.cpp x
pcom ownership guidelines using nscomptr original document information author: scott collins last updated date: september 23, 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license ...
Mozilla technologies
the module is structured as a drop-in component and exposes its xml-as-data features both to javascript and c++/x
pcom users.
... the xml extras module is built by default on all platforms, and is included in the browser installers so it is available in the nightly builds.x
pcomx
pcom is a cross platform component object model, similar to microsoft com.
... it has multiple language bindings, allowing x
pcom components to be used and implemented in javascript, java, and python in addition to c++.xpidlxpidl is an interface description language used to specify x
pcom 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 x
pcom components to mozilla (written in javascript or c++).
MailNews fakeserver
using fakeserver in x
pcshell tests since there are three different components of fakeserver, a total of four objects need to be set up in a fakeserver test on top of other testing.
...the server provides the following api to x
pcshell tests: <caption> nsmailserver x
pcshell 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 x
pcshell 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 rtcrt
pcapabilities object describing the codecs and capabilities supported by rtcrtpreceivers on the current device.
... syntax let rt
pcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive.
... return value an rtcrt
pcapabilities 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 rtcrt
pcontributingsource instances, each corresponding to one csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds.
... syntax var rtcrt
pcontributingsources = rtcrtpreceiver.getcontributingsources() parameters none.
... return value an array of rtcrt
pcontributingsource instances.
RTCRtpReceiver.getSynchronizationSources() - Web APIs
the getsynchronizationsources() method of the rtcrtpreceiver interface returns an array of rtcrt
pcontributingsource instances, each corresponding to one ssrc (synchronization source) identifier received by the current rtcrtpreceiver in the last ten seconds.
... syntax var rtcrt
pcontributingsources = rtcrtpreceiver.getcontributingsources() parameters none.
... as you'll see in the documentarion for rtcrtpsynchronizationsource, it inherits the properties of rtcrt
pcontributingsource, including timestamp, source, and audiolevel.
RTCRtpSender.getCapabilities() static function - Web APIs
the static function rtcrtpsender.getcapabilities() returns an rtcrt
pcapabilities object describing the codecs and capabilities supported by the rtcrtpsender.
... syntax let rt
pcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive.
... return value an rtcrt
pcapabilities 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": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqyg
pcwu6aq", "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/tolwr4cg8khdlburcby6g
pclo3dpu09sw+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": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqyg
pcwu6aq", "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 o
pcode 1 0 0 0 0x1=0001 fin: you can send your message in frames, but now keep things simple.
... o
pcode 0x1 means this is a text.
... full list of o
pcodes - 134: if the second byte minus 128 is between 0 and 125, this is the length of the message.
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 cu
pcake.
... pausing and playing animations we’ll talk more about alice’s animation later, but for now, let’s look closer at the cu
pcake’s animation: var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); the element.animate() method will immediately run after it is called.
... to prevent the cake from eating itself up before the user has had the chance to click on it, we call animation.pause() on it immediately after it is defined, like so: nommingcake.pause(); we can now use the animation.play() method to run it whenever we’re ready: nommingcake.play(); specifically, we want to link it to alice’s animation, so she gets bigger as the cu
pcake gets eaten.
CSS reference - CSS: Cascading Style Sheets
er-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearcli
pclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-ga
pcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdirection:disableddisplay<display-box...
...><display-inside><display-internal><display-legacy><display-listitem><display-outside>d
pcmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfont-feature-settings (@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+wubcztca0ccs4kddqjdtltmrl1o3yitha7o
pcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8...
...a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8ycmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwu
pc+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,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaaoxaaadsqblssogwaaaad0su1fb9oecqmckpi8ciiaaaaidevydenvbw1lbnqa9sywvwaaauhjrefuomtjybgfxab501zwbvval2nhnlmk6mxcjbf69zu+hz/9fb5o1lx+bg45qhl8/fyr5it3xrp/ywtuvvvk3veqgxz70tvbjy8+wv39+2/hz19/mgwjzzutyjaluobv9jimaxheyd3h7ku8fpj2icml8z92dlbtmzdeig3fco7j08foh1kurkm3e9iw54yvkwutuom+lpt/bgbwf3//sf37/1/c02ccg1lb8f//f95dzx74mtmzshhosm6szrq/a6ir/z2rkfejbxulyfpdidi6af///...
Making content editable - Developer guides
option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7o
pcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/xhbqaaaazis0deap8...
...a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8ycmjdflehmlkjkvk7kuyn+ufza/rtth76zavocdptrxzqtni3mrwu
pc+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,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalg
pc/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 makehel
pcallback(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 =...
... makehel
pcallback(item.help); } } setuphelp(); run the code using this jsfiddle link.
...rather than the callbacks all sharing a single lexical environment, the makehel
pcallback function creates a new lexical environment for each callback, in which help refers to the corresponding string from the helptext array.
Private Properties - Archive of obsolete content
namespaces in the add-on sdk the add-on sdk is built on top of x
pcom, the interface between javascript and c++ code.
... since x
pcom allows the user to do virtually anything, security is very important.
SDK and XUL Comparison - Archive of obsolete content
x
pcom traditional add-ons have access to a vast amount of firefox functionality via x
pcom.
...if you need more flexibility than the sdk's high-level apis provide, you can use its low-level apis to load x
pcom objects directly or to manipulate the dom directly as in a traditional bootstrapped extension.
clipboard - Archive of obsolete content
var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahg
pcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d"); if the clipboard contains an image, open it in a new tab.
... var clipboard = require("sdk/clipboard"); clipboard.set("data:image/png;base64,ivborw0kggoaaaansuheugaaacaaaaagcaya" + "aabzenr0aaaasuleqvryhe3o0qkaiawd0eyqe3q993aq3cbsukpygfsnty" + "n5ugbqpk0baadgp0brdwxwlweaaaaagpsa3rzdaaaaahg
pcgrpganzq2fg" + "bwrr9aaaaabjru5erkjggg%3d%3d", "text"); globals functions set(data, datatype) replace the contents of the user's clipboard with the provided data.
system/runtime - Archive of obsolete content
x
pcomabi a string identifying the abi of the current processor and compiler vtable.
... this string takes the form <processor>-<compilerabi>, for example: "x86-msvc" or "p
pc-gcc3".
Creating Reusable Modules - Archive of obsolete content
for both these operations we'll use x
pcom interfaces.
... } return path; } hash function firefox has built-in support for hash functions, exposed via the nsicryptohash x
pcom interface the documentation page for that interface includes an example of calculating an md5 hash of a file's contents, given its path.
Downloading Files - Archive of obsolete content
var privacy = privatebrowsingutils.privacycontextfromwindow(urlsourcewindow); var hardcodedusername = "ericjung"; var hardcodedpassword = "foobar"; persist.progresslistener = { queryinterface: x
pcomutils.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.nsihtt
pchannel && 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 x
pcom components.
... look in the source for other strings available: x
pcom/io/nsappdirectoryservicedefs.h, x
pcom/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 === sd
pclass) { 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(sd
pclass), nlen = afields.length; for (var nitem = 0; nitem < nlen; new datepicker(afields[nitem++])); } const /* customizable by user */ sprefs = "zdp"; sd
pclass = "date-picker", smonthsnames = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], sdays = ["m", "t", "w", "t", "f", "s", "s"], bzeroismonday = true, /* internal usage...
On page load - Archive of obsolete content
llowing xul documents: application uri to overlay firefox chrome://browser/content/browser.xul thunderbird chrome://messenger/content/messenger.xul navigator from seamonkey chrome://navigator/content/navigator.xul attaching a script attach a script to your overlay (see "attaching a script to an overlay") that adds a load event listener to ap
pcontent element (browsers) or messagepane (mail): window.addeventlistener("load", function load(event){ window.removeeventlistener("load", load, false); //remove listener, no longer needed myextension.init(); },false); var myextension = { init: function() { var ap
pcontent = document.getelementbyid("ap
pcontent"); // browser if(ap
pcontent){ ap
pcontent.addeventlistener("dom...
...to attach to the unload event in above example you can use the "pagehide" event like this: ap
pcontent.addeventlistener("pagehide", myextension.onpageunload, false); for ap
pcontent and similarly for messagepane messagepane.addeventlistener("pagehide", myextension.onpageunload, false); and add your code to onpageunload method.
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: x
pcomutils.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: x
pcomutils.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 x
pcom components, preferences defaults etc.
... the startup process receives this "needsrestart" bit when the extension manager's startup completes, shuts down x
pcom and relaunches the application.
Extension Versioning, Update and Compatibility - Archive of obsolete content
--> <em:signature>migtma0gcsqgsib3dqebbquaa4gbamo1o2gwsccth1gwymgscfanakpn40pjfowt ub2hvdg8+oxmcif8d/9evwm8eh/ixuxyzlmrzts3o5tv9eway5ubctqdf1wgtsgk jrgzow1fitkzi7w0//c8ekdmlatguegfns2iltd5p/0kh/hf1r
pc1wuqeqkcd4+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/hf1r
pc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> <!-- this represents the same description within the li from the previous example --> <rdf:description about="urn:mozilla:extension:foobar@developer.mozilla.org:2.2"> <em:version>2.2</em:version> <!-- trimmed the rest of the contents here --> </rdf:description> <rdf:description about="urn:mozilla:extens...
Extension Etiquette - Archive of obsolete content
x
pcom contract ids, which are often registered in chrome.manifest files.
...x
pcom contract ids, for instance, should always begin with an @, followed by a domain name that the author controls, e.g., "@example.com/foo/bar;1" it is important that the prefix that you use be unlikely to conflict with other code, and that it be indicative of the name of your add-on.
Firefox addons developer guide - Archive of obsolete content
the firefox add-ons developer guide was contributed by the mozilla japan community; it covers how to go about building firefox extensions using x
pcom and xul.
... next » introduction to extensions technologies used in developing extensions introduction to xul—how to build a more intuitive ui using x
pcom—implementing advanced processes let's build a firefox extension firefox extensions and xul applications license and authors next » ...
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>ap
pcoast</em:creator> <em:homepageurl>https://developer.mozilla.org/docs/xul_school</em:homepageurl> this is the data that is displayed before and after the extension is installed, that you can see in the add-ons manager.
... « previousnext » this tutorial was kindly donated to mozilla by ap
pcoast.
XUL School Tutorial - Archive of obsolete content
pt object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the box model x
pcom objects observer notifications custom xul elements with xbl mozilla documentation roadmap useful mozilla community sites appendices appendix a: add-on performance appendix b: install and uninstall scripts appendix c: avoiding using eval in add-ons appendix d: loading scripts appendix e: dom building and html insertion appendix f: monitoring dom changes the xul...
... school project was developed by ap
pcoast (formerly glaxstar).
Building TransforMiiX standalone - Archive of obsolete content
add tx_exe=1 mk_add_options build_modules="x
pcom transformiix" ac_add_options --enable-standalone-modules="x
pcom transformiix" to your .mozconfig, and use client.mk to pull as usual.
... this will pull the necessary subtree with mozilla/client.mk mozilla/build/unix/modules.mk mozilla/build mozilla/config mozilla/expat mozilla/extensions/transformiix mozilla/include mozilla/allmakefiles.sh mozilla/client.mk mozilla/aclocal.m4 mozilla/configure mozilla/configure.in mozilla/makefile.in plus nspr and x
pcom from the cvs repository.
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::ma
pcommonattributesinto), or as a consequence of a style rule (mapdeclarationtextinto in nscssstylerule.cpp) all these cases use nsdocument::enablebidi to set the flag mbidienabled.
...improvements to lists with hebrew and arabic list-style-type summary of new classes class name x
pcom 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 nshtt
pchannel implements nsihtt
pchannel talks to the cache initiates http transactions processes http response codes intercepts progress notifications nshtt
pconnection implements nsistreamlistener & nsistreamprovider talks to the socket transport service feeds data to its transaction object routes progress notifications nshtt
pconnectioninfo identifies a connection nshttptransaction ...
... implements nsirequest encapsulates a http request and response parses incoming data nshtt
pchunkeddecoder owned by a transaction strips chunked transfer encoding nshttprequesthead owns a nshttpheaderarray knows how to fill a request buffer nshttpresponsehead owns a nshttpheaderarray knows how to parse response lines 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
x
pcom a simple, cross-platform component model with multiple language bindings and idl descriptions so you can plug your custom functionality into the framework and connect it with other components.
... web services built-in support for xmlhttprequest, xml-r
pc, soap, and wsdl to enable mozilla-based application authors to take advantage of the exploding world of web services.
LIR - Archive of obsolete content
the lir instruction set is best learnt by reading nanojit/liro
pcode.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 o
pcode, ie.
New Skin Notes - Archive of obsolete content
for an example of this, see creating x
pcom 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/p
pcs), i find myself needing to use ctrl+- with the devmo wikki currently, not to change my global settings of course, which are fine and factory-default, working well with the other sites i visit regularily or manage...
PyDOM - Archive of obsolete content
globals and namespaces this is taken from a mail to the pyx
pcom list - it should be expanded, but a copy-paste will do for now normal module semantics don't exist here.
...related topics pyx
pcom: create and use x
pcom 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 p
pc mac osx 10.5, 10.6 on intel linux 32 and 64 bit solaris 10 on sparc android 2.2 on arm windows mobile 6.5 mips (linux) sh4 (linux) getting the tamarin source the tamarin source resides in mercurial at tamarin central.
... the command to build from the terminal is: $ cd tamarin-redux $ xcodebuild archs=p
pc -project platform/mac/avmshell/avmshell.xcodeproj for a debug build, add '-configuration debug' (note the capital d and no "=").
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 p
pc & 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 pocket
pc 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 x
pcom.xpi with the shared libraries in the structure described under the [x
pcom] 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 x
pcom 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 x
pcom.xpi and other debug xpis delivered to mozilla/installer/raw.
...for example, see the x
pcom 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 x
pcom.xpi and other debug xpis delivered to mozilla/dist/win32_d.obj/install.
...for example, see the x
pcom section that lists all the shared libraries as seen in dist.
Accessing Files - Archive of obsolete content
there are alternative x
pcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
... components the components directory where x
pcom components are installed.
Template and Tree Listeners - Archive of obsolete content
these each implement a different x
pcom 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); // p
pchenhui@hotmail.com tree.builder.queryinterface (components.interfaces.nsixultreebuilder) .addobserver(treebuilderobserver); the candropbeforeafter method returns false since we do not want to allow before and after drops.
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 x
pcom object which holds information about the user's locale.
... stringbundle type: nsistringbundle returns the x
pcom string bundle object which implements nsistringbundle.
Dialogs in XULRunner - Archive of obsolete content
the xul filepickers are x
pcom 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 x
pcom.
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 ol
pc sugarlabs a python gtk widget with xulrunner embedded, providing full access to nsi dom and all other xulrunner interfaces, in a gtk window.
Make your xulrunner app match the system locale - Archive of obsolete content
this article is going to assume a lot of knowledge of x
pcom and will be written for someone using python, but the ideas should be adaptable.
... from x
pcom 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 x
pcnativewrapper (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 x
pcom component that extends nsicontentpolicy.
2006-11-24 - Archive of obsolete content
building x
pcom components with msvs 2005 november 21st: buffaloaf is having trouble getting a personal x
pcom component to work under xulrunner when compiled with msvs 2005.
..."component returned failure code: 0x80570016 (ns_error_x
pc_gs_returned_failure) [nsijscid.getservice]" nsresult: "0x80570016 (ns_error_x
pc_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.x
pcom - sept 22-29, 2006 announcements none during this week.
...x
pcom discussion of the limitation and merits of java in place of x
pcom.
2006-09-30 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - sept 30- oct 5, 2006 announcements build a x
pcom component on mac os x benjamin smedberg confirmed that this tutorial http://www.iosart.com/firefox/x
pcom/ is misleading as it uses the standalone glue (-dx
pcom_glue) for components, which is not recommended.
... developers should use this sample instead: http://developer.mozilla.org/en/docs/x
pcom_glue discussions dynamic load overlay a short discussion about the possibilities of loading and unloading xul overlay runtime reading binary data from file discusses about the code to read binary data from file how to build x
pcom component on mac os x discusses about the make file code used to build x
pcom components on mac os x successfully meetings none during this week.
2006-11-24 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - nov 18-nov 24, 2006 announcements none during this week.
... discussions tutorials: non c++ bindings for x
pcom tutorials on how to interface with firefox using x
pcom 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 x
pcom 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.x
pcom - oct 28-nov 3, 2006 announcements none during this week.
... discussions problem linking libraries to x
pcom component a discussion involving a problem with linking third party library to x
pcom component.
2006-12-08 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - dec 02- dec 08, 2006 announcements none during this week.
... discussions x
pcom 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=i
pcplugins:5 c:\> set nspr_log_file=c:\plugins.log c:\> cd c:\program files\mozilla firefox c:\> firefox.exe the log file will be saved to c:\plugins.log (or wherever nspr_log_file is set).
...from within a bash shell: $ export nspr_log_modules=i
pcplugins:5 $ export nspr_log_file=~/plugins.log $ /usr/bin/firefox the file will be saved to ~/plugins.log (or wherever nspr_log_file is set).
NPN_CreateObject - Archive of obsolete content
syntax #include <npruntime.h> npobject *npn_createobject(npp npp, n
pclass *aclass); parameters the function has the following parameters: <tt>npp</tt> the npp indicating which plugin wants to instantiate the object.
... description if the given n
pclass provides an allocate function it is used to allocate the storage for the object and the npp argument passed to npn_createobject() is passed along to that function.
NPN_GetValue - Archive of obsolete content
values for npnvariable: npnvxdisplay =1: unix only: returns the current display npnvxtap
pcontext: unix only: returns the application's xtap
pcontext 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), npnvxtap
pcontext (the browser's xtap
pcontext), and npnvnetscapewindow (the browser toplevel window in which the plugin is displayed).
NPAPI plugin reference - Archive of obsolete content
n
pclass n
pclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an n
pclass (i.e.
... npobject npobject is a structure that holds a pointer to an n
pclass and an integer reference count, and possibly also implementation specific (i.e.
Browser Feature Detection - Archive of obsolete content
e wordspacing true true true dom css 2 support for properties/methods in document.body.style</caption> name firefox 1.5 ie 6 & 7 opera 8.54 - 9.01 azimuth true false false backgroundposition true true true bordercollapse true true true borderspacing true false true borderto
pcolor true true true borderrightcolor true true true borderbottomcolor true true true borderleftcolor true true true bordertopstyle true true true borderrightstyle true true true borderbottomstyle true true true borderleftstyle true true true bottom true...
... {name: 'verticalalign', 'supported': false}, {name: 'whitespace', 'supported': false}, {name: 'width', 'supported': false}, {name: 'wordspacing', 'supported': false} ], 'domcss2': [ {name: 'azimuth', 'supported': false}, {name: 'backgroundposition', 'supported': false}, {name: 'bordercollapse', 'supported': false}, {name: 'borderspacing', 'supported': false}, {name: 'borderto
pcolor', 'supported': false}, {name: 'borderrightcolor', 'supported': false}, {name: 'borderbottomcolor', 'supported': false}, {name: 'borderleftcolor', 'supported': false}, {name: 'bordertopstyle', 'supported': false}, {name: 'borderrightstyle', 'supported': false}, {name: 'borderbottomstyle', 'supported': false}, {name: 'borderleftstyle', 'supported': false}, {name: 'bottom', 'supp...
XForms Custom Controls - Archive of obsolete content
x
pcom 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 x
pcom 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 x
pcom component (giving it access to all open windows), and for berkeley db xml, possibly implementing it in c++ instead, which is that database's original language of development.
... however, the extension demonstrates a technique which does not depend on using x
pcom, while still giving full privileges.
Archive of obsolete content
newsgroup summaries obsolete: x
pcom-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 x
pcom architecture allows x
pcom components be scriptable via a different mechanism called x
pconnect.
Gecko FAQ - Gecko Redirect 1
gecko is reusable on all platforms thanks to x
pcom, a subset of com that works across platforms.
... additionally, on the windows platform, gecko's x
pcom interfaces are wrapped in an activex control that vb developers can utilize (activex wrappers are not available on other platforms because activex is a windows-only technology).
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=zipujsazv6
pcgcbjscj1zu6pqzbfmuat; 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=zipujsazv6
pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _ga=ga1.2.1688886003.1471911953; ffo=true csrfmiddlewaretoken=zipujsazv6
pcgcbjscj1zu6pqzbfmuat&user-username=hamishwillee&user-fullname=hamish+willee&user-title=&user-organization=&user-location=australia&user-locale=en-us&user-timezone=australia%2fmelbourne&user-irc_nickname=&user-interests=&user-expertise=&user-twitter_...
Strategies for carrying out testing - Learn web development
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 x
pcom components use idl to create interfaces.
...the function attribute tells the x
pconnect 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 libx
pcom 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 x
pcom is not appropriate or not possible.
Browser API
mozbrowserasyncscroll sent when the browser <iframe> content scrolls (the a
pcz version.) see also mozbrowserscroll.
...a
pcz) starts or stops.
Embedding Tips
a service is a singleton object implementing one or more x
pcom 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 fornsihtt
pchanne and call methods on that to determine response codes and other information from the server.
HTTP Cache
there is no i
pc 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 (ap
pcachestorage): 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 getstartu
pchanges() method lets you find out which add-ons were installed, removed, updated, enabled, or disabled at application startup.
... for example, to take a look at the add-ons that were disabled at startup: components.utils.import("resource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartu
pchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "navigator:browser" type.
Sqlite.jsm
sqlite.jsm offers some compelling advantages over the low-level storage x
pcom interfaces: automatic statement management.
...the complexities of x
pcom 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) _registerinterap
pconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterap
pconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, arunupdate) _registeractivities: function(amanifest, aapp, arunupdate) _createactivitiestounregister:...
...canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) po
pcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests...
JavaScript code modules
ctypes.jsm provides an interface that allows javascript code to call native libraries without requiring the development of an x
pcom component.
... x
pcomutils.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/x
pcom/base/nscyclecollector.cpp:3008) 0x7f6860fdfe02 #03: nspurplebuffer::sizeofexcludingthis(unsigned long (*)(void const*)) const (/home/njn/moz/mi2/x
pcom/base/nscyclecollector.cpp:933) 0x7f6860fdb7af #04: nscyclecollector::sizeofincludingthis(unsigned long (*)(void const*), unsigned long*, unsigned long*, unsigned long*, unsigned long*, unsigned long*) const (/home/njn/moz/mi2/x
pcom/base/nscyc...
...lecollector.cpp:3029) 0x7f6860fdb6b1 #05: cyclecollectormultireporter::collectreports(nsimemorymultireportercallback*, nsisupports*) (/home/njn/moz/mi2/x
pcom/base/nscyclecollector.cpp:3075) 0x7f6860fde432 #06: nsmemoryinfodumper::dumpmemoryreportstofileimpl(nsastring_internal const&) (/home/njn/moz/mi2/x
pcom/base/nsmemoryinfodumper.cpp:626) 0x7f6860fece79 #07: nsmemoryinfodumper::dumpmemoryreportstofile(nsastring_internal const&, bool, bool) (/home/njn/moz/mi2/x
pcom/base/nsmemoryinfodumper.cpp:344) 0x7f6860febaf9 #08: mozilla::(anonymous namespace)::dumpmemoryreportsrunnable::run() (/home/njn/moz/mi2/x
pcom/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%) ++ x
pconnect 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 x
pconnect.
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
x
pcomhdrarray [getter] return an nsimutablearray of the message headers that have been injected into folders.
... folderswithx
pcomhdrarrays [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 x
pcom_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/setu
pcommonmailnews.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 (p
pc), 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_ocs
pchecker_check does not support specified responder (and given signercert) bug 414003: crash [[@ cert_decodecertpackage] sometimes with this testcase bug 415167: memory leak in certutil bug 417399: arena allocation results are not checked in pkix_pl_infoaccess_parselocation bug 420644: improve ssl tracing of key derivation bug 426886: use const char* in pk11_importcertforkey bug 428103: ...
... 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_destroyocs
pcertid ] 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_namedgrou
pconfig).
... added support for rsa-pss signatures in tls 1.2 and tls 1.3 new functions in ssl.h ssl_namedgrou
pconfig notable changes in nss 3.27 update 2016-10-02: the maximum tls version supported has been increased to tls 1.3 (draft).
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 u
pcoming 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 p
pc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized warning in p7env.c bug 1561548 - remove -wmaybe-uninitialized warning in pkix_pl_ldapdefaultclient.c bug 1512605 - incorrect alert description after unencrypted finished msg bug 1564715 - read /proc/cpuinfo when at_hwcap2 returns 0 bug 1532194 - remove or fix -ddebug_$user from make builds bug 1565577 - visual studio's ...
NSS 3.47 release notes
u
pcoming changes to default tls configuration the next nss team plans to make two changes to the default tls configuration in nss 3.48, which will be released in early december: tls 1.3 will be the default maximum tls version.
...uniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stan
pcertdb bug 1576307 - check mechanism param and param length before casting to mechanism-specific structs bug 1577953 - support longer (up to rfc maximum) hkdf outputs bug 1508776 - remove refcounting from sftk_freesession (cve-2019-11756) bug 1494063 - support tls exporter in tstclnt and selfserv bug 1581024 - heap overflow in nss utility "derdump" bug 1582343 - soft token mac verification no...
NSS 3.53 release notes
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 - p
pc64: 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 p
pc64le 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_du
pcertifiate() will remain the same, but pk11_referenceslot() will become pk11_dupslot(), and pk11_clonecontext() will become pk11_du
pcontext().
Utility functions
3.2 and later sec_asn1encodersettakefrombuf mxr 3.2 and later sec_asn1encoderstart mxr 3.2 and later sec_asn1encoderupdate mxr 3.2 and later sec_asn1encodeunsignedinteger mxr 3.11.1 and later sec_asn1lengthlength mxr 3.2 and later sec_du
pcrl mxr 3.9 and later sec_getsignaturealgorithmoidtag mxr 3.10 and later sec_getregisteredhtt
pclient mxr 3.12 and later sec_pkcs5getcryptoalgorithm mxr 3.2 and later sec_pkcs5getkeylength mxr 3.2 and later sec_pkcs5getpbealgorithm mxr 3.2 and later ...
... sec_pkcs5isalgorithmpbealg mxr 3.2 and later sec_pkcs5isalgorithmpbealgtag mxr 3.12 and later sec_registerdefaulthtt
pclient mxr 3.11.1 and later sec_signdata mxr 3.2 and later sec_stringtooid mxr 3.12 and later secitem_allocitem mxr 3.2 and later secitem_arenadupitem mxr 3.9 and later secitem_compareitem mxr 3.2 and later secitem_copyitem mxr 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 x
pconnect we use that from time to time when we know we aren't going to be creating any new objects (other than global objects, which have no parent or prototype) or doing anything that might call back into native code that could create objects.
... background: the fastest instructions for nameexpressions are fat o
pcodes 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 x
pcom object (see nsisupports).
... this is only meaningful if spidermonkey is built with x
pconnect and the jsclass_has_private flag is also set.
JS_SetOptions
the context's private data points to an x
pcom object (see nsisupports).
... this is only meaningful if spidermonkey is built with x
pconnect.
JSDBGAPI
breakpoints js_settrap js_gettrapo
pcode 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_linenumberto
pc js_getfunctionscript js_getfunctionnative js_getfunctionfastnative js_getscriptprincipals typedef jsstackframe js_frameiterator js_getframescript js_getframe
pc 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_sto
pchudremote 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 [x
pcshell], since the host environments differ.
...if you're looking to investigate that, build a standalone copy of spidermonkey and compare it with x
pcshell.
Shell global objects
line2
pc([fun,] line) map line number to
pc.
...
pc2line(fun[,
pc]) map
pc to line number.
Aggregating the In-Memory Datasource
introduction you can use x
pcom aggregation1 with the in-memory datasource.
... notes describing all of the vagaries of x
pcom aggregation is beyond the scope of this document.
Generating GUIDs
guids are used in mozilla programming for identifying several types of entities, including x
pcom 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/x
pcom format when #define-ing iids and cids in mozilla c++ code, you generally use the following format: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx #define ns_...id \ { 0xxxxxxxxx, 0xxxxx, 0xxxxx, \ { 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx, 0xxx } } you can generate code in this format using one of the following tools.
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 x
pcom for more information on registration).
...have to register component here or with regx
pcom?
Making cross-thread calls using runnables
typically, thread activities are triggered and managed using an x
pcom 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 "nsx
pcomcidinternal.h" void calculatepiasynchronously(int digits, picallback callback) { // to create a new thread, get the thread manager nscomptr<nsithreadmanager> tm = do_getservice(ns_threadmanager_contractid); nscomptr<nsithread> mythread; nsresult rv = tm->newthread(0, 0, getter_addrefs(mythread)); if (ns_failed(rv)) { // in case of failure, call back immediately with an empty strin...
Components.interfacesByID
each object represents one of the x
pcom interfaces -- that some component or another might or might not implement.
...the interfaces which x
pconnect 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/x
pconnect/src/x
pc.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 x
pcom result codes, with each value being that of the corresponding result code.
Components.utils.importGlobalProperties
the following strings are supported: string/object x
pcom 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'); x
pcom components some objects have an x
pcom alternative, which typically allows more flexibility then the dom version here is an example of how to use the dom xmlhttprequest through x
pcom 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 x
pcom from within java.
... the test apps can be found at mozilla/extensions/java/x
pcom/tests.
nsCategoryManager
« x
pcom api reference summary the x
pcom category manager.
... class id 16d222a6-1dd2-11b2-b693-f38b02c021b2 contractid @mozilla.org/categorymanager;1 supported interfaces nsicategorymanager remarks this component is a singleton and should therefore be accessed via the x
pcom service manager.
nsLocalFile
« x
pcom 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 x
pcom component manager.
nsObserverService
« x
pcom api reference the x
pcom 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 x
pcom service manager.
nsScriptableInputStream
« x
pcom api reference summary a component implementing nsiscriptableinputstream.
... class id 7225c040-a9bf-11d3-a197-0050041caf44 contractid @mozilla.org/scriptableinputstream;1 supported interfaces nsiscriptableinputstream, nsiinputstream remarks this component should be accessed via the x
pcom component manager.
NS_NewLocalFile
« x
pcom api reference summary the ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.
... #include "nsx
pcom.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
« x
pcom api reference summary the ns_newnativelocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.
... #include "nsx
pcom.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 stri
pchars 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars 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 stri
pchars void stri
pchars(const char*) - source remove all occurrences of characters in aset from the string.
nsACString
« x
pcom 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 x
pcom 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 stri
pchars 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 stri
pchars void stri
pchars(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 stri
pchar data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsAString
« x
pcom 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 x
pcom 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 stri
pchars 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 stri
pchars void stri
pchars(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 stri
pchar data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsAutoString (External)
pt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendint tointeger base classes ...
... 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral f...
... 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchar base classes nsacstring_internal data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(char, print32) - source this method is used to remove all occurrences of achar from this string.
nsDependentCSubstring external
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstringcontainer data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars 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 stri
pchars void stri
pchars(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 stri
pchar base classes nsastring_internal data members no public members.
... @see nstsubstring::isvoid parameters prbool <anonymous> stri
pchar void stri
pchar(prunichar, print32) - source this method is used to remove all occurrences of achar from this string.
nsDependentSubstring external
ading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stri
pchars stripwhitespace trim defaultcomparator compare(const prunichar*, print32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator<= operator== operator>= operator> operator!= equalsliteral ...
... 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 stri
pchars void stri
pchars(const char*) - source remove all occurrences of characters in aset from the string.
nsEmbedCString
« x
pcom 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 x
pcom string functions, prefixed with ns_cstring.
nsEmbedString
« x
pcom 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 x
pcom 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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar appendint tointeger base classes nscstring_external data membe...
... 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 stri
pchars void stri
pchars(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 stri
pchars 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 stri
pchars void stri
pchars(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 stri
pchars 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 stri
pchars void stri
pchars(const char*) - source remove all occurrences of characters in aset from the string.
nsSupportsWeakReference
« x
pcom 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 x
pcom 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 nsihtt
pchannel htt
pchannel, in boolean isforeign, out nscookiepolicy policy ); parameters uri the uri to find the policy for.
... htt
pchannel the channel to extract the p3p headers from.
nsICookieService
getcookiestring() will query the documenturi property off of nsihtt
pchannelinternal if supported, so getcookiestring() can be used in place of this method.
...setcookiestring() will query the documenturi property off of nsihtt
pchannelinternal if supported, and setcookiestring() could also query the date header from the channel if achannel supports nsihtt
pchannel.
nsIDNSListener
inherits from: nsisupports last changed in gecko 1.7 method overview void onlooku
pcomplete(in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus); methods onlooku
pcomplete() called when an asynchronous host lookup completes.
... void onlooku
pcomplete( in nsicancelable arequest, in nsidnsrecord arecord, in nsresult astatus ); parameters arequest the value returned from asyncresolve.
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 x
pcom component implementing this interface can be exposed to web content as a property on the window.
...ensure that you never return any internal x
pcom objects to untrusted code.
nsIDebug2
x
pcom/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 x
pcom was compiled with debug defined.
nsIDirectoryServiceProvider2
x
pcom/io/nsidirectoryservice.idlscriptable an extension of nsidirectoryserviceprovider which allows multiple files to be returned for the given key.
...use an x
pcom return code of ns_success_aggregate_result if this result should be aggregated with other "lower" providers.
nsIEditor
« x
pcom 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 dum
pcontenttree(); void debugdum
pcontent() ; void debugunittests(out long outnumtests, out long outnumtestsfailed); [notx
pcom] boolean ismodifiablenode(in nsidomnode anode); constants load flags constant value description enone 0 enext 1 eprevious 2 enextword 3 epreviouswo...
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, *.m
pc, *.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, notx
pcom] alreadyaddrefed_nsframeloader getframeloader(); void swapframeloaders(in nsiframeloaderowner aotherowner); attributes attribute type description frameloader nsiframeloader the frame loader owned by this nsiframeloaderowner.
...[noscript, notx
pcom] 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 ahtt
pchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata); attributes attribute type description isactive boolean true when the interface is active and should observe http activity, otherwise false.
...void observeactivity( in nsisupports ahtt
pchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata ); parameters ahtt
pchannel the nsihtt
pchannel on which the activity occurred.
nsIHttpUpgradeListener
netwerk/protocol/http/nsihtt
pchannelinternal.idlscriptable the callback interface for nsihtt
pchannelinternal.httpupgrade; this is called when an http protocol upgrade is finished.
... note: to begin a protocol upgrade, call nsihtt
pchannelinternal.httpupgrade().
nsIINIParser
x
pcom/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/x
pcom/ini-parser-factory;1", components.interfaces.nsiiniparserfactory ); var iniparser = inifact.createiniparser(inifile); try { return iniparser.getstring(section,prop); } catch(e) { return undefined; } } // usage: var lang = getinivalue(file,"setting","language"); enumerating sections this example gets a list of all the sections in the ini file.
nsIINIParserFactory
x
pcom/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/x
pcom/ini-parser-factory;1"; var interf = components.interfaces.nsiiniparserfactory; var inifact = components.manager.getclassobjectbycontractid(cl,interf); // get the iniparser for the ini file var iniparser = inifact.createiniparser(file); see also nsiiniparser nsilocalfile ...
nsIINIParserWriter
nsiiniparserwriter x
pcom/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/x
pcom/ini-processor-factory;1"].
nsIMemory
x
pcom/base/nsimemory.idlscriptable this interface represents a generic memory allocator.
... method overview voidptr alloc(in size_t size); violates the x
pcom interface guidelines void free(in voidptr ptr); violates the x
pcom interface guidelines void heapminimize(in boolean immediate); boolean islowmemory(); deprecated since gecko 2.0 voidptr realloc(in voidptr ptr, in size_t newsize); violates the x
pcom interface guidelines methods alloc allocates a block of memory of a particular size.
nsIObserver
x
pcom/ds/nsiobserver.idlscriptable this interface is implemented by an object that wishes to observe notifications.
... the most common implementation of nsiobserverservice is the x
pcom observer service.
nsIObserverService
x
pcom/ds/nsiobserverservice.idlscriptable this interface provides methods to add, remove, notify, and enumerate observers of various notifications.
... inherits from: nsisupports last changed in gecko 0.9.6 the x
pcom nsobserverservice implements this interface to provide global notifications for a variety of subsystems.
nsIParentalControlsService
constants constant value description e
pclog_urivisit 1 this log entry type represents an access to web content.
... e
pclog_filedownload 2 this log entry type represents a file download.
nsIScriptError
js/x
pconnect/idl/nsiscripterror.idlscriptable represents javascript errors and warnings for use by the console service.
... categories the web console does not display "x
pconnect 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 x
pcom 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 x
pcom 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,notx
pcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in long offset); native code only!
... collapsed() [noscript,notx
pcom,nostdcall] boolean collapsed(); native code only!collapsenative void collapsenative( in nsinode parentnode, in long offset ); parameters parentnode offset collapsetoend() collapses the whole selection to a single point at the end of the current selection (regardless of direction).
nsISelectionPrivate
void startbatchchanges(); wstring tostringwithformat(in string formattype, in unsigned long flags, in print32 wra
pcolumn); 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 wra
pcolumn ); parameters formattype flags wra
pcolumn return value ...
nsISupportsWeakReference
x
pcom/base/nsiweakreference.idlscriptable this interface is a factory interface, which produces appropriate instances of nsiweakreference.
... remarks the x
pcom glue library provides nssupportsweakreference, a canonical implementation of nsisupportsweakreference.
nsIThreadEventFilter
x
pcom/threads/nsithreadinternal.idlscriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview boolean acceptevent(in nsirunnable event);violates the x
pcom interface guidelines methods violates the x
pcom interface guidelines acceptevent() this method is called to determine whether or not an event may be accepted by a nested event queue.
nsIThreadInternal
the nsithreadinternal interface is implemented by the x
pcom thread object to let consumers observe dispatch activity on a thread.
... x
pcom/threads/nsithreadinternal.idlscriptable please add a summary to this article.
nsITraceableChannel
it is implemented by nsihtt
pchannel.
... 1.0 66 introduced gecko 1.9.0.4 inherits from: nsisupports last changed in gecko 1.9.0.4 the typical way to use this interface is as follows: register for the "http-on-examine-response" notification to track all http responses; skip redirects (responsestatus = 3xx on nsihtt
pchannel), since otherwise you may end up with two listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistreamlistener (that passes the data to the original requester - e.g.
nsIURIFixupInfo
fixu
pchangedprotocol boolean if we changed the protocol; instead of using one raw from the input.
... fixu
pcreatedalternateuri boolean if we created an alternative uri.
nsIWeakReference
x
pcom/base/nsiweakreference.idlscriptable this interface represents a proxy for an x
pcom object.
... it allows a consumer to hold an indirect, non-owning reference to an x
pcom object.
nsIWebProgressListener
in such cases, the request itself should be queried for extended error information (for example for http requests see nsihtt
pchannel.
... 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/x
pcomutils.jsm"); var mylistener = { queryinterface: x
pcomutils.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 (x
pcom) 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 x
pcom 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
« x
pcom 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 x
pcom memory allocator.
nsGetModuleProc
summary this function prototype provides the x
pcom entry-point into a module.
... #include "nsx
pcom.h" typedef nsresult (pr_callback *nsgetmoduleproc)( nsicomponentmanager *acompmgr, nsifile* alocation, nsimodule** aresult ); parameters acompmgr [in] the x
pcom component manager.
nsStaticModuleInfo
summary this data structure is used by ns_initx
pcom3 to specify static x
pcom modules.
... #include "nsx
pcom.h" struct nsstaticmoduleinfo { const char* name; nsgetmoduleproc getmodule; }; members name this member provides the name of the module as a null-terminated, ascii-valued character array.
The Thread Manager
only c++ code may use the thread manager and x
pcom thread.
... nsithreadinternal a subclass of nsithread that is implemented by the x
pcom 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 x
pcom 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 x
pcom library.
Working with out parameters
when working with x
pcom 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 x
pconnect, 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 onsto
pcopy the onsto
pcopy interface is called when the copy operation has completed.
... ns_imethod onsto
pcopy( nsresult astatus, - the resulting status for the send operation nsisupports *listenerdata) = 0; - the nsisupports pointer passed in to the original copy operation 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 x
pcshell tests, it has either passed on try or has been run locally on the appropriate platform(s).
... specifically, if the x
pcshell test will do different things on windows than it will do on os x or linux, it must be run on windows and one of os x / linux.
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 x
pcom 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 x
pcom inspectors.
Get Thunderbird version
(version 3.0b3pre was the first build to include steel.) var versionchecker = components.classes["@mozilla.org/x
pcom/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/x
pcom/version- comparator;1"].getservice(components.interfaces.nsiversioncomparator); if ( versionchecker.compare( version, "3.0b3" ) >= 0 ) // code for >= 3.0b3 else // code for < 3.0b3 ...
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 l
pctstr = ctypes.jschar.ptr; var l
pcstr = ctypes.char.ptr; var loadlibrary = kernel.declare("loadlibraryw", ctypes.winapi_abi, hmodule, l
pctstr); var getprocaddress = kernel.declare("getprocaddress", ctypes.winapi_abi, ctypes.void_t.ptr, hmodule, l
pcstr); var huser = loadlibrary("user32"); var funcptr = getprocaddress(huser, "messageboxw"); // now we have a pointer to a function, let's cast it to t...
...he right type var messageboxtype = ctypes.functiontype(ctypes.winapi_abi, ctypes.int32_t, [hwnd, l
pctstr, l
pctstr, 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 x
pcom 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 x
pcom in gecko 2 - binary components ...
Constants - Plugins
npvers_has_x
pconnect_scripting 13 plug-in is scriptable using x
pconnect.
... npvers_has_npobject_enum 18 the n
pclass in question has an enumerate field, which lets you enumerate the properties of an npobject of that class.
Animation.pause() - Web APIs
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 cu
pcake 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 cu
pcake, and the bottle that reads "drink me." var stopplayingalice = function() { alicechange.pause(); nommingcake.pause(); drinking.pause(); }; // when the user releases the cu
pcake or the bottle, pause the animations.
AudioTrack.enabled - Web APIs
function swa
pcommentarymain() { 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 swa
pcommentarymain() 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
the console.grou
pcollapsed() method is similar, but the new block is collapsed and requires clicking a disclosure button to read it.
... note: from gecko 9 until gecko 51, the grou
pcollapsed() method was the same as group().
console - Web APIs
console.grou
pcollapsed() creates a new inline group, indenting all following output by another level.
...the console.grou
pcollapsed() method is similar but creates the new block collapsed, requiring the use of a disclosure button to open it for reading.
Document.documentURIObject - Web APIs
this only works for privileged (universalx
pconnect) 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 x
pcnativewrapper).
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 ap
pcache.
...however, ap
pcache storage isn't locally mutable, and doesn't allow for fine-grained client-side management.
HTMLTextAreaElement - Web APIs
nlen : nrowend), bkee
pcols = nkey === 13 || nlen + 1 < ncols || /\n/.test(srow) || ((nrowstart === 0 || ndeltaforw > 0 || nkey > 0) && (srow.length < ncols || (nkey > 0 && (nlen === nrowend || sval.charat(nrowend) === "\n")))); return (nkey !== 13 || (areturns ?
... areturns.length + 1 : 1) < nrows) && ((nkey > 32 && nkey < 41) || bkee
pcols); } 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 cli
pcontainer = document.createelement('article'); var cliplabel = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); cli
pcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; cli
pcontainer.appendc...
...hild(audio); cli
pcontainer.appendchild(cliplabel); cli
pcontainer.appendchild(deletebutton); soundclips.appendchild(cli
pcontainer); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; var audiourl = url.createobjecturl(blob); audio.src = audiourl; console.log("recorder stopped"); deletebutton.onclick = 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 cli
pcontainer = document.createelement('article'); const cliplabel = document.createelement('p'); const audio = document.createelement('audio'); const deletebutton = document.createelement('button'); cli
pcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; cli
pcontainer.appendchild(audio); cli
pcontain...
...er.appendchild(cliplabel); cli
pcontainer.appendchild(deletebutton); soundclips.appendchild(cli
pcontainer); 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.ap
pcodename read only always returns "mozilla", in any browser.
... living standard added the ap
pcodename 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 sct
pcausecodes = [ "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.sct
pcausecode < sct
pcausecodes.length) { console.error(" sctp failure: ", err.sct
pcausecode); } else { console.error(" unknown sctp error"); } break; case "dtls-failure": if (err.receivedalert) { console.error(" received dlts failure alert: ", err.receivedalert); } if (err.sentalert) { console.error(" sent dlts failure ...
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 rtcrt
pcodecparameters objects describing the set of codecs from which the sender or receiver will choose.
... function getrt
pcname(rtpobject) { let parameters = rtpobject.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiveparameters' in that specification.
RTCRtpSynchronizationSource - Web APIs
since rtcrtpsynchronizationsource implements rtcrt
pcontributingsource, its properties are also available.
... properties also implements the properties of rtcrt
pcontributingsource.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the rtcrtptransceiver method setcodecpreferences() configures the transceiver's codecs given a list of rtcrt
pcodeccapability objects specifying the new preferences for each codec.
... syntax rtcrtptransceiver.setcodecpreferences(codecs) parameters codecs an array of rtcrt
pcodeccapability objects, in order of preference, each providing the parameters for one of the transceiver's supported codecs.
SVGLength - Web APIs
at valueinspecifiedunits domstring valueasstring constants svg_lengthtype_unknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_
pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and cm units console.log("value: " + val.value + ...
... 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") { ...
... rtcrt
pcontributingsourcestats 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 u
pcoming drawing commands.
...not only are their locations in the world changing over time, but each n
pc likely has body parts or components that are moving in relation to one another.
window.dump() - Web APIs
dump() is also available to x
pcom components implemented in javascript, even though window is not the global object in components.
...note that dump output from x
pcom components goes to stderr, while dump called elsewhere will output to stdout.
Web APIs
ions rtccertificate rtcconfiguration rtcdtmfsender rtcdtmftonechangeevent rtcdatachannel rtcdatachannelevent rtcdtlstransport rtcerror rtcerrorevent rtcicecandidate rtcicecandidateinit rtcicecandidatepair rtcicecandidatepairstats rtcicecandidatestats rtcicecandidatetype rtcicecomponent rtcicecredentialtype rtcicegathererstate rtciceparameters rtciceprotocol rtcicerole rtciceserver rtcicetc
pcandidatetype rtcicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtcremoteoutboundrtpstreamstats rtcrtcpparameters rtcrt
pcapabilities rtcrt
pcodeccapability rtcrt
pcodecp...
...arameters rtcrt
pcontributingsource 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 zi
pcode</div> <div role="textbox" contenteditable="true" aria-placeholder="5-digit zi
pcode" aria-labelledby="txtboxlabel"></div> <!-- multi-line text area --> <div id="txtboxmultilinelabel">enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxmultilinelabel" aria-required="true"></div> semantic elements are more concise and ...
... <label for="txtbox">enter your five-digit zi
pcode</label> <input type="text" placeholder="5-digit zi
pcode" id="txtbox"/> <!-- multi-line text area --> <label for="txtboxmultiline">enter the tags for the article</label> <textarea id="txtboxmultiline" required></textarea> where a text field is read-only, indicated this by setting aria-readonly="true" on the element.
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 1
pc = 1/16th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in when including a length value, if the length is 0, the unit identifier is not required.
... d
pcm dots per centimetre.
attr() - CSS: Cascading Style Sheets
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: c2
pc,
pcap).
HTML documentation index - HTML: Hypertext Markup Language
237 using the application cache advanced, app, cache, guide, html, ap
pcache, application cache, web cache html5 provides an application caching mechanism that lets web applications run offline.
... this application cache (ap
pcache) interface lists resources that browsers should cache to be available offline.
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 nsx
pccomponents_utils] // a.js: // a.js has content privileges imports.components.utils; // => undefined modules in the add-on sdk the module system used by the sdk is based on what we learned so far: it follows the commonjs specification, which attempts to define a standardized module api.
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.nsihtt
pchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type.
Chrome Authority - Archive of obsolete content
var xhr = require("x"+"hr"); var modname = "x
pcom"; var x
pcom = require(modname); var one = require("one"); var two = require("two"); the intention is that developers use require() statements for two purposes: to declare (to security reviewers) what sorts of powers the module wants to use, and to control how those powers are mapped into the module's local namespace.
Developing for Firefox Mobile - Archive of obsolete content
supported io/text-streams supported lang/functional supported lang/type supported loader/cuddlefish supported loader/sandbox supported net/url supported net/xhr supported places/bookmarks not supported places/favicon not supported places/history not supported platform/x
pcom supported preferences/service supported stylesheet/style supported stylesheet/utils supported system/environment supported system/events supported system/runtime supported system/unload supported system/xul-app supported tabs/utils supported test/assert supported t...
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) x
pcomviewer an x
pcom 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!
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 swa
pcache() to switch to the new cache.
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 power
pc 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&zi
pcode=@zi"); addressbook quick search query pref ("mail.addr_book.quicksearchquery.format" ) the format for this pref is: @v == the escaped value typed in the quick search bar in the addressbook every occurance of @v will be replaced.
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-javax
pcom build xulrunner : make -f client.mk build once the build is done, there will be a directory called mozilla-obj.
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 x
pcom stdcall calling convention because of gcc 4.3.0 bug cppflags="-dmoz_disable_x
pcom_stdcall" #specify the cxx and static analysis #point cxx to the cross compile g++ with plugin support cxx=$home/mingw-install/bin/i686-mingw32-g++ ac_add_options --with-static-checking=$home/dehydra/dehydra-gcc/gcc_dehydra.so then, you can start building your mozilla.
Tamarin Releases - Archive of obsolete content
u
pcoming 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 power
pc bug 458077 complete add mac-x64 and linux-x64 buildbots complete fail build on assertion in acceptance tests complete merge tracking bug bug 469836 in progress tc feb '09 spring backlog tbd.
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.
XML in Mozilla - Archive of obsolete content
w3c recommendation xslt xmlhttprequest w3c recommendation xml extras request api (no longer supported) mozilla add-on sdk domparser and xmlserializer mozilla xml extras sax sax soap (no longer supported) w3c note web services xml-r
pc (no longer supported) userland software xml-r
pc rdf w3c recommendations rdf svg w3c recommendation svg animation (smil) w3c recommendation mathml w3c recommendation mathml p3p (no longer supported) w3c recommendation p3p wsdl (...
XUL Tutorial - Archive of obsolete content
tent panels splitters toolbars and menus toolbars simple menu bars more menu features popup menus scrolling menus events and scripts adding event handlers more event handlers keyboard shortcuts focus and selection commands updating commands broadcasters and observers document object model document object model modifying a xul interface manipulating lists box objects x
pcom interfaces x
pcom examples trees trees more tree features tree selection custom tree views tree view details tree box objects rdf and templates introduction to rdf templates trees and templates rdf datasources advanced rules persistent data skins and locales adding style sheets styling a tree modifying the default skin creating a skin skinning xul files by hand loc...
The Implementation of the Application Object Model - Archive of obsolete content
however, in this x
pcom world, where each type of pluggable content is off in its own dll, there's no clean way to inherit functionality from some base class implementation, when that implementation must necessarily reside in a different dll, without introducing a code dependency between all pluggable content and the common base class.
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 x
pcom, 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="po
pcorn"/> <treecell label="large"/> </treerow> </treeitem> <treeitem> <treerow> <treecell label="root beer"/> <treecell label="small"/> </treerow> </treeitem> </treechildren> </tree> more information about the tree element.
panel - Archive of obsolete content
the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, to
pcenter or bottomcenter.
scrollbox - Archive of obsolete content
do this instead: var x
pcominterface =scrollbox_element.boxobject.queryinterface( components.interfaces.nsiscrollboxobject); x
pcominterface.ensureelementisvisible(child_element_to_make_visible); see the nsiscrollboxobject api for other scroll-related methods.
tooltip - Archive of obsolete content
the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, to
pcenter or bottomcenter.
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 x
pcom." xulrunner was fixed in gecko 39.
XULRunner tips - Archive of obsolete content
ry directory unzip the package copy the following files: chrome/inspector.jar to the chrome directory of your xulrunner application components/inspector-cmdline.js to your components directory defaults/preferences/inspector.js to your preferences directory open your chrome.manifest file and add these lines: content inspector jar:inspector.jar!/content/inspector/ x
pcnativewrappers=no locale inspector en-us jar:inspector.jar!/locale/inspector/ skin inspector modern/1.0 jar:inspector.jar!/skin/modern/inspector/ skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/dom/popupoverlay.xul overlay chrome://inspect...
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 x
pcom, and xulrunner applications for more detailed information, see the xul_explorer:planning#feature_planning_for_xul_explorer.
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.apps.thunderbird - october 7-13, 2006 announcements updated: thunderbird developer documentation eric shepherd has put together a checklist for the u
pcoming thunderbird developer documentation and is looking for feedback as well as contributors.
2006-10-06 - Archive of obsolete content
../../dist/host/bin/host_xpidl -m header -w -i~mozilla/x
pcom/base -i../../dist/idl -o _xpidlgen/nsiconsolelistener ~/mozilla/x
pcom/base/nsiconsolelistener.idl gmake[2]: *** [_xpidlgen/nsiconsolelistener.h] bus error gmake[2]: *** deleting file `_xpidlgen/nsiconsolelistener.h' gmake[1]: *** [export] error 2 make: *** [all] error 2:: on octorber 4th ludwig hügelschäfer responded to his original post with the solution to his own problem.
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/x
pcom/tests' gmake[2]: *** [libs] error 2 gmake[2]: leaving directory `/usr/mozilla2/src/mozilla/x
pcom' 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 u
pcoming there are no open blockers left.
2006-11-3 - Archive of obsolete content
seamonkey 1.0.6 and 1.1 beta u
pcoming the seamonkey projet is planning a security release of the stable 1.0 series as well as a beta for the 1.1 version, all possibly in the next days or week.
2006-10-27 - Archive of obsolete content
traffic status of x
pcom cycle collector graydon hoare provides the x
pcom patch which experiments with implementing a general-purpose garbage-cycle collector for x
pcom.
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 x
pcshell from mozilla.dev.platform to mozilla.dev.quality.
2006-10-27 - Archive of obsolete content
he recommends that a non-x
pcshell environment is needed really badly, but the big issue is that the x
pcshell doesn't have an event loop, so nothing asynchronous can be tested.
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 universalx
pconnect in a 'entire' protocol (http://, file://).
2006-11-10 - Archive of obsolete content
summary: mozilla.dev.tech.x
pcom - 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.
Newsgroup summaries - Archive of obsolete content
06-10-06mozilla.dev.apps.calendarmozilla.dev.tech.js-enginemozilla-dev-accessibilitymozilla-dev-apps-calendarmozilla-dev-apps-firefoxmozilla-dev-apps-thunderbirdmozilla-dev-buildsmozilla-dev-embeddingmozilla-dev-extensionsmozilla-dev-i18nmozilla-dev-l10nmozilla-dev-planningmozilla-dev-platformmozilla-dev-qualitymozilla-dev-securitymozilla-dev-tech-js-enginemozilla-dev-tech-layoutmozilla-dev-tech-x
pcommozilla-dev-tech-xul ...
Introduction to Public-Key Cryptography - Archive of obsolete content
ckzccazsgawibagibazanbgkqhkig9w0baqqfada3mqswcqydvqqgewjvuzer ma8ga1uechmitmv0c2nhcguxftatbgnvbastdfn1chjpewencybdqtaefw05nzew mtgwmtm2mjvafw05otewmtgwmtm2mjvamegxczajbgnvbaytalvtmrewdwydvqqk ewhozxrzy2fwztenmasga1uecxmeuhviczexmbuga1ueaxmou3vwcml5ysbtagv0 dhkwgz8wdqyjkozihvcnaqefbqadgy0amigjaogbamr6ezipgfjx3urjgejmkiqg 7sdatyazbcabu1avyd7chrkiq31fbxfogd3wnktbf6hro6eamm5/r1askzz8aw7l iqzbcrx
pc0k4du+2q6xju2mpm/8wkumontuvzpo+sgxelmhvcheqoocwfdizywyz nmmrjgaoma2ms6pukfqvagmbaagjnja0mbegcwcgsagg+eibaqqeawiagdafbgnv hsmegdawgbty8gzzkbhhufwjm1oxeuzc+zymytanbgkqhkig9w0baqqfaaobgqbt i6/z07z635dfzx4xbafpjlrl/aywqztsyx8gfcnaqcqcwasdkvsuj/vwbf91o3j3 ukdgy
pcd2cyrcgki4mwqdwyltpuhah18hhz5uvi00mjyw8w2wuosy0rc/a/idy84 hw3wwehbuqvk5sy4/zj4otjx7dwnmdgwbwfprqjd1a== -----end certificate----- how...
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin central, please see tamarin build documentation supported platforms operating system processor status windows xp x86 supported, acceptance and performance tests automated in buildbot mac os x 10.4 x86 supported, acceptance and performance tests automated in buildbot linux - ubuntu 8.0.4 x86 supported, acceptance and performance tests automated in buildbot windows mobile (pocket
pc 5.0) armv4t supported, acceptance and performance tests automated in buildbot raw image (no os) armv5 supported, acceptance and performance tests not done linux (nokia n810) armv5 supported, acceptance and performance tests not done current build status the current tamarin tracing build status can be found at tamarin tracing build status getting the tamarin source the tamarin tracing sourc...
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_macp
pc, 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!
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 u
pcoming 0.8.7 release if you have your first working firefox build, you can go on with building the xforms extension.
XForms Input Element - Archive of obsolete content
representations the xforms input element can be represented by the following widgets for the s
pcified data types (or types derived from these data types): text field - the default widget when no type is specified or the data is of type xsd:string (xhtml/xul) checkbox - used for xsd:boolean instance data.
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.
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.
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 x
pconnect were used to make plug-ins scriptable.
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 u
pcoming major revision of the http network protocol 200 https glossary, https, infrastructure, security https (hypertext transfer protocol secure) is an encrypted version of the http protocol.
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('universalx
pconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); ...
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 1
pc = 1/6th of 1in pt points 1pt = 1/72th of 1in px pixels 1px = 1/96th of 1in most of these values are more useful when used for print, rather than screen output.
Accessibility API cross-reference
the i
pc mechanisms used by current generation api's are also not cross-platform, although communication for some cross-platform accessibility api of the future could be done through sockets.
Gecko info for Windows accessibility vendors
hresult get_attributesfornames( /* [in] */ unsigned short numattribs, /* [in] */ bstr __r
pc_far *attribnames, /* [in] */ short __r
pc_far *namespaceid, /* [out] */ bstr __r
pc_far *attribvalues); the get_computedstyle method is used to find out the cumulative, computed results for all style rules applied to a node.
Links and Resources
the european union is looking to base their u
pcoming 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.
Command line options
other options need to be documented -print-x
pcom-dir -print-x
pcom-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%2fsobmyi8basajf
pcj1aaeejwvqqlpabxmh5bjjqi0gi9dtaagdbbccavlkgmq7ykczx
pcqxquzhaeccj4xgml493ug21zd%2badaxh0wlm4a9mzpxjkjiiawtar5pqmalacabquulttbgccagcnnzgabbgamj5thwgvjlaaaaabjru5erkjggg%3d%3d</image> <url type="text/html" method="get" template="http://developer.mozilla.org/en/docs/special:search?search={searchterms}"/> <searchform>http://developer.mozilla.org/en/docs/special:search</searchform> </searchplugin> not...
Gmake vs. Pymake
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 purplex
pcom and libpurple first download the purplex
pcom code: hg clone http://hg.mozilla.org/users/florian_queze.net/purple mozilla/extensions/purple if you've set up your build environment as above, then all you need to do is: echo 'ac_add_options --enable-extensions=purple' >> .mozconfig in the comm-central directory, or just add the ac_add_options --enable-extensions=purple line to your .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/x
pcshell-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 nsihtt
pchannel).
Reviewer Checklist
if it's js, try to design and build so that x
pcshell can exercise most functionality.
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 x
pcshell-test services/common/tests/unit/ or run an individual test: $ ./mach mochitest browser/base/content/test/general/browser_pinnedtabs.js you run mach from the source directory, so you should be able to use your shell's tab completion to tab-complete paths to tests.
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 i
pc 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 x
pcom objects and jsms.
Limitations of frame scripts
frame scripts run with system privileges and have access to the components object, enabling them to use x
pcom objects and jsms.
Communicating with frame scripts
an x
pcom 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 x
pcom objects and jsms.
Limitations of frame scripts
frame scripts run with system privileges and have access to the components object, enabling them to use x
pcom objects and jsms.
Performance
} object.assign(contentypolicy.prototype, { classdescription: ..., classid: ..., contractid: ..., queryinterface: x
pcomutils.generateqi([ci.nsicontentpolicy]), shouldload: function(type, location, origin, context) { let resultlist = services.cpmm.sendsyncmessage("my-addon:check-load", {destination: location, source: origin}) // <=== sync message!
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 ap
pcache 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.
Embedding Mozilla
mailing list newsgroup rss feed #embedding irc channel related topics gecko, x
pcom ...
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 & macp
pc.
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 x
pcom category is searched for the extension.
IME handling guide
mozilla::contentcache this is a base class of contentcacheinchild and contentcacheinparent and i
pc-aware.
Implementing QueryInterface
some alternatives the ns_impl_query_interface[012] macros the sample above implements two x
pcom 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: x
pcshell-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 enos
pc no space on device enotdir is not a directory enxio device no configured or does not support operation eopnotsupp (not always available under windows) operation not supported.
OSFile.jsm
this api is intended to replace, in time, most x
pcom-based manipulation of files (nsifile, subsets of nsiioservice, etc.) by javascript code.
Bootstrapping a new locale
where active development of the u
pcoming release of firefox occurs) and then begin the necessary work for translation.
Updates
interview to the a
pc 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 sunr
pc 113 auth 115 sftp 117 uucp-path 119 nntp 123 ntp 135 loc-srv / epmap 139 netbios 143 imap2 179 bgp 389 ldap 465 smtp+ssl 512 print / exec 513 login 514 shell 515 printer 526 tempo 530 courier ...
JS::PerfMeasurement
perfmeasurement* js::extractperfmeasurement(jsval wrapper) if you are the c++ side of an x
pcom interface, and you want to benchmark only part of your execution time but make the results available to javascript, you can declare a bare jsval argument in your .idl file and have javascript pass a perfmeasurement object that it created in that argument slot.
TimerFirings logging
com/scripts/12086/dy-min.js?v=12086:3:3389 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] https://ad.doubleclick.net/ddm/adi/n7921.1283839cadreon.com.au/b9038144.122190976;sz=300x600;click=http://pixel.mathtag.com/click/img?mt_aid=2744535504761193354&mt_id=1895890&mt_adid=148611&mt_sid=973379&mt_exid=9&mt_inapp=0&mt_uuid=353d5460-19f6-4400-9bbd-d0fcc3bcf595&mt_3
pck=http%3a//beacon-apac-hkg1.rubiconproject.com/beacon/t/d1f9921d-4e47-448f-b6ba-36cae1c31b65/&redirect=;ord=2744535504761193354?:83:0 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler 92 -495057024[7f74e105ba00]: [7108] fn timer (one_shot 160 ms): nsbrowserstatusfilter::timeouthandler the first column shows how many times the ...
TraceMalloc
(this can be done by examining the unprocessed output of an x
pcom_mem_refcnt_log, one of the nstracerefcnt logs.) you should use the --use-address argument to diffbloatdump.pl, and then the diff tree can be run through fix_linux_stack.py or fix_macosx_stack.py as needed.
Performance
related topics javascript, x
pcom, developing mozilla, extensions, addons ...
Preferences
related topics xul, javascript, x
pcom, extensions, developing mozilla ...
Crash reporting
reports and queries crash-stats has built-in reports of "to
pcrashes" 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 (p
pc), 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 x
pcom hashtable guide ...
Named Shared Memory
the unix implementation may use sysv i
pc shared memory, posix shared memory, or memory mapped files; the filename may be used to define the namespace.
PRUint64
notes note: prior to gecko 12.0, pruint64 was actually treated as a signed 64-bit integer by x
pconnect.
PRUnichar
an unsigned 16-bit type, like char in java or the "characters" of a javascript string defined in /mozilla/x
pcom/base/nscore.h.
PR_CloseSemaphore
syntax #include <pri
pcsem.h> nspr_api(prstatus) pr_closesemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore.
PR_DeleteSemaphore
syntax #include <pri
pcsem.h> nspr_api(prstatus) pr_deletesemaphore(const char *name); parameter the function has the following parameter: name the name of a semaphore that was previously created via a call to pr_opensemaphore.
PR_OpenSemaphore
syntax #include <pri
pcsem.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 <pri
pcsem.h> nspr_api(prstatus) pr_postsemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore.
PR_WaitSemaphore
syntax #include <pri
pcsem.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 i
pc semaphores i
pc semaphore functions thread pools thread pool types thread pool functions random number generator random number generator function hash tables hash tables and type constants hash table functions nspr error handling error type error functions error codes ...
Cryptography functions
sec_deletepermcertificate mxr 3.2 and later sec_deletepermcrl mxr 3.2 and later sec_dersigndata mxr 3.2 and later sec_destroycrl mxr 3.2 and later sec_findcrlbydercert mxr 3.2 and later sec_findcrlbyname mxr 3.2 and later sec_looku
pcrls mxr 3.2 and later sec_newcrl mxr 3.2 and later sec_quickderdecodeitem mxr 3.6 and later seckey_cachestaticflags mxr 3.10 and later seckey_converttopublickey mxr 3.2 and later seckey_copyprivatekey mxr 3.2 and later seckey_copypu...
JSS FAQ
jss/ssl/sslserver.java org/mozilla/jss/ssl/ssltest.java other test code that may prove useful: org/mozilla/jss/asn1/integer.java org/mozilla/jss/asn1/sequence.java org/mozilla/jss/asn1/set.java org/mozilla/jss/pkcs10/certificationrequest.java org/mozilla/jss/pkcs12/pfx.java org/mozilla/jss/pkix/cert/certificate.java org/mozilla/jss/pkix/cmmf/certre
pcontent.java org/mozilla/jss/pkix/crmf/certreqmsg.java org/mozilla/jss/pkix/crmf/certtemplate.java org/mozilla/jss/pkix/primitive/name.java org/mozilla/jss/provider/javax/crypto/jsssecretkeyfactoryspi.java org/mozilla/jss/util/utf8converter.java org/mozilla/jss/util/base64inputstream.java jss/samples/pqggen.java jss/samples/pkcs12.java if i don't ...
NSS_3.12.2_release_notes.html
bug 455424: nssilckt.h defines the enumeration constant 'lock' bug 456036: stubs for deprecated functions in lib/certdb/stan
pcertdb.c should set the pr_not_implemented_error error.
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/power
pc 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_getsrt
pcipher (in ssl.h) ssl_setrt
pciphers (in ssl.h) support for aes-gcm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30.
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_namedgrou
pconfig 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 u
pcoming 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 u
pcoming 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 p
pc 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/power
pc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdbm shared object is available anyway.
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 p
pc __has_include(<sys/auxv.h>) bug 1614786 - fix a compilation error for ‘getfipsenv’ "defined but not used" bug 1615208 - send dtls version numbers in dtls 1.3 supported_versions extension to avoid an incompatibility.
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//x1x
pcga7nrsldhz4widaqabakeajh8+4qncwcmgivnm6ytbpqt+k/jeoexg2bqhjojvnxn3fazgcefxvpuibcjvfaijs9ybcmozzrato0+k2hwnoqihaoc4nvbo8fqhzs4yxm1m86kml47fa9ui//oufbhladw1aiea2dbmixnsbokb+ohver69p0gnewlvcjc9bjdvfdlvslcciqcptv3vgyjv2vdwxqzqahc+yb4gigaqoqbcbmjd3lyflqiga+vtydunoqwtzwve4grf7izk2v5ccnhg3gr5rgwxn58cigccaforruksm66isg0iti04g9v/w+wmx91wjeeb+qbz" int main(int argc, char **argv) { secstatus rv;...
PKCS11 FAQ
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 (p
pc, alpha, x86) o macos (power
pc) 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_cm
pcertchainwcanames manipulating certificates cert_du
pcertificate 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_cm
pcertchainwcanames manipulating certificates cert_du
pcertificate 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_du
pcertificate 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 (p
pc, alpha, x86) macos (power
pc) ncr (x86) nec (mips) os2 (x86) osf (alpha) reliantunix (mips) sco (x86) solaris (sparc) sony (mips) sunos (sparc) unixware (x86) win16 (x86) win95 (x86) winnt (x86) here are some examples of valid platform strings: irix:6.2:mipssunos:5.5.1:sparclinux:2.0.32:x86win95::x86.
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 (p
pc, alpha, x86) o macos (power
pc) 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 x
pcom 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 x
pcom.
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 x
pconnect 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 o
pcodes.h by make_o
pcode_doc.py.
Bytecodes
bytecode listing all o
pcodes are annotated with a [-po
pcount, +pushcount] to represent the overall stack-effects their execution.
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_addweakpointerzonegrou
pcallback and js_addweakpointercompartmentcallback js_removeweakpointercallback is replaced with js_removeweakpointerzonegrou
pcallback 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 i
pc 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/x
pcomutils.jsm"); x
pcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an url the insert() method accepts a keyword entry object describing the keyword to insert.
Preferences API
interfaces the preferences api is exposed as a set of x
pcom components and interfaces: nsiprefservice, nsiprefbranch.
extIExtension
implemented via x
pcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
extIPreferenceBranch
implemented via x
pcom service for extiapplication: see the instructions on the fuel (firefox), steel (thunderbird) and smile (seamonkey) pages.
extISessionStorage
implemented via x
pcom 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++/x
pcom 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 x
pcom resources the x
pcom project page xulplanet's online x
pcom reference information on x
pconnect and script...
mozilla::services namespace
the services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect x
pcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.
Components.classesByID
each property represents one of the classes of x
pcom components that can be constructed or accessed as an x
pcom 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 x
pcnativewrapper.unwrap().
Components.utils.unload
see bug 769253 see also bug 481603 the documentation in x
pccomponents.idl the tests in js/x
pconnect/tests/unit/ ...
Other Resources
other resources embedding mozilla x
pconnect - javascript-x
pcom bridge blackconnect - java-x
pcom bridge (no longer supported) xpidl to java types - from blackconnect ...
appShellService
then again, there's a much easier way; one of the x
pcshell extensions is a quit function: quit(3) ...
nsIRegistry
perhaps if we quit with the x
pconnect:appshellservice, it will work.
nsIUUIDGenerator
x
pcom/base/nsiuuidgenerator.idlscriptable this interface can be used to generate an id that can be considered globally unique, often referred to as a uuid or guid.
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: _x
pcom_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...
nsIWinTaskbar
example netscape.security.privilegemanager.enableprivilege("universalx
pconnect"); 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
x
pcom/ds/nsiwindowsregkey.idlscriptable this interface is designed to provide scriptable access to the windows registry system.
nsIWritablePropertyBag2
x
pcom/ds/nsiwritablepropertybag2.idlscriptable this interface extends nsipropertybag2 with methods for setting properties.
nsIXMLHttpRequest
when using the x
pcom interface, as seen below in example 2, we can get access to this.
nsIXULAppInfo
x
pcom/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" x
pcwrappednative_nohelper { queryinterface: queryinterface(), compression: getter, size: getter, realsize: getter, crc32: getter, isdirectory: getter, lastmodifiedtime: getter, issynthetic: getter, permissions: getter, compression: 8 } scratchpad/1:19 */ if (!entry.isdirectory) { var inputstream = zr.getinputstream(entrypointer); reusablestreaminstance.init(in...
nsIZipWriter
it for (var i=0; i<dirarr.length; i++) { cu.reporterror('adding contents of dir['+i+']: ' + dirarr[i].leafname + ' path: ' + dirarr[i].path); var direntries = dirarr[i].directoryentries; while (direntries.hasmoreelements()) { var entry = direntries.getnext().queryinterface(ci.nsifile); //entry is instance of nsifile so here https://developer.mozilla.org/docs/x
pcom_interface_reference/nsifile if (entry.path == xpi.path) { cu.reporterror('skipping entry - will not add this entry to the zip file - as this is the zip itself: "' + xpi.path + '" leafname:"' + xpi.leafname + '"'); continue; } if (entry.isdirectory()) { dirarr.push(entry); } var relpath = entry.path.replace(dirarr[0]...
NS_ASSERTION
the behavior of an assertion failure can be controlled using the x
pcom_debug_break environment variable.
NS_CStringAppendData
« x
pcom api reference summary the ns_cstringappenddata function appends data to the existing value of a nsacstring instance.
NS_CStringCloneData
« x
pcom api reference summary the ns_cstringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.
Message Interfaces
nsimsgdbview nsimsgdbview - the nsimsgdbview interface handles the display of mail in the threadpane and preview pane of thunderbird and other x
pcom based mail cients.
Thunderbird extensions
d community / communications thunderbird specific : add-ons section on developer.thunderbird.net thunderbird communication channels add-on developers forum/mailing list #maildev irc channel more general : mozillazine extension development forum general developer channels related topics xul, javascript, x
pcom, themes, developing mozilla categori ...
libmime content type handlers
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 x
pcom component (i.e.
Using js-ctypes
we see that it needs to be defined like this: int winapi messagebox( _in_opt_ hwnd hwnd, _in_opt_ l
pctstr lptext, _in_opt_ l
pctstr l
pcaption, _in_ uint utype ); so we read this article here on defining types and replicate it: declaring types var lib = ctypes.open("user32.dll"); or even without the extension.
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: p
pc/x86/universal loadable mach-o bundle windowed and windowless plug-ins you can write plug-ins that are drawn in their own native windows or frames on a web page.
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 x
pconnect 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 n
pclass « previousnext » ...
Gecko Plugin API Reference - Plugins
npn_getintidentifier npn_identifierisstring npn_utf8fromidentifier npn_intfromidentifier npobject npn_createobject npn_retainobject npn_releaseobject npn_invoke npn_invokedefault npn_evaluate npn_getproperty npn_setproperty npn_removeproperty npn_hasproperty npn_hasmethod npn_setexception n
pclass structures npanycallbackstruct npbyterange npembedprint npevent npfullprint npp np_port npprint npprintcallbackstruct nprect npregion npsaveddata npsetwindowcallbackstruct npstream npwindow constants error codes result codes plug-in version constants version feature constants external resources external projects and articles for plugin creation original...
Debugger.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_i
pc” “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.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/x
pcomutils.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 o
pcode maskbit finbit the data and time columns are visible by default, but you can customize the interface to see more columns by choosing which ones to show from the context menu that is opened by right-clicking in the table header.
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 u
pcoming 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.d
pcm(number); css.dppx(number); // <flex> css.fr(number); examples we use the css.vmax() numeric factory function to create a cssunitvalue: let height = css.vm...
Drawing shapes with canvas - Web APIs
in u
pcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes.
DOMHighResTimeStamp - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdomhighrestimestam
pchrome 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-u
pcoming-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
this property only has special meaning in privileged javascript code (with universalx
pconnect 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 * " " s
pc \u0020 * * this does not use javascript's "\s" because that includes non-breaking * spaces (and also some other characters).
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 internetoffsetto
pchrome 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 internetisma
pchrome full support 1edge full support 12firefox full support yesie ?
HTMLImageElement.useMap - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetusema
pchrome 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 sa
pce between cell content and cell borders.
IDBFactory.cmp() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcm
pchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
IDBFactory - Web APIs
ra android full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitcm
pchrome full support 24 full support 24 no support 23 — 24prefixed prefixed implemented with the vendor prefix: webkitedge full support 12firefox full support 16 full support ...
Intersection Observer API - Web APIs
k, observeroptions); observers[i].observe(document.queryselector("#" + boxid)); } // scroll to the starting position document.scrollingelement.scrolltop = wrapper.firstelementchild.getboundingclientrect().top + window.scrolly; document.scrollingelement.scrollleft = 750; } intersectioncallback = (entries) => { entries.foreach((entry) => { let box = entry.target; let visible
pct = (math.floor(entry.intersectionratio * 100)) + "%"; box.queryselector(".topleft").innerhtml = visible
pct; box.queryselector(".topright").innerhtml = visible
pct; box.queryselector(".bottomleft").innerhtml = visible
pct; box.queryselector(".bottomright").innerhtml = visible
pct; }); } startup(); clipping and the intersection rectangle the browser computes the final interse...
KeyboardEvent.key - Web APIs
some specialty keyboard keys (such as the extended keys for controlling media on multimedia keyboards) don't generate key codes on windows; instead, they trigger wm_ap
pcommand events.
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 onmsvideoframeste
pcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml navigator.mslaunchuri() mslaunchuric...
Navigator.oscpu - Web APIs
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 (p
pc build) power
pc 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
standard navigatorid.ap
pcodename 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 = ap
pcodename/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 universalx
pconnect privileges.
Notification.timestamp - Web APIs
for example, a timestamp for an u
pcoming meeting could be set in the future, whereas a timestamp for a missed message could be set in the past.
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.
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
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.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
sct
pcausecode read only if errordetail is sctp-failure, this property is a long integer specifying the sctp cause code indicating the cause of the failed sctp negotiation.
RTCErrorEvent.error - Web APIs
sct
pcausecode read only if errordetail is sctp-failure, this property is a long integer specifying the sctp cause code indicating the cause of the failed sctp negotiation.
RTCIceCandidate.component - Web APIs
if (candidate.component == "rtp") { handlert
pcandidate(candidate); } else if (candidate.component == "rtcp") { handlertc
pcandidate(candidate); } else { handleunknowncandidate(candidate); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidate.component' in that specification.
RTCIceCandidate.tcpType - Web APIs
syntax var tcptype = rtcicecandidate.tcptype; value a domstring whose value is one of those defined by the rtcicetc
pcandidatetype 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.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.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.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.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@oo
pcode.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 getrt
pcname(rtpobject) { let parameters = rtpobject.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtcpparameters' in that specification.
RTCRtpReceiveParameters - Web APIs
function getrtc
pcname(receiver) { let parameters = receiver.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiveparameters' in that specification.
RTCRtpReceiver.getParameters() - Web APIs
function getrtc
pcname(receiver) { let parameters = receiver.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpreceiver.getparameters()' in that specification.
RTCRtpReceiver - Web APIs
methods rtcrtpreceiver.getcontributingsources() returns an array of rtcrt
pcontributingsource instances for each unique csrc (contributing source) identifier received by the current rtcrtpreceiver in the last ten seconds.
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 rtcrt
pcapabilities object describing the system's capabilities for sending a specified kind of media data.
RTCRtpTransceiver - Web APIs
methods setcodecpreferences() a list of rtcrt
pcodecparameters 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; ap
pcache because they don't make assumptions about what you are trying to do, and then break when those assumptions are not exactly right; you have granular control over everything.
WebRTC API - Web APIs
rtcrt
pcontributingsource 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
jsonr
pc-bidirectional: asynchronous r
pc which, on a single connection, may have functions exported on the server and, and the same time, on the client (client may call server, server may also call client).
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 x
pcom interfaces to sqlite) or the session store api (an x
pcom storage utility for use by extensions).
Functions and classes available to Web Workers - Web APIs
basic implementation (yes) ap
pcodename, product, taintenabled(): 28 (28) online: 29 (29) navigatorlanguage: (yes) appname, appversion, online, platform, useragent: 10.0 other: no support (yes) (yes) xmlhttprequest creates and returns a new xmlhttprequest object; this mimics the behavior of the standard xmlhttprequest() constructor.
Window.content - Web APIs
see also working with windows in chrome code when accessing content documents from privileged code, be aware of x
pcnativewrappers.
Window.controllers - Web APIs
each missing removal can cause bug 415775: assertion: x
pconnect is being called on a scope without a 'components' property!
Window.stop() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsto
pchrome 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_x
pc_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_x
pc_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"…} ap
pcodename: "mozilla" appname: "netscape" appversion: "5.0 (macintosh; intel mac os x 10_10_1) applewebkit/537.36 (khtml, like gecko) chrome/40.0.2214.93 safari/537.36" hardwareconcurrency: 4 online: true platform: "macintel" product: "gecko" useragent: "mozilla/5.0 (macintosh; intel mac os x 10_10_1) applewebkit/537.36 (khtml, like gecko) chrome/40.0.2214.93 safari/537.36...
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_hel
pchange event_object_defactionchange event_object_acceleratorchange msaa states cheat sheet for information on what each state does, see the msdn state constants page.
CSS Properties Reference - CSS: Cascading Style Sheets
borderleftcolor border-left-style borderleftstyle border-left-width borderleftwidth border-right borderright border-right-color borderrightcolor border-right-style borderrightstyle border-right-width borderrightwidth border-style borderstyle border-top bordertop border-top-color borderto
pcolor border-top-style bordertopstyle border-top-width bordertopwidth border-width borderwidth clear clear clip clip color color cursor cursor display display filter filter float cssfloat font font font-family fontfamily font-size fontsize ...
border-top - CSS: Cascading Style Sheets
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-to
pchrome full support 1edge full support 12firefox full support 1ie full support 4opera full support 3.5safari full support 1webview ...
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.
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 souphtt
pclientsink and shout2send exist to stream media over http.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
"> </figure> <!-- image with a caption --> <figure> <img src="https://udn.realityripple.com/samples/6c/98485e5d8a.png" alt="the beautiful mdn logo."> <figcaption>mdn logo</figcaption> </figure> code snippets <figure> <figcaption>get browser details using <code>navigator</code>.</figcaption> <pre> function navigatorexample() { var txt; txt = "browser codename: " + navigator.ap
pcodename + "; "; txt+= "browser name: " + navigator.appname + "; "; txt+= "browser version: " + navigator.appversion + "; "; txt+= "cookies enabled: " + navigator.cookieenabled + "; "; txt+= "platform: " + navigator.platform + "; "; txt+= "user-agent header: " + navigator.useragent + "; "; console.log("navigatorexample", txt); } </pre> </figure> quotations <figure> <figcapti...
<template>: The Content Template element - HTML: Hypertext Markup Language
<table id="producttable"> <thead> <tr> <td>u
pc_code</td> <td>product_name</td> </tr> </thead> <tbody> <!-- existing data could optionally be included here --> </tbody> </table> <template id="productrow"> <tr> <td class="record"></td> <td></td> </tr> </template> first, we have a table into which we will later insert content using javascript code.
<textarea> - HTML: Hypertext Markup Language
yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yeswra
pchrome full support yesedge full support 12firefox full support yesie full support yesopera full support yessafari full support yes...
Compression in HTTP - HTTP
apache supports compression and uses mod_deflate; for nginx there is ngx_http_gzip_module; for iis, the <htt
pcompression> 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), ap
pcache, 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="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
Public-Key-Pins - HTTP
public-key-pins: pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
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 power
pc mozilla/5.0 (macintosh; p
pc mac os x x.y; rv:10.0) gecko/20100101 firefox/10.0 linux linux is a more diverse platform.
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="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; max-age=5184000; includesubdomains; report-uri="https://www.example.org/hpkp-report" in this example, pin-sha256="cu
pctazwkaasuywhhnedttwpy3obake3h2+sozs7sws=" pins the server's public key used in production.
HTTP resources and specifications - HTTP
proposed standard rfc 2324 hyper text coffee pot control protocol (htc
pcp/1.0) april 1st joke spec rfc 7168 the hyper text coffee pot control protocol for tea efflux appliances (htc
pcp-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
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 (htc
pcp/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 (htc
pcp-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, includepro
pcb) { var props = []; do { if (iterateselfbool) { object.getownpropertynames(obj).foreach(function(prop) { if (props.indexof(prop) === -1 && includepro
pcb(obj, prop)) { props.push(prop); } }); } if (!iterateprototypebool) { break; ...
getter - JavaScript
get notifier() { delete this.notifier; return this.notifier = document.getelementbyid('bookmarked-notification-anchor'); }, for firefox code, see also the x
pcomutils.jsm code module, which defines the definelazygetter() function.
Intl.Locale.prototype.numberingSystem - JavaScript
n japanese financial numerals — algorithmic jpanyear japanese first-year gannen numbering for japanese calendar kali kayah li digits khmr khmer digits knda kannada digits lana tai tham hora (secular) digits lanatham tai tham tham (ecclesiastical) digits laoo lao digits latn latin digits le
pc le
pcha digits limb limbu digits mathbold mathematical bold digits mathdbl mathematical double-struck digits mathmono mathematical monospace digits mathsanb mathematical sans-serif bold digits mathsans mathematical sans-serif digits mlym malayalam digits modi modi digits mong mongolian di...
Intl.NumberFormat() constructor - JavaScript
possible values include: "adlm", "ahom", "arab", "arabext", "bali", "beng", "bhks", "brah", "cakm", "cham", "deva", "diak", "fullwide", "gong", "gonm", "gujr", "guru", "hanidec", "hmng", "hmnp", "java", "kali", "khmr", "knda", "lana", "lanatham", "laoo", "latn", "le
pc", "limb", "mathbold", "mathdbl", "mathmono", "mathsanb", "mathsans", "mlym", "modi", "mong", "mroo", "mtei", "mymr", "mymrshan", "mymrtlng", "newa", "nkoo", "olck", "orya", "osma", "rohg", "saur", "segment", "shrd", "sind", "sinh", "sora", "sund", "takr", "talu", "tamldec", "telu", "thai", "tibt", "tirh", "vaii", "wara", "wcho".
JavaScript shells - JavaScript
javascript shell (js) - a command line interpreter for javascript x
pcshell is an x
pconnect - 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.
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 u
pcoming articles and use in our example application.