Search completed in 0.92 seconds.
108 results for "codebase":
Your results are loading. Please wait...
The Firefox codebase: CSS Guidelines
basics here are some basic tips that can optimize reviews if you are changing css: avoid !important but if you have to use it, make sure it's obvious why you're using it (ideally with a comment). the overriding css section contains more information about this. avoid magic numbers; prefer automatic sizing or alignment methods. some examples to avoid: absolutely positioned elements hardcoded values such as: vertical-align: -2px; . the reason you should avoid such "hardcoded" values is that, they don't necessarily work for all font-size configurations. ...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
s that this section outlines. traditionally, the object element has been used differently by microsoft internet explorer and by mozilla-based browsers such as netscape 7. in ie, the object element is used to invoke a plugin that is built on the activex architecture. ...
...ove example, the classid attribute that goes along with the object element points to a "clsid:" urn followed by the unique identifier of an activex control (in the above example, the string beginning with "d27..."). this is, in fact, the unique identifier of macromedia's flash plugin, and developers are expected to know such unique identifiers in order to invoke the component of their choice. the codebase attribute used above points to a location that houses the cab file containing the activex control. in this context, the codebase attribute is used as an obtainment mechanism -- that is to say, a way to obtain a control if it isn't present. if the flash activex control is not installed, ie will then go to the url referenced by the codebase attribute and retrieve the activex control. additional par...
...sh plugin for both ie and netscape 7. however, there are a few caveats that developers ought to bear in mind when using the object element with mozilla-based browsers such as netscape 7 and in ie: caveats if you use one single object element for both browsers (as in the above example), it is not possible to provide a cross-browserobtainment mechanism for streamlined download. ...
...And 7 more matches
nsIPrincipal
fingerprint id of this principal's certificate. throws if there is no certificate associated with this principal. read only. hascertificate boolean whether this principal is associated with a certificate. read only. hashvalue unsigned long returns a hash value for the principal. read only. native code only! origin string the origin of this principal's codebase uri. an origin is defined as: scheme + host + port. read only. prettyname autf8string the pretty name for the certificate. this sort of (but not really) identifies the subject of the certificate (the entity that stands behind the certificate). note that this may be empty; prefer to get the certificate itself and get this information from it, since that may provide more informa...
...for the certificate. this actually identifies the subject of the certificate. this may well not be a string that would mean much to a typical user on its own (e.g. it may have a number of different names all concatenated together with some information on what they mean in between). throws if there is no certificate associated with this principal. read only. uri nsiuri the codebase uri to which this principal pertains. this is generally the document uri. read only. note: this wasn't accessible by scripts prior to gecko 2.0. constants principal capability constants these values indicate the capabilities of a principal. the order is significant; if an operation is performed on a set of capabilities, the minimum is computed. constant value de...
...s native code only!canenablecapability short canenablecapability( in string capability ); parameters capability missing description return value missing description exceptions thrown missing exception missing description checkmayload() checks whether this principal is allowed to load the network resource located at the given uri under the same-origin policy. this means that codebase principals are only allowed to load resources from the same domain, the system principal is allowed to load anything, and null principals are not allowed to load anything. note: prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this was not available to scripts. if the load is allowed this function does nothing. if the load is not allowed the function throws ns_error_dom_bad_uri...
...And 3 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
software (in a streamlined manner) that the web site wants the user to have. trigger scripts are a recommended way of initiating an xpinstall download. triggering an xpinstall download from html in a manner analogous to how smartupdate downloads were initiated by the pluginurl attribute of the embed tag, xpinstall downloads can also be initiated by html tags invoking plugins, notably via the codebase attribute of the object tag. this is analogous to how internet explorer downloads cab files pointed to by the codebase attribute of the object tag. here's an example of a hypothetical object tag used to invoke myplugin (an imaginary application): <object id="theplugin" type="application/x-myplugin" width="100" height="100" codebase="http://location/xpi/myplugin.xpi"> <param .... > in the abo...
...note: xpi packages (files with the xpi extension) use the application/x-xpinstall mime type. ...
...: 05 aug 2002 copyright information: copyright © 2001-2003 netscape. all rights reserved. link: http://devedge-temp.mozilla.org/view.../index_en.html triggering an xpinstall download from html in a manner analogous to how smartupdate downloads were initiated by the pluginurl attribute of the embed tag, xpinstall downloads can also be initiated by html tags invoking plugins, notably via the codebase attribute of the object tag. this is analogous to how internet explorer downloads cab files pointed to by the codebase attribute of the object tag. here's an example of a hypothetical object tag used to invoke myplugin (an imaginary application): <object id="theplugin" type="application/x-xpinstall" width="100" height="100" codebase="http://location/xpi/myplugin.xpi"> <param .... > in the ab...
...note: xpi packages (files with the xpi extension) use the application/x-xpinstall mime type. ...
JSPrincipals
obsolete since jsapi 13 getprincipalarray void * (*)(jscontext *, jsprincipals *) pointer to the function that returns an array of principal definitions. ...
...obsolete since jsapi 13 getprincipalarray void * (*)(jscontext *, jsprincipals *) pointer to the function that returns an array of principal definitions. ...
...ugh the js_...forprincipals functions. some examples of security-enhanced api call are js_compilescriptforprincipals, js_compilefunctionforprincipals, and js_evaluatescriptforprincipals. these functions ensure that the given jsprincipals object is indelibly associated not only with the script being compiled or evaluated, but with all functions ever created by that script or code eval()-ed by it. codebase points to the common codebase for this object or script. only objects and scripts that share a common codebase can interact. getprincipalarray is a pointer to the function that retrieves the principals for this object or script. globalprivilegesenabled is a flag that indicates whether principals are enabled globally. refcount is the reference count. this is used for memory management. each tim...
... when refcount reaches zero, the principals are no longer in use and are destroyed. ...
Setting up CDT to work on SpiderMonkey
hence, here is a short-ish guide for doing just that. ...
...hence, here is a short-ish guide for doing just that. ...
...ant to use ccache, you can enable it by adding --with-ccache to the arguments list. due to a bug in cdt, you have to make a small change to cdt's build configuration as explained in step 3 below for that to work, though. step 2 - installing eclipse and setting up the project the following run-down is a condensed and updated version of what is explained in much more detail for the entire mozilla codebase. luckily, improvements in cdt have reduced the basic process to manageable five steps: download and extract "eclipse ide for c/c++ developers" from the eclipse downloads page. start eclipse and create a workspace somewhere. select "new > makefile project with existing code" from the "file" menu. give the project a name that you like ("spidermonkey" has a nice ring to it) and use the "browse...
...his point, the indexer starts running and already produces a pretty decent index of much of spidermonkey. still, there are a quite a few things that cdt does not pick up yet: for everything to be indexed, cdt has to be aware of the project's build details. step 3 - index all the code to let cdt know about the build, it has to invoke make itself (or, as is done in the guide for the whole mozilla codebase on mdn, read a log of the build), which can be setup with these simple steps: open the project's properties by selecting its root and clicking "properties" in the "file" menu and select "c/c++ build". under the "builder settings" group tab, deactivate "use default build command". instead, change "build command" to read make -w (this is required because cdt needs detailed information about wh...
Plug-in Basics - Plugins
his use of nested object elements with markup more congenial to gecko included as children of the parent object element. ...
...he child element, where these rules for handling mime types are repeated. the rest of this section is a brief introduction to this html element. for more information on the object element and other elements used for plug-in display, see w3c html 4.01 specification. to embed a variety of object types in an html page, use the object element. <object classid="classfile" data="datalocation" codebase="classfiledir" type="mimetype" align="alignment" height="pixheight" width="pixwidth" id="name" > ... </object> the first set of object element attributes are urls. classid is the url of the specific object implementation. this attribute is similar to the code attribute of the applet element. though gecko does not support this object attribute, you can nest object elements with d...
...c object implementation. this attribute is similar to the code attribute of the applet element. though gecko does not support this object attribute, you can nest object elements with different attributes to use the object element for embedding plug-ins on any browser platform (see the example above). data represents the url of the object's data; this is equivalent to the src attribute of embed. codebase represents the url of the plug-in; this is the same as the codebase attribute of the applet element. for plug-ins, codebase is the same as pluginspace. type represents the mime type of the plug-in; this is the same as the type attribute of embed. height, width, align are basic img/embed/applet attributes supported by object. height and width are required for object elements that resolve to embe...
...of elements within an html page. border: draw a border 25 pixels wide around the plug-in. align: align the plug-in at the right side of the web page. the following example shows an embed element nested within an object element, which is necessary for browsers that do not support the embed element. ...
Index - Archive of obsolete content
to the extension window. the issue that is commonly overlooked here is that the rss feed could contain some malicious javascript code and it would then execute with the privileges of the extension — meaning that it would get full access to the browser (cookies, history etc) and to user’s files. these issues can easily be avoided by making use of the existing security mechanisms in the mozilla codebase. the following article explains these security mechanisms, ideally an extension that needs to display web content (which is always potentially dangerous) will use all of them. 231 downloading json and javascript in extensions ajax, add-ons, extensions, json, xmlhttprequest a common practice found in many extensions is using xmlhttprequest (or some other mechanism) to download...
...us component for the chrome registry and an install.js script to perform the installation. finally we'll zip the files into an archive. 395 making it into a static overlay add-ons, extensions now that we have a working mozilla extension that shows tinderbox status, we need to make it distributable to other users. the two ways of doing that are to integrate it into the mozilla codebase (in which case it is no longer an extension but rather part of the default mozilla distribution) and to package it into an installer that users can run from within mozilla to add the extension to their mozilla installation. 396 prerequisites add-ons, extensions in order to complete this tutorial you need to have and know how to use the following programs on your computer: ...
.... this introduction is the first in a series of articles on venkman and javascript debugging. even if you are already using venkman, the features, procedures, and tips described here will make you a more confident web developer and debugger. 688 video presentations presentations mozilla is actively working to produce video presentations that can help you learn how the mozilla codebase works and how to take advantage of its technology in your own applications and extensions. this article is a jumping-off point to help you find those presentations. 689 when to use ifdefs developing mozilla the mozilla codebase is used for many different projects and products, including firefox, thunderbird, xulrunner, and many others. sometimes the same basic code is used fo...
RDF in Mozilla FAQ - Archive of obsolete content
tainer;1 contractid and init() it with the datasource and resource as parameters. note that this will fail if the resource isn't already a container. xul templates xul templates are created by specifying a datasources attribute on an element in a xul document. there are two "forms" that xul templates may be written in. the "simple" form, which is currently the most common form in the mozilla codebase, and the "extended" form, which allows for sophisticated pattern matching against the rdf graph. see the xul:template guide. (these are bizarrely arranged because the eventual intent is to introduce templates using the extended form -- which in many ways is conceptually simpler, even if more verbose -- and then treat the "simple" form as a shorthand for the extended form.) what can i build with ...
...rvice's getdatasource() method, so it will be managed similarly to all other datasources loaded this way. what is the security model for rdf/xml in xul? xul that is loaded from a "trusted" url (currently, any chrome: url) can specify any datasource uri in the datasources attribute of the xul template. xul that is loaded from an "untrusted" url can only specify an rdf/xml document from the same codebase (in the java sense of the word) that the xul document originated from. no "special" (i.e., rdf:) datasources may be loaded from untrusted xul. how do i add a datasource to a xul template? although it's possible to create a xul template with an "implicit" set of datasources by specifying the datasources attribute, there are often times when you won't know the datasource that you want to add unti...
...se are included in signed scripts, and are runnable from http directly. see also duplicates.rdf (for live rdf feed from mozilla) alongside duplicates.xul. note that for these to work, you have to relax mozilla's security model. to do this, add the following line to your preferences file. (shut down mozilla first since it overwrites your preferences file when you quit.) user_pref("signed.applets.codebase_principal_support", true); mozilla will ask you if you want to grant the scripts in duplicates.xul permission to access xpconnect; respond in the affirmative. currently, mozilla does not allow unprivileged access to the rdf interfaces and services; see bug 122846 for details. please mail danbri, mozilla-rdf or waterson with urls if you are aware of other examples to which we ought to link! n...
Developing New Mozilla Features - Archive of obsolete content
our portability requirements may be new to even seasoned developers. our cross-platform component model (“xpcom”) is similar to com, but you’ll want to make sure you use it well before going too far with your project. and of course, we have a set of coding practices to help everyone live together. ...
... hard to have a developer involved in the core code who is connected to what you are doing if you can’t make this happen, let mozilla.org staff know and we will try to facilitate this. it’s possible developers may not pay much attention to you because they believe your proposed feature is not a high priority, or is not wanted at all, or that you haven’t demonstrated that you understand the codebase and mozilla coding practices well enough for them to spend a lot of time with you. in some cases the developers may be in error and staff will work to make this clear and get you connected. in other cases, mozilla.org staff may agree with the developers that it does not make sense for them to spend much time assisting with your project. this is a painful setting and we hope it doesn’t happen of...
Video presentations - Archive of obsolete content
how pages are built using the dom this presentation describes how documents are loaded and the dom tree is constructed. (as quicktime; 198 mb) laying out and drawing documents (slides) this presentation describes how a document is laid out and painted to the display by the gecko engine. ...
... how pages are built using the dom this presentation describes how documents are loaded and the dom tree is constructed. (as quicktime; 198 mb) laying out and drawing documents (slides) this presentation describes how a document is laid out and painted to the display by the gecko engine. ...
Windows Media in Netscape - Archive of obsolete content
media player 7 and later, although netscape 7.1 supports the clsids of windows media player 6x and later. it is important to note that in netscape 7.1, only the classid for windows media player is supported, and no other control can be created. the various param elements that can be used and the functionalities behind them is best described by the windows media 9 series sdk. in netscape 7.1, the codebase attribute of the object element cannot be used to initiate a digitally signed download of the windows media control, if it is not present on the machine. the section below on scripting the control covers more on how to detect if the windows media player has not been successfully created. scripting the windows media player control the number of methods and properties that are exposed by the windo...
...ng by scripts in the web page containing the control, are covered in detail by the windows media player sdk. this section covers relevant issues concerning the invocation of methods and properties from within web pages that are embedding the windows media control. detecting successful creation of the control often, usage of activex controls in ie involve the use of the object element along with a codebase attribute that initiates a download of the component if it is missing from the machine running the web page. the windows media 9 series sdk doesn't provide a url to use with the codebase attribute for retrieval of the component in ie, and on netscape 7.1 the codebase attribute isn't supported for such retrieval. therefore detecting whether the component was successfully instantiated can help prov...
Command line crash course - Learn web development
choice of installing tools globally — so we can access them anywhere — or locally to the current project directory. there's pros and cons each way — and this list of pros and cons for globally installing is far from exhaustive: pros of installing globally cons of installing globally accessible anywhere in your terminal may not be compatible with your project's codebase only install once other developers in your team won't have access to these tools, for example if you are sharing the codebase over a tool like git. uses less disk space related to the previous point, it makes project code harder to replicate (if you install your tools locally, they can be set up as dependencies and installed with npm install). always the same vers...
...y with prettier, so you can see how it works. first of all, create a new directory somewhere on your file system that is easy to find. maybe a directory called prettier-test on your desktop. now save the following code in a new file called index.js, inside your test directory: const myobj = { a:1,b:{c:2}} function printme(obj){console.log(obj.b.c)} printme(myobj) we can run prettier against a codebase to just check if our code wants adjusting. cd into your directory, and try running this command: prettier --check index.js you should get on output along the lines of checking formatting... index.js code style issues found in the above file(s). forgot to run prettier? so there's some code styles that can be fixed. no problem. adding the --write option to the prettier command will fix those up...
Contributing to the Mozilla code base
er. your mentor will help guide you with the bug fix and through the submission and landing process. good first bugs - are the best way to take your first steps into the mozilla ecosystem. they're all about small changes, sometimes as little as a few lines, but they're a great way to learn about setting up your development environment, navigating bugzilla, and making contributions to the mozilla codebase. visit firefox-dev.tools - we list firefox developer tools bugs for new contributors. student projects - are larger projects, such as might be suitable for a university student for credit. of course, if you are not a student, feel free to fix one of these bugs. we maintain two lists: one for projects based on the existing codebase, and one for implementing new applications. use a bug searchin...
... fixing a nontrivial number of bugs you should request level 3 access so you can land your own code after it has been reviewed. ...
Mozilla
nology lets firefox help protect users by comparing the urls the user visits to a list of known scam sites, and presenting a warning to the user when they visit a site on the list. an introduction to hacking mozilla this guide introduces the mozilla project and provides an overview for developers interested in contributing to or exploring the various parts of the codebase. android-specific test suites there are several android-specific test suites that run on the firefox for android codebase: api change rules until further notice, the following rules govern api changes: application cache implementation overview this happens in nshttpchannel::opencacheentry(). all top level document load...
...on the build page for your platform. mozilla dom hacking guide mozilla gives you the opportunity not only to use very powerful and complete dom support, but also to work on a world-class implementation of one of the greatest internet technologies ever created. mozilla external string guide the mozilla codebase used to have a notion of "external" strings, which were the string classes visible to code outside of the mozilla codebase (extensions, xulrunner applications, and embedders). these classes were removed a long time ago. the only remaining string classes are the "internal" ones, which are documented xpcom guide internal strings. mozilla framework based on templates ...
HTMLObjectElement - Web APIs
list of archives for resources for this object. htmlobjectelement.border is a domstring that reflects the border html attribute, specifying the width of a border around the object. htmlobjectelement.code is a domstring representing the name of an applet class file, containing either the applet's subclass, or the path to get to the class, including the class file itself. htmlobjectelement.codebase is a domstring that reflects the codebase html attribute, specifying the base path to use to resolve relative uris. htmlobjectelement.codetype is a domstring that reflects the codetype html attribute, specifying the content type of the data. htmlobjectelement.contentdocument read only returns a document representing the active document of the object element's nested browsing context, if...
...nition of 'htmlobjectelement' in that specification. living standard html5the definition of 'htmlobjectelement' in that specification. recommendation the w3c specification is a latest of a previous version of html living standard technically, the property tabindex is now defined on htmlelement. the following properties are now obsolete: align, archive, border, code, codebase, codetype, declare, hspace, standby, and vspace. the following properties have been added: typemustmatch, contentwindow, willvalidate, validity, and validationmessage. the following methods have been added: checkvalidity() and setcustomvalidity(). document object model (dom) level 2 html specificationthe definition of 'htmlobjectelement' in that specification. obsolete the ...
system/events - Archive of obsolete content
api for working with the application observer service. usage the system/events module provides core (low level) api for working with the application observer service, also known as nsiobserverservice. you can find a list of events dispatched by the firefox codebase here. var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type. event : object an optional object with data and subject attributes. data refers to a string that you would like to pass throu...
Displaying web content in an extension without security issues - Archive of obsolete content
to the extension window. the issue that is commonly overlooked here is that the rss feed could contain some malicious javascript code and it would then execute with the privileges of the extension — meaning that it would get full access to the browser (cookies, history etc) and to user’s files. these issues can easily be avoided by making use of the existing security mechanisms in the mozilla codebase. the following article explains these security mechanisms, ideally an extension that needs to display web content (which is always potentially dangerous) will use all of them. displaying untrusted data as content in firefox, there is a distinction between chrome and content documents. the top document in a window is always a chrome document. if you look at the frames it loads, those will usually ...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
hat firefox itself and its extensions have privileges set by default after installation and registration. extensions don't need special code like that in listing 2 in order to get privileges. fixme: we should advise against using such method fixme: figure 1: dialog requesting privileges listing 3: grant privileges without manual confirmation for a specific file user_pref("capability.principal.codebase.test.granted", "universalxpconnect"); user_pref("capability.principal.codebase.test.id", "file url"); frequently used xpcom functions let’s take a look at those xpcom functions that are used especially frequently. you should be able to get the gist of how xpcom is used by looking at the sample code. you can paste almost all the sample code in this chapter into your existing test.xul file to ...
Appendix F: Monitoring DOM changes - Archive of obsolete content
for add-ons targeting only the latest firefox, those wishing to support older browsers will need to provide fallbacks. for more information, see this blog post on the issues at hand. non-mutation triggers it is usually possible to tell when a mutation has occurred or is about to occur without resorting to mutation events or observers. most of these methods are specific to a particular site or codebase. hashchange and popstate events most ajax-heavy sites update the url when they significantly change their content, either via a change to the fragment identifier (hash) or more recently via the history.pushstate method. the former triggers a hashchange event while the latter triggers a popstate event. event listeners for those events are the preferred method for detecting dom modifications when...
Installing plugins to Gecko embedding browsers on Windows - Archive of obsolete content
etermine where to install a given plugin (for mozilla browsers) on windows. since the prospect of embedded gecko browsers raises the scenario of more than one gecko-based browser that a netscape-style plugin can work with, it becomes important to let plugin developers know how to discover these browsers on a windows machine. this information applies to mozilla based browsers that pull the mozilla codebase after the mozilla 0.9.1 milestone release. none of the registry keys mentioned here are written by browsers before the mozilla 0.9.1 timeframe. for example, netscape 6.0 and 6.01 do not write any of these keys into the registry, and thus these keys are not available for plugin vendors to parse for these two browsers. netscape 6.1 and onwards, however, will write these keys, and so creating a plug...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
h="500" height="300"> <param name="type" value="video/quicktime"/> <param name="src" value="http://www.foobar.com/some_movie.mov"/> <!-- custom arguments --> <param name="loop" value="true"/> </object> the classid attribute tells ie to create an instance of the plug-in hosting control, the width and height specify the dimensions in pixels. you may optionally specify a codebase attribute if you have packaged the control into a cab file and wish for it to be installed automatically. the following <embed> attributes have <param> tag equivalents: <param name="type" ...> is equivalent to typespecifies the mime type of the plug-in. the control uses this value to determine which plug-in it should create to handle the content. <param name="src" ...> is equivalent to srcspec...
Conclusion - Archive of obsolete content
ucture and installer script to install these files in that subdirectory? how could you modify the extension to load the tinderbox page when you click on the status icon? mozilla has a fourth ui layer--localized text--that wasn't discussed in the tutorial because there is no text to localize. how could it be added to the extension if necessary? tinderbox actually keeps track of more than one codebase. in particular, it tracks both the main mozilla codebase (the trunk) and a stable branch. how could you modify tinderstatus to show the status of both the trunk and the branch? this extension can be installed into netscape 7 without problems. firefox has slightly different chrome registry requirements, so you may need to modify the contents.rdf files. for example, you need to change chrome://na...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
hrome#"> <rdf:seq about="urn:mozilla:package:root"> <rdf:li resource="urn:mozilla:package:tinderstatus"/> </rdf:seq> <rdf:description about="urn:mozilla:package:tinderstatus" chrome:displayname="mozilla tinderstatus extension" chrome:author="myk melez" chrome:name="tinderstatus" chrome:extension="true" chrome:description="displays tinderbox status for the mozilla codebase."> </rdf:description> <rdf:seq about="urn:mozilla:overlays"> <rdf:li resource="chrome://navigator/content/navigator.xul"/> </rdf:seq> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://tinderstatus/content/tinderstatusoverlay.xul</rdf:li> </rdf:seq> </rdf:rdf> install.js, on the other hand, goes into the tinderstatus-installer directory: initinstall( "mozi...
Making it into a static overlay - Archive of obsolete content
now that we have a working mozilla extension that shows tinderbox status, we need to make it distributable to other users. the two ways of doing that are to integrate it into the mozilla codebase (in which case it is no longer an extension but rather part of the default mozilla distribution) and to package it into an installer that users can run from within mozilla to add the extension to their mozilla installation. most extensions are distributed as installer packages, and that's how we'll distribute our extension. integrating extensions into the mozilla codebase is beyond the scope of this tutorial, but for more information see mozilla.org's hacking documentation. mozilla installer packages are called xpis (pronounced "zippies"), which stands for cross-platform installer. the packages ar...
Tinderbox - Archive of obsolete content
er that makes those results available via a web page. the tool enables mozilla.org to be immediately notified of changes to the code that prevent mozilla from compiling and running (or compromise performance and footprint) so they can get someone to fix the problem or reverse the changes. mozilla engineers regularly check tinderbox before changing the code because changes are prohibited while the codebase is broken. the mozilla sheriff, a rotating position responsible for watching the code and getting engineers to fix breakage, checks tinderbox even more regularly. while it isn't difficult to load the tinderbox web page or sidebar, it would be useful to have an even quicker way to check tinderbox that doesn't require going to a web page, changing sidebars, or even having the sidebar open. although...
DTrace - Archive of obsolete content
in d (no, not that one). mozilla dtrace support has been added by the sun dtrace team and can be used on solaris 10 and mac os x 10.5. dtrace has been largely supplanted by the gecko profiler and other tools, so this documentation has been archived. if you find that there are still use cases of consequence, you're welcome to file a documentation bug. the dtrace probes currently built into the codebase may be enabled by default in the future, but for now you'll need to create a build with --enable-dtrace (on mac os x you also have to use at least the 10.5 sdk for --with-macos-sdk, unlike the common configuration that uses the 10.4 sdk). trunk nightly builds with shark support (*-mac-shark.dmg here) are built with --enable-dtrace. documentation writing scripts a g...
Dehydra Frequently Asked Questions - Archive of obsolete content
for patterns in control flow graphs (cfgs). images of those graphs reminded me of the multiheaded hydra monster. thus de-hydra can be thought of as a decapitating tool for slaying cfgs. currently dehydra does not provide the cfg functionality, this functionality is now provided by treehydra. what is the status of gcc 4.5 support? development version of dehydra should work with gcc 4.5 on any c++ codebase. if you encounter bugs or crashes, report them. where does one report dehydra bugs? use this link to file bugs. for crashes reports attach a minimized input file. use either a source files that rely on standard headers or a compressed .ii file (pass -save-temps to gcc to get .ii files). where can i find js code for real-life analyses for dehydra? please see static checking scripts on mozilla-cent...
Installing Dehydra - Archive of obsolete content
to generate preprocessed mozilla source files (*.ii), see the pork install instructions. see also dehydra_manual treehydra build instructions ...
Gecko Coding Help Wanted - Archive of obsolete content
sure could use the help. here are some fixes that are straightforward; they just need some time and attention: decomtamination convert weird, ugly and inefficient method signatures to more natural c++ method signatures. it's really improved code readability, reduced code size, and sped up performance. it's kind of tedious but it's extremely valuable and will help you learn the way around the codebase. we've done a lot, but there's a lot more to do. roc is willing to work closely with anyone with reasonable c++ experience to get them started on this. just send him mail. not up for coding yet? join the gecko bugathon and help save gecko engineers from imminent doom! original document information author(s): fantasai last updated date: may 4, 2004 copyright information: portio...
Java in Firefox Extensions - Archive of obsolete content
ss to java.net.urlclassloader to get a class loader, and finally pass the classloader and array to a function which gives the necessary privileges: // this function will be called to give the necessary privileges to your jar files // however, the policy never comes into play, because // (1) adding permissions doesn't add to the policy itself, and // (2) addurl alone does not set the grant codebase function policyadd (loader, urls) { try { //if have trouble with the policy try changing it to //edu.mit.simile.javafirefoxextensionutils.urlsetpolicy var str = 'edu.mit.simile.javafirefoxextensionutils.urlsetpolicy'; var policyclass = java.lang.class.forname( str, true, loader ); var policy = ...
Mozilla Application Framework - Archive of obsolete content
structure and widgets of your user interface while your application is running. xulmaker a gui builder currently under development that lets you drag-and-drop widgets onto a grid to build your user interface. bugzilla the mozilla bug tracking webtool to help you track progress in fixing bugs and implementing features that affect your applications. lxr a web interface to the mozilla codebase that shows you every file in the repository as well as a line-by-line breakdown of who changed which line when in each file bonsai a web interface to the checkin log that you can query for checkins between certain dates, of certain files, or by certain developers. tinderbox our 24/7 build and test webtool that constantly builds, tests, and reports on the mozilla application suite on mul...
How to Write and Land Nanojit Patches - Archive of obsolete content
obsolete since gecko 11 (firefox 11 / thunderbird 11 / seamonkey 2.8)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. nanojit was removed during the development of (firefox 11 / thunderbird 11 / seamonkey 2.8), so this information is relevant to earlier versions of the codebase. adobe and mozilla share a copy of nanojit. this means that landing nanojit patches is a bit complicated, but experience has taught us that this is much better than having separate versions of nanojit. (note: this document is called nanojitmerge for historical reasons -- adobe and mozilla used to have separate copies of nanojit, but this was a maintenance headache so they were merged. the first version of th...
Tamarin build documentation - Archive of obsolete content
rial can be found here. building tamarin building tamarin will create all the libraries for the avmplus and garbage collector (mmgc), and create a standalone executable (shell) for executing files in the abc file format. running the shell without any arguments will list the available options. note that additional command-line arguments are only available in the debug configuration. the tamarin codebase contains a cross-platform build system for mozilla developers. the cross-platform build system is used for daily automated build testing so it is the most reliable system. the tamarin codebase has the ability to build additional code which supports debugging hooks. in the xcode project, this is the debug_debugger and release_debugger configurations. the flash player builds tamarin with the debug...
When To Use ifdefs - Archive of obsolete content
sometimes the same basic code is used for multiple projects, but there are small differences needed. "ifdefs", or conditional instructions, are used to build different code what are ifdefs ifdefs are conditional directives to a text preprocessor which mark that certain blocks of code are used only in certain conditions. in this document, the term is used more loosely to discuss any kind of conditional that differentiates between different build configurations. ...
XBL - Archive of obsolete content
removal of the xbl implementation is being tracked in bug 1566221. see also: xbl removal design review packet, problems with xbl and the xbl and web components comparison. xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents. the element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding. ...
Manifest Files - Archive of obsolete content
applications if you are creating applications for older versions of mozilla software, that is, before firefox 1.5 or mozilla 1.8, the process is a bit more involved. the following describes how to set up a package for earlier versions. this section may be skipped if you are writing new extensions or xul applications. note: this older process does also apply to the new seamonkey 1.0 though. the codebase there has not yet adopted the "manifest" format. <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <rdf:seq about="urn:mozilla:package:root"> <rdf:li resource="urn:mozilla:package:myapplication"/> </rdf:seq> <rdf:description about="urn:mozilla:package:myapplication" chrome:displ...
The Implementation of the Application Object Model - Archive of obsolete content
xul development will take even less time than xp development. the additional cost up front to implement xul is worth it for the amount of time it will save in future versions of the browser. timing. it's now or never. if this approach isn't taken now, then we'll fall back into our old pattern. this is the pivotal point, because the apps are all being re-written from scratch. for this particular codebase, if we don't do this from start, we won't do it at all. why use rdf at all? ok, ok. so you've convinced me that xul is the way and the light. but why do you need to use rdf at all? nsicontent, nsidomelement, and all of those interfaces mentioned at the beginning of this document are just that: interfaces! couldn't you just make mail content and bookmarks content etc. and have them implement th...
Archived Mozilla and build documentation - Archive of obsolete content
that it is not included in the gecko-based browsers such as k-meleon, galeon and netscape 8.x. venkman has been provided as part of the mozilla install distribution since october 2001, as well as an extension package in xpi format. video presentations mozilla is actively working to produce video presentations that can help you learn how the mozilla codebase works and how to take advantage of its technology in your own applications and extensions. this article is a jumping-off point to help you find those presentations. gecko - the smart embedding choice xbdesignmode.js xml in mozilla mozilla has a relatively good support for xml. several world wide web consortium (w3c) recommendati...
Mozilla release FAQ - Archive of obsolete content
re can i get the sources to netscape 4.x or lower? these sources are not available. much of the old code cannot be released due to legal concerns, and at the time of mozilla's initial release, that code was removed from the tree. the 'classic' branch of the current cvs tree is as close to the 4.x source as the public will ever see, although that branch has been abandoned in the move to the modern codebase. how do i tweak the interface (replace the logo, etc)? the xptoolkit docs might help in writing the needed xul. you can find replacement themes in preferences, under appearance->themes, using the 'get new themes' link there. where can i get patches? there is not currently a central repository of patches. however, via cvs, you can keep up with the latest source from mozilla. i made a patch! how do...
Adobe Flash - Archive of obsolete content
handle such callbacks are specially named so that the flash plugin can find them. these special callback functions are named with a concatenation of the name of the embed element, the underscore ("_"), and the string "dofscommand". ...
The First Install Problem - Archive of obsolete content
lies with the writing of plugin directory information into the registry along with a plid, we can then use the object tag to invoke plugins based on their "classid" (their respective plid, which is a uri, which works well with the w3c spec). for example, in our case, a prospective invocation might look like: <object classid="@mycompany.com/myapplication,version=5.01" data="myfile.typ" codebase="http://myurl.com/myplugin/myplugin.xpi" type="application/x-myapp"></object> the use of both "type" and "classid" attributes here offers the following user benefit: if there is another mimetype handler for application/x-myapp, only myapplication gets invoked. the resolution of a mimetype handler is no longer arbitrary. if the "data" file myfile.typ doesn't contain enough resource...
Tamarin Tracing Build Documentation - Archive of obsolete content
tracing tamarin-tracing building tamarin building tamarin will create all the libraries for the avmplus and garbage collector (mmgc), and create a standalone executable, avmshell, for executing files in the abc file format. running avmshell without any arguments will list the available options. note that additional command-line arguments are only available in the debug configuration. the tamarin codebase contains a cross-platform build system for mozilla developers. the cross-platform build system is used for daily automated build testing so it is the most reliable system. the tamarin codebase has the ability to build additional code which supports debugging hooks. in the xcode project, this is the debug_debugger and release_debugger configurations. the flash player builds tamarin with the debugg...
Gecko FAQ - Gecko Redirect 1
fully compliant browser." because web pages can be arbitrarily long and complex and have arbitrarily deeply nested markup, it will always be possible to construct web pages that do not display in a given browser the way the specifications would recommend. so long as qa testing and test case development continues, there will always be known bugs at any given point in time in the open-source gecko codebase, and it follows that every commercial product that has ever shipped and ever will ship based on gecko will have known bugs at the time of its release. (the same principle of course applies to other browser engine development projects and products based upon them as well.) known bugs in the open-source gecko codebase are documented in bugzilla. here are some links to lists of reported bugs relate...
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
rns ordering and structure; the instructions must also be meaningful, which is the province of semantics. code must have correct syntax in order to compile correctly, otherwise a syntax error occurs. even small errors, like a missing parenthesis, can stop source code from compiling successfully. frameworks are said to have a "clean" syntax if they produce simple, readable, concise results. if a codebase uses "a lot of syntax", it requires more characters to achieve the same functionality. learn more general knowledge syntax (programming languages) on wikipedia ...
How CSS is structured - Learn web development
previously set values. comments as with any coding work, it is best practice to write comments along with css. this helps you to remember how the code works as you come back later for fixes or enhancement. it also helps others understand the code. css comments begin with /* and end with */. in the example below, comments mark the start of distinct sections of code. this helps to navigate the codebase as it gets larger. with this kind of commenting in place, searching for comments in your code editor becomes a way to efficiently find a section of code. /* handle basic element styling */ /* -------------------------------------------------------------------------------------------- */ body { font: 1em/150% helvetica, arial, sans-serif; padding: 1em; margin: 0 auto; max-width: 33em; } ...
From object to iframe — other embedding technologies - Learn web development
er about it. always use the sandbox attribute you want to give attackers as little power as you can to do bad things on your website, therefore you should give embedded content only the permissions needed for doing its job. of course, this applies to your own content, too. a container for code where it can be used appropriately — or for testing — but can't cause any harm to the rest of the codebase (either accidental or malicious) is called a sandbox. unsandboxed content can do way too much (executing javascript, submitting forms, popup windows, etc.) by default, you should impose all available restrictions by using the sandbox attribute with no parameters, as shown in our previous example. if absolutely required, you can add permissions back one by one (inside the sandbox="" attribute va...
Introduction to client-side frameworks - Learn web development
oading new web pages, so it doesn't know that it should automatically adjust focus or announce a new page title. framework authors have devoted immense time and labor to writing javascript that recreates these features, and even then, no framework has done so perfectly. the upshot is that you should consider accessibility from the very start of every web project, but bear in mind that abstracted codebases that use frameworks are more likely to suffer from major accessibility issues if you don't. how to choose a framework each of the frameworks discussed in this module take different approaches to web application development. each is regularly improving or changing, and each has its pros and cons. choosing the right framework is a team- and project-dependent process, and you should do your own r...
Getting started with React - Learn web development
ilation part of its setup process. you don't have to configure compilation yourself unless you want to. because jsx is a blend of html and javascript, some developers find it intuitive. others say that its blended nature makes it confusing. once you're comfortable with it, however, it will allow you to build user interfaces more quickly and intuitively, and allow others to better understand your codebase at a glance. to read more about jsx, check out the react team's jsx in depth article. setting up your first react app there are many ways to use react, but we're going to use the command-line interface (cli) tool create-react-app, as mentioned earlier, which expedites the process of developing a react application by installing some packages and creating some files for you, handling the tooling...
React resources - Learn web development
dered. for this app, we could have for example written a dedicated form.css file to house the styles of those respective components, then imported the styles into their respective modules like this: import form from './form'; import './form.css' this approach makes it easy to identify and manage the css that belongs to a specific component. however, it also fragments your stylesheet across your codebase, and this fragmentation might not be worthwhile. for larger applications with hundreds of unique views and lots of moving parts, it makes sense to limit the amount of irrelevant code that's sent to your user. you'll likely have app-wide styles and specific component styles that built on top of those. you can read more about component stylesheets in the create-react-app docs. react devtools we ...
Vue resources - Learn web development
tinue your learning. further resources here’s where you should go to learn more about vue: vue docs — the main vue site. contains comprehensive documentation, including examples, cookbooks, and reference material. this is the best place to start learning vue in depth. vue github repo — the vue code itself. this is where you can report issues and/or contribute directly to the vue codebase. studying the vue source code can help you better understand how the framework works, and write better code. vue forum — the official forum for getting help with vue. vue cli docs — documentation for the vue cli. this contains information on customizing and extending the output you are generating via the cli. nuxtjs — nuxtjs is a server-side vue framework, with some architectural opinion...
Strategies for carrying out testing - Learn web development
nd ie for windows (last two versions of each), ios safari for iphone/ipad, android stock browser (last two versions) on phone/tablet, chrome and firefox for android (last two versions) on phone tablet. accessibility passing common tests. b grade: ie 8 and 9 for windows, opera mini. c grade: opera, other niche modern browsers. what are you going to test? when you've got a new addition to your codebase that needs testing, before you start testing you should write out a list of testing requirements that need to pass to be accepted. these requirements can be visual or functional — both combine to make a usable web site feature. consider the following example (see the source code, and also the example running live): test criteria for this feature could be written like so: a and b grade: ...
Git and GitHub - Learn web development
nfrastructure that provides a git server plus a number of really useful tools for working with git repositories individually or in teams, such as reporting issues with the code, reviewing tools, project management features such as assigning tasks and task statuses, and more. note: git is actually a distributed version control system, meaning that a complete copy of the repository containing the codebase is made on your computer (and everyone else's). you make changes to your own copy, and then push those changes back up to the server, where an administrator will decide whether to merge your changes with the master copy. looking to become a front-end web developer? we have put together a course that includes all the essential information you need to work towards your goal. get started ...
Deploying our app - Learn web development
the test fails, the build fails, and netlify won’t deploy. let’s get started. go to your package.json file and open it up. ...
Package management basics - Learn web development
all the things, we're now ready for some "modern client-side development" (which really means using build tools to make the developer experience a little easier). first of all however, take another look at your package.json file. you'll see that npm has added a new field, dependencies: "dependencies": { "parcel-bundler": "^1.12.4" } this is part of the npm magic — if in future you move your codebase to another location, on another machine, you can recreate the same set up by running the command npm install, and npm will look at the dependencies and install them for you. one disadvantage is that parcel is only available inside our parcel-experiment app; you won't be able to run it in a different directory. but the advantages outweigh the disadvantages. setting up our example app anyway, on...
Android-specific test suites
android-checkstyle ensures that the java coding style is consistent throughout. android-findbugs ensures that the code avoids common java coding errors. android-lint ensures that the code avoids common android coding errors. all of these suites require a functioning build of firefox for android — either a full build or an artifact build. all of the suites are configured by and invoked using gradle. android-test runs android-specific local unit tests. ...
Creating JavaScript callbacks in components
ing a word found in the raw string data. here is an example of how to use the callback system: var wordhandler = { onword : function(word) { alert(word); } }; var stringparser = /* get a reference to the parser somehow */ stringparser.addobserver(wordhandler); stringparser.parse("pay no attention to the man behind the curtain"); you can find examples of this pattern all over the mozilla codebase. in fact, there is even a specific interface for this form of push callbacks, nsiobserverservice. javascript functions as callbacks another common use of the pattern is found in addeventlistener / removeeventlistener. a nice feature of addeventlistener is that you can pass a javascript function in place of the callback listener interface. remember (or discover) that addeventlistener is a method o...
Debugging
firefox with vmware workstation how to setup record and replay debugging on firefox, to help debug intermittent mochitest failures. detecting defects in firefox with coverity coverity is a static analysis system that can detect defects in firefox. gecko logging using old-school logging to try to track down what's going on. debugging specific parts of the mozilla codebase debugging opengl if you're working on code that involves opengl calls, and need to debug it, you can turn on a special opengl debugging mode. debugging frame reflow and debugging table reflow notes on debugging issues in gecko's layout engine. miscellaneous debugging safari some tips for debugging safari debugging chrome some tips for...
Configuring Build Options
uild will compile and run correctly. the following build options are very common: optimization ac_add_options --enable-optimize enables the default compiler optimization options note: this is enabled by default ac_add_options --enable-optimize=-o2 chooses particular compiler optimization options. in most cases, this will not give the desired results, unless you know the mozilla codebase very well; note, however, that if you are building with the microsoft compilers, you probably do want this as -o1 will optimize for size, unlike gcc. ac_add_options --enable-debug enables assertions in c++ and javascript, plus other debug-only code. this can significantly slow a build, but it is invaluable when writing patches. people developing patches (especially in c++) should generally use...
Working with Mozilla source code
d the code, but is a great way to search it. navigating the mozilla source code learn about the various folders in the mozilla source tree, and how to find what you're looking for. bugs for newcomers if you are new to the project and want something to work on, look here. interface development guide guidelines and documentation for how to create and update xpcom interfaces. the firefox codebase: css guidelines this document contains guidelines defining how css inside the firefox codebase should be written, it is notably relevant for firefox front-end engineers. svg cleanup guide guidelines and best practices for shipping new svgs. try servers mozilla products build on at least three platforms. if you don't have access to them all, you can use the try servers to test your patches an...
Developer guide
e and binary apis in mozilla. customizing firefox information about creating customized versions of firefox. task-graph generation what controls the jobs that run on a push to version control? how can you change that? obsolete build caveats and tips a place to put build tips which are no longer relevant to building the latest version of the code from main but are relevant when building old codebases. firefox source docs web-hosted documentation built from the mozilla-central source code. tools bugzilla the bugzilla database used to track issues for mozilla projects. dxr next generation of searching mozilla's source code. in active development. searchfox another option for mozilla code searching. indexes js as well as c++, includes blame capabilities. in active development. mo...
Embedding the editor
r, which is capable of saving and restoring state such that it can be transferred between the various subdocuments being edited. that state would have to include the document, undo stack, and typing state. the implementation of the editing session would be responsible for swapping out the editor's state on focus changes etc. more than one editor per window current composer clients in the mozilla codebase all assume that there is only one <editor> tag per window. they all need to be able to deal with multiple editors. fixing this would require js changes of the following kind: standardize the way that clients get at the editorshell (or its replacement, post-embedding work) from the window. ensure that focus changes between editors update the window's notion of the "current" editor. if we cont...
How to implement a custom autocomplete search component
a newer and slightly simplified mechanism that is used in "toolkit" applications such as firefox and xulrunner. ...
PBackground
s a lot of code "just works" in the content process. but some things, such as apis that need to manipulate files or device settings (e.g. geolocation) cannot run in the content process because it has restricted privileges. instead, these apis must ask the chrome process to do something on their behalf via an ipdl protocol. this has lead to a rather awkward pattern seen in some parts of the gecko codebase, looking something like this (try searching for geckoprocesstype_default in dxr): if (xre_getprocesstype() == geckoprocesstype_default) { dothething(arguments); } else { mipdlprotocol->senddothething(arguments); } this can get unwieldy very quickly, so a better solution was needed. pbackground pbackground exists to solve such problems. it connects a designated "background" thread in the c...
PromiseWorker.jsm
or js-ctypes but it is not limited to that. there is no xpcom access, similar to chromeworker. this answers the question "when should i use a promiseworker?", and the answer is, whenever you would normally use a chromeworker, but want postmessage to return promises. the promiseworker object is used to deliver all of the os.file functionality to the main thread. here is the test case from firefox codebase: mozilla dxr :: test_promise.js. promiseworker module consists of two javascript files, promiseworker.jsm and promiseworker.js. promiseworker.jsm path: resource://gre/modules/promiseworker.jsm a javascript code module used by the main thread to create a worker thread and communicate with it. promiseworker.jsm provides basepromiseworker. promiseworker.js path: resource://gre/modules/workers/...
Localization content best practices
statements and references to user input. example: you have chosen a keyword that is currently in use by "%s". please select another. example: search %1$s for "%2$s" non-directional single, and double, quotation marks should be used in reference to html code, or other languages where ascii character usage is required, such as html. html does not prefer one over the other, and our codebase uses them interchangeably as of march 2016. example: this web page at <span id='malware_sitename'/> has been reported as an attack page and has been blocked based on your security preferences. u+2026 (\u2026) is the horizontal ellipsis character. this character should be used in place of three consecutive periods. create localizable strings don't assume grammar structures you need to cons...
Mozilla external string guide
these classes were removed a long time ago. the only remaining string classes are the "internal" ones, which are documented xpcom guide internal strings. ...
Build Metrics
lower is better. static constructors are undesirable because their initialization imposes an unavoidable time penalty every time firefox is started. installer size size in bytes of the firefox installer. lower is better here, especially on space-restricted platforms like android. ...
Leak-hunting strategies and tips
at owns references to reference counted objects). see bug 109671 for an example. destructors that should have been virtual: if you expect to override an object's destructor (which includes giving a derived class of it an nscomptr member variable) and delete that object through a pointer to the base class using delete, its destructor better be virtual. (but we have many virtual destructors in the codebase that don't need to be -- don't do that.) debugging leaks that go through xpconnect many large object graphs that leak go through xpconnect. this can mean there will be xpconnect wrapper objects showing up as owning the leaked objects, but it doesn't mean it's xpconnect's fault (although that has been known to happen, it's rare). debugging leaks that go through xpconnect requires a basic unders...
Profiling with the Firefox Profiler
"running time" column and look for when the time changes. while looking for performance problems, you're looking for the processes that are taking the most time; then you can figure out how to optimize them. common performance bugs in firefox inefficient code that is on the reflow or restyle paths is often to blame for jank. so is code that is run often in the parent process or in parts of the codebase that apply to many users. synchronous re-flow can be caused by js that, for example, makes changes to the page content in a loop and queries about the layout of the page in that same loop. a presshell:flush means that we are either recomputing styles or recomputing layout. these sorts of flushes should be avoided if possible, as they can be quite expensive. keep your eyes out for flushes like t...
TraceMalloc
tracemalloc captures stack traces of all malloc, calloc , realloc, and free calls (this currently covers all operator new and delete calls in mozilla, too). to enable tracemalloc in your build, configure with --enable-trace-malloc. the built mozilla application will support the following additional command-line options: --trace-malloc filename the application will log allocation and deallocation events with stack traces in a binary format to the given file. ...
Performance
restyle is taking so long power profiling power profiling overview this page provides an overview of relevant information, including details about hardware, what can be measured, and recommended approaches. it should be the starting point for anybody new to power profiling. tools/power/rapl (mac, linux) tools/power/rapl is a command-line utility in the mozilla codebase that uses the intel rapl interface to gather direct power estimates for the package, cores, gpu and memory. powermetrics (mac-only) powermetrics is a command-line utility that gathers and displays a wide range of global and per-process measurements, including cpu usage, gpu usage, and various wakeups frequencies. timerfirings logging (all platforms) timerfirings logging is a b...
Emscripten
d, has numerous independent compatible implementations, and runs everywhere from pcs to ipads. with emscripten, c/c++ developers don’t have the high cost of porting code manually to javascript — or having to learn javascript at all. web developers also benefit, as they can use the many thousands of pre-existing native utilities and libraries in their sites. practically any portable c or c++ codebase can be compiled into javascript using emscripten, ranging from high performance games that need to render graphics, play sounds, and load and process files, through to application frameworks like qt. emscripten generates fast code — its default output format is asm.js , a highly optimizable subset of javascript that can execute at close to native speed in many cases. note: sound interesting?
Index
y database password only once. the -j option is available only in netscape signing tool 1.0 and later versions. the -j option cannot be used at the same time as the -z option. if the -c# option is not used with the -j option, the default compression value is 6. note that versions 1.1 and later of netscape signing tool correctly recognizes the codebase attribute, allows paths to be expressed for the class and src attributes instead of filenames only, processes link tags and parses html correctly, and offers clearer error messages. -l lists the certificates in your database. an asterisk appears to the left of the nickname for any certificate that can be used to sign objects w...
NSS tools : signtool
y database password only once. the -j option is available only in netscape signing tool 1.0 and later versions. the -j option cannot be used at the same time as the -z option. if the -c# option is not used with the -j option, the default compression value is 6. note that versions 1.1 and later of netscape signing tool correctly recognizes the codebase attribute, allows paths to be expressed for the class and src attributes instead of filenames only, processes link tags and parses html correctly, and offers clearer error messages. -l lists the certificates in your database. an asterisk appears to the left of the nickname for any certificate that can be used to sign objects w...
Renaming With Pork
these notes are based on tools pork refactoring toolchain [required]. see installing pork. filterdiff from patchutils renaming a class 1. ...
Hacking Tips
m.js/wasm call, so you should find a way to set this breakpoint for the only generated codes you want to look at. run the program. do next in gdb until you reach the definition of the funcptr: // call the per-exported-function trampoline created by generateentry. │ auto funcptr = js_data_to_func_ptr(exportfuncptr, codebase() + func.entryoffset()); │ if (!call_generated_2(funcptr, exportargs.begin(), &tlsdata_)) │ return false; after it's set, x/64i funcptr will show you the trampoline code. there should be a call to an address at some point ; that's what we're targeting. copy ...
Index
lication. 537 tracing jit deprecated, spidermonkey the tracing jit in spidermonkey consists of a generic, low level component called nanojit which is co-maintained between adobe and mozilla, and a spidermonkey-specific high level component called jstracer. the nanojit component is language agnostic, and contains no knowledge about spidermonkey or any other part of the mozilla codebase. the jstracer component consists of a monitor and a recorder. the monitor watches the executing spidermonkey interpreter. when the monitor determines that the interpreter has entered a region of code that would benefit from native compilation, the monitor activates the recorder. the recorder records the activity of the interpreter, using nanojit to build an efficient, native representation of the...
Tracing JIT
this document is talking about deprecated feature. the tracing jit in spidermonkey consists of a generic, low level component called nanojit which is co-maintained between adobe and mozilla, and a spidermonkey-specific high level component called jstracer. the nanojit component is language agnostic, and contains no knowledge about spidermonkey or any other part of the mozilla codebase. the jstracer component consists of a monitor and a recorder. the monitor watches the executing spidermonkey interpreter. when the monitor determines that the interpreter has entered a region of code that would benefit from native compilation, the monitor activates the recorder. the recorder records the activity of the interpreter, using nanojit to build an efficient, native representation of the execution...
Thread Sanitizer
n you will want to set the variable to $llvm_home/build/bin/llvm-symbolizer. ignoring known races in some cases, races can be confirmed to be benign and fixing them would cause possible performance issues. tsan offers two possibilities to ignore such known races. compile-time blacklisting functions with racy memory access can be flagged, such that the compiler will not instrument them. in our codebase, this is done using the moz_tsan_blacklist macro on the function definition. it will expand to the appropriate attributes if the compiler supports them. compile-time blacklisting is the preferred way of blacklisting, because it does not have a performance impact. still, blacklisting should be done very carefully so we won't miss important bugs. runtime suppressions to prevent races from showing...
WebReplayRoadmap
zing one or more recordings to study their behavior in detail. if the debugger could perform this analysis then it could show this information to developers and help them understand the app even when they are not actively debugging a particular recording. static type integration (not yet implemented) static type systems like flow and typescript are great and really useful for managing an app's codebase, but they are unsound by design, and it is pretty easy to satisfy the type system and yet have different types in practice. a recording can be analyzed for the types that appear in practice. these can be compared with the types provided to the type system, and any mismatches can be flagged. the points in the recording where the mismatches occur can be identified, and the debugger can seek to t...
Avoiding leaks in JavaScript XPCOM components
n owns a reference to n as long as j is reachable from a garbage collection root. n has a pointer to j, so the wrapper wrapping j exists as long as n doesn't release the pointer, and creates a garbage collection root that roots j. thus j is always reachable from a garbage collection root, and we have a cycle. i actually can't find an example of this simple leak pattern that occurred in mozilla's codebase. but it certainly could. however, it's easy to inadvertently create this same type of leak when using closures. in javascript, as in many interpreted languages, functions have access to the variables that are in scope where they are created. a closure is a code × environment pair: function objects are not just the code; they're also the environment. since all the variables in that environment a...
An Overview of XPCOM
ded", or not loaded at all, which can improve the performance of your application. maintenance even when you are not updating a component, designing your application in a modular way can make it easier for you to find and maintain the parts of the application that you are interested in. mozilla has over four million lines of code, and no single individual understands the entire codebase. the best way to tackle a project of this size is to divide it into smaller, more manageable pieces, use a component programming model, and to organize related sets of components into modules. the network library, for example, consists of components for each of the protocols, http, ftp, and others, which are bundled together and linked into a single library. this library is the networking module,...
Detailed XPCOM hashtable guide
ropriate entries are getentry and putentry. future plans nsisimpleenumerator support the (obsolete) nshashtable has a wrapper that exposes an nsisimpleenumerator on its items. i will add this support to the various nsbasehashtable classes as well, as needed. hash functions all of the above hashtables need a hash function. this function converts the key into a semi-unique integer. ...
Mozilla internal string guide
introduction the string classes are a library of c++ classes which are used to manage buffers of wide (16-bit) and narrow (8-bit) character strings. the headers and implementation are in the xpcom/string directory. all strings are stored as a single contiguous buffer of characters. ...
XPCOM guide
Mozilla › Tech › XPCOM › Guide
out, dom operations, content javascript, and chrome javascript run on the main thread. however, it may be useful for c++ code in the mozilla platform to run tasks on another thread.mozilla internal string guidemost of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers. this guide documents the string classes which are visible to code within the mozilla codebase (code which is linked into libxul). mozilla::services namespacethe services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.receiving startup notificationssometimes it's necessary for xpcom components to receive notifications ...
Index
Mozilla › Tech › XPCOM › Index
and chrome javascript run on the main thread. however, it may be useful for c++ code in the mozilla platform to run tasks on another thread. 117 mozilla internal string guide guide, xpcom most of the mozilla code uses a c++ class hierarchy to pass string data, rather than using raw pointers. this guide documents the string classes which are visible to code within the mozilla codebase (code which is linked into libxul). 118 receiving startup notifications component manager, embedding mozilla, needsupdate, xpcom sometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example. 119 xpcom stream guide guide, needsconte...
nsIClassInfo
cessed by any thread. main_thread_only 1 << 2 the class may only be accessed by the main application thread. dom_object 1 << 3 the class is a dom object. plugin_object 1 << 4 the class is a plugin object. content_node 1 << 6 specifies that this class implements nsicontent. note: this flag is private and is for use by the mozilla codebase only. reserved 1 << 31 the high order bit is reserved for consumers of these flags. no implementor of this interface should ever return flags with this bit set. eager_classinfo 1 << 5 this flag is designed for use with nsgenericfactory and can be set in nsmodulecomponentinfo::mflags. it has no meaning when returned from the flags attribute of a nsiclassinfo implement...
nsIMsgDBView
w pane of thunderbird and other xpcom based mail cients. inherits from: nsisupports implemented by: @mozilla.org/messenger/msgdbview;1. to create an instance, use: var dbview = components.classes[@mozilla.org/messenger/msgdbview;1?type=] .createinstance(components.interfaces.nsimsgdbview); where type designates different types of view's available. available in the mozilla codebase are types "quicksearch", "threadswithunread", "watchedthreadswithunread", "xfvf" (virtual folders), "search", "group", and "threaded" each with their own implementation of nsimsgdbview that provides a different sorting/view of the data. method overview void open(in nsimsgfolder folder, in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder, in nsmsgviewflagstypevalue ...
XPCOM reference
this reference describes the interfaces and functions provided by the xpcom library. in addition, it details the various helper classes and functions, as well as the components, provided by the xpcom glue library. the contents herein are oriented primarily toward extension developers and people embedding xpcom in other projects. if you're working on a module in the mozilla codebase that's compiled with the mozilla_internal_api flag set, some of these apis -- the string functions and classes in particular -- are not the ones you should be using. see the xpcom internal string guide for documentation of the internal string api used within the mozilla codebase. core xpcom functionsxpcom provides a number of global functions which are used to initialize and shut down the xpcom library,...
XPIDL
on of all javascript values), and objects that are marked nsivariant have their types automatically boxed and unboxed as appropriate. the equivalent representations of all idl types in native code is given in the earlier tables; parameters of type inout follow their out form. native code should pay particular attention to not passing in null values for out parameters (although some parts of the codebase are known to violate this, it is strictly enforced at the js<->native barrier), and also ensuring that boolean types only receive values of 0 (false) or 1 (true). representations of types additionally depend on some of the many types of properties they may have. the array property turns the parameter into an array; the parameter must also have a corresponding size_is property whose argument is t...
The Valgrind Test Job
its a message describing the problem, along with a stack trace indicating where the problem occurs. it also prints a suppression, which is a sequence of text that can be put in a suppression file (and specified via valgrind's --suppressions option) if you want valgrind to ignore such errors in future runs. for example, we have a small number of deliberate but inconsequential memory leaks in the codebase that have corresponding suppressions. but generally errors should be fixed rather than suppressed. when running locally, you may see errors that do not occur on the test machines. errors in system libraries can generally be ignored, because they are out of our control and the kind of thing we suppress on the test machines. errors in mozilla code should probably be reported in bugs! if you ne...
Thunderbird extensions
is extremely powerful and is used heavily by add-ons such as thunderbird conversations. learn more about gloda: an overview of gloda how to create your first message query and read the gloda examples gloda internals: gloda debugging, gloda indexing more thunderbird-specific links some links may be out of date, but they still provide valuable information on the codebase. an overview of thunderbird components developer reference docs: folder classes db views (message list) message summary database mailnews protocols mailnews filters error reporting tools steel library (obsolete as of thunderbird 52, use https://github.com/protz/thunderbird-stdlib) developing new account types ...
Library
ovided if the api is an exported data symbol rather than a function. return value a functiontype cdata object representing the declared api. exceptions thrown ctypes ctype functiontype abi typeerror the return type was specified as an array. alternative syntax another use for ctypes.declare is to get non-function/non-methods from libraries. the syntax for this is seen in firefox codebase here: //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 this shows that we can also supply only two arguments to the declare function. the first being the same as in the above example, name, which is the name of the symbol to export. and in place of the abi argument, we will pass in the type of this export. for example, from the objective-c library we can export ...
Use watchpoints - Firefox Developer Tools
in the firefox debugger, this information can be provided by watchpoints. by setting a watchpoint on the property, rather than a breakpoint at a particular line, you can discover where that access occurs. there are three types of watchpoints: get, set, and get or set. ...
Deprecated tools - Firefox Developer Tools
panels have been removed, you still have access to the old code, and there are alternative webextensions that you can try to get similar functionality. when we deprecate a panel, we begin by getting feedback from the community to determine the impact of removing that panel. once we have decided to remove the panel, we will provide a warning message, and finally, we will remove the panel from the codebase. you may see a warning message, as in the following image, when trying to activate a deprecated panel: in addition, if you open the panel for one of these tools, you will also see a warning message about its removal. scratchpad scratchpad is deprecated as of firefox 70 (bug 1565380), and will be removed as of firefox 72 (bug 1519103). description scratchpad provided an environment for e...
Index - Firefox Developer Tools
buttons in the toolbar: 132 use a source map the javascript sources executed by the browser are often transformed in some way from the original sources created by a developer. for example: 133 use watchpoints firefox, guide, tools when debugging javascript code, it can be useful to know when properties on objects are read or modified. in a large, complex codebase, it's not always easy to know where in the code a given property is accessed. in the firefox debugger, this information can be provided by watchpoints. by setting a watchpoint on the property, rather than a breakpoint at a particular line, you can discover where that access occurs. 134 set a logpoint debugger, debugging, dev tools, javascript debugging, tools, breakpoint, logpoint ...
BatteryManager - Web APIs
vent; this event is sent when the battery level is updated. methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget. eventtarget.removeeventlistener() removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) specifications specification status comment battery status api candidate recommendation initial definition ...
EventTarget - Web APIs
ts: all;} constructor eventtarget() creates a new eventtarget object instance. methods eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget. eventtarget.removeeventlistener() removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example simple implementation of eventtarget var eventtarget = function() { this.listeners = {}; }; eventtarget.prototype.listeners = null;...
Screen - Web APIs
Web › API › Screen
orientation (only works in fullscreen or for installed apps) methods inherited from eventtarget: eventtarget.addeventlistener() registers an event handler of a specific event type on the eventtarget. eventtarget.removeeventlistener() removes an event listener from the eventtarget. eventtarget.dispatchevent() dispatches an event to this eventtarget. additional methods in mozilla chrome codebase mozilla includes a couple of extensions for use by js-implemented event targets to implement onevent properties. see also webidl bindings. void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification sp...
HTML attribute reference - HTML: Hypertext Markup Language
input> indicates whether the element should be checked on page load. cite <blockquote>, <del>, <ins>, <q> contains a uri which points to the source of the quote or change. class global attribute often used with css to style elements with common properties. code <applet> specifies the url of the applet's class file to be loaded and executed. codebase <applet> this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. color <basefont>, <font>, <hr> this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb format. note: this is a legacy attribute. please use the css color proper...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
Web › HTML › Element › applet
lso be rendered as alternative text. archive this attribute refers to an archived or compressed version of the applet and its associated class files, which might help reduce download time. code this attribute specifies the url of the applet's class file to be loaded and executed. applet filenames are identified by a .class filename extension. the url specified by code might be relative to the codebase attribute. codebase this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. datafld this attribute, supported by internet explorer 4 and higher, specifies the column name from the data source object that supplies the bound data. this attribute might be used to specify the various <param> elements passed to the...
<object> - HTML: Hypertext Markup Language
Web › HTML › Element › object
ludes the global attributes. archivehtml 4 onlyobsolete since html5 a space-separated list of uris for archives of resources for the object. borderdeprecated since html4.01obsolete since html5 the width of a border around the control, in pixels. classidhtml 4 onlyobsolete since html5 the uri of the object's implementation. it can be used together with, or in place of, the data attribute. codebasehtml 4 onlyobsolete since html5 the base path used to resolve relative uris specified by classid, data, or archive. if not specified, the default is the base uri of the current document. codetypehtml 4 onlyobsolete since html5 the content type of the data specified by classid. data the address of the resource as a valid url. at least one of data and type must be defined. declarehtml 4 onlyob...
Feature Policy - HTTP
ut controls features instead of security behavior. the feature-policy header has now been renamed to permissions-policy in the spec, and this article will eventually be updated to reflect that change. in a nutshell feature policy provides a mechanism to explicitly declare what functionality is used (or not used), throughout your website. this allows you to lock in best practices, even as the codebase evolves over time — as well as to more safely compose third-party content — by limiting which features are available. with feature policy, you opt-in to a set of "policies" for the browser to enforce on specific features used throughout a website. these policies restrict what apis the site can access or modify the browser's default behavior for certain features. examples of what you can do ...
CSP: trusted-types - HTTP
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings. this allows authors to define rules guarding writing values to the dom and thus reducing the dom xss attack surface to small, isolated parts of the web application codebase, facilitating their monitoring and code review. this directive declares a white-list of trusted type policy names created with trustedtypes.createpolicy from trusted types api. syntax content-security-policy: trusted-types; content-security-policy: trusted-types <policyname>; content-security-policy: trusted-types <policyname> <policyname> 'allow-duplicates'; <domstring> any string can be a truste...
HTTP Index - HTTP
Web › HTTP › Index
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings. this allows authors to define rules guarding writing values to the dom and thus reducing the dom xss attack surface to small, isolated parts of the web application codebase, facilitating their monitoring and code review. this directive declares a white-list of trusted type policy names created with trustedtypes.createpolicy from trusted types api. 105 csp: upgrade-insecure-requests csp, content-security-policy, directive, http, reference, requests, security, upgrade, upgrade-insecure-requests the http content-security-policy (csp) upgrade-insecu...
Symbol - JavaScript
mple, new boolean, new string and new number). if you really want to create a symbol wrapper object, you can use the object() function: let sym = symbol('foo') typeof sym // "symbol" let symobj = object(sym) typeof symobj // "object" shared symbols in the global symbol registry the above syntax using the symbol() function will not create a global symbol that is available in your whole codebase. to create symbols available across files and even across realms (each of which has its own global scope), use the methods symbol.for() and symbol.keyfor() to set and retrieve symbols from the global symbol registry. finding symbol properties on objects the method object.getownpropertysymbols() returns an array of symbols and lets you find symbol properties on a given object. note that every ob...
Optimizing startup performance - Web Performance
wnloaded and executed before continuing. if you need to decode asset files (for example, decoding jpeg files and turning them into raw texture data for later use by webgl), that's great to do in workers. when dealing with data supported by the browser (for example, decoding image data), use the decoders built into the browser or device rather than rolling your own or using one from the original codebase. the provided one is almost certainly significantly faster, and will reduce your app size to boot. in addition, the browser may automatically parallelize these decoders. any data processing that can be done in parallel should be. don't do one chunk of data after another; do them all at once when possible! don't include scripts or stylesheets that don't participate in the critical path in your s...